import { ShadowlessElement } from '@blockeditor/lit';
import type { Middleware, ReferenceElement, VirtualElement } from '@floating-ui/dom';
import type { TemplateResult } from 'lit';
type MenuCommon = {
    hide?: () => boolean;
};
type GroupMenu = MenuCommon & {
    type: 'group';
    name: string;
    children: () => NormalMenu[];
};
type MenuClass = (string & {}) | 'delete-item';
type NormalMenu = MenuCommon & ({
    type: 'action';
    name: string;
    isSelected?: boolean;
    label?: TemplateResult;
    icon?: TemplateResult;
    postfix?: TemplateResult;
    select: () => void;
    onHover?: (hover: boolean) => void;
    class?: MenuClass;
} | {
    type: 'checkbox';
    name: string;
    checked: boolean;
    postfix?: TemplateResult;
    label?: TemplateResult;
    select: (checked: boolean) => boolean;
    class?: string;
} | {
    type: 'sub-menu';
    name: string;
    label?: TemplateResult;
    postfix?: TemplateResult;
    icon?: TemplateResult;
    options: MenuOptions;
} | {
    type: 'custom';
    render: TemplateResult;
});
export type Menu = GroupMenu | NormalMenu;
export type MenuOptions = {
    onComplete?: () => void;
    onClose?: () => void;
    style?: string;
    input?: {
        search?: boolean;
        placeholder?: string;
        initValue?: string;
        onComplete?: (text: string) => void;
        left?: TemplateResult;
        right?: TemplateResult;
    };
    items: Menu[];
};
declare const MenuComponent_base: typeof ShadowlessElement & import("@blockeditor/global/utils").Constructor<import("@blockeditor/lit").DisposableClass>;
export declare class MenuComponent<_T> extends MenuComponent_base {
    static styles: import("lit").CSSResult;
    options: MenuOptions;
    private _text?;
    private _selectedIndex?;
    private subMenu?;
    private inputRef;
    private allItems;
    private selectableItems;
    private _checked;
    private setChecked;
    private getChecked;
    private get minIndex();
    private get selectedIndex();
    private set selectedIndex(value);
    private get text();
    private set text(value);
    private close;
    private _inputText;
    firstUpdated(): void;
    disconnectedCallback(): void;
    private show;
    private processMap;
    private process;
    private _complete;
    private focusInput;
    private _clickContainer;
    private get selectedItem();
    private _mouseEnter;
    private initTime;
    private _isConsciousChoice;
    private clearSubMenu;
    mouseEnterHeader: () => void;
    processItems(): void;
    render(): TemplateResult<1>;
    private showHeader;
    private get isSearchMode();
}
declare global {
    interface HTMLElementTagNameMap {
        'affine-menu': MenuComponent<unknown>;
    }
}
export declare const createModal: (container?: HTMLElement) => HTMLDivElement;
export declare const positionToVRect: (x: number, y: number) => VirtualElement;
export declare const eventToVRect: (e: MouseEvent) => VirtualElement;
export declare const createPopup: (target: ReferenceElement, content: HTMLElement, options?: {
    onClose?: () => void;
    middleware?: Array<Middleware | null | undefined | false>;
}) => () => void;
export type MenuHandler = {
    close: () => void;
};
export declare const popMenu: <T>(target: ReferenceElement, props: {
    options: MenuOptions;
    middleware?: Array<Middleware | null | undefined | false>;
}) => MenuHandler;
export declare const popFilterableSimpleMenu: (target: ReferenceElement, options: Menu[], onClose?: () => void) => void;
export {};
//# sourceMappingURL=menu.d.ts.map