/** * Lazy schema factory. * * `defineSchema(factory)` returns a memoized getter that resolves the * `SchemaValidator` extension contract on first call and materializes the * schema via the provided factory. This indirection lets core modules declare * schemas without importing zod directly. A real validator (typically * `@veryfront/ext-schema-zod`) must be registered in the contract registry before * the schema is first accessed. * * @module schemas/define */ import type { Schema, SchemaFactory, SchemaValidator } from "../extensions/schema/index.js"; export declare function resolveSchemaValidator(): SchemaValidator; /** Assert the runtime surface promised by the opaque Schema contract. */ export declare function assertSchemaContract(value: unknown, message: string): asserts value is Schema; /** * Wrap a schema factory so that it is built lazily on first call. * * @param factory - Receives a `SchemaValidator` and returns a `Schema`. * @returns A zero-arg getter that caches and returns the built schema. * Requires a SchemaValidator extension to be registered before first use. * * @example * ```ts * const getUserSchema = defineSchema((v) => * v.object({ id: v.string().uuid(), name: v.string().min(1) }) * ); * * const user = getUserSchema().parse(input); * ``` */ export declare function defineSchema(factory: SchemaFactory): () => Schema; //# sourceMappingURL=define.d.ts.map