Files
bilibili-subtitle/src/messaging/const.ts
IndieKKY 240f760ae9 优化
2024-10-06 13:07:05 +08:00

22 lines
479 B
TypeScript

// 请求信息
export type L2ReqMsg = {
from: 'extension' | 'inject' | 'app'
// target: string
method: string
params?: any
// [key: string]: any
}
// 响应信息
export type L2ResMsg<L2Res = any> = {
code: number
msg?: string
data?: L2Res
}
export const MESSAGE_TO_EXTENSION_HANDSHAKE = 'handshake'
export const MESSAGE_TO_EXTENSION_ROUTE_MSG = 'routeMsg'
export const TAG_TARGET_INJECT = 'target:inject'
export const TAG_TARGET_APP = 'target:app'