import { DBFieldAttribute } from "@better-auth/core/db"; import * as z from "zod"; export declare function toZodSchema, IsClientSide extends boolean>({ fields, isClientSide }: { fields: Fields; /** * If true, then any fields that have `input: false` will be removed from the schema to prevent user input. */ isClientSide: IsClientSide; }): ZodSchemaForSide; type ZodSchemaForSide, IsClientSide extends boolean> = IsClientSide extends true ? z.ZodObject, z.core.$strip> : z.ZodObject, z.core.$strip>; type SchemaShape, IsClientSide extends boolean> = RemoveNeverProps<{ [key in keyof Fields]: FieldAttributeToSchema; }>; export type FieldAttributeToSchema, isClientSide extends boolean = false> = Field extends DBFieldAttribute ? GetSchemaForSide>> : Record; type GetType = F extends { type: "string"; } ? z.ZodString : F extends { type: "number"; } ? z.ZodNumber : F extends { type: "boolean"; } ? z.ZodBoolean : F extends { type: "date"; } ? z.ZodDate : z.ZodAny; type GetRequired = F extends { required: false; } ? z.ZodOptional> : Schema; type GetSchemaForSide = isClientSide extends true ? Field extends { input: false; } ? never : Schema : Field extends { returned: false; } ? never : Schema; type RemoveNeverProps = { [K in keyof T as [T[K]] extends [never] ? never : K]: T[K]; }; export {};