Skip to content

Documentation / @super-line/client / ClientPluginContext

Interface: ClientPluginContext

Defined in: index.ts:322

What a client plugin's setup receives (ADR-0024) — the client's own view of itself, for observers that need current state rather than the stream of changes to it.

Deliberately read-only and deliberately incomplete: there is no request start time here, because a reader holding the tap stream already has the timestamp of the outbound frame and can join the two. Adding one would be the client keeping state solely so an observer could read it back.

Properties

clientId

readonly clientId: string

Defined in: index.ts:324

Stable for this client instance. A page runs several — a session replacement runs two at once.


role

readonly role: string

Defined in: index.ts:326

The role this client connected as.

Methods

getCollectionSubs()

getCollectionSubs(): CollectionSubView[]

Defined in: index.ts:332

Live collection subscriptions, with the rows each is currently holding.

Returns

CollectionSubView[]


getDocSnapshot()

getDocSnapshot(n, id): unknown

Defined in: index.ts:339

The current plaintext snapshot of one open CRDT document, or undefined if it is not open here. The wire carries only opaque deltas, so this is the only way to see document contents.

Parameters

n

string

id

string

Returns

unknown


getOpenDocs()

getOpenDocs(): OpenDocView[]

Defined in: index.ts:334

Open CRDT documents.

Returns

OpenDocView[]


getPending()

getPending(): PendingRequestView[]

Defined in: index.ts:328

Requests awaiting a response, including those queued behind an unwritable socket.

Returns

PendingRequestView[]


getTopics()

getTopics(): TopicSubView[]

Defined in: index.ts:330

Live topic subscriptions.

Returns

TopicSubView[]

Released under the MIT License.