import type { ComponentType, ReactNode, RefObject, Context } from 'react';
import type { BaseProps, AsProp, DeferInfer, HeadingTag } from '../../types';
import type { ProgressProps } from '../Progress';
export interface ModalManagerProps {
    /** Content that will be provided modal manager context. */
    children: ReactNode;
}
export interface ModalOptions {
    /**
     * If true, the Modal will render as an alert that is not dismissible.
     * @default false
     */
    alert?: boolean;
    /**
     * Toggle Esc keypress action or clicking backdrop to dismiss Modal. Also displays dismiss button on Modal header.
     * Not valid for Modals of type alert.
     * @default alert ? false : true
     */
    dismissible?: boolean;
    /**
     * Toggle minimize button in header thereby helping in rendering minimizable/non-minimizable Modals.
     * Not valid for Modals of type alert.
     * @default false
     */
    minimizable?: boolean;
    /**
     * Toggle maximize button in header thereby helping in rendering maximizable/non-maximizable Modals.
     * Not valid for Modals of type alert.
     * @default false
     */
    maximizable?: boolean;
    /** Positions the modal in the right corner without backdrop
     * @default false
     */
    dockable?: boolean;
    /**
     * If true, the Modal will initially render in a minimized state.
     * @default false
     */
    defaultMinimized?: boolean;
    /**
     * If true, the Modal content will be removed from the DOM when in a minimized state.
     * @default true
     */
    unmountWhenMinimized?: boolean;
    /** Used to identify the modal. Will be passed back as an argument in life cycle functions. */
    id?: string;
    /** Life cycle function that will be run when the modal is minimized. */
    onMinimize?: (id: string) => void;
    /** Life cycle function that will be run when the modal is maximized. */
    onMaximize?: (id: string) => void;
    /** Life cycle function that will be run when the modal is maximized. */
    onDock?: (id: string) => void;
    /** Life cycle function that will be run when the modal is activated (un minimized). */
    onActivate?: (id: string) => void;
    /** Life cycle function that will be run when the modal is dismissed. */
    onDismiss?: (id: string) => void;
}
export interface ModalProps extends BaseProps, AsProp {
    /** Place a modal into a loading state by way of a bool or an object which allows for a custom message and determinate progress. */
    progress?: boolean | Pick<ProgressProps, 'message' | 'minValue' | 'maxValue' | 'value'>;
    /** Heading for the Modal. */
    heading: ReactNode;
    /**
     * Heading level.
     * @default h2
     */
    headingTag?: HeadingTag;
    /** Count for list data presented in the Modal. */
    count?: number;
    /** Content for the Modal. */
    children: ReactNode;
    /** Actions for the Modal. */
    actions?: ReactNode;
    /**
     * Render the modal in full width and height.
     * @default false
     */
    stretch?: boolean;
    /**
     * Toggle to position the Modal vertically centered or not.
     * @default false
     */
    center?: boolean;
    /**
     * Automatically compute the width of the Modal based on the content.
     * @default false
     */
    autoWidth?: boolean;
    /** Takes a React Ref of the element to be focused initially on mounting Modal. */
    defaultFocus?: RefObject<HTMLElement>;
    /** Accepts a callback function that gets invoked before opening a Modal. */
    onBeforeOpen?: () => void;
    /** Accepts a callback function that gets invoked after opening a Modal. */
    onAfterOpen?: () => void;
    /** Accepts a callback function that gets invoked before closing a Modal. */
    onBeforeClose?: () => void;
    /** Accepts a callback function that gets invoked after closing a Modal. */
    onAfterClose?: () => void;
    /**
     * Accepts a callback function that returns a boolean before dismissing a modal.
     * If the boolean is false, the modal will not be dismissed.
     */
    onRequestDismiss?: () => boolean | void;
    /**
     * Accepts a callback function that returns a boolean before minimizing a modal.
     * If the boolean is false, the modal will not be minimized.
     */
    onRequestMinimize?: () => boolean | void;
    /**
     * Accepts a callback function that returns a boolean before maximizing a modal.
     * If the boolean is false, the modal will not be maximized.
     */
    onRequestMaximize?: () => boolean | void;
    /**
     * Accepts a callback function that returns a boolean before docking a modal.
     * If the boolean is false, the modal will not be dockable.
     */
    onRequestDock?: () => boolean | void;
    /**
     * Accepts a callback function that returns a boolean before activating a modal.
     * If the boolean is false, the modal will not be activated.
     */
    onRequestActivate?: () => boolean | void;
}
export type ModalState = 'open' | 'closed' | 'minimized' | 'maximized' | 'docked';
export interface ModalMethods<P extends object = object> {
    /** Closes the referenced Modal when called. */
    dismiss: () => void;
    /** Updates the referenced Modal with a set of props. */
    update: (props: Partial<P>) => void;
    /** Minimizes the referenced Modal. */
    minimize: () => void;
    /** Maximizes the referenced Modal. */
    maximize: () => void;
    /** Docks the referenced Modal. */
    dock: () => void;
    /** Will reopen the referenced Modal if minimized, and minimize any open Modals that are minimizable. */
    activate: () => void;
    /** Removes the referenced Modal from the DOM. */
    unmount: () => void;
}
export interface ModalManagerContextValue {
    /**
     * The function that will create the Modal. This function accepts the component to render a Modal,
     * props for that component, and options for that Modal.
     */
    create: <P extends object>(component: ComponentType<P>, props?: DeferInfer<P>, options?: ModalOptions) => ModalMethods<P>;
    ModalContext: Context<ModalContextValue>;
    initialized: boolean;
}
export interface ModalContextValue extends ModalMethods, ModalOptions {
    state: ModalState;
    top: boolean;
    /** @internal */
    initialized: boolean;
}
export interface ModalObject<P extends object = object> {
    id: string;
    state: ModalState;
    methods: ModalMethods<P>;
    props?: P;
    Component: ComponentType<P>;
    options: ModalOptions;
}
//# sourceMappingURL=Modal.types.d.ts.map