import React, { JSXElementConstructor } from 'react'; /** @public */ type LayerPossibleCloseReason = 'clickAway' | 'escapeKey'; /** @public */ type LayerRequestCloseHandler = (data: { event: MouseEvent | KeyboardEvent | TouchEvent; reason: LayerPossibleCloseReason; }) => void; interface LayerProps { children?: React.ReactNode; /** * An array of reasons (`clickAway`, `escapeKey`) for which this `Layer` should close. */ closeReasons?: LayerPossibleCloseReason[]; /** * Invoked when a potential close event occurs. The function is passed a data object * containing the event and a reason. Possible reasons are `escapeKey` and `clickAway`. */ onRequestClose?: LayerRequestCloseHandler; /** * Whether the component is currently open. */ open?: boolean; } declare const Layer: JSXElementConstructor & { layerContainer: HTMLDivElement | null; possibleCloseReasons: LayerPossibleCloseReason[]; propTypes: React.WeakValidationMap; }; export default Layer; export { LayerProps, LayerRequestCloseHandler }; export type { LayerPossibleCloseReason };