DefinitelyTyped/types/refresh-fetch/index.d.ts
2020-03-18 16:16:20 -04:00

20 lines
696 B
TypeScript

// Type definitions for refresh-fetch 0.6
// Project: https://github.com/vlki/refresh-fetch
// Definitions by: Alex Lisenkov <https://github.com/AlexLisenkov>
// Pieter Braam <https://github.com/ppbraam>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
export function configureRefreshFetch<T>(
configuration: {
fetch: T;
refreshToken: () => Promise<void>;
shouldRefreshToken: (error: any) => boolean;
}): T;
export function fetchJSON<ResponseBody>(url: string | Request | URL, options?: RequestInit): Promise<{
/* tslint:disable-next-line no-unnecessary-generics */
body: ResponseBody;
response: Response;
}>;