CollabReferenceCollab clientClasses

CollabClient

Class: CollabClient

Defined in: packages/collab-client/src/index.ts:65

The client that manages sending local editor state changes to the remote server and merging remote changes into local editor state.

Constructors

Constructor

new CollabClient(config: CollabClientConfig): CollabClient;

Defined in: packages/collab-client/src/index.ts:72

Parameters

config

CollabClientConfig

Returns

CollabClient

Methods

listen()

listen(editorState: EditorState, signal?: AbortSignal): Promise<void>;

Defined in: packages/collab-client/src/index.ts:112

Start listening for remote commits. This function should only be called once.

Parameters

editorState

EditorState

signal?

AbortSignal

Returns

Promise<void>


send()

send(editorState: EditorState): Promise<void>;

Defined in: packages/collab-client/src/index.ts:81

Send local editor state changes to the remote server.

Parameters

editorState

EditorState

Returns

Promise<void>


update()

update(config: Partial<Omit<CollabClientConfig, "listener">>): void;

Defined in: packages/collab-client/src/index.ts:104

Updates the desired portion of the client's CollabClientConfig. For example, this can be used to update the auth headers used by sendCommit.

Parameters

config

Partial<Omit<CollabClientConfig, "listener">>

Returns

void

On this page