@myfinal/shared

v0.2.5

Published

[Dian](https://github.com/FinalDevHQ/Dian) 框架的共享类型定义包。

Readme

@myfinal/shared

Dian 框架的共享类型定义包。

安装

npm install @myfinal/shared

内容

该包导出 Dian 框架各层之间共享的核心类型,所有上层模块(插件、SDK、存储等)均通过此包交互,不直接依赖协议原始字段。

核心类型

import type { BotEvent, EventPayload, BotEventType, Platform, ActionResult, SendActionFn } from "@myfinal/shared";

| 类型 | 说明 | |------|------| | Platform | 平台标识,目前为 "onebot" | | BotEventType | 事件大类:message / notice / request / meta_event 等 | | BotEvent | 统一事件对象,包含 botIdtypesubtypepayloadraw | | EventPayload | 结构化 payload,抽出 textuserIdgroupIdmessageIdsenderName 等常用字段 | | ActionResult<T> | Action 调用结果,包含 okstatusretcodedata | | SendActionFn | 通用 action 发送函数类型 |

相关包