Files
providers/src/utils/fetcher.ts
2023-08-23 17:56:18 +02:00

12 lines
280 B
TypeScript

export type FetcherOptions = {
baseUrl?: string;
headers?: Record<string, string>;
query?: Record<string, string>;
method?: 'GET' | 'POST';
body?: Record<string, any> | string | FormData;
};
export type Fetcher<T = any> = {
(url: string, ops?: FetcherOptions): T;
};