diff --git a/docs/en_us/4.2-StandardizedInterfaceDesign.md b/docs/en_us/4.2-StandardizedInterfaceDesign.md index f48d11689..56095c405 100644 --- a/docs/en_us/4.2-StandardizedInterfaceDesign.md +++ b/docs/en_us/4.2-StandardizedInterfaceDesign.md @@ -27,4 +27,5 @@ If you wish to add a binding for a certain language to MaaFW, you can choose one 1. The NotificationCallback wrapped interface parses the message and dispatches it to different methods (refer to MaaMsg.h). For example, `on_resource_loading_starting(data)`. ResourceLoading can also be dispatched as an Event enumeration and Starting as a Type enumeration, such as `on_notification(event, type, data)`. Among them, `data` is the structure parsed by detail_json, instead of directly giving the original json. 2. For the NotificationCallback wrapped interface, you can consider adding the on_unknown_notification method to temporarily deal with the subsequent messages added by MaaFW. You can also consider adding the raw field or other fields representing unknown content to the structure parsed by detail_json. -3. More: TODO... +3. Split detail_json obtained by `MaaTaskerGetRecognitionDetail` into all_results, filtered_results, best_result (note that best may be null), and parse them into different structures according to the algorithm +4. More: TODO... diff --git "a/docs/zh_cn/4.2-\346\240\207\345\207\206\345\214\226\346\216\245\345\217\243\350\256\276\350\256\241.md" "b/docs/zh_cn/4.2-\346\240\207\345\207\206\345\214\226\346\216\245\345\217\243\350\256\276\350\256\241.md" index 378f2bbe3..2a96d5197 100644 --- "a/docs/zh_cn/4.2-\346\240\207\345\207\206\345\214\226\346\216\245\345\217\243\350\256\276\350\256\241.md" +++ "b/docs/zh_cn/4.2-\346\240\207\345\207\206\345\214\226\346\216\245\345\217\243\350\256\276\350\256\241.md" @@ -27,4 +27,5 @@ binding 可以分为两步: 1. NotificationCallback 包装的接口,解析 message 再派发到不同的方法中(参考 MaaMsg.h)。如 `on_resource_loading_starting(data)`。也可将 ResourceLoading 作为 Event 枚举,Starting 作为 Type 枚举派发,如 `on_notification(event, type, data)`。其中 `data` 为 detail_json 解析出的结构体,而不是直接给出原始 json 。 2. NotificationCallback 包装的接口,可以考虑增加 on_unknown_notification 方法,用于暂时应对 MaaFW 后续新增的消息。detail_json 解析出的结构体中也可考虑加入 raw 字段或其他表示未知内容的字段。 -3. 更多:TODO... +3. `MaaTaskerGetRecognitionDetail` 获取的 detail_json,请拆分成 all_results, filtered_results, best_result(注意 best 可能为 null),并根据 algorithm 解析成不同的结构体 +4. 更多:TODO...