import { SubmenuAction, IAction } from '../../../base/common/actions.js';
import { Event } from '../../../base/common/event.js';
import { IDisposable } from '../../../base/common/lifecycle.js';
import { ICommandAction, ICommandActionTitle, Icon } from '../../action/common/action.js';
import { ICommandService } from '../../commands/common/commands.service.js';
import { ContextKeyExpression } from '../../contextkey/common/contextkey.js';
import { IContextKeyService } from '../../contextkey/common/contextkey.service.js';

interface IMenuItem {
    command: ICommandAction;
    alt?: ICommandAction;
    when?: ContextKeyExpression;
    group?: 'navigation' | string;
    order?: number;
    isHiddenByDefault?: boolean;
}
interface ISubmenuItem {
    title: string | ICommandActionTitle;
    submenu: MenuId;
    icon?: Icon;
    when?: ContextKeyExpression;
    group?: 'navigation' | string;
    order?: number;
    isSelection?: boolean;
    rememberDefaultAction?: boolean;
}
declare class MenuId {
    private static readonly _instances;
    static readonly CommandPalette: MenuId;
    static readonly DebugBreakpointsContext: MenuId;
    static readonly DebugCallStackContext: MenuId;
    static readonly DebugConsoleContext: MenuId;
    static readonly DebugVariablesContext: MenuId;
    static readonly NotebookVariablesContext: MenuId;
    static readonly DebugHoverContext: MenuId;
    static readonly DebugWatchContext: MenuId;
    static readonly DebugToolBar: MenuId;
    static readonly DebugToolBarStop: MenuId;
    static readonly EditorContext: MenuId;
    static readonly SimpleEditorContext: MenuId;
    static readonly EditorContent: MenuId;
    static readonly EditorLineNumberContext: MenuId;
    static readonly EditorContextCopy: MenuId;
    static readonly EditorContextPeek: MenuId;
    static readonly EditorContextShare: MenuId;
    static readonly EditorTitle: MenuId;
    static readonly EditorTitleRun: MenuId;
    static readonly EditorTitleContext: MenuId;
    static readonly EditorTitleContextShare: MenuId;
    static readonly EmptyEditorGroup: MenuId;
    static readonly EmptyEditorGroupContext: MenuId;
    static readonly EditorTabsBarContext: MenuId;
    static readonly EditorTabsBarShowTabsSubmenu: MenuId;
    static readonly EditorTabsBarShowTabsZenModeSubmenu: MenuId;
    static readonly EditorActionsPositionSubmenu: MenuId;
    static readonly ExplorerContext: MenuId;
    static readonly ExplorerContextShare: MenuId;
    static readonly ExtensionContext: MenuId;
    static readonly GlobalActivity: MenuId;
    static readonly CommandCenter: MenuId;
    static readonly CommandCenterCenter: MenuId;
    static readonly LayoutControlMenuSubmenu: MenuId;
    static readonly LayoutControlMenu: MenuId;
    static readonly MenubarMainMenu: MenuId;
    static readonly MenubarAppearanceMenu: MenuId;
    static readonly MenubarDebugMenu: MenuId;
    static readonly MenubarEditMenu: MenuId;
    static readonly MenubarCopy: MenuId;
    static readonly MenubarFileMenu: MenuId;
    static readonly MenubarGoMenu: MenuId;
    static readonly MenubarHelpMenu: MenuId;
    static readonly MenubarLayoutMenu: MenuId;
    static readonly MenubarNewBreakpointMenu: MenuId;
    static readonly PanelAlignmentMenu: MenuId;
    static readonly PanelPositionMenu: MenuId;
    static readonly ActivityBarPositionMenu: MenuId;
    static readonly MenubarPreferencesMenu: MenuId;
    static readonly MenubarRecentMenu: MenuId;
    static readonly MenubarSelectionMenu: MenuId;
    static readonly MenubarShare: MenuId;
    static readonly MenubarSwitchEditorMenu: MenuId;
    static readonly MenubarSwitchGroupMenu: MenuId;
    static readonly MenubarTerminalMenu: MenuId;
    static readonly MenubarViewMenu: MenuId;
    static readonly MenubarHomeMenu: MenuId;
    static readonly OpenEditorsContext: MenuId;
    static readonly OpenEditorsContextShare: MenuId;
    static readonly ProblemsPanelContext: MenuId;
    static readonly SCMInputBox: MenuId;
    static readonly SCMChangesSeparator: MenuId;
    static readonly SCMIncomingChanges: MenuId;
    static readonly SCMIncomingChangesContext: MenuId;
    static readonly SCMIncomingChangesSetting: MenuId;
    static readonly SCMOutgoingChanges: MenuId;
    static readonly SCMOutgoingChangesContext: MenuId;
    static readonly SCMOutgoingChangesSetting: MenuId;
    static readonly SCMIncomingChangesAllChangesContext: MenuId;
    static readonly SCMIncomingChangesHistoryItemContext: MenuId;
    static readonly SCMOutgoingChangesAllChangesContext: MenuId;
    static readonly SCMOutgoingChangesHistoryItemContext: MenuId;
    static readonly SCMChangeContext: MenuId;
    static readonly SCMResourceContext: MenuId;
    static readonly SCMResourceContextShare: MenuId;
    static readonly SCMResourceFolderContext: MenuId;
    static readonly SCMResourceGroupContext: MenuId;
    static readonly SCMSourceControl: MenuId;
    static readonly SCMSourceControlInline: MenuId;
    static readonly SCMSourceControlTitle: MenuId;
    static readonly SCMTitle: MenuId;
    static readonly SearchContext: MenuId;
    static readonly SearchActionMenu: MenuId;
    static readonly StatusBarWindowIndicatorMenu: MenuId;
    static readonly StatusBarRemoteIndicatorMenu: MenuId;
    static readonly StickyScrollContext: MenuId;
    static readonly TestItem: MenuId;
    static readonly TestItemGutter: MenuId;
    static readonly TestMessageContext: MenuId;
    static readonly TestMessageContent: MenuId;
    static readonly TestPeekElement: MenuId;
    static readonly TestPeekTitle: MenuId;
    static readonly TouchBarContext: MenuId;
    static readonly TitleBarContext: MenuId;
    static readonly TitleBarTitleContext: MenuId;
    static readonly TunnelContext: MenuId;
    static readonly TunnelPrivacy: MenuId;
    static readonly TunnelProtocol: MenuId;
    static readonly TunnelPortInline: MenuId;
    static readonly TunnelTitle: MenuId;
    static readonly TunnelLocalAddressInline: MenuId;
    static readonly TunnelOriginInline: MenuId;
    static readonly ViewItemContext: MenuId;
    static readonly ViewContainerTitle: MenuId;
    static readonly ViewContainerTitleContext: MenuId;
    static readonly ViewTitle: MenuId;
    static readonly ViewTitleContext: MenuId;
    static readonly CommentEditorActions: MenuId;
    static readonly CommentThreadTitle: MenuId;
    static readonly CommentThreadActions: MenuId;
    static readonly CommentThreadAdditionalActions: MenuId;
    static readonly CommentThreadTitleContext: MenuId;
    static readonly CommentThreadCommentContext: MenuId;
    static readonly CommentTitle: MenuId;
    static readonly CommentActions: MenuId;
    static readonly CommentsViewThreadActions: MenuId;
    static readonly InteractiveToolbar: MenuId;
    static readonly InteractiveCellTitle: MenuId;
    static readonly InteractiveCellDelete: MenuId;
    static readonly InteractiveCellExecute: MenuId;
    static readonly InteractiveInputExecute: MenuId;
    static readonly IssueReporter: MenuId;
    static readonly NotebookToolbar: MenuId;
    static readonly NotebookStickyScrollContext: MenuId;
    static readonly NotebookCellTitle: MenuId;
    static readonly NotebookCellDelete: MenuId;
    static readonly NotebookCellInsert: MenuId;
    static readonly NotebookCellBetween: MenuId;
    static readonly NotebookCellListTop: MenuId;
    static readonly NotebookCellExecute: MenuId;
    static readonly NotebookCellExecuteGoTo: MenuId;
    static readonly NotebookCellExecutePrimary: MenuId;
    static readonly NotebookDiffCellInputTitle: MenuId;
    static readonly NotebookDiffCellMetadataTitle: MenuId;
    static readonly NotebookDiffCellOutputsTitle: MenuId;
    static readonly NotebookOutputToolbar: MenuId;
    static readonly NotebookOutlineFilter: MenuId;
    static readonly NotebookOutlineActionMenu: MenuId;
    static readonly NotebookEditorLayoutConfigure: MenuId;
    static readonly NotebookKernelSource: MenuId;
    static readonly BulkEditTitle: MenuId;
    static readonly BulkEditContext: MenuId;
    static readonly TimelineItemContext: MenuId;
    static readonly TimelineTitle: MenuId;
    static readonly TimelineTitleContext: MenuId;
    static readonly TimelineFilterSubMenu: MenuId;
    static readonly AccountsContext: MenuId;
    static readonly SidebarTitle: MenuId;
    static readonly PanelTitle: MenuId;
    static readonly AuxiliaryBarTitle: MenuId;
    static readonly AuxiliaryBarHeader: MenuId;
    static readonly TerminalInstanceContext: MenuId;
    static readonly TerminalEditorInstanceContext: MenuId;
    static readonly TerminalNewDropdownContext: MenuId;
    static readonly TerminalTabContext: MenuId;
    static readonly TerminalTabEmptyAreaContext: MenuId;
    static readonly TerminalStickyScrollContext: MenuId;
    static readonly WebviewContext: MenuId;
    static readonly InlineCompletionsActions: MenuId;
    static readonly InlineEditActions: MenuId;
    static readonly NewFile: MenuId;
    static readonly MergeInput1Toolbar: MenuId;
    static readonly MergeInput2Toolbar: MenuId;
    static readonly MergeBaseToolbar: MenuId;
    static readonly MergeInputResultToolbar: MenuId;
    static readonly InlineSuggestionToolbar: MenuId;
    static readonly InlineEditToolbar: MenuId;
    static readonly ChatContext: MenuId;
    static readonly ChatCodeBlock: MenuId;
    static readonly ChatMessageTitle: MenuId;
    static readonly ChatExecute: MenuId;
    static readonly ChatExecuteSecondary: MenuId;
    static readonly ChatInputSide: MenuId;
    static readonly AccessibleView: MenuId;
    static readonly MultiDiffEditorFileToolbar: MenuId;
    static readonly DiffEditorHunkToolbar: MenuId;
    static readonly DiffEditorSelectionToolbar: MenuId;
    /**
     * Create or reuse a `MenuId` with the given identifier
     */
    static for(identifier: string): MenuId;
    readonly id: string;
    /**
     * Create a new `MenuId` with the unique identifier. Will throw if a menu
     * with the identifier already exists, use `MenuId.for(ident)` or a unique
     * identifier
     */
    constructor(identifier: string);
}
interface IMenuActionOptions {
    arg?: any;
    shouldForwardArgs?: boolean;
    renderShortTitle?: boolean;
}
interface IMenuChangeEvent {
    readonly menu: IMenu;
    readonly isStructuralChange: boolean;
    readonly isToggleChange: boolean;
    readonly isEnablementChange: boolean;
}
interface IMenu extends IDisposable {
    readonly onDidChange: Event<IMenuChangeEvent>;
    getActions(options?: IMenuActionOptions): [
        string,
        Array<MenuItemAction | SubmenuItemAction>
    ][];
}
interface IMenuCreateOptions {
    emitEventsForSubmenuChanges?: boolean;
    eventDebounceDelay?: number;
}
type ICommandsMap = Map<string, ICommandAction>;
interface IMenuRegistryChangeEvent {
    has(id: MenuId): boolean;
}
interface IMenuRegistry {
    readonly onDidChangeMenu: Event<IMenuRegistryChangeEvent>;
    addCommand(userCommand: ICommandAction): IDisposable;
    getCommand(id: string): ICommandAction | undefined;
    getCommands(): ICommandsMap;
    /**
     * @deprecated Use `appendMenuItem` or most likely use `registerAction2` instead. There should be no strong
     * reason to use this directly.
     */
    appendMenuItems(items: Iterable<{
        id: MenuId;
        item: IMenuItem | ISubmenuItem;
    }>): IDisposable;
    appendMenuItem(menu: MenuId, item: IMenuItem | ISubmenuItem): IDisposable;
    getMenuItems(loc: MenuId): Array<IMenuItem | ISubmenuItem>;
}
declare const MenuRegistry: IMenuRegistry;
declare class SubmenuItemAction extends SubmenuAction {
    readonly item: ISubmenuItem;
    readonly hideActions: IMenuItemHide | undefined;
    constructor(item: ISubmenuItem, hideActions: IMenuItemHide | undefined, actions: IAction[]);
}
interface IMenuItemHide {
    readonly isHidden: boolean;
    readonly hide: IAction;
    readonly toggle: IAction;
}
declare class MenuItemAction implements IAction {
    readonly hideActions: IMenuItemHide | undefined;
    private _commandService;
    static label(action: ICommandAction, options?: IMenuActionOptions): string;
    readonly item: ICommandAction;
    readonly alt: MenuItemAction | undefined;
    private readonly _options;
    readonly id: string;
    readonly label: string;
    readonly tooltip: string;
    readonly class: string | undefined;
    readonly enabled: boolean;
    readonly checked?: boolean;
    constructor(item: ICommandAction, alt: ICommandAction | undefined, options: IMenuActionOptions | undefined, hideActions: IMenuItemHide | undefined, contextKeyService: IContextKeyService, _commandService: ICommandService);
    run(...args: any[]): Promise<void>;
}

export { type IMenu, type IMenuActionOptions, type IMenuChangeEvent, type IMenuCreateOptions, type IMenuItem, type IMenuItemHide, type IMenuRegistry, type IMenuRegistryChangeEvent, type ISubmenuItem, MenuId, MenuItemAction, MenuRegistry, SubmenuItemAction };
