| 123456789101112131415161718192021222324 |
- import { type Disposable, type Event } from '@flowgram.ai/utils';
- import { type CommandEvent } from './command';
- export const CommandService = Symbol('CommandService');
- /**
- * command service 执行接口
- */
- export interface CommandService extends Disposable {
- /**
- * command 事件执行前触发事件
- */
- readonly onWillExecuteCommand: Event<CommandEvent>;
- /**
- * command 事件执行完成后触发
- */
- readonly onDidExecuteCommand: Event<CommandEvent>;
- /**
- * 执行 command
- */
- executeCommand<T>(command: string, ...args: any[]): Promise<T | undefined>;
- }
|