import { z } from 'zod'; import type { InputBooleanFieldOptions, InputEnumFieldOptions, InputNumberFieldOptions, InputStringFieldOptions } from '../types/FieldOptions'; export type FieldValueToOptions = T extends z.ZodBoolean ? Partial : T extends z.ZodString ? Partial : T extends z.ZodNumber ? Partial : T extends z.ZodEnum ? Partial : T extends z.ZodNativeEnum ? Partial : T extends z.ZodObject ? MappedFieldOptions : never; export type MappedFieldOptions = { [K in keyof T['shape']]?: FieldValueToOptions; }; export type UnwrapZodType = T extends { _def: { innerType: infer U; }; } ? U extends z.ZodTypeAny ? UnwrapZodType : T : T;