Skip to main content

driftdb

Classes

Interfaces

Type Aliases

ConnectionStatus

Ƭ ConnectionStatus: { connected: false } | { connected: true ; debugUrl: string }

Defined in

js-pkg/packages/driftdb/src/types.ts:56


DataChannelMsg

Ƭ DataChannelMsg: Object

Type declaration

NameType
lastSeennumber
senderstring
valueany

Defined in

js-pkg/packages/driftdb/src/webrtc.ts:4


DbConnectionParams

Ƭ DbConnectionParams: Object

Type declaration

NameType
websocketConstructor?typeof WebSocket

Defined in

js-pkg/packages/driftdb/src/index.ts:22


Key

Ƭ Key: string

Defined in

js-pkg/packages/driftdb/src/types.ts:1


MessageFromDb

Ƭ MessageFromDb: { key: Key ; seq: SequenceNumber ; type: "push" ; value: unknown } | { data: SequenceValue[] ; key: Key ; type: "init" } | { message: string ; type: "error" } | { key: Key ; size: number ; type: "stream_size" } | { nonce?: number ; type: "pong" }

Defined in

js-pkg/packages/driftdb/src/types.ts:13


MessageToDb

Ƭ MessageToDb: { action: Action ; key: Key ; type: "push" ; value: unknown } | { key: Key ; seq?: SequenceNumber ; type: "get" } | { nonce?: number ; type: "ping" }

Defined in

js-pkg/packages/driftdb/src/types.ts:39


WrappedPresenceMessage

Ƭ WrappedPresenceMessage<T>: Object

Type parameters

Name
T

Type declaration

NameType
lastSeennumber
valueT

Defined in

js-pkg/packages/driftdb/src/presence.ts:9

Functions

uniqueClientId

uniqueClientId(): string

Generate a random client ID for the current client.

The client ID is stored in session storage so that it is the same across page reloads.

Returns

string

A random client ID that is stored in session storage.

Defined in

js-pkg/packages/driftdb/src/index.ts:283