@navikt/ds-react
Version:
React components from the Norwegian Labour and Welfare Administration.
13 lines (12 loc) • 835 B
TypeScript
import React from "react";
import type { ModalProps } from "./types";
export interface MouseCoordinates {
clientX: number;
clientY: number;
}
export declare const coordsAreInside: ({ clientX, clientY }: MouseCoordinates, { left, top, right, bottom }: DOMRect) => boolean;
export declare function getCloseHandler(modalRef: React.RefObject<HTMLDialogElement | null>, header: ModalProps["header"], onBeforeClose: ModalProps["onBeforeClose"]): (() => false | void | undefined) | undefined;
declare function useIsModalOpen(modalRef: HTMLDialogElement | null): boolean;
export declare const BODY_CLASS_LEGACY = "navds-modal__document-body";
declare function useBodyScrollLock(modalRef: React.RefObject<HTMLDialogElement | null>, portalNode: HTMLElement | null, isNested: boolean): void;
export { useIsModalOpen, useBodyScrollLock };