Appearance
TypeScript 类型
灵动桌面框架的 TypeScript 类型定义,位于 src/types/ 目录。
AppConfig
配置项数据结构。
typescript
interface AppConfig {
id: number
key: string
value: string
created_at: string
updated_at: string
}SystemInfo
系统信息数据结构。
typescript
interface SystemInfo {
os_type: string
os_version: string
hostname: string
app_version: string
}类型对照
前后端类型必须严格对齐:
| Rust | TypeScript | 示例 |
|---|---|---|
String | string | 文本内容 |
i64 | number | ID、计数 |
bool | boolean | 开关标志 |
Vec<T> | T[] | 列表 |
Option<T> | T | null | 可空值 |