tdesign-vue-next-starter/src/types/axios.d.ts

30 lines
626 B
TypeScript
Raw Normal View History

import { AxiosRequestConfig } from 'axios';
export interface RequestOptions {
apiUrl?: string;
isJoinPrefix?: boolean;
urlPrefix?: string;
joinParamsToUrl?: boolean;
formatDate?: boolean;
isTransformResponse?: boolean;
isReturnNativeResponse?: boolean;
ignoreRepeatRequest?: boolean;
joinTime?: boolean;
withToken?: boolean;
retry?: {
count: number;
delay: number;
};
}
export interface Result<T = any> {
code: number;
type: 'success' | 'error' | 'warning';
message: string;
result: T;
}
export interface AxiosRequestConfigRetry extends AxiosRequestConfig {
retryCount?: number;
}