mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-05 09:47:20 +00:00
1.4 KiB
1.4 KiB
title, sidebar_position
| title | sidebar_position |
|---|---|
| API 总览 | 0 |
引擎提供的公开 API 分为命名空间和模型两类,其中命名空间用于聚合一大类的 API,模型为各 API 涉及到的对象模型。
命名空间
引擎直接提供以下几大类 API
- skeleton 面板 API
- material 物料 API
- project 模型 API
- simulator-host 模拟器 API
- hotkey 快捷键 API
- setters 设置器 API
- event 事件 API
- config 配置 API
- common 通用 API
- logger 日志 API
- init 初始化 API
模型
以下模型通过前面的 API 以返回值等形式间接透出。
- document-model 文档
- node 节点
- node-children 节点孩子
- props 属性集
- prop 属性
- setting-prop-entry 设置属性
- setting-top-entry 设置属性集
- component-meta 物料元数据
- selection 画布选中
- detecting 画布 hover
- history 操作历史
API 设计约定
一些 API 设计约定:
- 所有 API 命名空间都按照 variables / functions / events 来组织
- 事件(events)的命名格式为:on[Will|Did]VerbNoun?,参考 https://code.visualstudio.com/api/references/vscode-api#events
- 基于 Disposable 模式,对于事件的绑定、快捷键的绑定函数,返回值则是解绑函数
- 对于属性的导出,统一用 .xxx 的 getter 模式,(尽量)不使用 .getXxx()