Trilium Frontend API
    Preparing search index...

    Interface SpanIterator<T>

    Methods used when iterating over the spans created by a set of ranges. The entire iterated range will be covered with either span or point calls.

    interface SpanIterator<T extends RangeValue> {
        point(
            from: number,
            to: number,
            value: T,
            active: readonly T[],
            openStart: number,
            index: number,
        ): void;
        span(
            from: number,
            to: number,
            active: readonly T[],
            openStart: number,
        ): void;
    }

    Type Parameters

    Index

    Methods

    Methods

    • Called when going over a point decoration. The active range decorations that cover the point and have a higher precedence are provided in active. The open count in openStart counts the number of those ranges that started before the point and. If the point started before the iterated range, openStart will be active.length + 1 to signal this.

      Parameters

      • from: number
      • to: number
      • value: T
      • active: readonly T[]
      • openStart: number
      • index: number

      Returns void

    • Called for any ranges not covered by point decorations. active holds the values that the range is marked with (and may be empty). openStart indicates how many of those ranges are open (continued) at the start of the span.

      Parameters

      • from: number
      • to: number
      • active: readonly T[]
      • openStart: number

      Returns void