import { UseDisclosureProps, UseDisclosureReturn } from "@chakra-ui/react";
import { UseFormProps, UseFormReturn } from "react-hook-form";
import { UseMutationResult } from "@tanstack/react-query";
import { FormKeyConfig } from "./form-key-config";
import { TData } from "../types";
export interface UseEditRecordModalProps<T extends TData> {
    /**
     * The title of the Create Record modal to display on the button and the header
     */
    title: string;
    /**
     * The mutation to run when the form is submitted
     * @param data The data to submit to the mutation function
     */
    mutationFn: (data: T) => Promise<T>;
    /**
     * The form key config populate the modal
     */
    formKeys: FormKeyConfig<T>[];
    /**
     * The default values to fill the form
     */
    defaultValues?: UseFormProps<T>["defaultValues"];
}
export interface UseEditRecordModalReturn<T extends TData> {
    /**
     * The title of the Create Record modal to display on the button and the header
     */
    title: string;
    /**
     * The mutation response
     */
    mutationResponse: UseMutationResult<T, unknown, T, unknown>;
    /**
     * The form to use for the Create Record modal
     */
    form: UseFormReturn<T>;
    /**
     * The function to run the submission of the form
     */
    onFormSubmit: (data: T) => Promise<void>;
    /**
     * The function to run when the form has errors
     */
    onFormError: (errors: any) => void;
    /**
     * The modal disclosure props
     */
    disclosure: UseDisclosureReturn;
    /**
     * The form key config populate the modal
     */
    formKeys: FormKeyConfig<T>[];
}
export declare const useEditRecordModalWithCustomMutationHook: <T extends object, R extends {}>({ title, formKeys, defaultValues, onFormSubmit: _onFormSubmit, useMutationHook, disclosureProps, }: Omit<UseEditRecordModalProps<T>, "mutationFn"> & {
    useMutationHook: ({ onSuccess, onError, }: {
        onSuccess?: (() => void) | undefined;
        onError?: (() => void) | undefined;
    }) => R;
    onFormSubmit?: ((mutation: R, formFields: T) => Promise<void>) | undefined;
    disclosureProps?: UseDisclosureProps | undefined;
}) => {
    title: string;
    formKeys: FormKeyConfig<T>[];
    mutationResponse: R;
    form: UseFormReturn<T, any, undefined>;
    onFormSubmit: (data: T) => Promise<void>;
    onFormError: (errors: any) => void;
    disclosure: {
        isOpen: boolean;
        onOpen: () => void;
        onClose: () => void;
        onToggle: () => void;
        isControlled: boolean;
        getButtonProps: (props?: any) => any;
        getDisclosureProps: (props?: any) => any;
    };
};
/**
 * Generic abstraction of the useMutation required to run the CreateRecordModal
 * A function can be passed into the mutationFn to run the record creation process on save
 * @returns
 */
export declare const useEditRecordModal: <T extends object>({ title, formKeys, mutationFn, defaultValues, }: UseEditRecordModalProps<T>) => UseEditRecordModalReturn<T>;
//# sourceMappingURL=use-edit-record-modal.d.ts.map