index.d.ts 495 B

12345678
  1. import * as React from 'react';
  2. import type { ModalFunc, ModalStaticFunctions } from '../confirm';
  3. export type ModalFuncWithPromise = (...args: Parameters<ModalFunc>) => ReturnType<ModalFunc> & {
  4. then<T>(resolve: (confirmed: boolean) => T, reject: VoidFunction): Promise<T>;
  5. };
  6. export type HookAPI = Omit<Record<keyof ModalStaticFunctions, ModalFuncWithPromise>, 'warn'>;
  7. declare function useModal(): readonly [instance: HookAPI, contextHolder: React.ReactElement];
  8. export default useModal;