Skip to content

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
}

类型对照

前后端类型必须严格对齐:

RustTypeScript示例
Stringstring文本内容
i64numberID、计数
boolboolean开关标志
Vec<T>T[]列表
Option<T>T | null可空值

基于 Tauri 2.x 构建的企业级桌面应用开发框架