Skip to content
Snippets Groups Projects
Unverified Commit 893fa691 authored by marihachi's avatar marihachi Committed by GitHub
Browse files

add FetchLike (#19)

parent 39270c78
No related branches found
No related tags found
No related merge requests found
......@@ -14,10 +14,20 @@ export function isAPIError(reason: any): reason is APIError {
return reason[MK_API_ERROR] === true;
}
export type FetchLike = (input: string, init?: {
method?: string;
body?: string;
credentials?: RequestCredentials;
cache?: RequestCache;
}) => Promise<{
status: number;
json(): Promise<any>;
}>;
export class APIClient {
public origin: string;
public credential: string | null | undefined;
public fetch: (typeof fetch);
public fetch: FetchLike;
constructor(opts: {
origin: APIClient['origin'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment