import type { ScopedSegment } from './types.js'; export type ScopePredicate = (segment: ScopedSegment) => boolean; /** * One `&`-joined clause of a scope selector entry, e.g. `'~heading'` inside * `'paragraph & ~heading'`. */ export interface SelectorClause { /** The clause text as written (trimmed), including any leading `~`. */ clause: string; /** True when the clause is `~`-negated. */ negated: boolean; /** The scope name with negation marker and whitespace stripped. */ term: string; } /** * Splits a selector entry into its `&`-joined clauses. This is THE selector * tokenizer: compilation (compileSelector below) and config validation * (scopes/vocabulary.ts validateScopeSelector, config/validate.ts) must all * parse selector entries through here, so the two sides can never drift * apart on what counts as a term. */ export declare function tokenizeSelector(raw: string): SelectorClause[]; /** * Order-preserving removal of duplicate messages within a single selector's * problem list. A selector that repeats the same mistake per clause * (`all & all`, `bogus & bogus`) produces the identical message once per * clause — reporting it twice adds noise, not information. Applied inside * the problem-producing helpers (wholeDocumentKeywordProblems here, * validateScopeSelector in vocabulary.ts) so every consumer — config * validation's error list and compileSelector's throw alike — gets the * deduplicated form. */ export declare function dedupeProblems(problems: string[]): string[]; /** * Problems with `all`/`raw` used as selector TERMS inside a compound or * negated expression. Both are whole-document keywords, not segment names — * extractScopes never emits segments with those scopes — so: * - as a conjunction term (`heading & all`) the keyword clause can never * match a segment, and the whole rule silently reports nothing; * - negated (`~all`, `~raw`) the clause matches EVERY segment, silently * meaning "everything" when the set-theoretic reading of `~all` is * "nothing". * Bare `all`/`raw` as an entire single entry is NOT a problem — that's the * valid whole-document form compileSelector normalizes to `null`. Config * validation (config/validate.ts validateScope) surfaces these as * validation errors; compileSelector throws on them so direct runRules * callers that skip validation fail loudly instead of silently. */ export declare function wholeDocumentKeywordProblems(entry: string): string[]; export declare function compileSelector(scope: string | string[] | undefined): ScopePredicate | null; //# sourceMappingURL=selector.d.ts.map