import type { Combinator, ParseContext, ParseResult } from '../types.ts'; /** Anything `completionsAt` can probe: an interpreter combinator OR a `compile()`d * grammar. A grammar compiled with `{ recovery: true }` records the probe on its fast * path, so completions work on the published compiled artifact — no interpreter needed. */ type CompletionsTarget = Combinator | { parseWithContext(input: string, ctx: ParseContext, pos?: number): ParseResult; }; /** * Returns the set of expected tokens at the given cursor offset. * Useful for implementing IDE completions. * * Runs the parser on input truncated at `offset` with a probe that tracks the * highest-position failure seen, even when sepBy/many backtrack past the cursor. * Returns the expected tokens from that deepest failure. * * Works on the interpreter combinator OR a `compile(g, { recovery: true })` grammar * (the probe is recorded on the compiled fast path). Returns an empty array when the * input up to `offset` parses completely with no failures at or before the cursor. * * The returned strings use the same labels as ParseFail.expected: * quoted literals like `"\"{\""` and regex patterns like `"/[0-9]+/"`. */ export declare function completionsAt(target: CompletionsTarget, input: string, offset: number, options?: { tolerant?: boolean; }): string[]; export {}; //# sourceMappingURL=completions.d.ts.map