import { ReactEventHandler } from 'react'; import { RedirectionSideEffect } from '../../sideEffect'; import { Record, OnFailure, OnSuccess } from '../../types'; /** * Prepare callback for a Delete button with undo support * * @example * * import React from 'react'; * import ActionDelete from '@mui/icons-material/Delete'; * import { Button, useDeleteWithUndoController } from '../app'; * * const DeleteButton = ({ * resource, * record, * basePath, * redirect, * onClick, * ...rest * }) => { * const { loading, handleDelete } = useDeleteWithUndoController({ * resource, * record, * basePath, * redirect, * onClick, * }); * * return ( * * ); * }; */ declare const useDeleteWithUndoController: (props: UseDeleteWithUndoControllerParams) => UseDeleteWithUndoControllerReturn; export interface UseDeleteWithUndoControllerParams { basePath?: string; record?: Record; redirect?: RedirectionSideEffect; resource?: string; onClick?: ReactEventHandler; onSuccess?: OnSuccess; onFailure?: OnFailure; } export interface UseDeleteWithUndoControllerReturn { loading: boolean; handleDelete: ReactEventHandler; } export default useDeleteWithUndoController;