Skip to content

Commit 76b2a05

Browse files
liujupingJackLian
authored andcommitted
docs(command): add command api docs
1 parent 5657d9c commit 76b2a05

File tree

18 files changed

+118
-17
lines changed

18 files changed

+118
-17
lines changed

docs/docs/api/canvas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: canvas - 画布 API
3-
sidebar_position: 12
3+
sidebar_position: 10
44
---
55

66
> **@types** [IPublicApiCanvas](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/canvas.ts)<br/>

docs/docs/api/command.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: command - 指令 API
3+
sidebar_position: 10
4+
---
5+
6+
7+
8+
## 模块概览
9+
10+
该模块使得与命令系统的交互成为可能,提供了一种全面的方式来处理、执行和管理应用程序中的命令。
11+
12+
13+
14+
## 接口
15+
16+
### IPublicApiCommand
17+
18+
与命令交互的接口。它提供了注册、注销、执行和管理命令的方法。
19+
20+
21+
22+
## 方法
23+
24+
### registerCommand
25+
26+
注册一个新命令及其处理函数。
27+
28+
```
29+
typescriptCopy code
30+
/**
31+
* 注册一个新的命令及其处理程序。
32+
* @param command {IPublicTypeCommand} - 要注册的命令。
33+
*/
34+
registerCommand(command: IPublicTypeCommand): void;
35+
```
36+
37+
### unregisterCommand
38+
39+
注销一个已存在的命令。
40+
41+
```
42+
typescriptCopy code
43+
/**
44+
* 注销一个已存在的命令。
45+
* @param name {string} - 要注销的命令的名称。
46+
*/
47+
unregisterCommand(name: string): void;
48+
```
49+
50+
### executeCommand
51+
52+
根据名称和提供的参数执行命令,确保参数符合命令的定义。
53+
54+
```
55+
typescriptCopy code
56+
/**
57+
* 根据名称和提供的参数执行命令。
58+
* @param name {string} - 要执行的命令的名称。
59+
* @param args {IPublicTypeCommandHandlerArgs} - 命令的参数。
60+
*/
61+
executeCommand(name: string, args?: IPublicTypeCommandHandlerArgs): void;
62+
```
63+
64+
### batchExecuteCommand
65+
66+
批量执行命令,在所有命令执行后进行重绘,历史记录中只记录一次。
67+
68+
```
69+
typescriptCopy code
70+
/**
71+
* 批量执行命令,随后进行重绘,历史记录中只记录一次。
72+
* @param commands {Array} - 命令对象的数组,包含名称和可选参数。
73+
*/
74+
batchExecuteCommand(commands: { name: string; args?: IPublicTypeCommandHandlerArgs }[]): void;
75+
```
76+
77+
### listCommands
78+
79+
列出所有已注册的命令。
80+
81+
```
82+
typescriptCopy code
83+
/**
84+
* 列出所有已注册的命令。
85+
* @returns {IPublicTypeListCommand[]} - 已注册命令的数组。
86+
*/
87+
listCommands(): IPublicTypeListCommand[];
88+
```
89+
90+
### onCommandError
91+
92+
为命令执行过程中的错误注册错误处理回调函数。
93+
94+
```
95+
typescriptCopy code
96+
/**
97+
* 为命令执行过程中的错误注册一个回调函数。
98+
* @param callback {(name: string, error: Error) => void} - 错误处理的回调函数。
99+
*/
100+
onCommandError(callback: (name: string, error: Error) => void): void;
101+
```

docs/docs/api/common.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: common - 通用 API
3-
sidebar_position: 11
3+
sidebar_position: 10
44
---
55

66
> **@types** [IPublicApiCommon](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/common.ts)<br/>

docs/docs/api/commonUI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: commonUI - UI 组件库
3-
sidebar_position: 11
3+
sidebar_position: 10
44
---
55

66
## 简介

docs/docs/api/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: config - 配置 API
3-
sidebar_position: 8
3+
sidebar_position: 5
44
---
55

66
> **@types** [IPublicModelEngineConfig](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/engine-config.ts)<br/>

docs/docs/api/configOptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: config options - 配置列表
3-
sidebar_position: 13
3+
sidebar_position: 5
44
---
55

66
> **@types** [IPublicTypeEngineOptions](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/engine-options.ts)<br/>

docs/docs/api/event.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: event - 事件 API
3-
sidebar_position: 7
3+
sidebar_position: 10
44
---
55

66
> **@types** [IPublicApiEvent](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/event.ts)<br/>

docs/docs/api/hotkey.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: hotkey - 快捷键 API
3-
sidebar_position: 5
3+
sidebar_position: 10
44
---
55

66
> **@types** [IPublicApiHotkey](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/hotkey.ts)<br/>

docs/docs/api/init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: init - 初始化 API
3-
sidebar_position: 10
3+
sidebar_position: 0
44
---
55

66
> **@since** v1.0.0

docs/docs/api/logger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: logger - 日志 API
3-
sidebar_position: 9
3+
sidebar_position: 10
44
---
55

66
> **@types** [IPublicApiLogger](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/logger.ts)<br/>

0 commit comments

Comments
 (0)