/** * Shape checks for `uniq="true"`: the bodies that cannot keep the promise. * * `uniq` is a property of a DRAW. The engine has exactly two mechanisms for it — * take from a pool without replacement, or rearrange the columns the sequence * owns — and both need the sequence's own value to BE a draw. A body that * derives its value, picks it per row, or joins several draws into one string * satisfies neither, so the attribute could only ever be ignored. It used to be, * in silence, which is the worst of the outcomes: the config claims the column * is unique, the data disagrees, and nothing says a word. * * These live apart from the main validator because they are one idea told three * ways, and because `validate.ts` is at its line ceiling. */ import { type Diagnostic } from '../errors/index.js'; import type { OpenCloseElementContext, SelfClosingElementContext } from '../generated/TDCParser.js'; /** * `uniq="true"` where the value is not DRAWN at all — a `` result, or a * per-row pick among `` branches. There is no pool and no column of * its own, so there is nothing to draw without replacement or to rearrange. */ export declare function checkUniqUnsupported(seqEl: OpenCloseElementContext, name: string | undefined, why: string, diagnostics: Diagnostic[], hint?: string): void; /** What `checkUniqDraw` needs to resolve a template address the way the run does. */ export interface UniqDrawCtx { readonly locale: string; readonly packGenerators?: ReadonlySet | undefined; } /** * `uniq="true"` where the value IS drawn, but from something that has no list * of values to draw without replacement. * * `check` called these valid and the run then refused them, so a tool that * built its work around `check` — validate, then run — learnt only at the * second step. The most common one is the first thing anybody asks of test * data: a unique email, `common.internet.email` + `uniq="true"`, where the pack * is a generator that composes each address. * * The reason is asked of the same function the run asks, so the two cannot * disagree about which draws can be unique. Only the shapes that take that * path are judged — exactly one drawn (unnamed) part, with or without literals * and fields beside it, as measured. A compound's `uniq` rearranges its named * fields instead and works over any of them. */ export declare function checkUniqDraw(seqEl: OpenCloseElementContext, name: string | undefined, gens: readonly (OpenCloseElementContext | SelfClosingElementContext)[], ctx: UniqDrawCtx, diagnostics: Diagnostic[]): void; /** * `uniq="true"` on a composed value that joins two or more DRAWN parts. * * One drawn part plus constants is fine and is honoured: appending a constant * cannot make two different draws collide, so drawing that part without * replacement makes the whole value unique. Two drawn parts is a different * story — the parts have no fixed widths, so a unique set of parts is not a * unique join: `9` + `15` and `91` + `5` are the same three characters. */ export declare function checkUniqOnComposed(seqEl: OpenCloseElementContext, name: string | undefined, gens: readonly (OpenCloseElementContext | SelfClosingElementContext)[], diagnostics: Diagnostic[]): void; /** * `uniq="true"` on a simple sequence whose `` also asks for formatting, * blanking or repetition. * * `increment` and `decrement` are exempt: they are unique by construction, keep * their ordinary build, and their formatting runs as it does anywhere else. */ export declare function checkUniqDropsAttrs(seqEl: OpenCloseElementContext, name: string | undefined, gens: readonly (OpenCloseElementContext | SelfClosingElementContext)[], hasLiteral: boolean, diagnostics: Diagnostic[]): void; /** * `` inside a `uniq="true"` sequence. * * They are described as independent — "use either one, or both at once" — and * they are not. `` repairs a row so its fields differ; `uniq` * afterwards REARRANGES the whole columns to make the records unique, and the * rearrangement knows nothing about which pairings the repair ruled out. So the * repair is undone, silently: * * A,B over p,q,r,s * 12 rows, 12 legal distinct pairs — and the run still produced s,s and q,q * * The request was exactly satisfiable and the answer still broke the rule the * config states. Refused rather than half-kept: a row that violates `` * is the one thing the tag exists to prevent. */ export declare function checkUniqWithDistinct(seqEl: OpenCloseElementContext, name: string | undefined, distinctGroups: readonly (readonly unknown[])[], diagnostics: Diagnostic[]): void; //# sourceMappingURL=uniq-shape.d.ts.map