wangdl 91698a2f3b
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 13s
refactor: TypeScript 类型体系重构 + 状态管理 + 环境配置
## 类型安全
- tsconfig: 开启 strict: true(豁免 noImplicitAny + strictNullChecks,待后续收紧)
- 新建 15 个领域类型文件 (src/types/),共 ~80 个类型定义
- 统一 barrel export (src/types/index.ts)
- 消除 9 个 [key: string]: any 接口
- 消除 22 个 API data: any 参数 → 替换为具体 DTO
- 消除 36 个 Promise<any> → 使用具体泛型
- 消除重复 PaginatedResponse,统一使用 PaginatedResult
- API 内联类型全部迁至 types/

## 状态管理
- 引入 Zustand (zustand + persist)
- 新建 src/stores/ui-store.ts — 侧边栏折叠状态持久化
- AdminLayout 接入 useUIStore

## 环境配置
- 新建 .env.example — 环境变量模板
- 新建 .env.production — 生产架构文档
- 新建 src/vite-env.d.ts — IDE 类型声明

## 通用 UI 类型
- 新建 src/types/ui.ts — TypedColumn<T>, SortState, FilterState 等

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-04 11:02:52 +08:00

50 lines
924 B
TypeScript

// ── 复习 / 发布 ──
import type { ReviewCardItem } from './api'
export type { ReviewCardItem }
export interface ReviewCard {
id: string
userId: string
userName?: string
frontText: string
backText?: string
difficulty: string | null
status: string
scheduleState: string | null
intervalDays: number
repetitionCount: number
lapseCount: number
nextReviewAt: string | null
createdAt?: string
}
export interface Changelog {
id: string
version: string
title: string
content: string
type: 'feature' | 'fix' | 'improvement' | 'breaking'
published: boolean
publishedAt?: string
createdAt: string
}
export interface ReleaseDecision {
id: string
title: string
description?: string
status: string
priority?: string
assignee?: string
createdAt: string
}
export interface ReleaseChecklistItem {
id: string
label: string
checked: boolean
category?: string
}