import { ReactNode } from "react"; import { FieldValues, Path } from "react-hook-form"; import { z } from "zod"; export type FormAction = "create" | "read" | "update"; export interface FormFieldConfig { name: Path; label: string; icon?: ReactNode; type: "text" | "number" | "textarea" | "select" | "multiselect" | "checkbox" | "switch"; placeholder?: string; options?: { value: string; label: string; }[]; rows?: number; className?: string; disabled?: boolean; transform?: (value: any) => any; validation?: (value: any) => boolean; description?: string; } export interface FormConfig { title: { create: string; read: string; update: string; }; description: { create: string; read: string; update: string; }; schema: z.ZodSchema; fields: FormFieldConfig[]; gridCols?: number; onSubmit: (data: T, action: FormAction) => Promise; isPending?: boolean; } export interface FormProps { action: FormAction; selectedItem?: Partial; closeForm: () => void; config: FormConfig; open?: boolean; onOpenChange?: (open: boolean) => void; asModal?: boolean; } export declare function useFormHook(props: FormProps): { form: any; formComponent: any; handleSubmit: () => Promise; isConfirmOpen: any; setIsConfirmOpen: any; };