//#region src/vocabulary.d.ts /** * Normalize to Unicode NFC, trim leading/trailing whitespace, and collapse * internal whitespace runs to single ASCII spaces. */ declare function canonicalTerm(value: string): string; /** * Lowercase canonical key for case- and spacing-insensitive identity comparison * without fuzzy or punctuation merging (`"case study"` !== `"case-study"`). */ declare function canonicalTermKey(value: string): string; declare class VocabularyIncompleteError extends Error { readonly code: "vocabulary_incomplete"; readonly prefix: string; readonly pagesScanned: number; constructor(prefix: string, pagesScanned: number); } interface VocabularyLookupPage { readonly items: readonly string[]; readonly nextCursor?: string | null; } interface ResolveCanonicalVocabularyOptions { readonly values: readonly string[]; /** Paginated lookup under the current caller's RLS-scoped client. */ listPage(input: { readonly prefix: string; readonly cursor?: string; readonly limit: number; readonly signal?: AbortSignal; }): VocabularyLookupPage | Promise; /** Page size passed to `listPage` (1..200, default `50`). */ readonly pageSize?: number; /** Maximum pages scanned per prefix before failing closed (1..100, default `20`). */ readonly maxPages?: number; /** Extract server-side prefix query from a `canonicalTermKey` (defaults to `key.split(" ")[0]!`). */ readonly prefixFor?: (canonicalKey: string) => string; /** Format a verified-new term when no existing item matches `canonicalTermKey` (defaults to `(_, key) => key`). */ readonly formatNew?: (canonicalText: string, canonicalKey: string) => string; readonly signal?: AbortSignal; } /** * Resolve candidate tag/label/category values against an application's paginated * vocabulary so existing stored spellings are reused verbatim while verified-new * terms normalize deterministically. Fails closed with `VocabularyIncompleteError` * if a prefix lookup remains truncated after `maxPages` or stalls on a cursor. */ declare function resolveCanonicalVocabulary(options: ResolveCanonicalVocabularyOptions): Promise; //#endregion export { ResolveCanonicalVocabularyOptions, VocabularyIncompleteError, VocabularyLookupPage, canonicalTerm, canonicalTermKey, resolveCanonicalVocabulary }; //# sourceMappingURL=vocabulary.d.ts.map