mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-18 02:30:51 +08:00
feat: initialize new React application structure with TypeScript, ESLint, and Prettier configurations, while removing legacy files and adding new components and pages for enhanced functionality
This commit is contained in:
36
src/types/api.ts
Normal file
36
src/types/api.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* API 相关类型定义
|
||||
* 基于原项目 src/core/api-client.js 和各模块 API
|
||||
*/
|
||||
|
||||
// HTTP 方法
|
||||
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
||||
|
||||
// API 客户端配置
|
||||
export interface ApiClientConfig {
|
||||
apiBase: string;
|
||||
managementKey: string;
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
// 请求选项
|
||||
export interface RequestOptions {
|
||||
method?: HttpMethod;
|
||||
headers?: Record<string, string>;
|
||||
params?: Record<string, any>;
|
||||
data?: any;
|
||||
}
|
||||
|
||||
// 服务器版本信息
|
||||
export interface ServerVersion {
|
||||
version: string;
|
||||
buildDate?: string;
|
||||
}
|
||||
|
||||
// API 错误
|
||||
export type ApiError = Error & {
|
||||
status?: number;
|
||||
code?: string;
|
||||
details?: any;
|
||||
data?: any;
|
||||
};
|
||||
Reference in New Issue
Block a user