import { UseFormErrorsHook } from './useFormErrors'; import { UseFormStatusHook } from './useFormStatus'; import { UseFormValuesHook } from './useFormValues'; import { FieldPath, UseFormStateHook, Values } from './useFormState'; export type UseFormListOptions = { /** * The form errors hook. */ formErrors: UseFormErrorsHook; /** * The form state hook. */ formState: UseFormStateHook; /** * The form keys hook. */ formStatus: UseFormStatusHook; /** * The form values hook. */ formValues: UseFormValuesHook; }; export type UseFormListHook = { /** * Appends one or more items to a list. * @param path * @param items */ appendListItem(path: FieldPath, ...items: E[]): void; /** * Inserts one or more items in a list. * @param path * @param index * @param items */ insertListItem(path: FieldPath, index: number, ...items: E[]): void; /** * Moves an item in a list. * @param path * @param fromIndex * @param toIndex */ moveListItem(path: FieldPath, fromIndex: number, toIndex: number): void; /** * Inserts one or more items to the beginning of a list. * @param path * @param items */ prependListItem(path: FieldPath, ...items: E[]): void; /** * Removes one or more items from a list using their indices. * @param path * @param indices */ removeListItem(path: FieldPath, ...indices: number[]): void; /** * Replaces an item in a list. * @param path * @param index * @param item */ replaceListItem(path: FieldPath, index: number, item: E): void; /** * Swaps two items in a list. * @param path * @param fromIndex * @param toIndex */ swapListItem(path: FieldPath, fromIndex: number, toIndex: number): void; }; declare function useFormList(options: UseFormListOptions): UseFormListHook; export default useFormList; //# sourceMappingURL=useFormList.d.ts.map