Skip to main content
Version: v1

StablePlaceInternal Interface

A location in a trait. This is NOT the location of a node, but a location where a node could be inserted: it is next to a sibling or at one end of the trait.

To be well formed, either sibling or trait must be defined, but not both.

Any given insertion location can be described by two StablePlace objects, one with Side.After and one with Side.Before. For example, in a trait containing two strings "foo" and "bar", there are 6 different StablePlaces corresponding to 3 locations in the trait a new node could be inserted: at the start, before "foo", after "foo", before "bar", after "bar", and at the end. Neither of the two ways to specify the same location are considered to be after each other.

The anchor (referenceSibling or referenceTrait) used for a particular StablePlace can have an impact in collaborative scenarios.

StablePlace objects can be conveniently constructed with the helper methods exported on a constant of the same name.

Signature

export interface StablePlaceInternal extends Omit<StablePlaceInternal_0_0_2, 'referenceSibling' | 'referenceTrait'>

Extends: Omit<StablePlaceInternal_0_0_2

Properties

Property Modifiers Type Description
referenceSibling optional NodeId The sibling to which this 'StablePlace' is anchored (by 'side'). If specified, referenceTrait must be unspecified.
referenceTrait optional TraitLocationInternal The trait to which this 'StablePlace' is anchored (by 'side'). If specified, referenceSibling must be unspecified.

Property Details

referenceSibling

The sibling to which this 'StablePlace' is anchored (by 'side'). If specified, referenceTrait must be unspecified.

Signature

readonly referenceSibling?: NodeId;

Type: NodeId

referenceTrait

The trait to which this 'StablePlace' is anchored (by 'side'). If specified, referenceSibling must be unspecified.

Signature

readonly referenceTrait?: TraitLocationInternal;

Type: TraitLocationInternal