amis-rpc-design/node_modules/antd/es/modal/useModal/index.d.ts

9 lines
495 B
TypeScript
Raw Normal View History

2023-10-07 19:42:30 +08:00
import * as React from 'react';
import type { ModalFunc, ModalStaticFunctions } from '../confirm';
export type ModalFuncWithPromise = (...args: Parameters<ModalFunc>) => ReturnType<ModalFunc> & {
then<T>(resolve: (confirmed: boolean) => T, reject: VoidFunction): Promise<T>;
};
export type HookAPI = Omit<Record<keyof ModalStaticFunctions, ModalFuncWithPromise>, 'warn'>;
declare function useModal(): readonly [instance: HookAPI, contextHolder: React.ReactElement];
export default useModal;