import { Command, CommandHandler } from '@gedit/command'; import { Keybinding } from '@gedit/layout'; import { Disposable, MenuAction, MenuPath, SubMenuOptions } from '@gedit/application-common'; import { AbleManager, EntityManager } from '../common'; import { PlaygroundConfig } from './playground-config'; export declare const PLAYGROUND_ID_PREFIX = "__PG"; export declare const PlaygroundId: unique symbol; export type PlaygroundId = string; export declare const toCommandId: (playgroundId: string, cmdId: string) => string; export declare const toContextMenuPath: (playgroundId: string) => MenuPath; export interface PlaygroundCommandHandler extends CommandHandler { /** * Execute this handler. */ execute(...args: any[]): any; /** * Test whether this handler is enabled (active). */ isEnabled?(...args: any[]): boolean; /** * Test whether menu items for this handler should be visible. */ isVisible?(...args: any[]): boolean; /** * Test whether menu items for this handler should be toggled. */ isToggled?(...args: any[]): boolean; } export declare class PlaygroundCommandRegistry { private readonly commands?; readonly ableManager: AbleManager; readonly entityManager: EntityManager; readonly playgroundId: PlaygroundId; toCommandId(id: string): string; /** * 注册命令 * @param command * @param handler */ registerCommand(command: Command, handler: PlaygroundCommandHandler): Disposable; executeCommand(commandId: string, ...args: any[]): Promise; unregisterCommand(command: Command): void; } export declare class PlaygroundMenuRegistry { private readonly menus?; readonly playgroundId: PlaygroundId; readonly playgroundConfig: PlaygroundConfig; toMenuPath(menuPath: MenuPath): MenuPath; toMenuAction(menuAction: MenuAction): MenuAction; toCommands(commands: Command[]): Command[]; /** * 注册右键菜单 */ registerMenuAction(menuPath: MenuPath, menuAction: MenuAction): Disposable; registerMenus(menuPath: MenuPath, commands: Command[]): Disposable; registerSubmenus(menuPath: MenuPath, label: string, commands?: Command[], options?: SubMenuOptions): Disposable; /** * 注册子菜单 */ registerSubmenuAction(menuPath: MenuPath, label: string, options?: SubMenuOptions): Disposable; unregisterMenuAction(item: MenuAction, menuPath?: MenuPath): void; } export declare class PlaygroundKeybindingRegistry { readonly playgroundId: PlaygroundId; private readonly keybindings?; private toKeybinding; /** * 注册快捷键 */ registerKeybindings(...keybindings: Keybinding[]): Disposable; unregisterKeybinding(keybinding: Keybinding): void; } //# sourceMappingURL=playground-registries.d.ts.map