import * as React from 'react'; export interface Props { children: React.ReactNode; portalElement?: React.ReactElement; portalContent: React.ReactNode | ((params: PortalContentRenderProps) => React.ReactNode); onOpen?: () => void; onClose?: () => void; onShouldClose?: () => void; closeOnScroll?: boolean; closeOnOutsideClick?: boolean; closeOnKeyDown?: (event: KeyboardEvent) => boolean; isOpen?: boolean; positionStrategy?: PositioningStrategy; rootNode?: HTMLElement; /** * The component or HTML tag to render as the wrapper for the children. * * @default 'span' */ as?: React.ElementType; } export interface PortalContentRenderProps { close: () => void; isOpen: boolean; isPositioned: boolean; strategy: Strategy; relatedWidth: number; relatedHeight: number; transitionStarted: () => void; transitionEnded: () => void; } export type PositioningStrategy = (parentRect: ClientRect, portalRect: ClientRect, props: Props) => { top: number; left: number; strategy: Strategy; }; export declare enum Position { ABOVE_LEFT = "ABOVE_LEFT", ABOVE_RIGHT = "ABOVE_RIGHT", BELOW_LEFT = "BELOW_LEFT", BELOW_RIGHT = "BELOW_RIGHT" } export declare const defaultPositionStrategy: PositioningStrategy; interface State { top?: number; left?: number; portalRect?: ClientRect | DOMRect; parentRect?: ClientRect | DOMRect; isPositioned: boolean; isOpen: boolean; transitionActive: boolean; shouldRender: boolean; scrollParents: Array; strategy?: Strategy; } declare class PositioningPortal extends React.Component, State> { static defaultProps: { isOpen: boolean; closeOnScroll: boolean; onOpen: () => void; onClose: () => void; onShouldClose: () => void; closeOnOutsideClick: boolean; closeOnKeyDown: (event: KeyboardEvent) => boolean; positionStrategy: PositioningStrategy; }; state: State; private portalRef; private parentRef; componentDidMount(): void; componentDidUpdate(prevProps: Props): void; componentWillUnmount(): void; close: () => void; transitionStarted: () => void; transitionEnded: () => void; private handleOutsideMouseClick; private handleKeydown; private onOpen; private onClose; private markClickEvent; private preRenderPortal; private finalRenderPortal; render(): React.ReactElement>; } export default PositioningPortal;