Documentation / @super-line/client / SuperLineClientPlugin
Interface: SuperLineClientPlugin
Defined in: index.ts:347
The client half of a server/client plugin pair, registered on plugins: [...]. All fields optional. Mirrors the server half but smaller — no handler subtraction (client implement is already optional per-key).
Properties
implement?
optionalimplement?:Record<string, (input) =>unknown>
Defined in: index.ts:373
Handlers answering the library's server→client requests; a key collision (with the app or another plugin) throws.
name
name:
string
Defined in: index.ts:349
Unique among the client's plugins; a duplicate name throws at construction.
onClientSideEvent?
optionalonClientSideEvent?: (event) =>void
Defined in: index.ts:366
Client-side tap (ADR-0024), fired synchronously at each emit site with LIVE payload references — an observer must not mutate them, and must snapshot anything it keeps. Zero cost when no plugin taps; a throwing tap is isolated and routed to onError as kind: 'tap', never failing the operation it observed.
Named apart from the server plugin's onEvent on purpose: that hook carries TapEvent (the server's vocabulary — connId, role, target, nodeId), this one carries ClientTapEvent. A pair's two halves look symmetric here and are not.
Parameters
event
Returns
void
onConnect?
optionalonConnect?: () =>void
Defined in: index.ts:351
Called on the first successful connect (multiplexed after the client's onConnect).
Returns
void
onDisconnect?
optionalonDisconnect?: (code) =>void
Defined in: index.ts:353
Called when the socket drops, with the close code (multiplexed after onDisconnect).
Parameters
code
number
Returns
void
onReconnect?
optionalonReconnect?: () =>void
Defined in: index.ts:355
Called on each successful reconnect after the first (multiplexed after onReconnect).
Returns
void
setup?
optionalsetup?: (ctx) =>void| (() =>void)
Defined in: index.ts:371
Imperative escape hatch, run once at construction with the plugin's ClientPluginContext. Return an optional dispose function, called on client.close(). Mirrors the server plugin's setup.
Parameters
ctx
Returns
void | (() => void)