1234567891011121314151617181920212223242526272829303132333435363738 |
- // types/global.d.ts
- import {AxiosRequestConfig} from "axios";
- declare global {
- interface AxiosResponse<T = any> {
- data: ApiResponseData<T>;
- status: number;
- statusText: string;
- headers: {
- [key: string]: string;
- 'content-type'?: string;
- };
- config: AxiosRequestConfig;
- }
- interface ApiResponse<T = any> {
- data: ApiResponseData<T>;
- status: number;
- statusText: string;
- headers: {
- [key: string]: string;
- 'content-type'?: string;
- };
- config: {
- method?: string;
- url?: string;
- params?: Record<string, any>;
- headers?: Record<string, any>;
- };
- }
- interface ApiResponseData<T = any> {
- code: number;
- msg: string;
- success: boolean;
- data: T;
- }
- }
|