Files
testing-tool/utils/messages.tsx
T
雨霖铃 22985f4c18 feat:添加测试页面并优化时间戳工具
refactor: 优化时间戳转换组件及整体代码结构
chore: 更新构建配置和包依赖项
2026-02-13 17:29:01 +08:00

39 lines
866 B
TypeScript

import { defineExtensionMessaging } from '@webext-core/messaging';
export const messages = {
popup: {
from: {
start: 'popup:start',
stop: 'popup:stop',
},
to: {
stopped: 'popup:stopped',
started: 'popup:started',
},
checkStatus: 'popup:check-status',
ready: 'popup:ready',
},
content: {
from: {
saveTrackeEvents: 'content:save-tracke-events',
},
to: {
startRecording: 'content:start-recording',
stopRecording: 'content:stop-recording',
},
checkStatus: 'content:check-status',
},
offscreen: {
to: {
startRecording: 'offscreen:start-recording',
stopRecording: 'offscreen:stop-recording',
},
},
};
interface ProtocolMap {
getStringLength(data: string): number;
}
export const { sendMessage, onMessage } = defineExtensionMessaging<ProtocolMap>();