简体中文
SYS_Help.help() method
查询 Help 信息(渐进式)
签名
typescript
function help(
namespace?: string,
className?: string,
methodName?: string,
): Promise<ISYS_HelpData | Record<string, any> | ISYS_HelpClassSummary | ISYS_HelpMethodDetail>;1
2
3
4
5
2
3
4
5
参数名
参数 | 类型 | 描述 |
|---|---|---|
namespace | string | (可选) 命名空间: |
className | string | (可选) 类名 / 类型名 / 命名空间下的分组名(external 场景为注册时的 namespace) |
methodName | string | (可选) 方法名 / 接口名 |
返回值
Promise<ISYS_HelpData | Record<string, any> | ISYS_HelpClassSummary | ISYS_HelpMethodDetail>
渐进式查询结果:
- 无参:返回总览
{ description, eda: [{ name, comment } 全部类型条目], external: { namespace: { apiName: 标题 } }, callConventions },description说明如何查询类 / 接口 / 枚举 / 类型;callConventions是给 AI 的调用约定总纲,包含: 内置入口与external入口总览(entry/entries)、类名到运行时属性名的映射(classToProperty)、 查询入口说明(queryGuide:类 / 接口 / 枚举 / 类型统一用--class-name)、异步约定 (asyncConvention/externalAsyncConvention)、调用示例(example/externalExample)、Source系列源 API 的异步落盘时序约束(sourceApiConvention)、 原理图绘制建议(schematicDrawingConvention,含优先用导线互连、未连接引脚设非连接模式、孤立器件复核)、 面向 AI 的完整调用文档链接(documentation); - 仅namespace('eda'/'format'):返回{ description, types },types为该命名空间下全部类型条目[{ name, comment }](类 / 枚举 / 接口 / 类型);'eda'场景额外返回callConventions; -namespace+className:类返回{ title, methods: [{ name, comment }] }方法摘要, 枚举 / 接口 / 类型返回类型详情({ name, comment, values }枚举值列表或{ name, comment, fields }字段列表); - 三个参数齐全('eda'场景):返回单方法的完整详情(入参、出参、返回值); -'format'场景:仅namespace返回{ description, types }(eprj3 离线本地文件格式),namespace+className返回该类型的详情(无methodName层级)
示例
javascript
// 1. 总览
const overview = await eda.sys_Help.help();
// 2. 查看 eda 下 lib_Device 类的方法
const deviceMethods = await eda.sys_Help.help('eda', 'lib_Device');
// 3. 查看 create 方法的完整用法
const createDoc = await eda.sys_Help.help('eda', 'lib_Device', 'create');
// 4. 查看外部注入接口
const externalInfo = await eda.sys_Help.help('external', 'component', 'placeComponent');1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11