UNPKG

@vulform/react

Version:

React components for VulForm contact form management

33 lines 1.19 kB
/** * Main hook for VulForm React integration */ import { VulFormError, FormTemplate, ValidationErrors, SubmissionResponse } from '@vulform/core'; interface UseVulFormProps { templateId: string; apiKey?: string; apiUrl?: string; prefill?: Record<string, any>; onSuccess?: (response: SubmissionResponse) => void; onError?: (error: VulFormError) => void; onValidationError?: (errors: ValidationErrors) => void; enableAnalytics?: boolean; spamProtection?: boolean; } interface UseVulFormReturn { template: FormTemplate | null; loading: boolean; error: VulFormError | null; submitting: boolean; submitted: boolean; formData: Record<string, any>; validationErrors: ValidationErrors; setFormData: React.Dispatch<React.SetStateAction<Record<string, any>>>; updateField: (fieldName: string, value: any) => void; validateForm: () => Promise<boolean>; submitForm: (data?: Record<string, any>) => Promise<void>; resetForm: () => void; clearErrors: () => void; } export declare function useVulForm(props: UseVulFormProps): UseVulFormReturn; export default useVulForm; //# sourceMappingURL=useVulForm.d.ts.map