import type { z } from 'zod'; import type { RefContextSlotDefinition, RefContextSlotMap } from '#src/references/ref-context-slot.js'; import type { DefinitionSchemaCreator, DefinitionSchemaCreatorOptions, DefinitionSchemaCreatorWithSlots, DefinitionSchemaParserContext } from './types.js'; export declare function createDefinitionSchemaParserContext(options: DefinitionSchemaCreatorOptions): DefinitionSchemaParserContext; export declare function definitionSchema(creator: DefinitionSchemaCreator): (context: DefinitionSchemaParserContext) => T; /** * Creates a schema that requires slots to be passed from parent schemas. * Used when a schema needs to reference entities from a parent context. * * @example * ```typescript * // Child schema requiring modelSlot from parent * export const createModelScalarFieldSchema = definitionSchemaWithSlots( * { modelSlot: modelEntityType }, * (ctx, { modelSlot }) => * ctx.withEnt(schema, { * type: modelScalarFieldEntityType, * parentSlot: modelSlot, * }), * ); * * // Called from parent: * createModelScalarFieldSchema(ctx, { modelSlot: parentModelSlot }) * ``` */ export declare function definitionSchemaWithSlots(slotDefinition: TSlotDef, creator: (ctx: DefinitionSchemaParserContext, slots: RefContextSlotMap) => T): DefinitionSchemaCreatorWithSlots; /** * Wraps a schema creator that requires slots with placeholder slots, * producing a simple schema creator that can be used for validation-only * contexts (e.g., React Hook Form). * * The placeholder slots allow the schema to parse without actual parent context, * which is useful when you only need schema validation without ref extraction. * * @example * ```typescript * // Schema that normally requires modelSlot from parent * const createModelScalarFieldSchema = definitionSchemaWithSlots( * { modelSlot: modelEntityType }, * (ctx, { modelSlot }) => ctx.withEnt(schema, { parentSlot: modelSlot }), * ); * * // For React Hook Form validation, wrap with placeholder slots * const fieldSchema = withPlaceholderSlots(createModelScalarFieldSchema); * const zodSchema = fieldSchema(ctx); // No slots needed * ``` */ export declare function withPlaceholderSlots(schemaCreator: DefinitionSchemaCreatorWithSlots): DefinitionSchemaCreator; //# sourceMappingURL=schema-creator.d.ts.map