diff --git a/types/amqplib/index.d.ts b/types/amqplib/index.d.ts index a6e5aec204..45b5e6e3ca 100644 --- a/types/amqplib/index.d.ts +++ b/types/amqplib/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/squaremo/amqp.node // Definitions by: Michael Nahkies , Ab Reitsma , Nicolás Fantone // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/anydb-sql-migrations/index.d.ts b/types/anydb-sql-migrations/index.d.ts index 5db740c70f..ae922c37ae 100644 --- a/types/anydb-sql-migrations/index.d.ts +++ b/types/anydb-sql-migrations/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/spion/anydb-sql-migrations // Definitions by: Gorgi Kosev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import Promise = require('bluebird'); import { Column, Table, Transaction, AnydbSql } from 'anydb-sql'; diff --git a/types/asana/index.d.ts b/types/asana/index.d.ts index 364980b66c..ede3bc99f9 100644 --- a/types/asana/index.d.ts +++ b/types/asana/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/Asana/node-asana // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index a8a6242bb4..0e810f8ae5 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/auth0/node-auth0 // Definitions by: Wilson Hobbs , Seth Westphal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as Promise from 'bluebird'; diff --git a/types/blue-tape/index.d.ts b/types/blue-tape/index.d.ts index 133968a165..c2d2d50ab5 100644 --- a/types/blue-tape/index.d.ts +++ b/types/blue-tape/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/spion/blue-tape // Definitions by: Haoqun Jiang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/bluebird-global/index.d.ts b/types/bluebird-global/index.d.ts index 835bc59c31..c0e220ce07 100644 --- a/types/bluebird-global/index.d.ts +++ b/types/bluebird-global/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/petkaantonov/bluebird // Definitions by: 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 | void | Bluebird.Thenable): Bluebird; - catch(predicate: (error: any) => boolean, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => T | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable): Bluebird; - catch(predicate: Object, onReject: (error: any) => T | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - catch(predicate: Object, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; + catch(predicate: (error: any) => boolean, onReject: (error: any) => T | PromiseLike | void | PromiseLike): Bluebird; + catch(predicate: (error: any) => boolean, onReject: (error: any) => U | PromiseLike): Bluebird; + catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => T | PromiseLike | void | PromiseLike): Bluebird; + catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | PromiseLike): Bluebird; + catch(predicate: Object, onReject: (error: any) => T | PromiseLike | void | PromiseLike): Bluebird; + catch(predicate: Object, onReject: (error: any) => U | PromiseLike): Bluebird; } /* * Patch all static methods and the constructor */ interface PromiseConstructor { - new (callback: (resolve: (thenableOrResult?: T | Bluebird.Thenable) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void): Promise; + new (callback: (resolve: (thenableOrResult?: T | PromiseLike) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void): Promise; // all: typeof Bluebird.all; any: typeof Bluebird.any; diff --git a/types/bluebird-retry/index.d.ts b/types/bluebird-retry/index.d.ts index 63adc1476d..97d756524b 100644 --- a/types/bluebird-retry/index.d.ts +++ b/types/bluebird-retry/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/jut-io/bluebird-retry // Definitions by: Pascal Vomhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index 5d1d5cfc81..451b23fa02 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/petkaantonov/bluebird // Definitions by: Leonard Hecker // 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 implements Bluebird.Thenable, Bluebird.Inspection { +declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * 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) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void); + constructor(callback: (resolve: (thenableOrResult?: R | PromiseLike) => 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(onFulfill: (value: R) => U1 | Bluebird.Thenable, onReject: (error: any) => U2 | Bluebird.Thenable): Bluebird; - then(onFulfill: (value: R) => U | Bluebird.Thenable, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - then(onFulfill: (value: R) => U | Bluebird.Thenable): Bluebird; - then(): Bluebird; + // Based on PromiseLike.then, but returns a Bluebird instance. + then(onFulfill?: (value: R) => U | Bluebird.Thenable, onReject?: (error: any) => U | Bluebird.Thenable): Bluebird; // For simpler signature help. + then(onfulfilled?: ((value: R) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Bluebird; /** * 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 | void | Bluebird.Thenable): Bluebird; - caught(onReject?: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - catch(onReject?: (error: any) => U | Bluebird.Thenable): Bluebird; - caught(onReject?: (error: any) => U | Bluebird.Thenable): Bluebird; + catch(onReject?: (error: any) => R | PromiseLike | void | PromiseLike): Bluebird; + caught(onReject?: (error: any) => R | PromiseLike | void | PromiseLike): Bluebird; + catch(onReject?: (error: any) => U | PromiseLike): Bluebird; + caught(onReject?: (error: any) => U | PromiseLike): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection 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 | void | Bluebird.Thenable, + onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, ): Bluebird; caught( filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, @@ -82,7 +82,7 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection 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 | void | Bluebird.Thenable, + onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, ): Bluebird; catch( filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, @@ -90,7 +90,7 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection 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, + onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, ): Bluebird; caught( filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, @@ -98,7 +98,7 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection 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, + onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, ): Bluebird; catch( @@ -106,106 +106,106 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection 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 | void | Bluebird.Thenable, + onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, ): Bluebird; caught( 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 | void | Bluebird.Thenable, + onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, ): Bluebird; catch( 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, + onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, ): Bluebird; caught( 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, + onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, ): Bluebird; catch( 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 | void | Bluebird.Thenable, + onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, ): Bluebird; caught( 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 | void | Bluebird.Thenable, + onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, ): Bluebird; catch( 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, + onReject: (error: E1 | E2 | E3) => U | PromiseLike, ): Bluebird; caught( 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, + onReject: (error: E1 | E2 | E3) => U | PromiseLike, ): Bluebird; catch( 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 | void | Bluebird.Thenable, + onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, ): Bluebird; caught( 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 | void | Bluebird.Thenable, + onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, ): Bluebird; catch( 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, + onReject: (error: E1 | E2) => U | PromiseLike, ): Bluebird; caught( 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, + onReject: (error: E1 | E2) => U | PromiseLike, ): Bluebird; catch( filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - onReject: (error: E1) => R | Bluebird.Thenable | void | Bluebird.Thenable, + onReject: (error: E1) => R | PromiseLike | void | PromiseLike, ): Bluebird; caught( filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - onReject: (error: E1) => R | Bluebird.Thenable | void | Bluebird.Thenable, + onReject: (error: E1) => R | PromiseLike | void | PromiseLike, ): Bluebird; catch( filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - onReject: (error: E1) => U | Bluebird.Thenable, + onReject: (error: E1) => U | PromiseLike, ): Bluebird; caught( filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - onReject: (error: E1) => U | Bluebird.Thenable, + onReject: (error: E1) => U | PromiseLike, ): Bluebird; /** * 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(onReject: (reason: any) => U | Bluebird.Thenable): Bluebird; + error(onReject: (reason: any) => U | PromiseLike): Bluebird; /** * 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(handler: () => U | Bluebird.Thenable): Bluebird; + finally(handler: () => U | PromiseLike): Bluebird; - lastly(handler: () => U | Bluebird.Thenable): Bluebird; + lastly(handler: () => U | PromiseLike): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection(onFulfilled?: (value: R) => U | Bluebird.Thenable, onRejected?: (error: any) => U | Bluebird.Thenable): void; + done(onFulfilled?: (value: R) => U | PromiseLike, onRejected?: (error: any) => U | PromiseLike): void; /** * Like `.finally()`, but not called for rejections. */ - tap(onFulFill: (value: R) => Bluebird.Thenable): Bluebird; + tap(onFulFill: (value: R) => PromiseLike): Bluebird; tap(onFulfill: (value: R) => U): Bluebird; /** * Like `.catch()` but rethrows the error * TODO: disallow non-objects */ - tapCatch(onReject: (error?: any) => U | Bluebird.Thenable): Bluebird; + tapCatch(onReject: (error?: any) => U | PromiseLike): Bluebird; tapCatch( filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, @@ -235,29 +235,29 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection 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, + onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, ): Bluebird; tapCatch( 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, + onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, ): Bluebird; tapCatch( 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, + onReject: (error: E1 | E2 | E3) => U | PromiseLike, ): Bluebird; tapCatch( 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, + onReject: (error: E1 | E2) => U | PromiseLike, ): Bluebird; tapCatch( filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - onReject: (error: E1) => U | Bluebird.Thenable, + onReject: (error: E1) => U | PromiseLike, ): Bluebird; /** @@ -488,7 +488,7 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection(fulfilledHandler: (...values: W[]) => U | Bluebird.Thenable): Bluebird; + spread(fulfilledHandler: (...values: W[]) => U | PromiseLike): Bluebird; spread(fulfilledHandler: Function): Bluebird; /** @@ -525,29 +525,29 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection(mapper: (item: Q, index: number, arrayLength: number) => U | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; + map(mapper: (item: Q, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; /** * 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(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U | Bluebird.Thenable, initialValue?: U): Bluebird; + reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; /** * 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(filterer: (item: U, index: number, arrayLength: number) => boolean | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; + filter(filterer: (item: U, index: number, arrayLength: number) => boolean | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; /** * 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(iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable): Bluebird; + each(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; /** * 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(iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable): Bluebird; + mapSeries(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection(fn: () => R | Bluebird.Thenable): Bluebird; - static attempt(fn: () => R | Bluebird.Thenable): Bluebird; + static try(fn: () => R | PromiseLike): Bluebird; + static attempt(fn: () => R | PromiseLike): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection; - static resolve(value: R | Bluebird.Thenable): Bluebird; + static resolve(value: R | PromiseLike): Bluebird; /** * Create a promise that is rejected with the given `reason`. @@ -597,7 +597,7 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection(value: R | Bluebird.Thenable): Bluebird; + static cast(value: R | PromiseLike): Bluebird; /** * Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`. @@ -619,7 +619,7 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection(ms: number, value: R | Bluebird.Thenable): Bluebird; + static delay(ms: number, value: R | PromiseLike): Bluebird; static delay(ms: number): Bluebird; /** @@ -671,13 +671,13 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection(values: [Bluebird.Thenable | T1, Bluebird.Thenable | T2, Bluebird.Thenable | T3, Bluebird.Thenable | T4, Bluebird.Thenable | T5]): Bluebird<[T1, T2, T3, T4, T5]>; - static all(values: [Bluebird.Thenable | T1, Bluebird.Thenable | T2, Bluebird.Thenable | T3, Bluebird.Thenable | T4]): Bluebird<[T1, T2, T3, T4]>; - static all(values: [Bluebird.Thenable | T1, Bluebird.Thenable | T2, Bluebird.Thenable | T3]): Bluebird<[T1, T2, T3]>; - static all(values: [Bluebird.Thenable | T1, Bluebird.Thenable | T2]): Bluebird<[T1, T2]>; - static all(values: [Bluebird.Thenable | T1]): Bluebird<[T1]>; + static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3, PromiseLike | T4, PromiseLike | T5]): Bluebird<[T1, T2, T3, T4, T5]>; + static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3, PromiseLike | T4]): Bluebird<[T1, T2, T3, T4]>; + static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3]): Bluebird<[T1, T2, T3]>; + static all(values: [PromiseLike | T1, PromiseLike | T2]): Bluebird<[T1, T2]>; + static all(values: [PromiseLike | T1]): Bluebird<[T1]>; // array with values - static all(values: Bluebird.Thenable<(Bluebird.Thenable | R)[]> | (Bluebird.Thenable | R)[]): Bluebird; + static all(values: PromiseLike<(PromiseLike | R)[]> | (PromiseLike | R)[]): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection(values: Bluebird.Thenable<(Bluebird.Thenable | R)[]> | (Bluebird.Thenable | R)[]): Bluebird; + static any(values: PromiseLike<(PromiseLike | R)[]> | (PromiseLike | R)[]): Bluebird; /** * 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(values: Bluebird.Thenable<(Bluebird.Thenable | R)[]> | (Bluebird.Thenable | R)[]): Bluebird; + static race(values: PromiseLike<(PromiseLike | R)[]> | (PromiseLike | R)[]): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection(values: Bluebird.Thenable[]>, count: number): Bluebird; + static some(values: PromiseLike[]>, count: number): Bluebird; // promise of array with values - static some(values: Bluebird.Thenable, count: number): Bluebird; + static some(values: PromiseLike, count: number): Bluebird; // array with promises of value - static some(values: Bluebird.Thenable[], count: number): Bluebird; + static some(values: PromiseLike[], count: number): Bluebird; // array with values static some(values: R[], count: number): Bluebird; @@ -729,15 +729,15 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection(arg1: A1 | Bluebird.Thenable, handler: (arg1: A1) => R | Bluebird.Thenable): Bluebird; - static join(arg1: A1 | Bluebird.Thenable, arg2: A2 | Bluebird.Thenable, handler: (arg1: A1, arg2: A2) => R | Bluebird.Thenable): Bluebird; - static join(arg1: A1 | Bluebird.Thenable, arg2: A2 | Bluebird.Thenable, arg3: A3 | Bluebird.Thenable, handler: (arg1: A1, arg2: A2, arg3: A3) => R | Bluebird.Thenable): Bluebird; - static join(arg1: A1 | Bluebird.Thenable, arg2: A2 | Bluebird.Thenable, arg3: A3 | Bluebird.Thenable, arg4: A4 | Bluebird.Thenable, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | Bluebird.Thenable): Bluebird; - static join(arg1: A1 | Bluebird.Thenable, arg2: A2 | Bluebird.Thenable, arg3: A3 | Bluebird.Thenable, arg4: A4 | Bluebird.Thenable, arg5: A5 | Bluebird.Thenable, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | Bluebird.Thenable): Bluebird; + static join(arg1: A1 | PromiseLike, handler: (arg1: A1) => R | PromiseLike): Bluebird; + static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, handler: (arg1: A1, arg2: A2) => R | PromiseLike): Bluebird; + static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike): Bluebird; + static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, arg4: A4 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike): Bluebird; + static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, arg4: A4 | PromiseLike, arg5: A5 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike): Bluebird; // variadic array /** @deprecated use .all instead */ - static join(...values: (R | Bluebird.Thenable)[]): Bluebird; + static join(...values: (R | PromiseLike)[]): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection(values: Bluebird.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; + static map(values: PromiseLike[]>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; // promise of array with values - static map(values: Bluebird.Thenable, mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; + static map(values: PromiseLike, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; // array with promises of value - static map(values: Bluebird.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; + static map(values: PromiseLike[], mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; // array with values - static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable, options?: Bluebird.ConcurrencyOption): Bluebird; + static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection(values: Bluebird.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable, initialValue?: U): Bluebird; + static reduce(values: PromiseLike[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; // promise of array with values - static reduce(values: Bluebird.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable, initialValue?: U): Bluebird; + static reduce(values: PromiseLike, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; // array with promises of value - static reduce(values: Bluebird.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable, initialValue?: U): Bluebird; + static reduce(values: PromiseLike[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; // array with values - static reduce(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | Bluebird.Thenable, initialValue?: U): Bluebird; + static reduce(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection(values: Bluebird.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable, option?: Bluebird.ConcurrencyOption): Bluebird; + static filter(values: PromiseLike[]>, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; // promise of array with values - static filter(values: Bluebird.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable, option?: Bluebird.ConcurrencyOption): Bluebird; + static filter(values: PromiseLike, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; // array with promises of value - static filter(values: Bluebird.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable, option?: Bluebird.ConcurrencyOption): Bluebird; + static filter(values: PromiseLike[], filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; // array with values - static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean | Bluebird.Thenable, option?: Bluebird.ConcurrencyOption): Bluebird; + static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection(values: Bluebird.Thenable[]>, iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable): Bluebird; + static each(values: PromiseLike[]>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; // array with promises of value - static each(values: Bluebird.Thenable[], iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable): Bluebird; + static each(values: PromiseLike[], iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; // array with values OR promise of array with values - static each(values: R[] | Bluebird.Thenable, iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable): Bluebird; + static each(values: R[] | PromiseLike, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection(values: (R | Bluebird.Thenable)[] | Bluebird.Thenable<(R | Bluebird.Thenable)[]>, iterator: (item: R, index: number, arrayLength: number) => U | Bluebird.Thenable): Bluebird; + static mapSeries(values: (R | PromiseLike)[] | PromiseLike<(R | PromiseLike)[]>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; /** * 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 implements Bluebird.Thenable, Bluebird.Inspection) => void | Bluebird.Thenable): Bluebird.Disposer; + disposer(disposeFn: (arg: R, promise: Bluebird) => void | PromiseLike): Bluebird.Disposer; /** * 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(disposer: Bluebird.Disposer, executor: (transaction: R) => Bluebird.Thenable): Bluebird; - static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2) => Bluebird.Thenable): Bluebird; - static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, disposer3: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2, transaction3: R3) => Bluebird.Thenable): Bluebird; + static using(disposer: Bluebird.Disposer, executor: (transaction: R) => PromiseLike): Bluebird; + static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2) => PromiseLike): Bluebird; + static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, disposer3: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2, transaction3: R3) => PromiseLike): Bluebird; /** * 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; + promisifier?: (originalMethod: Function) => () => PromiseLike; } /** @@ -951,10 +951,8 @@ declare namespace Bluebird { export class Disposer { } - export interface Thenable { - then(onFulfilled: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; - then(onFulfilled: (value: R) => U | Thenable, onRejected?: (error: any) => void | Thenable): Thenable; - } + /** @deprecated Use PromiseLike directly. */ + export type Thenable = PromiseLike; export interface Resolver { /** diff --git a/types/bookshelf/index.d.ts b/types/bookshelf/index.d.ts index a7c0a90536..55be61ba9e 100644 --- a/types/bookshelf/index.d.ts +++ b/types/bookshelf/index.d.ts @@ -2,7 +2,7 @@ // Project: http://bookshelfjs.org/ // Definitions by: Andrew Schurman , Vesa Poikajärvi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 import Knex = require('knex'); import knex = require('knex'); diff --git a/types/consolidate/index.d.ts b/types/consolidate/index.d.ts index 2a0adb1db9..bfe432214f 100644 --- a/types/consolidate/index.d.ts +++ b/types/consolidate/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/visionmedia/consolidate.js // Definitions by: Carlos Ballesteros Velasco , Theo Sherry , Nicolas Henry // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Imported from: https://github.com/soywiz/typescript-node-definitions/consolidate.d.ts diff --git a/types/db-migrate-base/index.d.ts b/types/db-migrate-base/index.d.ts index de3a4c0812..a881fa6a06 100644 --- a/types/db-migrate-base/index.d.ts +++ b/types/db-migrate-base/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/db-migrate/db-migrate-base // Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/db-migrate-pg/index.d.ts b/types/db-migrate-pg/index.d.ts index 7804f4ddad..6a72fd1109 100644 --- a/types/db-migrate-pg/index.d.ts +++ b/types/db-migrate-pg/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/db-migrate/pg // Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped +// TypeScript Version: 2.3 import * as pg from "pg"; import * as DbMigrateBase from "db-migrate-base"; diff --git a/types/fs-extra-promise/index.d.ts b/types/fs-extra-promise/index.d.ts index d57fd93ed6..9d174f791f 100644 --- a/types/fs-extra-promise/index.d.ts +++ b/types/fs-extra-promise/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/overlookmotel/fs-extra-promise // Definitions by: midknight41 , Jason Swearingen , Hiromi Shikata // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 /// diff --git a/types/inline-css/index.d.ts b/types/inline-css/index.d.ts index a6db3ef67b..6d43b7975d 100644 --- a/types/inline-css/index.d.ts +++ b/types/inline-css/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/jonkemp/inline-css // Definitions by: Philip Spain // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/java/index.d.ts b/types/java/index.d.ts index 46dc577e35..cf770a8807 100644 --- a/types/java/index.d.ts +++ b/types/java/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/joeferner/node-java // Definitions by: Jim Lloyd , Kentaro Teramoto // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/java/java-tests.ts b/types/java/java-tests.ts index 6d464b36e1..4c79640733 100644 --- a/types/java/java-tests.ts +++ b/types/java/java-tests.ts @@ -1,5 +1,3 @@ -/// - 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 => { return BluePromise.resolve(); }); */ diff --git a/types/karma-coverage/index.d.ts b/types/karma-coverage/index.d.ts index 20ee56f43c..03ca857449 100644 --- a/types/karma-coverage/index.d.ts +++ b/types/karma-coverage/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/karma-runner/karma-coverage // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as karma from 'karma'; import * as istanbul from 'istanbul'; diff --git a/types/karma/index.d.ts b/types/karma/index.d.ts index 59590b0a6d..ab4dc9b31f 100644 --- a/types/karma/index.d.ts +++ b/types/karma/index.d.ts @@ -2,8 +2,8 @@ // Project: https://github.com/karma-runner/karma // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -/// /// // 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` diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index fa84243b76..2e301af850 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -2,9 +2,8 @@ // Project: https://github.com/tgriesser/knex // Definitions by: Qubo , Baronfel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 -/// /// import events = require("events"); diff --git a/types/node-mysql-wrapper/index.d.ts b/types/node-mysql-wrapper/index.d.ts index 7785d8a7b4..c887da3368 100644 --- a/types/node-mysql-wrapper/index.d.ts +++ b/types/node-mysql-wrapper/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/nodets/node-mysql-wrapper // Definitions by: Makis Maropoulos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// @@ -49,20 +50,20 @@ interface IQueryConstructor { 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) 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) 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 { - /** 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 { 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 { /** * 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 { * @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 { getPrimaryKeyValue(jsObject: any): number | string; /** - * + * */ - find(criteriaRawJsObject: any): Promise; // only criteria + find(criteriaRawJsObject: any): Promise; // only criteria find(criteriaRawJsObject: any, callback: ((_results: T[]) => any)): Promise; // criteria and callback find(criteriaRawJsObject: any, callback?: (_results: T[]) => any): Promise; @@ -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; diff --git a/types/nodemailer-smtp-transport/index.d.ts b/types/nodemailer-smtp-transport/index.d.ts index 7f0f8d7cca..4e4e11afe0 100644 --- a/types/nodemailer-smtp-transport/index.d.ts +++ b/types/nodemailer-smtp-transport/index.d.ts @@ -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; diff --git a/types/nodemailer/index.d.ts b/types/nodemailer/index.d.ts index 88a82f073a..833873c45e 100644 --- a/types/nodemailer/index.d.ts +++ b/types/nodemailer/index.d.ts @@ -4,11 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// 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; - + /** * 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 */ diff --git a/types/orientjs/index.d.ts b/types/orientjs/index.d.ts index 571aeebe7c..679fc7c70a 100644 --- a/types/orientjs/index.d.ts +++ b/types/orientjs/index.d.ts @@ -2,6 +2,8 @@ // Project: https://github.com/orientechnologies/orientjs // Definitions by: Saeed Tabrizi // Definitions: https://github.com/borisyankov/DefinitelyTyped +// TypeScript Version: 2.3 + // Developed with love in www.nowcando.com /// diff --git a/types/pg/pg-tests.ts b/types/pg/pg-tests.ts index 2fe301935a..73c18ac1b7 100644 --- a/types/pg/pg-tests.ts +++ b/types/pg/pg-tests.ts @@ -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); diff --git a/types/pify/pify-tests.ts b/types/pify/pify-tests.ts index 2252005b85..87e1ba28ae 100644 --- a/types/pify/pify-tests.ts +++ b/types/pify/pify-tests.ts @@ -1,8 +1,4 @@ - -/// - 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')); \ No newline at end of file +pify(fs.readFile, Promise)('bar.txt').then((result: string) => assert(result, 'bar')); \ No newline at end of file diff --git a/types/project-oxford/index.d.ts b/types/project-oxford/index.d.ts index db322e3fa8..5a85f26ad6 100644 --- a/types/project-oxford/index.d.ts +++ b/types/project-oxford/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/felixrieseberg/project-oxford // Definitions by: Scott Southwood // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/redlock/index.d.ts b/types/redlock/index.d.ts index 85e5882639..1e00de6ed1 100644 --- a/types/redlock/index.d.ts +++ b/types/redlock/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/mike-marcacci/node-redlock // Definitions by: Ilya Mochalov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as redis from 'redis'; import * as Promise from 'bluebird'; diff --git a/types/request-promise/index.d.ts b/types/request-promise/index.d.ts index 06d4947579..393abacbe7 100644 --- a/types/request-promise/index.d.ts +++ b/types/request-promise/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/request/request-promise // Definitions by: Christopher Glantschnig , Joe Skeen , Aya Morisawa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import request = require('request'); import http = require('http'); diff --git a/types/sequelize-fixtures/index.d.ts b/types/sequelize-fixtures/index.d.ts index 6114ed84e2..5a54317668 100644 --- a/types/sequelize-fixtures/index.d.ts +++ b/types/sequelize-fixtures/index.d.ts @@ -2,9 +2,7 @@ // Project: https://github.com/domasx2/sequelize-fixtures // Definitions by: Christian Schwarz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -/// +// TypeScript Version: 2.3 import * as Sequelize from "sequelize"; diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 47e6039f89..a427c30eb8 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -2,12 +2,11 @@ // Project: http://sequelizejs.com // Definitions by: samuelneff , Peter Harris , Ivan Drinchev , Brendan Abolivier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 // Based on original work by: samuelneff /// -/// /// diff --git a/types/sequelize/v3/index.d.ts b/types/sequelize/v3/index.d.ts index 1a3ce50d0c..50e428f47b 100644 --- a/types/sequelize/v3/index.d.ts +++ b/types/sequelize/v3/index.d.ts @@ -7,7 +7,6 @@ // Based on original work by: samuelneff /// -/// /// diff --git a/types/simple-mock/simple-mock-tests.ts b/types/simple-mock/simple-mock-tests.ts index 16d8b89a93..05c900ee99 100644 --- a/types/simple-mock/simple-mock-tests.ts +++ b/types/simple-mock/simple-mock-tests.ts @@ -1,7 +1,7 @@ -/// - 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(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; diff --git a/types/simple-oauth2/index.d.ts b/types/simple-oauth2/index.d.ts index a192e6879b..37add22766 100644 --- a/types/simple-oauth2/index.d.ts +++ b/types/simple-oauth2/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/lelylan/simple-oauth2 // Definitions by: [Michael Müller] // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import Bluebird = require("bluebird"); diff --git a/types/stripe-node/index.d.ts b/types/stripe-node/index.d.ts index b299f5c2a1..a6193cb45d 100644 --- a/types/stripe-node/index.d.ts +++ b/types/stripe-node/index.d.ts @@ -3,7 +3,6 @@ // Definitions by: William Johnston , Peter Harris // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// /// declare module 'stripe' { diff --git a/types/umzug/index.d.ts b/types/umzug/index.d.ts index 85659e246b..0c58ef40ff 100644 --- a/types/umzug/index.d.ts +++ b/types/umzug/index.d.ts @@ -2,10 +2,7 @@ // Project: https://github.com/sequelize/umzug // Definitions by: Ivan Drinchev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -/// -/// +// TypeScript Version: 2.3 import Sequelize = require("sequelize"); diff --git a/types/waterline/index.d.ts b/types/waterline/index.d.ts index 6525e699b6..a3aa7c04ee 100644 --- a/types/waterline/index.d.ts +++ b/types/waterline/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/balderdashy/waterline // Definitions by: Alexandro Libertino // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/webgme/tsconfig.json b/types/webgme/tsconfig.json index 2d5184486f..d1ae63d85c 100644 --- a/types/webgme/tsconfig.json +++ b/types/webgme/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "module": "commonjs", + "target": "es6", "lib": [ "es6", "dom" diff --git a/types/webgme/webgme-tests.ts b/types/webgme/webgme-tests.ts index e6f315a3ef..1cb2c78814 100644 --- a/types/webgme/webgme-tests.ts +++ b/types/webgme/webgme-tests.ts @@ -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 { 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 { 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 => { 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(() => { - return core.traverse(sponsor.rootNode, - { excludeRoot: false }, - visitFn); - }) - .then(() => { - return nodeGuidMap; - }); + + await core.traverse(sponsor.rootNode, { excludeRoot: false }, visitFn); + return nodeGuidMap; } }