Trilium Frontend API
    Preparing search index...

    Interface SyntaxNodeRef

    The set of properties provided by both SyntaxNode and TreeCursor. Note that, if you need an object that is guaranteed to stay stable in the future, you need to use the node accessor.

    interface SyntaxNodeRef {
        from: number;
        name: string;
        node: SyntaxNode;
        to: number;
        tree: Tree;
        type: NodeType;
        matchContext(context: readonly string[]): boolean;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    Methods

    Properties

    from: number

    The start position of the node.

    name: string

    The name of the node (.type.name).

    Retrieve a stable syntax node at this position.

    to: number

    The end position of the node.

    tree: Tree

    Get the tree that represents the current node, if any. Will return null when the node is in a tree buffer.

    type: NodeType

    The type of the node.

    Methods

    • Test whether the node matches a given context—a sequence of direct parent nodes. Empty strings in the context array act as wildcards, other strings must match the ancestor node's name.

      Parameters

      • context: readonly string[]

      Returns boolean