Trilium Frontend API
    Preparing search index...

    Type Alias BuildData

    type BuildData = {
        buffer: BufferCursor | readonly number[];
        bufferStart?: number;
        length?: number;
        maxBufferLength?: number;
        minRepeatType?: number;
        nodeSet: NodeSet;
        reused?: readonly Tree[];
        start?: number;
        topID: number;
    }
    Index

    Properties

    buffer: BufferCursor | readonly number[]

    The buffer or buffer cursor to read the node data from.

    When this is an array, it should contain four values for every node in the tree.

    • The first holds the node's type, as a node ID pointing into the given NodeSet.
    • The second holds the node's start offset.
    • The third the end offset.
    • The fourth the amount of space taken up in the array by this node and its children. Since there's four values per node, this is the total number of nodes inside this node (children and transitive children) plus one for the node itself, times four.

    Parent nodes should appear after child nodes in the array. As an example, a node of type 10 spanning positions 0 to 4, with two children, of type 11 and 12, might look like this:

    [11, 0, 1, 4, 12, 2, 4, 4, 10, 0, 4, 12]
    
    bufferStart?: number

    The position in the buffer where the function should stop reading. Defaults to 0.

    length?: number

    The length of the wrapping node. The end offset of the last child is used when not provided.

    maxBufferLength?: number

    The maximum buffer length to use. Defaults to DefaultBufferLength.

    minRepeatType?: number

    The first node type that indicates repeat constructs in this grammar.

    nodeSet: NodeSet

    The node types to use.

    reused?: readonly Tree[]

    An optional array holding reused nodes that the buffer can refer to.

    start?: number

    The position the tree should start at. Defaults to 0.

    topID: number

    The id of the top node type.