# types.ts **路径**:`src/api/types.ts` ## 功能用途 公共 API 类型定义,供 event、order、position、market 等模块复用,避免重复声明。 ## 核心类型 ### PageResult\ 分页结果通用结构: ```typescript interface PageResult { list: T[] page: number pageSize: number total: number } ``` ### ApiResponse\ 通用 API 响应: ```typescript interface ApiResponse { code: number data?: T msg: string } ``` ## 使用方式 ```typescript import type { PageResult, ApiResponse } from '@/api/types' // 在接口模块中导出供外部使用 export type { PageResult } export interface MyListResponse { code: number data: PageResult msg: string } ``` ## 扩展方式 - 新增通用类型时在此文件添加 - 各 API 模块通过 `export type { Xxx }` 重新导出,保持向后兼容