import { SchemaIR } from "../types.js"; import { SharedSchemaPlan } from "./dedupe.js"; import { CodeGenResult, CodegenMode, GeneratedConstant } from "./context.js"; //#region src/core/codegen/index.d.ts interface GenerateValidatorOptions { refCount?: number; /** Codegen output mode. Defaults to "inline". */ mode?: CodegenMode; /** * File-level shared slow-walk plan (schema deduplication). Applied only to * mutation-free schemas, so shared walks stay on the deferred cold path. */ sharedSchemas?: SharedSchemaPlan | undefined; /** * Compact mode (`output: "compact"`). Drop the compiled slow walk for * mutation-free schemas with a TOTAL fast path and delegate the cold error * path to the retained Zod schema (`__zcFinZ`). The fast (hot) path is * unchanged; only the bulky error-collecting walk — 64–77% of generated * bytes — is replaced by a few bytes of zod delegation. See * {@link CodeGenResult.usesRetainedSchema}. */ compact?: boolean | undefined; /** Internal file-pipeline hook for pooling exact constant initializers across validators. */ onConstant?: ((constant: GeneratedConstant) => void) | undefined; /** Internal exact-initializer plan used by the file pipeline's final generation pass. */ sharedConstantNames?: ReadonlyMap | undefined; } /** * Generate optimized validation code from SchemaIR. * * - `code`: preamble declarations (Sets, RegExps, etc.) — deterministic for the same IR * - `functionDef`: full function expression string referencing preamble vars via closure * - `usedHelpers`: helper names from "virtual:zod-compiler/runtime" referenced (lean mode only) * * Usage: `new Function(code + "\nreturn " + functionDef + ";")()` */ declare function generateValidator(ir: SchemaIR, name: string, options?: GenerateValidatorOptions): CodeGenResult; //#endregion export { type CodeGenResult, GenerateValidatorOptions, generateValidator }; //# sourceMappingURL=index.d.ts.map