import { SchemaIR } from "../types.js"; import { CodegenMode } from "./context.js"; //#region src/core/codegen/dedupe.d.ts /** A shared slow-walk validator hosted at module scope. */ interface SharedSchemaRef { /** Name of the `function __zcSw_N(input, path, issues)` declaration. */ readonly name: string; } interface SharedSchemaPlan { /** * Shared ref for an IR node, or undefined when the node is not a shared * candidate. Keyed by structural identity (memoized), so repeated lookups * during codegen are O(1). */ refFor(ir: SchemaIR): SharedSchemaRef | undefined; /** Module-scope declarations (shared preamble + `__zcSw_N` functions). `""` when empty. */ readonly code: string; /** Runtime helper names referenced by the shared block (lean mode). */ readonly usedHelpers: Set; readonly isEmpty: boolean; } /** Leading marker of a shared block; used to skip re-injection on watch/HMR re-runs. */ declare const SHARED_BLOCK_MARKER = "/* zod-compiler shared */"; /** * Build the shared-schema plan for one file's root schemas. Returns * {@link EMPTY_PLAN} (a no-op) when nothing repeats — the common case, so files * without internal duplication pay only a single linear analysis pass. */ declare function createSharedSchemaPlan(roots: readonly SchemaIR[], mode: CodegenMode): SharedSchemaPlan; //#endregion export { SHARED_BLOCK_MARKER, SharedSchemaPlan, SharedSchemaRef, createSharedSchemaPlan }; //# sourceMappingURL=dedupe.d.ts.map