import type { AnyZodObject } from './any-zod-type.js'; type And = A extends true ? B extends true ? true : false : false; /** * Infer the input type of a zod schema using structural typing. * v3 schemas have `_input` phantom type. * v4 schemas have `_zod.input` phantom type. */ type InferZodInput = T extends { _zod: { input: any; }; } ? T['_zod']['input'] : T extends { _input: any; } ? T['_input'] : Record; export type PropsIfHasProps> = And extends true ? { defaultProps?: {}; } : { defaultProps: InferProps; }; export type InferProps> = AnyZodObject extends Schema ? {} extends Props ? Record : Props : {} extends Props ? InferZodInput : InferZodInput & Props; export {};