@twinfinity/core
    Preparing search index...

    Class MarkupSheet2DCollection

    Collection of all the MarkupSheet2D instances that have been created locally and loaded via the markup API.

    Index

    Properties

    Accessors

    • get conflictCount(): number

      Number of objects with conflicts in the layer. A conflict occurs if there is a mismatch between the local and the remote representation of the layer. Conflicts can only occur when Layer.saveAndMerge or Layer.loadAndMerge is called.

      Returns number

    • get version(): number

      Get the version of the currently loaded layer. [-1] if no layer has yet been loaded.

      Returns number

    Methods

    • Creates a new markup sheet and adds it to the layer api.

      Parameters

      • id: string

        The id for the new sheet (has to be unique).

      • Optionalproperties: Map<string, MarkupProperty>

        Properties for the sheet.

      Returns MarkupSheet2D

      The new markup sheet.

    • Clear the layer.

      Returns void

    • Loads all existing (remote) objects from the backend and attempts to merge them into objects. This may result in conflicts between the local and the remote objects. A typical example is if the same object has been modified locally but also remotely (in the backend.)

      Returns Promise<number | LayerFailure>

    • Save the sheets using the layer api.

      Parameters

      • overwrite: boolean = false

        If true then the last version will be overwritten.

      Returns Promise<number | LayerFailure>

      Number of conflicts, if > 0 then save was not successfull.

    • Parameters

      • states: MergableObjectState[] = []

        Array of states used to filter out sheets, default is [MergableObjectState.Added, MergableObjectState.Modified, MergableObjectState.Unchanged].

      Returns IterableIterator<MarkupSheet2D>

      // Loops all modified sheets in this collection.
      for(const modifiedSheets of collection.sheets([MergableObjectState.Modified])) {
      ...
      }