@types/bluebird
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -23,3 +23,5 @@ // Type definitions for bluebird 1.0.0 | ||
*/ | ||
constructor(callback: (resolve: (thenableOrResult: T | Promise.Thenable<T>) => void, reject: (error: any) => void) => void); | ||
constructor( | ||
callback: (resolve: (thenableOrResult: T | Promise.Thenable<T>) => void, reject: (error: any) => void) => void, | ||
); | ||
@@ -29,5 +31,17 @@ /** | ||
*/ | ||
then<U>(onFulfill: (value: T) => Promise.Thenable<U>, onReject: (error: any) => Promise.Thenable<U>, onProgress?: (note: any) => any): Promise<U>; | ||
then<U>(onFulfill: (value: T) => Promise.Thenable<U>, onReject?: (error: any) => U, onProgress?: (note: any) => any): Promise<U>; | ||
then<U>(onFulfill: (value: T) => U, onReject: (error: any) => Promise.Thenable<U>, onProgress?: (note: any) => any): Promise<U>; | ||
then<U>( | ||
onFulfill: (value: T) => Promise.Thenable<U>, | ||
onReject: (error: any) => Promise.Thenable<U>, | ||
onProgress?: (note: any) => any, | ||
): Promise<U>; | ||
then<U>( | ||
onFulfill: (value: T) => Promise.Thenable<U>, | ||
onReject?: (error: any) => U, | ||
onProgress?: (note: any) => any, | ||
): Promise<U>; | ||
then<U>( | ||
onFulfill: (value: T) => U, | ||
onReject: (error: any) => Promise.Thenable<U>, | ||
onProgress?: (note: any) => any, | ||
): Promise<U>; | ||
then<U>(onFulfill?: (value: T) => U, onReject?: (error: any) => U, onProgress?: (note: any) => any): Promise<U>; | ||
@@ -92,5 +106,17 @@ | ||
*/ | ||
done<U>(onFulfilled: (value: T) => Promise.Thenable<U>, onRejected: (error: any) => Promise.Thenable<U>, onProgress?: (note: any) => any): Promise<U>; | ||
done<U>(onFulfilled: (value: T) => Promise.Thenable<U>, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise<U>; | ||
done<U>(onFulfilled: (value: T) => U, onRejected: (error: any) => Promise.Thenable<U>, onProgress?: (note: any) => any): Promise<U>; | ||
done<U>( | ||
onFulfilled: (value: T) => Promise.Thenable<U>, | ||
onRejected: (error: any) => Promise.Thenable<U>, | ||
onProgress?: (note: any) => any, | ||
): Promise<U>; | ||
done<U>( | ||
onFulfilled: (value: T) => Promise.Thenable<U>, | ||
onRejected?: (error: any) => U, | ||
onProgress?: (note: any) => any, | ||
): Promise<U>; | ||
done<U>( | ||
onFulfilled: (value: T) => U, | ||
onRejected: (error: any) => Promise.Thenable<U>, | ||
onProgress?: (note: any) => any, | ||
): Promise<U>; | ||
done<U>(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise<U>; | ||
@@ -142,5 +168,17 @@ | ||
*/ | ||
fork<U>(onFulfilled: (value: T) => Promise.Thenable<U>, onRejected: (error: any) => Promise.Thenable<U>, onProgress?: (note: any) => any): Promise<U>; | ||
fork<U>(onFulfilled: (value: T) => Promise.Thenable<U>, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise<U>; | ||
fork<U>(onFulfilled: (value: T) => U, onRejected: (error: any) => Promise.Thenable<U>, onProgress?: (note: any) => any): Promise<U>; | ||
fork<U>( | ||
onFulfilled: (value: T) => Promise.Thenable<U>, | ||
onRejected: (error: any) => Promise.Thenable<U>, | ||
onProgress?: (note: any) => any, | ||
): Promise<U>; | ||
fork<U>( | ||
onFulfilled: (value: T) => Promise.Thenable<U>, | ||
onRejected?: (error: any) => U, | ||
onProgress?: (note: any) => any, | ||
): Promise<U>; | ||
fork<U>( | ||
onFulfilled: (value: T) => U, | ||
onRejected: (error: any) => Promise.Thenable<U>, | ||
onProgress?: (note: any) => any, | ||
): Promise<U>; | ||
fork<U>(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise<U>; | ||
@@ -188,4 +226,4 @@ | ||
* promise.then(function(obj){ | ||
* return obj[propertyName].call(obj, arg...); | ||
* }); | ||
* return obj[propertyName].call(obj, arg...); | ||
* }); | ||
* </code> | ||
@@ -200,4 +238,4 @@ */ | ||
* promise.then(function(obj){ | ||
* return obj[propertyName]; | ||
* }); | ||
* return obj[propertyName]; | ||
* }); | ||
* </code> | ||
@@ -213,4 +251,4 @@ */ | ||
* .then(function() { | ||
* return value; | ||
* }); | ||
* return value; | ||
* }); | ||
* </code> | ||
@@ -232,4 +270,4 @@ * | ||
* .then(function() { | ||
* throw reason; | ||
* }); | ||
* throw reason; | ||
* }); | ||
* </code> | ||
@@ -313,3 +351,6 @@ * Same limitations apply as with `.return()`. | ||
// TODO type inference from array-resolving promise? | ||
reduce<Q, U>(reducer: (memo: U, item: Q, index: number, arrayLength: number) => Promise.Thenable<U>, initialValue?: U): Promise<U>; | ||
reduce<Q, U>( | ||
reducer: (memo: U, item: Q, index: number, arrayLength: number) => Promise.Thenable<U>, | ||
initialValue?: U, | ||
): Promise<U>; | ||
reduce<Q, U>(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U, initialValue?: U): Promise<U>; | ||
@@ -530,15 +571,36 @@ | ||
// promise of array with promises of value | ||
static map<R, U>(values: Promise.Thenable<Promise.Thenable<R>[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U[]>; | ||
static map<R, U>(values: Promise.Thenable<Promise.Thenable<R>[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise<U[]>; | ||
static map<R, U>( | ||
values: Promise.Thenable<Promise.Thenable<R>[]>, | ||
mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>, | ||
): Promise<U[]>; | ||
static map<R, U>( | ||
values: Promise.Thenable<Promise.Thenable<R>[]>, | ||
mapper: (item: R, index: number, arrayLength: number) => U, | ||
): Promise<U[]>; | ||
// promise of array with values | ||
static map<R, U>(values: Promise.Thenable<R[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U[]>; | ||
static map<R, U>(values: Promise.Thenable<R[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise<U[]>; | ||
static map<R, U>( | ||
values: Promise.Thenable<R[]>, | ||
mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>, | ||
): Promise<U[]>; | ||
static map<R, U>( | ||
values: Promise.Thenable<R[]>, | ||
mapper: (item: R, index: number, arrayLength: number) => U, | ||
): Promise<U[]>; | ||
// array with promises of value | ||
static map<R, U>(values: Promise.Thenable<R>[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U[]>; | ||
static map<R, U>(values: Promise.Thenable<R>[], mapper: (item: R, index: number, arrayLength: number) => U): Promise<U[]>; | ||
static map<R, U>( | ||
values: Promise.Thenable<R>[], | ||
mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>, | ||
): Promise<U[]>; | ||
static map<R, U>( | ||
values: Promise.Thenable<R>[], | ||
mapper: (item: R, index: number, arrayLength: number) => U, | ||
): Promise<U[]>; | ||
// array with values | ||
static map<R, U>(values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U[]>; | ||
static map<R, U>( | ||
values: R[], | ||
mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>, | ||
): Promise<U[]>; | ||
static map<R, U>(values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise<U[]>; | ||
@@ -554,16 +616,48 @@ | ||
// promise of array with promises of value | ||
static reduce<R, U>(values: Promise.Thenable<Promise.Thenable<R>[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable<U>, initialValue?: U): Promise<U>; | ||
static reduce<R, U>(values: Promise.Thenable<Promise.Thenable<R>[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise<U>; | ||
static reduce<R, U>( | ||
values: Promise.Thenable<Promise.Thenable<R>[]>, | ||
reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable<U>, | ||
initialValue?: U, | ||
): Promise<U>; | ||
static reduce<R, U>( | ||
values: Promise.Thenable<Promise.Thenable<R>[]>, | ||
reducer: (total: U, current: R, index: number, arrayLength: number) => U, | ||
initialValue?: U, | ||
): Promise<U>; | ||
// promise of array with values | ||
static reduce<R, U>(values: Promise.Thenable<R[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable<U>, initialValue?: U): Promise<U>; | ||
static reduce<R, U>(values: Promise.Thenable<R[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise<U>; | ||
static reduce<R, U>( | ||
values: Promise.Thenable<R[]>, | ||
reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable<U>, | ||
initialValue?: U, | ||
): Promise<U>; | ||
static reduce<R, U>( | ||
values: Promise.Thenable<R[]>, | ||
reducer: (total: U, current: R, index: number, arrayLength: number) => U, | ||
initialValue?: U, | ||
): Promise<U>; | ||
// array with promises of value | ||
static reduce<R, U>(values: Promise.Thenable<R>[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable<U>, initialValue?: U): Promise<U>; | ||
static reduce<R, U>(values: Promise.Thenable<R>[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise<U>; | ||
static reduce<R, U>( | ||
values: Promise.Thenable<R>[], | ||
reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable<U>, | ||
initialValue?: U, | ||
): Promise<U>; | ||
static reduce<R, U>( | ||
values: Promise.Thenable<R>[], | ||
reducer: (total: U, current: R, index: number, arrayLength: number) => U, | ||
initialValue?: U, | ||
): Promise<U>; | ||
// array with values | ||
static reduce<R, U>(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable<U>, initialValue?: U): Promise<U>; | ||
static reduce<R, U>(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise<U>; | ||
static reduce<R, U>( | ||
values: R[], | ||
reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable<U>, | ||
initialValue?: U, | ||
): Promise<U>; | ||
static reduce<R, U>( | ||
values: R[], | ||
reducer: (total: U, current: R, index: number, arrayLength: number) => U, | ||
initialValue?: U, | ||
): Promise<U>; | ||
@@ -578,15 +672,36 @@ /** | ||
// promise of array with promises of value | ||
static filter<R>(values: Promise.Thenable<Promise.Thenable<R>[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>; | ||
static filter<R>(values: Promise.Thenable<Promise.Thenable<R>[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>; | ||
static filter<R>( | ||
values: Promise.Thenable<Promise.Thenable<R>[]>, | ||
filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>, | ||
): Promise<R[]>; | ||
static filter<R>( | ||
values: Promise.Thenable<Promise.Thenable<R>[]>, | ||
filterer: (item: R, index: number, arrayLength: number) => boolean, | ||
): Promise<R[]>; | ||
// promise of array with values | ||
static filter<R>(values: Promise.Thenable<R[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>; | ||
static filter<R>(values: Promise.Thenable<R[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>; | ||
static filter<R>( | ||
values: Promise.Thenable<R[]>, | ||
filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>, | ||
): Promise<R[]>; | ||
static filter<R>( | ||
values: Promise.Thenable<R[]>, | ||
filterer: (item: R, index: number, arrayLength: number) => boolean, | ||
): Promise<R[]>; | ||
// array with promises of value | ||
static filter<R>(values: Promise.Thenable<R>[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>; | ||
static filter<R>(values: Promise.Thenable<R>[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>; | ||
static filter<R>( | ||
values: Promise.Thenable<R>[], | ||
filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>, | ||
): Promise<R[]>; | ||
static filter<R>( | ||
values: Promise.Thenable<R>[], | ||
filterer: (item: R, index: number, arrayLength: number) => boolean, | ||
): Promise<R[]>; | ||
// array with values | ||
static filter<R>(values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>; | ||
static filter<R>( | ||
values: R[], | ||
filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>, | ||
): Promise<R[]>; | ||
static filter<R>(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>; | ||
@@ -678,4 +793,4 @@ } | ||
// eslint-disable-next-line @definitelytyped/no-declare-current-package | ||
declare module 'bluebird' { | ||
declare module "bluebird" { | ||
export = Promise; | ||
} |
{ | ||
"name": "@types/bluebird", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "TypeScript definitions for bluebird", | ||
@@ -23,4 +23,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bluebird", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "b06b7a36a3c673235f53b39180a85cbda20321d1477d557ef745d998cd044af7", | ||
"typeScriptVersion": "4.3" | ||
"typesPublisherContentHash": "bcf289788107f6903869caa2326d5bf7792459392c555db711e6e77cff3a254d", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 01 Sep 2023 20:03:13 GMT | ||
* Last updated: Fri, 15 Sep 2023 19:06:48 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: `Promise` |
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
39962
698