typograph-editor-documentation
    Preparing search index...

    Interface collaboration_options

    Working in one template together (TYP-918): everyone in it sees the others' pointers and selections. Off unless a host passes collaboration to the Editor.

    The connection is the editor's; canvas only draws what it is given (set_remote_presence) and says where the local pointer is (spread_point_at). Without edit_together nobody's edits travel: one window holds the pen, and nothing here touches the document. With it, every window that may edit edits and its changes reach the others through ElementSync (TYP-919).

    interface collaboration_options {
        catch_up?: () => Promise<void>;
        document_id: string;
        edit_together?: boolean;
        release?: () => Promise<boolean>;
        token: (document_id: string) => Promise<string>;
        url: string;
        version?: string;
    }
    Index
    catch_up?: () => Promise<void>

    Load the latest saved document. Called when this window gets the pen after someone else held it: what is on screen here is the version from before their edits, and editing it would overwrite them. Editing stays withheld until it settles.

    document_id: string

    The room: the template's id.

    edit_together?: boolean

    Edit together (TYP-919): every window that may edit edits at once, and each edit reaches the others within a moment. Without it one window holds the pen at a time, and a window on the pen in the same room holds the ones editing together until it is put down. One window saves for everyone — editing.writer — so a host autosaves only there.

    release?: () => Promise<boolean>

    Save before this window gives the pen to the user's own other window (take_over() there). Resolve false — the save failed — and this window keeps it. Without it the pen is handed over at once, so a host that saves at all should pass it.

    token: (document_id: string) => Promise<string>

    A fresh collab token for document_id, from the host's backend (file-service issues it). Called on every connect and reconnect: a token lives two minutes, so never cache one.

    url: string

    The collab-service endpoint, e.g. wss://collab.typograph.nl/collab.

    version?: string

    The saved version of the template this window loaded — the storage's ETag — so that the room knows which version it holds (TYP-1140). Without it the room records none, and room_version() stays null.