Local changes API for the vec JSON CRDT node VecNode.

Type Parameters

Hierarchy (view full)

Constructors

Properties

api: ModelApi<any>
node: N

Accessors

  • get events(): NodeEvents<N>
  • Event target for listening to node changes. You can subscribe to "view" events, which are triggered every time the node's view changes.

    node.events.on('view', () => {
    // do something...
    });

    Returns NodeEvents<N>

Methods

  • Returns the API object of the extension if the node is an extension node. When the ext parameter is provided, it checks if the node is an instance of the given extension and returns the object's TypeScript type. Otherwise, it returns the API object of the extension, but without any type checking.

    Returns undefined | ExtApi<any> | JsonNodeApi<VecNodeExtensionData<N>>

    API of the extension

  • Type Parameters

    • EN extends ExtNode<any, any>
    • EApi extends ExtApi<EN>

    Parameters

    • ext: Extension<any, any, EN, EApi, any, any>

    Returns EApi

  • Get API instance of a child node.

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • key: K

      Object key to get.

    Returns JsonNodeApi<UnVecNode<N>[K]>

    A specified child node API.

  • Sets a list of elements to the given values.

    Parameters

    • entries: [index: number, value: unknown][]

      List of index-value pairs to set.

    Returns void

    Reference to itself.