@types/webappsec-credential-management
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -5,146 +5,6 @@ // Type definitions for W3C (WebAppSec) Credential Management API Level 1, 0.1 | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.2 | ||
// Spec: http://www.w3.org/TR/2016/WD-credential-management-1-20160425/ | ||
/* ************************ FETCH API DEFINITIONS ****************************** | ||
* TS 2.2 introduced definitions for the fetch API in the dom library, but | ||
* prior to that it was necessary to use the types defined in | ||
* @types/whatwg-fetch. In order to support all versions of TS 2.x, the | ||
* definitions for fetch from TS 2.2 dom are duplicated here. As long as these | ||
* remain identical to the definitions in dom 2.2+, they cause no issues. | ||
* | ||
* One caveat to "identical" here is that type definitions cannot be duplicated, | ||
* and so the "RequestInfo" type has been substituted for its expansion in | ||
* the below definitions: | ||
* | ||
* type RequestInfo = Request|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 var Request: { | ||
prototype: Request; | ||
new(input: Request | string, init?: RequestInit): Request; | ||
}; | ||
interface Headers { | ||
append(name: string, value: string): void; | ||
delete(name: string): void; | ||
forEach(callback: ForEachCallback): void; | ||
get(name: string): string | null; | ||
has(name: string): boolean; | ||
set(name: string, value: string): void; | ||
} | ||
declare var Headers: { | ||
prototype: Headers; | ||
new(init?: any): Headers; | ||
}; | ||
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; | ||
} | ||
declare var Response: { | ||
prototype: Response; | ||
new(body?: any, init?: ResponseInit): Response; | ||
}; | ||
interface ResponseInit { | ||
status?: number; | ||
statusText?: string; | ||
headers?: any; | ||
} | ||
interface ReadableStream { | ||
readonly locked: boolean; | ||
cancel(): Promise<void>; | ||
getReader(): ReadableStreamReader; | ||
} | ||
declare var ReadableStream: { | ||
prototype: ReadableStream; | ||
new(): ReadableStream; | ||
}; | ||
interface ReadableStreamReader { | ||
cancel(): Promise<void>; | ||
read(): Promise<any>; | ||
releaseLock(): void; | ||
} | ||
declare var ReadableStreamReader: { | ||
prototype: ReadableStreamReader; | ||
new(): ReadableStreamReader; | ||
}; | ||
interface Body { | ||
readonly bodyUsed: boolean; | ||
arrayBuffer(): Promise<ArrayBuffer>; | ||
blob(): Promise<Blob>; | ||
json(): Promise<any>; | ||
text(): Promise<string>; | ||
} | ||
interface URLSearchParams { | ||
/** | ||
* Appends a specified key/value pair as a new search parameter. | ||
*/ | ||
append(name: string, value: string): void; | ||
/** | ||
* Deletes the given search parameter, and its associated value, from the list of all search parameters. | ||
*/ | ||
delete(name: string): void; | ||
/** | ||
* Returns the first value associated to the given search parameter. | ||
*/ | ||
get(name: string): string | null; | ||
/** | ||
* Returns all the values association with a given search parameter. | ||
*/ | ||
getAll(name: string): string[]; | ||
/** | ||
* Returns a Boolean indicating if such a search parameter exists. | ||
*/ | ||
has(name: string): boolean; | ||
/** | ||
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. | ||
*/ | ||
set(name: string, value: string): void; | ||
} | ||
declare var URLSearchParams: { | ||
prototype: URLSearchParams; | ||
/** | ||
* Constructor returning a URLSearchParams object. | ||
*/ | ||
new (init?: string | URLSearchParams): URLSearchParams; | ||
}; | ||
interface GlobalFetch { | ||
fetch(input: Request|string, init?: RequestInit): Promise<Response>; | ||
} | ||
/* ************************* FETCH MODIFICATIONS ******************************* | ||
@@ -151,0 +11,0 @@ * The credential management spec modifies fetch(), by adding a new |
{ | ||
"name": "@types/webappsec-credential-management", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "TypeScript definitions for W3C (WebAppSec) Credential Management API Level 1,", | ||
@@ -20,4 +20,4 @@ "license": "MIT", | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "425b14d8386df1b691a2d78dc5f5aeaaaec462c526a7a34dd425dbed2b50f6bb", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "f54fcecbeefe45e46c9318ebeeded10c98e3de928ab74dbb8f9e0185314d8672", | ||
"typeScriptVersion": "2.2" | ||
} |
@@ -11,7 +11,7 @@ # Installation | ||
Additional Details | ||
* Last updated: Fri, 31 Mar 2017 00:49:51 GMT | ||
* Last updated: Wed, 19 Apr 2017 21:19:05 GMT | ||
* Dependencies: none | ||
* Global values: CredentialBase, FederatedCredential, Headers, PasswordCredential, ReadableStream, ReadableStreamReader, Request, Response, SiteBoundCredential, URLSearchParams, fetch | ||
* Global values: CredentialBase, FederatedCredential, PasswordCredential, SiteBoundCredential, fetch | ||
# Credits | ||
These definitions were written by Iain McGinniss <https://github.com/iainmcgin>. |
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
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
4
12570
270