Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IServerAdapter

An interface for a bridge between a datastore and a patch server. Patch servers should expose an interface like this one, which mediates outgoing patches from a given store, and delivers incoming patches to a store.

Hierarchy

  • IDisposable
    • IServerAdapter

Index

Properties

isDisposed

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

onRedo

onRedo: function | null

A callback to be invoked when an redo message is received by the server adapter.

onRemoteTransaction

onRemoteTransaction: function | null

A callback to be invoked when a remote transaction is received by the server adapter.

onUndo

onUndo: function | null

A callback to be invoked when an undo message is received by the server adapter.

Methods

broadcast

  • Broadcast a transaction from a datastore to collaborators.

    Parameters

    • transaction: Transaction

      the transaction to broadcast to collaborators.

      Notes

      This is expected to be called by a datastore, and not by any other user. Direct invocations of this function may have unexpected results.

    Returns void

dispose

  • dispose(): 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

redo

  • redo(id: string): Promise<void>

undo

  • undo(id: string): Promise<void>
  • Undo a transaction by id. This sends an undo message to the patch server, but the undo is not actually done until the datastore recieves the corresponding transaction and applies it.

    Parameters

    • id: string

    Returns Promise<void>

Generated using TypeDoc