import Component from '@glimmer/component';
import { htmlSafe } from '@ember/template';
import { displayMapping } from '../utils/css-mappings/eui-popover';
import type { paddingSizeMapping } from '../utils/css-mappings/eui-panel';
import type { EuiPopoverPosition } from '../utils/popover/types';
import type { EmberKeyboardEvent } from 'ember-keyboard/modifiers/on-key';
type PanelPaddingSize = keyof typeof paddingSizeMapping;
export type PopoverAnchorPosition = 'upCenter' | 'upLeft' | 'upRight' | 'downCenter' | 'downLeft' | 'downRight' | 'leftCenter' | 'leftUp' | 'leftDown' | 'rightCenter' | 'rightUp' | 'rightDown';
export type EuiPopoverArgs = {
    panelClasses?: string;
    /**
     * Class name passed to the direct parent of the button
     */
    anchorClassName?: string;
    /**
     * Alignment of the popover and arrow relative to the button
     */
    anchorPosition?: PopoverAnchorPosition;
    /**
     * Style and position alteration for arrow-less, left-aligned
     * attachment. Intended for use with inputs as anchors, e.g.
     * EuiInputPopover
     */
    attachToAnchor?: boolean;
    /**
     * Triggering element for which to align the popover to
     */
    button?: Component;
    buttonRef?: (e: HTMLDivElement) => unknown;
    /**
     * Callback to handle hiding of the popover
     */
    closePopover: () => void;
    /**
     * Restrict the popover's position within this element
     */
    container?: HTMLElement;
    /**
     * CSS display type for both the popover and anchor
     */
    display?: keyof typeof displayMapping;
    /**
     * Show arrow indicating to originating button
     */
    hasArrow?: boolean;
    /**
     * Specifies what element should initially have focus; Can be a DOM
     * node, or a selector string (which will be passed to
     * document.querySelector() to find the DOM node), or a function that
     * returns a DOM node
     */
    initialFocus?: FocusTarget | false;
    /**
     * Passed directly to EuiPortal for DOM positioning. Both properties are
     * required if prop is specified
     */
    insert?: {
        sibling: HTMLElement;
        position: 'before' | 'after';
    };
    /**
     * Visibility state of the popover
     */
    isOpen?: boolean;
    /**
     * Traps tab focus within the popover contents
     */
    ownFocus?: boolean;
    /**
     * Custom class added to the EuiPanel containing the popover contents
     */
    panelClassName?: string;
    /**
     * EuiPanel padding on all sides
     */
    panelPaddingSize?: PanelPaddingSize;
    /**
     * Standard DOM `style` attribute. Passed to the EuiPanel
     */
    panelStyle?: {
        [i: string]: string;
    };
    panelRef?: (e: HTMLElement | null) => unknown;
    popoverRef?: (e: HTMLElement) => unknown;
    /**
     * when not `false`, the popover will check if this popover is inside another popover and if so. will reposition itself to be inside the other popover
     */
    shouldAccountForOtherPopovers?: boolean;
    /**
     * When `true`, the popover's position is re-calculated when the user
     * scrolls, this supports having fixed-position popover anchors
     */
    repositionOnScroll?: boolean;
    /**
     * By default, popover content inherits the z-index of the anchor
     * component; pass `zIndex` to override
     */
    zIndex?: number;
    /**
     * Function callback for when the focus trap is deactivated
     */
    onTrapDeactivation?: () => void;
    /**
     * Distance away from the anchor that the popover will render
     */
    offset?: number;
    /**
     * Minimum distance between the popover and the bounding container;
     * Pass an array of 4 values to adjust each side differently: `[top, right, bottom, left]`
     * Default is 16
     */
    buffer?: number | [number, number, number, number];
    /**
     * Element to pass as the child element of the arrow;
     * Use case is typically limited to an accompanying `EuiBeacon`
     */
    arrowChildren?: Component;
    /**
     * Provide a name to the popover panel
     */
    ariaLabel?: string;
    /**
     * Alternative option to `aria-label` that takes an `id`.
     * Usually takes the `id` of the popover title
     */
    ariaLabelledBy?: string;
    tabindex?: string | number;
    shouldSelfFocus?: boolean;
    isFocusTrapPaused?: boolean;
    focusTrapOptions?: {
        onClickOutside?: (e: Event) => void;
    };
    mutationObserverOptions?: {
        attributes?: boolean;
        childList?: boolean;
        characterData?: boolean;
        subtree?: boolean;
    };
};
export declare function getPopoverPositionFromAnchorPosition(anchorPosition: PopoverAnchorPosition): EuiPopoverPosition;
export declare function getPopoverAlignFromAnchorPosition(anchorPosition: PopoverAnchorPosition): EuiPopoverPosition;
export declare const ANCHOR_POSITIONS: string[];
export declare const DISPLAY: string[];
export type FocusTarget = HTMLElement | string | (() => HTMLElement);
type CssProps = {
    top?: number;
    left?: number;
    right?: number;
    bottom?: number;
    zIndex?: number;
};
export interface EuiPopoverSignature {
    Element: HTMLDivElement;
    Args: EuiPopoverArgs;
    Blocks: {
        button: [];
        content: [];
        arrowChildren: [];
    };
}
export default class EuiPopoverComponent extends Component<EuiPopoverSignature> {
    isOpen: boolean;
    ownFocus: boolean;
    anchorPosition: PopoverAnchorPosition;
    panelPaddingSize: PanelPaddingSize;
    hasArrow: boolean;
    display: string;
    shouldSelfFocus: boolean;
    isFocusTrapPaused: boolean;
    prevIsOpen: boolean | undefined;
    suppressingPopover: boolean | undefined;
    isClosing: boolean;
    isOpening: boolean;
    popoverStyles: CssProps;
    arrowStyles: CssProps | undefined;
    arrowPosition: EuiPopoverPosition | null;
    openPosition: EuiPopoverPosition | null;
    isOpenStable: boolean;
    isCurrentlyOpen: boolean | undefined;
    popoverHost?: HTMLElement | null;
    private respositionTimeout;
    private closingTransitionTimeout;
    private closingTransitionAnimationFrame;
    private updateFocusAnimationFrame;
    private hasSetInitialFocus;
    button: HTMLElement | null;
    panel: HTMLElement | null;
    constructor(owner: unknown, args: EuiPopoverArgs);
    get insert(): {
        sibling: HTMLElement;
        position: string;
    } | undefined;
    closePopover(): void;
    onEscapeKey(event: Event, ekEvent?: EmberKeyboardEvent): void;
    onKeyDown(event: KeyboardEvent, ekEvent: EmberKeyboardEvent): void;
    onClickOutside(event: Event): void;
    updateFocus(): void;
    onOpenPopover(): void;
    get shouldAccountForOtherPopovers(): boolean;
    checkIfPopoverIsInsideAnotherPopover(ele: HTMLElement): void;
    didInsertPopover(ele: HTMLDivElement): void;
    didUpdateRepositionOnScroll(): void;
    didUpdateIsOpen(): void;
    willDestroy(): void;
    onMutation(records: MutationRecord[]): void;
    positionPopover(allowEnforcePosition: boolean): void;
    get _arrowStyles(): ReturnType<typeof htmlSafe> | undefined;
    get _popoverStyles(): {
        [i: string]: string;
    };
    get tabindex(): string | number;
    positionPopoverFixed(): void;
    positionPopoverFluid(): void;
    registerButton(btn: HTMLDivElement): void;
    registerPanel(panel: HTMLElement): void;
}
export {};
//# sourceMappingURL=eui-popover.d.ts.map