GeezerVison is showing github.com — docs(command): add command api docs · xiaomile/lowcode-engine@76b2a05
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: docs/docs/api/canvas.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | --- |
2 | 2 | title: canvas - 画布 API |
3 | | -sidebar_position: 12 |
| 3 | +sidebar_position: 10 |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | > **@types** [IPublicApiCanvas](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/canvas.ts)<br/> |
|
Collapse file
Copy file name to clipboard +101Lines changed: 101 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
| 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 | +``` |
Collapse file
Copy file name to clipboardExpand all lines: docs/docs/api/common.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | --- |
2 | 2 | title: common - 通用 API |
3 | | -sidebar_position: 11 |
| 3 | +sidebar_position: 10 |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | > **@types** [IPublicApiCommon](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/common.ts)<br/> |
|
Collapse file
Copy file name to clipboardExpand all lines: docs/docs/api/commonUI.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | --- |
2 | 2 | title: commonUI - UI 组件库 |
3 | | -sidebar_position: 11 |
| 3 | +sidebar_position: 10 |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | ## 简介 |
|
Collapse file
Copy file name to clipboardExpand all lines: docs/docs/api/config.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | --- |
2 | 2 | title: config - 配置 API |
3 | | -sidebar_position: 8 |
| 3 | +sidebar_position: 5 |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | > **@types** [IPublicModelEngineConfig](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/engine-config.ts)<br/> |
|
Collapse file
Copy file name to clipboardExpand all lines: docs/docs/api/configOptions.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | --- |
2 | 2 | title: config options - 配置列表 |
3 | | -sidebar_position: 13 |
| 3 | +sidebar_position: 5 |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | > **@types** [IPublicTypeEngineOptions](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/engine-options.ts)<br/> |
|
Collapse file
Copy file name to clipboardExpand all lines: docs/docs/api/event.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | --- |
2 | 2 | title: event - 事件 API |
3 | | -sidebar_position: 7 |
| 3 | +sidebar_position: 10 |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | > **@types** [IPublicApiEvent](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/event.ts)<br/> |
|
Collapse file
Copy file name to clipboardExpand all lines: docs/docs/api/hotkey.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | --- |
2 | 2 | title: hotkey - 快捷键 API |
3 | | -sidebar_position: 5 |
| 3 | +sidebar_position: 10 |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | > **@types** [IPublicApiHotkey](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/hotkey.ts)<br/> |
|
Collapse file
Copy file name to clipboardExpand all lines: docs/docs/api/init.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | --- |
2 | 2 | title: init - 初始化 API |
3 | | -sidebar_position: 10 |
| 3 | +sidebar_position: 0 |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | > **@since** v1.0.0 |
|
Collapse file
Copy file name to clipboardExpand all lines: docs/docs/api/logger.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | --- |
2 | 2 | title: logger - 日志 API |
3 | | -sidebar_position: 9 |
| 3 | +sidebar_position: 10 |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | > **@types** [IPublicApiLogger](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/logger.ts)<br/> |
|