import { Form } from '@formio/js'; import { MutableRefObject } from 'react'; import { ChangedSubmission, ComponentType, FormOptions, FormType, SubmissionType } from '../../interfaces'; import { JSON, JSONRecord } from '../../interfaces/JSONRecord.js'; import { FormCustomEvent } from './types'; type Webform = any; type EventError = string | Error | Error[] | { message: string; } | { message: string; }[]; export interface UseFormProps { src?: string; url?: string; form?: FormType; submission?: SubmissionType; options?: FormOptions; FormClass?: typeof Form; onFormReady?: (instance: Webform) => void; onPrevPage?: (page: number, submission: SubmissionType) => void; onNextPage?: (page: number, submission: SubmissionType) => void; onCancelSubmit?: () => void; onCancelComponent?: (component: ComponentType) => void; onChange?: (value: ChangedSubmission, flags: any, modified: boolean) => void; onCustomEvent?: (event: FormCustomEvent) => void; onComponentChange?: (changed: { instance: Webform; component: Webform; value: any; flags: any; }) => void; onSubmit?: (submission: SubmissionType, saved?: boolean) => void; onAsyncSubmit?: (submission: SubmissionType) => void; onSubmitDone?: (submission: SubmissionType) => void; onSubmitError?: (error: EventError) => void; onFormLoad?: (form: JSON) => void; onError?: (error: EventError | false) => void; onRender?: (param: any) => void; onAttach?: (param: any) => void; onBuild?: (param: any) => void; onFocus?: (instance: Webform) => void; onBlur?: (instance: Webform) => void; onInitialized?: () => void; onLanguageChanged?: () => void; onBeforeSetSubmission?: (submission: SubmissionType) => void; onSaveDraftBegin?: () => void; onSaveDraft?: (submission: SubmissionType) => void; onRestoreDraft?: (submission: SubmissionType | null) => void; onSubmissionDeleted?: (submission: SubmissionType) => void; onRequestDone?: () => void; otherEvents?: { [event: string]: (...args: any[]) => void; }; } export declare function useForm(props: UseFormProps): { element: MutableRefObject; instance: any; }; export {};