import React from 'react';
import type { Options as FocusTrapOptions } from 'focus-trap';
import type { Position } from './utils';
export interface Props {
    absoluteOffset?: Position;
    alignX?: 'left' | 'right' | 'center' | 'end';
    alignY?: 'top' | 'bottom' | 'start';
    allowOutOfBounds?: boolean;
    /** `null` should only be used if we provide enough context to screen readers to exclude aria-label attribute */
    ariaLabel?: string | null;
    boundariesElement?: HTMLElement;
    children?: React.ReactNode;
    fitHeight?: number;
    fitWidth?: number;
    /** Enable focus trap to contain the user's focus within the popup */
    focusTrap?: boolean | FocusTrapOptions;
    forcePlacement?: boolean;
    mountTo?: HTMLElement;
    offset?: number[];
    onPlacementChanged?: (placement: [
        string,
        string
    ]) => void;
    onPositionCalculated?: (position: Position) => Position;
    onUnmount?: () => void;
    preventOverflow?: boolean;
    rect?: DOMRect;
    role?: string;
    scrollableElement?: HTMLElement;
    shouldRenderPopup?: (position: Position) => boolean;
    stick?: boolean;
    style?: React.CSSProperties;
    target?: HTMLElement;
    zIndex?: number;
}
export interface State {
    popup?: HTMLElement;
    position?: Position;
    validPosition: boolean;
}
export default class Popup extends React.Component<Props, State> {
    scrollElement: undefined | false | HTMLElement;
    scrollParentElement: undefined | false | HTMLElement;
    rafIds: Set<number>;
    static defaultProps: {
        offset: number[];
        allowOutOfBound: boolean;
    };
    state: State;
    private popupRef;
    private focusTrap?;
    private placement;
    /**
     * Calculates new popup position
     */
    private calculatePosition;
    private updatePosition;
    private cannotSetPopup;
    /**
     * Popup initialization.
     * Checks whether it's possible to position popup along given target, and if it's not throws an error.
     */
    private initPopup;
    private handleRef;
    private scheduledUpdatePosition;
    onResize: () => void;
    resizeObserver: ResizeObserver | undefined;
    /**
     * Raf scheduled so that it also occurs after the initial update position
     */
    private initFocusTrap;
    /**
     * Cancels the initialisation of the focus trap if it has not yet occured
     * Deactivates the focus trap if it exists
     */
    private destroyFocusTrap;
    /**
     * Handle pausing, unpausing, and initialising (if not yet initialised) of the focus trap
     */
    handleChangedFocusTrapProp(prevProps: Props): void;
    componentDidUpdate(prevProps: Props): void;
    componentDidMount(): void;
    componentWillUnmount(): void;
    private renderPopup;
    render(): React.JSX.Element | null;
}
