diff --git a/README.md b/README.md index 0b1a79ae7c..5df5808bd1 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ Here are the [currently requested definitions](https://github.com/DefinitelyType If types are part of a web standard, they should be contributed to [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) so that they can become part of the default `lib.dom.d.ts`. -### A package uses `export =`, but I prefer to use default imports. Can I change `export =` to `export default`? +#### A package uses `export =`, but I prefer to use default imports. Can I change `export =` to `export default`? If default imports work in your environment, consider turning on the [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) compiler option. Do not change the type definition if it is accurate. @@ -214,8 +214,7 @@ For an NPM package, `export =` is accurate if `node -p 'require("foo")'` is the #### I want to use features from TypeScript 2.1. -Then you will have to add a comment to your definition header: `// TypeScript Version: 2.1`. -If it is merged before January 7, it will be published as a prerelease version, such as `4.3.0-next.0`. +Then you will have to add a comment to the last line of your definition header (after `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 2.1`. #### I want to add a DOM API not present in TypeScript by default. diff --git a/ace/tests/ace-anchor-tests.ts b/ace/test/anchor.ts similarity index 100% rename from ace/tests/ace-anchor-tests.ts rename to ace/test/anchor.ts diff --git a/ace/tests/ace-background_tokenizer-tests.ts b/ace/test/background_tokenizer.ts similarity index 100% rename from ace/tests/ace-background_tokenizer-tests.ts rename to ace/test/background_tokenizer.ts diff --git a/ace/tests/ace-default-tests.ts b/ace/test/default.ts similarity index 100% rename from ace/tests/ace-default-tests.ts rename to ace/test/default.ts diff --git a/ace/tests/ace-document-tests.ts b/ace/test/document.ts similarity index 100% rename from ace/tests/ace-document-tests.ts rename to ace/test/document.ts diff --git a/ace/tests/ace-edit_session-tests.ts b/ace/test/edit_session.ts similarity index 100% rename from ace/tests/ace-edit_session-tests.ts rename to ace/test/edit_session.ts diff --git a/ace/tests/ace-editor1-tests.ts b/ace/test/editor1.ts similarity index 100% rename from ace/tests/ace-editor1-tests.ts rename to ace/test/editor1.ts diff --git a/ace/tests/ace-editor_highlight_selected_word-tests.ts b/ace/test/editor_highlight_selected_word.ts similarity index 100% rename from ace/tests/ace-editor_highlight_selected_word-tests.ts rename to ace/test/editor_highlight_selected_word.ts diff --git a/ace/tests/ace-editor_navigation-tests.ts b/ace/test/editor_navigation.ts similarity index 100% rename from ace/tests/ace-editor_navigation-tests.ts rename to ace/test/editor_navigation.ts diff --git a/ace/tests/ace-editor_text_edit-tests.ts b/ace/test/editor_text_edit.ts similarity index 100% rename from ace/tests/ace-editor_text_edit-tests.ts rename to ace/test/editor_text_edit.ts diff --git a/ace/tests/ace-multi_select-tests.ts b/ace/test/multi_select.ts similarity index 100% rename from ace/tests/ace-multi_select-tests.ts rename to ace/test/multi_select.ts diff --git a/ace/tests/ace-placeholder-tests.ts b/ace/test/placeholder.ts similarity index 100% rename from ace/tests/ace-placeholder-tests.ts rename to ace/test/placeholder.ts diff --git a/ace/tests/ace-range-tests.ts b/ace/test/range.ts similarity index 100% rename from ace/tests/ace-range-tests.ts rename to ace/test/range.ts diff --git a/ace/tests/ace-range_list-tests.ts b/ace/test/range_list.ts similarity index 100% rename from ace/tests/ace-range_list-tests.ts rename to ace/test/range_list.ts diff --git a/ace/tests/ace-search-tests.ts b/ace/test/search.ts similarity index 100% rename from ace/tests/ace-search-tests.ts rename to ace/test/search.ts diff --git a/ace/tests/ace-selection-tests.ts b/ace/test/selection.ts similarity index 100% rename from ace/tests/ace-selection-tests.ts rename to ace/test/selection.ts diff --git a/ace/tests/ace-token_iterator-tests.ts b/ace/test/token_iterator.ts similarity index 100% rename from ace/tests/ace-token_iterator-tests.ts rename to ace/test/token_iterator.ts diff --git a/ace/tests/ace-virtual_renderer-tests.ts b/ace/test/virtual_renderer.ts similarity index 100% rename from ace/tests/ace-virtual_renderer-tests.ts rename to ace/test/virtual_renderer.ts diff --git a/ace/tsconfig.json b/ace/tsconfig.json index e5a0d270c3..0a65374983 100644 --- a/ace/tsconfig.json +++ b/ace/tsconfig.json @@ -15,22 +15,22 @@ }, "files": [ "index.d.ts", - "tests/ace-anchor-tests.ts", - "tests/ace-background_tokenizer-tests.ts", - "tests/ace-default-tests.ts", - "tests/ace-document-tests.ts", - "tests/ace-edit_session-tests.ts", - "tests/ace-editor1-tests.ts", - "tests/ace-editor_highlight_selected_word-tests.ts", - "tests/ace-editor_navigation-tests.ts", - "tests/ace-editor_text_edit-tests.ts", - "tests/ace-multi_select-tests.ts", - "tests/ace-placeholder-tests.ts", - "tests/ace-range-tests.ts", - "tests/ace-range_list-tests.ts", - "tests/ace-search-tests.ts", - "tests/ace-selection-tests.ts", - "tests/ace-token_iterator-tests.ts", - "tests/ace-virtual_renderer-tests.ts" + "test/anchor.ts", + "test/background_tokenizer.ts", + "test/default.ts", + "test/document.ts", + "test/edit_session.ts", + "test/editor1.ts", + "test/editor_highlight_selected_word.ts", + "test/editor_navigation.ts", + "test/editor_text_edit.ts", + "test/multi_select.ts", + "test/placeholder.ts", + "test/range.ts", + "test/range_list.ts", + "test/search.ts", + "test/selection.ts", + "test/token_iterator.ts", + "test/virtual_renderer.ts" ] } \ No newline at end of file diff --git a/acl/acl-tests.ts b/acl/test/index.ts similarity index 100% rename from acl/acl-tests.ts rename to acl/test/index.ts diff --git a/acl/acl-mongodbBackend-tests.ts b/acl/test/mongodbBackend.ts similarity index 100% rename from acl/acl-mongodbBackend-tests.ts rename to acl/test/mongodbBackend.ts diff --git a/acl/acl-redisBackend-tests.ts b/acl/test/redisBackend.ts similarity index 100% rename from acl/acl-redisBackend-tests.ts rename to acl/test/redisBackend.ts diff --git a/acl/tsconfig.json b/acl/tsconfig.json index d4ffafa7de..d663cdaa7f 100644 --- a/acl/tsconfig.json +++ b/acl/tsconfig.json @@ -15,8 +15,8 @@ }, "files": [ "index.d.ts", - "acl-tests.ts", - "acl-mongodbBackend-tests.ts", - "acl-redisBackend-tests.ts" + "test/index.ts", + "test/mongodbBackend.ts", + "test/redisBackend.ts" ] } \ No newline at end of file diff --git a/adal/adal-angular-tests.ts b/adal/test/angular.ts similarity index 100% rename from adal/adal-angular-tests.ts rename to adal/test/angular.ts diff --git a/adal/adal-tests.ts b/adal/test/index.ts similarity index 100% rename from adal/adal-tests.ts rename to adal/test/index.ts diff --git a/adal/tsconfig.json b/adal/tsconfig.json index e8a928a6ac..cabee4eec0 100644 --- a/adal/tsconfig.json +++ b/adal/tsconfig.json @@ -15,8 +15,8 @@ }, "files": [ "index.d.ts", - "adal-tests.ts", "adal-angular.d.ts", - "adal-angular-tests.ts" + "test/index.ts", + "test/angular.ts" ] } \ No newline at end of file diff --git a/amplify/amplifyjs-tests.ts b/amplify/amplify-tests.ts similarity index 100% rename from amplify/amplifyjs-tests.ts rename to amplify/amplify-tests.ts diff --git a/amplify/tsconfig.json b/amplify/tsconfig.json index 1adb36d073..a65fb478f3 100644 --- a/amplify/tsconfig.json +++ b/amplify/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "amplifyjs-tests.ts" + "amplify-tests.ts" ] } \ No newline at end of file diff --git a/angular-localforage/angular-localForage-tests.ts b/angular-localforage/angular-localforage-tests.ts similarity index 100% rename from angular-localforage/angular-localForage-tests.ts rename to angular-localforage/angular-localforage-tests.ts diff --git a/angular-localforage/tsconfig.json b/angular-localforage/tsconfig.json index e962f64de3..fd8c932b11 100644 --- a/angular-localforage/tsconfig.json +++ b/angular-localforage/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "angular-localForage-tests.ts" + "angular-localforage-tests.ts" ] } \ No newline at end of file diff --git a/angular-media-queries/match-media-tests.ts b/angular-media-queries/angular-media-queries-tests.ts similarity index 100% rename from angular-media-queries/match-media-tests.ts rename to angular-media-queries/angular-media-queries-tests.ts diff --git a/angular-media-queries/tsconfig.json b/angular-media-queries/tsconfig.json index df6257738e..493c273a2b 100644 --- a/angular-media-queries/tsconfig.json +++ b/angular-media-queries/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "match-media-tests.ts" + "angular-media-queries-tests.ts" ] } \ No newline at end of file diff --git a/angularlocalstorage/angularLocalStorage-tests.ts b/angularlocalstorage/angularlocalstorage-tests.ts similarity index 100% rename from angularlocalstorage/angularLocalStorage-tests.ts rename to angularlocalstorage/angularlocalstorage-tests.ts diff --git a/angularlocalstorage/tsconfig.json b/angularlocalstorage/tsconfig.json index ecdf8c2a96..cc91224c3b 100644 --- a/angularlocalstorage/tsconfig.json +++ b/angularlocalstorage/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "angularLocalStorage-tests.ts" + "angularlocalstorage-tests.ts" ] } \ No newline at end of file diff --git a/array-uniq/index-tests.ts b/array-uniq/array-uniq-tests.ts similarity index 100% rename from array-uniq/index-tests.ts rename to array-uniq/array-uniq-tests.ts diff --git a/array-uniq/tsconfig.json b/array-uniq/tsconfig.json index 3d8c032420..70196adde6 100644 --- a/array-uniq/tsconfig.json +++ b/array-uniq/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "index-tests.ts" + "array-uniq-tests.ts" ] } \ No newline at end of file diff --git a/async/async-explicit-tests.ts b/async/test/explicit.ts similarity index 100% rename from async/async-explicit-tests.ts rename to async/test/explicit.ts diff --git a/async/async-tests.ts b/async/test/index.ts similarity index 100% rename from async/async-tests.ts rename to async/test/index.ts diff --git a/async/tsconfig.json b/async/tsconfig.json index 412f9b97c6..8cceeb6576 100644 --- a/async/tsconfig.json +++ b/async/tsconfig.json @@ -15,7 +15,7 @@ }, "files": [ "index.d.ts", - "async-tests.ts", - "async-explicit-tests.ts" + "test/index.ts", + "test/explicit.ts" ] } \ No newline at end of file diff --git a/auth0-lock/auth0.lock-tests.ts b/auth0-lock/auth0-lock-tests.ts similarity index 100% rename from auth0-lock/auth0.lock-tests.ts rename to auth0-lock/auth0-lock-tests.ts diff --git a/auth0-lock/tsconfig.json b/auth0-lock/tsconfig.json index 641164d8a0..21b7642137 100644 --- a/auth0-lock/tsconfig.json +++ b/auth0-lock/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "auth0.lock-tests.ts" + "auth0-lock-tests.ts" ] } \ No newline at end of file diff --git a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts b/azure-mobile-services-client/azure-mobile-services-client-tests.ts similarity index 100% rename from azure-mobile-services-client/AzureMobileServicesClient-tests.ts rename to azure-mobile-services-client/azure-mobile-services-client-tests.ts diff --git a/azure-mobile-services-client/tsconfig.json b/azure-mobile-services-client/tsconfig.json index 7ad1094d69..5037dc88a1 100644 --- a/azure-mobile-services-client/tsconfig.json +++ b/azure-mobile-services-client/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "AzureMobileServicesClient-tests.ts" + "azure-mobile-services-client-tests.ts" ] } \ No newline at end of file diff --git a/babylonjs/babylon-tests.ts b/babylonjs/babylonjs-tests.ts similarity index 100% rename from babylonjs/babylon-tests.ts rename to babylonjs/babylonjs-tests.ts diff --git a/babylonjs/tsconfig.json b/babylonjs/tsconfig.json index b7a13bc9fc..185e6fda44 100644 --- a/babylonjs/tsconfig.json +++ b/babylonjs/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "babylon-tests.ts" + "babylonjs-tests.ts" ] } \ No newline at end of file diff --git a/backbone.marionette/marionette-tests.ts b/backbone.marionette/backbone.marionette-tests.ts similarity index 100% rename from backbone.marionette/marionette-tests.ts rename to backbone.marionette/backbone.marionette-tests.ts diff --git a/backbone.marionette/tsconfig.json b/backbone.marionette/tsconfig.json index 6fc8f27360..9dbd0a28f9 100644 --- a/backbone.marionette/tsconfig.json +++ b/backbone.marionette/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "marionette-tests.ts" + "backbone.marionette-tests.ts" ] } \ No newline at end of file diff --git a/backbone/backbone-with-lodash-tests.ts b/backbone/backbone-with-lodash-tests.ts deleted file mode 100644 index b44b2be988..0000000000 --- a/backbone/backbone-with-lodash-tests.ts +++ /dev/null @@ -1,404 +0,0 @@ -import * as Backbone from "backbone"; -import * as _ from "lodash"; - -function test_events() { - - var object = new Backbone.Events(); - object.on("alert", (eventName: string) => alert("Triggered " + eventName)); - - object.trigger("alert", "an event"); - - var onChange = () => alert('whatever'); - var context: any; - - object.off("change", onChange); - object.off("change"); - object.off(null, onChange); - object.off(null, null, context); - object.off(); -} - -class SettingDefaults extends Backbone.Model { - - // 'defaults' could be set in one of the following ways: - - defaults() { - return { - name: "Joe" - } - } - - constructor(attributes?: any, options?: any) { - super(attributes, options); // TODO error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. - this.defaults = { - name: "Joe" - } - // super has to come last - } - - // or set it like this - initialize() { - this.defaults = { - name: "Joe" - } - - } - - // same patterns could be used for setting 'Router.routes' and 'View.events' -} - -class Sidebar extends Backbone.Model { - - promptColor() { - var cssColor = prompt("Please enter a CSS color:"); - this.set({ color: cssColor }); - } -} - -class Note extends Backbone.Model { - initialize() { } - author() { } - coordinates() { } - allowedToEdit(account: any) { - return true; - } -} - -class PrivateNote extends Note { - allowedToEdit(account: any) { - return account.owns(this); - } - - set(attributes: any, options?: any): Backbone.Model { - return Backbone.Model.prototype.set.call(this, attributes, options); - } -} - -function test_models() { - - var sidebar = new Sidebar(); - sidebar.on('change:color', (model: {}, color: string) => $('#sidebar').css({ background: color })); - sidebar.set({ color: 'white' }); - sidebar.promptColor(); - - ////////// - - var note = new PrivateNote(); - - note.get("title"); - - note.set({ title: "March 20", content: "In his eyes she eclipses..." }); - - note.set("title", "A Scandal in Bohemia"); - - let strings: string[] - let value: any; - let values: any[]; - let bool: boolean; - - // underscore methods - strings = note.keys(); - values = note.values(); - values = note.pairs(); - values = note.invert(); - value = note.pick("foo"); - value = note.pick("foo", "bar"); - value = note.pick((value: any, key: any, object: any) => true); - value = note.omit("foo"); - value = note.omit("foo", "bar"); - value = note.omit((value: any, key: any, object: any) => true); - value = note.chain().pick().omit().value(); - bool = note.isEmpty(); -} - -class Employee extends Backbone.Model { - reports: EmployeeCollection; - - constructor(attributes?: any, options?: any) { - super(options); - this.reports = new EmployeeCollection(); - this.reports.url = '../api/employees/' + this.id + '/reports'; - } - - more() { - this.reports.reset(); - } -} - -class EmployeeCollection extends Backbone.Collection { - findByName(key: any) { } -} - -class Book extends Backbone.Model { - title: string; - author: string; - published: boolean; -} - -class Library extends Backbone.Collection { - // This model definition is here only to test type compatibility of the model, but it - // is not necessary in working code as it is automatically inferred through generics. - model: typeof Book; -} - -class Books extends Backbone.Collection { } - -function test_collection() { - - var books = new Books(); - - var book1: Book = new Book({ title: "Title 1", author: "Mike" }); - books.add(book1); - - // Objects can be added to collection by casting to model type. - // Compiler will check if object properties are valid for the cast. - // This gives better type checking than declaring an `any` overload. - books.add({ title: "Title 2", author: "Mikey" }); - - var model: Book = book1.collection.first(); - if (model !== book1) { - throw new Error("Error"); - } - - books.each(book => - book.get("title")); - - var titles = books.map(book => - book.get("title")); - - var publishedBooks = books.filter(book => - book.get("published") === true); - - var alphabetical = books.sortBy((book: Book): number => null); - - let one: Book; - let models: Book[]; - let bool: boolean; - let numDict: _.Dictionary; - let modelDict: _.Dictionary; - let modelsDict: _.Dictionary; - let num: number; - - models = books.slice(1); - models = books.slice(1, 3); - - // underscore methods - bool = books.all((value: Book, index: number, list: Book[]) => true); - bool = books.any((value: Book, index: number, list: Book[]) => true); - bool = books.chain().any((value: Book, index: number, list: Book[]) => true).value(); - models = books.collect((value: Book, index: number, list: Book[]) => value); - bool = books.contains(book1); - numDict = books.countBy((value: Book, index: number, list: Book[]) => true); - numDict = books.countBy("foo"); - one = books.detect((value: Book, index: number, list: Book[]) => true); - models = books.difference([book1]); - models = books.drop(); - models = books.each((value: Book, index: number, list: Book[]) => true); - bool = books.every((value: Book, index: number, list: Book[]) => true); - models = books.filter((value: Book, index: number, list: Book[]) => true); - one = books.find((value: Book, index: number, list: Book[]) => true); - num = books.findIndex((value: Book, index: number, list: Book[]) => true); - num = books.findLastIndex((value: Book, index: number, list: Book[]) => true); - one = books.first(); - models = books.first(3); - models = books.foldl((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); - models = books.foldr((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); - models = books.forEach((value: Book, index: number, list: Book[]) => true); - modelsDict = books.groupBy((value: Book, index: number, list: Book[]) => true); - modelsDict = books.groupBy("foo"); - one = books.head(); - models = books.head(3); - bool = books.include(book1); - bool = books.includes(book1); - modelDict = books.indexBy((value: Book, index: number, list: Book[]) => true); - modelDict = books.indexBy("foo"); - num = books.indexOf(book1, true); - one = books.initial(); - models = books.initial(3); - models = books.inject((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); - one = books.invoke("at", 3); - bool = books.isEmpty(); - one = books.last(); - models = books.last(3); - num = books.lastIndexOf(book1, 3); - models = books.map((value: Book, index: number, list: Book[]) => value); - one = books.max((value: Book, index: number, list: Book[]) => value); - one = books.min((value: Book, index: number, list: Book[]) => value); - [models] = books.partition((value: Book, index: number, list: Book[]) => true); - models = books.reduce((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); - models = books.reduceRight((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []); - models = books.reject((value: Book, index: number, list: Book[]) => true); - models = books.rest(3); - one = books.sample(); - models = books.sample(3); - models = books.select((value: Book, index: number, list: Book[]) => true); - models = books.shuffle(); - num = books.size(); - bool = books.some((value: Book, index: number, list: Book[]) => true); - models = books.sortBy((value: Book, index: number, list: Book[]) => value); - models = books.sortBy("foo"); - models = books.tail(3); - one = books.take(); - models = books.take(3); - models = books.toArray(); - models = books.without(book1, book1); -} - -////////// - -Backbone.history.start(); - -namespace v1Changes { - namespace events { - function test_once() { - var model = new Employee; - model.once('invalid', () => { }, this); - model.once('invalid', () => { }); - } - - function test_listenTo() { - var model = new Employee; - var view = new Backbone.View(); - view.listenTo(model, 'invalid', () => { }); - } - - function test_listenToOnce() { - var model = new Employee; - var view = new Backbone.View(); - view.listenToOnce(model, 'invalid', () => { }); - } - - function test_stopListening() { - var model = new Employee; - var view = new Backbone.View(); - view.stopListening(model, 'invalid', () => { }); - view.stopListening(model, 'invalid'); - view.stopListening(model); - } - } - - namespace ModelAndCollection { - function test_url() { - Employee.prototype.url = () => '/employees'; - EmployeeCollection.prototype.url = () => '/employees'; - } - - function test_parse() { - var model = new Employee(); - model.parse('{}', {}); - var collection = new EmployeeCollection; - collection.parse('{}', {}); - } - - function test_toJSON() { - var model = new Employee(); - model.toJSON({}); - var collection = new EmployeeCollection; - collection.toJSON({}); - } - - function test_sync() { - var model = new Employee(); - model.sync(); - var collection = new EmployeeCollection; - collection.sync(); - } - } - - namespace Model { - function test_validationError() { - var model = new Employee; - if (model.validationError) { - console.log('has validation errors'); - } - } - - function test_fetch() { - var model = new Employee({ id: 1 }); - model.fetch({ - success: () => { }, - error: () => { } - }); - } - - function test_set() { - var model = new Employee; - model.set({ name: 'JoeDoe', age: 21 }, { validate: false }); - model.set('name', 'JoeDoes', { validate: false }); - } - - function test_destroy() { - var model = new Employee; - model.destroy({ - wait: true, - success: (m?, response?, options?) => { }, - error: (m?, jqxhr?, options?) => { } - }); - - model.destroy({ - success: (m?, response?, options?) => { }, - error: (m?, jqxhr?) => { } - }); - - model.destroy({ - success: () => { }, - error: (m?, jqxhr?) => { } - }); - } - - function test_save() { - var model = new Employee; - - model.save({ - name: 'Joe Doe', - age: 21 - }, - { - wait: true, - validate: false, - success: (m?, response?, options?) => { }, - error: (m?, jqxhr?, options?) => { } - }); - - model.save({ - name: 'Joe Doe', - age: 21 - }, - { - success: () => { }, - error: (m?, jqxhr?) => { } - }); - } - - function test_validate() { - var model = new Employee; - - model.validate({ name: 'JoeDoe', age: 21 }, { validateAge: false }) - } - } - - namespace Collection { - function test_fetch() { - var collection = new EmployeeCollection; - collection.fetch({ reset: true }); - } - - function test_create() { - var collection = new EmployeeCollection; - var model = new Employee; - - collection.create(model, { - validate: false - }); - } - } - - namespace Router { - function test_navigate() { - var router = new Backbone.Router; - - router.navigate('/employees', { trigger: true }); - router.navigate('/employees', true); - } - } -} diff --git a/backbone/tsconfig.json b/backbone/tsconfig.json index 43a64b9e25..b4a63b9ef0 100644 --- a/backbone/tsconfig.json +++ b/backbone/tsconfig.json @@ -15,7 +15,6 @@ }, "files": [ "index.d.ts", - "backbone-tests.ts", - "backbone-with-lodash-tests.ts" + "backbone-tests.ts" ] } \ No newline at end of file diff --git a/bcryptjs/bcryptjs-tests.ts b/bcryptjs/bcryptjs-tests.ts index 83b67c17cc..cd91eb4896 100644 --- a/bcryptjs/bcryptjs-tests.ts +++ b/bcryptjs/bcryptjs-tests.ts @@ -3,6 +3,7 @@ import bcryptjs = require("bcryptjs"); let str: string; let num: number; let bool: boolean; +let error: Error; str = bcryptjs.genSaltSync(); str = bcryptjs.genSaltSync(10); @@ -13,6 +14,12 @@ bcryptjs.genSalt((err: Error, salt: string) => { bcryptjs.genSalt(10, (err: Error, salt: string) => { str = salt; }); +bcryptjs.genSalt() + .then(salt => str = salt) + .catch(err => error = err); +bcryptjs.genSalt(10) + .then(salt => str = salt) + .catch(err => error = err); str = bcryptjs.hashSync("string"); str = bcryptjs.hashSync("string", 10); @@ -26,6 +33,9 @@ bcryptjs.hash("string", 10, (err: Error, hash: string) => { }, (percent: number) => { num = percent; }); +bcryptjs.hash("string", 10) + .then(salt => str = salt) + .catch(err => error = err); bcryptjs.hash("string", "salt", (err: Error, hash: string) => { str = hash; @@ -46,6 +56,9 @@ bcryptjs.compare("string1", "string2", (err: Error, success: boolean) => { }, (percent: number) => { num = percent; }); +bcryptjs.compare("string1", "string2") + .then(success => bool = success) + .catch(err => error = err); num = bcryptjs.getRounds("string"); diff --git a/bcryptjs/index.d.ts b/bcryptjs/index.d.ts index fd1c0d7903..c081ed33fd 100644 --- a/bcryptjs/index.d.ts +++ b/bcryptjs/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for bcryptjs v2.3.0 +// Type definitions for bcryptjs v2.4.0 // Project: https://github.com/dcodeIO/bcrypt.js -// Definitions by: Joshua Filby +// Definitions by: Joshua Filby , Rafael Kraut // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -16,9 +16,17 @@ export declare function setRandomFallback(random: (random: number) => number[]): * Synchronously generates a salt. * @param rounds Number of rounds to use, defaults to 10 if omitted * @return Resulting salt + * @throws If a random fallback is required but not set */ export declare function genSaltSync(rounds?: number): string; +/** + * Asynchronously generates a salt. + * @param rounds Number of rounds to use, defaults to 10 if omitted + * @return Promise with resulting salt, if callback has been omitted + */ +export declare function genSalt(rounds?: number): Promise; + /** * Asynchronously generates a salt. * @param callback Callback receiving the error, if any, and the resulting salt @@ -40,6 +48,14 @@ export declare function genSalt(rounds: number, callback: (err: Error, salt: str */ export declare function hashSync(s: string, salt?: number | string): string; +/** + * Asynchronously generates a hash for the given string. + * @param s String to hash + * @param salt Salt length to generate or salt to use + * @return Promise with resulting hash, if callback has been omitted + */ +export declare function hash(s: string, salt: number | string): Promise; + /** * Asynchronously generates a hash for the given string. * @param s String to hash @@ -47,7 +63,7 @@ export declare function hashSync(s: string, salt?: number | string): string; * @param callback Callback receiving the error, if any, and the resulting hash * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms. */ -export declare function hash(s: string, salt: number | string, callback: (err: Error, hash: string) => void, progressCallback?: (percent: number) => void): void; +export declare function hash(s: string, salt: number | string, callback?: (err: Error, hash: string) => void, progressCallback?: (percent: number) => void): void; /** * Synchronously tests a string against a hash. @@ -57,6 +73,14 @@ export declare function hash(s: string, salt: number | string, callback: (err: E */ export declare function compareSync(s: string, hash: string): boolean; +/** + * Asynchronously compares the given data against the given hash. + * @param s Data to compare + * @param hash Data to be compared to + * @return Promise, if callback has been omitted + */ +export declare function compare(s: string, hash: string): Promise; + /** * Asynchronously compares the given data against the given hash. * @param s Data to compare @@ -64,7 +88,7 @@ export declare function compareSync(s: string, hash: string): boolean; * @param callback Callback receiving the error, if any, otherwise the result * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms. */ -export declare function compare(s: string, hash: string, callback: (err: Error, success: boolean) => void, progressCallback?: (percent: number) => void): void; +export declare function compare(s: string, hash: string, callback?: (err: Error, success: boolean) => void, progressCallback?: (percent: number) => void): void; /** * Gets the number of rounds used to encrypt the specified hash. diff --git a/bounce.js/bounce-tests.ts b/bounce.js/bounce.js-tests.ts similarity index 100% rename from bounce.js/bounce-tests.ts rename to bounce.js/bounce.js-tests.ts diff --git a/bounce.js/tsconfig.json b/bounce.js/tsconfig.json index d06c697a6b..1718271ef6 100644 --- a/bounce.js/tsconfig.json +++ b/bounce.js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "bounce-tests.ts" + "bounce.js-tests.ts" ] } \ No newline at end of file diff --git a/bowser/bowser-module-tests.ts b/bowser/bowser-module-tests.ts deleted file mode 100644 index 7d662b2f2b..0000000000 --- a/bowser/bowser-module-tests.ts +++ /dev/null @@ -1,9 +0,0 @@ - - -import Bowser = require('bowser'); - -Bowser.msedge === true; -Bowser.test(['msie']) === true; -Bowser.a === Bowser.c; -Bowser.osversion > 10; -Bowser.osversion === '10.1A'; \ No newline at end of file diff --git a/bowser/bowser-global-tests.ts b/bowser/bowser-tests.ts similarity index 100% rename from bowser/bowser-global-tests.ts rename to bowser/bowser-tests.ts diff --git a/bowser/tsconfig.json b/bowser/tsconfig.json index 60a6d8803f..70de6c837c 100644 --- a/bowser/tsconfig.json +++ b/bowser/tsconfig.json @@ -15,7 +15,6 @@ }, "files": [ "index.d.ts", - "bowser-module-tests.ts", - "bowser-global-tests.ts" + "bowser-tests.ts" ] } \ No newline at end of file diff --git a/box2d/box2dweb-tests.ts b/box2d/box2d-tests.ts similarity index 100% rename from box2d/box2dweb-tests.ts rename to box2d/box2d-tests.ts diff --git a/box2d/tsconfig.json b/box2d/tsconfig.json index 426500dcfd..d98f02a1c1 100644 --- a/box2d/tsconfig.json +++ b/box2d/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "box2dweb-tests.ts" + "box2d-tests.ts" ] } \ No newline at end of file diff --git a/chart.js/index.d.ts b/chart.js/index.d.ts index 3ef5919acf..7a7b05c714 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -62,7 +62,7 @@ declare namespace Chart { afterBody?: (item?: ChartTooltipItem[], data?: any) => void; beforeFooter?: (item?: ChartTooltipItem[], data?: any) => void; footer?: (item?: ChartTooltipItem[], data?: any) => void; - afterfooter?: (item?: ChartTooltipItem[], data?: any) => void; + afterFooter?: (item?: ChartTooltipItem[], data?: any) => void; } export interface ChartAnimationParameter { diff --git a/chartjs/chart-tests.ts b/chartjs/chartjs-tests.ts similarity index 100% rename from chartjs/chart-tests.ts rename to chartjs/chartjs-tests.ts diff --git a/chartjs/tsconfig.json b/chartjs/tsconfig.json index 5d31ea6aa4..e6b3a63e91 100644 --- a/chartjs/tsconfig.json +++ b/chartjs/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "chart-tests.ts" + "chartjs-tests.ts" ] } \ No newline at end of file diff --git a/chrome/chrome-app-tests.ts b/chrome/test/chrome-app.ts similarity index 100% rename from chrome/chrome-app-tests.ts rename to chrome/test/chrome-app.ts diff --git a/chrome/chrome-tests.ts b/chrome/test/index.ts similarity index 100% rename from chrome/chrome-tests.ts rename to chrome/test/index.ts diff --git a/chrome/tsconfig.json b/chrome/tsconfig.json index 385e3c3ccf..33947734d9 100644 --- a/chrome/tsconfig.json +++ b/chrome/tsconfig.json @@ -16,8 +16,8 @@ "files": [ "index.d.ts", "chrome-app.d.ts", - "chrome-app-tests.ts", "chrome-cast.d.ts", - "chrome-tests.ts" + "test/index.ts", + "test/chrome-app.ts" ] } \ No newline at end of file diff --git a/cldrjs/cldr.js-event-tests.ts b/cldrjs/test/event.ts similarity index 93% rename from cldrjs/cldr.js-event-tests.ts rename to cldrjs/test/event.ts index c626e72663..92e8d51b77 100644 --- a/cldrjs/cldr.js-event-tests.ts +++ b/cldrjs/test/event.ts @@ -1,5 +1,3 @@ -/// - Cldr.on("get", (path, value) => { console.log(path); console.log(value); diff --git a/cldrjs/cldr.js-tests.ts b/cldrjs/test/index.ts similarity index 100% rename from cldrjs/cldr.js-tests.ts rename to cldrjs/test/index.ts diff --git a/cldrjs/cldr.js-supplemental-tests.ts b/cldrjs/test/supplemental.ts similarity index 100% rename from cldrjs/cldr.js-supplemental-tests.ts rename to cldrjs/test/supplemental.ts diff --git a/cldrjs/tsconfig.json b/cldrjs/tsconfig.json index f7edc6e510..2d2559c670 100644 --- a/cldrjs/tsconfig.json +++ b/cldrjs/tsconfig.json @@ -16,8 +16,8 @@ "files": [ "index.d.ts", "cldr.js-supplemental.d.ts", - "cldr.js-tests.ts", - "cldr.js-event-tests.ts", - "cldr.js-supplemental-tests.ts" + "test/index.ts", + "test/event.ts", + "test/supplemental.ts" ] } \ No newline at end of file diff --git a/codemirror/codemirror-tests.ts b/codemirror/test/index.ts similarity index 100% rename from codemirror/codemirror-tests.ts rename to codemirror/test/index.ts diff --git a/codemirror/codemirror-matchbrackets-tests.ts b/codemirror/test/matchbrackets.ts similarity index 100% rename from codemirror/codemirror-matchbrackets-tests.ts rename to codemirror/test/matchbrackets.ts diff --git a/codemirror/codemirror-runmode-tests.ts b/codemirror/test/runmode.ts similarity index 100% rename from codemirror/codemirror-runmode-tests.ts rename to codemirror/test/runmode.ts diff --git a/codemirror/searchcursor-tests.ts b/codemirror/test/searchcursor.ts similarity index 100% rename from codemirror/searchcursor-tests.ts rename to codemirror/test/searchcursor.ts diff --git a/codemirror/codemirror-showhint-tests.ts b/codemirror/test/showhint.ts similarity index 100% rename from codemirror/codemirror-showhint-tests.ts rename to codemirror/test/showhint.ts diff --git a/codemirror/tsconfig.json b/codemirror/tsconfig.json index 6b0d828cdc..01c0253447 100644 --- a/codemirror/tsconfig.json +++ b/codemirror/tsconfig.json @@ -15,14 +15,14 @@ }, "files": [ "index.d.ts", - "codemirror-tests.ts", "codemirror-matchbrackets.d.ts", - "codemirror-matchbrackets-tests.ts", "codemirror-runmode.d.ts", - "codemirror-runmode-tests.ts", "codemirror-showhint.d.ts", - "codemirror-showhint-tests.ts", "searchcursor.d.ts", - "searchcursor-tests.ts" + "test/index.ts", + "test/matchbrackets.ts", + "test/runmode.ts", + "test/searchcursor.ts", + "test/showhint.ts" ] } \ No newline at end of file diff --git a/concat-stream/concat-stream-tests.ts b/concat-stream/concat-stream-tests.ts new file mode 100644 index 0000000000..6dac3129f0 --- /dev/null +++ b/concat-stream/concat-stream-tests.ts @@ -0,0 +1,20 @@ +import concat = require("concat-stream") + +import { Readable } from "stream"; + +class MyReadable extends Readable { + i: number = 1; + _read() { + if (this.i <= 100) { + this.push(this.i.toString()); + this.i++; + } else { + this.push(null); + } + } +} + +let myReadable = new MyReadable(); + +myReadable.pipe(concat((buf) => console.log(buf.toString()))); +myReadable.pipe(concat({}, (buf) => console.log(buf.toString()))); diff --git a/concat-stream/index.d.ts b/concat-stream/index.d.ts new file mode 100644 index 0000000000..578a3e48b8 --- /dev/null +++ b/concat-stream/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for concat-stream 1.6 +// Project: https://github.com/maxogden/concat-stream +// Definitions by: Joey Marianer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Writable } from "stream"; + +interface ConcatOpts { + encoding?: string; +} + +declare function concat(cb: (buf: Buffer) => void): Writable; +declare function concat(opts: ConcatOpts, cb: (buf: Buffer) => void): Writable; + +export = concat; diff --git a/concat-stream/tsconfig.json b/concat-stream/tsconfig.json new file mode 100644 index 0000000000..3e6c0e2260 --- /dev/null +++ b/concat-stream/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "concat-stream-tests.ts" + ] +} diff --git a/concat-stream/tslint.json b/concat-stream/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/concat-stream/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/cybozulabs-md5/CybozuLabs-md5-tests.ts b/cybozulabs-md5/cybozulabs-md5-tests.ts similarity index 100% rename from cybozulabs-md5/CybozuLabs-md5-tests.ts rename to cybozulabs-md5/cybozulabs-md5-tests.ts diff --git a/cybozulabs-md5/tsconfig.json b/cybozulabs-md5/tsconfig.json index 68a7e48345..37774f4c4e 100644 --- a/cybozulabs-md5/tsconfig.json +++ b/cybozulabs-md5/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "CybozuLabs-md5-tests.ts" + "cybozulabs-md5-tests.ts" ] } \ No newline at end of file diff --git a/date.format.js/date.format-tests.ts b/date.format.js/date.format.js-tests.ts similarity index 100% rename from date.format.js/date.format-tests.ts rename to date.format.js/date.format.js-tests.ts diff --git a/date.format.js/tsconfig.json b/date.format.js/tsconfig.json index ab30747450..794c0f0e15 100644 --- a/date.format.js/tsconfig.json +++ b/date.format.js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "date.format-tests.ts" + "date.format.js-tests.ts" ] } \ No newline at end of file diff --git a/deployjava/deployJava-tests.ts b/deployjava/deployjava-tests.ts similarity index 100% rename from deployjava/deployJava-tests.ts rename to deployjava/deployjava-tests.ts diff --git a/deployjava/tsconfig.json b/deployjava/tsconfig.json index 5cf5fed9e5..ffd4d28173 100644 --- a/deployjava/tsconfig.json +++ b/deployjava/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "deployJava-tests.ts" + "deployjava-tests.ts" ] } \ No newline at end of file diff --git a/doccookies/docCookies-tests.ts b/doccookies/doccookies-tests.ts similarity index 100% rename from doccookies/docCookies-tests.ts rename to doccookies/doccookies-tests.ts diff --git a/doccookies/tsconfig.json b/doccookies/tsconfig.json index c6572494b3..ef167447be 100644 --- a/doccookies/tsconfig.json +++ b/doccookies/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "docCookies-tests.ts" + "doccookies-tests.ts" ] } \ No newline at end of file diff --git a/dragula/index.d.ts b/dragula/index.d.ts index 98ff1f3108..fe09c409e2 100644 --- a/dragula/index.d.ts +++ b/dragula/index.d.ts @@ -16,7 +16,7 @@ declare namespace dragula { accepts?: (el?: Element, target?: Element, source?: Element, sibling?: Element) => boolean; invalid?: (el?: Element, target?: Element) => boolean; direction?: string; - copy?: boolean; + copy?: ((el: Element, source: Element) => boolean) | boolean; revertOnSpill?: boolean; removeOnSpill?: boolean; delay?: boolean | number; diff --git a/duplexer2/duplexer2-tests.ts b/duplexer2/duplexer2-tests.ts new file mode 100644 index 0000000000..d611b69144 --- /dev/null +++ b/duplexer2/duplexer2-tests.ts @@ -0,0 +1,33 @@ +import stream = require("stream"); +import duplexer2 = require("duplexer2"); + +let writable = new stream.Writable({ objectMode: true }), + readable = new stream.Readable({ objectMode: true }); + +writable.once("finish", () => { + setTimeout(() => { + readable.push(null); + }, 500); +}); + +let duplex = duplexer2(writable, readable); + +duplex.on("data", (e: any) => { + console.log("got data", JSON.stringify(e)); +}); + +duplex.on("finish", () => { + console.log("got finish event"); +}); + +duplex.on("end", () => { + console.log("got end event"); +}); + +duplex.write("oh, hi there", () => { + console.log("finished writing"); +}); + +duplex.end("", () => { + console.log("finished ending"); +}); \ No newline at end of file diff --git a/duplexer2/index.d.ts b/duplexer2/index.d.ts new file mode 100644 index 0000000000..a8b5e4c3a8 --- /dev/null +++ b/duplexer2/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for duplexer2 0.1 +// Project: https://github.com/deoxxa/duplexer2 +// Definitions by: Zlatko Andonovski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// Definition file started by dts-gen + +/// + +declare function duplexer2(options: {bubbleErrors: boolean}, writable: NodeJS.WritableStream, readable: NodeJS.ReadableStream): NodeJS.ReadWriteStream; +declare function duplexer2(writable: NodeJS.WritableStream, readable: NodeJS.ReadableStream): NodeJS.ReadWriteStream; + +export = duplexer2; diff --git a/duplexer2/tsconfig.json b/duplexer2/tsconfig.json new file mode 100644 index 0000000000..61d21210f6 --- /dev/null +++ b/duplexer2/tsconfig.json @@ -0,0 +1,20 @@ +{ + "files": [ + "index.d.ts", + "duplexer2-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "noImplicitThis": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file diff --git a/duplexer2/tslint.json b/duplexer2/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/duplexer2/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/elasticsearch/elasticsearch-tests.ts b/elasticsearch/elasticsearch-tests.ts index c9be3c01ef..98d5a6c925 100644 --- a/elasticsearch/elasticsearch-tests.ts +++ b/elasticsearch/elasticsearch-tests.ts @@ -32,6 +32,11 @@ client.indices.delete({ }, function (error) { }); +client.create({ + index: 'index', + type: 'type' +}); + client.create({ id: '123', index: 'index', diff --git a/elasticsearch/index.d.ts b/elasticsearch/index.d.ts index f3ac0992c6..6558c94f2f 100644 --- a/elasticsearch/index.d.ts +++ b/elasticsearch/index.d.ts @@ -195,7 +195,7 @@ declare module Elasticsearch { version?: number; versionType?: VersionType; pipeline?: string; - id: string; + id?: string; index: string; type: string; } diff --git a/electron/electron-tests.ts b/electron/test/index.ts similarity index 100% rename from electron/electron-tests.ts rename to electron/test/index.ts diff --git a/electron/github-electron-main-tests.ts b/electron/test/main.ts similarity index 100% rename from electron/github-electron-main-tests.ts rename to electron/test/main.ts diff --git a/electron/github-electron-renderer-tests.ts b/electron/test/renderer.ts similarity index 100% rename from electron/github-electron-renderer-tests.ts rename to electron/test/renderer.ts diff --git a/electron/tsconfig.json b/electron/tsconfig.json index 79c504aade..8b0d4b6952 100644 --- a/electron/tsconfig.json +++ b/electron/tsconfig.json @@ -15,8 +15,8 @@ }, "files": [ "index.d.ts", - "electron-tests.ts", - "github-electron-renderer-tests.ts", - "github-electron-main-tests.ts" + "test/index.ts", + "test/main.ts", + "test/renderer.ts" ] } \ No newline at end of file diff --git a/ember/v1/tsconfig.json b/ember/v1/tsconfig.json index 04fdc535c5..2354a6e4db 100644 --- a/ember/v1/tsconfig.json +++ b/ember/v1/tsconfig.json @@ -11,7 +11,7 @@ ], "types": [], "paths": { - "ember": ["ember/v0"] + "ember": ["ember/v1"] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/enhanced-resolve/enhanced-resolve-tests.ts b/enhanced-resolve/test/index.ts similarity index 100% rename from enhanced-resolve/enhanced-resolve-tests.ts rename to enhanced-resolve/test/index.ts diff --git a/enhanced-resolve/lib/lib-tests.ts b/enhanced-resolve/test/lib.ts similarity index 100% rename from enhanced-resolve/lib/lib-tests.ts rename to enhanced-resolve/test/lib.ts diff --git a/enhanced-resolve/tsconfig.json b/enhanced-resolve/tsconfig.json index 5bd29396ab..b1a5b475ef 100644 --- a/enhanced-resolve/tsconfig.json +++ b/enhanced-resolve/tsconfig.json @@ -15,7 +15,6 @@ }, "files": [ "index.d.ts", - "enhanced-resolve-tests.ts", "lib/AliasFieldPlugin.d.ts", "lib/AliasPlugin.d.ts", "lib/AppendPlugin.d.ts", @@ -33,7 +32,6 @@ "lib/getPaths.d.ts", "lib/globToRegExp.d.ts", "lib/JoinRequestPlugin.d.ts", - "lib/lib-tests.ts", "lib/LogInfoPlugin.d.ts", "lib/MainFieldPlugin.d.ts", "lib/ModuleAppendPlugin.d.ts", @@ -49,6 +47,8 @@ "lib/SyncAsyncFileSystemDecorator.d.ts", "lib/TryNextPlugin.d.ts", "lib/UnsafeCachePlugin.d.ts", - "lib/UseFilePlugin.d.ts" + "lib/UseFilePlugin.d.ts", + "test/index.ts", + "test/lib.ts" ] } diff --git a/fabric/fabricjs-tests.ts b/fabric/fabric-tests.ts similarity index 100% rename from fabric/fabricjs-tests.ts rename to fabric/fabric-tests.ts diff --git a/fabric/tsconfig.json b/fabric/tsconfig.json index fe93e260b9..60921d5263 100644 --- a/fabric/tsconfig.json +++ b/fabric/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "fabricjs-tests.ts" + "fabric-tests.ts" ] } \ No newline at end of file diff --git a/falcor/falcor-browser-tests.ts b/falcor/test/browser.ts similarity index 100% rename from falcor/falcor-browser-tests.ts rename to falcor/test/browser.ts diff --git a/falcor/falcor-tests.ts b/falcor/test/index.ts similarity index 100% rename from falcor/falcor-tests.ts rename to falcor/test/index.ts diff --git a/falcor/tsconfig.json b/falcor/tsconfig.json index 1709a8a627..d81a60d4ee 100644 --- a/falcor/tsconfig.json +++ b/falcor/tsconfig.json @@ -15,7 +15,7 @@ }, "files": [ "index.d.ts", - "falcor-tests.ts", - "falcor-browser-tests.ts" + "test/index.ts", + "test/browser.ts" ] } \ No newline at end of file diff --git a/fb/fbsdk-tests.ts b/fb/fb-tests.ts similarity index 100% rename from fb/fbsdk-tests.ts rename to fb/fb-tests.ts diff --git a/fb/tsconfig.json b/fb/tsconfig.json index f99ae7bb46..a04f48e410 100644 --- a/fb/tsconfig.json +++ b/fb/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "fbsdk-tests.ts" + "fb-tests.ts" ] } \ No newline at end of file diff --git a/fetch-mock/fetch-mock-tests.ts b/fetch-mock/fetch-mock-tests.ts index 2f0080ebac..f16aab11c9 100644 --- a/fetch-mock/fetch-mock-tests.ts +++ b/fetch-mock/fetch-mock-tests.ts @@ -4,12 +4,13 @@ fetchMock.mock("http://test.com", 200); fetchMock.mock(/test\.com/, 200); fetchMock.mock(() => true, 200); fetchMock.mock((url, opts) => true, 200); +fetchMock.once("http://test.com", 200); fetchMock.mock(/test/, "test").mock(/test/, { a: "b" }); fetchMock.mock(/test/, { status: 200, headers: { - "test": "test" + test: "test" }, body: { a: "b" @@ -23,20 +24,39 @@ fetchMock.calls().unmatched[0][0].toUpperCase(); fetchMock.calls("http://test.com")[0][0].toUpperCase(); (fetchMock.calls("http://test.com")[0][1] as RequestInit).body; -fetchMock.called("http://test.com"); +let doneStatus: boolean = fetchMock.done(); +let doneStatusArguments: boolean = fetchMock.done("http://test.com"); + +let calledStatus: boolean = fetchMock.called(); +let calledStatusArguments = fetchMock.called("http://test.com"); (fetchMock.lastCall()[1] as RequestInit).body; -fetchMock.lastUrl(); +let lastUrl: string = fetchMock.lastUrl(); fetchMock.lastOptions(); -fetchMock.get("http://test.com", 200) -fetchMock.post("http://test.com", 200) -fetchMock.put("http://test.com", 200) -fetchMock.delete("http://test.com", 200) -fetchMock.head("http://test.com", 200) +fetchMock.get("http://test.com", 200); +fetchMock.getOnce("http://test.com", 200); +fetchMock.post("http://test.com", 200); +fetchMock.postOnce("http://test.com", 200); +fetchMock.put("http://test.com", 200); +fetchMock.putOnce("http://test.com", 200); +fetchMock.delete("http://test.com", 200); +fetchMock.deleteOnce("http://test.com", 200); +fetchMock.head("http://test.com", 200); +fetchMock.headOnce("http://test.com", 200); +fetchMock.patch("http://test.com", 200); +fetchMock.patchOnce("http://test.com", 200); -fetchMock.get("http://test.com", 200, {method: "GET"}) -fetchMock.post("http://test.com", 200, {method: "POST"}) -fetchMock.put("http://test.com", 200, {method: "PUT"}) -fetchMock.delete("http://test.com", 200, {method: "DELETE"}) -fetchMock.head("http://test.com", 200, {method: "HEAD"}) +fetchMock.get("http://test.com", 200, {method: "GET"}); +fetchMock.post("http://test.com", 200, {method: "POST"}); +fetchMock.put("http://test.com", 200, {method: "PUT"}); +fetchMock.delete("http://test.com", 200, {method: "DELETE"}); +fetchMock.head("http://test.com", 200, {method: "HEAD"}); + +fetchMock + .mock("http://test.com", 200) + .catch(503); + +fetchMock + .mock("http://test.com", 200) + .spy(); diff --git a/fetch-mock/index.d.ts b/fetch-mock/index.d.ts index cda0b2539f..4d69096845 100644 --- a/fetch-mock/index.d.ts +++ b/fetch-mock/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for fetch-mock 5.0.0 +// Type definitions for fetch-mock 5.8 // Project: https://github.com/wheresrhys/fetch-mock -// Definitions by: Alexey Svetliakov , Tamir Duberstein +// Definitions by: Alexey Svetliakov , Tamir Duberstein , Risto Keravuori // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -11,7 +11,7 @@ type MockRequest = Request | RequestInit; * @param url * @param opts */ -type MockMatcherFunction = (url: string, opts: MockRequest) => boolean +type MockMatcherFunction = (url: string, opts: MockRequest) => boolean; /** * Mock matcher. Can be one of following: * string: Either @@ -69,7 +69,7 @@ interface MockResponseObject { type MockResponse = Response | Promise | number | Promise | string | Promise - | Object | Promise + | {} | Promise<{}> | MockResponseObject | Promise; /** * Mock response function @@ -104,33 +104,41 @@ interface MockOptions { * as specified above */ response?: MockResponse | MockResponseFunction; + /** + * integer, n, limiting the number of times the matcher can be used. + If the route has already been called n times the route will be + ignored and the call to fetch() will fall through to be handled by + any other routes defined (which may eventually result in an error + if nothing matches it). + */ + times?: number; } type MockCall = [string, MockRequest]; interface MatchedRoutes { - matched: Array; - unmatched: Array; + matched: MockCall[]; + unmatched: MockCall[]; } interface MockOptionsMethodGet extends MockOptions { - method: 'GET' + method: 'GET'; } interface MockOptionsMethodPost extends MockOptions { - method: 'POST' + method: 'POST'; } interface MockOptionsMethodPut extends MockOptions { - method: 'PUT' + method: 'PUT'; } interface MockOptionsMethodDelete extends MockOptions { - method: 'DELETE' + method: 'DELETE'; } interface MockOptionsMethodHead extends MockOptions { - method: 'HEAD' + method: 'HEAD'; } interface FetchMockStatic { @@ -140,17 +148,9 @@ interface FetchMockStatic { call through to fetch(). Calls to .mock() can be chained. * @param matcher Condition for selecting which requests to mock * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock */ - mock(matcher: MockMatcher, response: MockResponse | MockResponseFunction): this; - /** - * Replaces fetch() with a stub which records its calls, grouped by - route, and optionally returns a mocked Response object or passes the - call through to fetch(). Calls to .mock() can be chained. - * @param matcher Condition for selecting which requests to mock - * @param response Configures the http response returned by the mock - * @param options Additional properties defining the route to mock - */ - mock(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options: MockOptions): this; + mock(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options?: MockOptions): this; /** * Replaces fetch() with a stub which records its calls, grouped by route, and optionally returns a mocked Response object or passes the @@ -158,65 +158,180 @@ interface FetchMockStatic { * @param options The route to mock */ mock(options: MockOptions): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + route, and optionally returns a mocked Response object or passes the + call through to fetch(). Shorthand for mock() limited to being + called one time only. Calls to .once() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Optional additional properties defining the route to mock + */ + once(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options?: MockOptions): this; + /** * Replaces fetch() with a stub which records its calls, grouped by route, and optionally returns a mocked Response object or passes the call through to fetch(). Shorthand for mock() restricted to the GET - method. Calls to .mock() can be chained. + method. Calls to .get() can be chained. * @param matcher Condition for selecting which requests to mock * @param response Configures the http response returned by the mock * @param [options] Additional properties defining the route to mock */ get(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodGet): this; + /** + * Replaces fetch() with a stub which records its calls, grouped by + route, and optionally returns a mocked Response object or passes the + call through to fetch(). Shorthand for mock() restricted to the GET + method and limited to being called one time only. Calls to .getOnce() + can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + getOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodGet): this; + /** * Replaces fetch() with a stub which records its calls, grouped by route, and optionally returns a mocked Response object or passes the call through to fetch(). Shorthand for mock() restricted to the POST - method. Calls to .mock() can be chained. + method. Calls to .post() can be chained. * @param matcher Condition for selecting which requests to mock * @param response Configures the http response returned by the mock * @param [options] Additional properties defining the route to mock */ post(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPost): this; + /** + * Replaces fetch() with a stub which records its calls, grouped by + route, and optionally returns a mocked Response object or passes the + call through to fetch(). Shorthand for mock() restricted to the POST + method and limited to being called one time only. Calls to .postOnce() + can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + postOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPost): this; + /** * Replaces fetch() with a stub which records its calls, grouped by route, and optionally returns a mocked Response object or passes the call through to fetch(). Shorthand for mock() restricted to the PUT - method. Calls to .mock() can be chained. + method. Calls to .put() can be chained. * @param matcher Condition for selecting which requests to mock * @param response Configures the http response returned by the mock * @param [options] Additional properties defining the route to mock */ put(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPut): this; + /** + * Replaces fetch() with a stub which records its calls, grouped by + route, and optionally returns a mocked Response object or passes the + call through to fetch(). Shorthand for mock() restricted to the PUT + method and limited to being called one time only. Calls to .putOnce() + can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + putOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPut): this; + /** * Replaces fetch() with a stub which records its calls, grouped by route, and optionally returns a mocked Response object or passes the call through to fetch(). Shorthand for mock() restricted to the - DELETE method. Calls to .mock() can be chained. + DELETE method. Calls to .delete() can be chained. * @param matcher Condition for selecting which requests to mock * @param response Configures the http response returned by the mock * @param [options] Additional properties defining the route to mock */ delete(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodDelete): this; + /** + * Replaces fetch() with a stub which records its calls, grouped by + route, and optionally returns a mocked Response object or passes the + call through to fetch(). Shorthand for mock() restricted to the + DELETE method and limited to being called one time only. Calls to + .deleteOnce() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + deleteOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodDelete): this; + /** * Replaces fetch() with a stub which records its calls, grouped by route, and optionally returns a mocked Response object or passes the call through to fetch(). Shorthand for mock() restricted to the HEAD - method. Calls to .mock() can be chained. + method. Calls to .head() can be chained. * @param matcher Condition for selecting which requests to mock * @param response Configures the http response returned by the mock * @param [options] Additional properties defining the route to mock */ head(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; + /** + * Replaces fetch() with a stub which records its calls, grouped by + route, and optionally returns a mocked Response object or passes the + call through to fetch(). Shorthand for mock() restricted to the HEAD + method and limited to being called one time only. Calls to .headOnce() + can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + headOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + route, and optionally returns a mocked Response object or passes the + call through to fetch(). Shorthand for mock() restricted to the PATCH + method. Calls to .patch() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + patch(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; + /** + * Replaces fetch() with a stub which records its calls, grouped by + route, and optionally returns a mocked Response object or passes the + call through to fetch(). Shorthand for mock() restricted to the PATCH + method and limited to being called one time only. Calls to .patchOnce() + can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + patchOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; + + /** + * Chainable method that defines how to respond to calls to fetch that + don't match any of the defined mocks. It accepts the same types of + response as a normal call to .mock(matcher, response). It can also + take an arbitrary function to completely customise behaviour of + unmatched calls. If .catch() is called without any parameters then + every unmatched call will receive a 200 response. + * @param [response] Configures the http response returned by the mock + */ + catch(response?: MockResponse | MockResponseFunction): this; + + /** + * Chainable method that records the call history of unmatched calls, + but instead of responding with a stubbed response, the request is + passed through to native fetch() and is allowed to communicate + over the network. Similar to catch(). + */ + spy(response?: MockResponse | MockResponseFunction): this; + /** * Chainable method that restores fetch() to its unstubbed state and clears all data recorded for its calls. */ restore(): this; + /** * Chainable method that clears all data recorded for fetch()'s calls */ reset(): this; + /** * Returns all calls to fetch, grouped by whether fetch-mock matched them or not. @@ -225,42 +340,50 @@ interface FetchMockStatic { /** * Returns all calls to fetch matching matcherName. */ - calls(matcherName?: string): Array; + calls(matcherName?: string): MockCall[]; + /** * Returns a Boolean indicating whether fetch was called and a route - was matched. - */ - called(): boolean; - /** - * Returns a Boolean indicating whether fetch was called and a route - named matcherName was matched. + was matched (or a specific route if matcherName is passed). + * @param [matcherName] either the name of a route or equal to + matcher.toString() for any unnamed route */ called(matcherName?: string): boolean; + /** - * Returns the arguments for the last matched call to fetch - */ - lastCall(): MockCall; - /** - * Returns the arguments for the last call to fetch matching - matcherName + * Returns a Boolean indicating whether fetch was called the expected + number of times (or at least once if the route defines no expectation + is set) for every route (or for a specific route if matcherName is + passed). + * @param [matcherName] either the name of a route or equal to + matcher.toString() for any unnamed route */ - lastCall(matcherName?: string): MockCall; + done(matcherName?: string): boolean; + /** - * Returns the url for the last matched call to fetch + * Returns the arguments for the last matched call to fetch (or the + last call to specific route is matcherName is passed). + * @param [matcherName] either the name of a route or equal to + matcher.toString() for any unnamed route */ - lastUrl(): string; + lastCall(matcherName?: string): MockCall; + /** - * Returns the url for the last call to fetch matching matcherName + * Returns the url for the last matched call to fetch (or the last + call to specific route is matcherName is passed). + * @param [matcherName] either the name of a route or equal to + matcher.toString() for any unnamed route */ lastUrl(matcherName?: string): string; + /** - * Returns the options for the last matched call to fetch - */ - lastOptions(): MockRequest; - /** - * Returns the options for the last call to fetch matching matcherName + * Returns the options for the last matched call to fetch (or the + last call to a specific route is matcherName is passed). + * @param [matcherName] either the name of a route or equal to + matcher.toString() for any unnamed route */ lastOptions(matcherName?: string): MockRequest; + /** * Set some global config options, which include * sendAsJson [default `true`] - by default fetchMock will @@ -268,7 +391,7 @@ interface FetchMockStatic { for each call but for some scenarios, e.g. when dealing with a lot of array buffers, it can be useful to default to `false` */ - configure(opts: Object): void; + configure(opts: {}): void; } declare var fetchMock: FetchMockStatic; diff --git a/fetch-mock/tslint.json b/fetch-mock/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/fetch-mock/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/ffi/node-ffi-tests.ts b/ffi/ffi-tests.ts similarity index 100% rename from ffi/node-ffi-tests.ts rename to ffi/ffi-tests.ts diff --git a/ffi/tsconfig.json b/ffi/tsconfig.json index df00f708f8..45c991ece0 100644 --- a/ffi/tsconfig.json +++ b/ffi/tsconfig.json @@ -16,6 +16,6 @@ "files": [ "index.d.ts", "node-ffi-buffer.d.ts", - "node-ffi-tests.ts" + "ffi-tests.ts" ] } \ No newline at end of file diff --git a/file-saver/FileSaver-tests.ts b/file-saver/file-saver-tests.ts similarity index 100% rename from file-saver/FileSaver-tests.ts rename to file-saver/file-saver-tests.ts diff --git a/file-saver/tsconfig.json b/file-saver/tsconfig.json index 0ff18d9918..8aa772455a 100644 --- a/file-saver/tsconfig.json +++ b/file-saver/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "FileSaver-tests.ts" + "file-saver-tests.ts" ] } \ No newline at end of file diff --git a/finch/Finch-tests.ts b/finch/finch-tests.ts similarity index 100% rename from finch/Finch-tests.ts rename to finch/finch-tests.ts diff --git a/finch/tsconfig.json b/finch/tsconfig.json index 990f0265d9..1ffe7db57e 100644 --- a/finch/tsconfig.json +++ b/finch/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "Finch-tests.ts" + "finch-tests.ts" ] } \ No newline at end of file diff --git a/fingerprintjs/fingerprint-tests.ts b/fingerprintjs/fingerprintjs-tests.ts similarity index 100% rename from fingerprintjs/fingerprint-tests.ts rename to fingerprintjs/fingerprintjs-tests.ts diff --git a/fingerprintjs/tsconfig.json b/fingerprintjs/tsconfig.json index c1a7922d8f..146b0b572e 100644 --- a/fingerprintjs/tsconfig.json +++ b/fingerprintjs/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "fingerprint-tests.ts" + "fingerprintjs-tests.ts" ] } \ No newline at end of file diff --git a/firebase/firebase-tests.ts b/firebase/test/index.ts similarity index 100% rename from firebase/firebase-tests.ts rename to firebase/test/index.ts diff --git a/firebase/firebase-simplelogin-tests.ts b/firebase/test/simplelogin.ts similarity index 100% rename from firebase/firebase-simplelogin-tests.ts rename to firebase/test/simplelogin.ts diff --git a/firebase/tsconfig.json b/firebase/tsconfig.json index ead8399d7a..38c3bea3d5 100644 --- a/firebase/tsconfig.json +++ b/firebase/tsconfig.json @@ -16,7 +16,7 @@ "files": [ "index.d.ts", "firebase-simplelogin.d.ts", - "firebase-tests.ts", - "firebase-simplelogin-tests.ts" + "test/index.ts", + "test/simplelogin.ts" ] } \ No newline at end of file diff --git a/flexslider/flexSlider-tests.ts b/flexslider/flexslider-tests.ts similarity index 100% rename from flexslider/flexSlider-tests.ts rename to flexslider/flexslider-tests.ts diff --git a/flexslider/tsconfig.json b/flexslider/tsconfig.json index 2319b11528..e856d242c2 100644 --- a/flexslider/tsconfig.json +++ b/flexslider/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "flexSlider-tests.ts" + "flexslider-tests.ts" ] } \ No newline at end of file diff --git a/flux/index.d.ts b/flux/index.d.ts index 252d1c7920..4b9c261040 100644 --- a/flux/index.d.ts +++ b/flux/index.d.ts @@ -1,11 +1,10 @@ -// Type definitions for Flux +// Type definitions for Flux 3.0 // Project: http://facebook.github.io/flux/ // Definitions by: Steve Baker , Giedrius Grabauskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// /// -/// export = Flux; diff --git a/flux/package.json b/flux/package.json deleted file mode 100644 index aa7d5773ad..0000000000 --- a/flux/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "immutable": "^3.8.1" - } -} diff --git a/flux/utils/index.d.ts b/flux/utils/index.d.ts index d69a6f1e55..b223945181 100644 --- a/flux/utils/index.d.ts +++ b/flux/utils/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Flux Utils +// Type definitions for Flux Utils 3.0 // Project: http://facebook.github.io/flux/ // Definitions by: Steve Baker , Giedrius Grabauskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,12 +6,10 @@ /// /// /// -/// import * as React from 'react'; import * as Flux from 'flux'; import * as fbEmitter from 'fbemitter'; -import * as immutable from 'immutable'; export = FluxUtils; @@ -34,6 +32,12 @@ declare namespace FluxUtils { * @type {boolean} */ withProps?: boolean; + /** + * Default value: false + * + * @type {boolean} + */ + withContext?: boolean; } export class Container { @@ -44,35 +48,18 @@ declare namespace FluxUtils { * The provided base class must have static methods getStores() and calculateState(). */ static create(base: React.ComponentClass, options?: RealOptions): React.ComponentClass; - } - /** - * This class extends ReduceStore and defines the state as an immutable map. - */ - export class MapStore extends ReduceStore, TPayload> { - /** - * Access the value at the given key. - * Throws an error if the key does not exist in the cache. - */ - at(key: K): V; + /** - * Check if the cache has a particular key - */ - has(key: K): boolean; - - /** - * Get the value of a particular key. - * Returns undefined if the key does not exist in the cache. - */ - get(key: K): V; - - /** - * Gets an array of keys and puts the values in a map if they exist, - * it allows providing a previous result to update instead of generating a new map. - * Providing a previous result allows the possibility of keeping the same reference if the keys did not change. - */ - getAll(keys: immutable.Iterable.Indexed, prev?: immutable.Map): immutable.Map; + * This is a way to connect stores to a functional stateless view + */ + static createFunctional( + viewFn: (props: State) => React.ReactElement, + getStores: (props?: Props, context?: any) => FluxUtils.Store[], + calculateState: (prevState?: State, props?: Props, context?: any) => State, + options?: RealOptions + ): React.ComponentClass; } export class ReduceStore extends Store { diff --git a/format-unicorn/format-unicorn-tests.ts b/format-unicorn/test/index.ts similarity index 100% rename from format-unicorn/format-unicorn-tests.ts rename to format-unicorn/test/index.ts diff --git a/format-unicorn/format-unicorn-safe-tests.ts b/format-unicorn/test/safe.ts similarity index 100% rename from format-unicorn/format-unicorn-safe-tests.ts rename to format-unicorn/test/safe.ts diff --git a/format-unicorn/tsconfig.json b/format-unicorn/tsconfig.json index 2c82afbd5b..45bb7c114e 100644 --- a/format-unicorn/tsconfig.json +++ b/format-unicorn/tsconfig.json @@ -16,7 +16,7 @@ "files": [ "index.d.ts", "safe.d.ts", - "format-unicorn-tests.ts", - "format-unicorn-safe-tests.ts" + "test/index.ts", + "test/safe.ts" ] } \ No newline at end of file diff --git a/fullcalendar/fullCalendar-tests.ts b/fullcalendar/fullcalendar-tests.ts similarity index 100% rename from fullcalendar/fullCalendar-tests.ts rename to fullcalendar/fullcalendar-tests.ts diff --git a/fullcalendar/tsconfig.json b/fullcalendar/tsconfig.json index b8ea18f909..2d26610a8c 100644 --- a/fullcalendar/tsconfig.json +++ b/fullcalendar/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "fullCalendar-tests.ts" + "fullcalendar-tests.ts" ] } \ No newline at end of file diff --git a/fullcalendar/v1/fullCalendar-tests.ts b/fullcalendar/v1/fullcalendar-tests.ts similarity index 100% rename from fullcalendar/v1/fullCalendar-tests.ts rename to fullcalendar/v1/fullcalendar-tests.ts diff --git a/fullcalendar/v1/tsconfig.json b/fullcalendar/v1/tsconfig.json index a589491226..bf820ac863 100644 --- a/fullcalendar/v1/tsconfig.json +++ b/fullcalendar/v1/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "fullCalendar-tests.ts" + "fullcalendar-tests.ts" ] } \ No newline at end of file diff --git a/get-stdin/index-tests.ts b/get-stdin/get-stdin-tests.ts similarity index 100% rename from get-stdin/index-tests.ts rename to get-stdin/get-stdin-tests.ts diff --git a/get-stdin/tsconfig.json b/get-stdin/tsconfig.json index 3d8c032420..2d3c1a6c70 100644 --- a/get-stdin/tsconfig.json +++ b/get-stdin/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "index-tests.ts" + "get-stdin-tests.ts" ] } \ No newline at end of file diff --git a/git/node-git-tests.ts b/git/git-tests.ts similarity index 100% rename from git/node-git-tests.ts rename to git/git-tests.ts diff --git a/git/tsconfig.json b/git/tsconfig.json index 0bc0ff5fe6..eccbc2065b 100644 --- a/git/tsconfig.json +++ b/git/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "node-git-tests.ts" + "git-tests.ts" ] } \ No newline at end of file diff --git a/go/goJS-tests.ts b/go/go-tests.ts similarity index 100% rename from go/goJS-tests.ts rename to go/go-tests.ts diff --git a/go/tsconfig.json b/go/tsconfig.json index ced78ef938..cd76eca117 100644 --- a/go/tsconfig.json +++ b/go/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "goJS-tests.ts" + "go-tests.ts" ] } \ No newline at end of file diff --git a/google.analytics/ga-tests.ts b/google.analytics/google.analytics-tests.ts similarity index 100% rename from google.analytics/ga-tests.ts rename to google.analytics/google.analytics-tests.ts diff --git a/google.analytics/tsconfig.json b/google.analytics/tsconfig.json index ddce77f25e..b954b6f821 100644 --- a/google.analytics/tsconfig.json +++ b/google.analytics/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "ga-tests.ts" + "google.analytics-tests.ts" ] } \ No newline at end of file diff --git a/googlemaps.infobubble/google.maps.infobubble-tests.ts b/googlemaps.infobubble/googlemaps.infobubble-tests.ts similarity index 100% rename from googlemaps.infobubble/google.maps.infobubble-tests.ts rename to googlemaps.infobubble/googlemaps.infobubble-tests.ts diff --git a/googlemaps.infobubble/tsconfig.json b/googlemaps.infobubble/tsconfig.json index 165f392587..42b03a0823 100644 --- a/googlemaps.infobubble/tsconfig.json +++ b/googlemaps.infobubble/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "google.maps.infobubble-tests.ts" + "googlemaps.infobubble-tests.ts" ] } \ No newline at end of file diff --git a/googlemaps/google.maps-tests.ts b/googlemaps/googlemaps-tests.ts similarity index 100% rename from googlemaps/google.maps-tests.ts rename to googlemaps/googlemaps-tests.ts diff --git a/googlemaps/tsconfig.json b/googlemaps/tsconfig.json index 0382e30210..c858dfee0c 100644 --- a/googlemaps/tsconfig.json +++ b/googlemaps/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "google.maps-tests.ts" + "googlemaps-tests.ts" ] } diff --git a/grunt/gruntjs-tests.ts b/grunt/grunt-tests.ts similarity index 100% rename from grunt/gruntjs-tests.ts rename to grunt/grunt-tests.ts diff --git a/grunt/tsconfig.json b/grunt/tsconfig.json index f4b2b816d9..ca11c8f477 100644 --- a/grunt/tsconfig.json +++ b/grunt/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "gruntjs-tests.ts" + "grunt-tests.ts" ] } \ No newline at end of file diff --git a/halogen/halogen-clip-loader-tests.tsx b/halogen/test/clip-loader.tsx similarity index 100% rename from halogen/halogen-clip-loader-tests.tsx rename to halogen/test/clip-loader.tsx diff --git a/halogen/halogen-fade-loader-tests.tsx b/halogen/test/fade-loader.tsx similarity index 100% rename from halogen/halogen-fade-loader-tests.tsx rename to halogen/test/fade-loader.tsx diff --git a/halogen/halogen-pacman-loader-tests.tsx b/halogen/test/pacman-loader.tsx similarity index 100% rename from halogen/halogen-pacman-loader-tests.tsx rename to halogen/test/pacman-loader.tsx diff --git a/halogen/halogen-rotate-loader-tests.tsx b/halogen/test/rotate-loader.tsx similarity index 100% rename from halogen/halogen-rotate-loader-tests.tsx rename to halogen/test/rotate-loader.tsx diff --git a/halogen/tsconfig.json b/halogen/tsconfig.json index 5e6c8ab8f5..c2c0018e1b 100644 --- a/halogen/tsconfig.json +++ b/halogen/tsconfig.json @@ -16,9 +16,9 @@ }, "files": [ "index.d.ts", - "halogen-clip-loader-tests.tsx", - "halogen-fade-loader-tests.tsx", - "halogen-pacman-loader-tests.tsx", - "halogen-rotate-loader-tests.tsx" + "test/clip-loader.tsx", + "test/fade-loader.tsx", + "test/pacman-loader.tsx", + "test/rotate-loader.tsx" ] } \ No newline at end of file diff --git a/hammerjs/v1/tsconfig.json b/hammerjs/v1/tsconfig.json index deecbdb055..63de88e4e7 100644 --- a/hammerjs/v1/tsconfig.json +++ b/hammerjs/v1/tsconfig.json @@ -11,7 +11,7 @@ ], "types": [], "paths": { - "hammerjs": ["hammerjs/v0"] + "hammerjs": ["hammerjs/v1"] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/heatmap.js/heatmap-tests.ts b/heatmap.js/heatmap.js-tests.ts similarity index 100% rename from heatmap.js/heatmap-tests.ts rename to heatmap.js/heatmap.js-tests.ts diff --git a/heatmap.js/tsconfig.json b/heatmap.js/tsconfig.json index b90279cd8c..e1b42b5bd1 100644 --- a/heatmap.js/tsconfig.json +++ b/heatmap.js/tsconfig.json @@ -12,6 +12,6 @@ }, "files": [ "index.d.ts", - "heatmap-tests.ts" + "heatmap.js-tests.ts" ] } \ No newline at end of file diff --git a/highcharts/modules/boost-tests.ts b/highcharts/test/boost.ts similarity index 100% rename from highcharts/modules/boost-tests.ts rename to highcharts/test/boost.ts diff --git a/highcharts/modules/exporting-tests.ts b/highcharts/test/exporting.ts similarity index 100% rename from highcharts/modules/exporting-tests.ts rename to highcharts/test/exporting.ts diff --git a/highcharts/highstock-tests.ts b/highcharts/test/highstock.ts similarity index 100% rename from highcharts/highstock-tests.ts rename to highcharts/test/highstock.ts diff --git a/highcharts/highcharts-tests.ts b/highcharts/test/index.ts similarity index 100% rename from highcharts/highcharts-tests.ts rename to highcharts/test/index.ts diff --git a/highcharts/highcharts-more-tests.ts b/highcharts/test/more.ts similarity index 100% rename from highcharts/highcharts-more-tests.ts rename to highcharts/test/more.ts diff --git a/highcharts/modules/no-data-to-display-tests.ts b/highcharts/test/no-data-to-display.ts similarity index 100% rename from highcharts/modules/no-data-to-display-tests.ts rename to highcharts/test/no-data-to-display.ts diff --git a/highcharts/modules/offline-exporting-tests.ts b/highcharts/test/offline-exporting.ts similarity index 100% rename from highcharts/modules/offline-exporting-tests.ts rename to highcharts/test/offline-exporting.ts diff --git a/highcharts/tsconfig.json b/highcharts/tsconfig.json index 4744c83cb0..5d3e9ebe3f 100644 --- a/highcharts/tsconfig.json +++ b/highcharts/tsconfig.json @@ -15,18 +15,18 @@ }, "files": [ "index.d.ts", - "highcharts-tests.ts", "modules/boost.d.ts", - "modules/boost-tests.ts", "modules/exporting.d.ts", - "modules/exporting-tests.ts", "modules/no-data-to-display.d.ts", - "modules/no-data-to-display-tests.ts", "modules/offline-exporting.d.ts", - "modules/offline-exporting-tests.ts", "highcharts-more.d.ts", - "highcharts-more-tests.ts", "highstock.d.ts", - "highstock-tests.ts" + "test/boost.ts", + "test/exporting.ts", + "test/highstock.ts", + "test/index.ts", + "test/more.ts", + "test/no-data-to-display.ts", + "test/offline-exporting.ts" ] } \ No newline at end of file diff --git a/highlight.js/highlightjs-tests.ts b/highlight.js/highlight.js-tests.ts similarity index 100% rename from highlight.js/highlightjs-tests.ts rename to highlight.js/highlight.js-tests.ts diff --git a/highlight.js/tsconfig.json b/highlight.js/tsconfig.json index 86f2eade00..4b7c3117e1 100644 --- a/highlight.js/tsconfig.json +++ b/highlight.js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "highlightjs-tests.ts" + "highlight.js-tests.ts" ] } \ No newline at end of file diff --git a/history.js/history-tests.ts b/history.js/history.js-tests.ts similarity index 100% rename from history.js/history-tests.ts rename to history.js/history.js-tests.ts diff --git a/history.js/tsconfig.json b/history.js/tsconfig.json index 3ef4710368..795d9a540f 100644 --- a/history.js/tsconfig.json +++ b/history.js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "history-tests.ts" + "history.js-tests.ts" ] } \ No newline at end of file diff --git a/hubspot-pace/HubSpot-pace-tests.ts b/hubspot-pace/hubspot-pace-tests.ts similarity index 100% rename from hubspot-pace/HubSpot-pace-tests.ts rename to hubspot-pace/hubspot-pace-tests.ts diff --git a/hubspot-pace/tsconfig.json b/hubspot-pace/tsconfig.json index 67b152117c..1f7464eaa2 100644 --- a/hubspot-pace/tsconfig.json +++ b/hubspot-pace/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "HubSpot-pace-tests.ts" + "hubspot-pace-tests.ts" ] } \ No newline at end of file diff --git a/hypertext-application-language/index.d.ts b/hypertext-application-language/index.d.ts index 7834a81faf..111356c1ee 100644 --- a/hypertext-application-language/index.d.ts +++ b/hypertext-application-language/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Hypertext Application Language Draft 6 +// Type definitions for Hypertext Application Language Draft 6.0 // Project: https://tools.ietf.org/html/draft-kelly-json-hal-06 // Definitions by: Maks3w // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/i18n/i18n-node-tests.ts b/i18n/i18n-tests.ts similarity index 100% rename from i18n/i18n-node-tests.ts rename to i18n/i18n-tests.ts diff --git a/i18n/tsconfig.json b/i18n/tsconfig.json index 57a6b8ffb0..55f6a32871 100644 --- a/i18n/tsconfig.json +++ b/i18n/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "i18n-node-tests.ts" + "i18n-tests.ts" ] } \ No newline at end of file diff --git a/interact.js/interact-tests.ts b/interact.js/interact.js-tests.ts similarity index 100% rename from interact.js/interact-tests.ts rename to interact.js/interact.js-tests.ts diff --git a/interact.js/tsconfig.json b/interact.js/tsconfig.json index 9426c9e0cc..8dbabcade7 100644 --- a/interact.js/tsconfig.json +++ b/interact.js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "interact-tests.ts" + "interact.js-tests.ts" ] } \ No newline at end of file diff --git a/intercomjs/intercom-tests.ts b/intercomjs/intercomjs-tests.ts similarity index 100% rename from intercomjs/intercom-tests.ts rename to intercomjs/intercomjs-tests.ts diff --git a/intercomjs/tsconfig.json b/intercomjs/tsconfig.json index 6dfa66b6a1..79163abfc4 100644 --- a/intercomjs/tsconfig.json +++ b/intercomjs/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "intercom-tests.ts" + "intercomjs-tests.ts" ] } \ No newline at end of file diff --git a/ion.rangeslider/ion.rangeSlider-tests.ts b/ion.rangeslider/ion.rangeslider-tests.ts similarity index 100% rename from ion.rangeslider/ion.rangeSlider-tests.ts rename to ion.rangeslider/ion.rangeslider-tests.ts diff --git a/ion.rangeslider/tsconfig.json b/ion.rangeslider/tsconfig.json index 5912868fde..aede38d763 100644 --- a/ion.rangeslider/tsconfig.json +++ b/ion.rangeslider/tsconfig.json @@ -1,8 +1,4 @@ { - "files": [ - "index.d.ts", - "ion.rangeSlider-tests.ts" - ], "compilerOptions": { "module": "commonjs", "target": "es6", @@ -16,5 +12,9 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true - } + }, + "files": [ + "index.d.ts", + "ion.rangeslider-tests.ts" + ] } \ No newline at end of file diff --git a/ion.rangeslider/v1/ion.rangeSlider-tests.ts b/ion.rangeslider/v1/ion.rangeslider-tests.ts similarity index 100% rename from ion.rangeslider/v1/ion.rangeSlider-tests.ts rename to ion.rangeslider/v1/ion.rangeslider-tests.ts diff --git a/ion.rangeslider/v1/tsconfig.json b/ion.rangeslider/v1/tsconfig.json index fa756621f2..2460539a3f 100644 --- a/ion.rangeslider/v1/tsconfig.json +++ b/ion.rangeslider/v1/tsconfig.json @@ -11,13 +11,13 @@ ], "types": [], "paths": { - "ion.rangeslider": ["ion.rangeslider/v0"] + "ion.rangeslider": ["ion.rangeslider/v1"] }, "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "ion.rangeSlider-tests.ts" + "ion.rangeslider-tests.ts" ] } \ No newline at end of file diff --git a/is/is_js-tests.ts b/is/is-tests.ts similarity index 100% rename from is/is_js-tests.ts rename to is/is-tests.ts diff --git a/is/tsconfig.json b/is/tsconfig.json index 2e97760d50..7afa0a2de1 100644 --- a/is/tsconfig.json +++ b/is/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "is_js-tests.ts" + "is-tests.ts" ] } \ No newline at end of file diff --git a/iscroll/index.d.ts b/iscroll/index.d.ts index b4a8d62763..cfe1824643 100644 --- a/iscroll/index.d.ts +++ b/iscroll/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iScroll 5 +// Type definitions for iScroll 5.0 // Project: http://cubiq.org/iscroll-5-ready-for-beta-test // Definitions by: Christiaan Rakowski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/ix.js/ix-tests.ts b/ix.js/test/index.ts similarity index 100% rename from ix.js/ix-tests.ts rename to ix.js/test/index.ts diff --git a/ix.js/l2o-tests.ts b/ix.js/test/l2o.ts similarity index 99% rename from ix.js/l2o-tests.ts rename to ix.js/test/l2o.ts index 7b35b71a9e..063e85bfd6 100644 --- a/ix.js/l2o-tests.ts +++ b/ix.js/test/l2o.ts @@ -1,5 +1,3 @@ -/// - var ec_ns = (a: number, b: string) => a.toString() == b; //equality comparer on number,string var ec_nn = (a: number, b: number) => a === b; //equality comparer on number,number var c_nn = (a: number, b: number) => a - b; //comparer on number,number diff --git a/ix.js/tsconfig.json b/ix.js/tsconfig.json index 670dba223e..7f476db666 100644 --- a/ix.js/tsconfig.json +++ b/ix.js/tsconfig.json @@ -15,7 +15,7 @@ }, "files": [ "index.d.ts", - "ix-tests.ts", - "l2o-tests.ts" + "test/index.ts", + "test/l2o.ts" ] } \ No newline at end of file diff --git a/jee-jsf/jsf-tests.ts b/jee-jsf/jee-jsf-tests.ts similarity index 100% rename from jee-jsf/jsf-tests.ts rename to jee-jsf/jee-jsf-tests.ts diff --git a/jee-jsf/tsconfig.json b/jee-jsf/tsconfig.json index 0774f560ab..e7b8594556 100644 --- a/jee-jsf/tsconfig.json +++ b/jee-jsf/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jsf-tests.ts" + "jee-jsf-tests.ts" ] } \ No newline at end of file diff --git a/jodata/joData-tests.ts b/jodata/jodata-tests.ts similarity index 100% rename from jodata/joData-tests.ts rename to jodata/jodata-tests.ts diff --git a/jodata/tsconfig.json b/jodata/tsconfig.json index 3638d1b6f6..28bcc5bb36 100644 --- a/jodata/tsconfig.json +++ b/jodata/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "joData-tests.ts" + "jodata-tests.ts" ] } \ No newline at end of file diff --git a/jquery.blockui/jquery.blockUI-tests.ts b/jquery.blockui/jquery.blockui-tests.ts similarity index 100% rename from jquery.blockui/jquery.blockUI-tests.ts rename to jquery.blockui/jquery.blockui-tests.ts diff --git a/jquery.blockui/tsconfig.json b/jquery.blockui/tsconfig.json index 0d9c7d0a03..70b0f9a8aa 100644 --- a/jquery.blockui/tsconfig.json +++ b/jquery.blockui/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.blockUI-tests.ts" + "jquery.blockui-tests.ts" ] } \ No newline at end of file diff --git a/jquery.clientsidelogging/jquery.clientSideLogging-tests.ts b/jquery.clientsidelogging/jquery.clientsidelogging-tests.ts similarity index 100% rename from jquery.clientsidelogging/jquery.clientSideLogging-tests.ts rename to jquery.clientsidelogging/jquery.clientsidelogging-tests.ts diff --git a/jquery.clientsidelogging/tsconfig.json b/jquery.clientsidelogging/tsconfig.json index 483ce592e1..0bfce0b33c 100644 --- a/jquery.clientsidelogging/tsconfig.json +++ b/jquery.clientsidelogging/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.clientSideLogging-tests.ts" + "jquery.clientsidelogging-tests.ts" ] } \ No newline at end of file diff --git a/jquery.contextmenu/jquery.contextMenu-tests.ts b/jquery.contextmenu/jquery.contextmenu-tests.ts similarity index 100% rename from jquery.contextmenu/jquery.contextMenu-tests.ts rename to jquery.contextmenu/jquery.contextmenu-tests.ts diff --git a/jquery.contextmenu/tsconfig.json b/jquery.contextmenu/tsconfig.json index 25cae340ac..4e684a80b0 100644 --- a/jquery.contextmenu/tsconfig.json +++ b/jquery.contextmenu/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.contextMenu-tests.ts" + "jquery.contextmenu-tests.ts" ] } \ No newline at end of file diff --git a/jquery.customselect/jquery.customSelect-tests.ts b/jquery.customselect/jquery.customselect-tests.ts similarity index 100% rename from jquery.customselect/jquery.customSelect-tests.ts rename to jquery.customselect/jquery.customselect-tests.ts diff --git a/jquery.customselect/tsconfig.json b/jquery.customselect/tsconfig.json index 470079177d..a82625409d 100644 --- a/jquery.customselect/tsconfig.json +++ b/jquery.customselect/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.customSelect-tests.ts" + "jquery.customselect-tests.ts" ] } \ No newline at end of file diff --git a/jquery.datatables/jquery.dataTables-tests.ts b/jquery.datatables/jquery.datatables-tests.ts similarity index 100% rename from jquery.datatables/jquery.dataTables-tests.ts rename to jquery.datatables/jquery.datatables-tests.ts diff --git a/jquery.datatables/tsconfig.json b/jquery.datatables/tsconfig.json index 486b10d9ca..edb98f9b94 100644 --- a/jquery.datatables/tsconfig.json +++ b/jquery.datatables/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.dataTables-tests.ts" + "jquery.datatables-tests.ts" ] } \ No newline at end of file diff --git a/jquery.gridster/gridster-tests.ts b/jquery.gridster/jquery.gridster-tests.ts similarity index 100% rename from jquery.gridster/gridster-tests.ts rename to jquery.gridster/jquery.gridster-tests.ts diff --git a/jquery.gridster/tsconfig.json b/jquery.gridster/tsconfig.json index 775fbfbbd8..5bae952a15 100644 --- a/jquery.gridster/tsconfig.json +++ b/jquery.gridster/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "gridster-tests.ts" + "jquery.gridster-tests.ts" ] } \ No newline at end of file diff --git a/jquery.leanmodal/jquery.leanModal-tests.ts b/jquery.leanmodal/jquery.leanmodal-tests.ts similarity index 100% rename from jquery.leanmodal/jquery.leanModal-tests.ts rename to jquery.leanmodal/jquery.leanmodal-tests.ts diff --git a/jquery.leanmodal/tsconfig.json b/jquery.leanmodal/tsconfig.json index ce5f2553ec..a9a32b6d34 100644 --- a/jquery.leanmodal/tsconfig.json +++ b/jquery.leanmodal/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.leanModal-tests.ts" + "jquery.leanmodal-tests.ts" ] } \ No newline at end of file diff --git a/jquery.notifybar/jquery.notifyBar-tests.ts b/jquery.notifybar/jquery.notifybar-tests.ts similarity index 100% rename from jquery.notifybar/jquery.notifyBar-tests.ts rename to jquery.notifybar/jquery.notifybar-tests.ts diff --git a/jquery.notifybar/tsconfig.json b/jquery.notifybar/tsconfig.json index c338f7bf5e..587dec244d 100644 --- a/jquery.notifybar/tsconfig.json +++ b/jquery.notifybar/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.notifyBar-tests.ts" + "jquery.notifybar-tests.ts" ] } \ No newline at end of file diff --git a/jquery.pjax.falsandtru/jquery.pjax-tests.ts b/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts similarity index 100% rename from jquery.pjax.falsandtru/jquery.pjax-tests.ts rename to jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts diff --git a/jquery.pjax.falsandtru/tsconfig.json b/jquery.pjax.falsandtru/tsconfig.json index eafe636c08..7c619d7288 100644 --- a/jquery.pjax.falsandtru/tsconfig.json +++ b/jquery.pjax.falsandtru/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.pjax-tests.ts" + "jquery.pjax.falsandtru-tests.ts" ] } \ No newline at end of file diff --git a/jquery.postmessage/jquery.postMessage-tests.ts b/jquery.postmessage/jquery.postmessage-tests.ts similarity index 100% rename from jquery.postmessage/jquery.postMessage-tests.ts rename to jquery.postmessage/jquery.postmessage-tests.ts diff --git a/jquery.postmessage/tsconfig.json b/jquery.postmessage/tsconfig.json index 3e70423c66..dd298d2aa0 100644 --- a/jquery.postmessage/tsconfig.json +++ b/jquery.postmessage/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.postMessage-tests.ts" + "jquery.postmessage-tests.ts" ] } \ No newline at end of file diff --git a/jquery.rowgrid/jquery.rowGrid-tests.ts b/jquery.rowgrid/jquery.rowgrid-tests.ts similarity index 100% rename from jquery.rowgrid/jquery.rowGrid-tests.ts rename to jquery.rowgrid/jquery.rowgrid-tests.ts diff --git a/jquery.rowgrid/tsconfig.json b/jquery.rowgrid/tsconfig.json index 55ebd698c1..314bc2a671 100644 --- a/jquery.rowgrid/tsconfig.json +++ b/jquery.rowgrid/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.rowGrid-tests.ts" + "jquery.rowgrid-tests.ts" ] } \ No newline at end of file diff --git a/jquery.scrollto/jquery.scrollTo-tests.ts b/jquery.scrollto/jquery.scrollto-tests.ts similarity index 100% rename from jquery.scrollto/jquery.scrollTo-tests.ts rename to jquery.scrollto/jquery.scrollto-tests.ts diff --git a/jquery.scrollto/tsconfig.json b/jquery.scrollto/tsconfig.json index 183ea5843e..94f73774ed 100644 --- a/jquery.scrollto/tsconfig.json +++ b/jquery.scrollto/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.scrollTo-tests.ts" + "jquery.scrollto-tests.ts" ] } \ No newline at end of file diff --git a/jquery.simplepagination/jquery.simplePagination-tests.ts b/jquery.simplepagination/jquery.simplepagination-tests.ts similarity index 100% rename from jquery.simplepagination/jquery.simplePagination-tests.ts rename to jquery.simplepagination/jquery.simplepagination-tests.ts diff --git a/jquery.simplepagination/tsconfig.json b/jquery.simplepagination/tsconfig.json index 890a63616d..02376bb00c 100644 --- a/jquery.simplepagination/tsconfig.json +++ b/jquery.simplepagination/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "jquery.simplePagination-tests.ts" + "jquery.simplepagination-tests.ts" ] } \ No newline at end of file diff --git a/js-fixtures/fixtures-tests.ts b/js-fixtures/js-fixtures-tests.ts similarity index 100% rename from js-fixtures/fixtures-tests.ts rename to js-fixtures/js-fixtures-tests.ts diff --git a/js-fixtures/tsconfig.json b/js-fixtures/tsconfig.json index 3f93c8ccdc..3c1a51cf41 100644 --- a/js-fixtures/tsconfig.json +++ b/js-fixtures/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "fixtures-tests.ts" + "js-fixtures-tests.ts" ] } \ No newline at end of file diff --git a/js-md5/md5-tests.ts b/js-md5/js-md5-tests.ts similarity index 100% rename from js-md5/md5-tests.ts rename to js-md5/js-md5-tests.ts diff --git a/js-md5/tsconfig.json b/js-md5/tsconfig.json index cbccd9ae2e..1b5b2dd795 100644 --- a/js-md5/tsconfig.json +++ b/js-md5/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "md5-tests.ts" + "js-md5-tests.ts" ] } \ No newline at end of file diff --git a/jszip/index.d.ts b/jszip/index.d.ts index 46fe0f870c..be9b053d43 100644 --- a/jszip/index.d.ts +++ b/jszip/index.d.ts @@ -148,6 +148,7 @@ interface JSZipFileOptions { comment?: string; optimizedBinaryString?: boolean; createFolders?: boolean; + dir?: boolean; } interface JSZipObjectOptions { diff --git a/jszip/jszip-tests.ts b/jszip/jszip-tests.ts index da6366fbcb..f7a4b9f10f 100644 --- a/jszip/jszip-tests.ts +++ b/jszip/jszip-tests.ts @@ -9,6 +9,7 @@ var SEVERITY = { function createTestZip(): JSZip { var zip = new JSZip(); zip.file("test.txt", "test string"); + zip.file("test", null, { dir: true }); zip.file("test/test.txt", "test string"); return zip } diff --git a/knockout/tests/knockout-tests.ts b/knockout/test/index.ts similarity index 100% rename from knockout/tests/knockout-tests.ts rename to knockout/test/index.ts diff --git a/knockout/tests/knockout-templatingBehaviors-tests.ts b/knockout/test/templatingBehaviors.ts similarity index 100% rename from knockout/tests/knockout-templatingBehaviors-tests.ts rename to knockout/test/templatingBehaviors.ts diff --git a/knockout/tsconfig.json b/knockout/tsconfig.json index 04246314bb..b09f482a4a 100644 --- a/knockout/tsconfig.json +++ b/knockout/tsconfig.json @@ -15,7 +15,7 @@ }, "files": [ "index.d.ts", - "tests/knockout-templatingBehaviors-tests.ts", - "tests/knockout-tests.ts" + "test/templatingBehaviors.ts", + "test/index.ts" ] } \ No newline at end of file diff --git a/koa-send/index.d.ts b/koa-send/index.d.ts index f8424c1a85..521e96036e 100644 --- a/koa-send/index.d.ts +++ b/koa-send/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for koa-send v3.x +// Type definitions for koa-send v3.3 // Project: https://github.com/koajs/send // Definitions by: Peter Safranek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -13,6 +13,7 @@ interface ISendOptions { format?: boolean; gzip?: boolean; setHeaders?: Function; + extensions?: string[]; } declare function send(ctx: Koa.Context, path: string, opts?: ISendOptions): Promise; diff --git a/koa-send/koa-send-tests.ts b/koa-send/koa-send-tests.ts index e231d4e6b3..88a6f16abb 100644 --- a/koa-send/koa-send-tests.ts +++ b/koa-send/koa-send-tests.ts @@ -17,5 +17,6 @@ app.use(async (ctx: Koa.Context) => { format: true, gzip: true, setHeaders: () => {}, + extensions: ['shemp'], }); }); diff --git a/konami.js/konami-tests.ts b/konami.js/konami.js-tests.ts similarity index 100% rename from konami.js/konami-tests.ts rename to konami.js/konami.js-tests.ts diff --git a/konami.js/tsconfig.json b/konami.js/tsconfig.json index 8b4f43df6e..6175df34c2 100644 --- a/konami.js/tsconfig.json +++ b/konami.js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "konami-tests.ts" + "konami.js-tests.ts" ] } \ No newline at end of file diff --git a/leaflet/index.d.ts b/leaflet/index.d.ts index 3e50ded6fd..93cceb3425 100644 --- a/leaflet/index.d.ts +++ b/leaflet/index.d.ts @@ -1046,6 +1046,7 @@ declare namespace L { keepInView?: boolean; closeButton?: boolean; autoClose?: boolean; + closeOnClick?: boolean; } type Content = string | HTMLElement; diff --git a/localforage/localForage-tests.ts b/localforage/localforage-tests.ts similarity index 100% rename from localforage/localForage-tests.ts rename to localforage/localforage-tests.ts diff --git a/localforage/tsconfig.json b/localforage/tsconfig.json index ac31a49c3e..b2ebf8be91 100644 --- a/localforage/tsconfig.json +++ b/localforage/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "localForage-tests.ts" + "localforage-tests.ts" ] } \ No newline at end of file diff --git a/lodash/index.d.ts b/lodash/index.d.ts index 731cf801ca..89436684c1 100644 --- a/lodash/index.d.ts +++ b/lodash/index.d.ts @@ -13288,6 +13288,28 @@ declare namespace _ { ): number; } + //_.meanBy + interface LoDashStatic { + /** + * Computes the mean of the provided propties of the objects in the `array` + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the mean. + * @example + * + * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); + * // => 5 + */ + meanBy( + collection: List, + iteratee?: DictionaryIterator + ): number; + } + interface LoDashImplicitArrayWrapper { /** * @see _.mean diff --git a/loopback-boot/loopback-boot-test.ts b/loopback-boot/loopback-boot-tests.ts similarity index 100% rename from loopback-boot/loopback-boot-test.ts rename to loopback-boot/loopback-boot-tests.ts diff --git a/loopback-boot/tsconfig.json b/loopback-boot/tsconfig.json index d784404acf..3bd43c78fd 100644 --- a/loopback-boot/tsconfig.json +++ b/loopback-boot/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "loopback-boot-test.ts" + "loopback-boot-tests.ts" ] } \ No newline at end of file diff --git a/loopback/loopback-test.ts b/loopback/loopback-tests.ts similarity index 100% rename from loopback/loopback-test.ts rename to loopback/loopback-tests.ts diff --git a/loopback/tsconfig.json b/loopback/tsconfig.json index 9454529143..4ca6819f7e 100644 --- a/loopback/tsconfig.json +++ b/loopback/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "loopback-test.ts" + "loopback-tests.ts" ] } \ No newline at end of file diff --git a/maker.js/makerjs-tests.ts b/maker.js/maker.js-tests.ts similarity index 100% rename from maker.js/makerjs-tests.ts rename to maker.js/maker.js-tests.ts diff --git a/maker.js/tsconfig.json b/maker.js/tsconfig.json index cd4be3d273..c3fe4a7a20 100644 --- a/maker.js/tsconfig.json +++ b/maker.js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "makerjs-tests.ts" + "maker.js-tests.ts" ] } \ No newline at end of file diff --git a/mandrill-api/mandrill-tests.ts b/mandrill-api/mandrill-api-tests.ts similarity index 100% rename from mandrill-api/mandrill-tests.ts rename to mandrill-api/mandrill-api-tests.ts diff --git a/mandrill-api/tsconfig.json b/mandrill-api/tsconfig.json index 8f41f411aa..25bf307996 100644 --- a/mandrill-api/tsconfig.json +++ b/mandrill-api/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "mandrill-tests.ts" + "mandrill-api-tests.ts" ] } \ No newline at end of file diff --git a/mcustomscrollbar/mCustomScrollbar-tests.ts b/mcustomscrollbar/mcustomscrollbar-tests.ts similarity index 100% rename from mcustomscrollbar/mCustomScrollbar-tests.ts rename to mcustomscrollbar/mcustomscrollbar-tests.ts diff --git a/mcustomscrollbar/tsconfig.json b/mcustomscrollbar/tsconfig.json index 06d2e59f1a..56a75dc8b2 100644 --- a/mcustomscrollbar/tsconfig.json +++ b/mcustomscrollbar/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "mCustomScrollbar-tests.ts" + "mcustomscrollbar-tests.ts" ] } \ No newline at end of file diff --git a/memory-fs/memory-fs-tests.ts b/memory-fs/test/index.ts similarity index 89% rename from memory-fs/memory-fs-tests.ts rename to memory-fs/test/index.ts index 61302916be..07abb3e3fe 100644 --- a/memory-fs/memory-fs-tests.ts +++ b/memory-fs/test/index.ts @@ -1,5 +1,3 @@ -/// - import MemoryFileSystem = require('memory-fs'); const fs = new MemoryFileSystem({}); diff --git a/memory-fs/lib/join-tests.ts b/memory-fs/test/join.ts similarity index 100% rename from memory-fs/lib/join-tests.ts rename to memory-fs/test/join.ts diff --git a/memory-fs/lib/normalize-tests.ts b/memory-fs/test/normalize.ts similarity index 100% rename from memory-fs/lib/normalize-tests.ts rename to memory-fs/test/normalize.ts diff --git a/memory-fs/tsconfig.json b/memory-fs/tsconfig.json index 8236038c24..f1afc33095 100644 --- a/memory-fs/tsconfig.json +++ b/memory-fs/tsconfig.json @@ -15,10 +15,10 @@ }, "files": [ "index.d.ts", - "memory-fs-tests.ts", - "lib/join-tests.ts", "lib/join.d.ts", - "lib/normalize-tests.ts", - "lib/normalize.d.ts" + "lib/normalize.d.ts", + "test/index.ts", + "test/join.ts", + "test/normalize.ts" ] } \ No newline at end of file diff --git a/metric-suffix/metric-suffix-external-tests.ts b/metric-suffix/metric-suffix-external-tests.ts deleted file mode 100644 index 5b22aeeaa1..0000000000 --- a/metric-suffix/metric-suffix-external-tests.ts +++ /dev/null @@ -1,22 +0,0 @@ -import metric_suffix = require('metric-suffix'); - -metric_suffix(42) // 42 -metric_suffix(999) // 999 -metric_suffix(1000) // 1.0k - -metric_suffix(1234, 2) // 1.2k -metric_suffix(12345, 2) // 12k -metric_suffix(123456, 2) // 123k - -metric_suffix(1234, 3) // 1.23k -metric_suffix(12345, 3) // 12.3k -metric_suffix(123456, 3) // 123k - -metric_suffix(1234, 4) // 1.234k -metric_suffix(12345, 4) // 12.35k -metric_suffix(123456, 4) // 123.5k - -metric_suffix(986725) // 987k -metric_suffix(986725, 4) // 986.7k -metric_suffix(986725123) // 987M -metric_suffix(986725123, 5) // 986.73M \ No newline at end of file diff --git a/metric-suffix/tsconfig.json b/metric-suffix/tsconfig.json index 313286b950..c23b32a4e4 100644 --- a/metric-suffix/tsconfig.json +++ b/metric-suffix/tsconfig.json @@ -15,7 +15,6 @@ }, "files": [ "index.d.ts", - "metric-suffix-tests.ts", - "metric-suffix-external-tests.ts" + "metric-suffix-tests.ts" ] } \ No newline at end of file diff --git a/microsoft-ajax/microsoft.ajax-tests.ts b/microsoft-ajax/microsoft-ajax-tests.ts similarity index 100% rename from microsoft-ajax/microsoft.ajax-tests.ts rename to microsoft-ajax/microsoft-ajax-tests.ts diff --git a/microsoft-ajax/tsconfig.json b/microsoft-ajax/tsconfig.json index 0066ff394e..3ed87d107e 100644 --- a/microsoft-ajax/tsconfig.json +++ b/microsoft-ajax/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "microsoft.ajax-tests.ts" + "microsoft-ajax-tests.ts" ] } \ No newline at end of file diff --git a/mocha/UNUSED_FILES.txt b/mocha/UNUSED_FILES.txt new file mode 100644 index 0000000000..2c70329a00 --- /dev/null +++ b/mocha/UNUSED_FILES.txt @@ -0,0 +1,2 @@ +mocha-node.d.ts +mocha-node-tests.ts \ No newline at end of file diff --git a/mocha/tsconfig.json b/mocha/tsconfig.json index 14d99637d1..94ab1840b4 100644 --- a/mocha/tsconfig.json +++ b/mocha/tsconfig.json @@ -15,8 +15,6 @@ }, "files": [ "index.d.ts", - "mocha-tests.ts", - "mocha-node.d.ts", - "mocha-node-tests.ts" + "mocha-tests.ts" ] } \ No newline at end of file diff --git a/mousetrap/mousetrap-global-bind-tests.ts b/mousetrap/test/global-bind.ts similarity index 100% rename from mousetrap/mousetrap-global-bind-tests.ts rename to mousetrap/test/global-bind.ts diff --git a/mousetrap/mousetrap-tests.ts b/mousetrap/test/index.ts similarity index 100% rename from mousetrap/mousetrap-tests.ts rename to mousetrap/test/index.ts diff --git a/mousetrap/tsconfig.json b/mousetrap/tsconfig.json index 003c378176..d7def634a2 100644 --- a/mousetrap/tsconfig.json +++ b/mousetrap/tsconfig.json @@ -15,7 +15,7 @@ }, "files": [ "index.d.ts", - "mousetrap-tests.ts", - "mousetrap-global-bind-tests.ts" + "test/index.ts", + "test/global-bind.ts" ] } \ No newline at end of file diff --git a/ng-cordova/actionSheet-tests.ts b/ng-cordova/test/actionSheet.ts similarity index 100% rename from ng-cordova/actionSheet-tests.ts rename to ng-cordova/test/actionSheet.ts diff --git a/ng-cordova/app-version-tests.ts b/ng-cordova/test/app-version.ts similarity index 100% rename from ng-cordova/app-version-tests.ts rename to ng-cordova/test/app-version.ts diff --git a/ng-cordova/appAvailability-tests.ts b/ng-cordova/test/appAvailability.ts similarity index 100% rename from ng-cordova/appAvailability-tests.ts rename to ng-cordova/test/appAvailability.ts diff --git a/ng-cordova/badge-tests.ts b/ng-cordova/test/badge.ts similarity index 100% rename from ng-cordova/badge-tests.ts rename to ng-cordova/test/badge.ts diff --git a/ng-cordova/camera-tests.ts b/ng-cordova/test/camera.ts similarity index 100% rename from ng-cordova/camera-tests.ts rename to ng-cordova/test/camera.ts diff --git a/ng-cordova/datepicker-tests.ts b/ng-cordova/test/datepicker.ts similarity index 100% rename from ng-cordova/datepicker-tests.ts rename to ng-cordova/test/datepicker.ts diff --git a/ng-cordova/device-tests.ts b/ng-cordova/test/device.ts similarity index 100% rename from ng-cordova/device-tests.ts rename to ng-cordova/test/device.ts diff --git a/ng-cordova/deviceMotion-tests.ts b/ng-cordova/test/deviceMotion.ts similarity index 100% rename from ng-cordova/deviceMotion-tests.ts rename to ng-cordova/test/deviceMotion.ts diff --git a/ng-cordova/deviceOrientation-tests.ts b/ng-cordova/test/deviceOrientation.ts similarity index 100% rename from ng-cordova/deviceOrientation-tests.ts rename to ng-cordova/test/deviceOrientation.ts diff --git a/ng-cordova/dialogs-tests.ts b/ng-cordova/test/dialogs.ts similarity index 100% rename from ng-cordova/dialogs-tests.ts rename to ng-cordova/test/dialogs.ts diff --git a/ng-cordova/emailComposer-tests.ts b/ng-cordova/test/emailComposer.ts similarity index 100% rename from ng-cordova/emailComposer-tests.ts rename to ng-cordova/test/emailComposer.ts diff --git a/ng-cordova/file-tests.ts b/ng-cordova/test/file.ts similarity index 100% rename from ng-cordova/file-tests.ts rename to ng-cordova/test/file.ts diff --git a/ng-cordova/fileTransfer-tests.ts b/ng-cordova/test/fileTransfer.ts similarity index 100% rename from ng-cordova/fileTransfer-tests.ts rename to ng-cordova/test/fileTransfer.ts diff --git a/ng-cordova/geolocation-tests.ts b/ng-cordova/test/geolocation.ts similarity index 100% rename from ng-cordova/geolocation-tests.ts rename to ng-cordova/test/geolocation.ts diff --git a/ng-cordova/network-tests.ts b/ng-cordova/test/network.ts similarity index 100% rename from ng-cordova/network-tests.ts rename to ng-cordova/test/network.ts diff --git a/ng-cordova/toast-tests.ts b/ng-cordova/test/toast.ts similarity index 100% rename from ng-cordova/toast-tests.ts rename to ng-cordova/test/toast.ts diff --git a/ng-cordova/tsconfig.json b/ng-cordova/tsconfig.json index 68bdca092a..68f86a18f9 100644 --- a/ng-cordova/tsconfig.json +++ b/ng-cordova/tsconfig.json @@ -16,21 +16,21 @@ }, "files": [ "index.d.ts", - "actionSheet-tests.ts", - "app-version-tests.ts", - "appAvailability-tests.ts", - "badge-tests.ts", - "camera-tests.ts", - "datepicker-tests.ts", - "device-tests.ts", - "deviceMotion-tests.ts", - "deviceOrientation-tests.ts", - "dialogs-tests.ts", - "emailComposer-tests.ts", - "file-tests.ts", - "fileTransfer-tests.ts", - "geolocation-tests.ts", - "network-tests.ts", - "toast-tests.ts" + "test/actionSheet.ts", + "test/app-version.ts", + "test/appAvailability.ts", + "test/badge.ts", + "test/camera.ts", + "test/datepicker.ts", + "test/device.ts", + "test/deviceMotion.ts", + "test/deviceOrientation.ts", + "test/dialogs.ts", + "test/emailComposer.ts", + "test/file.ts", + "test/fileTransfer.ts", + "test/geolocation.ts", + "test/network.ts", + "test/toast.ts" ] } \ No newline at end of file diff --git a/ngtoaster/angularjs-toaster-tests.ts b/ngtoaster/ngtoaster-tests.ts similarity index 100% rename from ngtoaster/angularjs-toaster-tests.ts rename to ngtoaster/ngtoaster-tests.ts diff --git a/ngtoaster/tsconfig.json b/ngtoaster/tsconfig.json index eaf3b5027d..67970d092e 100644 --- a/ngtoaster/tsconfig.json +++ b/ngtoaster/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "angularjs-toaster-tests.ts" + "ngtoaster-tests.ts" ] } \ No newline at end of file diff --git a/node/index.d.ts b/node/index.d.ts index ba3a7685fc..ba2bbed3d6 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -3958,7 +3958,7 @@ declare module "v8" { physical_space_size: number; } - const enum DoesZapCodeSpaceFlag { + enum DoesZapCodeSpaceFlag { Disabled = 0, Enabled = 1 } diff --git a/node/tsconfig.json b/node/tsconfig.json index adc8804da6..15c5691724 100644 --- a/node/tsconfig.json +++ b/node/tsconfig.json @@ -15,6 +15,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "isolatedModules": true } } \ No newline at end of file diff --git a/novnc/noVNC-tests.ts b/novnc/novnc-tests.ts similarity index 100% rename from novnc/noVNC-tests.ts rename to novnc/novnc-tests.ts diff --git a/novnc/tsconfig.json b/novnc/tsconfig.json index bfb76135a7..3c88833118 100644 --- a/novnc/tsconfig.json +++ b/novnc/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "noVNC-tests.ts" + "novnc-tests.ts" ] } \ No newline at end of file diff --git a/numeral/numeraljs-tests.ts b/numeral/numeral-tests.ts similarity index 100% rename from numeral/numeraljs-tests.ts rename to numeral/numeral-tests.ts diff --git a/numeral/tsconfig.json b/numeral/tsconfig.json index 61386fac51..5d51b7d6cc 100644 --- a/numeral/tsconfig.json +++ b/numeral/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "numeraljs-tests.ts" + "numeral-tests.ts" ] } \ No newline at end of file diff --git a/nw.gui/node-webkit-tests.ts b/nw.gui/nw.gui-tests.ts similarity index 100% rename from nw.gui/node-webkit-tests.ts rename to nw.gui/nw.gui-tests.ts diff --git a/nw.gui/tsconfig.json b/nw.gui/tsconfig.json index 0a184e9e8b..d59063a0b2 100644 --- a/nw.gui/tsconfig.json +++ b/nw.gui/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "node-webkit-tests.ts" + "nw.gui-tests.ts" ] } \ No newline at end of file diff --git a/openui5/ui5-tests.ts b/openui5/openui5-tests.ts similarity index 100% rename from openui5/ui5-tests.ts rename to openui5/openui5-tests.ts diff --git a/openui5/tsconfig.json b/openui5/tsconfig.json index 428f84704f..97d54dd860 100644 --- a/openui5/tsconfig.json +++ b/openui5/tsconfig.json @@ -18,6 +18,6 @@ "jquery.sap.d.ts", "sap.m.d.ts", "sap.ui.d.ts", - "ui5-tests.ts" + "openui5-tests.ts" ] } \ No newline at end of file diff --git a/p2/index.d.ts b/p2/index.d.ts index 5fb85052e6..e9b8b79054 100644 --- a/p2/index.d.ts +++ b/p2/index.d.ts @@ -520,7 +520,10 @@ declare namespace p2 { addShape(shape: Shape, offset?: number[], angle?: number): void; removeShape(shape: Shape): boolean; updateMassProperties(): void; - applyForce(force: number[], worldPoint: number[]): void; + applyForce(force: number[], relativePoint?: number[]): void; + applyForceLocal(localforce: number[], localPoint?: number[]): void; + applyImpulse(impulse: number[], relativePoint?: number[]): void; + applyImpulseLocal(impulse: number[], localPoint?: number[]): void; toLocalFrame(out: number[], worldPoint: number[]): void; toWorldFrame(out: number[], localPoint: number[]): void; fromPolygon(path: number[][], options?: { diff --git a/p2/p2-tests.ts b/p2/p2-tests.ts index bdad71b906..0579a880b2 100644 --- a/p2/p2-tests.ts +++ b/p2/p2-tests.ts @@ -31,6 +31,12 @@ world.addBody(groundBody); // This is done using a fixed time step size. var timeStep = 1 / 60; // seconds +// Apply a force to the circle +circleBody.applyForce([10, 0]); + +// Apply an impulse to the circle +circleBody.applyImpulse([0, 50]); + // The "Game loop". Could be replaced by, for example, requestAnimationFrame. setInterval(function(){ diff --git a/paralleljs/parallel-tests.ts b/paralleljs/paralleljs-tests.ts similarity index 100% rename from paralleljs/parallel-tests.ts rename to paralleljs/paralleljs-tests.ts diff --git a/paralleljs/tsconfig.json b/paralleljs/tsconfig.json index debc292389..f6ae0047ac 100644 --- a/paralleljs/tsconfig.json +++ b/paralleljs/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "parallel-tests.ts" + "paralleljs-tests.ts" ] } \ No newline at end of file diff --git a/paypal-cordova-plugin/PayPal-Cordova-Plugin-tests.ts b/paypal-cordova-plugin/paypal-cordova-plugin-tests.ts similarity index 100% rename from paypal-cordova-plugin/PayPal-Cordova-Plugin-tests.ts rename to paypal-cordova-plugin/paypal-cordova-plugin-tests.ts diff --git a/paypal-cordova-plugin/tsconfig.json b/paypal-cordova-plugin/tsconfig.json index 4cd4acf310..c32cd43755 100644 --- a/paypal-cordova-plugin/tsconfig.json +++ b/paypal-cordova-plugin/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "PayPal-Cordova-Plugin-tests.ts" + "paypal-cordova-plugin-tests.ts" ] } \ No newline at end of file diff --git a/pem/index.d.ts b/pem/index.d.ts index 8a5f71b729..c523fb8fa7 100644 --- a/pem/index.d.ts +++ b/pem/index.d.ts @@ -1,155 +1,265 @@ -// Type definitions for PEM v1.8.3 +// Type definitions for PEM 1.9 // Project: https://github.com/andris9/pem -// Definitions by: Anthony Trinh +// Definitions by: Anthony Trinh , Ruslan Arkhipau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "pem" { +interface ModuleConfiguration { /** - * Creates a private key - * - * @param {Number} [keyBitsize=2048] Size of the key, defaults to 2048bit (can also be a function) - * @param {Object} [options] object of cipher and password {cipher:'aes128',password:'xxx'}, defaults empty object - * @param {Function} callback Callback function with an error object and {key} + * Path to OpenSSL binaries */ - function createPrivateKey(keyBitsize: Number, options: Object, callback: Function): void; - function createPrivateKey(keyBitsize: Number, callback: Function): void; - function createPrivateKey(options: Object, callback: Function): void; - function createPrivateKey(callback: Function): void; - - /** - * Creates a dhparam key - * - * @param {Number} [keyBitsize=512] Size of the key, defaults to 512bit - * @param {Function} callback Callback function with an error object and {dhparam} - */ - function createDhparam(keyBitsize: Number, callback: Function): void; - function createDhparam(callback: Function): void; - - /** - * Creates a Certificate Signing Request - * - * If client key is undefined, a new key is created automatically. The used key is included - * in the callback return as clientKey - * - * @param {Object} [options] Optional options object - * @param {String} [options.clientKey] Optional client key to use - * @param {Number} [options.keyBitsize] If clientKey is undefined, bit size to use for generating a new key (defaults to 2048) - * @param {String} [options.hash] Hash function to use (either md5 sha1 or sha256, defaults to sha256) - * @param {String} [options.country] CSR country field - * @param {String} [options.state] CSR state field - * @param {String} [options.locality] CSR locality field - * @param {String} [options.organization] CSR organization field - * @param {String} [options.organizationUnit] CSR organizational unit field - * @param {String} [options.commonName='localhost'] CSR common name field - * @param {String} [options.emailAddress] CSR email address field - * @param {String} [options.csrConfigFile] CSR config file - * @param {Array} [options.altNames] is a list of subjectAltNames in the subjectAltName field - * @param {Function} callback Callback function with an error object and {csr, clientKey} - */ - function createCSR(options: Object, callback: Function): void; - function createCSR(callback: Function): void; - - /** - * Creates a certificate based on a CSR. If CSR is not defined, a new one - * will be generated automatically. For CSR generation all the options values - * can be used as with createCSR. - * - * @param {Object} [options] Optional options object - * @param {String} [options.serviceKey] Private key for signing the certificate, if not defined a new one is generated - * @param {String} [options.serviceKeyPassword] Password of the service key - * @param {Boolean} [options.selfSigned] If set to true and serviceKey is not defined, use clientKey for signing - * @param {String} [options.hash] Hash function to use (either md5 sha1 or sha256, defaults to sha256) - * @param {String} [options.csr] CSR for the certificate, if not defined a new one is generated - * @param {Number} [options.days] Certificate expire time in days - * @param {String} [options.clientKeyPassword] Password of the client key - * @param {String} [options.extFile] extension config file - without '-extensions v3_req' - * @param {String} [options.config] extension config file - with '-extensions v3_req' - * @param {Function} callback Callback function with an error object and {certificate, csr, clientKey, serviceKey} - */ - function createCertificate(options: Object, callback: Function): void; - function createCertificate(callback: Function): void; - - /** - * Reads subject data from a certificate or a CSR - * - * @param {String} certificate PEM encoded CSR or certificate - * @param {Function} callback Callback function with an error object and {country, state, locality, organization, organizationUnit, commonName, emailAddress} - */ - function readCertificateInfo(certificate: string, callback: Function): void; - function readCertificateInfo(callback: Function): void; - - /** - * Exports a public key from a private key, CSR or certificate - * - * @param {String} certificate PEM encoded private key, CSR or certificate - * @param {Function} callback Callback function with an error object and {publicKey} - */ - function getPublicKey(certificate: string, callback: Function): void; - function getPublicKey(callback: Function): void; - - /** - * Gets the fingerprint for a certificate - * - * @param {String} certificate PEM encoded certificate - * @param {String} hash Hash function to use (either md5 sha1 or sha256, defaults to sha256) - * @param {Function} callback Callback function with an error object and {fingerprint} - */ - function getFingerprint(certificate: string, hash: string, callback: Function): void; - function getFingerprint(certificate: string, callback: Function): void; - function getFingerprint(callback: Function): void; - - /** - * Gets the modulus from a certificate, a CSR or a private key - * - * @param {String} certificate PEM encoded, CSR PEM encoded, or private key - * @param {String} password password for the certificate - * @param {Function} callback Callback function with an error object and {modulus} - */ - function getModulus(certificate: string, password: string, callback: Function): void; - function getModulus(certificate: string, callback: Function): void; - - /** - * Gets the size and prime of DH parameters - * - * @param {String} dh DH parameters PEM encoded - * @param {Function} callback Callback function with an error object and {size, prime} - */ - function getDhparamInfo(dh: string, callback: Function): void; - - /** - * Exports private key and certificate to a PKCS12 keystore - * - * @param {String} key PEM encoded private key - * @param {String} certificate PEM encoded certificate - * @param {String} password Password of the result PKCS12 file - * @param {Object} [options] object of cipher and optional client key password {cipher:'aes128', clientKeyPassword: 'xxx'} - * @param {Function} callback Callback function with an error object and {pkcs12} - */ - function createPkcs12(key: string, certificate: string, password: string, options: Object, callback: Function): void; - function createPkcs12(key: string, certificate: string, password: string, callback: Function): void; - - /** - * Reads private key and certificate from a PKCS12 keystore - * @param {String} bufferOrPath - * @param {Object} [options] object of cipher and optional client key password {cipher:'aes128', clientKeyPassword: 'xxx'} - * @param {Function} callback Callback function with an error object and {pkcs12} - * @returns the result of the callback - */ - function readPkcs12(bufferOrPath: string, options: Object, callback: Function): any; - function readPkcs12(options: Object, callback: Function): any; - - /** - * Verifies the signing chain of the passed certificate - * - * @param {String} certificate PEM encoded certificate - * @param {Array} ca List of CA certificates - * @param {Function} callback Callback function with an error object and a boolean valid - */ - function verifySigningChain(certificate: string, ca: Array, callback: Function): void; - - /** - * config the pem module - * @param {Object} options - */ - function config(options: Object): void; + pathOpenSSL: string; } + +export type PrivateKeyCipher = "aes128" | "aes192" | "aes256" | "camellia128" | "camellia192" | "camellia256" | "des" | "des3" | "idea" | string; // allow for additions in future + +interface PrivateKeyCreationOptions { + cipher: PrivateKeyCipher; + password: string; +} + +interface Pkcs12CreationOptions { + cipher?: PrivateKeyCipher; + clientKeyPassword?: string; + certFiles?: string[]; +} + +interface Pkcs12ReadOptions { + p12Password?: string; + clientKeyPassword?: string; +} + +export type HashFunction = 'md5' | 'sha1' | 'sha256' | string; +interface CSRCreationOptions { + /** + * Optional client key to use + */ + clientKey?: string; + clientKeyPassword?: string; + /** + * If clientKey is undefined, bit size to use for generating a new key (defaults to 2048) + */ + keyBitsize?: number; + /** + * Hash function to use, defaults to sha256 + */ + hash?: HashFunction; + /** + * CSR country field + */ + country?: string; + /** + * CSR state field + */ + state?: string; + /** + * CSR locality field + */ + locality?: string; + /** + * CSR organization field + */ + organization?: string; + /** + * CSR organizational unit field + */ + organizationUnit?: string; + /** + * CSR common name field, defaults to 'localhost' + */ + commonName?: string; + /** + * CSR email address field + */ + emailAddress?: string; + /** + * CSR config file + */ + csrConfigFile?: string; + /** + * A list of subjectAltNames in the subjectAltName field + */ + altNames?: string[]; +} + +interface CertificateCreationOptions extends CSRCreationOptions { + /** + * Private key for signing the certificate, if not defined a new one is generated + */ + serviceKey?: string; + /** + * Password of the service key + */ + serviceKeyPassword?: string; + serviceCertificate?: any; + serial?: any; + /** + * If set to true and serviceKey is not defined, use clientKey for signing + */ + selfSigned?: boolean; + /** + * CSR for the certificate, if not defined a new one is generated from the provided parameters + */ + csr?: string; + /** + * Certificate expire time in days, defaults to 365 + */ + days?: number; + /** + * Password of the client key + */ + clientKeyPassword?: string; + /** + * extension config file - without '-extensions v3_req' + */ + extFile?: string; + /** + * extension config file - with '-extensions v3_req' + */ + config?: string; +} + +interface CertificateCreationResult { + certificate: any; + csr: string; + clientKey: string; + serviceKey: string; +} + +interface CertificateSubjectReadResult { + country: string; + state: string; + locality: string; + organization: string; + organizationUnit: string; + commonName: string; + emailAddress: string; +} + +type Callback = (error: any, result: T) => any; + +/** + * Creates a private key + * + * @param {number} [keyBitsize=2048] Size of the key, defaults to 2048bit (can also be a function) + * @param {PrivateKeyCreationOptions} [options] private key encryption settings, defaults to empty object (no enryption) + * @param {Callback<{ key: string }>} callback Callback function with an error object and {key} + */ +declare function createPrivateKey(keyBitsize: number, options: PrivateKeyCreationOptions, callback: Callback<{ key: string }>): void; +declare function createPrivateKey(optionsOrKeyBitsize: number | PrivateKeyCreationOptions, callback: Callback<{ key: string }>): void; +declare function createPrivateKey(callback: Callback<{ key: string }>): void; + +/** + * Creates a dhparam key + * + * @param {Number} [keyBitsize=512] Size of the key, defaults to 512bit + * @param {Callback<{ dhparam: any }>} callback Callback function with an error object and {dhparam} + */ +declare function createDhparam(keyBitsize: number, callback: Callback<{ dhparam: any }>): void; +declare function createDhparam(callback: Callback<{ dhparam: any }>): void; + +/** + * Creates a Certificate Signing Request + * + * If options.clientKey is undefined, a new key is created automatically. The used key is included + * in the callback return as clientKey + * + * @param {CSRCreationOptions} [options] Optional options object + * @param {Callback<{ csr: string, clientKey: string }>} callback Callback function with an error object and {csr, clientKey} + */ +declare function createCSR(options: CSRCreationOptions, callback: Callback<{ csr: string, clientKey: string }>): void; +declare function createCSR(callback: Callback<{ csr: string, clientKey: string }>): void; + +/** + * Creates a certificate based on a CSR. If CSR is not defined, a new one + * will be generated automatically. For CSR generation all the options values + * can be used as with createCSR. + * + * @param {Object} [CertificateCreationOptions] Optional options object + * @param {Callback} callback Callback function with an error object and {certificate, csr, clientKey, serviceKey} + */ +declare function createCertificate(options: CertificateCreationOptions, callback: Callback): void; +declare function createCertificate(callback: Callback): void; + +/** + * Reads subject data from a certificate or a CSR + * + * @param {String} certificate PEM encoded CSR or certificate + * @param {Callback} callback Callback function with an error object and {country, state, locality, organization, organizationUnit, commonName, emailAddress} + */ +declare function readCertificateInfo(certificate: string, callback: Callback): void; +declare function readCertificateInfo(callback: Callback): void; + +/** + * Exports a public key from a private key, CSR or certificate + * + * @param {String} certificate PEM encoded private key, CSR or certificate + * @param {Callback<{ publicKey: string }>} callback Callback function with an error object and {publicKey} + */ +declare function getPublicKey(certificate: string, callback: Callback<{ publicKey: string }>): void; +declare function getPublicKey(callback: Callback<{ publicKey: string }>): void; + +/** + * Gets the fingerprint for a certificate + * + * @param {String} certificate PEM encoded certificate + * @param {HashFunction} hash Hash function to use (either md5 sha1 or sha256, defaults to sha256) + * @param {Callback<{ fingerprint: string }>} callback Callback function with an error object and {fingerprint} + */ +declare function getFingerprint(certificate: string, hash: HashFunction, callback: Callback<{ fingerprint: string }>): void; +declare function getFingerprint(certificate: string, callback: Callback<{ fingerprint: string }>): void; +declare function getFingerprint(callback: Callback<{ fingerprint: string }>): void; + +/** + * Gets the modulus from a certificate, a CSR or a private key + * + * @param {String} certificate PEM encoded, CSR PEM encoded, or private key + * @param {String} password password for the certificate + * @param {Callback<{ modulus: any }>} callback Callback function with an error object and {modulus} + */ +declare function getModulus(certificate: string, password: string, callback: Callback<{ modulus: any }>): void; +declare function getModulus(certificate: string, callback: Callback<{ modulus: any }>): void; + +/** + * Gets the size and prime of DH parameters + * + * @param {String} dh DH parameters PEM encoded + * @param {Callback<{ size: any, prime: any }>} callback Callback function with an error object and {size, prime} + */ +declare function getDhparamInfo(dh: string, callback: Callback<{ size: any, prime: any }>): void; + +/** + * Exports private key and certificate to a PKCS12 keystore + * + * @param {String} key PEM encoded private key + * @param {String} certificate PEM encoded certificate + * @param {String} password Password of the result PKCS12 file + * @param {Pkcs12CreationOptions} [options] object of cipher and optional client key password {cipher:'aes128', clientKeyPassword: 'xxx'} + * @param {Callback<{ pkcs12: any }>} callback Callback function with an error object and {pkcs12} + */ +declare function createPkcs12(key: string, certificate: string, password: string, options: Pkcs12CreationOptions, callback: Callback<{ pkcs12: any }>): void; +declare function createPkcs12(key: string, certificate: string, password: string, callback: Callback<{ pkcs12: any }>): void; + +/** + * Reads private key and certificate from a PKCS12 keystore + * @param {String} bufferOrPath + * @param {Pkcs12ReadOptions} [options] + * @param {Function} callback Callback function with an error object and {pkcs12} + * @returns the result of the callback + */ +declare function readPkcs12(bufferOrPath: string, options: Pkcs12ReadOptions, callback: Callback<{ pkcs12: any }>): any; +declare function readPkcs12(bufferOrPath: string, callback: Callback<{ pkcs12: any }>): any; + +/** + * Verifies the signing chain of the passed certificate + * + * @param {String} certificate PEM encoded certificate + * @param {string[]} ca List of CA certificates + * @param {Function} callback Callback function with an error object and a boolean valid + */ +declare function verifySigningChain(certificate: string, ca: string[], callback: Callback): void; + +/** + * config the pem module + * @param {ModuleConfiguration} options + */ +declare function config(options: ModuleConfiguration): void; diff --git a/pem/tslint.json b/pem/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/pem/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/pleasejs/please-tests.ts b/pleasejs/pleasejs-tests.ts similarity index 100% rename from pleasejs/please-tests.ts rename to pleasejs/pleasejs-tests.ts diff --git a/pleasejs/tsconfig.json b/pleasejs/tsconfig.json index 58ebc9d426..0a595973af 100644 --- a/pleasejs/tsconfig.json +++ b/pleasejs/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "please-tests.ts" + "pleasejs-tests.ts" ] } \ No newline at end of file diff --git a/popper.js/popper-tests.ts b/popper.js/popper.js-tests.ts similarity index 100% rename from popper.js/popper-tests.ts rename to popper.js/popper.js-tests.ts diff --git a/popper.js/tsconfig.json b/popper.js/tsconfig.json index a9af98d819..599036ff15 100644 --- a/popper.js/tsconfig.json +++ b/popper.js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "popper-tests.ts" + "popper.js-tests.ts" ] } \ No newline at end of file diff --git a/pouchdb/pouch-tests.ts b/pouchdb/pouchdb-tests.ts similarity index 100% rename from pouchdb/pouch-tests.ts rename to pouchdb/pouchdb-tests.ts diff --git a/pouchdb/tsconfig.json b/pouchdb/tsconfig.json index 173d43fcd5..09bc6a7440 100644 --- a/pouchdb/tsconfig.json +++ b/pouchdb/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "pouch-tests.ts" + "pouchdb-tests.ts" ] } \ No newline at end of file diff --git a/prismjs/prism-tests.ts b/prismjs/prismjs-tests.ts similarity index 100% rename from prismjs/prism-tests.ts rename to prismjs/prismjs-tests.ts diff --git a/prismjs/tsconfig.json b/prismjs/tsconfig.json index 9acf5a037c..972a24f9fe 100644 --- a/prismjs/tsconfig.json +++ b/prismjs/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "prism-tests.ts" + "prismjs-tests.ts" ] } \ No newline at end of file diff --git a/progressjs/progress-tests.ts b/progressjs/progressjs-tests.ts similarity index 100% rename from progressjs/progress-tests.ts rename to progressjs/progressjs-tests.ts diff --git a/progressjs/tsconfig.json b/progressjs/tsconfig.json index 0961490fd3..c04d0442c1 100644 --- a/progressjs/tsconfig.json +++ b/progressjs/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "progress-tests.ts" + "progressjs-tests.ts" ] } \ No newline at end of file diff --git a/pubsub-js/PubSub-tests.ts b/pubsub-js/pubsub-js-tests.ts similarity index 100% rename from pubsub-js/PubSub-tests.ts rename to pubsub-js/pubsub-js-tests.ts diff --git a/pubsub-js/tsconfig.json b/pubsub-js/tsconfig.json index d2fa213f84..eda08b963b 100644 --- a/pubsub-js/tsconfig.json +++ b/pubsub-js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "PubSub-tests.ts" + "pubsub-js-tests.ts" ] } \ No newline at end of file diff --git a/random-js/random-js-ambient-tests.ts b/random-js/random-js-tests.ts similarity index 100% rename from random-js/random-js-ambient-tests.ts rename to random-js/random-js-tests.ts diff --git a/random-js/tsconfig.json b/random-js/tsconfig.json index 04313eb3db..eb2e70e45c 100644 --- a/random-js/tsconfig.json +++ b/random-js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "random-js-ambient-tests.ts" + "random-js-tests.ts" ] } \ No newline at end of file diff --git a/raven-js/ravenjs-tests.ts b/raven-js/raven-js-tests.ts similarity index 100% rename from raven-js/ravenjs-tests.ts rename to raven-js/raven-js-tests.ts diff --git a/raven-js/tsconfig.json b/raven-js/tsconfig.json index 821b76f72e..78f622e685 100644 --- a/raven-js/tsconfig.json +++ b/raven-js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "ravenjs-tests.ts" + "raven-js-tests.ts" ] } \ No newline at end of file diff --git a/react-addons-css-transition-group/index.d.ts b/react-addons-css-transition-group/index.d.ts index b57b39ab69..c8ccf83ebe 100644 --- a/react-addons-css-transition-group/index.d.ts +++ b/react-addons-css-transition-group/index.d.ts @@ -1,16 +1,12 @@ -// Type definitions for React (react-addons-css-transition-group) 0.14 +// Type definitions for React (react-addons-css-transition-group) 15.0 // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign , Microsoft // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import 'react-addons-transition-group'; -import { ComponentClass, TransitionGroupProps } from 'react'; +import { ComponentClass, TransitionGroupProps, CSSTransitionGroupProps } from 'react'; -declare var CSSTransitionGroup: CSSTransitionGroup; -type CSSTransitionGroup = ComponentClass; -export = CSSTransitionGroup; - -declare namespace CSSTransitionGroup { +declare module 'react' { interface CSSTransitionGroupTransitionName { enter: string; enterActive?: string; @@ -20,7 +16,7 @@ declare namespace CSSTransitionGroup { appearActive?: string; } - interface CSSTransitionGroupProps extends TransitionGroupProps { + export interface CSSTransitionGroupProps extends TransitionGroupProps { transitionName: string | CSSTransitionGroupTransitionName; transitionAppear?: boolean; transitionAppearTimeout?: number; @@ -30,3 +26,8 @@ declare namespace CSSTransitionGroup { transitionLeaveTimeout?: number; } } + +declare var CSSTransitionGroup: CSSTransitionGroup; +type CSSTransitionGroup = ComponentClass; +export = CSSTransitionGroup; + diff --git a/react-css-transition-replace/index.d.ts b/react-css-transition-replace/index.d.ts index 292e45e5e5..88a8d11ffd 100644 --- a/react-css-transition-replace/index.d.ts +++ b/react-css-transition-replace/index.d.ts @@ -7,7 +7,7 @@ import * as React from "react"; import * as CSSTransitionGroup from "react-addons-css-transition-group"; declare namespace CSSTransitionReplace { - interface Props extends CSSTransitionGroup.CSSTransitionGroupProps { + interface Props extends React.CSSTransitionGroupProps { overflowHidden?: boolean } } diff --git a/react-daterange-picker/package.json b/react-daterange-picker/package.json deleted file mode 100644 index 4c6d24a445..0000000000 --- a/react-daterange-picker/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "moment": ">=2.14.0" - } -} \ No newline at end of file diff --git a/react-daterange-picker/tsconfig.json b/react-daterange-picker/tsconfig.json index 5d13fe1e1c..ef3f5b7c35 100644 --- a/react-daterange-picker/tsconfig.json +++ b/react-daterange-picker/tsconfig.json @@ -9,12 +9,6 @@ "typeRoots": [ "../" ], - "paths": { - "*": [ - "*", - "react-daterange-picker/node_modules/*" - ] - }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, diff --git a/react-event-listener/index.d.ts b/react-event-listener/index.d.ts new file mode 100644 index 0000000000..7fefddbe7b --- /dev/null +++ b/react-event-listener/index.d.ts @@ -0,0 +1,226 @@ +// Type definitions for react-event-listener 0.4 +// Project: https://github.com/oliviertassinari/react-event-listener +// Definitions by: Alexey Svetliakov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as React from "react"; + +interface EventOptions { + /** + * @default false + */ + passive?: boolean; + /** + * @default false + */ + capture?: boolean; +} + +export function withOptions(handler: (ev: T) => any, options: EventOptions): (ev: T) => any; + +export interface EventListenerProps { + // Global events + onPointerCancel?: (ev: PointerEvent) => any; + onPointerCancelCapture?: (ev: PointerEvent) => any; + onPointerDown?: (ev: PointerEvent) => any; + onPointerDownCapture?: (ev: PointerEvent) => any; + onPointerEnter?: (ev: PointerEvent) => any; + onPointerEnterCapture?: (ev: PointerEvent) => any; + onPointerLeave?: (ev: PointerEvent) => any; + onPointerLeaveCapture?: (ev: PointerEvent) => any; + onPointerMove?: (ev: PointerEvent) => any; + onPointerMoveCapture?: (ev: PointerEvent) => any; + onPointerOut?: (ev: PointerEvent) => any; + onPointerOutCapture?: (ev: PointerEvent) => any; + onPointerOver?: (ev: PointerEvent) => any; + onPointerOverCapture?: (ev: PointerEvent) => any; + onPointerUp?: (ev: PointerEvent) => any; + onPointerUpCapture?: (ev: PointerEvent) => any; + onWheel?: (ev: WheelEvent) => any; + onWheelCapture?: (ev: WheelEvent) => any; + onAbort?: (ev: Event) => any; + onAbortCapture?: (ev: Event) => any; + onAfterPrint?: (ev: Event) => any; + onAfterPrintCapture?: (ev: Event) => any; + onBeforePrint?: (ev: Event) => any; + onBeforePrintCapture?: (ev: Event) => any; + onBeforeUnload?: (ev: BeforeUnloadEvent) => any; + onBeforeUnloadCapture?: (ev: BeforeUnloadEvent) => any; + onBlur?: (ev: FocusEvent) => any; + onBlurCapture?: (ev: FocusEvent) => any; + onCanPlay?: (ev: Event) => any; + onCanPlayCapture?: (ev: Event) => any; + onCanPlayThrough?: (ev: Event) => any; + onCanPlayThroughCapture?: (ev: Event) => any; + onChange?: (ev: Event) => any; + onChangeCapture?: (ev: Event) => any; + onClick?: (ev: MouseEvent) => any; + onClickCapture?: (ev: MouseEvent) => any; + onCompassNeedsCalibration?: (ev: Event) => any; + onCompassNeedsCalibrationCapture?: (ev: Event) => any; + onContextMenu?: (ev: PointerEvent) => any; + onContextMenuCapture?: (ev: PointerEvent) => any; + onDblClick?: (ev: MouseEvent) => any; + onDblClickCapture?: (ev: MouseEvent) => any; + onDeviceMotion?: (ev: DeviceMotionEvent) => any; + onDeviceMotionCapture?: (ev: DeviceMotionEvent) => any; + onDeviceOrientation?: (ev: DeviceOrientationEvent) => any; + onDeviceOrientationCapture?: (ev: DeviceOrientationEvent) => any; + onDrag?: (ev: DragEvent) => any; + onDragCapture?: (ev: DragEvent) => any; + onDragEnd?: (ev: DragEvent) => any; + onDragEndCapture?: (ev: DragEvent) => any; + onDragEnter?: (ev: DragEvent) => any; + onDragEnterCapture?: (ev: DragEvent) => any; + onDragLeave?: (ev: DragEvent) => any; + onDragLeaveCapture?: (ev: DragEvent) => any; + onDragOver?: (ev: DragEvent) => any; + onDragOverCapture?: (ev: DragEvent) => any; + onDragStart?: (ev: DragEvent) => any; + onDragStartCapture?: (ev: DragEvent) => any; + onDrop?: (ev: DragEvent) => any; + onDropCapture?: (ev: DragEvent) => any; + onDurationChange?: (ev: Event) => any; + onDurationChangeCapture?: (ev: Event) => any; + onEmptied?: (ev: Event) => any; + onEmptiedCapture?: (ev: Event) => any; + onEnded?: (ev: Event) => any; + onEndedCapture?: (ev: Event) => any; + onError?: ErrorEventHandler; + onErrorCapture?: ErrorEventHandler; + onFocus?: (ev: FocusEvent) => any; + onFocusCapture?: (ev: FocusEvent) => any; + onHashChange?: (ev: HashChangeEvent) => any; + onHashChangeCapture?: (ev: HashChangeEvent) => any; + onInput?: (ev: Event) => any; + onInputCapture?: (ev: Event) => any; + onKeyDown?: (ev: KeyboardEvent) => any; + onKeyDownCapture?: (ev: KeyboardEvent) => any; + onKeyPress?: (ev: KeyboardEvent) => any; + onKeyPressCapture?: (ev: KeyboardEvent) => any; + onKeyUp?: (ev: KeyboardEvent) => any; + onKeyUpCapture?: (ev: KeyboardEvent) => any; + onLoad?: (ev: Event) => any; + onLoadCapture?: (ev: Event) => any; + onLoadedData?: (ev: Event) => any; + onLoadedDataCapture?: (ev: Event) => any; + onLoadedMetadata?: (ev: Event) => any; + onLoadedMetadataCapture?: (ev: Event) => any; + onLoadStart?: (ev: Event) => any; + onLoadStartCapture?: (ev: Event) => any; + onMessage?: (ev: MessageEvent) => any; + onMessageCapture?: (ev: MessageEvent) => any; + onMouseDown?: (ev: MouseEvent) => any; + onMouseDownCapture?: (ev: MouseEvent) => any; + onMouseEnter?: (ev: MouseEvent) => any; + onMouseEnterCapture?: (ev: MouseEvent) => any; + onMouseLeave?: (ev: MouseEvent) => any; + onMouseLeaveCapture?: (ev: MouseEvent) => any; + onMouseMove?: (ev: MouseEvent) => any; + onMouseMoveCapture?: (ev: MouseEvent) => any; + onMouseOut?: (ev: MouseEvent) => any; + onMouseOutCapture?: (ev: MouseEvent) => any; + onMouseOver?: (ev: MouseEvent) => any; + onMouseOverCapture?: (ev: MouseEvent) => any; + onMouseUp?: (ev: MouseEvent) => any; + onMouseUpCapture?: (ev: MouseEvent) => any; + onMouseWheel?: (ev: MouseWheelEvent) => any; + onMouseWheelCapture?: (ev: MouseWheelEvent) => any; + onMsGestureChange?: (ev: MSGestureEvent) => any; + onMsGestureChangeCapture?: (ev: MSGestureEvent) => any; + onMsGestureDoubleTap?: (ev: MSGestureEvent) => any; + onMsGestureDoubleTapCapture?: (ev: MSGestureEvent) => any; + onMsGestureEnd?: (ev: MSGestureEvent) => any; + onMsGestureEndCapture?: (ev: MSGestureEvent) => any; + onMsGestureHold?: (ev: MSGestureEvent) => any; + onMsGestureHoldCapture?: (ev: MSGestureEvent) => any; + onMsGestureStart?: (ev: MSGestureEvent) => any; + onMsGestureStartCapture?: (ev: MSGestureEvent) => any; + onMsGestureTap?: (ev: MSGestureEvent) => any; + onMsGestureTapCapture?: (ev: MSGestureEvent) => any; + onMsInertiaStart?: (ev: MSGestureEvent) => any; + onMsInertiaStartCapture?: (ev: MSGestureEvent) => any; + onMsPointerCancel?: (ev: MSPointerEvent) => any; + onMsPointerCancelCapture?: (ev: MSPointerEvent) => any; + onMsPointerDown?: (ev: MSPointerEvent) => any; + onMsPointerDownCapture?: (ev: MSPointerEvent) => any; + onMsPointerEnter?: (ev: MSPointerEvent) => any; + onMsPointerEnterCapture?: (ev: MSPointerEvent) => any; + onMsPointerLeave?: (ev: MSPointerEvent) => any; + onMsPointerLeaveCapture?: (ev: MSPointerEvent) => any; + onMsPointerMove?: (ev: MSPointerEvent) => any; + onMsPointerMoveCapture?: (ev: MSPointerEvent) => any; + onMsPointerOut?: (ev: MSPointerEvent) => any; + onMsPointerOutCapture?: (ev: MSPointerEvent) => any; + onMsPointerOver?: (ev: MSPointerEvent) => any; + onMsPointerOverCapture?: (ev: MSPointerEvent) => any; + oNmsPointerUp?: (ev: MSPointerEvent) => any; + oNmsPointerUpCapture?: (ev: MSPointerEvent) => any; + onOffline?: (ev: Event) => any; + onOfflineCapture?: (ev: Event) => any; + onOnline?: (ev: Event) => any; + onOnlineCapture?: (ev: Event) => any; + onOrientationChange?: (ev: Event) => any; + onOrientationChangeCapture?: (ev: Event) => any; + onPageHide?: (ev: PageTransitionEvent) => any; + onPageHideCapture?: (ev: PageTransitionEvent) => any; + onPageShow?: (ev: PageTransitionEvent) => any; + onPageShowCapture?: (ev: PageTransitionEvent) => any; + onPause?: (ev: Event) => any; + onPauseCapture?: (ev: Event) => any; + onPlay?: (ev: Event) => any; + onPlayCapture?: (ev: Event) => any; + onPlaying?: (ev: Event) => any; + onPlayingCapture?: (ev: Event) => any; + onPopState?: (ev: PopStateEvent) => any; + onPopStateCapture?: (ev: PopStateEvent) => any; + onProgress?: (ev: ProgressEvent) => any; + onProgressCapture?: (ev: ProgressEvent) => any; + onRateChange?: (ev: Event) => any; + onRateChangeCapture?: (ev: Event) => any; + onReadyStateChange?: (ev: ProgressEvent) => any; + onReadyStateChangeCapture?: (ev: ProgressEvent) => any; + onReset?: (ev: Event) => any; + onResetCapture?: (ev: Event) => any; + onResize?: (ev: UIEvent) => any; + onResizeCapture?: (ev: UIEvent) => any; + onScroll?: (ev: UIEvent) => any; + onScrollCapture?: (ev: UIEvent) => any; + onSeeked?: (ev: Event) => any; + onSeekedCapture?: (ev: Event) => any; + onSeeking?: (ev: Event) => any; + onSeekingCapture?: (ev: Event) => any; + onSelect?: (ev: UIEvent) => any; + onSelectCapture?: (ev: UIEvent) => any; + onStalled?: (ev: Event) => any; + onStalledCapture?: (ev: Event) => any; + onStorage?: (ev: StorageEvent) => any; + onStorageCapture?: (ev: StorageEvent) => any; + onSubmit?: (ev: Event) => any; + onSubmitCapture?: (ev: Event) => any; + onSuspend?: (ev: Event) => any; + onSuspendCapture?: (ev: Event) => any; + onTimeUpdate?: (ev: Event) => any; + onTimeUpdateCapture?: (ev: Event) => any; + onTouchCancel?: any; + onTouchCancelCapture?: any; + onTouchEnd?: any; + onTouchEndCapture?: any; + onTouchMove?: any; + onTouchMoveCapture?: any; + onTouchStart?: any; + onTouchStartCapture?: any; + onUnload?: (ev: Event) => any; + onUnloadCapture?: (ev: Event) => any; + onVolumeChange?: (ev: Event) => any; + onVolumeChangeCapture?: (ev: Event) => any; + onWaiting?: (ev: Event) => any; + onWaitingCapture?: (ev: Event) => any; + + /** + * Target (window or document) + */ + target: Window | Document | string; +} + +export default class EventListener extends React.Component { } diff --git a/react-event-listener/react-event-listener-tests.tsx b/react-event-listener/react-event-listener-tests.tsx new file mode 100644 index 0000000000..194ab97e7f --- /dev/null +++ b/react-event-listener/react-event-listener-tests.tsx @@ -0,0 +1,6 @@ +import * as React from "react"; +import EventListener, { withOptions } from "react-event-listener"; + + { }} />; + { }, { passive: true, capture: true })} />; + { }}/> diff --git a/react-event-listener/tsconfig.json b/react-event-listener/tsconfig.json new file mode 100644 index 0000000000..619baa483a --- /dev/null +++ b/react-event-listener/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-event-listener-tests.tsx" + ] +} diff --git a/react-event-listener/tslint.json b/react-event-listener/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/react-event-listener/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/react-native/react-native-animated-tests.tsx b/react-native/test/animated.tsx similarity index 100% rename from react-native/react-native-animated-tests.tsx rename to react-native/test/animated.tsx diff --git a/react-native/react-native-tests.tsx b/react-native/test/index.tsx similarity index 100% rename from react-native/react-native-tests.tsx rename to react-native/test/index.tsx diff --git a/react-native/tsconfig.json b/react-native/tsconfig.json index 1a6f765478..930ac3d811 100644 --- a/react-native/tsconfig.json +++ b/react-native/tsconfig.json @@ -16,7 +16,7 @@ }, "files": [ "index.d.ts", - "react-native-tests.tsx", - "react-native-animated-tests.tsx" + "test/index.tsx", + "test/animated.tsx" ] } \ No newline at end of file diff --git a/react/react-tests.ts b/react/test/index.ts similarity index 100% rename from react/react-tests.ts rename to react/test/index.ts diff --git a/react/react-tsx-tests.tsx b/react/test/tsx.tsx similarity index 100% rename from react/react-tsx-tests.tsx rename to react/test/tsx.tsx diff --git a/react/tsconfig.json b/react/tsconfig.json index bf6595e99f..f26f721c8c 100644 --- a/react/tsconfig.json +++ b/react/tsconfig.json @@ -1,8 +1,8 @@ { "files": [ "index.d.ts", - "react-tests.ts", - "react-tsx-tests.tsx" + "test/index.ts", + "test/tsx.tsx" ], "compilerOptions": { "module": "commonjs", diff --git a/redux-form/index.d.ts b/redux-form/index.d.ts index 4c73f3e489..590fe3a633 100644 --- a/redux-form/index.d.ts +++ b/redux-form/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/erikras/redux-form // Definitions by: Carson Full , Daniel Lytkin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// @@ -16,9 +17,13 @@ export type FieldType = 'Field' | 'FieldArray'; export type DataShape = {[fieldName:string]: FieldValue}; -export type FormErrors = FormData & { _error?: string }; +export type FormErrors = { + [P in keyof FormData]?: React.ReactElement | string; +} & { _error?: string }; -export type FormWarnings = FormData & { _warning?: string }; +export type FormWarnings = { + [P in keyof FormData]?: React.ReactElement | string; +} & { _warning?: string }; /** * A component class or stateless function component. diff --git a/requirejs-domready/domready-tests.ts b/requirejs-domready/requirejs-domready-tests.ts similarity index 100% rename from requirejs-domready/domready-tests.ts rename to requirejs-domready/requirejs-domready-tests.ts diff --git a/requirejs-domready/tsconfig.json b/requirejs-domready/tsconfig.json index 4a6ca208f5..5d6731cbd1 100644 --- a/requirejs-domready/tsconfig.json +++ b/requirejs-domready/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "domready-tests.ts" + "requirejs-domready-tests.ts" ] } \ No newline at end of file diff --git a/requirejs/require-tests.ts b/requirejs/requirejs-tests.ts similarity index 100% rename from requirejs/require-tests.ts rename to requirejs/requirejs-tests.ts diff --git a/requirejs/tsconfig.json b/requirejs/tsconfig.json index 7fc6ef8516..6d8c38c0c9 100644 --- a/requirejs/tsconfig.json +++ b/requirejs/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "require-tests.ts" + "requirejs-tests.ts" ] } \ No newline at end of file diff --git a/rx-angular/rx.angular-tests.ts b/rx-angular/rx-angular-tests.ts similarity index 100% rename from rx-angular/rx.angular-tests.ts rename to rx-angular/rx-angular-tests.ts diff --git a/rx-angular/tsconfig.json b/rx-angular/tsconfig.json index 2412cb2874..084109bfb3 100644 --- a/rx-angular/tsconfig.json +++ b/rx-angular/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "rx.angular-tests.ts" + "rx-angular-tests.ts" ] } \ No newline at end of file diff --git a/sammy/sammyjs-tests.ts b/sammy/sammy-tests.ts similarity index 100% rename from sammy/sammyjs-tests.ts rename to sammy/sammy-tests.ts diff --git a/sammy/tsconfig.json b/sammy/tsconfig.json index 34996aa4cc..15b4050f9e 100644 --- a/sammy/tsconfig.json +++ b/sammy/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "sammyjs-tests.ts" + "sammy-tests.ts" ] } \ No newline at end of file diff --git a/selenium-webdriver/chrome-tests.ts b/selenium-webdriver/test/chrome.ts similarity index 100% rename from selenium-webdriver/chrome-tests.ts rename to selenium-webdriver/test/chrome.ts diff --git a/selenium-webdriver/firefox-tests.ts b/selenium-webdriver/test/firefox.ts similarity index 100% rename from selenium-webdriver/firefox-tests.ts rename to selenium-webdriver/test/firefox.ts diff --git a/selenium-webdriver/index-tests.ts b/selenium-webdriver/test/index.ts similarity index 100% rename from selenium-webdriver/index-tests.ts rename to selenium-webdriver/test/index.ts diff --git a/selenium-webdriver/tsconfig.json b/selenium-webdriver/tsconfig.json index 89e3b4fd9f..3925dd11ee 100644 --- a/selenium-webdriver/tsconfig.json +++ b/selenium-webdriver/tsconfig.json @@ -15,18 +15,18 @@ }, "files": [ "index.d.ts", - "index-tests.ts", "chrome.d.ts", - "chrome-tests.ts", "edge.d.ts", "executors.d.ts", "firefox.d.ts", - "firefox-tests.ts", "http.d.ts", "ie.d.ts", "opera.d.ts", "remote.d.ts", "safari.d.ts", - "testing.d.ts" + "testing.d.ts", + "test/index.ts", + "test/chrome.ts", + "test/firefox.ts" ] } diff --git a/sencha_touch/SenchaTouch-tests.ts b/sencha_touch/sencha_touch-tests.ts similarity index 100% rename from sencha_touch/SenchaTouch-tests.ts rename to sencha_touch/sencha_touch-tests.ts diff --git a/sencha_touch/tsconfig.json b/sencha_touch/tsconfig.json index 3ed5d8263d..a8a395e97a 100644 --- a/sencha_touch/tsconfig.json +++ b/sencha_touch/tsconfig.json @@ -1,7 +1,7 @@ { "files": [ "index.d.ts", - "SenchaTouch-tests.ts" + "sencha_touch-tests.ts" ], "compilerOptions": { "module": "commonjs", diff --git a/sha1/index.d.ts b/sha1/index.d.ts new file mode 100644 index 0000000000..81b2202dc3 --- /dev/null +++ b/sha1/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for sha1 1.1 +// Project: https://github.com/pvorb/node-sha1 +// Definitions by: Bill Sourour +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** + * js function for hashing messages with SHA1 + * + * @param {(string | Buffer)} message - a string or buffer to hash + * @param {Sha1Options} options - an options object + * @returns {string} the resultant SHA1 hash of the given message + */ +declare function main(message: string | Buffer, options?: Sha1Options): string | Uint8Array; +export = main; + +interface Sha1Options { + asBytes?: boolean; + asString?: boolean; +} diff --git a/sha1/sha1-tests.ts b/sha1/sha1-tests.ts new file mode 100644 index 0000000000..f2c6547f2b --- /dev/null +++ b/sha1/sha1-tests.ts @@ -0,0 +1,36 @@ +/// + +import fs = require("fs"); +import sha1 = require("sha1"); +/** + * API + * sha1(message) + * message -- String or Buffer + * returns String + * + * Usage + **************************************************** + * var sha1 = require('sha1'); * + * console.log(sha1('message')); * + **************************************************** + * This will print the following + * 6f9b9af3cd6e8b8a73c2cdced37fe9f59226e27d + * + * It supports buffers, too + **************************************************** + * var fs = require('fs'); * + * var sha1 = require('sha1'); * + * * + * fs.readFile('example.txt', function(err, buf) { * + * console.log(sha1(buf)); * + * }); * + * ************************************************** + */ +console.log(sha1('message')); // should print 6f9b9af3cd6e8b8a73c2cdced37fe9f59226e27d + +const testTwo = sha1('message', {asString: true}); +const testThree = sha1('message', {asBytes: true}); + +fs.readFile('sha1.d.ts', function(err: Error, buf: Buffer) { + console.log(sha1(buf)); +}); diff --git a/sha1/tsconfig.json b/sha1/tsconfig.json new file mode 100644 index 0000000000..ec99de7c10 --- /dev/null +++ b/sha1/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sha1-tests.ts" + ] +} diff --git a/sha1/tslint.json b/sha1/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/sha1/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/sharepoint/SharePoint-tests.ts b/sharepoint/sharepoint-tests.ts similarity index 100% rename from sharepoint/SharePoint-tests.ts rename to sharepoint/sharepoint-tests.ts diff --git a/sharepoint/tsconfig.json b/sharepoint/tsconfig.json index 76d3dc13a0..e631b4c53e 100644 --- a/sharepoint/tsconfig.json +++ b/sharepoint/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "SharePoint-tests.ts" + "sharepoint-tests.ts" ] } \ No newline at end of file diff --git a/signals/js-signals-tests.ts b/signals/signals-tests.ts similarity index 100% rename from signals/js-signals-tests.ts rename to signals/signals-tests.ts diff --git a/signals/tsconfig.json b/signals/tsconfig.json index 13bc50af80..94b8397fd2 100644 --- a/signals/tsconfig.json +++ b/signals/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "js-signals-tests.ts" + "signals-tests.ts" ] } \ No newline at end of file diff --git a/slickgrid/slickgrid-tests.ts b/slickgrid/test/index.ts similarity index 100% rename from slickgrid/slickgrid-tests.ts rename to slickgrid/test/index.ts diff --git a/slickgrid/slick.autotooltips-tests.ts b/slickgrid/test/slick.autotooltips.ts similarity index 100% rename from slickgrid/slick.autotooltips-tests.ts rename to slickgrid/test/slick.autotooltips.ts diff --git a/slickgrid/slick.checkboxselectcolumn-tests.ts b/slickgrid/test/slick.checkboxselectcolumn.ts similarity index 89% rename from slickgrid/slick.checkboxselectcolumn-tests.ts rename to slickgrid/test/slick.checkboxselectcolumn.ts index 593496537f..c0f08bb2af 100644 --- a/slickgrid/slick.checkboxselectcolumn-tests.ts +++ b/slickgrid/test/slick.checkboxselectcolumn.ts @@ -1,7 +1,3 @@ -/// -/// -/// - /** * Extracted from https://github.com/mleibman/SlickGrid/blob/master/examples/example-checkbox-row-select.html */ diff --git a/slickgrid/tsconfig.json b/slickgrid/tsconfig.json index ff7ab0e597..081819d112 100644 --- a/slickgrid/tsconfig.json +++ b/slickgrid/tsconfig.json @@ -15,13 +15,13 @@ }, "files": [ "index.d.ts", - "slickgrid-tests.ts", "slick.autotooltips.d.ts", - "slick.autotooltips-tests.ts", "slick.checkboxselectcolumn.d.ts", - "slick.checkboxselectcolumn-tests.ts", "slick.columnpicker.d.ts", "slick.headerbuttons.d.ts", - "slick.rowselectionmodel.d.ts" + "slick.rowselectionmodel.d.ts", + "test/index.ts", + "test/slick.autotooltips.ts", + "test/slick.checkboxselectcolumn.ts" ] } \ No newline at end of file diff --git a/smooth-scrollbar/index.d.ts b/smooth-scrollbar/index.d.ts new file mode 100644 index 0000000000..f6a65ca958 --- /dev/null +++ b/smooth-scrollbar/index.d.ts @@ -0,0 +1,277 @@ +// Type definitions for smooth-scrollbar 7.2 +// Project: https://github.com/idiotWu/smooth-scrollbar +// Definitions by: Alexey Svetliakov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace Scrollbar; + +export interface ScrollbarOptions { + /** + * Scrolling speed scale. + * @default 1 + */ + speed?: number; + /** + * Delta reduction damping, a float value between (0, 1), the lower the value is, the more smooth the scrolling will be. + * @default 0.1 + */ + damping?: number; + /** + * Minimal size for scrollbar thumb. + * @default 20 + */ + thumbMinSize?: number; + /** + * Execute listeners in synchronous or asynchronous. + * @default false + */ + syncCallbacks?: boolean; + /** + * Render scrolling by integer pixels, set to true to improve performance. + * @default true + */ + renderByPixels?: boolean; + /** + * Whether allow upper scrollable content to continue scrolling when current scrollbar reaches edge. + * When set to "auto", it will be enabled on nested scrollbars, and disabled on first-class scrollbars. + * @default "auto" + */ + continuousScrolling?: boolean | "auto"; + /** + * Experimental overscroll effect, "bounce" for iOS style effect and "glow" for Android style effect. + * Be careful when you enable this feature! + * @default false + */ + overscrollEffect?: boolean | "bounce" | "glow"; + /** + * Canvas paint color with 'glow' effect. + * @default "#87ceeb" + */ + overscrollEffectColor?: string; + /** + * The same as damping, but for overscrolling. + * @default 0.2 + */ + overscrollDamping?: number; +} + +export interface ScrollbarTargets { + readonly container: HTMLElement; + readonly content: HTMLElement; + readonly xAxis: { + readonly track: HTMLElement; + readonly thumb: HTMLElement; + }; + readonly yAxis: { + readonly track: HTMLElement; + readonly thumb: HTMLElement; + }; +} + +interface ScrollIntoViewOptions { + /** + * scrolling stop offset to top edge of container + * @default 0 + */ + offsetTop?: number; + /** + * scrolling stop offset to left edge of container + * @default 0 + */ + offsetLeft?: number; + /** + * whether to scroll container when target element is visible + * @default false + */ + onlyScrollIfNeeded?: boolean; +} + +export interface ScrollStatusObject { + /** + * Scrolling direction + */ + direction: { + x: "none" | "right" | "left"; + y: "none" | "up" | "down"; + }; + /** + * Scrolling offset + */ + offset: { + x: number; + y: number; + }; + /** + * Max scroll distance in px + */ + limit: { + x: number; + y: number; + }; +} + +export default class Scrollbar { + /** + * Init scrollbar on given element, and returns scrollbar instance + * @param {HTMLElement} element Element to init scrollbar + * @param {ScrollbarOptions} options Scrollbar options + * @return {Scrollbar} Scrollbar instance + */ + static init(element: HTMLElement, options?: ScrollbarOptions): Scrollbar; + /** + * Automatically init scrollbar on all elements refer to selector scrollbar, [scrollbar], [data-scrollbar] + * @return {Scrollbar[]} An array of scrollbars + */ + static initAll(options?: ScrollbarOptions): Scrollbar[]; + /** + * Check if scrollbar exists on given element: + * @param {HTMLElement} element HTML element + * @return {boolean} + */ + static has(element: HTMLElement): boolean; + /** + * Get scrollbar on the given element + * @param {HTMLElement} element HTML element + * @return {Scrollbar|undefined} Scrollbar instance of undefined if element doesn't have scrollbar + */ + static get(element: HTMLElement): Scrollbar | undefined; + /** + * Get all scrollbar instances + * @return {Scrollbar[]} An array of scrollbar instances + */ + static getAll(): Scrollbar[]; + /** + * Remove scrollbar on the given element + * @param {HTMLElement} element HTML element + * @param {boolean} isRemoval + */ + static destroy(element: HTMLElement, isRemoval?: boolean): void; + /** + * Destroys all scrollbar instances + */ + static destroyAll(): void; + /** + * Current scrollbar targets + */ + readonly targets: ScrollbarTargets; + /** + * Current scrolling offset + */ + offset: { + x: number; + y: number; + }; + /** + * Max scrolling offset + */ + limit: { + x: number; + y: number; + }; + /** + * Alias for offset.y + */ + scrollTop: number; + /** + * Alias for offset.x + */ + scrollLeft: number; + + /** + * Scrollbars are automatically updated with 100ms debounce (or childList changes if MutationObserver is supported). + * You can call update() to force an update, this will be useful when you modified contents inside scrollbar + * @param {boolean} async By default, updating will operate synchronously, set to true to update asynchronously (in next frame). + */ + update(async?: boolean): void; + /** + * Return the size of scrollbar container and scroll content + * @return {Object} Container and content dimensions + */ + getSize(): { container: { width: number; height: number }; content: { width: number; height: number } }; + /** + * Like window.scrollTo(), scroll content will be set to the given position immediately. + * @param {number} x X position + * @param {number} y Y position + * @param {boolean} withoutCallbacks Set to true to disable callback functions temporarily. + */ + setPosition(x: number, y: number, withoutCallbacks?: boolean): void; + /** + * Scroll to given position with easing, callback will be invoked with instance after scrolling: + * @param {number} x X position + * @param {number} y Y position + * @param {number} duration description + * @param {Function} callback Callback + */ + scrollTo(x: number, y: number, duration?: number, callback?: (instance: this) => void): void; + /** + * Scroll target element into visible area of scrollbar, like DOM method element.scrollIntoView(). + * This will be helpful when you want to create some anchors. + * @param {HTMLElement} element Element to scroll into + * @param {ScrollIntoViewOptions} options Options + */ + scrollIntoView(element: HTMLElement, options?: ScrollIntoViewOptions): void; + /** + * Check if an element is visible in the current view area. + * @param {HTMLElement} element HTML element + * @return {boolean} True/false + */ + isVisible(element: HTMLElement): boolean; + /** + * Register scrolling listener to scrollbar instance, callbacks will be invoked in every small scrolling. + * @param {Function} listener A listener + */ + addListener(listener: (status: ScrollStatusObject) => void): void; + /** + * Remove the given listeneer from listeners collection, like Element.removeEventListener(). + * @param {Function} listener A listener + */ + removeListener(listener: (status: ScrollStatusObject) => void): void; + /** + * This is another useful method when you want to make infinite scrolling. + * Callbacks will be invoked with status object when you scrolling down over a threshold. + * @param {Function} listener A listener + * @param {number} threshold Threshold, default 50 + */ + infiniteScroll(listener: (status: ScrollStatusObject) => void, threshold?: number): void; + /** + * Remove DOM event handlers that match regex rules + * @param {RegExp[]} regexps regexps + * @example + * instance.unregisterEvents(/touch/, /key/); + */ + unregisterEvents(...regexps: RegExp[]): void; + /** + * Recover events that are unregistered. + * @param {RegExp[]} regexps regexps + */ + registerEvents(...regexps: RegExp[]): void; + /** + * Clear all movements and stop scrollbar immediately, will be useful when you want to stop scrollbar and set it to another position. + */ + clearMovement(): void; + /** + * Alias for clearMovement() method. + */ + stop(): void; + /** + * Remove this scrollbar instance + * @param {boolean} isRemoval Set to true if scrollbar being removed from DOM + */ + destroy(isRemoval?: boolean): void; + /** + * Get content element of the scrollbar, which contains all of your contents within scrollbar. + * In other words, all contents that you've put them into target element, will be moved here after you initialized the scrollbar. + * @return {HTMLElement} HTML content element + */ + getContentElem(): HTMLElement; + /** + * Show scrollbar track, you can choose whether 'x' or 'y' or 'both', default is 'both' which will show tracks both on x-axis and y-axis. + * @param {"x"|"y"|"both"} direction Track direction + */ + showTrack(direction?: "x" | "y" | "both"): void; + /** + * Like showTrack() method, but for hiding the track on specified direction. + * @param {"x"|"y"|"both"} direction Track direction + */ + hideTrack(direction?: "x" | "y" | "both"): void; +} diff --git a/smooth-scrollbar/smooth-scrollbar-tests.ts b/smooth-scrollbar/smooth-scrollbar-tests.ts new file mode 100644 index 0000000000..2072caa3c8 --- /dev/null +++ b/smooth-scrollbar/smooth-scrollbar-tests.ts @@ -0,0 +1,31 @@ +import Scrollbar from "smooth-scrollbar"; + +const elem = document.createElement("div"); + +const scrollbar = Scrollbar.init(elem, { + continuousScrolling: true, + damping: 5, + overscrollDamping: 5, + overscrollEffect: "glow", + overscrollEffectColor: "green", + renderByPixels: true, + speed: 10, + syncCallbacks: true, + thumbMinSize: 1 +}); + +Scrollbar.has(elem); +Scrollbar.get(elem) === scrollbar; + +scrollbar.targets.container; +scrollbar.targets.xAxis.track; + +scrollbar.update(true); +scrollbar.setPosition(10, 10); + +scrollbar.addListener(status => status.direction); +scrollbar.infiniteScroll(status => status.direction.y); + +scrollbar.hideTrack("both"); +scrollbar.showTrack("x"); +scrollbar.destroy(true); diff --git a/smooth-scrollbar/tsconfig.json b/smooth-scrollbar/tsconfig.json new file mode 100644 index 0000000000..be638b7a40 --- /dev/null +++ b/smooth-scrollbar/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "smooth-scrollbar-tests.ts" + ] +} diff --git a/smooth-scrollbar/tslint.json b/smooth-scrollbar/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/smooth-scrollbar/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/sprintf-js/sprintf-tests.ts b/sprintf-js/sprintf-js-tests.ts similarity index 100% rename from sprintf-js/sprintf-tests.ts rename to sprintf-js/sprintf-js-tests.ts diff --git a/sprintf-js/tsconfig.json b/sprintf-js/tsconfig.json index 51135a42a2..f3209176f2 100644 --- a/sprintf-js/tsconfig.json +++ b/sprintf-js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "sprintf-tests.ts" + "sprintf-js-tests.ts" ] } \ No newline at end of file diff --git a/svg.js/svgjs-tests.ts b/svg.js/svg.js-tests.ts similarity index 100% rename from svg.js/svgjs-tests.ts rename to svg.js/svg.js-tests.ts diff --git a/svg.js/tsconfig.json b/svg.js/tsconfig.json index 720007c430..fe7ec62362 100644 --- a/svg.js/tsconfig.json +++ b/svg.js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "svgjs-tests.ts" + "svg.js-tests.ts" ] } \ No newline at end of file diff --git a/touch-events/touch-event-tests.ts b/touch-events/touch-events-tests.ts similarity index 100% rename from touch-events/touch-event-tests.ts rename to touch-events/touch-events-tests.ts diff --git a/touch-events/tsconfig.json b/touch-events/tsconfig.json index 9193ccfb7e..2d6a066fdf 100644 --- a/touch-events/tsconfig.json +++ b/touch-events/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "touch-event-tests.ts" + "touch-events-tests.ts" ] } \ No newline at end of file diff --git a/uuidjs/tsconfig.json b/uuidjs/tsconfig.json index 6c43a5006f..5de0c29bb1 100644 --- a/uuidjs/tsconfig.json +++ b/uuidjs/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "UUID-tests.ts" + "uuidjs-tests.ts" ] } \ No newline at end of file diff --git a/uuidjs/UUID-tests.ts b/uuidjs/uuidjs-tests.ts similarity index 100% rename from uuidjs/UUID-tests.ts rename to uuidjs/uuidjs-tests.ts diff --git a/vex-js/tsconfig.json b/vex-js/tsconfig.json index fcaf4b9f3b..3428a5b5ed 100644 --- a/vex-js/tsconfig.json +++ b/vex-js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "vex-tests.ts" + "vex-js-tests.ts" ] } \ No newline at end of file diff --git a/vex-js/vex-tests.ts b/vex-js/vex-js-tests.ts similarity index 100% rename from vex-js/vex-tests.ts rename to vex-js/vex-js-tests.ts diff --git a/vivus/tsconfig.json b/vivus/tsconfig.json index 3d8c032420..1afb932f4c 100644 --- a/vivus/tsconfig.json +++ b/vivus/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "index-tests.ts" + "vivus-tests.ts" ] } \ No newline at end of file diff --git a/vivus/index-tests.ts b/vivus/vivus-tests.ts similarity index 100% rename from vivus/index-tests.ts rename to vivus/vivus-tests.ts diff --git a/webrtc/MediaStream-tests.ts b/webrtc/test/MediaStream.ts similarity index 97% rename from webrtc/MediaStream-tests.ts rename to webrtc/test/MediaStream.ts index e45154bd44..d8c87afdec 100644 --- a/webrtc/MediaStream-tests.ts +++ b/webrtc/test/MediaStream.ts @@ -1,4 +1,3 @@ -/// var mediaStreamConstraints: MediaStreamConstraints = { audio: true, video: true }; var mediaTrackConstraintSet: MediaTrackConstraintSet = {}; diff --git a/webrtc/RTCPeerConnection-tests.ts b/webrtc/test/RTCPeerConnection.ts similarity index 97% rename from webrtc/RTCPeerConnection-tests.ts rename to webrtc/test/RTCPeerConnection.ts index dcb6bf8657..1272327ac2 100644 --- a/webrtc/RTCPeerConnection-tests.ts +++ b/webrtc/test/RTCPeerConnection.ts @@ -1,6 +1,3 @@ -/// -/// - let defaultIceServers: RTCIceServer[] = RTCPeerConnection.defaultIceServers; if (defaultIceServers.length > 0) { let urls = defaultIceServers[0].urls; diff --git a/webrtc/tsconfig.json b/webrtc/tsconfig.json index 00a9884815..fdda3c7ab0 100644 --- a/webrtc/tsconfig.json +++ b/webrtc/tsconfig.json @@ -15,7 +15,7 @@ }, "files": [ "index.d.ts", - "MediaStream-tests.ts", - "RTCPeerConnection-tests.ts" + "test/MediaStream.ts", + "test/RTCPeerConnection.ts" ] } \ No newline at end of file diff --git a/x2js/tsconfig.json b/x2js/tsconfig.json index 860553af5b..bb82a3b504 100644 --- a/x2js/tsconfig.json +++ b/x2js/tsconfig.json @@ -15,6 +15,6 @@ }, "files": [ "index.d.ts", - "xml2json-tests.ts" + "x2js-tests.ts" ] } \ No newline at end of file diff --git a/x2js/xml2json-tests.ts b/x2js/x2js-tests.ts similarity index 100% rename from x2js/xml2json-tests.ts rename to x2js/x2js-tests.ts diff --git a/xsd-schema-validator/index.d.ts b/xsd-schema-validator/index.d.ts index c4fd02e8f5..db867b4178 100644 --- a/xsd-schema-validator/index.d.ts +++ b/xsd-schema-validator/index.d.ts @@ -9,4 +9,4 @@ export function validateXML(xml: string|NodeJS.ReadableStream|{file: string}, pa valid: boolean; messages: string[]; result: string; -}) => void): void; +}) => void): void; \ No newline at end of file diff --git a/xsd-schema-validator/tsconfig.json b/xsd-schema-validator/tsconfig.json index f41083f666..e720897bf8 100644 --- a/xsd-schema-validator/tsconfig.json +++ b/xsd-schema-validator/tsconfig.json @@ -17,4 +17,4 @@ "index.d.ts", "xsd-schema-validator-tests.ts" ] -} \ No newline at end of file +}