/** * The placement contract — which tag may live inside which. * * The grammar lets any element nest anywhere, so these rules live in the * validator. This module holds the small, reusable pieces the container * checks in `validate.ts` share; the full contract is pinned by * `test/validator/placement.test.ts`. */ import type { ParserRuleContext } from 'antlr4ng'; import { type Diagnostic } from '../errors/index.js'; import type { ElementContext } from '../generated/TDCParser.js'; /** Underlying context of any child element — incl. ``, which elementKind skips. */ export declare function childNode(el: ElementContext): ParserRuleContext | null; /** Tag name of any child — `'data'`/`'map'` or the element name; null for a whitespace node. */ export declare function childTagName(el: ElementContext): string | null; /** True for a known construct that simply belongs somewhere else. */ export declare function isKnownConstruct(name: string): boolean; /** * A `` written where nothing renders it. * * ``, ``, `` and `` each used to skip a `` child * before any check ran, so the text was dropped without a word — the config * said something and got nothing. A `` has no value of its own; it joins * the value of the thing around it, and those four have no value to join. * `` is the one worth spelling out: it publishes NAMED fields, so a tag * with no name could not be addressed even if it were kept. */ export declare function reportLooseData(el: ElementContext, parent: string, sink: { diagnostics: Diagnostic[]; }): boolean; /** Report a known tag sitting in a parent that doesn't allow it. */ export declare function reportMisplaced(el: ElementContext, name: string, parent: string, sink: { diagnostics: Diagnostic[]; }): void; /** * One invented tag, one answer — wherever it turns up. * * Eight containers refused an unknown child and five let it through in silence, * and the eight that did refuse used five codes and three wordings for the one * mistake. The codes stay as they are (they are published, and the errors * reference is keyed by them); the NOTE is what a reader acts on, so every * container now says it the same way. * * `` is the deliberate exception and is never checked: a tag inside it is * output TEXT — `xy` renders `xy` — which is how a config * emits XML or HTML. */ export declare function reportUnknownChild(node: ParserRuleContext, parent: string, name: string, code: string, sink: { diagnostics: Diagnostic[]; }, /** Explicit list, for a tag whose children depend on where it sits. */ allowedOverride?: readonly string[]): void; //# sourceMappingURL=placement.d.ts.map