engine/model/operation/utils

Api-module icon module

Type Definitions

Functions

  • Chevron-right icon

    _insert( position, nodes ) → ModelRange
    internal

    Inserts given nodes at given position.

    Parameters

    position : ModelPosition

    Position at which nodes should be inserted.

    nodes : ModelNodeSet

    Nodes to insert.

    Returns

    ModelRange

    Range spanning over inserted elements.

  • Chevron-right icon

    _move( this, sourceRange, targetPosition ) → ModelRange
    internal

    Moves nodes in given range to given target position. Only flat ranges are accepted.

    Parameters

    this : any
    sourceRange : ModelRange

    Range containing nodes to move.

    targetPosition : ModelPosition

    Position to which nodes should be moved.

    Returns

    ModelRange

    Range containing moved nodes.

  • Chevron-right icon

    _normalizeNodes( nodes ) → Array<ModelNode>
    internal

    Normalizes given object or an array of objects to an array of nodes. See NodeSet for details on how normalization is performed.

    Parameters

    nodes : ModelNodeSet

    Objects to normalize.

    Returns

    Array<ModelNode>

    Normalized nodes.

  • Chevron-right icon

    _remove( this, range ) → Array<ModelNode>
    internal

    Removed nodes in given range. Only flat ranges are accepted.

    Parameters

    this : any
    range : ModelRange

    Range containing nodes to remove.

    Returns

    Array<ModelNode>
  • Chevron-right icon

    _setAttribute( range, key, value ) → void
    internal

    Sets given attribute on nodes in given range. The attributes are only set on top-level nodes of the range, not on its children.

    Parameters

    range : ModelRange

    Range containing nodes that should have the attribute set. Must be a flat range.

    key : string

    Key of attribute to set.

    value : unknown

    Attribute value.

    Returns

    void