import type { SourceFile, Span, Token } from '../core/index.js'; import type { HighlightKind } from './kinds.js'; /** One piece of the file, with what it is and the text it covers. */ export interface Highlight { readonly kind: HighlightKind; readonly span: Span; /** * The source the span covers, carried rather than left to the caller to slice. * * A host that concatenates these gets the file back, so a renderer never * indexes the buffer and never has to agree with this module about what an * offset means. It is also what makes the covering property a one-line test. */ readonly text: string; } /** * Every piece of a file, in order, covering it exactly. * * The token list is walked rather than sorted, and a token that would overlap * the piece before it is skipped rather than believed. Both of those are * defences rather than expectations: the property this returns is what a host * draws with, and it has to hold for a stream from a file somebody is halfway * through typing as firmly as for one from a script that compiles. */ export declare function scan(file: SourceFile, tokens: readonly Token[]): readonly Highlight[]; //# sourceMappingURL=scan.d.ts.map