@beenotung/tslib
Version:
utils library in Typescript
12 lines (11 loc) • 377 B
TypeScript
export declare let fetch: Window['fetch'];
export declare function polyfillFetch(): void;
/**
* check if the status code is 2xx
* */
export declare function checkedFetch<T>({ input, init, on2xx, non2xx, }: {
input: RequestInfo;
init?: RequestInit;
on2xx: (response: Response) => T | Promise<T>;
non2xx: (response: Response) => T | Promise<T>;
}): Promise<T>;