Skip to content

Commit b720bc8

Browse files
neko-paraMistEO
authored andcommitted
chore: 错题本
1 parent 2cc2753 commit b720bc8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ MaaFramework/
220220
5.`test/python/binding_test.py` 添加相应的 API 调用测试
221221
6.`test/agent/` 中添加 Agent 单元测试,验证远程调用功能
222222

223+
### 修改 NodeJS Binding
224+
225+
当修改 NodeJS Binding 时, 需要注意以下内容:
226+
227+
1. 所有逻辑都在 `source/binding/NodeJS/src/apis`
228+
2. 对于某一个特定内容, 需要联动修改 `.h`, `.cpp`, `.d.ts`
229+
3. 当接口包含默认参数时, 在 `.h` 中声明的接口应使用 `maajs::OptionalParam` 来包裹对应参数, 在 `.cpp` 中使用 `.value_or()` 提供默认值
230+
4. 当接口包含 `T | null` 格式时, 使用 `std::optional`
231+
5. 当发现接口变更无法找到合适的修改位置时, 在 Issue 或 PR 中 @neko-para
232+
223233
**Agent 单元测试说明**
224234

225235
- `test/agent/agent_main_test.py`:AgentClient 端测试(主进程),负责创建 Resource/Controller/Tasker,并测试 AgentClient 的连接管理、custom_*_list 等 API

0 commit comments

Comments
 (0)