@types/when
Advanced tools
Comparing version 2.4.29 to 2.4.30
@@ -112,3 +112,3 @@ // Type definitions for When 2.4.0 | ||
*/ | ||
function map<T>(promisesOrValues: any[], mapFunc: (value: any, index?: Number) => any): Promise<T>; | ||
function map<T>(promisesOrValues: any[], mapFunc: (value: any, index: number) => any): Promise<T>; | ||
@@ -122,6 +122,6 @@ /** | ||
* may contain a mix of promises and values. | ||
* @param reduceFunc function(accumulated:*, x:*, index:Number):*} f reduce function | ||
* @param reduceFunc function(accumulated:*, x:*, index:number):*} f reduce function | ||
* @returns a promise that will resolve to the final reduced value | ||
*/ | ||
function reduce<T>(promisesOrValues: any[], reduceFunc: (reduction: T, value: any, index?: Number) => T | Promise<T>, initialValue: T): Promise<T>; | ||
function reduce<T>(promisesOrValues: any[], reduceFunc: (reduction: T, value: any, index: number) => T | Promise<T>, initialValue: T): Promise<T>; | ||
@@ -135,19 +135,35 @@ /** | ||
* may contain a mix of promises and values. | ||
* @param reduceFunc function(accumulated:*, x:*, index:Number):*} f reduce function | ||
* @param reduceFunc function(accumulated:*, x:*, index:number):*} f reduce function | ||
* @returns a promise that will resolve to the final reduced value | ||
*/ | ||
function reduceRight<T>(promisesOrValues: any[], reduceFunc: (reduction: T, value: any, index?: Number) => T | Promise<T>, initialValue: T): Promise<T>; | ||
function reduceRight<T>(promisesOrValues: any[], reduceFunc: (reduction: T, value: any, index: number) => T | Promise<T>, initialValue: T): Promise<T>; | ||
/** | ||
* Describes the status of a promise. | ||
* Describes the outcome of a promise. | ||
* state may be one of: | ||
* "fulfilled" - the promise has resolved | ||
* "pending" - the promise is still pending to resolve/reject | ||
* "rejected" - the promise has rejected | ||
*/ | ||
interface Descriptor<T> { | ||
state: string; | ||
value?: T; | ||
reason?: any; | ||
type Descriptor<T> = FulfilledDescriptor<T> | RejectedDescriptor; | ||
/** | ||
* Snapshot which describes the status of a promise. | ||
* state may be one of: | ||
* "fulfilled" - the promise has resolved | ||
* "rejected" - the promise has rejected | ||
* "pending" - the promise is still pending to resolve/reject | ||
*/ | ||
type Snapshot<T> = FulfilledDescriptor<T> | RejectedDescriptor | PendingDescriptor; | ||
interface FulfilledDescriptor<T> { | ||
state: 'fulfilled'; | ||
value: T; | ||
} | ||
interface RejectedDescriptor { | ||
state: 'rejected'; | ||
reason: any; | ||
} | ||
interface PendingDescriptor { | ||
state: 'pending'; | ||
} | ||
@@ -275,3 +291,22 @@ /** | ||
then<U>(onFulfilled: (value: T) => U | Promise<U>, onRejected?: (reason: any) => U | Promise<U>, onProgress?: (update: any) => void): Promise<U>; | ||
then( | ||
onFulfilled?: ((value: T) => T | Thenable<T>) | undefined | null, | ||
onRejected?: ((reason: any) => T | Thenable<T>) | undefined | null, | ||
onProgress?: (update: any) => void | ||
): Promise<T>; | ||
then<TResult>( | ||
onFulfilled: ((value: T) => TResult | Thenable<TResult>), | ||
onRejected?: ((reason: any) => TResult | Thenable<TResult>) | undefined | null, | ||
onProgress?: (update: any) => void | ||
): Promise<TResult>; | ||
then<TResult>( | ||
onFulfilled: ((value: T) => T | Thenable<T>) | undefined | null, | ||
onRejected: ((reason: any) => TResult | Thenable<TResult>), | ||
onProgress?: (update: any) => void | ||
): Promise<T | TResult>; | ||
then<TResult1, TResult2>( | ||
onFulfilled: ((value: T) => TResult1 | Thenable<TResult1>), | ||
onRejected: ((reason: any) => TResult2 | Thenable<TResult2>), | ||
onProgress?: (update: any) => void | ||
): Promise<TResult1 | TResult2>; | ||
@@ -291,10 +326,4 @@ spread<T>(onFulfilled: _.Fn0<Promise<T> | T>): Promise<T>; | ||
interface Thenable<T> { | ||
then<U>(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U): Thenable<U>; | ||
then<U>(onFulfilled?: (value: T) => U, onRejected?: (reason: any) => U): Thenable<U>; | ||
} | ||
interface Snapshot<T> { | ||
state: string; | ||
value?: T; | ||
reason?: any; | ||
} | ||
} | ||
@@ -377,4 +406,3 @@ | ||
reject(reason: any): void; | ||
resolve(value?: T): void; | ||
resolve(value?: when.Promise<T>): void; | ||
resolve(value?: T | when.Promise<T>): void; | ||
} | ||
@@ -381,0 +409,0 @@ |
{ | ||
"name": "@types/when", | ||
"version": "2.4.29", | ||
"version": "2.4.30", | ||
"description": "TypeScript definitions for When", | ||
@@ -9,7 +9,9 @@ "license": "MIT", | ||
"name": "Derek Cicerone", | ||
"url": "https://github.com/derekcicerone" | ||
"url": "https://github.com/derekcicerone", | ||
"githubUsername": "derekcicerone" | ||
}, | ||
{ | ||
"name": "Wim Looman", | ||
"url": "https://github.com/Nemo157" | ||
"url": "https://github.com/Nemo157", | ||
"githubUsername": "Nemo157" | ||
} | ||
@@ -24,5 +26,4 @@ ], | ||
"dependencies": {}, | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "26778aaec40d739a30d76da58c0a2a666a87542d839f61fef9d59131d1a656bb", | ||
"typesPublisherContentHash": "341ec9af589e49363f3095cfcee43f75d679790f72ea6df5950f764981de5259", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 22 May 2017 21:03:30 GMT | ||
* Last updated: Wed, 18 Apr 2018 19:49:48 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: When |
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
21078
333