Files
bytedance--flowgram.ai/packages/common/command/src/command-service.ts
T
wehub-resource-sync 0232b4e2bb
CI / build (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:09:51 +08:00

30 lines
691 B
TypeScript

/**
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
* SPDX-License-Identifier: MIT
*/
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>;
}