bytefun
Version:
一个打通了原型设计、UI设计与代码转换、跨平台原生代码开发等的平台
56 lines (54 loc) • 1.02 kB
text/typescript
export interface VSCodePluginMessage<T = any> {
/**
* 消息类型
*/
type: string
/**
* 消息数据
*/
data?: T
/**
* 消息ID(用于请求-响应模式)
*/
id?: string
/**
* 是否是响应消息
*/
isResponse?: boolean
/**
* 目标插件ID
*/
pluginId?: string
/**
* 消息优先级
*/
priority?: 'high' | 'normal' | 'low'
/**
* 时间戳
*/
timestamp?: number
}
// 页面数据接口
export interface PageData {
nodeId?: string
id?: string
name: string
type: number
thumbnail?: string
authorName?: string
resourceAuthorName?: string
nodeUpdateTime?: string
resourceUpdateTime?: string
[]: any
}
// 消息类型常量
export const MESSAGE_TYPES = {
OPEN_PROJECTS: 'openProjects',
OPEN_LIBRARY: 'openLibrary',
REFRESH: 'refresh',
OPEN_PAGE: 'openPage',
OPEN_PROJECT_PAGE: 'openProjectPage',
SYNC_PAGE: 'syncPage',
SYNC_ALL_PAGES: 'syncAllPages',
SYN_CODE_TO_EDITOR: 'synCodeToEditor'
} as const