/// declare type TAnswer = { text: string; value: T; }; declare type TContext = { [key: string]: string | number; }; declare type TUseConfirmation = [(context?: TContext) => Promise, JSX.Element]; /** * useConfirmation can be used to show a confirmation dialog box * @param info - Info text to show * @param buttons - buttons, array: [{text: string, value: TValue}, ...] * @param resultCallback - Callback to be called on result * * @returns an array with [showFn: () => Promise, component], * where showFn is a function to be called to show the dialog box. It returns a * promise that resolves to the result value. * component is a component that must be rendered somewhere */ export declare const useConfirmation: >(info: string, buttons: TAnswer[], resultCallback?: ((value: T) => void) | undefined) => TUseConfirmation; export {};