@umbraco-cms/backoffice
    Preparing search index...

    Type Alias Utils

    type Utils = {
        createMappablePosition: (position: number) => MappablePosition;
        getUpdatedPosition: (
            position: MappablePosition,
            transaction: Transaction,
        ) => GetUpdatedPositionResult;
    }
    Index

    Properties

    createMappablePosition: (position: number) => MappablePosition

    Creates a MappablePosition from a position number. A mappable position can be used to track the next position after applying a transaction.

    Type Declaration

      • (position: number): MappablePosition
      • Parameters

        • position: number

          The position (as a number) where the MappablePosition will be created.

        Returns MappablePosition

        A new MappablePosition instance at the given position.

    const position = editor.utils.createMappablePosition(10)
    
    getUpdatedPosition: (
        position: MappablePosition,
        transaction: Transaction,
    ) => GetUpdatedPositionResult

    Returns the new position after applying a transaction.

    Type Declaration

    const position = editor.utils.createMappablePosition(10)
    const {position, mapResult} = editor.utils.getUpdatedPosition(position, transaction)