import React, { CSSProperties, ReactNode, RefObject } from "react"; import { RejectCommand, ShowCommand } from "./DialogCommands"; type UseDialogCallbacks = { show: ShowCommand; reject: RejectCommand; }; export type UseDialogResult = [ ReactNode, UseDialogCallbacks ]; export interface DialogOptions { divInsteadOfDialog?: boolean; elementId?: string; background?: string; disableCloseOnClickOutside?: boolean; /** * Blocks scrolling of the page behind the dialog while it is open. * @default true */ blockScroll?: boolean; modal: boolean; className: string; closingClassName: string; contentWrapperClassName: string; contentWrapperStyle?: CSSProperties; dialogStyle?: CSSProperties; ref?: RefObject; onResolve?: () => void; onReject?: () => void; /** * Whether content is allowed to stick out of the modal, instead of being * clipped at its edges. Only has an effect together with * `divInsteadOfDialog`. * * A popover anchored to something inside the modal — a date picker, a * dropdown — is positioned relative to what it belongs to, so it cannot be * lifted out with z-index. Clipping is what cuts it off. * * The modal then cannot scroll its own content, so only use it for a modal * whose content fits. Has no effect while the modal fills the screen, as it * does on a phone. * * @default false */ allowContentOverflow?: boolean; /** * Sets aria-label on modal or dialog element. */ label?: string; /** * Sets aria-labelledby on modal or dialog element. */ labelledby?: string; /** * Sets aria-describedby on modal or dialog element. */ describedby?: string; } export declare function useDialog(component: React.FC, { ref, modal, contentWrapperClassName, closingClassName, contentWrapperStyle, dialogStyle, divInsteadOfDialog, disableCloseOnClickOutside, blockScroll, elementId, onResolve, onReject, className, background, allowContentOverflow, label, labelledby, describedby, }: DialogOptions): UseDialogResult; export {};