import React from 'react'; import PropTypes from 'prop-types'; interface AdditionalInterpolationProperties { top?: number; } type ModalLayerRenderModalHandler = (interpolatedStyle: { opacity: number; } & AdditionalInterpolationProperties) => React.ReactNode; type ModalLayerRequestCloseHandler = (data: { event: React.MouseEvent | MouseEvent | KeyboardEvent | TouchEvent; reason: 'clickAway' | 'escapeKey'; }) => void; interface ModalLayerPropsBase { /** * Indicate whether the animation of the children is still running. * If true, the ModalLayer should not close. */ childrenInAnimation?: boolean; /** * A function that returns a default style object for the animation. The values will be * used as initial values. */ getDefaultMotionStyle?: () => AdditionalInterpolationProperties; /** * A function that returns a style object. The resulting interpolated style * will be passed to `renderModal`. */ getMotionStyle?: () => AdditionalInterpolationProperties; /** * A function that will be called when a close event occurs. * The callback will be passed a reason (either 'escapeKey', 'clickAway') and the event. */ onRequestClose?: ModalLayerRequestCloseHandler; /** * Indicates whether the modal is currently open. */ open?: boolean; /** * Function that renders the modal. It is passed the current style object as interpolated by the animation, * and is expected to return renderable content. */ renderModal: ModalLayerRenderModalHandler; /** * The non-hidden overlay mask covers the entire page, blocks other interactions while the Modal is open. * If set to `interactive`, clicking on the scrim will close the Modal. */ scrim?: 'visible' | 'hidden' | 'interactive'; } declare function ModalLayer({ childrenInAnimation, getDefaultMotionStyle, getMotionStyle, onRequestClose, open, renderModal, scrim, }: ModalLayerPropsBase): React.JSX.Element; declare namespace ModalLayer { var propTypes: { childrenInAnimation: PropTypes.Requireable; getDefaultMotionStyle: PropTypes.Requireable<(...args: any[]) => any>; getMotionStyle: PropTypes.Requireable<(...args: any[]) => any>; onRequestClose: PropTypes.Requireable<(...args: any[]) => any>; open: PropTypes.Requireable; renderModal: PropTypes.Validator<(...args: any[]) => any>; scrim: PropTypes.Requireable; }; } export default ModalLayer; export { ModalLayerRequestCloseHandler, ModalLayerRenderModalHandler };