Skip to content

Commit

Permalink
Update command.md
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuping authored Feb 26, 2024
1 parent bd85ca3 commit 1ab0158
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions docs/docs/api/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ sidebar_position: 10

注册一个新命令及其处理函数。

```
typescriptCopy code
```typescript
/**
* 注册一个新的命令及其处理程序。
* @param command {IPublicTypeCommand} - 要注册的命令。
Expand All @@ -38,8 +37,7 @@ registerCommand(command: IPublicTypeCommand): void;

注销一个已存在的命令。

```
typescriptCopy code
```typescript
/**
* 注销一个已存在的命令。
* @param name {string} - 要注销的命令的名称。
Expand All @@ -51,8 +49,7 @@ unregisterCommand(name: string): void;

根据名称和提供的参数执行命令,确保参数符合命令的定义。

```
typescriptCopy code
```typescript
/**
* 根据名称和提供的参数执行命令。
* @param name {string} - 要执行的命令的名称。
Expand All @@ -65,8 +62,7 @@ executeCommand(name: string, args?: IPublicTypeCommandHandlerArgs): void;

批量执行命令,在所有命令执行后进行重绘,历史记录中只记录一次。

```
typescriptCopy code
```typescript
/**
* 批量执行命令,随后进行重绘,历史记录中只记录一次。
* @param commands {Array} - 命令对象的数组,包含名称和可选参数。
Expand All @@ -78,8 +74,7 @@ batchExecuteCommand(commands: { name: string; args?: IPublicTypeCommandHandlerAr

列出所有已注册的命令。

```
typescriptCopy code
```typescript
/**
* 列出所有已注册的命令。
* @returns {IPublicTypeListCommand[]} - 已注册命令的数组。
Expand All @@ -91,8 +86,7 @@ listCommands(): IPublicTypeListCommand[];

为命令执行过程中的错误注册错误处理回调函数。

```
typescriptCopy code
```typescript
/**
* 为命令执行过程中的错误注册一个回调函数。
* @param callback {(name: string, error: Error) => void} - 错误处理的回调函数。
Expand Down

0 comments on commit 1ab0158

Please sign in to comment.