@types/isomorphic-fetch
Advanced tools
Comparing version 0.0.32 to 0.0.33
@@ -6,180 +6,113 @@ // Type definitions for isomorphic-fetch 0.0 | ||
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"; | ||
interface ForEachCallback { | ||
(keyId: any, status: string): void; | ||
} | ||
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | | ||
"opaqueredirect"; | ||
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 HeadersInterface { | ||
interface Headers { | ||
append(name: string, value: string): void; | ||
delete(name: string): void; | ||
forEach(callback: ForEachCallback): void; | ||
get(name: string): string | null; | ||
getAll(name: string): string[]; | ||
has(name: string): boolean; | ||
set(name: string, value: string): void; | ||
// TODO: iterable<string, string>; | ||
forEach(callback: (value: string, index: number, headers: HeadersInterface) => void, thisArg?: any): void; | ||
// NOTE: The following are supported by whatwg-fetch but not node-fetch. | ||
// entries(): IterableIterator<[string, string]>; | ||
// keys(): IterableIterator<string>; | ||
// values(): IterableIterator<string>; | ||
} | ||
type HeadersInit = Headers | string[] | { [index: string]: string }; | ||
declare class Headers implements HeadersInterface { | ||
constructor(init?: HeadersInit); | ||
append(name: string, value: string): void; | ||
delete(name: string): void; | ||
get(name: string): string | null; | ||
getAll(name: string): string[]; | ||
has(name: string): boolean; | ||
set(name: string, value: string): void; | ||
forEach(callback: (value: string, index: number, headers: HeadersInterface) => void, thisArg?: any): void; | ||
declare var Headers: { | ||
prototype: Headers; | ||
new(init?: any): Headers; | ||
} | ||
interface BodyInterface { | ||
bodyUsed: boolean; | ||
arrayBuffer(): Promise<ArrayBuffer>; | ||
blob(): Promise<Blob>; | ||
formData(): Promise<FormData>; | ||
json(): Promise<any>; | ||
json<T>(): Promise<T>; | ||
text(): Promise<string>; | ||
interface Blob { | ||
readonly size: number; | ||
readonly type: string; | ||
msClose(): void; | ||
msDetachStream(): any; | ||
slice(start?: number, end?: number, contentType?: string): Blob; | ||
} | ||
declare class Body implements BodyInterface { | ||
bodyUsed: boolean; | ||
interface Body { | ||
readonly bodyUsed: boolean; | ||
arrayBuffer(): Promise<ArrayBuffer>; | ||
blob(): Promise<Blob>; | ||
formData(): Promise<FormData>; | ||
json(): Promise<any>; | ||
json<T>(): Promise<T>; | ||
text(): Promise<string>; | ||
} | ||
interface RequestInterface extends BodyInterface { | ||
method: string; | ||
url: string; | ||
headers: HeadersInterface; | ||
type: RequestType; | ||
destination: RequestDestination; | ||
referrer?: string; | ||
referrerPolicy?: ReferrerPolicy; | ||
mode: RequestMode; | ||
credentials: RequestCredentials; | ||
cache: RequestCache; | ||
redirect?: RequestRedirect; | ||
integrity?: string; | ||
clone(): RequestInterface; | ||
} | ||
type BodyInit = Blob | ArrayBufferView | ArrayBuffer | FormData /* | URLSearchParams */ | string; | ||
interface RequestInit { | ||
method?: string; | ||
headers?: HeadersInit; | ||
body?: BodyInit; | ||
headers?: any; | ||
body?: any; | ||
referrer?: string; | ||
referrerPolicy?: ReferrerPolicy; | ||
mode?: RequestMode; | ||
credentials?: RequestCredentials; | ||
cache?: RequestCache; | ||
redirect?: RequestRedirect; | ||
referrerPolicy?: string; | ||
mode?: string; | ||
credentials?: string; | ||
cache?: string; | ||
redirect?: string; | ||
integrity?: string; | ||
window?: any; // can only be set to null | ||
keepalive?: boolean; | ||
window?: any; | ||
} | ||
type RequestInfo = RequestInterface | string; | ||
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 class Request extends Body implements RequestInterface { | ||
constructor(input: RequestInfo, init?: RequestInit); | ||
method: string; | ||
url: string; | ||
headers: HeadersInterface; | ||
type: RequestType; | ||
destination: RequestDestination; | ||
referrer: string; | ||
referrerPolicy: ReferrerPolicy; | ||
mode: RequestMode; | ||
credentials: RequestCredentials; | ||
cache: RequestCache; | ||
redirect: RequestRedirect; | ||
integrity: string; | ||
clone(): RequestInterface; | ||
declare var Request: { | ||
prototype: Request; | ||
new(input: Request | string, init?: RequestInit): Request; | ||
} | ||
interface ResponseInterface extends BodyInterface { | ||
type: ResponseType; | ||
url: string; | ||
redirected: boolean; | ||
status: number; | ||
statusText: string; | ||
ok: boolean; | ||
headers: HeadersInterface; | ||
// size: number; | ||
// timeout: number; | ||
body: any; | ||
trailer: Promise<HeadersInterface>; | ||
clone(): ResponseInterface; | ||
interface ReadableStream { | ||
readonly locked: boolean; | ||
cancel(): Promise<void>; | ||
} | ||
type ResponseBodyInit = BodyInit; | ||
interface ResponseInit { | ||
status?: number; | ||
statusText?: string; | ||
headers?: HeadersInit; | ||
headers?: any; | ||
} | ||
declare class Response extends Body implements ResponseInterface { | ||
constructor(body?: ResponseBodyInit, init?: ResponseInit); | ||
interface Response extends Object, Body { | ||
readonly body: ReadableStream | null; | ||
readonly headers: Headers; | ||
readonly ok: boolean; | ||
readonly status: number; | ||
readonly statusText: string; | ||
readonly type: string; | ||
readonly url: string; | ||
clone(): Response; | ||
} | ||
static redirect(url: string, status?: number): ResponseInterface; | ||
static error(): ResponseInterface; | ||
declare var Response: { | ||
prototype: Response; | ||
new(body?: any, init?: ResponseInit): Response; | ||
} | ||
type: ResponseType; | ||
url: string; | ||
redirected: boolean; | ||
status: number; | ||
statusText: string; | ||
ok: boolean; | ||
headers: HeadersInterface; | ||
body: any; | ||
trailer: Promise<HeadersInterface>; | ||
clone(): ResponseInterface; | ||
interface GlobalFetch { | ||
fetch(input: Request | string, init?: RequestInit): Promise<Response>; | ||
} | ||
interface Window { | ||
fetch(url: RequestInfo, init?: RequestInit): Promise<ResponseInterface>; | ||
interface Window extends GlobalFetch { | ||
} | ||
declare var fetch: typeof window.fetch; | ||
declare function fetch(input: Request | string, init?: RequestInit): Promise<Response>; | ||
declare module "isomorphic-fetch" { | ||
export = fetch; | ||
namespace _fetch { } | ||
const _fetch: typeof fetch; | ||
export = _fetch; | ||
} |
{ | ||
"name": "@types/isomorphic-fetch", | ||
"version": "0.0.32", | ||
"version": "0.0.33", | ||
"description": "TypeScript definitions for isomorphic-fetch", | ||
"license": "MIT", | ||
"author": "Todd Lucas <https://github.com/toddlucas>", | ||
"contributors": [ | ||
{ | ||
"name": "Todd Lucas", | ||
"url": "https://github.com/toddlucas" | ||
} | ||
], | ||
"main": "", | ||
@@ -15,4 +20,4 @@ "repository": { | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "3dfdd47f5de2d06f1ca0aabac44379053887b2a51d2046747063e22dcc1279cf", | ||
"typesPublisherContentHash": "bec3288a555962e6e7e6046aac8103185e9066e94eb9ae90fa1ad351feed3dce", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -11,7 +11,7 @@ # Installation | ||
Additional Details | ||
* Last updated: Fri, 20 Jan 2017 04:54:08 GMT | ||
* Last updated: Thu, 23 Feb 2017 18:39:27 GMT | ||
* Dependencies: none | ||
* Global values: Body, Headers, Request, Response, fetch | ||
* Global values: Headers, Request, Response, fetch | ||
# Credits | ||
These definitions were written by Todd Lucas <https://github.com/toddlucas>. |
@@ -6,3 +6,8 @@ { | ||
"data": { | ||
"authors": "Todd Lucas <https://github.com/toddlucas>", | ||
"contributors": [ | ||
{ | ||
"name": "Todd Lucas", | ||
"url": "https://github.com/toddlucas" | ||
} | ||
], | ||
"dependencies": {}, | ||
@@ -18,3 +23,2 @@ "pathMappings": {}, | ||
"globals": [ | ||
"Body", | ||
"Headers", | ||
@@ -32,5 +36,5 @@ "Request", | ||
"hasPackageJson": false, | ||
"contentHash": "3dfdd47f5de2d06f1ca0aabac44379053887b2a51d2046747063e22dcc1279cf" | ||
"contentHash": "bec3288a555962e6e7e6046aac8103185e9066e94eb9ae90fa1ad351feed3dce" | ||
}, | ||
"isLatest": true | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5243
137
1