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..20e38ed7bb 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`? 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..3dc4aad0a4 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: @@ -44,10 +45,8 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection(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(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. @@ -951,10 +950,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 b4c9a648ac..a962746944 100644 --- a/types/fs-extra-promise/index.d.ts +++ b/types/fs-extra-promise/index.d.ts @@ -2,11 +2,9 @@ // Project: https://github.com/overlookmotel/fs-extra-promise // Definitions by: midknight41 , Jason Swearingen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 /// -/// -/// import * as stream from 'stream'; import { Stats } from 'fs'; 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..31e2b569aa 100644 --- a/types/umzug/index.d.ts +++ b/types/umzug/index.d.ts @@ -4,9 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -/// -/// - import Sequelize = require("sequelize"); declare namespace umzug { 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..61cd76bef0 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,7 +328,7 @@ 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"; @@ -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; } }