import { FormSchema, FormValues, FormField, RadioTextAnswer, JsonValue } from '@form-engine-ts/core'; import { z } from 'zod'; interface CreateZodFormSchemaOptions { readonly pageIndex?: number; } type RadioTextEnabled = TField extends { readonly type: "radio"; readonly options: readonly (infer TOption)[]; } ? Extract extends never ? false : true : false; type ValueForField = TField["type"] extends "number" | "rating" ? number : TField["type"] extends "checkbox" ? boolean : TField["type"] extends "multi-select" ? readonly string[] : TField["type"] extends "radio" ? RadioTextEnabled extends true ? string | RadioTextAnswer : string : string; type FieldsForSchema = TSchema["fields"][number]; type FieldIds = FieldsForSchema["id"]; type RequiredFieldIds = FieldsForSchema extends infer TField ? TField extends FormField ? TField["required"] extends true ? TField["id"] : never : never : never; type OptionalFieldIds = Exclude, RequiredFieldIds>; type FieldById = Extract, { readonly id: TId; }>; /** Values inferred from a schema's field IDs and field types. */ type FormValuesForSchema = string extends FieldIds ? FormValues : Readonly<{ readonly [TId in RequiredFieldIds]: ValueForField>; } & { readonly [TId in OptionalFieldIds]?: ValueForField>; }> & { readonly metadata?: Readonly>; readonly translationMetadata?: Readonly>; }; declare function createZodFormSchema(schema: TSchema, options?: CreateZodFormSchemaOptions): z.ZodType>; declare function createZodFormSchema(schema: FormSchema, options?: CreateZodFormSchemaOptions): z.ZodType>; interface ZodTransformOptions { readonly stripHiddenFields?: boolean; readonly stripUnknownFields?: boolean; readonly trimStrings?: boolean; } declare function createZodFormCodec(schema: TSchema, options?: ZodTransformOptions): z.ZodType>; declare function createZodFormCodec(schema: FormSchema, options?: ZodTransformOptions): z.ZodPreprocess, unknown, z.core.$ZodTypeInternals, unknown>>>; export { type CreateZodFormSchemaOptions, type FormValuesForSchema, type ZodTransformOptions, createZodFormCodec, createZodFormSchema };