export type ErrorMessageMode = 'none' | 'modal' | 'message' | undefined

export interface RequestOptions {
  isTransformResponse?: boolean
  isReturnNativeResponse?: boolean
  apiUrl?: string
  errorMessageMode?: ErrorMessageMode
  ignoreCancelToken?: boolean
  // 请求重试机制
  retryRequest?: RetryRequest
}

export interface RetryRequest {
  isOpenRetry: boolean // 是否重试
  count: number // 重试次数
  waitTime: number // 重试间隔时间
  retryErrorStatus?: number // 重试状态码
}

// 接口正常返回数据
export interface Result<T = { data?: { [key: string]: any } }>
  extends BaseResParams {
  data?: T
}

// multipart/form-data: upload file
export interface UploadFileParams {
  // Other parameters
  data?: Recordable
  // File parameter interface field name
  name?: string
  // file name
  file: File | Blob
  // file name
  filename?: string
  [key: string]: any
}
