mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 17:03:26 +00:00
More elaborate fetcher API's
This commit is contained in:
@@ -11,12 +11,17 @@ export type FetchOps = {
|
||||
|
||||
export type FetchHeaders = {
|
||||
get(key: string): string | null;
|
||||
set(key: string, value: string): void;
|
||||
};
|
||||
|
||||
export type FetchReply = {
|
||||
text(): Promise<string>;
|
||||
json(): Promise<any>;
|
||||
extraHeaders?: FetchHeaders;
|
||||
extraUrl?: string;
|
||||
headers: FetchHeaders;
|
||||
url: string;
|
||||
status: number;
|
||||
};
|
||||
|
||||
export type FetchLike = (url: string, ops?: FetchOps | undefined) => Promise<FetchReply>;
|
||||
|
Reference in New Issue
Block a user