Skip to content

Session

A caller-driven clock keeps networking and liveness outside synchronous document edits.

E extends EditEnvelope

new Session<E>(options): Session<E>

SessionOptions<E>

Session<E>

readonly archives: object[]

readonly branch: Branch

readonly history: readonly Confirmation<E>[]


readonly members: Set<string>


readonly pending: Map<string, E>

get branch(): Branch

Branch


get host(): string | undefined

string | undefined


get isHost(): boolean

boolean


get peer(): string

string


get presenceTime(): number

number


get status(): "waiting" | "collecting" | "stable" | "handoff" | "left" | "activating"

"waiting" | "collecting" | "stable" | "handoff" | "left" | "activating"

connect(peer): void

string

void


disconnect(peer): void

string

void


leave(successor?): void

string

void


receive(message): boolean

Message<E>

boolean


retire(peer): void

string

void


sendPresence(payload): void

PresenceMessage

void


submit(edit): void

E

void


subscribePresence(observer): () => void

PresenceObserver

() => void


subscribePresenceClock(listener): () => void

(now) => void

() => void


tick(now): void

number

void