IFClite TypeScript API
    Preparing search index...

    Interface CollabSession

    interface CollabSession {
        clientId: number;
        conflicts: ConflictDetector;
        doc: Doc;
        presence: Presence;
        provider: ProviderKind;
        roomId: string;
        undoController: UndoController;
        whenSynced: Promise<void>;
        captureBaseline(): Uint8Array;
        captureDocState(): Uint8Array;
        dispose(): void;
        extractUserLayer(
            baseline: Uint8Array,
            clientId?: number,
            snapshot?: SnapshotOptions,
        ): IfcxFile;
        onConflict(listener: ConflictListener): () => void;
        onStatus(
            listener: (s: WebSocketStatus | "memory" | "indexeddb") => void,
        ): () => void;
        redo(): boolean;
        seed(input: IfcxInput, options?: SeedOptions): IfcxFile;
        snapshot(options?: SnapshotOptions): IfcxFile;
        status(): WebSocketStatus | "memory" | "indexeddb";
        transact<T>(fn: () => T): T;
        undo(): boolean;
    }
    Index
    clientId: number
    conflicts: ConflictDetector
    doc: Doc
    presence: Presence
    provider: ProviderKind
    roomId: string
    undoController: UndoController
    whenSynced: Promise<void>

    Resolves once both persistence and (if applicable) websocket sync have completed.

    • Capture a baseline state vector for later layer extraction.

      Returns Uint8Array

    • Capture the doc's FULL state (Y.encodeStateAsUpdate) as the fork point for whole-doc publishing (publishLayer's baseline). Distinct from captureBaseline, which returns a state VECTOR for the per-user extractUserLayer path.

      Returns Uint8Array

    • Returns void

    • Extract a per-user layer (defaults to this peer).

      Parameters

      • baseline: Uint8Array
      • OptionalclientId: number
      • Optionalsnapshot: SnapshotOptions

      Returns IfcxFile

    • Parameters

      Returns () => void

    • Returns boolean

    • Wrap edits in a Yjs transaction tagged with our local origin.

      Type Parameters

      • T

      Parameters

      • fn: () => T

      Returns T

    • Local-origin undo via Y.UndoManager.

      Returns boolean