import { GestureResponderEvent } from "react-native"; import { IHtmlDivProps } from "../../html/types"; import { IClassName } from "../../types"; import { IVariantPropsModal } from "../../variants/modal"; export declare const Modal: ({ visible, testID, backdropClassName, onPress, variant, className, onAccessibilityEscape, containerClassName, dismissable: customDismissable, onDismiss, ...props }: IModalProps) => import("react/jsx-runtime").JSX.Element; export interface IModalProps extends IHtmlDivProps { /** * Indicates whether the modal is currently visible. * If set to true, the modal will be displayed; otherwise, it will be hidden. */ visible?: boolean; backdropClassName?: IClassName; /** * A callback function that is called when an attempt is made to close the modal. * The event parameter can be either a GestureResponderEvent or a KeyboardEvent. * @param event * @returns */ onDismiss?: (event?: GestureResponderEvent | KeyboardEvent) => any; /*** * When set to true, pressing the backdrop will close the modal. Defaults to true unless specified otherwise. */ dismissable?: boolean; containerClassName?: IClassName; onAccessibilityEscape?: IHtmlDivProps["onAccessibilityEscape"]; variant?: IVariantPropsModal; } export interface IModalContext { isOpen?: () => boolean; isClosed?: () => boolean; isVisible?: boolean; handleDismiss: (e: GestureResponderEvent | KeyboardEvent) => any; dismissable: boolean; } /** * A custom hook that provides access to the modal context. * This hook allows components to easily consume the modal context * without needing to use the `useContext` hook directly. * * @function useModal * @returns {IModalContext | null} The current modal context value, which includes * properties and methods for managing modal state. Returns null if the context * is not available, indicating that the component is not wrapped in a corresponding * provider. * * @example * // Example of using the useModal hook in a component * import * as React from 'react'; * import { useModal } from './path/to/useModal'; import { disabled } from '../../../../../../frontend-dash/src/decorators/all/index'; * * const ModalComponent = () => { * const modalContext = useModal(); * * if (!modalContext) { * return