import React from 'react'; import { Dict } from 'utils'; export interface UseModalProps { open?: boolean; id?: string; onClose(): void; /** If `true`, scrolling will be disabled on the `body` when the modal opens. */ blockScrollOnMount?: boolean; closeOnOverlayClick?: boolean; closeOnEsc?: boolean; onOverlayClick?(): void; onEsc?(): void; /** * A11y: If `true`, the siblings of the `modal` will have `aria-hidden` * set to `true` so that screen readers can only see the `modal`. * This is commonly known as making the other elements **inert** * @default true */ useInert?: boolean; /** If true, a padding-right will be applied to the body element to preserve the scrollbar gap. */ preserveScrollBarGap?: boolean; } /** * Modal hook to polyfill `aria-modal`. * * It applies `aria-hidden` to elements behind the modal * to indicate that they're `inert`. * * @param ref React ref of the node * @param shouldHide whether `aria-hidden` should be applied */ export declare function useAriaHidden(ref: React.RefObject, shouldHide: boolean): void; /** * Modal hook that manages all the logic for the modal dialog widget * and returns prop getters, state and actions. * * @param props */ export declare function useModal(props: UseModalProps): { open: boolean; onClose: () => void; headerId: string; bodyId: string; titleId: string; setBodyMounted: React.Dispatch>; setHeaderMounted: React.Dispatch>; dialogRef: React.MutableRefObject; getContentProps: (contentProps?: Dict) => { ref: (node: HTMLElement | null) => void; id: string; role: any; tabIndex: number; 'aria-modal': boolean; 'aria-labelledby': string | undefined; 'aria-describedby': string | undefined; onClick: (event: unknown) => void; }; getOverlayProps: (overlayProps?: Dict) => { ref: (node: HTMLElement | null) => void; onClick: (event: unknown) => void; onKeyDown: (event: unknown) => void; onMouseDown: (event: unknown) => void; }; }; export declare type UseModalReturn = ReturnType;