@omni-probe/types
v0.1.0
Published
Shared event, client, and plugin types for omni-probe
Maintainers
Readme
@omni-probe/types
omni-probe 的公共事件、Client、Plugin 与配置类型。该包不安装平台插桩,可用于业务接收端、事件处理函数和自定义插件的 TypeScript 类型约束。
npm install @omni-probe/typesimport type {
ProbeClient,
ProbeEvent,
ProbePlugin,
} from '@omni-probe/types'
export function consume(events: ProbeEvent[]): void {
for (const event of events) {
console.log(event.type, event.payload)
}
}
export const plugin: ProbePlugin = {
name: 'business-context',
setup(client: ProbeClient) {
client.setContext({ channel: 'web' })
},
}运行时还导出 SCHEMA_VERSION 和构建时注入的 SDK_VERSION。事件结构以判别联合表示,type 与 payload 一一对应。
License: MIT
