/** * An attribute the engine does not read is a silent no-op. Say so. * * This is the same defect `pack-params.ts` already reports for pack parameters, * left unreported everywhere else. `` looks like * it guards the sequence; `` accepts name, parent and uniq, so the * `if` does nothing and the engine says nothing — a page of the documentation * taught that spelling for as long as it existed, and the output it promised * was unreachable. * * The damage is worse when the name is a near miss, because the run succeeds * and the data looks right: * * -> 50 / 50 * -> 90 / 10 * * One letter, no warning, plausible output. For a test-data generator that is * the worst failure mode there is — not a crash, but quietly wrong data that * looks correct. * * SCOPE. Only tags whose attribute set is CLOSED and small are checked here: * ``, ``, ``, ``, ``, ``, ``, * ``, ``. `` is deliberately excluded — its attributes vary * by `type=`, and a `type="template"` generator additionally accepts whatever * parameters its pack declares, which is exactly what `pack-params.ts` handles * with the registry in hand. Guessing here would produce the false errors that * check was careful to avoid. * * SEVERITY. An error, and the run stops. There is no backward compatibility to * protect — the library has not shipped — and the whole point is that the * config asked for something it did not get. Letting generation continue would * hand back the wrong data with a note attached, which is the failure being * fixed, not a softer version of it. A misspelled attribute is a bug in the * config; the run should not proceed on a guess about what was meant. * * Each list is deliberately generous: a name missing from one of these sets * becomes a false warning on a working config, which is worse than the silent * no-op being fixed. */ import { type Diagnostic } from '../errors/index.js'; import type { AttrContext, ElementContext } from '../generated/TDCParser.js'; /** * What each closed tag actually reads, taken from the engine rather than from * the LSP completion map — that map exists for autocomplete, is missing `mode`, * `engine` and every compute tag, and would have produced hundreds of false * warnings if trusted here. * * `comment` is accepted everywhere: it is documented as a note that never * renders, and refusing it on a tag that happens not to list it would be a * pointless trap. */ export declare const CLOSED_TAG_ATTRIBUTES: ReadonlyMap>; /** * What `` accepts, as ONE generous union rather than a set per `type=`. * * Splitting by type would catch more — `format=` on a number generator does * nothing — but it would also mean a per-type list that is wrong somewhere, * and a false warning on a working config is the outcome this whole check must * never produce. The union still catches the case that matters, a misspelling: * `persent` is in nobody's list. * * Three groups make it up: the wrappers the engine applies to any generator, * the attributes some generator type reads, and the parameters of the named * distributions. Measured against every config in the tests, the docs and the * data packs before being switched on: zero would-be warnings. */ export declare const GEN_ATTRIBUTES: ReadonlySet; /** * Attributes that belong to one FAMILY of generators, and to which. * * The union above catches a misspelling; it cannot catch a real attribute on * the wrong generator, which is the likelier mistake and just as silent: * * -> 65 32 24 44 * -> 6 3 2 4 * -> 6 3 2 4 * * `min`/`max` are real (distribution parameters) and `range` is real (dates), * so nothing complained and the column quietly became single digits. * * Only attributes with an UNAMBIGUOUS owner are listed. An exhaustive * per-type allowlist would catch more and would also be wrong somewhere, and * a false error on a working config is the one outcome this check must never * produce. Anything absent from this map keeps the old, permissive treatment. * * Measured rather than read off the switch: each pair was probed by rendering * with and without the attribute and comparing the output, so "owner" means * the engine demonstrably behaves differently, not that a `case` label * mentions it. */ export declare const ATTRIBUTE_OWNERS: ReadonlyMap>; /** * Builtin template paths and the parameters each one reads. * * `type="template"` as a whole stays out of the union check — a pack declares * its own parameters and `pack-params.ts` judges those with the registry in * hand. But these two paths are not backed by any pack, so until now nothing * checked them at all: * * -> ages 20–30 * -> ages 20–80 * * One letter, no message, plausible dates — the same failure `persent` used * to be. Their parameter sets are small and closed, so checking them carries * no risk of a false error. */ export declare const BUILTIN_TEMPLATE_PARAMS: ReadonlyMap>; /** * A `type="template"` generator is not put through the union: it accepts * whatever parameters its pack declares, and `pack-params.ts` judges those * with the registry in hand. Guessing without it is how false errors get * invented. The two BUILTIN paths have no pack behind them, so they are * checked here against their own closed sets. */ export declare function checkGenAttrs(attrs: readonly AttrContext[], diagnostics: Diagnostic[]): void; /** Report every attribute on `tag` that the engine will not read. */ export declare function checkUnknownAttrs(tag: string, attrs: readonly AttrContext[], diagnostics: Diagnostic[]): void; /** * Walk the whole document once and check every closed tag it contains. * * A single pass rather than a call at each site the validator already visits: * the existing walker has a dozen entry points, and a tag reached by a path * nobody thought to hook would keep its silence — which is the very failure * being fixed. */ export declare function checkAllUnknownAttrs(root: ElementContext[], diagnostics: Diagnostic[], insideCompute?: boolean): void; //# sourceMappingURL=unknown-attrs.d.ts.map