mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Merge pull request #17245 from DefinitelyTyped/bluebird-promiselike
bluebird: Make `Thenable` an alias to the builtin `PromiseLike`.
This commit is contained in:
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/squaremo/amqp.node
|
||||
// Definitions by: Michael Nahkies <https://github.com/mnahkies>, Ab Reitsma <https://github.com/abreits>, Nicolás Fantone <https://github.com/nfantone>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/spion/anydb-sql-migrations
|
||||
// Definitions by: Gorgi Kosev <https://github.com/spion>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import Promise = require('bluebird');
|
||||
import { Column, Table, Transaction, AnydbSql } from 'anydb-sql';
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/Asana/node-asana
|
||||
// Definitions by: Qubo <https://github.com/tkqubo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="bluebird" />
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/auth0/node-auth0
|
||||
// Definitions by: Wilson Hobbs <https://github.com/wbhob>, Seth Westphal <https://github.com/westy92>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as Promise from 'bluebird';
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/spion/blue-tape
|
||||
// Definitions by: Haoqun Jiang <https://github.com/sodatea>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
Vendored
+8
-7
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/petkaantonov/bluebird
|
||||
// Definitions by: d-ph <https://github.com/d-ph>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/*
|
||||
* 1. Why use `bluebird-global` instead of `bluebird`?
|
||||
@@ -117,19 +118,19 @@ declare global {
|
||||
*
|
||||
* @todo Duplication of code is never ideal. See whether there's a better way of achieving this.
|
||||
*/
|
||||
catch(predicate: (error: any) => boolean, onReject: (error: any) => T | Bluebird.Thenable<T> | void | Bluebird.Thenable<void>): Bluebird<T>;
|
||||
catch<U>(predicate: (error: any) => boolean, onReject: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U | T>;
|
||||
catch<E extends Error>(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => T | Bluebird.Thenable<T> | void | Bluebird.Thenable<void>): Bluebird<T>;
|
||||
catch<E extends Error, U>(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable<U>): Bluebird<U | T>;
|
||||
catch(predicate: Object, onReject: (error: any) => T | Bluebird.Thenable<T> | void | Bluebird.Thenable<void>): Bluebird<T>;
|
||||
catch<U>(predicate: Object, onReject: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U | T>;
|
||||
catch(predicate: (error: any) => boolean, onReject: (error: any) => T | PromiseLike<T> | void | PromiseLike<void>): Bluebird<T>;
|
||||
catch<U>(predicate: (error: any) => boolean, onReject: (error: any) => U | PromiseLike<U>): Bluebird<U | T>;
|
||||
catch<E extends Error>(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => T | PromiseLike<T> | void | PromiseLike<void>): Bluebird<T>;
|
||||
catch<E extends Error, U>(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | PromiseLike<U>): Bluebird<U | T>;
|
||||
catch(predicate: Object, onReject: (error: any) => T | PromiseLike<T> | void | PromiseLike<void>): Bluebird<T>;
|
||||
catch<U>(predicate: Object, onReject: (error: any) => U | PromiseLike<U>): Bluebird<U | T>;
|
||||
}
|
||||
|
||||
/*
|
||||
* Patch all static methods and the constructor
|
||||
*/
|
||||
interface PromiseConstructor {
|
||||
new <T>(callback: (resolve: (thenableOrResult?: T | Bluebird.Thenable<T>) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void): Promise<T>;
|
||||
new <T>(callback: (resolve: (thenableOrResult?: T | PromiseLike<T>) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void): Promise<T>;
|
||||
|
||||
// all: typeof Bluebird.all;
|
||||
any: typeof Bluebird.any;
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/jut-io/bluebird-retry
|
||||
// Definitions by: Pascal Vomhoff <https://github.com/pvomhoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="bluebird" />
|
||||
|
||||
|
||||
Vendored
+92
-94
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/petkaantonov/bluebird
|
||||
// Definitions by: Leonard Hecker <https://github.com/lhecker>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/*!
|
||||
* The code following this comment originates from:
|
||||
@@ -34,30 +35,29 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R> {
|
||||
declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
|
||||
/**
|
||||
* Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise.
|
||||
* If promise cancellation is enabled, passed in function will receive one more function argument `onCancel` that allows to register an optional cancellation callback.
|
||||
*/
|
||||
constructor(callback: (resolve: (thenableOrResult?: R | Bluebird.Thenable<R>) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void);
|
||||
constructor(callback: (resolve: (thenableOrResult?: R | PromiseLike<R>) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void);
|
||||
|
||||
/**
|
||||
* Promises/A+ `.then()`. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.
|
||||
*/
|
||||
then<U1, U2>(onFulfill: (value: R) => U1 | Bluebird.Thenable<U1>, onReject: (error: any) => U2 | Bluebird.Thenable<U2>): Bluebird<U1 | U2>;
|
||||
then<U>(onFulfill: (value: R) => U | Bluebird.Thenable<U>, onReject: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U>;
|
||||
then<U>(onFulfill: (value: R) => U | Bluebird.Thenable<U>): Bluebird<U>;
|
||||
then(): Bluebird<R>;
|
||||
// Based on PromiseLike.then, but returns a Bluebird instance.
|
||||
then<U>(onFulfill?: (value: R) => U | Bluebird.Thenable<U>, onReject?: (error: any) => U | Bluebird.Thenable<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>;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
catch(onReject?: (error: any) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>): Bluebird<R>;
|
||||
caught(onReject?: (error: any) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>): Bluebird<R>;
|
||||
catch<U>(onReject?: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U | R>;
|
||||
caught<U>(onReject?: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U | R>;
|
||||
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>;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -74,7 +74,7 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
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,
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>,
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R> | void | PromiseLike<void>,
|
||||
): Bluebird<R>;
|
||||
caught<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object,
|
||||
@@ -82,7 +82,7 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
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,
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>,
|
||||
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>(
|
||||
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object,
|
||||
@@ -90,7 +90,7 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
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,
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | Bluebird.Thenable<U>,
|
||||
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>(
|
||||
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object,
|
||||
@@ -98,7 +98,7 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
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,
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | Bluebird.Thenable<U>,
|
||||
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>(
|
||||
@@ -106,106 +106,106 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
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,
|
||||
onReject: (error: E1 | E2 | E3 | E4) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>,
|
||||
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R> | void | PromiseLike<void>,
|
||||
): Bluebird<R>;
|
||||
caught<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,
|
||||
onReject: (error: E1 | E2 | E3 | E4) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>,
|
||||
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R> | void | PromiseLike<void>,
|
||||
): Bluebird<R>;
|
||||
catch<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,
|
||||
onReject: (error: E1 | E2 | E3 | E4) => U | Bluebird.Thenable<U>,
|
||||
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>(
|
||||
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,
|
||||
onReject: (error: E1 | E2 | E3 | E4) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
catch<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,
|
||||
onReject: (error: E1 | E2 | E3) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>,
|
||||
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R> | void | PromiseLike<void>,
|
||||
): Bluebird<R>;
|
||||
caught<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,
|
||||
onReject: (error: E1 | E2 | E3) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>,
|
||||
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R> | void | PromiseLike<void>,
|
||||
): Bluebird<R>;
|
||||
catch<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,
|
||||
onReject: (error: E1 | E2 | E3) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1 | E2 | E3) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
caught<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,
|
||||
onReject: (error: E1 | E2 | E3) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1 | E2 | E3) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
catch<E1 extends Error, E2 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object,
|
||||
filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object,
|
||||
onReject: (error: E1 | E2) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>,
|
||||
onReject: (error: E1 | E2) => R | PromiseLike<R> | void | PromiseLike<void>,
|
||||
): Bluebird<R>;
|
||||
caught<E1 extends Error, E2 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object,
|
||||
filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object,
|
||||
onReject: (error: E1 | E2) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>,
|
||||
onReject: (error: E1 | E2) => R | PromiseLike<R> | void | PromiseLike<void>,
|
||||
): Bluebird<R>;
|
||||
catch<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,
|
||||
onReject: (error: E1 | E2) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1 | E2) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
caught<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,
|
||||
onReject: (error: E1 | E2) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1 | E2) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
catch<E1 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object,
|
||||
onReject: (error: E1) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>,
|
||||
onReject: (error: E1) => R | PromiseLike<R> | void | PromiseLike<void>,
|
||||
): Bluebird<R>;
|
||||
caught<E1 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object,
|
||||
onReject: (error: E1) => R | Bluebird.Thenable<R> | void | Bluebird.Thenable<void>,
|
||||
onReject: (error: E1) => R | PromiseLike<R> | void | PromiseLike<void>,
|
||||
): Bluebird<R>;
|
||||
catch<U, E1 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object,
|
||||
onReject: (error: E1) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
caught<U, E1 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object,
|
||||
onReject: (error: E1) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
/**
|
||||
* Like `.catch` but instead of catching all types of exceptions, it only catches those that don't originate from thrown errors but rather from explicit rejections.
|
||||
*/
|
||||
error<U>(onReject: (reason: any) => U | Bluebird.Thenable<U>): Bluebird<U>;
|
||||
error<U>(onReject: (reason: any) => U | PromiseLike<U>): Bluebird<U>;
|
||||
|
||||
/**
|
||||
* Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. There are special semantics for `.finally()` in that the final value cannot be modified from the handler.
|
||||
*
|
||||
* Alias `.lastly();` for compatibility with earlier ECMAScript version.
|
||||
*/
|
||||
finally<U>(handler: () => U | Bluebird.Thenable<U>): Bluebird<R>;
|
||||
finally<U>(handler: () => U | PromiseLike<U>): Bluebird<R>;
|
||||
|
||||
lastly<U>(handler: () => U | Bluebird.Thenable<U>): Bluebird<R>;
|
||||
lastly<U>(handler: () => U | PromiseLike<U>): Bluebird<R>;
|
||||
|
||||
/**
|
||||
* Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise.
|
||||
@@ -215,19 +215,19 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
/**
|
||||
* Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error.
|
||||
*/
|
||||
done<U>(onFulfilled?: (value: R) => U | Bluebird.Thenable<U>, onRejected?: (error: any) => U | Bluebird.Thenable<U>): void;
|
||||
done<U>(onFulfilled?: (value: R) => U | PromiseLike<U>, onRejected?: (error: any) => U | PromiseLike<U>): void;
|
||||
|
||||
/**
|
||||
* Like `.finally()`, but not called for rejections.
|
||||
*/
|
||||
tap<U>(onFulFill: (value: R) => Bluebird.Thenable<U>): Bluebird<R>;
|
||||
tap<U>(onFulFill: (value: R) => PromiseLike<U>): Bluebird<R>;
|
||||
tap<U>(onFulfill: (value: R) => U): Bluebird<R>;
|
||||
|
||||
/**
|
||||
* Like `.catch()` but rethrows the error
|
||||
* TODO: disallow non-objects
|
||||
*/
|
||||
tapCatch<U>(onReject: (error?: any) => U | Bluebird.Thenable<U>): Bluebird<R>;
|
||||
tapCatch<U>(onReject: (error?: any) => U | PromiseLike<U>): Bluebird<R>;
|
||||
|
||||
tapCatch<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,
|
||||
@@ -235,29 +235,29 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
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,
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
|
||||
): Bluebird<R>;
|
||||
tapCatch<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,
|
||||
onReject: (error: E1 | E2 | E3 | E4) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
|
||||
): Bluebird<R>;
|
||||
tapCatch<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,
|
||||
onReject: (error: E1 | E2 | E3) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1 | E2 | E3) => U | PromiseLike<U>,
|
||||
): Bluebird<R>;
|
||||
tapCatch<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,
|
||||
onReject: (error: E1 | E2) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1 | E2) => U | PromiseLike<U>,
|
||||
): Bluebird<R>;
|
||||
tapCatch<U, E1 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object,
|
||||
onReject: (error: E1) => U | Bluebird.Thenable<U>,
|
||||
onReject: (error: E1) => U | PromiseLike<U>,
|
||||
): Bluebird<R>;
|
||||
|
||||
/**
|
||||
@@ -488,7 +488,7 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
/**
|
||||
* Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers.
|
||||
*/
|
||||
spread<U, W>(fulfilledHandler: (...values: W[]) => U | Bluebird.Thenable<U>): Bluebird<U>;
|
||||
spread<U, W>(fulfilledHandler: (...values: W[]) => U | PromiseLike<U>): Bluebird<U>;
|
||||
spread<U>(fulfilledHandler: Function): Bluebird<U>;
|
||||
|
||||
/**
|
||||
@@ -525,29 +525,29 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
* Same as calling `Bluebird.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
*/
|
||||
// TODO type inference from array-resolving promise?
|
||||
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => U | Bluebird.Thenable<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
|
||||
/**
|
||||
* Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
*/
|
||||
// TODO type inference from array-resolving promise?
|
||||
reduce<Q, U>(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U | Bluebird.Thenable<U>, initialValue?: U): Bluebird<U>;
|
||||
reduce<Q, U>(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Bluebird<U>;
|
||||
|
||||
/**
|
||||
* Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
*/
|
||||
// TODO type inference from array-resolving promise?
|
||||
filter<U>(filterer: (item: U, index: number, arrayLength: number) => boolean | Bluebird.Thenable<boolean>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
filter<U>(filterer: (item: U, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
|
||||
/**
|
||||
* Same as calling ``Bluebird.each(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
*/
|
||||
each<R, U>(iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>): Bluebird<R[]>;
|
||||
each<R, U>(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<R[]>;
|
||||
|
||||
/**
|
||||
* Same as calling ``Bluebird.mapSeries(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
*/
|
||||
mapSeries<R, U>(iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>): Bluebird<U[]>;
|
||||
mapSeries<R, U>(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<U[]>;
|
||||
|
||||
/**
|
||||
* Cancel this `promise`. Will not do anything if this promise is already settled or if the cancellation feature has not been enabled
|
||||
@@ -568,8 +568,8 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
*
|
||||
* Alias for `attempt();` for compatibility with earlier ECMAScript version.
|
||||
*/
|
||||
static try<R>(fn: () => R | Bluebird.Thenable<R>): Bluebird<R>;
|
||||
static attempt<R>(fn: () => R | Bluebird.Thenable<R>): Bluebird<R>;
|
||||
static try<R>(fn: () => R | PromiseLike<R>): Bluebird<R>;
|
||||
static attempt<R>(fn: () => R | PromiseLike<R>): Bluebird<R>;
|
||||
|
||||
/**
|
||||
* Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function.
|
||||
@@ -581,7 +581,7 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
* Create a promise that is resolved with the given `value`. If `value` is a thenable or promise, the returned promise will assume its state.
|
||||
*/
|
||||
static resolve(): Bluebird<void>;
|
||||
static resolve<R>(value: R | Bluebird.Thenable<R>): Bluebird<R>;
|
||||
static resolve<R>(value: R | PromiseLike<R>): Bluebird<R>;
|
||||
|
||||
/**
|
||||
* Create a promise that is rejected with the given `reason`.
|
||||
@@ -597,7 +597,7 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
/**
|
||||
* Cast the given `value` to a trusted promise. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable.
|
||||
*/
|
||||
static cast<R>(value: R | Bluebird.Thenable<R>): Bluebird<R>;
|
||||
static cast<R>(value: R | PromiseLike<R>): Bluebird<R>;
|
||||
|
||||
/**
|
||||
* Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`.
|
||||
@@ -619,7 +619,7 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
* If value is a promise, the delay will start counting down when it is fulfilled and the returned
|
||||
* promise will be fulfilled with the fulfillment value of the value promise.
|
||||
*/
|
||||
static delay<R>(ms: number, value: R | Bluebird.Thenable<R>): Bluebird<R>;
|
||||
static delay<R>(ms: number, value: R | PromiseLike<R>): Bluebird<R>;
|
||||
static delay(ms: number): Bluebird<void>;
|
||||
|
||||
/**
|
||||
@@ -671,13 +671,13 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
*/
|
||||
// TODO enable more overloads
|
||||
// array with promises of different types
|
||||
static all<T1, T2, T3, T4, T5>(values: [Bluebird.Thenable<T1> | T1, Bluebird.Thenable<T2> | T2, Bluebird.Thenable<T3> | T3, Bluebird.Thenable<T4> | T4, Bluebird.Thenable<T5> | T5]): Bluebird<[T1, T2, T3, T4, T5]>;
|
||||
static all<T1, T2, T3, T4>(values: [Bluebird.Thenable<T1> | T1, Bluebird.Thenable<T2> | T2, Bluebird.Thenable<T3> | T3, Bluebird.Thenable<T4> | T4]): Bluebird<[T1, T2, T3, T4]>;
|
||||
static all<T1, T2, T3>(values: [Bluebird.Thenable<T1> | T1, Bluebird.Thenable<T2> | T2, Bluebird.Thenable<T3> | T3]): Bluebird<[T1, T2, T3]>;
|
||||
static all<T1, T2>(values: [Bluebird.Thenable<T1> | T1, Bluebird.Thenable<T2> | T2]): Bluebird<[T1, T2]>;
|
||||
static all<T1>(values: [Bluebird.Thenable<T1> | T1]): Bluebird<[T1]>;
|
||||
static all<T1, T2, T3, T4, T5>(values: [PromiseLike<T1> | T1, PromiseLike<T2> | T2, PromiseLike<T3> | T3, PromiseLike<T4> | T4, PromiseLike<T5> | T5]): Bluebird<[T1, T2, T3, T4, T5]>;
|
||||
static all<T1, T2, T3, T4>(values: [PromiseLike<T1> | T1, PromiseLike<T2> | T2, PromiseLike<T3> | T3, PromiseLike<T4> | T4]): Bluebird<[T1, T2, T3, T4]>;
|
||||
static all<T1, T2, T3>(values: [PromiseLike<T1> | T1, PromiseLike<T2> | T2, PromiseLike<T3> | T3]): Bluebird<[T1, T2, T3]>;
|
||||
static all<T1, T2>(values: [PromiseLike<T1> | T1, PromiseLike<T2> | T2]): Bluebird<[T1, T2]>;
|
||||
static all<T1>(values: [PromiseLike<T1> | T1]): Bluebird<[T1]>;
|
||||
// array with values
|
||||
static all<R>(values: Bluebird.Thenable<(Bluebird.Thenable<R> | R)[]> | (Bluebird.Thenable<R> | R)[]): Bluebird<R[]>;
|
||||
static all<R>(values: PromiseLike<(PromiseLike<R> | R)[]> | (PromiseLike<R> | R)[]): Bluebird<R[]>;
|
||||
|
||||
/**
|
||||
* Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. If any promise in the object rejects, the returned promise is rejected with the rejection reason.
|
||||
@@ -695,14 +695,14 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
/**
|
||||
* Like `Promise.some()`, with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly.
|
||||
*/
|
||||
static any<R>(values: Bluebird.Thenable<(Bluebird.Thenable<R> | R)[]> | (Bluebird.Thenable<R> | R)[]): Bluebird<R>;
|
||||
static any<R>(values: PromiseLike<(PromiseLike<R> | R)[]> | (PromiseLike<R> | R)[]): Bluebird<R>;
|
||||
|
||||
/**
|
||||
* 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 or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value.
|
||||
*
|
||||
* **Note** If you pass empty array or a sparse array with no values, or a promise/thenable for such, it will be forever pending.
|
||||
*/
|
||||
static race<R>(values: Bluebird.Thenable<(Bluebird.Thenable<R> | R)[]> | (Bluebird.Thenable<R> | R)[]): Bluebird<R>;
|
||||
static race<R>(values: PromiseLike<(PromiseLike<R> | R)[]> | (PromiseLike<R> | R)[]): Bluebird<R>;
|
||||
|
||||
/**
|
||||
* Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution.
|
||||
@@ -712,11 +712,11 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
* *The original array is not modified.*
|
||||
*/
|
||||
// promise of array with promises of value
|
||||
static some<R>(values: Bluebird.Thenable<Bluebird.Thenable<R>[]>, count: number): Bluebird<R[]>;
|
||||
static some<R>(values: PromiseLike<PromiseLike<R>[]>, count: number): Bluebird<R[]>;
|
||||
// promise of array with values
|
||||
static some<R>(values: Bluebird.Thenable<R[]>, count: number): Bluebird<R[]>;
|
||||
static some<R>(values: PromiseLike<R[]>, count: number): Bluebird<R[]>;
|
||||
// array with promises of value
|
||||
static some<R>(values: Bluebird.Thenable<R>[], count: number): Bluebird<R[]>;
|
||||
static some<R>(values: PromiseLike<R>[], count: number): Bluebird<R[]>;
|
||||
// array with values
|
||||
static some<R>(values: R[], count: number): Bluebird<R[]>;
|
||||
|
||||
@@ -729,15 +729,15 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
*
|
||||
* Note: In 1.x and 0.x Promise.join used to be a Promise.all that took the values in as arguments instead in an array. This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply
|
||||
*/
|
||||
static join<R, A1>(arg1: A1 | Bluebird.Thenable<A1>, handler: (arg1: A1) => R | Bluebird.Thenable<R>): Bluebird<R>;
|
||||
static join<R, A1, A2>(arg1: A1 | Bluebird.Thenable<A1>, arg2: A2 | Bluebird.Thenable<A2>, handler: (arg1: A1, arg2: A2) => R | Bluebird.Thenable<R>): Bluebird<R>;
|
||||
static join<R, A1, A2, A3>(arg1: A1 | Bluebird.Thenable<A1>, arg2: A2 | Bluebird.Thenable<A2>, arg3: A3 | Bluebird.Thenable<A3>, handler: (arg1: A1, arg2: A2, arg3: A3) => R | Bluebird.Thenable<R>): Bluebird<R>;
|
||||
static join<R, A1, A2, A3, A4>(arg1: A1 | Bluebird.Thenable<A1>, arg2: A2 | Bluebird.Thenable<A2>, arg3: A3 | Bluebird.Thenable<A3>, arg4: A4 | Bluebird.Thenable<A4>, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | Bluebird.Thenable<R>): Bluebird<R>;
|
||||
static join<R, A1, A2, A3, A4, A5>(arg1: A1 | Bluebird.Thenable<A1>, arg2: A2 | Bluebird.Thenable<A2>, arg3: A3 | Bluebird.Thenable<A3>, arg4: A4 | Bluebird.Thenable<A4>, arg5: A5 | Bluebird.Thenable<A5>, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | Bluebird.Thenable<R>): Bluebird<R>;
|
||||
static join<R, A1>(arg1: A1 | PromiseLike<A1>, handler: (arg1: A1) => R | PromiseLike<R>): Bluebird<R>;
|
||||
static join<R, A1, A2>(arg1: A1 | PromiseLike<A1>, arg2: A2 | PromiseLike<A2>, handler: (arg1: A1, arg2: A2) => R | PromiseLike<R>): Bluebird<R>;
|
||||
static join<R, A1, A2, A3>(arg1: A1 | PromiseLike<A1>, arg2: A2 | PromiseLike<A2>, arg3: A3 | PromiseLike<A3>, handler: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike<R>): Bluebird<R>;
|
||||
static join<R, A1, A2, A3, A4>(arg1: A1 | PromiseLike<A1>, arg2: A2 | PromiseLike<A2>, arg3: A3 | PromiseLike<A3>, arg4: A4 | PromiseLike<A4>, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike<R>): Bluebird<R>;
|
||||
static join<R, A1, A2, A3, A4, A5>(arg1: A1 | PromiseLike<A1>, arg2: A2 | PromiseLike<A2>, arg3: A3 | PromiseLike<A3>, arg4: A4 | PromiseLike<A4>, arg5: A5 | PromiseLike<A5>, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike<R>): Bluebird<R>;
|
||||
|
||||
// variadic array
|
||||
/** @deprecated use .all instead */
|
||||
static join<R>(...values: (R | Bluebird.Thenable<R>)[]): Bluebird<R[]>;
|
||||
static join<R>(...values: (R | PromiseLike<R>)[]): Bluebird<R[]>;
|
||||
|
||||
/**
|
||||
* Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well.
|
||||
@@ -747,16 +747,16 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
* *The original array is not modified.*
|
||||
*/
|
||||
// promise of array with promises of value
|
||||
static map<R, U>(values: Bluebird.Thenable<Bluebird.Thenable<R>[]>, mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
static map<R, U>(values: PromiseLike<PromiseLike<R>[]>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
|
||||
// promise of array with values
|
||||
static map<R, U>(values: Bluebird.Thenable<R[]>, mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
static map<R, U>(values: PromiseLike<R[]>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
|
||||
// array with promises of value
|
||||
static map<R, U>(values: Bluebird.Thenable<R>[], mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
static map<R, U>(values: PromiseLike<R>[], mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
|
||||
// array with values
|
||||
static map<R, U>(values: R[], mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
static map<R, U>(values: R[], mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
|
||||
|
||||
/**
|
||||
* Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well.
|
||||
@@ -766,16 +766,16 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
* *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.*
|
||||
*/
|
||||
// promise of array with promises of value
|
||||
static reduce<R, U>(values: Bluebird.Thenable<Bluebird.Thenable<R>[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>, initialValue?: U): Bluebird<U>;
|
||||
static reduce<R, U>(values: PromiseLike<PromiseLike<R>[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Bluebird<U>;
|
||||
|
||||
// promise of array with values
|
||||
static reduce<R, U>(values: Bluebird.Thenable<R[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>, initialValue?: U): Bluebird<U>;
|
||||
static reduce<R, U>(values: PromiseLike<R[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Bluebird<U>;
|
||||
|
||||
// array with promises of value
|
||||
static reduce<R, U>(values: Bluebird.Thenable<R>[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>, initialValue?: U): Bluebird<U>;
|
||||
static reduce<R, U>(values: PromiseLike<R>[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Bluebird<U>;
|
||||
|
||||
// array with values
|
||||
static reduce<R, U>(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>, initialValue?: U): Bluebird<U>;
|
||||
static reduce<R, U>(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Bluebird<U>;
|
||||
|
||||
/**
|
||||
* Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well.
|
||||
@@ -785,16 +785,16 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
* *The original array is not modified.
|
||||
*/
|
||||
// promise of array with promises of value
|
||||
static filter<R>(values: Bluebird.Thenable<Bluebird.Thenable<R>[]>, filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable<boolean>, option?: Bluebird.ConcurrencyOption): Bluebird<R[]>;
|
||||
static filter<R>(values: PromiseLike<PromiseLike<R>[]>, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, option?: Bluebird.ConcurrencyOption): Bluebird<R[]>;
|
||||
|
||||
// promise of array with values
|
||||
static filter<R>(values: Bluebird.Thenable<R[]>, filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable<boolean>, option?: Bluebird.ConcurrencyOption): Bluebird<R[]>;
|
||||
static filter<R>(values: PromiseLike<R[]>, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, option?: Bluebird.ConcurrencyOption): Bluebird<R[]>;
|
||||
|
||||
// array with promises of value
|
||||
static filter<R>(values: Bluebird.Thenable<R>[], filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable<boolean>, option?: Bluebird.ConcurrencyOption): Bluebird<R[]>;
|
||||
static filter<R>(values: PromiseLike<R>[], filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, option?: Bluebird.ConcurrencyOption): Bluebird<R[]>;
|
||||
|
||||
// array with values
|
||||
static filter<R>(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable<boolean>, option?: Bluebird.ConcurrencyOption): Bluebird<R[]>;
|
||||
static filter<R>(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, option?: Bluebird.ConcurrencyOption): Bluebird<R[]>;
|
||||
|
||||
/**
|
||||
* Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well.
|
||||
@@ -802,11 +802,11 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
* Resolves to the original array unmodified, this method is meant to be used for side effects. If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration.
|
||||
*/
|
||||
// promise of array with promises of value
|
||||
static each<R, U>(values: Bluebird.Thenable<Bluebird.Thenable<R>[]>, iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>): Bluebird<R[]>;
|
||||
static each<R, U>(values: PromiseLike<PromiseLike<R>[]>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<R[]>;
|
||||
// array with promises of value
|
||||
static each<R, U>(values: Bluebird.Thenable<R>[], iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>): Bluebird<R[]>;
|
||||
static each<R, U>(values: PromiseLike<R>[], iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<R[]>;
|
||||
// array with values OR promise of array with values
|
||||
static each<R, U>(values: R[] | Bluebird.Thenable<R[]>, iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>): Bluebird<R[]>;
|
||||
static each<R, U>(values: R[] | PromiseLike<R[]>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<R[]>;
|
||||
|
||||
/**
|
||||
* Given an Iterable(arrays are Iterable), or a promise of an Iterable, which produces promises (or a mix of promises and values), iterate over all the values in the Iterable into an array and iterate over the array serially, in-order.
|
||||
@@ -815,7 +815,7 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
*
|
||||
* If any promise in the input array is rejected or any promise returned by the iterator function is rejected, the result will be rejected as well.
|
||||
*/
|
||||
static mapSeries<R, U>(values: (R | Bluebird.Thenable<R>)[] | Bluebird.Thenable<(R | Bluebird.Thenable<R>)[]>, iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable<U>): Bluebird<U[]>;
|
||||
static mapSeries<R, U>(values: (R | PromiseLike<R>)[] | PromiseLike<(R | PromiseLike<R>)[]>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<U[]>;
|
||||
|
||||
/**
|
||||
* A meta method used to specify the disposer method that cleans up a resource when using `Promise.using`.
|
||||
@@ -827,16 +827,16 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
|
||||
* The second argument passed to a disposer is the result promise of the using block, which you can
|
||||
* inspect synchronously.
|
||||
*/
|
||||
disposer(disposeFn: (arg: R, promise: Bluebird<R>) => void | Bluebird.Thenable<void>): Bluebird.Disposer<R>;
|
||||
disposer(disposeFn: (arg: R, promise: Bluebird<R>) => void | PromiseLike<void>): Bluebird.Disposer<R>;
|
||||
|
||||
/**
|
||||
* In conjunction with `.disposer`, using will make sure that no matter what, the specified disposer
|
||||
* will be called when the promise returned by the callback passed to using has settled. The disposer is
|
||||
* necessary because there is no standard interface in node for disposing resources.
|
||||
*/
|
||||
static using<R, T>(disposer: Bluebird.Disposer<R>, executor: (transaction: R) => Bluebird.Thenable<T>): Bluebird<T>;
|
||||
static using<R1, R2, T>(disposer: Bluebird.Disposer<R1>, disposer2: Bluebird.Disposer<R2>, executor: (transaction1: R1, transaction2: R2) => Bluebird.Thenable<T>): Bluebird<T>;
|
||||
static using<R1, R2, R3, T>(disposer: Bluebird.Disposer<R1>, disposer2: Bluebird.Disposer<R2>, disposer3: Bluebird.Disposer<R3>, executor: (transaction1: R1, transaction2: R2, transaction3: R3) => Bluebird.Thenable<T>): Bluebird<T>;
|
||||
static using<R, T>(disposer: Bluebird.Disposer<R>, executor: (transaction: R) => PromiseLike<T>): Bluebird<T>;
|
||||
static using<R1, R2, T>(disposer: Bluebird.Disposer<R1>, disposer2: Bluebird.Disposer<R2>, executor: (transaction1: R1, transaction2: R2) => PromiseLike<T>): Bluebird<T>;
|
||||
static using<R1, R2, R3, T>(disposer: Bluebird.Disposer<R1>, disposer2: Bluebird.Disposer<R2>, disposer3: Bluebird.Disposer<R3>, executor: (transaction1: R1, transaction2: R2, transaction3: R3) => PromiseLike<T>): Bluebird<T>;
|
||||
|
||||
/**
|
||||
* Add handler as the handler to call when there is a possibly unhandled rejection.
|
||||
@@ -891,7 +891,7 @@ declare namespace Bluebird {
|
||||
suffix?: string;
|
||||
filter?: (name: string, func: Function, 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: Function) => () => Thenable<any>;
|
||||
promisifier?: (originalMethod: Function) => () => PromiseLike<any>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -951,10 +951,8 @@ declare namespace Bluebird {
|
||||
export class Disposer<R> {
|
||||
}
|
||||
|
||||
export interface Thenable<R> {
|
||||
then<U>(onFulfilled: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
|
||||
then<U>(onFulfilled: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void | Thenable<void>): Thenable<U>;
|
||||
}
|
||||
/** @deprecated Use PromiseLike<T> directly. */
|
||||
export type Thenable<T> = PromiseLike<T>;
|
||||
|
||||
export interface Resolver<R> {
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: http://bookshelfjs.org/
|
||||
// Definitions by: Andrew Schurman <http://github.com/arcticwaters>, Vesa Poikajärvi <https://github.com/vesse>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import Knex = require('knex');
|
||||
import knex = require('knex');
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/visionmedia/consolidate.js
|
||||
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>, Theo Sherry <https://github.com/theosherry>, Nicolas Henry <https://github.com/nicolashenry>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Imported from: https://github.com/soywiz/typescript-node-definitions/consolidate.d.ts
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/db-migrate/db-migrate-base
|
||||
// Definitions by: nickiannone <https://github.com/nickiannone>
|
||||
// Definitions: https://github.com/nickiannone/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/db-migrate/pg
|
||||
// Definitions by: nickiannone <http://github.com/nickiannone>
|
||||
// Definitions: https://github.com/nickiannone/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as pg from "pg";
|
||||
import * as DbMigrateBase from "db-migrate-base";
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/overlookmotel/fs-extra-promise
|
||||
// Definitions by: midknight41 <https://github.com/midknight41>, Jason Swearingen <https://github.com/jasonswearingen>, Hiromi Shikata <https://github.com/HiromiShikata>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/jonkemp/inline-css
|
||||
// Definitions by: Philip Spain <https://github.com/philipisapain>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="bluebird" />
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/joeferner/node-java
|
||||
// Definitions by: Jim Lloyd <https://github.com/jimlloyd>, Kentaro Teramoto <https://github.com/hrl7>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
///<reference types="bluebird"/>
|
||||
|
||||
import java = require('java');
|
||||
import BluePromise = require('bluebird');
|
||||
|
||||
@@ -9,7 +7,7 @@ java.asyncOptions = {
|
||||
promiseSuffix: 'P',
|
||||
promisify: BluePromise.promisify
|
||||
};
|
||||
// todo: figure out why promise doesn't work here
|
||||
// todo: figure out why promise doesn't work here
|
||||
/* java.registerClientP((): Promise<void> => {
|
||||
return BluePromise.resolve();
|
||||
}); */
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/karma-runner/karma-coverage
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as karma from 'karma';
|
||||
import * as istanbul from 'istanbul';
|
||||
|
||||
Vendored
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Project: https://github.com/karma-runner/karma
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="bluebird" />
|
||||
/// <reference types="node" />
|
||||
|
||||
// See Karma public API https://karma-runner.github.io/0.13/dev/public-api.html
|
||||
@@ -54,7 +54,7 @@ declare namespace karma {
|
||||
};
|
||||
EXIT_CODE: string;
|
||||
}
|
||||
|
||||
|
||||
interface LauncherStatic {
|
||||
generateId(): string;
|
||||
//TODO: injector should be of type `di.Injector`
|
||||
|
||||
Vendored
+1
-2
@@ -2,9 +2,8 @@
|
||||
// Project: https://github.com/tgriesser/knex
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>, Baronfel <https://github.com/baronfel>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="bluebird" />
|
||||
/// <reference types="node" />
|
||||
|
||||
import events = require("events");
|
||||
|
||||
Vendored
+25
-24
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/nodets/node-mysql-wrapper
|
||||
// Definitions by: Makis Maropoulos <https://github.com/kataras>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
///<reference path="./my-meteor.d.ts" />
|
||||
|
||||
@@ -49,20 +50,20 @@ interface IQueryConstructor<T> {
|
||||
|
||||
|
||||
declare class Helper {
|
||||
/**
|
||||
/**
|
||||
* Callback like forEach
|
||||
* @name valueCallback
|
||||
* @function
|
||||
* @param {T} the value of the object's key
|
||||
* @param {T} the value of the object's key
|
||||
* @returnTye {U}
|
||||
* @return {U}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* CallbaforEach
|
||||
* @name keyCallback
|
||||
* @function
|
||||
* @param {string} the name of the object's key
|
||||
* @param {string} the name of the object's key
|
||||
* @returnTye {U}
|
||||
* @return {U}
|
||||
*/
|
||||
@@ -158,7 +159,7 @@ declare class CriteriaParts implements ICriteriaParts {
|
||||
noDatabaseProperties: string[];
|
||||
|
||||
/**
|
||||
* The converted/exported where clause.
|
||||
* The converted/exported where clause.
|
||||
*/
|
||||
whereClause: string;
|
||||
|
||||
@@ -472,7 +473,7 @@ declare class Connection extends EventEmitter {
|
||||
eventTypes: string[];
|
||||
|
||||
/**
|
||||
* Force to fetch ONLY these Database table names {array of string}.
|
||||
* Force to fetch ONLY these Database table names {array of string}.
|
||||
*/
|
||||
tableNamesToUseOnly: any[];
|
||||
|
||||
@@ -495,7 +496,7 @@ declare class Connection extends EventEmitter {
|
||||
* Attach a real connection.
|
||||
* @param {Mysql.IConnection} connection the real connection object.
|
||||
* @returnType {nothing}
|
||||
* @return {nothing}
|
||||
* @return {nothing}
|
||||
*/
|
||||
attach(connection: Mysql.IConnection): void;
|
||||
|
||||
@@ -503,13 +504,13 @@ declare class Connection extends EventEmitter {
|
||||
* Close the entire real connection and remove all event's listeners (if exist).
|
||||
* @param {function} callback If error occurs when closing the connection, this callback has the responsibility to catch it.
|
||||
* @returnType {nothing}
|
||||
* @return {nothing}
|
||||
* @return {nothing}
|
||||
*/
|
||||
end(callback?: (error: any) => void): void;
|
||||
|
||||
/**
|
||||
* Close the entire real connection and remove all event's listeners (if exist).
|
||||
* the difference from the 'end' is that this method doesn't care about errors so no callback passing here.
|
||||
* the difference from the 'end' is that this method doesn't care about errors so no callback passing here.
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
@@ -545,7 +546,7 @@ declare class Connection extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Escape the query column's value and return it.
|
||||
* @param {string} val the value which will be escaped.
|
||||
* @param {string} val the value which will be escaped.
|
||||
* @returnType {string}
|
||||
* @return {string}
|
||||
*/
|
||||
@@ -565,7 +566,7 @@ declare class Connection extends EventEmitter {
|
||||
* Adds an event listener/watcher on a table for a 'database event'.
|
||||
* @param {string} tableName the table name which you want to add the event listener.
|
||||
* @param {string or string[]} evtType the event(s) type you want to watch, one of these(string) or an array of them(string[]): ["INSERT", "UPDATE", "REMOVE", "SAVE"].
|
||||
* @param {function} callback Callback which has one parameter(typeof any[]) which filled by the rawRows (results after query executed and before parsed to object(s)).
|
||||
* @param {function} callback Callback which has one parameter(typeof any[]) which filled by the rawRows (results after query executed and before parsed to object(s)).
|
||||
* @returnType {nothing}
|
||||
* @return {nothing}
|
||||
*/
|
||||
@@ -573,7 +574,7 @@ declare class Connection extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Removes an event listener/watcher from a table for a specific event type.
|
||||
* @param {string} tableName the table name which you want to remove the event listener.
|
||||
* @param {string} tableName the table name which you want to remove the event listener.
|
||||
* @param {string} evtType the Event type you want to remove, one of these: "INSERT", "UPDATE", "REMOVE", "SAVE".
|
||||
* @param {function} callbackToRemove the callback that you were used for watch this event type.
|
||||
* @returnType {nothing}
|
||||
@@ -587,13 +588,13 @@ declare class Connection extends EventEmitter {
|
||||
* @param {function} callback the function will be called and fill the one and only parameter when an errors occurs.
|
||||
* @param {any[]} queryArguments (optional) the query arguments you want to pass into query. ['arg1','arg2']...
|
||||
* @returnType {nothing}
|
||||
* @return {nothing}
|
||||
* @return {nothing}
|
||||
*/
|
||||
query(queryStr: string, callback: (err: Mysql.IError, results: any) => any, queryArguments?: any[]): void;
|
||||
|
||||
/**
|
||||
* Returns a MysqlTable object from the database factory. (Note: this method doesn't create anything, just finds and returns the correct table, you don't have to create anything at all. Tables are fetched by the library itself.)
|
||||
* If you are using typescript you can pass a class (generic<T>) in order to use the auto completion assistance on table's results methods(find,findById,findAll,save,remove,safeRemove).
|
||||
* If you are using typescript you can pass a class (generic<T>) in order to use the auto completion assistance on table's results methods(find,findById,findAll,save,remove,safeRemove).
|
||||
* @param {string} tableName the table name which you want to get, on the form of: 'anyDatabaseTable' OR 'any_database_table' (possible your real table name into your database).
|
||||
* @returnType {MysqlTable}
|
||||
* @return {MysqlTable}
|
||||
@@ -602,7 +603,7 @@ declare class Connection extends EventEmitter {
|
||||
}
|
||||
|
||||
declare class Table<T> {
|
||||
/** Private keywords here are useless but I put them.
|
||||
/** Private keywords here are useless but I put them.
|
||||
* If the developer wants to see the properties of the Table class, he/she just comes here.
|
||||
*/
|
||||
|
||||
@@ -630,17 +631,17 @@ declare class Table<T> {
|
||||
primaryKey: string;
|
||||
|
||||
/**
|
||||
* The MysqlConnection object which this MysqlTable belongs.
|
||||
* The MysqlConnection object which this MysqlTable belongs.
|
||||
*/
|
||||
connection: Connection;
|
||||
|
||||
/**
|
||||
* The real database name of the table. Autofilled by library.
|
||||
* The real database name of the table. Autofilled by library.
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* Set of the query rules that will be applied after the 'where clause' on each select query executed by this table.
|
||||
* Set of the query rules that will be applied after the 'where clause' on each select query executed by this table.
|
||||
* @return {SelectQueryRules}
|
||||
*/
|
||||
rules: SelectQueryRules;
|
||||
@@ -661,7 +662,7 @@ declare class Table<T> {
|
||||
/**
|
||||
* Adds or turn on an event listener/watcher on a table for a 'database event'.
|
||||
* @param {string} evtType the event type you want to watch, one of these: ["INSERT", "UPDATE", "REMOVE", "SAVE"].
|
||||
* @param {function} callback Callback which has one parameter(typeof any[]) which filled by the rawResults (results after query executed and before exports to object(s)).
|
||||
* @param {function} callback Callback which has one parameter(typeof any[]) which filled by the rawResults (results after query executed and before exports to object(s)).
|
||||
* @returnType {nothing}
|
||||
* @return {nothing}
|
||||
*/
|
||||
@@ -689,7 +690,7 @@ declare class Table<T> {
|
||||
* @param {string} functionName the function name you want to use, this is used when you want to call this function later.
|
||||
* @param {function} theFunction the function with any optional parameters you want to pass along.
|
||||
* @returnType {nothing}
|
||||
* @return {nothing}
|
||||
* @return {nothing}
|
||||
*/
|
||||
extend(functionName: string, theFunction: (...args: any[]) => any): void;
|
||||
|
||||
@@ -726,9 +727,9 @@ declare class Table<T> {
|
||||
getPrimaryKeyValue(jsObject: any): number | string;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
find(criteriaRawJsObject: any): Promise<T[]>; // only criteria
|
||||
find(criteriaRawJsObject: any): Promise<T[]>; // only criteria
|
||||
find(criteriaRawJsObject: any, callback: ((_results: T[]) => any)): Promise<T[]>; // criteria and callback
|
||||
find(criteriaRawJsObject: any, callback?: (_results: T[]) => any): Promise<T[]>;
|
||||
|
||||
@@ -792,7 +793,7 @@ declare class Database {
|
||||
|
||||
/**
|
||||
* Close the entire real connection and remove all event's listeners (if exist).
|
||||
* the difference from the 'end' is that this method doesn't care about errors so no callback passing here.
|
||||
* the difference from the 'end' is that this method doesn't care about errors so no callback passing here.
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
@@ -800,7 +801,7 @@ declare class Database {
|
||||
* Close the entire real connection and remove all event's listeners (if exist).
|
||||
* @param {function} maybeAcallbackError If error occurs when closing the connection, this callback has the responsibility to catch it.
|
||||
* @returnType {nothing}
|
||||
* @return {nothing}
|
||||
* @return {nothing}
|
||||
*/
|
||||
end(maybeAcallbackError: (err: any) => void): void;
|
||||
|
||||
|
||||
+4
-4
@@ -24,16 +24,16 @@ declare namespace smtpTransport {
|
||||
|
||||
/** is the registered client secret of the application */
|
||||
clientSecret?: string;
|
||||
|
||||
|
||||
/** is an optional refresh token. If it is provided then Nodemailer tries to generate a new access token if existing one expires or fails */
|
||||
refreshToken?: string;
|
||||
|
||||
|
||||
/** is the access token for the user. Required only if refreshToken is not available and there is no token refresh callback specified */
|
||||
accessToken?: string;
|
||||
|
||||
|
||||
/** is an optional expiration time for the current accessToken */
|
||||
expires?: number;
|
||||
|
||||
|
||||
/** is an optional HTTP endpoint for requesting new access tokens. This value defaults to Gmail */
|
||||
accessUrl?: string;
|
||||
|
||||
|
||||
Vendored
+2
-4
@@ -4,11 +4,9 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
/// <reference types="bluebird" />
|
||||
|
||||
import directTransport = require("nodemailer-direct-transport");
|
||||
import smtpTransport = require("nodemailer-smtp-transport");
|
||||
import * as Promise from 'bluebird';
|
||||
|
||||
/**
|
||||
* Transporter plugin
|
||||
@@ -36,7 +34,7 @@ export interface Transporter {
|
||||
* Send mail using a template.
|
||||
*/
|
||||
templateSender(template?: any, defaults?: any): (mailData: any, context: any) => Promise<SentMessageInfo>;
|
||||
|
||||
|
||||
/**
|
||||
* Send mail using a template with a callback.
|
||||
*/
|
||||
@@ -50,7 +48,7 @@ export interface Transporter {
|
||||
* @param pluginFunc is a function that takes two arguments: the mail object and a callback function
|
||||
*/
|
||||
use(step: string, plugin: Plugin): void;
|
||||
|
||||
|
||||
/**
|
||||
* Verifies connection with server
|
||||
*/
|
||||
|
||||
Vendored
+2
@@ -2,6 +2,8 @@
|
||||
// Project: https://github.com/orientechnologies/orientjs
|
||||
// Definitions by: Saeed Tabrizi <https://github.com/saeedtabrizi>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Developed with love in www.nowcando.com
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
import * as pg from "pg";
|
||||
import * as bluebird from "bluebird";
|
||||
|
||||
var conString = "postgres://username:password@localhost/database";
|
||||
|
||||
@@ -55,7 +53,7 @@ var config = {
|
||||
port: 5432, //env var: PGPORT
|
||||
max: 10, // max number of clients in the pool
|
||||
idleTimeoutMillis: 30000, // how long a client is allowed to remain idle before being closed
|
||||
Promise: bluebird
|
||||
Promise,
|
||||
};
|
||||
var pool = new pg.Pool(config);
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
|
||||
/// <reference types="bluebird" />
|
||||
|
||||
import * as pify from 'pify';
|
||||
import * as Bluebird from 'bluebird';
|
||||
|
||||
function assert(actual: string, expected: string): void {
|
||||
if (actual !== expected) {
|
||||
@@ -28,4 +24,4 @@ const fsP = pify(fs);
|
||||
fsP.readFile('foo.txt').then((result: string) => assert(result, 'foo'));
|
||||
|
||||
pify(fs.readFile)('foo.txt').then((result: string) => assert(result, 'foo'));
|
||||
pify(fs.readFile, Bluebird)('bar.txt').then((result: string) => assert(result, 'bar'));
|
||||
pify(fs.readFile, Promise)('bar.txt').then((result: string) => assert(result, 'bar'));
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/felixrieseberg/project-oxford
|
||||
// Definitions by: Scott Southwood <https://github.com/scsouthw/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/mike-marcacci/node-redlock
|
||||
// Definitions by: Ilya Mochalov <https://github.com/chrootsu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as redis from 'redis';
|
||||
import * as Promise from 'bluebird';
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/request/request-promise
|
||||
// Definitions by: Christopher Glantschnig <https://github.com/cglantschnig/>, Joe Skeen <http://github.com/joeskeen>, Aya Morisawa <https://github.com/AyaMorisawa>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import request = require('request');
|
||||
import http = require('http');
|
||||
|
||||
Vendored
+1
-3
@@ -2,9 +2,7 @@
|
||||
// Project: https://github.com/domasx2/sequelize-fixtures
|
||||
// Definitions by: Christian Schwarz <https://github.com/cschwarz/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="sequelize" />
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as Sequelize from "sequelize";
|
||||
|
||||
|
||||
Vendored
+1
-2
@@ -2,12 +2,11 @@
|
||||
// Project: http://sequelizejs.com
|
||||
// Definitions by: samuelneff <https://github.com/samuelneff>, Peter Harris <https://github.com/codeanimal>, Ivan Drinchev <https://github.com/drinchev>, Brendan Abolivier <https://github.com/babolivier>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Based on original work by: samuelneff <https://github.com/samuelneff/sequelize-auto-ts/blob/master/lib/sequelize.d.ts>
|
||||
|
||||
/// <reference types="lodash" />
|
||||
/// <reference types="bluebird" />
|
||||
/// <reference types="validator" />
|
||||
|
||||
|
||||
|
||||
Vendored
-1
@@ -7,7 +7,6 @@
|
||||
// Based on original work by: samuelneff <https://github.com/samuelneff/sequelize-auto-ts/blob/master/lib/sequelize.d.ts>
|
||||
|
||||
/// <reference types="lodash" />
|
||||
/// <reference types="bluebird" />
|
||||
/// <reference types="validator" />
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/// <reference types="mocha"/>
|
||||
|
||||
import Simple = require('simple-mock');
|
||||
import Bluebird = require('bluebird');
|
||||
declare function describe(desc: string, action: () => void): void;
|
||||
declare function beforeEach(action: () => void): void;
|
||||
declare function it(desc: string, action: (done: () => void) => void): void;
|
||||
declare var assert: {
|
||||
(cond: any, message?: string): void;
|
||||
equal<T>(a: T, b: T): void;
|
||||
@@ -908,9 +908,6 @@ describe('Simple', function() {
|
||||
|
||||
let obj: any
|
||||
|
||||
before(function() {
|
||||
})
|
||||
|
||||
beforeEach(function() {
|
||||
obj = new ProtoKlass()
|
||||
})
|
||||
@@ -1019,5 +1016,5 @@ describe('Simple', function() {
|
||||
})
|
||||
})
|
||||
|
||||
Simple.Promise = Bluebird;
|
||||
Simple.Promise = Promise;
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/lelylan/simple-oauth2
|
||||
// Definitions by: [Michael Müller] <https://github.com/mad-mike>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import Bluebird = require("bluebird");
|
||||
|
||||
|
||||
Vendored
-1
@@ -3,7 +3,6 @@
|
||||
// Definitions by: William Johnston <https://github.com/wjohnsto>, Peter Harris <https://github.com/codeanimal/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="bluebird" />
|
||||
/// <reference types="node" />
|
||||
|
||||
declare module 'stripe' {
|
||||
|
||||
Vendored
+1
-4
@@ -2,10 +2,7 @@
|
||||
// Project: https://github.com/sequelize/umzug
|
||||
// Definitions by: Ivan Drinchev <https://github.com/drinchev/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="bluebird" />
|
||||
/// <reference types="sequelize" />
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import Sequelize = require("sequelize");
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/balderdashy/waterline
|
||||
// Definitions by: Alexandro Libertino <https://github.com/arvitaly>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
|
||||
+117
-145
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
const MetaDataStr = "";
|
||||
|
||||
import Promise = require("bluebird");
|
||||
import PluginBase = require("plugin/PluginBase");
|
||||
|
||||
import * as fs from "fs";
|
||||
@@ -286,36 +285,29 @@ function test_client_using_a_blob() {
|
||||
return { stateMachine: { name: "dm", initialState: null, finalStates: [], states: [] } };
|
||||
}
|
||||
|
||||
public main(mainHandler: Core.ResultCallback): void {
|
||||
async main(mainHandler: Core.ResultCallback): Promise<string[]> {
|
||||
let artifact: Core.Artifact;
|
||||
|
||||
Promise
|
||||
.try(() => {
|
||||
return this.extractDataModel();
|
||||
})
|
||||
.then((dataModel) => {
|
||||
var dataModelStr = JSON.stringify(dataModel, null, 4);
|
||||
this.dataModel = dataModel;
|
||||
const dataModel = this.extractDataModel();
|
||||
var dataModelStr = JSON.stringify(dataModel, null, 4);
|
||||
this.dataModel = dataModel;
|
||||
|
||||
this.logger.info('Extracted dataModel', dataModelStr);
|
||||
this.logger.info('Extracted dataModel', dataModelStr);
|
||||
|
||||
return self.blobClient.putFile('dataModel.json', dataModelStr);
|
||||
})
|
||||
.then((jsonFileHash) => {
|
||||
// Add link from result to this file.
|
||||
self.result.addArtifact(jsonFileHash);
|
||||
const jsonFileHash = await self.blobClient.putFile('dataModel.json', dataModelStr);
|
||||
// Add link from result to this file.
|
||||
self.result.addArtifact(jsonFileHash);
|
||||
|
||||
// Create a complex artifact, with links to multiple files.
|
||||
artifact = self.blobClient.createArtifact('simulator');
|
||||
// Create a complex artifact, with links to multiple files.
|
||||
artifact = self.blobClient.createArtifact('simulator');
|
||||
|
||||
let programJS = "some javascript file";
|
||||
self.logger.info('program.js', programJS);
|
||||
let programJS = "some javascript file";
|
||||
self.logger.info('program.js', programJS);
|
||||
|
||||
return artifact.addFilesAsSoftLinks({
|
||||
'program.js': programJS,
|
||||
'index.html': this.pluginMetadata
|
||||
});
|
||||
})
|
||||
return artifact.addFilesAsSoftLinks({
|
||||
'program.js': programJS,
|
||||
'index.html': this.pluginMetadata
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -336,13 +328,13 @@ type DictionaryAny = { [key: string]: any };
|
||||
* Related example using traverse.
|
||||
* https://github.com/webgme/xmi-tools/blob/master/src/plugins/XMIExporter/XMIExporter.js#L430
|
||||
*/
|
||||
function test_core_containment_traversal_complete() {
|
||||
async function test_core_containment_traversal_complete() {
|
||||
const BLANK = "";
|
||||
const NULL_OBJECT = "_OBJECT"
|
||||
const NULL_GUID = "00000000-0000-0000-0000-000000000000";
|
||||
|
||||
function getEdgesModel(sponsor: PluginBase, core: Core.Core,
|
||||
_rootNode: Common.Node, _metaNode: Common.Node): Core.Dictionary {
|
||||
async function getEdgesModel(sponsor: PluginBase, core: Core.Core,
|
||||
_rootNode: Common.Node, _metaNode: Common.Node): Promise<Core.Dictionary> {
|
||||
|
||||
let fcoName = core.getAttribute(core.getFCO(sponsor.rootNode), "name");
|
||||
let languageName = core.getAttribute(sponsor.rootNode, "name");
|
||||
@@ -389,7 +381,7 @@ function test_core_containment_traversal_complete() {
|
||||
* The traverse function follows the containment tree.
|
||||
* @type {[type]}
|
||||
*/
|
||||
let visitFn = (node: Node, done: Common.VoidFn): void => {
|
||||
let visitFn = async (node: Node, done: Common.VoidFn): Promise<void> => {
|
||||
try {
|
||||
let core = sponsor.core;
|
||||
let nodePath: string = core.getPath(node);
|
||||
@@ -486,133 +478,113 @@ function test_core_containment_traversal_complete() {
|
||||
});
|
||||
|
||||
// get pointers & inv_pointers
|
||||
Promise
|
||||
.try(() => {
|
||||
return core.getPointerNames(node);
|
||||
})
|
||||
.map((ptrName: string) => {
|
||||
let targetPathRaw = core.getPointerPath(node, ptrName);
|
||||
if (typeof targetPathRaw !== "string") { return; }
|
||||
const ptrNames = await core.getPointerNames(node);
|
||||
Promise.all(ptrNames.map(async ptrName => {
|
||||
let targetPathRaw = core.getPointerPath(node, ptrName);
|
||||
if (typeof targetPathRaw !== "string") { return; }
|
||||
|
||||
let targetPath: string = targetPathRaw;
|
||||
Promise
|
||||
.try(() => {
|
||||
return core.loadByPath(sponsor.rootNode, targetPath);
|
||||
})
|
||||
.then((targetNode: Node) => {
|
||||
let targetGuid = core.getGuid(targetNode);
|
||||
if (ptrName === "base") {
|
||||
let targetPath: string = targetPathRaw;
|
||||
const targetNode = core.loadByPath(sponsor.rootNode, targetPath);
|
||||
let targetGuid = core.getGuid(targetNode);
|
||||
if (ptrName === "base") {
|
||||
|
||||
} else {
|
||||
let pointers: DictionaryAny = sourceEntry.pointers;
|
||||
let targetMetaNode = core.getBaseType(targetNode);
|
||||
let targetMetaName = core.getAttribute(targetMetaNode, "name");
|
||||
if (typeof targetMetaName === "string") {
|
||||
pointers[ptrName] = {
|
||||
name: targetMetaName,
|
||||
guid: targetGuid
|
||||
};
|
||||
}
|
||||
let targetEntry = nodeGuidMap[targetGuid];
|
||||
if (targetEntry === undefined) {
|
||||
targetEntry = {
|
||||
"name": {},
|
||||
"guid": targetGuid,
|
||||
"pointers": {}, "inv_pointers": {},
|
||||
"sets": {}, "inv_sets": {}
|
||||
};
|
||||
nodeGuidMap[targetGuid] = targetEntry;
|
||||
}
|
||||
targetEntry.inv_pointers[ptrName] = {
|
||||
name: targetMetaName,
|
||||
guid: sourceGuid
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
let pointers: DictionaryAny = sourceEntry.pointers;
|
||||
let targetMetaNode = core.getBaseType(targetNode);
|
||||
let targetMetaName = core.getAttribute(targetMetaNode, "name");
|
||||
if (typeof targetMetaName === "string") {
|
||||
pointers[ptrName] = {
|
||||
name: targetMetaName,
|
||||
guid: targetGuid
|
||||
};
|
||||
}
|
||||
let targetEntry = nodeGuidMap[targetGuid];
|
||||
if (targetEntry === undefined) {
|
||||
targetEntry = {
|
||||
"name": {},
|
||||
"guid": targetGuid,
|
||||
"pointers": {}, "inv_pointers": {},
|
||||
"sets": {}, "inv_sets": {}
|
||||
};
|
||||
nodeGuidMap[targetGuid] = targetEntry;
|
||||
}
|
||||
targetEntry.inv_pointers[ptrName] = {
|
||||
name: targetMetaName,
|
||||
guid: sourceGuid
|
||||
};
|
||||
}
|
||||
}));
|
||||
|
||||
// get sets & inv_set
|
||||
Promise
|
||||
.try(() => {
|
||||
return core.getValidSetNames(node);
|
||||
})
|
||||
.map((setName: string) => {
|
||||
let targetMemberPathsRaw = core.getMemberPaths(node, setName);
|
||||
for (let targetMemberPath of targetMemberPathsRaw) {
|
||||
if (typeof targetMemberPath !== "string") { return; }
|
||||
let targetPath: string = targetMemberPath;
|
||||
const setNames = await core.getValidSetNames(node);
|
||||
Promise.all(setNames.map(setName => {
|
||||
let targetMemberPathsRaw = core.getMemberPaths(node, setName);
|
||||
for (let targetMemberPath of targetMemberPathsRaw) {
|
||||
if (typeof targetMemberPath !== "string") { return; }
|
||||
let targetPath: string = targetMemberPath;
|
||||
|
||||
Promise
|
||||
.try(() => {
|
||||
return core.loadByPath(sponsor.rootNode, targetPath);
|
||||
})
|
||||
.then((targetNode: Node) => {
|
||||
let targetGuid = core.getGuid(targetNode);
|
||||
let sets: DictionaryAny = sourceEntry.sets;
|
||||
let targetMetaNode = core.getBaseType(targetNode);
|
||||
let targetMetaName = core.getAttribute(targetMetaNode, "name");
|
||||
if (typeof targetMetaName === "string") {
|
||||
let load = {
|
||||
name: targetMetaName,
|
||||
guid: targetGuid
|
||||
};
|
||||
let sourceSet = sets[setName];
|
||||
if (sourceSet === undefined) {
|
||||
sets[setName] = [load];
|
||||
} else {
|
||||
sourceSet.push(load);
|
||||
}
|
||||
}
|
||||
let targetEntry = nodeGuidMap[targetGuid];
|
||||
if (targetEntry === undefined) {
|
||||
targetEntry = {
|
||||
"name": {},
|
||||
"guid": targetGuid,
|
||||
"pointers": {}, "inv_pointers": {},
|
||||
"sets": {}, "inv_sets": {}
|
||||
};
|
||||
nodeGuidMap[targetGuid] = targetEntry;
|
||||
}
|
||||
let invSets = targetEntry.inv_sets;
|
||||
let targetSet = invSets[setName];
|
||||
let invLoad = {
|
||||
name: targetMetaName,
|
||||
guid: sourceGuid
|
||||
};
|
||||
if (targetSet === undefined) {
|
||||
invSets[setName] = [invLoad];
|
||||
} else {
|
||||
targetSet.push(invLoad);
|
||||
};
|
||||
})
|
||||
.catch((err: Error) => {
|
||||
console.log(`difficulty loading target path: ${targetPath} with err: ${err.message}`);
|
||||
let load = {
|
||||
"fault": `could not load member path: ${targetPath}`
|
||||
};
|
||||
let sets: DictionaryAny = sourceEntry.sets;
|
||||
let sourceSet = sets[setName];
|
||||
if (sourceSet === undefined) {
|
||||
sets[setName] = [load];
|
||||
} else {
|
||||
sourceSet.push(load);
|
||||
}
|
||||
});
|
||||
try {
|
||||
const targetNode = core.loadByPath(sponsor.rootNode, targetPath);
|
||||
let targetGuid = core.getGuid(targetNode);
|
||||
let sets: DictionaryAny = sourceEntry.sets;
|
||||
let targetMetaNode = core.getBaseType(targetNode);
|
||||
let targetMetaName = core.getAttribute(targetMetaNode, "name");
|
||||
if (typeof targetMetaName === "string") {
|
||||
let load = {
|
||||
name: targetMetaName,
|
||||
guid: targetGuid
|
||||
};
|
||||
let sourceSet = sets[setName];
|
||||
if (sourceSet === undefined) {
|
||||
sets[setName] = [load];
|
||||
} else {
|
||||
sourceSet.push(load);
|
||||
}
|
||||
}
|
||||
let targetEntry = nodeGuidMap[targetGuid];
|
||||
if (targetEntry === undefined) {
|
||||
targetEntry = {
|
||||
"name": {},
|
||||
"guid": targetGuid,
|
||||
"pointers": {}, "inv_pointers": {},
|
||||
"sets": {}, "inv_sets": {}
|
||||
};
|
||||
nodeGuidMap[targetGuid] = targetEntry;
|
||||
}
|
||||
let invSets = targetEntry.inv_sets;
|
||||
let targetSet = invSets[setName];
|
||||
let invLoad = {
|
||||
name: targetMetaName,
|
||||
guid: sourceGuid
|
||||
};
|
||||
if (targetSet === undefined) {
|
||||
invSets[setName] = [invLoad];
|
||||
} else {
|
||||
targetSet.push(invLoad);
|
||||
};
|
||||
}
|
||||
});
|
||||
catch (err) {
|
||||
console.log(`difficulty loading target path: ${targetPath} with err: ${err.message}`);
|
||||
let load = {
|
||||
"fault": `could not load member path: ${targetPath}`
|
||||
};
|
||||
let sets: DictionaryAny = sourceEntry.sets;
|
||||
let sourceSet = sets[setName];
|
||||
if (sourceSet === undefined) {
|
||||
sets[setName] = [load];
|
||||
} else {
|
||||
sourceSet.push(load);
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
} finally {
|
||||
done();
|
||||
}
|
||||
};
|
||||
return Promise
|
||||
.try<void>(() => {
|
||||
return core.traverse(sponsor.rootNode,
|
||||
{ excludeRoot: false },
|
||||
visitFn);
|
||||
})
|
||||
.then(() => {
|
||||
return nodeGuidMap;
|
||||
});
|
||||
|
||||
await core.traverse(sponsor.rootNode, { excludeRoot: false }, visitFn);
|
||||
return nodeGuidMap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user