/** View over a flat trivia log (`_triviaLog` or per-node `triviaLog`). */ export type TriviaEntriesView = { readonly length: number; readonly labels: readonly string[] | undefined; readonly stride: number; start(i: number): number; end(i: number): number; /** Raw-child insertion boundary; defined only for a per-node trivia log. */ insertIndex(i: number): number | undefined; kindIndex(i: number): number | undefined; kind(i: number): string | undefined; text(i: number, input: string): string; }; export type RootTriviaGap = { /** Start offset of the contiguous trivia gap. */ readonly start: number; /** End offset of the contiguous trivia gap. */ readonly end: number; /** Entry indices into `entries` that make up this gap. */ readonly entryIndices: readonly number[]; /** True when any entry in the gap has the requested labeled trivia kind. */ hasKind(kind: string): boolean; /** Slice the full contiguous gap text from the original input. */ text(input: string): string; }; export type RootTriviaIndex = { /** Lazy entry-level view over sparse selected-root rows. */ readonly entries: TriviaEntriesView; /** Selected-root label table; entry kind indices refer to this array. */ readonly labels: readonly string[]; /** * Contiguous trivia gaps keyed by the following content offset. Values are * entry indices into `entries`, not materialized `{ value, span }` objects. */ readonly before: ReadonlyMap; /** * Contiguous trivia gaps keyed by the preceding content offset. Values are * entry indices into `entries`, not materialized `{ value, span }` objects. */ readonly after: ReadonlyMap; entryIndicesBefore(offset: number): readonly number[]; entryIndicesAfter(offset: number): readonly number[]; /** * Contiguous trivia gap immediately before `offset`, keyed by the following * content offset. Returns undefined when no gap sits at that boundary. */ gapBefore(offset: number): RootTriviaGap | undefined; /** * Contiguous trivia gap immediately after `offset`, keyed by the preceding * content offset. Returns undefined when no gap sits at that boundary. */ gapAfter(offset: number): RootTriviaGap | undefined; /** All contiguous trivia gaps in source order. */ gaps(): readonly RootTriviaGap[]; /** Source-ordered gaps containing at least one entry with the given label. */ gapsWithKind(kind: string | readonly string[]): readonly RootTriviaGap[]; }; /** Number of packed fields in one selected-root trivia row. */ export declare const SELECTED_ROOT_STRIDE = 5; /** * Wrap a flat trivia log. Stride is inferred from `labels`: * - root `_triviaLog`: 2 (start, end) or 3 (+ kindIndex) * - node `triviaLog`: 3 (start, end, insertIdx) or 4 (+ kindIndex) */ export declare function triviaEntries(log: readonly number[], labels?: readonly string[], opts?: { nodeLog?: boolean; }): TriviaEntriesView; /** * Build a root view over the sparse selected-label rows captured as * `[ownedRangeStart, ownedRangeEnd, markerStart, markerEnd, kindIndex]`. * * This is intentionally a different input shape from `triviaLog`: each row is * one selected marker, while the first pair names the complete committed trivia * range around it. Thus a mixed trivia run costs one five-number row, not three * legacy trivia entries. Rows are source ordered and equal gap pairs are * contiguous, which lets singleton boundary lookups binary-search the sparse * rows without constructing document-wide maps. */ export declare function buildRootTriviaIndex(log: readonly number[], labels: readonly string[]): RootTriviaIndex; //# sourceMappingURL=trivia-entries.d.ts.map