/** * Per-type generator validation, dispatched by `type=`. * * Lifted out of `validate.ts` when it hit the repo's own ceiling on file * length. Every branch here calls a checker that already lives in its own file, * so the move introduced no logic and no cycle: the `ctx` each one takes is a * structural interface, not the validator's `Ctx` class. * * The type-INDEPENDENT checks stay behind in `checkGen`, which is the boundary * worth keeping — what every generator must satisfy, and what this one must. */ import type { Diagnostic } from '../errors/index.js'; import type { OpenCloseElementContext, SelfClosingElementContext } from '../generated/TDCParser.js'; import { type AdvancedRegexValidationContext } from './advanced-regex.js'; import { type FileValidationContext } from './file.js'; import { type HttpCheckContext } from './http.js'; import { type RegexValidationContext } from './regex.js'; import { type TemplateLocaleCtx } from './template-locale.js'; /** * What a per-type checker may reach for. * * The intersection of every context the branches below need, rather than the * validator's `Ctx` class — importing that would create the cycle * `data-element.ts` already documents avoiding. */ export type GenTypeCtx = FileValidationContext & TemplateLocaleCtx & RegexValidationContext & AdvancedRegexValidationContext & HttpCheckContext & { readonly diagnostics: Diagnostic[]; readonly declaredSequences: readonly string[]; /** The sequence this gen belongs to, for `prev()` naming its own column. */ readonly currentSequence?: string | undefined; /** Of those, the ones whose `` repeats — a LIST in one cell. */ readonly repeatingSequences: readonly string[]; readonly locale: string; }; /** Is this `` a whole column read from other columns? */ export declare function isDerived(type: string | undefined, attrs: Record): boolean; /** * Where a `` stands, as far as the placement rules below care. * * sequence the whole ``: one unnamed ``, nothing beside it * branch one of a sequence's `` branches, or the fallback after them * case inside a `` or ``, at any depth * part an unnamed part of a composed `` — beside a literal or another part * field a named field of a compound `` */ export type GenPlace = 'sequence' | 'branch' | 'case' | 'part' | 'field'; export declare function checkGenByType(gen: OpenCloseElementContext | SelfClosingElementContext, type: string | undefined, ctx: GenTypeCtx, place?: GenPlace): void; //# sourceMappingURL=gen-type.d.ts.map