mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 03:01:16 +00:00
docs(command): add command api docs
This commit is contained in:
parent
5657d9c084
commit
76b2a05049
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: canvas - 画布 API
|
title: canvas - 画布 API
|
||||||
sidebar_position: 12
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
|
|
||||||
> **@types** [IPublicApiCanvas](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/canvas.ts)<br/>
|
> **@types** [IPublicApiCanvas](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/canvas.ts)<br/>
|
||||||
|
|||||||
101
docs/docs/api/command.md
Normal file
101
docs/docs/api/command.md
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
---
|
||||||
|
title: command - 指令 API
|
||||||
|
sidebar_position: 10
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 模块概览
|
||||||
|
|
||||||
|
该模块使得与命令系统的交互成为可能,提供了一种全面的方式来处理、执行和管理应用程序中的命令。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 接口
|
||||||
|
|
||||||
|
### IPublicApiCommand
|
||||||
|
|
||||||
|
与命令交互的接口。它提供了注册、注销、执行和管理命令的方法。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 方法
|
||||||
|
|
||||||
|
### registerCommand
|
||||||
|
|
||||||
|
注册一个新命令及其处理函数。
|
||||||
|
|
||||||
|
```
|
||||||
|
typescriptCopy code
|
||||||
|
/**
|
||||||
|
* 注册一个新的命令及其处理程序。
|
||||||
|
* @param command {IPublicTypeCommand} - 要注册的命令。
|
||||||
|
*/
|
||||||
|
registerCommand(command: IPublicTypeCommand): void;
|
||||||
|
```
|
||||||
|
|
||||||
|
### unregisterCommand
|
||||||
|
|
||||||
|
注销一个已存在的命令。
|
||||||
|
|
||||||
|
```
|
||||||
|
typescriptCopy code
|
||||||
|
/**
|
||||||
|
* 注销一个已存在的命令。
|
||||||
|
* @param name {string} - 要注销的命令的名称。
|
||||||
|
*/
|
||||||
|
unregisterCommand(name: string): void;
|
||||||
|
```
|
||||||
|
|
||||||
|
### executeCommand
|
||||||
|
|
||||||
|
根据名称和提供的参数执行命令,确保参数符合命令的定义。
|
||||||
|
|
||||||
|
```
|
||||||
|
typescriptCopy code
|
||||||
|
/**
|
||||||
|
* 根据名称和提供的参数执行命令。
|
||||||
|
* @param name {string} - 要执行的命令的名称。
|
||||||
|
* @param args {IPublicTypeCommandHandlerArgs} - 命令的参数。
|
||||||
|
*/
|
||||||
|
executeCommand(name: string, args?: IPublicTypeCommandHandlerArgs): void;
|
||||||
|
```
|
||||||
|
|
||||||
|
### batchExecuteCommand
|
||||||
|
|
||||||
|
批量执行命令,在所有命令执行后进行重绘,历史记录中只记录一次。
|
||||||
|
|
||||||
|
```
|
||||||
|
typescriptCopy code
|
||||||
|
/**
|
||||||
|
* 批量执行命令,随后进行重绘,历史记录中只记录一次。
|
||||||
|
* @param commands {Array} - 命令对象的数组,包含名称和可选参数。
|
||||||
|
*/
|
||||||
|
batchExecuteCommand(commands: { name: string; args?: IPublicTypeCommandHandlerArgs }[]): void;
|
||||||
|
```
|
||||||
|
|
||||||
|
### listCommands
|
||||||
|
|
||||||
|
列出所有已注册的命令。
|
||||||
|
|
||||||
|
```
|
||||||
|
typescriptCopy code
|
||||||
|
/**
|
||||||
|
* 列出所有已注册的命令。
|
||||||
|
* @returns {IPublicTypeListCommand[]} - 已注册命令的数组。
|
||||||
|
*/
|
||||||
|
listCommands(): IPublicTypeListCommand[];
|
||||||
|
```
|
||||||
|
|
||||||
|
### onCommandError
|
||||||
|
|
||||||
|
为命令执行过程中的错误注册错误处理回调函数。
|
||||||
|
|
||||||
|
```
|
||||||
|
typescriptCopy code
|
||||||
|
/**
|
||||||
|
* 为命令执行过程中的错误注册一个回调函数。
|
||||||
|
* @param callback {(name: string, error: Error) => void} - 错误处理的回调函数。
|
||||||
|
*/
|
||||||
|
onCommandError(callback: (name: string, error: Error) => void): void;
|
||||||
|
```
|
||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: common - 通用 API
|
title: common - 通用 API
|
||||||
sidebar_position: 11
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
|
|
||||||
> **@types** [IPublicApiCommon](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/common.ts)<br/>
|
> **@types** [IPublicApiCommon](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/common.ts)<br/>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: commonUI - UI 组件库
|
title: commonUI - UI 组件库
|
||||||
sidebar_position: 11
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
|
|
||||||
## 简介
|
## 简介
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: config - 配置 API
|
title: config - 配置 API
|
||||||
sidebar_position: 8
|
sidebar_position: 5
|
||||||
---
|
---
|
||||||
|
|
||||||
> **@types** [IPublicModelEngineConfig](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/engine-config.ts)<br/>
|
> **@types** [IPublicModelEngineConfig](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/engine-config.ts)<br/>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: config options - 配置列表
|
title: config options - 配置列表
|
||||||
sidebar_position: 13
|
sidebar_position: 5
|
||||||
---
|
---
|
||||||
|
|
||||||
> **@types** [IPublicTypeEngineOptions](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/engine-options.ts)<br/>
|
> **@types** [IPublicTypeEngineOptions](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/engine-options.ts)<br/>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: event - 事件 API
|
title: event - 事件 API
|
||||||
sidebar_position: 7
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
|
|
||||||
> **@types** [IPublicApiEvent](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/event.ts)<br/>
|
> **@types** [IPublicApiEvent](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/event.ts)<br/>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: hotkey - 快捷键 API
|
title: hotkey - 快捷键 API
|
||||||
sidebar_position: 5
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
|
|
||||||
> **@types** [IPublicApiHotkey](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/hotkey.ts)<br/>
|
> **@types** [IPublicApiHotkey](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/hotkey.ts)<br/>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: init - 初始化 API
|
title: init - 初始化 API
|
||||||
sidebar_position: 10
|
sidebar_position: 0
|
||||||
---
|
---
|
||||||
|
|
||||||
> **@since** v1.0.0
|
> **@since** v1.0.0
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: logger - 日志 API
|
title: logger - 日志 API
|
||||||
sidebar_position: 9
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
|
|
||||||
> **@types** [IPublicApiLogger](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/logger.ts)<br/>
|
> **@types** [IPublicApiLogger](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/logger.ts)<br/>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: material - 物料 API
|
title: material - 物料 API
|
||||||
sidebar_position: 2
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
|
|
||||||
> **@types** [IPublicApiMaterial](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/material.ts)<br/>
|
> **@types** [IPublicApiMaterial](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/material.ts)<br/>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"label": "模型定义 Models",
|
"label": "模型定义 Models",
|
||||||
"position": 14,
|
"position": 100,
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"collapsible": true
|
"collapsible": true
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: plugins - 插件 API
|
title: plugins - 插件 API
|
||||||
sidebar_position: 4
|
sidebar_position: 2
|
||||||
---
|
---
|
||||||
> **@types** [IPublicApiPlugins](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/plugins.ts)<br/>
|
> **@types** [IPublicApiPlugins](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/plugins.ts)<br/>
|
||||||
> **@since** v1.0.0
|
> **@since** v1.0.0
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: project - 模型 API
|
title: project - 模型 API
|
||||||
sidebar_position: 3
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
## 模块简介
|
## 模块简介
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: setters - 设置器 API
|
title: setters - 设置器 API
|
||||||
sidebar_position: 6
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
> **@types** [IPublicApiSetters](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/setters.ts)<br/>
|
> **@types** [IPublicApiSetters](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/setters.ts)<br/>
|
||||||
> **@since** v1.0.0
|
> **@since** v1.0.0
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: simulatorHost - 模拟器 API
|
title: simulatorHost - 模拟器 API
|
||||||
sidebar_position: 3
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
> **@types** [IPublicApiSimulatorHost](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/simulator-host.ts)<br/>
|
> **@types** [IPublicApiSimulatorHost](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/simulator-host.ts)<br/>
|
||||||
> **@since** v1.0.0
|
> **@since** v1.0.0
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: skeleton - 面板 API
|
title: skeleton - 面板 API
|
||||||
sidebar_position: 1
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
> **@types** [IPublicApiSkeleton](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/skeleton.ts)<br/>
|
> **@types** [IPublicApiSkeleton](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/api/skeleton.ts)<br/>
|
||||||
> **@since** v1.0.0
|
> **@since** v1.0.0
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: workspace - 应用级 API
|
title: workspace - 应用级 API
|
||||||
sidebar_position: 12
|
sidebar_position: 10
|
||||||
---
|
---
|
||||||
|
|
||||||
> **[@experimental](./#experimental)**<br/>
|
> **[@experimental](./#experimental)**<br/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user