Socket
Socket
Sign inDemoInstall

@types/bluebird

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/bluebird - npm Package Compare versions

Comparing version 3.5.16 to 3.5.17

399

bluebird/index.d.ts

@@ -50,3 +50,3 @@ // Type definitions for bluebird 3.5

then<U>(onFulfill?: (value: R) => U | PromiseLike<U>, onReject?: (error: any) => U | PromiseLike<U>): Bluebird<U>; // For simpler signature help.
then<TResult1 = R, TResult2 = never>(onfulfilled?: ((value: R) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Bluebird<TResult1 | TResult2>;
then<TResult1 = R, TResult2 = never>(onfulfilled?: ((value: R) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Bluebird<TResult1 | TResult2>;

@@ -58,6 +58,4 @@ /**

*/
catch(onReject?: (error: any) => R | PromiseLike<R> | void | PromiseLike<void>): Bluebird<R>;
caught(onReject?: (error: any) => R | PromiseLike<R> | void | PromiseLike<void>): Bluebird<R>;
catch<U>(onReject?: (error: any) => U | PromiseLike<U>): Bluebird<U | R>;
caught<U>(onReject?: (error: any) => U | PromiseLike<U>): Bluebird<U | R>;
catch(onReject: (error: any) => R | PromiseLike<R>): Bluebird<R>;
catch<U>(onReject?: ((error: any) => U | PromiseLike<U>) | undefined | null): Bluebird<U | R>;

@@ -70,4 +68,2 @@ /**

* Alias `.caught();` for compatibility with earlier ECMAScript version.
*
* TODO: disallow non-objects
*/

@@ -80,3 +76,3 @@ catch<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(

filter5: (new (...args: any[]) => E5),
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R> | void | PromiseLike<void>,
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R>,
): Bluebird<R>;

@@ -89,5 +85,5 @@ catch<E1, E2, E3, E4, E5>(

filter5: ((error: E5) => boolean) | (E5 & object),
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R> | void | PromiseLike<void>,
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R>,
): Bluebird<R>;
caught<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
catch<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
filter1: (new (...args: any[]) => E1),

@@ -98,5 +94,5 @@ filter2: (new (...args: any[]) => E2),

filter5: (new (...args: any[]) => E5),
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R> | void | PromiseLike<void>,
): Bluebird<R>;
caught<E1, E2, E3, E4, E5>(
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<U, E1, E2, E3, E4, E5>(
filter1: ((error: E1) => boolean) | (E1 & object),

@@ -107,5 +103,6 @@ filter2: ((error: E2) => boolean) | (E2 & object),

filter5: ((error: E5) => boolean) | (E5 & object),
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R> | void | PromiseLike<void>,
): Bluebird<R>;
catch<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
filter1: (new (...args: any[]) => E1),

@@ -115,6 +112,5 @@ filter2: (new (...args: any[]) => E2),

filter4: (new (...args: any[]) => E4),
filter5: (new (...args: any[]) => E5),
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U> | void | PromiseLike<void>,
): Bluebird<U | R>;
catch<U, E1, E2, E3, E4, E5>(
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R>,
): Bluebird<R>;
catch<E1, E2, E3, E4>(
filter1: ((error: E1) => boolean) | (E1 & object),

@@ -124,6 +120,5 @@ filter2: ((error: E2) => boolean) | (E2 & object),

filter4: ((error: E4) => boolean) | (E4 & object),
filter5: ((error: E5) => boolean) | (E5 & object),
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
): Bluebird<U | R>;
caught<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R>,
): Bluebird<R>;
catch<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
filter1: (new (...args: any[]) => E1),

@@ -133,6 +128,5 @@ filter2: (new (...args: any[]) => E2),

filter4: (new (...args: any[]) => E4),
filter5: (new (...args: any[]) => E5),
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
): Bluebird<U | R>;
caught<U, E1, E2, E3, E4, E5>(
catch<U, E1, E2, E3, E4>(
filter1: ((error: E1) => boolean) | (E1 & object),

@@ -142,42 +136,92 @@ filter2: ((error: E2) => boolean) | (E2 & object),

filter4: ((error: E4) => boolean) | (E4 & object),
filter5: ((error: E5) => boolean) | (E5 & object),
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
catch<E1 extends Error, E2 extends Error, E3 extends Error>(
filter1: (new (...args: any[]) => E1),
filter2: (new (...args: any[]) => E2),
filter3: (new (...args: any[]) => E3),
filter4: (new (...args: any[]) => E4),
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R> | void | PromiseLike<void>,
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R>,
): Bluebird<R>;
catch<E1, E2, E3, E4>(
catch<E1, E2, E3>(
filter1: ((error: E1) => boolean) | (E1 & object),
filter2: ((error: E2) => boolean) | (E2 & object),
filter3: ((error: E3) => boolean) | (E3 & object),
filter4: ((error: E4) => boolean) | (E4 & object),
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R> | void | PromiseLike<void>,
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R>,
): Bluebird<R>;
caught<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
catch<U, E1 extends Error, E2 extends Error, E3 extends Error>(
filter1: (new (...args: any[]) => E1),
filter2: (new (...args: any[]) => E2),
filter3: (new (...args: any[]) => E3),
filter4: (new (...args: any[]) => E4),
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R> | void | PromiseLike<void>,
): Bluebird<R>;
caught<E1, E2, E3, E4>(
onReject: (error: E1 | E2 | E3) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<U, E1, E2, E3>(
filter1: ((error: E1) => boolean) | (E1 & object),
filter2: ((error: E2) => boolean) | (E2 & object),
filter3: ((error: E3) => boolean) | (E3 & object),
filter4: ((error: E4) => boolean) | (E4 & object),
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R> | void | PromiseLike<void>,
onReject: (error: E1 | E2 | E3) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<E1 extends Error, E2 extends Error>(
filter1: (new (...args: any[]) => E1),
filter2: (new (...args: any[]) => E2),
onReject: (error: E1 | E2) => R | PromiseLike<R>,
): Bluebird<R>;
catch<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
catch<E1, E2>(
filter1: ((error: E1) => boolean) | (E1 & object),
filter2: ((error: E2) => boolean) | (E2 & object),
onReject: (error: E1 | E2) => R | PromiseLike<R>,
): Bluebird<R>;
catch<U, E1 extends Error, E2 extends Error>(
filter1: (new (...args: any[]) => E1),
filter2: (new (...args: any[]) => E2),
onReject: (error: E1 | E2) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<U, E1, E2>(
filter1: ((error: E1) => boolean) | (E1 & object),
filter2: ((error: E2) => boolean) | (E2 & object),
onReject: (error: E1 | E2) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<E1 extends Error>(
filter1: (new (...args: any[]) => E1),
onReject: (error: E1) => R | PromiseLike<R>,
): Bluebird<R>;
catch<E1>(
filter1: ((error: E1) => boolean) | (E1 & object),
onReject: (error: E1) => R | PromiseLike<R>,
): Bluebird<R>;
catch<U, E1 extends Error>(
filter1: (new (...args: any[]) => E1),
onReject: (error: E1) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<U, E1>(
filter1: ((error: E1) => boolean) | (E1 & object),
onReject: (error: E1) => U | PromiseLike<U>,
): Bluebird<U | R>;
/**
* This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler.
*
* Alias `.caught();` for compatibility with earlier ECMAScript version.
*/
caught(onReject: (error: any) => R | PromiseLike<R>): Bluebird<R>;
caught<U>(onReject?: ((error: any) => U | PromiseLike<U>) | undefined | null): Bluebird<U | R>;
/**
* This extends `.catch` to work more like catch-clauses in languages like Java or C#. Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler. The catch handler that is first met that has eligible constructors specified, is the one that will be called.
*
* This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. The return result of the predicate will be used determine whether the error handler should be called.
*
* Alias `.caught();` for compatibility with earlier ECMAScript version.
*/
caught<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
filter1: (new (...args: any[]) => E1),
filter2: (new (...args: any[]) => E2),
filter3: (new (...args: any[]) => E3),
filter4: (new (...args: any[]) => E4),
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<U, E1, E2, E3, E4>(
filter5: (new (...args: any[]) => E5),
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R>,
): Bluebird<R>;
caught<E1, E2, E3, E4, E5>(
filter1: ((error: E1) => boolean) | (E1 & object),

@@ -187,5 +231,6 @@ filter2: ((error: E2) => boolean) | (E2 & object),

filter4: ((error: E4) => boolean) | (E4 & object),
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
): Bluebird<U | R>;
caught<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
filter5: ((error: E5) => boolean) | (E5 & object),
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R>,
): Bluebird<R>;
caught<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
filter1: (new (...args: any[]) => E1),

@@ -195,5 +240,6 @@ filter2: (new (...args: any[]) => E2),

filter4: (new (...args: any[]) => E4),
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
filter5: (new (...args: any[]) => E5),
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
): Bluebird<U | R>;
caught<U, E1, E2, E3, E4>(
caught<U, E1, E2, E3, E4, E5>(
filter1: ((error: E1) => boolean) | (E1 & object),

@@ -203,41 +249,47 @@ filter2: ((error: E2) => boolean) | (E2 & object),

filter4: ((error: E4) => boolean) | (E4 & object),
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
filter5: ((error: E5) => boolean) | (E5 & object),
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<E1 extends Error, E2 extends Error, E3 extends Error>(
caught<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
filter1: (new (...args: any[]) => E1),
filter2: (new (...args: any[]) => E2),
filter3: (new (...args: any[]) => E3),
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R> | void | PromiseLike<void>,
filter4: (new (...args: any[]) => E4),
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R>,
): Bluebird<R>;
catch<E1, E2, E3>(
caught<E1, E2, E3, E4>(
filter1: ((error: E1) => boolean) | (E1 & object),
filter2: ((error: E2) => boolean) | (E2 & object),
filter3: ((error: E3) => boolean) | (E3 & object),
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R> | void | PromiseLike<void>,
filter4: ((error: E4) => boolean) | (E4 & object),
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R>,
): Bluebird<R>;
caught<E1 extends Error, E2 extends Error, E3 extends Error>(
caught<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
filter1: (new (...args: any[]) => E1),
filter2: (new (...args: any[]) => E2),
filter3: (new (...args: any[]) => E3),
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R> | void | PromiseLike<void>,
): Bluebird<R>;
caught<E1, E2, E3>(
filter4: (new (...args: any[]) => E4),
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
): Bluebird<U | R>;
caught<U, E1, E2, E3, E4>(
filter1: ((error: E1) => boolean) | (E1 & object),
filter2: ((error: E2) => boolean) | (E2 & object),
filter3: ((error: E3) => boolean) | (E3 & object),
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R> | void | PromiseLike<void>,
): Bluebird<R>;
catch<U, E1 extends Error, E2 extends Error, E3 extends Error>(
filter4: ((error: E4) => boolean) | (E4 & object),
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
): Bluebird<U | R>;
caught<E1 extends Error, E2 extends Error, E3 extends Error>(
filter1: (new (...args: any[]) => E1),
filter2: (new (...args: any[]) => E2),
filter3: (new (...args: any[]) => E3),
onReject: (error: E1 | E2 | E3) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<U, E1, E2, E3>(
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R>,
): Bluebird<R>;
caught<E1, E2, E3>(
filter1: ((error: E1) => boolean) | (E1 & object),
filter2: ((error: E2) => boolean) | (E2 & object),
filter3: ((error: E3) => boolean) | (E3 & object),
onReject: (error: E1 | E2 | E3) => U | PromiseLike<U>,
): Bluebird<U | R>;
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R>,
): Bluebird<R>;
caught<U, E1 extends Error, E2 extends Error, E3 extends Error>(

@@ -256,16 +308,6 @@ filter1: (new (...args: any[]) => E1),

catch<E1 extends Error, E2 extends Error>(
filter1: (new (...args: any[]) => E1),
filter2: (new (...args: any[]) => E2),
onReject: (error: E1 | E2) => R | PromiseLike<R> | void | PromiseLike<void>,
): Bluebird<R>;
catch<E1, E2>(
filter1: ((error: E1) => boolean) | (E1 & object),
filter2: ((error: E2) => boolean) | (E2 & object),
onReject: (error: E1 | E2) => R | PromiseLike<R> | void | PromiseLike<void>,
): Bluebird<R>;
caught<E1 extends Error, E2 extends Error>(
filter1: (new (...args: any[]) => E1),
filter2: (new (...args: any[]) => E2),
onReject: (error: E1 | E2) => R | PromiseLike<R> | void | PromiseLike<void>,
onReject: (error: E1 | E2) => R | PromiseLike<R>,
): Bluebird<R>;

@@ -275,14 +317,4 @@ caught<E1, E2>(

filter2: ((error: E2) => boolean) | (E2 & object),
onReject: (error: E1 | E2) => R | PromiseLike<R> | void | PromiseLike<void>,
onReject: (error: E1 | E2) => R | PromiseLike<R>,
): Bluebird<R>;
catch<U, E1 extends Error, E2 extends Error>(
filter1: (new (...args: any[]) => E1),
filter2: (new (...args: any[]) => E2),
onReject: (error: E1 | E2) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<U, E1, E2>(
filter1: ((error: E1) => boolean) | (E1 & object),
filter2: ((error: E2) => boolean) | (E2 & object),
onReject: (error: E1 | E2) => U | PromiseLike<U>,
): Bluebird<U | R>;
caught<U, E1 extends Error, E2 extends Error>(

@@ -299,26 +331,10 @@ filter1: (new (...args: any[]) => E1),

catch<E1 extends Error>(
filter1: (new (...args: any[]) => E1),
onReject: (error: E1) => R | PromiseLike<R> | void | PromiseLike<void>,
): Bluebird<R>;
catch<E1>(
filter1: ((error: E1) => boolean) | (E1 & object),
onReject: (error: E1) => R | PromiseLike<R> | void | PromiseLike<void>,
): Bluebird<R>;
caught<E1 extends Error>(
filter1: (new (...args: any[]) => E1),
onReject: (error: E1) => R | PromiseLike<R> | void | PromiseLike<void>,
onReject: (error: E1) => R | PromiseLike<R>,
): Bluebird<R>;
caught<E1>(
filter1: ((error: E1) => boolean) | (E1 & object),
onReject: (error: E1) => R | PromiseLike<R> | void | PromiseLike<void>,
onReject: (error: E1) => R | PromiseLike<R>,
): Bluebird<R>;
catch<U, E1 extends Error>(
filter1: (new (...args: any[]) => E1),
onReject: (error: E1) => U | PromiseLike<U>,
): Bluebird<U | R>;
catch<U, E1>(
filter1: ((error: E1) => boolean) | (E1 & object),
onReject: (error: E1) => U | PromiseLike<U>,
): Bluebird<U | R>;
caught<U, E1 extends Error>(

@@ -364,3 +380,2 @@ filter1: (new (...args: any[]) => E1),

* Like `.catch()` but rethrows the error
* TODO: disallow non-objects
*/

@@ -478,3 +493,3 @@ tapCatch<U>(onReject: (error?: any) => U | PromiseLike<U>): Bluebird<R>;

*/
call(propertyName: string, ...args: any[]): Bluebird<any>;
call(propertyName: keyof R, ...args: any[]): Bluebird<any>;

@@ -490,5 +505,3 @@ /**

*/
// TODO: Use "type property type" once it's there
// @see https://github.com/Microsoft/TypeScript/issues/1295
get<U>(key: string | number): Bluebird<U>;
get<U extends keyof R>(key: U): Bluebird<R[U]>;

@@ -509,4 +522,4 @@ /**

return(): Bluebird<void>;
return<U>(value: U): Bluebird<U>;
thenReturn(): Bluebird<void>;
return<U>(value: U): Bluebird<U>;
thenReturn<U>(value: U): Bluebird<U>;

@@ -526,4 +539,4 @@

*/
throw(reason: Error): Bluebird<R>;
thenThrow(reason: Error): Bluebird<R>;
throw(reason: Error): Bluebird<never>;
thenThrow(reason: Error): Bluebird<never>;

@@ -540,36 +553,35 @@ /**

* in the case where `value` doesn't change its value. That means `value` is bound at the time of calling `.catchReturn()`
* TODO: disallow non-objects
*/
catchReturn<U>(value: U): Bluebird<U>;
catchReturn<U>(value: U): Bluebird<R | U>;
catchReturn<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object,
filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object,
filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object,
catchReturn<U>(
filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter5: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
value: U,
): Bluebird<U>;
catchReturn<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object,
filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object,
): Bluebird<R | U>;
catchReturn<U>(
filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
value: U,
): Bluebird<U>;
catchReturn<U, E1 extends Error, E2 extends Error, E3 extends Error>(
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object,
): Bluebird<R | U>;
catchReturn<U>(
filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
value: U,
): Bluebird<U>;
catchReturn<U, E1 extends Error, E2 extends Error>(
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object,
): Bluebird<R | U>;
catchReturn<U>(
filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
value: U,
): Bluebird<U>;
catchReturn<U, E1 extends Error>(
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object,
): Bluebird<R | U>;
catchReturn<U>(
filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
value: U,
): Bluebird<U>;
): Bluebird<R | U>;

@@ -585,34 +597,33 @@ /**

* Same limitations apply as with `.catchReturn()`.
* TODO: disallow non-objects
*/
catchThrow(reason: Error): Bluebird<R>;
catchThrow<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object,
filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object,
filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object,
catchThrow(
filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter5: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
reason: Error,
): Bluebird<R>;
catchThrow<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object,
filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object,
catchThrow(
filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
reason: Error,
): Bluebird<R>;
catchThrow<E1 extends Error, E2 extends Error, E3 extends Error>(
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object,
catchThrow(
filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
reason: Error,
): Bluebird<R>;
catchThrow<E1 extends Error, E2 extends Error>(
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object,
catchThrow(
filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
reason: Error,
): Bluebird<R>;
catchThrow<E1 extends Error>(
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object,
catchThrow(
filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object,
reason: Error,

@@ -737,4 +748,3 @@ ): Bluebird<R>;

*/
static reject(reason: any): Bluebird<any>;
static reject<R>(reason: any): Bluebird<R>;
static reject(reason: any): Bluebird<never>;

@@ -795,3 +805,3 @@ /**

// TODO how to model promisifyAll?
static promisifyAll(target: object, options?: Bluebird.PromisifyAllOptions): object;
static promisifyAll<T extends object>(target: T, options?: Bluebird.PromisifyAllOptions<T>): T;

@@ -820,2 +830,3 @@ /**

static coroutine<T, A1, A2, A3, A4, A5, A6, A7, A8>(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => IterableIterator<any>, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => Bluebird<T>;
/**

@@ -829,2 +840,12 @@ * Add `handler` as the handler to call when there is a possibly unhandled rejection. The default handler logs the error stack to stderr or `console.error` in browsers.

/**
* Add handler as the handler to call when there is a possibly unhandled rejection.
* The default handler logs the error stack to stderr or console.error in browsers.
*
* Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections.
*
* Note: this hook is specific to the bluebird instance its called on, application developers should use global rejection events.
*/
static onPossiblyUnhandledRejection(handler?: (error: Error, promise: Bluebird<any>) => void): void;
/**
* Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled. The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. If any promise in the array rejects, the returned promise is rejected with the rejection reason.

@@ -840,3 +861,3 @@ */

// array with values
static all<R>(values: PromiseLike<Array<PromiseLike<R> | R>> | Array<PromiseLike<R> | R>): Bluebird<R[]>;
static all<R>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>): Bluebird<R[]>;

@@ -850,8 +871,6 @@ /**

*/
// trusted promise for map
static props<K, V>(map: PromiseLike<Map<K, PromiseLike<V> | V>>): Bluebird<Map<K, V>>;
// map
static props<K, V>(map: PromiseLike<Map<K, PromiseLike<V> | V>> | Map<K, PromiseLike<V> | V>): Bluebird<Map<K, V>>;
// trusted promise for object
static props<T>(object: PromiseLike<Bluebird.ResolvableProps<T>>): Bluebird<T>; // tslint:disable-line:unified-signatures
// map
static props<K, V>(map: Map<K, PromiseLike<V> | V>): Bluebird<Map<K, V>>; // tslint:disable-line:unified-signatures
// object

@@ -863,3 +882,3 @@ static props<T>(object: Bluebird.ResolvableProps<T>): Bluebird<T>; // tslint:disable-line:unified-signatures

*/
static any<R>(values: PromiseLike<Array<PromiseLike<R> | R>> | Array<PromiseLike<R> | R>): Bluebird<R>;
static any<R>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>): Bluebird<R>;

@@ -871,3 +890,3 @@ /**

*/
static race<R>(values: PromiseLike<Array<PromiseLike<R> | R>> | Array<PromiseLike<R> | R>): Bluebird<R>;
static race<R>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>): Bluebird<R>;

@@ -881,3 +900,3 @@ /**

*/
static some<R>(values: PromiseLike<Array<PromiseLike<R> | R>> | Array<PromiseLike<R> | R>, count: number): Bluebird<R[]>;
static some<R>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>, count: number): Bluebird<R[]>;

@@ -910,3 +929,3 @@ /**

*/
static map<R, U>(values: PromiseLike<Array<PromiseLike<R> | R>> | Array<PromiseLike<R> | R>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
static map<R, U>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;

@@ -920,3 +939,3 @@ /**

*/
static reduce<R, U>(values: PromiseLike<Array<PromiseLike<R> | R>> | Array<PromiseLike<R> | R>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Bluebird<U>;
static reduce<R, U>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Bluebird<U>;

@@ -930,3 +949,3 @@ /**

*/
static filter<R>(values: PromiseLike<Array<PromiseLike<R> | R>> | Array<PromiseLike<R> | R>, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, option?: Bluebird.ConcurrencyOption): Bluebird<R[]>;
static filter<R>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, option?: Bluebird.ConcurrencyOption): Bluebird<R[]>;

@@ -938,3 +957,3 @@ /**

*/
static each<R, U>(values: PromiseLike<Array<PromiseLike<R> | R>> | Array<PromiseLike<R> | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<R[]>;
static each<R, U>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<R[]>;

@@ -948,3 +967,3 @@ /**

*/
static mapSeries<R, U>(values: PromiseLike<Array<PromiseLike<R> | R>> | Array<PromiseLike<R> | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<U[]>;
static mapSeries<R, U>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<U[]>;

@@ -973,12 +992,2 @@ /**

/**
* Add handler as the handler to call when there is a possibly unhandled rejection.
* The default handler logs the error stack to stderr or console.error in browsers.
*
* Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections.
*
* Note: this hook is specific to the bluebird instance its called on, application developers should use global rejection events.
*/
static onPossiblyUnhandledRejection(handler?: (error: Error, promise: Bluebird<any>) => void): void;
/**
* Configure long stack traces, warnings, monitoring and cancellation.

@@ -1028,7 +1037,7 @@ * Note that even though false is the default here, a development environment might be detected which automatically

}
interface PromisifyAllOptions extends PromisifyOptions {
interface PromisifyAllOptions<T> extends PromisifyOptions {
suffix?: string;
filter?(name: string, func: (...args: any[]) => any, target?: any, passesDefaultFilter?: boolean): boolean;
// The promisifier gets a reference to the original method and should return a function which returns a promise
promisifier?(originalMethod: (...args: any[]) => any, defaultPromisifer: (...args: any[]) => (...args: any[]) => Bluebird<any>): () => PromiseLike<any>;
promisifier?(this: T, originalMethod: (...args: any[]) => any, defaultPromisifer: (...args: any[]) => (...args: any[]) => Bluebird<any>): () => PromiseLike<any>;
}

@@ -1057,3 +1066,3 @@ interface CoroutineOptions {

*/
class CancellationError extends Error {}
class CancellationError extends Error { }

@@ -1093,3 +1102,3 @@ /**

*/
class Disposer<R> {}
class Disposer<R> { }

@@ -1099,3 +1108,3 @@ /** @deprecated Use PromiseLike<T> directly. */

type ResolvableProps<T> = object & { [K in keyof T]: PromiseLike<T[K]> | T[K] };
type ResolvableProps<T> = object & {[K in keyof T]: PromiseLike<T[K]> | T[K]};

@@ -1102,0 +1111,0 @@ interface Resolver<R> {

{
"name": "@types/bluebird",
"version": "3.5.16",
"version": "3.5.17",
"description": "TypeScript definitions for bluebird",

@@ -20,4 +20,4 @@ "license": "MIT",

"dependencies": {},
"typesPublisherContentHash": "41f37028db7d2f781e4e9f14a44f3058d49429fedafb1230fd5fe5e2735dc3d6",
"typesPublisherContentHash": "3b3771b0ca678b9fdca543a4b2bf654ff907d34022e160df6ed9311ac12040c0",
"typeScriptVersion": "2.3"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Thu, 12 Oct 2017 21:00:44 GMT
* Last updated: Wed, 25 Oct 2017 18:38:01 GMT
* Dependencies: none

@@ -14,0 +14,0 @@ * Global values: none

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