import React from 'react';
import type { AnyFunction, AnyObj } from '../types';
export type PropsWithModalEnhanced<P extends AnyObj = AnyObj, CloseCB extends FunctionMap = AnyObj> = {
    enhancedAction?: ModalEnhancedAction<CloseCB>;
} & P;
type TriggerType = React.ReactNode;
type ContentType = React.ReactNode | (<P extends AnyObj = {}>(props: PropsWithModalEnhanced<P>) => React.ReactNode);
export interface UseModalEnhancedProps {
    defaultOpen?: boolean;
    onClick?: (e: React.MouseEvent<HTMLElement>, action: ModalEnhancedAction) => void;
    actionRef?: React.RefObject<ModalEnhancedAction>;
    content?: ContentType;
    trigger?: TriggerType;
    children?: ContentType | TriggerType;
}
type FunctionMap = Record<string, AnyFunction>;
/** `v1.6.0+` */
type EnhancedClose<CloseCB extends FunctionMap> = {
    <CBN extends keyof CloseCB>(callbackName: CBN, ...restArgs: Parameters<CloseCB[CBN]>): void;
    <CBN extends keyof CloseCB>(callbackName?: CBN): void;
};
/** `earlier ~ v1.5.x` */
type LegacyClose = () => void;
export interface ModalEnhancedAction<CloseCB extends FunctionMap = any> {
    /**
     * 关闭弹窗。
     * 1. `earlier ~ v1.5.x` 版本中，`close` 类型为 {@link LegacyClose}
     *
     * 2. `v1.6.0+` 版本中，`close` 类型为 {@link EnhancedClose}
     * 它支持传入回调函数名，以及回调函数的参数。可实现更多的功能。 比如：[#18](https://github.com/cy2zq/chaoyang_component/issues/18)
     */
    close: EnhancedClose<CloseCB> | LegacyClose;
    open: () => void;
}
declare function useModalEnhanced<CloseCB extends FunctionMap = any>(props?: UseModalEnhancedProps): readonly [boolean, {
    open: () => void;
    close: EnhancedClose<CloseCB>;
}, {
    trigger: React.ReactNode;
    content: React.ReactNode;
}, Omit<UseModalEnhancedProps, "children" | "trigger" | "content" | "onClick" | "actionRef" | "defaultOpen">];
export default useModalEnhanced;
