UNPKG

@theia/core

Version:

Theia is a cloud & desktop IDE framework implemented in TypeScript.

39 lines • 2.17 kB
import { AcceleratorForm, KeybindingRegistry } from '../keybinding.js'; import { ContextKeyService } from '../context-key-service.js'; import { DisposableCollection, CommandRegistry, Emitter } from '../../common/index.js'; import { CommandMenu, ContextExpressionMatcher, MenuAction, MenuPath } from '../../common/menu/menu-types.js'; export { AcceleratorForm } from '../keybinding.js'; export interface AcceleratorSource { /** Return the accelerator rendered in the explicitly requested logical or physical form. */ getAccelerator(context: HTMLElement | undefined, form: AcceleratorForm): string[]; } export declare namespace AcceleratorSource { function is(node: unknown): node is AcceleratorSource; } /** * Node representing an action in the menu tree structure. * It's based on {@link MenuAction} for which it tries to determine the * best label, icon and sortString with the given data. */ export declare class ActionMenuNode implements CommandMenu { protected readonly action: MenuAction; protected readonly commands: CommandRegistry; protected readonly keybindingRegistry: KeybindingRegistry; protected readonly contextKeyService: ContextKeyService; protected readonly disposables: DisposableCollection; protected readonly onDidChangeEmitter: Emitter<void>; onDidChange: import("../../common/event.js").Event<void>; constructor(action: MenuAction, commands: CommandRegistry, keybindingRegistry: KeybindingRegistry, contextKeyService: ContextKeyService); dispose(): void; isVisible<T>(effeciveMenuPath: MenuPath, contextMatcher: ContextExpressionMatcher<T>, context: T | undefined, ...args: unknown[]): boolean; getAccelerator(context: HTMLElement | undefined, form: AcceleratorForm): string[]; isEnabled(effeciveMenuPath: MenuPath, ...args: unknown[]): boolean; isToggled(effeciveMenuPath: MenuPath, ...args: unknown[]): boolean; run(effeciveMenuPath: MenuPath, ...args: unknown[]): Promise<void>; get id(): string; get when(): string | undefined; get label(): string; get icon(): string | undefined; get sortString(): string; } //# sourceMappingURL=action-menu-node.d.ts.map