Trilium Frontend API
    Preparing search index...

    Interface Input

    This is the interface parsers use to access the document. To run Lezer directly on your own document data structure, you have to write an implementation of it.

    interface Input {
        length: number;
        lineChunks: boolean;
        chunk(from: number): string;
        read(from: number, to: number): string;
    }
    Index

    Properties

    Methods

    Properties

    length: number

    The length of the document.

    lineChunks: boolean

    Indicates whether the chunks already end at line breaks, so that client code that wants to work by-line can avoid re-scanning them for line breaks. When this is true, the result of chunk() should either be a single line break, or the content between from and the next line break.

    Methods

    • Get the chunk after the given position. The returned string should start at from and, if that isn't the end of the document, may be of any length greater than zero.

      Parameters

      • from: number

      Returns string

    • Read the part of the document between the given positions.

      Parameters

      • from: number
      • to: number

      Returns string