import type { CodegenConfig } from '@zod-to-form/core'; import type { $ZodType } from 'zod/v4/core'; import type { Z2FViteConfig } from '../types.js'; /** * Build the effective `CodegenConfig` for a given (config, variant) pair. * * The bare default variant (`''`) returns the config as-is (minus the * `variants` field, which has no business in `generateFormComponent`'s * input). A named variant looks up `config.variants[variant]` and merges * it on top of the global fields. Unknown variants throw. */ /** * The plugin-side effective config — same shape as `CodegenConfig` except * `exportName` may still be empty (auto-detect). `compileTarget` promotes * it to a real name via `selectExport` before handing off to codegen. */ export type EffectiveZ2FConfig = Omit & { exportName?: string; }; export declare function buildEffectiveConfig(config: Z2FViteConfig, variant: string): EffectiveZ2FConfig; /** * Module namespace returned by Vite's `ssrLoadModule`. The shape is * `Record` — each named export is a property whose value * is whatever the user wrote. */ export type ModuleNamespace = Record; /** * Pick the named export from a module namespace that should be compiled * into a form. Resolution order: * * 1. If `expectedName` is provided, return that export (or throw if it * doesn't exist or isn't a Zod schema). * 2. Otherwise, find every named export that looks like a Zod schema. * If exactly one matches, return it. If zero or more than one match, * throw with a clear diagnostic — the user must disambiguate via * `config.exportName` or `config.variants[name].exportName`. * * Default exports are NOT considered — the contract is "named export * matching the convention". This avoids surprising the user when they * have both a default-exported helper and a named schema. */ export declare function selectExport(namespace: ModuleNamespace, schemaFile: string, expectedName?: string): { name: string; schema: $ZodType; }; /** * Compute a stable cache key from a config-shaped value. Consumers (the * `CompilationCache` keying logic in `plugin.ts`) should call this rather * than canonicalizing themselves so the hashing strategy stays in one * place. The parameter is widened beyond `CodegenConfig` because the * plugin hashes its own `Z2FViteConfig` (which adds `variants`) — and * `canonicalizeConfig` walks structurally, so either shape round-trips. * * Truncated to 16 hex chars (64 bits): collision-resistant enough for a * per-project cache keyed by (schemaFile, variant) pairs and keeps the * resulting virtual-module query strings short. */ export declare function configHash(config: CodegenConfig | Record): string; //# sourceMappingURL=load.d.ts.map