import React from "react"; import type { ModalFunc } from "antd/es/modal/confirm"; import type { PickOptional } from "../../internal/type"; import "./index.less"; import type { ButtonProps } from "antd/es/button"; export type CreateModalReturnType = ReturnType; export type ModalConfigWithoutEvent = Omit; export type CreateAsyncModalPromise = WithCloseHandling extends true ? Promise<"ok" | "cancel" | "close"> : Promise; export interface ModalConfig { body: React.ReactNode; title?: React.ReactElement | string; maskClosable?: boolean; closable?: boolean; width?: number; className?: string; okText?: string; cancelText?: string; subTitle?: string; onOk?: () => any; onCancel?: (byClose: boolean) => any; destroyTimeoutSecond?: number; autoFocusButton?: "ok" | "cancel" | null; hideButtons?: boolean; addInnerPadding?: boolean; footerExtra?: React.ReactElement | string | number; cancelButtonProps?: ButtonProps; } export interface RootProps { config?: PickOptional; } declare function createSync(config: ModalConfig): CreateModalReturnType; declare function createAsync(config: ModalConfigWithoutEvent, withCloseHandling?: WithCloseHandling): CreateAsyncModalPromise; declare function confirm(body: React.ReactNode, title?: string): Promise; declare function Root({ config }: RootProps): React.ReactElement; /** * If using , this function will not work */ declare function destroyAll(): void; export declare const ModalUtil: Readonly<{ createSync: typeof createSync; createAsync: typeof createAsync; confirm: typeof confirm; destroyAll: typeof destroyAll; Root: typeof Root; }>; export {};