import * as React from 'react'; import { Primitive } from '@radix-ui/react-primitive'; type PrimitiveDivProps = React.ComponentPropsWithoutRef; interface DismissableLayerProps extends PrimitiveDivProps { /** * When `true`, hover/focus/click interactions will be disabled on elements outside * the `DismissableLayer`. Users will need to click twice on outside elements to * interact with them: once to close the `DismissableLayer`, and again to trigger the element. */ disableOutsidePointerEvents?: boolean; /** * When `true`, a `'pointerdown'` event outside of the layered element will * wait for the interaction's click event before dispatching, allowing * third-party code to stop propagation of later events and cancel dismissal. */ deferPointerDownOutside?: boolean; /** * Event handler called when the escape key is down. * Can be prevented. */ onEscapeKeyDown?: (event: KeyboardEvent) => void; /** * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. * Can be prevented. */ onPointerDownOutside?: (event: PointerDownOutsideEvent) => void; /** * Event handler called when the focus moves outside of the `DismissableLayer`. * Can be prevented. */ onFocusOutside?: (event: FocusOutsideEvent) => void; /** * Event handler called when an interaction happens outside the `DismissableLayer`. * Specifically, when a `pointerdown` event happens outside or focus moves outside of it. * Can be prevented. */ onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void; /** * Handler called when the `DismissableLayer` should be dismissed */ onDismiss?: () => void; } declare const DismissableLayer: React.ForwardRefExoticComponent>; type DismissableLayerBranchElement = React.ComponentRef; interface DismissableLayerBranchProps extends PrimitiveDivProps { } declare const DismissableLayerBranch: React.ForwardRefExoticComponent>; /** * Registers a node as a "dismiss surface" for the enclosing DismissableLayer */ declare function useDismissableLayerSurface(): React.RefCallback; type PointerDownOutsideEvent = CustomEvent<{ originalEvent: PointerEvent; }>; type FocusOutsideEvent = CustomEvent<{ originalEvent: FocusEvent; }>; declare const Root: React.ForwardRefExoticComponent>; declare const Branch: React.ForwardRefExoticComponent>; export { Branch, DismissableLayer, DismissableLayerBranch, type DismissableLayerProps, Root, useDismissableLayerSurface };