Interface ISharedDocument

Implement an API for Context information on the shared information. This is used by, for example, docregistry to share the file-path of the edited content.

Hierarchy

Implemented by

Properties

awareness: Awareness

Document awareness

The changed signal.

disposed: ISignal<ISharedDocument, void>

A signal emitted when the object is disposed.

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

state: JSONObject

Document state

version: string

Document version

Methods

  • Whether the object can undo changes.

    Returns boolean

  • Whether the object can redo changes.

    Returns boolean

  • Clear the change stack.

    Returns void

  • Dispose of the resources held by the object.

    Notes

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Undefined Behavior

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void

  • Get the value for a state attribute

    Parameters

    • key: string

      Key to get

    Returns undefined | JSONValue

  • Redo an operation.

    Returns void

  • Set the value of a state attribute

    Parameters

    • key: string

      Key to set

    • value: JSONValue

      New attribute value

    Returns void

  • Perform a transaction. While the function f is called, all changes to the shared document are bundled into a single event.

    Parameters

    • f: (() => void)

      Transaction to execute

        • (): void
        • Returns void

    • Optional undoable: boolean

      Whether to track the change in the action history or not (default true)

    • Optional origin: any

    Returns void

  • Undo an operation.

    Returns void

Generated using TypeDoc