import { z } from 'zod'; export type IdleActionResultWithoutFormData = Pick>, 'success' | 'data' | 'invalid' | 'error'>; export type SuccessActionResultWithoutFormData = Pick>, 'success' | 'data'>; export type InvalidActionResultWithoutFormData> = Pick, 'success' | 'invalid'>; export type ErrorActionResultWithoutFormData = Pick>, 'success' | 'error'>; export type ActionResultWithoutFormData> = IdleActionResultWithoutFormData | SuccessActionResultWithoutFormData | InvalidActionResultWithoutFormData | ErrorActionResultWithoutFormData; export type IdleActionResult> = { formData: z.infer | undefined; success: false; data: undefined; invalid: undefined; error: undefined; }; export type SuccessActionResult> = { formData: z.infer | undefined; success: true; data: any; invalid: undefined; error: undefined; }; export type InvalidActionResult> = { formData: z.infer | undefined; success: false; data: undefined; invalid: FieldErrors | undefined; error: undefined; }; export type ErrorActionResult> = { formData: z.infer | undefined; success: false; data: undefined; invalid: undefined; error: string; }; export type ActionResult> = IdleActionResult | SuccessActionResult | InvalidActionResult | ErrorActionResult; type PrimitiveField = string | number | boolean | bigint | symbol | Date | null | undefined; type DotNestedKeys = Value extends PrimitiveField ? never : Value extends Array ? never : { [Key in Extract]: Value[Key] extends PrimitiveField ? Key : Value[Key] extends Array ? Key : DotNestedKeys extends never ? Key : Key | `${Key}.${DotNestedKeys}`; }[Extract]; type FieldErrorKeys = DotNestedKeys> extends never ? string : DotNestedKeys>; export type FieldErrors> = Partial, string[]>>; /** Utils */ export type ConvertEmptyToValue = 'undefined' | 'null' | 'empty-string'; export {}; //# sourceMappingURL=types.d.ts.map