/** * Extension setup validation — checks extension custom-type-name registrations * and produces `ConstraintSemanticDiagnostic` entries for setup-time failures. * * Called once at `ExtensionRegistry` construction time so setup diagnostics * are emitted ONCE per registry rather than once per analysis call. * * Produces two diagnostic codes: * - `SYNTHETIC_SETUP_FAILURE` — invalid identifier, duplicate registration * - `UNSUPPORTED_CUSTOM_TYPE_OVERRIDE` — unsupported TypeScript global-builtin override * * `SYNTHETIC_SETUP_FAILURE` predates the single-program analysis model and is * retained as a stable internal diagnostic code. */ import { type ConstraintSemanticDiagnostic } from "./semantic-targets.js"; import { type ExtensionTagSource } from "./tag-registry.js"; /** * Setup-time diagnostic produced by the `_validateExtensionSetup` helper. * * The `kind` field distinguishes between a "setup" failure (invalid type * name, duplicate registration) and an unsupported built-in override. * * @internal */ export interface SetupDiagnostic { /** The category of diagnostic. */ readonly kind: "unsupported-custom-type-override" | "synthetic-setup"; /** TypeScript diagnostic code, or -1 for non-TypeScript diagnostics. */ readonly code: number; /** Human-readable description of the diagnostic. */ readonly message: string; } /** * Maps a `SetupDiagnostic["kind"]` to its canonical diagnostic code string. * * Shared between the build and snapshot consumers to avoid diverging ternary * chains. * * @internal */ export declare function _mapSetupDiagnosticCode(kind: SetupDiagnostic["kind"]): string; /** * Validates extension custom-type registrations. * * Produces setup diagnostics without throwing. Called once at registry * construction time by `createExtensionRegistry` so setup diagnostics are * emitted ONCE per registry rather than once per analysis call. * * Skips `TS_PRIMITIVE_KEYWORDS` (natively resolved) and `TS_GLOBAL_BUILTIN_TYPES` * with value `true` (supported overrides). Rejects malformed names, duplicates * across/within extensions, and unsupported global-built-in overrides. * * @internal */ export declare function _validateExtensionSetup(extensions: readonly ExtensionTagSource[] | undefined): readonly SetupDiagnostic[]; /** * Converts `registry.setupDiagnostics` into `ConstraintSemanticDiagnostic[]` * anchored at the extension-registration site for the given file. * * Single source of truth for the build path's pre-emit of setup diagnostics * (consumed by `parseTSDocTags`). * * @internal */ export declare function _emitSetupDiagnostics(setupDiags: readonly SetupDiagnostic[], file: string): readonly ConstraintSemanticDiagnostic[]; //# sourceMappingURL=extension-setup-validation.d.ts.map