rmapi-js
    Preparing search index...

    Type Alias PageChange

    PageChange:
        | { index: number; kind: "layerAdd"; layer: LayerId; parent: LayerId }
        | { kind: "layerSet"; label?: string; layer: LayerId; visible?: boolean }
        | { index: number; kind: "strokeAdd"; layer: LayerId; stroke: Stroke }
        | {
            highlight: Highlight;
            index: number;
            kind: "highlightAdd";
            layer: LayerId;
        }
        | { index: number; kind: "textItemAdd"; layer: LayerId; slot: bigint }
        | { index: number; kind: "itemRemove"; layer: LayerId }
        | { items: Shown[]; kind: "layerReset"; layer: LayerId }
        | {
            formats: [offset: number, code: number][];
            inserted: string;
            kind: "textSplice";
            removed: number;
            start: number;
        }
        | { kind: "textReset"; text?: PageText }
        | { kind: "paragraphStyle"; paragraph: number; style?: number }
        | {
            backgroundVisible?: boolean;
            currentLayer?: LayerId;
            kind: "scene";
            paperSize?: [width: number, height: number];
            rootDocumentVisible?: boolean;
        }

    what a reader of a page shows differently, as a step to apply in order

    An index counts the items its layer shows as they stand when the step is applied, and text offsets count UTF-16 code units. A layer not seen before starts with no items and no name.

    Type Declaration

    • { index: number; kind: "layerAdd"; layer: LayerId; parent: LayerId }
      • index: number

        where

      • kind: "layerAdd"

        a nested layer is shown

      • layer: LayerId

        the layer

      • parent: LayerId

        the layer holding it, LayerId.ROOT for a page's own layers

    • { kind: "layerSet"; label?: string; layer: LayerId; visible?: boolean }
      • kind: "layerSet"

        a layer's name and visibility

      • Optionallabel?: string

        its name, if one was set

      • layer: LayerId

        the layer

      • Optionalvisible?: boolean

        whether it is shown, if that was set

    • { index: number; kind: "strokeAdd"; layer: LayerId; stroke: Stroke }
      • index: number

        where

      • kind: "strokeAdd"

        a stroke is shown

      • layer: LayerId

        the layer

      • stroke: Stroke

        the stroke

    • { highlight: Highlight; index: number; kind: "highlightAdd"; layer: LayerId }
      • highlight: Highlight

        the highlight

      • index: number

        where

      • kind: "highlightAdd"

        a highlight is shown

      • layer: LayerId

        the layer

    • { index: number; kind: "textItemAdd"; layer: LayerId; slot: bigint }
      • index: number

        where

      • kind: "textItemAdd"

        a text item is shown

      • layer: LayerId

        the layer

      • slot: bigint

        the item's slot

    • { index: number; kind: "itemRemove"; layer: LayerId }
      • index: number

        where

      • kind: "itemRemove"

        an item is no longer shown

      • layer: LayerId

        the layer

    • { items: Shown[]; kind: "layerReset"; layer: LayerId }
      • items: Shown[]

        what it shows, in order

      • kind: "layerReset"

        a layer's items, all of them

      • layer: LayerId

        the layer

    • {
          formats: [offset: number, code: number][];
          inserted: string;
          kind: "textSplice";
          removed: number;
          start: number;
      }
      • formats: [offset: number, code: number][]

        format codes that come in, at offsets into inserted

      • inserted: string

        what comes in their place

      • kind: "textSplice"

        typed text is replaced

        The format codes strictly inside what goes go with it, and those at either end of it stay at start, before what comes in.

      • removed: number

        how many code units go

      • start: number

        where

    • { kind: "textReset"; text?: PageText }
      • kind: "textReset"

        the typed text, all of it

      • Optionaltext?: PageText

        the text, or undefined when the page has none

    • { kind: "paragraphStyle"; paragraph: number; style?: number }
      • kind: "paragraphStyle"

        a paragraph's style

      • paragraph: number

        the paragraph, counted from 0

      • Optionalstyle?: number

        its style code, if one was set

    • {
          backgroundVisible?: boolean;
          currentLayer?: LayerId;
          kind: "scene";
          paperSize?: [width: number, height: number];
          rootDocumentVisible?: boolean;
      }
      • OptionalbackgroundVisible?: boolean

        whether the template is shown

      • OptionalcurrentLayer?: LayerId

        the selected layer

      • kind: "scene"

        the page's own settings

      • OptionalpaperSize?: [width: number, height: number]

        the page size in device pixels

      • OptionalrootDocumentVisible?: boolean

        whether the underlying document is shown