Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/whatwg-fetch

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/whatwg-fetch - npm Package Compare versions

Comparing version 0.0.30 to 0.0.31

169

whatwg-fetch/index.d.ts

@@ -1,98 +0,111 @@

// Type definitions for fetch API
// Type definitions for Fetch API
// Project: https://github.com/github/fetch
// Definitions by: Ryan Graham <https://github.com/ryan-codingintrigue>
// Definitions by: Ryan Graham <https://github.com/ryan-codingintrigue>, Kagami Sascha Rosylight <https://github.com/saschanaz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class Request extends Body {
constructor(input: string|Request, init?:RequestInit);
method: string;
url: string;
headers: Headers;
context: RequestContext;
referrer: string;
mode: RequestMode;
redirect: RequestRedirect;
credentials: RequestCredentials;
cache: RequestCache;
}
/// <reference types="whatwg-streams" />
interface RequestInit {
method?: string;
headers?: HeaderInit|{ [index: string]: string };
body?: BodyInit;
mode?: RequestMode;
redirect?: RequestRedirect;
credentials?: RequestCredentials;
cache?: RequestCache;
interface Window {
fetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
}
declare var fetch: typeof window.fetch;
type RequestContext =
"audio" | "beacon" | "cspreport" | "download" | "embed" |
"eventsource" | "favicon" | "fetch" | "font" | "form" | "frame" |
"hyperlink" | "iframe" | "image" | "imageset" | "import" |
"internal" | "location" | "manifest" | "object" | "ping" | "plugin" |
"prefetch" | "script" | "serviceworker" | "sharedworker" |
"subresource" | "style" | "track" | "video" | "worker" |
"xmlhttprequest" | "xslt";
type RequestMode = "same-origin" | "no-cors" | "cors";
type RequestRedirect = "follow" | "error" | "manual";
type RequestCredentials = "omit" | "same-origin" | "include";
type RequestCache =
"default" | "no-store" | "reload" | "no-cache" |
"force-cache" | "only-if-cached";
declare type HeadersInit = Headers | string[][] | { [key: string]: string };
declare class Headers {
constructor(init?: HeadersInit);
declare interface HeadersMap {
[index: string]: string;
}
append(name: string, value: string): void;
delete(name: string): void;
get(name: string): string; // | null; (TS 2.0 strict null check)
has(name: string): boolean;
set(name: string, value: string): void;
declare class Headers {
constructor(headers?:Headers|HeadersMap)
append(name: string, value: string): void;
delete(name: string):void;
get(name: string): string;
getAll(name: string): Array<string>;
has(name: string): boolean;
set(name: string, value: string): void;
forEach(callback: (value: string, name: string) => void): void;
// WebIDL pair iterator: iterable<ByteString, ByteString>
entries(): IterableIterator<[string, string]>;
forEach(callback: (value: string, index: number, headers: Headers) => void, thisArg?: any): void;
keys(): IterableIterator<string>;
values(): IterableIterator<string>;
[Symbol.iterator](): IterableIterator<[string, string]>;
}
declare class Body {
bodyUsed: boolean;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
formData(): Promise<FormData>;
json(): Promise<any>;
json<T>(): Promise<T>;
text(): Promise<string>;
declare type BodyInit = Blob | ArrayBufferView | ArrayBuffer | FormData /* | URLSearchParams */ | string;
interface Body {
bodyUsed: boolean;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
formData(): Promise<FormData>;
json(): Promise<any>;
text(): Promise<string>;
}
declare class Response extends Body {
constructor(body?: BodyInit, init?: ResponseInit);
static error(): Response;
static redirect(url: string, status: number): Response;
type: ResponseType;
url: string;
status: number;
ok: boolean;
statusText: string;
headers: Headers;
clone(): Response;
declare type RequestInfo = Request | string;
interface Request extends Body {
method: string;
url: string;
headers: Headers;
type: RequestType
destination: RequestDestination;
referrer: string;
referrerPolicy: ReferrerPolicy;
mode: RequestMode;
credentials: RequestCredentials;
cache: RequestCache;
redirect: RequestRedirect;
integrity: string;
clone(): Request;
}
interface RequestInit {
method?: string;
headers?: HeadersInit;
body?: BodyInit;
referrer?: string;
referrerPolicy?: ReferrerPolicy;
mode?: RequestMode;
credentials?: RequestCredentials;
cache?: RequestCache;
redirect?: RequestRedirect;
integrity?: string;
window?: any;
}
interface RequestConstructor {
new (input: RequestInfo, init?: RequestInit): Request;
}
declare var Request: RequestConstructor;
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
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";
interface Response extends Body {
type: ResponseType;
url: string;
redirected: boolean;
status: number;
ok: boolean;
statusText: string;
headers: Headers;
body: ReadableStream; // | null;
trailer: Promise<Headers>;
clone(): Response;
}
interface ResponseInit {
status: number;
statusText?: string;
headers?: HeaderInit;
status?: number;
statusText?: string;
headers?: HeadersInit;
}
interface ResponseConstructor {
new (body?: BodyInit, init?: ResponseInit): Response;
declare type HeaderInit = Headers|Array<string>;
declare type BodyInit = ArrayBuffer|ArrayBufferView|Blob|FormData|string;
declare type RequestInfo = Request|string;
interface Window {
fetch(url: string|Request, init?: RequestInit): Promise<Response>;
error(): Response;
redirect(url: string, status?: number): Response;
}
declare var Response: ResponseConstructor;
declare var fetch: typeof window.fetch;
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
{
"name": "@types/whatwg-fetch",
"version": "0.0.30",
"description": "TypeScript definitions for fetch API",
"version": "0.0.31",
"description": "TypeScript definitions for Fetch API",
"license": "MIT",
"author": "Ryan Graham <https://github.com/ryan-codingintrigue>",
"author": "Ryan Graham <https://github.com/ryan-codingintrigue>, Kagami Sascha Rosylight <https://github.com/saschanaz>",
"main": "",

@@ -13,4 +13,7 @@ "repository": {

"scripts": {},
"dependencies": {},
"typings": "index.d.ts"
"dependencies": {
"@types/whatwg-streams": "*"
},
"typings": "index.d.ts",
"typesPublisherContentHash": "9bcafbace6daa46b968ce4aa9249aeea70837f558456b19aa95171b15c4913e5"
}

@@ -5,3 +5,3 @@ # Installation

# Summary
This package contains type definitions for fetch API (https://github.com/github/fetch).
This package contains type definitions for Fetch API (https://github.com/github/fetch).

@@ -12,9 +12,9 @@ # Details

Additional Details
* Last updated: Thu, 25 Aug 2016 16:56:12 GMT
* Last updated: Mon, 19 Sep 2016 17:28:59 GMT
* File structure: Global
* Library Dependencies: none
* Library Dependencies: whatwg-streams
* Module Dependencies: none
* Global values: Body, Headers, Request, Response, fetch
* Global values: Headers, Request, Response, fetch
# Credits
These definitions were written by Ryan Graham <https://github.com/ryan-codingintrigue>.
These definitions were written by Ryan Graham <https://github.com/ryan-codingintrigue>, Kagami Sascha Rosylight <https://github.com/saschanaz>.
{
"authors": "Ryan Graham <https://github.com/ryan-codingintrigue>",
"authors": "Ryan Graham <https://github.com/ryan-codingintrigue>, Kagami Sascha Rosylight <https://github.com/saschanaz>",
"definitionFilename": "index.d.ts",
"libraryDependencies": [],
"libraryDependencies": [
"whatwg-streams"
],
"moduleDependencies": [],
"libraryMajorVersion": "0",
"libraryMinorVersion": "0",
"libraryName": "fetch API",
"libraryName": "Fetch API",
"typingsPackageName": "whatwg-fetch",

@@ -15,3 +17,2 @@ "projectName": "https://github.com/github/fetch",

"globals": [
"Body",
"Headers",

@@ -27,3 +28,3 @@ "Request",

"hasPackageJson": false,
"contentHash": "b233cae7ced4a688604dfd8774fa94201b81809d1576c0bb79bbdfba0505d994"
"contentHash": "9bcafbace6daa46b968ce4aa9249aeea70837f558456b19aa95171b15c4913e5"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc