type IParams = { [key: string]: any } | FormData type EventHandle = (target: EventTarget, type: string, bubbles: boolean, cancelable: boolean, lengthComputable: boolean) => void export interface IConfig { baseUrl?: string timeout?: number headers?: { [key: string]: any } transformRequest?: (IParams) => IParams responseType?: string withCredentials?: boolean upload?: Partial> } export interface IResult { data: any xhr: XMLHttpRequest params?: IParams url: string config: IConfig } export type IFFetch = (url: string, params?: IParams, config?: IConfig) => Promise declare namespace fetch { const get: IFFetch const post: IFFetch const del: IFFetch const put: IFFetch const config: IConfig const interceptor: { success: (data: any) => Promise fail: (data: any) => Promise } } export default fetch