Skip to main content
Version: v1

ConstraintInternal Interface

A set of constraints on the validity of an Edit. A Constraint is used to detect when an Edit, due to other concurrent edits, may have unintended effects or merge in non-semantic ways. It is processed in order like any other Change in an Edit. It can cause an edit to fail if the various constraints are not met at the time of evaluation (ex: the parentNode has changed due to concurrent editing). Does not modify the document.

Signature

export interface ConstraintInternal extends Omit<ConstraintInternal_0_0_2, 'toConstrain' | 'parentNode'>

Extends: Omit<ConstraintInternal_0_0_2

Properties

Property Modifiers Type Description
parentNode optional NodeId Require that parent under which toConstrain is located has this identifier.
toConstrain StableRangeInternal

Selects a sequence of nodes which will be checked against the constraints specified by the optional fields. If toConstrain is invalid, it will be treated like a constraint being unmet. Depending on effect this may or may not make the Edit invalid.

When a constraint is not met, the effects is specified by effect.

Property Details

parentNode

Require that parent under which toConstrain is located has this identifier.

Signature

readonly parentNode?: NodeId;

Type: NodeId

toConstrain

Selects a sequence of nodes which will be checked against the constraints specified by the optional fields. If toConstrain is invalid, it will be treated like a constraint being unmet. Depending on effect this may or may not make the Edit invalid.

When a constraint is not met, the effects is specified by effect.

Signature

readonly toConstrain: StableRangeInternal;

Type: StableRangeInternal