//#region src/unplugin/virtual.d.ts /** * Virtual module "virtual:zod-compiler/runtime". * * Hosts shared helpers and well-known regexes so that lean-mode generated code * (emitted by the unplugin transform) can `import { __zcMkv, __zcTS, __zcReEmail }` * instead of inlining these declarations per IIFE. * * Bundlers tree-shake unused exports during minification, so the virtual module * never bloats the final bundle with helpers that no schema actually references. * * The virtual module is rebuilt on each plugin instantiation but its content is * static (no per-build state), so caching the source string is safe. */ /** Public virtual module ID used by Vite / Rollup / esbuild and other `virtual:`-compatible bundlers. */ declare const VIRTUAL_RUNTIME_ID = "virtual:zod-compiler/runtime"; /** Bare-specifier alias for webpack/rspack, which reject the `virtual:` URI scheme. */ declare const WP_RUNTIME_ID = "__zod-compiler-runtime__"; /** * Real package subpath, shipped as `dist/runtime.js` (emitted at build time from * RUNTIME_SOURCE — see the `emit-runtime` plugin in vite.config.ts). * * The ids above only resolve inside a host that runs zod-compiler's resolveId * hook. A webpack loader has none, so lean mode was unavailable to it: the * specifier would survive into the output unresolved. This one needs no hook — * plain node resolution finds it — which is what lets a loader host dedup * helpers across files. * * Deliberately NOT intercepted by resolveVirtualId, unlike the two ids above. * They resolve to nothing without the hook, so answering them is free. This one * already resolves, and to a SPECIFIC copy: intercepting would override a * nested or newer zod-compiler whose runtime exports helpers this version has * never heard of, turning a working build into an unresolvable-import error * naming an id the user never wrote. A build that ends up with both this file * and the virtual module carries two copies of the helpers, which is wasteful * but correct — every result crosses module boundaries structurally, never by * identity. */ declare const RUNTIME_PACKAGE_ID = "zod-compiler/runtime"; /** Resolved id (Rollup convention: leading null byte hides the module from other plugins). */ declare const RESOLVED_RUNTIME_ID = "\0zod-compiler-runtime"; /** * The runtime module's ESM source. Exported because the package build writes it * to `dist/runtime.js` — the file and the virtual module must be the same bytes, * so there is exactly one producer. */ declare const RUNTIME_SOURCE: string; /** `id` filter for the resolveId hook: the runtime module's public specifiers. */ declare const RUNTIME_SPECIFIER_FILTER: RegExp[]; /** `id` filter for the load hook: the resolved (`\0`-prefixed) runtime id. */ declare const RESOLVED_RUNTIME_ID_FILTER: RegExp; declare function resolveVirtualId(id: string): string | null; declare function loadVirtual(id: string): string | null; /** Names of all helpers exported by the virtual module. */ declare const ALL_HELPER_NAMES: readonly string[]; //#endregion export { ALL_HELPER_NAMES, RESOLVED_RUNTIME_ID, RESOLVED_RUNTIME_ID_FILTER, RUNTIME_PACKAGE_ID, RUNTIME_SOURCE, RUNTIME_SPECIFIER_FILTER, VIRTUAL_RUNTIME_ID, WP_RUNTIME_ID, loadVirtual, resolveVirtualId }; //# sourceMappingURL=virtual.d.ts.map