| 1 | export interface RequestParams extends RequestInit { |
| 2 | url: string |
| 3 | method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' |
| 4 | data?: RequestData |
| 5 | params?: RequestQuery |
| 6 | } |
| 7 | |
| 8 | export type RequestData = object | FormData |
| 9 | export type RequestQuery = object |
| 10 | |
| 11 | export interface Dictionary<T = unknown> { |
| 12 | [key: string]: T |
| 13 | } |
| 14 | |
| 15 | export interface IFetchServiceConfig<T = Response> { |
| 16 | baseURL: string |
| 17 | requestInterceptor?: (requestParams: RequestParams) => RequestParams | void | null |
| 18 | responseInterceptor?: (response: Response) => T |
| 19 | } |
| 20 |