This commit is contained in:
2025-09-25 12:48:29 +08:00
parent 9dbc054483
commit d042520b14
7 changed files with 1358 additions and 1 deletions

View File

@@ -150,13 +150,28 @@ export interface StorageEvents {
onQuotaExceeded: (usedSpace: number, maxSpace: number) => void
}
/**
* 存储使用统计
*/
/**
* 存储使用统计
*/
export interface StorageStats {
/**
* 已使用存储空间(MB)
*/
usedSpace: number // 已使用空间(MB)
/**
* 最大存储空间(MB)
*/
maxSpace: number // 最大空间(MB)
/**
* 存储键数量
*/
keysCount: number // 键数量
/**
* 最后访问时间
*/
lastAccessed: Date
}
@@ -219,25 +234,61 @@ export interface StorageSDK {
*/
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS'
/**
* 网络请求配置
*/
/**
* 网络请求配置
*/
export interface NetworkRequestConfig {
/**
* HTTP请求方法
*/
method?: HTTPMethod
/**
* 请求头信息
*/
headers?: Record<string, string>
/**
* 请求体数据
*/
body?: any
/**
* 请求超时时间(毫秒)
*/
timeout?: number
/**
* 响应数据类型
*/
responseType?: 'json' | 'text' | 'blob' | 'arrayBuffer'
}
/**
* 网络响应
*/
/**
* 网络响应
*/
export interface NetworkResponse<T = any> {
/**
* 响应数据内容
*/
data: T
/**
* HTTP状态码
*/
status: number
/**
* HTTP状态文本
*/
statusText: string
/**
* 响应头信息
*/
headers: Record<string, string>
/**
* 请求URL
*/
url: string
}
@@ -305,22 +356,49 @@ export interface NetworkSDK {
// 事件SDK接口
// =============================================================================
/**
* 事件消息
*/
/**
* 事件消息
*/
export interface EventMessage<T = any> {
/**
* 消息唯一标识符
*/
id: string
/**
* 事件频道名称
*/
channel: string
/**
* 消息数据内容
*/
data: T
/**
* 发送方标识符
*/
senderId: string
/**
* 消息发送时间戳
*/
timestamp: Date
}
/**
* 事件订阅配置
*/
/**
* 事件订阅配置
*/
export interface EventSubscriptionConfig {
/**
* 消息过滤器函数
*/
filter?: (message: EventMessage) => boolean
/**
* 是否只监听一次
*/
once?: boolean // 只监听一次
}
@@ -383,26 +461,65 @@ export enum DialogType {
CONFIRM = 'confirm'
}
/**
* 对话框选项
*/
/**
* 对话框选项
*/
export interface DialogOptions {
/**
* 对话框标题
*/
title?: string
/**
* 对话框消息内容
*/
message: string
/**
* 对话框类型
*/
type?: DialogType
/**
* 自定义按钮文本数组
*/
buttons?: string[]
/**
* 默认按钮索引
*/
defaultButton?: number
/**
* 取消按钮索引
*/
cancelButton?: number
}
/**
* 通知选项
*/
/**
* 通知选项
*/
export interface NotificationOptions {
/**
* 通知标题
*/
title: string
/**
* 通知正文内容
*/
body: string
/**
* 通知图标URL
*/
icon?: string
/**
* 显示时长(毫秒)
*/
duration?: number // 显示时长(毫秒)
/**
* 通知操作按钮
*/
actions?: Array<{ title: string; action: string }>
}
@@ -474,28 +591,82 @@ export interface UISDK {
// 系统SDK接口
// =============================================================================
/**
* 系统信息
*/
/**
* 系统信息
*/
export interface SystemInfo {
/**
* 运行平台信息
*/
platform: string
/**
* 用户代理字符串
*/
userAgent: string
/**
* 系统语言设置
*/
language: string
/**
* 时区信息
*/
timezone: string
screenResolution: { width: number; height: number }
/**
* 屏幕分辨率
*/
screenResolution: {
/**
* 屏幕宽度
*/
width: number;
/**
* 屏幕高度
*/
height: number
}
/**
* 颜色深度
*/
colorDepth: number
/**
* 像素比率
*/
pixelRatio: number
}
/**
* 应用信息
*/
/**
* 应用信息
*/
export interface AppInfo {
/**
* 应用唯一标识符
*/
id: string
/**
* 应用名称
*/
name: string
/**
* 应用版本号
*/
version: string
/**
* 应用权限列表
*/
permissions: string[]
/**
* 应用创建时间
*/
createdAt: Date
/**
* 应用最后活跃时间
*/
lastActiveAt: Date
}