import { RaRecord, MutationMode, TransformData } from "../../types.js";
import { RedirectionSideEffect } from "../../routing/index.js";
import { UseGetOneHookValue, UseGetOneOptions, UseUpdateOptions } from "../../dataProvider/index.js";
import { SaveContextValue } from "../saveContext/index.js";
/**
 * Prepare data for the Edit view.
 *
 * useEditController does a few things:
 * - it grabs the id from the URL and the resource name from the ResourceContext,
 * - it fetches the record via useGetOne,
 * - it prepares the page title.
 *
 * @param {Object} props The props passed to the Edit component.
 *
 * @return {Object} controllerProps Fetched data and callbacks for the Edit view
 *
 * @example
 *
 * import { useEditController } from 'react-admin';
 * import EditView from './EditView';
 *
 * const MyEdit = () => {
 *     const controllerProps = useEditController({ resource: 'posts', id: 123 });
 *     return <EditView {...controllerProps} {...props} />;
 * }
 */
export declare const useEditController: <RecordType extends RaRecord = any, ErrorType = Error>(props?: EditControllerProps<RecordType, ErrorType>) => EditControllerResult<RecordType, ErrorType>;
export interface EditControllerProps<RecordType extends RaRecord = any, ErrorType = Error> {
    disableAuthentication?: boolean;
    id?: RecordType['id'];
    mutationMode?: MutationMode;
    mutationOptions?: UseUpdateOptions<RecordType, ErrorType>;
    queryOptions?: UseGetOneOptions<RecordType, ErrorType>;
    redirect?: RedirectionSideEffect;
    redirectOnError?: RedirectionSideEffect;
    resource?: string;
    transform?: TransformData;
    [key: string]: any;
}
export interface EditControllerBaseResult<RecordType extends RaRecord = any> extends SaveContextValue<RecordType> {
    defaultTitle?: string;
    isFetching: boolean;
    isLoading: boolean;
    isPaused?: boolean;
    isPlaceholderData?: boolean;
    refetch: UseGetOneHookValue<RecordType>['refetch'];
    redirect: RedirectionSideEffect;
    redirectOnError: RedirectionSideEffect;
    resource: string;
    saving: boolean;
}
export interface EditControllerLoadingResult<RecordType extends RaRecord = any> extends EditControllerBaseResult<RecordType> {
    record: undefined;
    error: null;
    isPending: true;
}
export interface EditControllerLoadingErrorResult<RecordType extends RaRecord = any, TError = Error> extends EditControllerBaseResult<RecordType> {
    record: undefined;
    error: TError;
    isPending: false;
}
export interface EditControllerRefetchErrorResult<RecordType extends RaRecord = any, TError = Error> extends EditControllerBaseResult<RecordType> {
    record: RecordType;
    error: TError;
    isPending: false;
}
export interface EditControllerSuccessResult<RecordType extends RaRecord = any> extends EditControllerBaseResult<RecordType> {
    record: RecordType;
    error: null;
    isPending: false;
}
export type EditControllerResult<RecordType extends RaRecord = any, ErrorType = Error> = EditControllerLoadingResult<RecordType> | EditControllerLoadingErrorResult<RecordType, ErrorType> | EditControllerRefetchErrorResult<RecordType, ErrorType> | EditControllerSuccessResult<RecordType>;
//# sourceMappingURL=useEditController.d.ts.map