typograph-editor-documentation
    Preparing search index...

    Class Collaboration

    Index
    • The storage refused a save (412): the template was saved outside the room since the version the room holds — through the API, by an agent, or by a window that does not edit together. Pass that newer document (a string or parsed; a document or a bundle, as open_document() takes) and its version. What it changed goes into the room for everyone, what the room changed and it did not stays, and where both changed one element the file wins (TYP-1140). Resolves true once the merge is on this window's canvas too, which a drag in progress holds back until it ends: then save again with If-Match on room_version(), which is version now. False when this window cannot merge — it does not edit together, or the document has no spreads — and the host should not overwrite the newer file.

      Parameters

      • document: string | object
      • version: string

      Returns Promise<boolean>

    • Milliseconds from someone's pointer moving to it being drawn here, newest last.

      Measured with the sender's clock, so it is only meaningful between two windows on one machine: that is how the WBSO latency figure is taken (TYP-918).

      Returns number[]

    • Loading the latest version failed (editing().catch_up_failed): try again. Does nothing otherwise, or when the window no longer holds the pen.

      Returns void

    • The saved version of the template the room holds (TYP-1140): the one the first window seeded it from, then each version its writer saved. A host that saves for everyone sends it as If-Match, so the storage refuses the save when the template changed outside the room since. null outside a room editing together, or when no host passed a version.

      Returns string

    • The host saved this window's document as version. A window that edits together records it in the room as the version it holds, writer or not: the writer can change while a save is in flight (a moment offline, a window joining with a lower client id), and the save still landed. Saved with If-Match on room_version(), saves reach storage one after the other, and each next one has heard the version of the one before. A window outside such a room keeps it for the room it seeds next.

      document: what was saved, as a string or parsed. The room keeps how the saved version has each element, to tell later what a file saved outside it changed (conflict()). Without it the room takes its own state for what was saved, which counts an edit made while the save was in flight as saved.

      Parameters

      • version: string
      • Optionaldocument: string | object

      Returns void

    • Take the pen from the user's own other window: it saves (collaboration_options.release) and hands it over, and this window loads the version it saved before editing starts. Only for the same person — someone else's pen is theirs until they are done. Resolves true once the pen is this window's, which may still be catching up (editing().catching_up), false when there was nothing to take or the other window did not let go.

      Returns Promise<boolean>