mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-03 11:20:50 +08:00
- Add 'auto' to Theme type - Implement cycleTheme (light -> dark -> auto) - Add autoTheme icon (sun with half-filled center) - Listen to system theme changes in auto mode Also includes some Prettier formatting fixes.
40 lines
703 B
TypeScript
40 lines
703 B
TypeScript
/**
|
|
* 通用类型定义
|
|
*/
|
|
|
|
export type Theme = 'light' | 'dark' | 'auto';
|
|
|
|
export type Language = 'zh-CN' | 'en';
|
|
|
|
export type NotificationType = 'info' | 'success' | 'warning' | 'error';
|
|
|
|
export interface Notification {
|
|
id: string;
|
|
message: string;
|
|
type: NotificationType;
|
|
duration?: number;
|
|
}
|
|
|
|
export interface ApiResponse<T = any> {
|
|
data?: T;
|
|
error?: string;
|
|
message?: string;
|
|
}
|
|
|
|
export interface PaginationState {
|
|
currentPage: number;
|
|
pageSize: number;
|
|
totalPages: number;
|
|
totalItems?: number;
|
|
}
|
|
|
|
export interface LoadingState {
|
|
isLoading: boolean;
|
|
error: Error | null;
|
|
}
|
|
|
|
// 泛型异步状态
|
|
export interface AsyncState<T> extends LoadingState {
|
|
data: T | null;
|
|
}
|