import { AccessibilityProps, Side, KeyboardHandlerMap } from '../shared/index.js';

interface PopoverProps {
    open?: boolean;
    defaultOpen?: boolean;
    onOpenChange?: (open: boolean) => void;
    placement?: Side;
}
interface PopoverAPI {
    /** Current open state */
    state: {
        open: boolean;
    };
    /** Props to spread on the trigger element */
    triggerProps: Partial<AccessibilityProps> & {
        'aria-expanded': boolean;
        'aria-controls': string;
        'aria-haspopup': 'dialog';
    };
    /** Props to spread on the content element */
    contentProps: {
        role: 'dialog';
        id: string;
    };
    /** Resolved placement */
    placement: Side;
    /** Open the popover */
    open: () => void;
    /** Close the popover */
    close: () => void;
    /** Toggle the popover */
    toggle: () => void;
    /** Keyboard handler map (Escape to close) */
    keyboardHandlers: KeyboardHandlerMap;
    /** Pre-built keyboard event handler */
    handleKeyDown: (event: KeyboardEvent) => void;
}
declare function createPopover(props?: PopoverProps): PopoverAPI;

declare const popoverContentVariants: (props?: ({
    side?: "top" | "right" | "bottom" | "left" | undefined;
} & {
    className?: string;
}) | undefined) => string;

export { type PopoverAPI, type PopoverProps, createPopover, popoverContentVariants };
