Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IModelDB

An interface for a path based database for creating and storing values, which is agnostic to the particular type of store in the backend.

Hierarchy

  • IDisposable
    • IModelDB

Implemented by

Index

Properties

Readonly basePath

basePath: string

The base path for the IModelDB. This is prepended to all the paths that are passed in to the member functions of the object.

Optional Readonly collaborators

collaborators: ICollaboratorMap

A map of the currently active collaborators for the database, including the local user.

Readonly connected

connected: Promise<void>

A promise that resolves when the database has connected to its backend, if any.

Readonly isCollaborative

isCollaborative: boolean

Whether the database is collaborative.

Readonly isDisposed

isDisposed: boolean

Whether the database has been disposed.

Readonly isPrepopulated

isPrepopulated: boolean

Whether the database has been populated with model values prior to connection.

Methods

createList

  • Create an undoable list and insert it in the database.

    Type parameters

    • T: JSONValue

    Parameters

    • path: string

    Returns IObservableUndoableList<T>

    the list that was created.

    Notes

    The list can only store objects that are simple JSON Objects and primitives.

createMap

  • Create a map and insert it in the database.

    Parameters

    • path: string

    Returns IObservableJSON

    the map that was created.

    Notes

    The map can only store objects that are simple JSON Objects and primitives.

createString

  • Create a string and insert it in the database.

    Parameters

    • path: string

    Returns IObservableString

    the string that was created.

createValue

  • Create an opaque value and insert it in the database.

    Parameters

    • path: string

    Returns IObservableValue

    the value that was created.

dispose

  • dispose(): void
  • Dispose of the resources held by the database.

    Returns void

get

  • Get a value for a path.

    Parameters

    • path: string

    Returns IObservable

    an IObservable.

getValue

  • getValue(path: string): JSONValue
  • Get a value at a path, or undefined if it has not been set That value must already have been created using createValue`.

    Parameters

    • path: string

    Returns JSONValue

has

  • has(path: string): boolean
  • Whether the IModelDB has an object at this path.

    Parameters

    • path: string

    Returns boolean

    a boolean for whether an object is at path.

setValue

  • setValue(path: string, value: JSONValue): void
  • Set a value at a path. That value must already have been created using createValue.

    Parameters

    • path: string
    • value: JSONValue

    Returns void

view

  • Create a view onto a subtree of the model database.

    Parameters

    • basePath: string

    Returns IModelDB

    an IModelDB with a view onto the original IModelDB, with basePath prepended to all paths.

Generated using TypeDoc