We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The new Fetch type definition included in TypeScript 2.2 defines everything in a overly simplified fashion, everything is just string or any:
interface Request extends Object, Body { readonly cache: string; readonly credentials: string; readonly destination: string; readonly headers: Headers; readonly integrity: string; readonly keepalive: boolean; readonly method: string; readonly mode: string; readonly redirect: string; readonly referrer: string; readonly referrerPolicy: string; readonly type: string; readonly url: string; clone(): Request; } declare var Request: { prototype: Request; new(input: Request | string, init?: RequestInit): Request; } interface RequestInit { method?: string; headers?: any; body?: any; referrer?: string; referrerPolicy?: string; mode?: string; credentials?: string; cache?: string; redirect?: string; integrity?: string; keepalive?: boolean; window?: any; }
vs whatwg-fetch d.ts from DefinitelyTyped that has been carefully crafted and tested:
declare class Request { constructor(input: RequestInfo, init?: RequestInit); readonly method: string; readonly url: string; readonly headers: Headers; readonly type: RequestType readonly destination: RequestDestination; readonly referrer: string; readonly referrerPolicy: ReferrerPolicy; readonly mode: RequestMode; readonly credentials: RequestCredentials; readonly cache: RequestCache; readonly redirect: RequestRedirect; readonly integrity: string; readonly keepalive: boolean; clone(): Request; } interface Request extends Body {} interface RequestInit { method?: string; headers?: HeadersInit; body?: BodyInit; referrer?: string; referrerPolicy?: ReferrerPolicy; mode?: RequestMode; credentials?: RequestCredentials; cache?: RequestCache; redirect?: RequestRedirect; integrity?: string; window?: null; // can only be set to null } type RequestType = "" | "audio" | "font" | "image" | "script" | "style" | "track" | "video"; type RequestDestination = "" | "document" | "embed" | "font" | "image" | "manifest" | "media" | "object" | "report" | "script" | "serviceworker" | "sharedworker" | "style" | "worker" | "xslt"; type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors"; type RequestCredentials = "omit" | "same-origin" | "include"; type RequestCache = "default" | "no-store" | "reload" | "no-cache" | "force-cache" | "only-if-cached"; type RequestRedirect = "follow" | "error" | "manual"; type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "same-origin" | "origin" | "strict-origin" | "origin-when-cross-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
The text was updated successfully, but these errors were encountered:
string
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
The new Fetch type definition included in TypeScript 2.2 defines everything in a overly simplified fashion, everything is just string or any:
vs whatwg-fetch d.ts from DefinitelyTyped that has been carefully crafted and tested:
The text was updated successfully, but these errors were encountered: