import * as React from 'react'; export declare type ModalFullConfig = { open: boolean; persistent: boolean; /** * If false, the state will jump from `opened` to `closed` * If true, the state will have an `opening` and `closing` phase lasting `animationDuration` */ animated: boolean; /** * Duration of the `opening` and `closing` state in millisecond */ animationDuration: number; onClose: () => void; ref?: React.Ref; /** * Value cached from the last time the modal was opening / opened * Can be useful if you want to keep Modal UI consistent during `closing` phase while resetting your application state. * For instance : * ```tsx * const MyComponent = () => { * const [selectedRow, setSelectedRow] = React.useState(null) * const ref = React.useRef(null) * const modal = useModal({ ref, onClose: () => setSelectedRow(null), open: selectedRow !== null, value: selectedRow }) * * return ( * * * { modal.state !== ModalState.closed && } * * ) * * } * ``` */ value: Value; }; export declare type ModalConfig = Partial>; export declare enum ModalState { opening = "opening", opened = "opened", closing = "closing", closed = "closed" } export declare type Modal = { state: ModalState; close: (...args: any[]) => void; ref: React.RefObject; hasAlreadyBeenOpened: boolean; value: Value; persistent: boolean; animated: boolean; animationDuration: number; }; //# sourceMappingURL=useModal.interface.d.ts.map