diff --git a/agenda/agenda-tests.ts b/agenda/agenda-tests.ts
index 6be618e59d..8c5e3e19bb 100644
--- a/agenda/agenda-tests.ts
+++ b/agenda/agenda-tests.ts
@@ -1,8 +1,5 @@
-///
-
import * as Agenda from "agenda";
-
var mongoConnectionString = "mongodb://127.0.0.1/agenda";
var agenda = new Agenda({ db: { address: mongoConnectionString } });
diff --git a/alt/alt-tests.ts b/alt/alt-tests.ts
index fad079b020..673930cd68 100644
--- a/alt/alt-tests.ts
+++ b/alt/alt-tests.ts
@@ -74,7 +74,7 @@ var testSource:AltJS.Source = {
remote() {
return new Promise((res:any, rej:any) => {
setTimeout(() => {
- if(true) {
+ if(!!true) {
res("stuff");
} else {
rej("Things have broken");
diff --git a/amcharts/tsconfig.json b/amcharts/tsconfig.json
index effc71d799..5e684a6e2b 100644
--- a/amcharts/tsconfig.json
+++ b/amcharts/tsconfig.json
@@ -2,7 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
- "noImplicitAny": true,
+ "noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": "../"
}
diff --git a/amplify-deferred/tsconfig.json b/amplify-deferred/tsconfig.json
index effc71d799..5e684a6e2b 100644
--- a/amplify-deferred/tsconfig.json
+++ b/amplify-deferred/tsconfig.json
@@ -2,7 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
- "noImplicitAny": true,
+ "noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": "../"
}
diff --git a/amplify/tsconfig.json b/amplify/tsconfig.json
index effc71d799..5e684a6e2b 100644
--- a/amplify/tsconfig.json
+++ b/amplify/tsconfig.json
@@ -2,7 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
- "noImplicitAny": true,
+ "noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": "../"
}
diff --git a/angular-dialog-service/angular-dialog-service.d.ts b/angular-dialog-service/angular-dialog-service.d.ts
index 3d75e32222..b321ff54e0 100644
--- a/angular-dialog-service/angular-dialog-service.d.ts
+++ b/angular-dialog-service/angular-dialog-service.d.ts
@@ -3,7 +3,7 @@
// Definitions by: William Comartin
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
///
declare namespace angular.dialogservice {
diff --git a/angular-material/tsconfig.json b/angular-material/tsconfig.json
index effc71d799..29976a565d 100644
--- a/angular-material/tsconfig.json
+++ b/angular-material/tsconfig.json
@@ -1,4 +1,5 @@
{
+ "files": ["angular-material.d.ts", "angular-material-tests.ts"],
"compilerOptions": {
"module": "commonjs",
"target": "es6",
diff --git a/angular-permission/tsconfig.json b/angular-permission/tsconfig.json
index effc71d799..a599fed323 100644
--- a/angular-permission/tsconfig.json
+++ b/angular-permission/tsconfig.json
@@ -1,4 +1,5 @@
{
+ "files": ["angular-permission.d.ts", "angular-permission-tests.ts"],
"compilerOptions": {
"module": "commonjs",
"target": "es6",
diff --git a/angular-strap/angular-strap-tests.ts b/angular-strap/angular-strap-tests.ts
index c052ffad4f..f4253ad94e 100644
--- a/angular-strap/angular-strap-tests.ts
+++ b/angular-strap/angular-strap-tests.ts
@@ -1,4 +1,4 @@
-///
+///
///
namespace angularStrapTests {
diff --git a/angularLocalStorage/angularLocalStorage.d.ts b/angularLocalStorage/angularLocalStorage.d.ts
index 35bb5928c1..e2f0858e40 100644
--- a/angularLocalStorage/angularLocalStorage.d.ts
+++ b/angularLocalStorage/angularLocalStorage.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Horiuchi_H
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace angular.localStorage {
interface ILocalStorageService {
diff --git a/angularfire/angularfire.d.ts b/angularfire/angularfire.d.ts
index e60fcad361..476840715d 100644
--- a/angularfire/angularfire.d.ts
+++ b/angularfire/angularfire.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Dénes Harmath
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
///
interface AngularFireService {
diff --git a/angularjs/angular-amd-tests.ts b/angularjs/angular-amd-tests.ts
deleted file mode 100644
index 97f6daf462..0000000000
--- a/angularjs/angular-amd-tests.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-
-import localName = require('angular');
-var mod: localName.IModule = localName.module('mod', []);
-
-// Remain compatible with the ambient version
-var mod2: angular.IModule = mod;
diff --git a/angularjs/tsconfig.json b/angularjs/tsconfig.json
index effc71d799..d46bc07418 100644
--- a/angularjs/tsconfig.json
+++ b/angularjs/tsconfig.json
@@ -1,4 +1,19 @@
{
+ "files": [
+ "angularjs.d.ts",
+ "angular-animate.d.ts",
+ "angular-component-router.d.ts",
+ "angular-cookies.d.ts",
+ "angular-mocks.d.ts",
+ "angular-resource.d.ts",
+ "angular-route.d.ts",
+ "angular-sanitize.d.ts",
+
+ "angular-route-tests.ts",
+ "angular-resource-tests.ts",
+ "angular-sanitize-tests.ts",
+ "angular-tests.ts"
+ ],
"compilerOptions": {
"module": "commonjs",
"target": "es6",
diff --git a/any-db-transaction/any-db-transaction-tests.ts b/any-db-transaction/any-db-transaction-tests.ts
index 9601d7f254..8e96f43883 100644
--- a/any-db-transaction/any-db-transaction-tests.ts
+++ b/any-db-transaction/any-db-transaction-tests.ts
@@ -1,7 +1,3 @@
-
-
-///
-
"use strict";
import anyDB = require("any-db");
diff --git a/apn/apn-tests.ts b/apn/apn-tests.ts
index b47259d76b..ea4bb34ae3 100644
--- a/apn/apn-tests.ts
+++ b/apn/apn-tests.ts
@@ -1,4 +1,3 @@
-///
import apn = require("apn");
//Hand made TypeScript tests
diff --git a/asana/asana-tests.ts b/asana/asana-tests.ts
index 0cadff6be0..e0735790fe 100644
--- a/asana/asana-tests.ts
+++ b/asana/asana-tests.ts
@@ -1,5 +1,4 @@
-
-///
+///
import * as asana from 'asana';
import * as util from 'util';
diff --git a/assert/assert-tests.ts b/assert/assert-tests.ts
index b01703e4d3..e918824b3d 100644
--- a/assert/assert-tests.ts
+++ b/assert/assert-tests.ts
@@ -13,7 +13,7 @@ assert.throws(() => {
}, undefined, "DODGED IT");
assert.doesNotThrow(() => {
- if (false) {
+ if (!!false) {
throw "a hammer at your face";
}
}, undefined, "What the...*crunch*");
diff --git a/assertsharp/assertsharp-tests.ts b/assertsharp/assertsharp-tests.ts
index 484e3ac774..7616725f8f 100644
--- a/assertsharp/assertsharp-tests.ts
+++ b/assertsharp/assertsharp-tests.ts
@@ -1,5 +1,3 @@
-///
-
import Assert from "assertsharp";
Assert.AreEqual(0, 0, "Pass");
diff --git a/assertsharp/assertsharp.d.ts b/assertsharp/index.d.ts
similarity index 99%
rename from assertsharp/assertsharp.d.ts
rename to assertsharp/index.d.ts
index 66849af3fa..a424b28944 100644
--- a/assertsharp/assertsharp.d.ts
+++ b/assertsharp/index.d.ts
@@ -3,7 +3,6 @@
// Definitions by: Bruno Leonardo Michels
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
export default class Assert {
static AreEqual(expected: T, actual: T, message?: string): void;
static AreNotEqual(notExpected: T, actual: T, message?: string): void;
diff --git a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts
index 7a3b9b9561..5ed27a833c 100644
--- a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts
+++ b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts
@@ -32,8 +32,8 @@ tableTodoItems.read()
//define simple handler used in callback calls for insert/update and delete
-function handlerInsUpd(e, i) { if (!e) data.push( i); };
-function handlerDelErr(e) { if (e) alert("ERROR: " + e); }
+function handlerInsUpd(e: any, i: any) { if (!e) data.push( i); };
+function handlerDelErr(e: any) { if (e) alert("ERROR: " + e); }
//insert one data passing info in POST + custom data in QueryString + simple callback handler
diff --git a/azure/azure-tests.ts b/azure/azure-tests.ts
index be81b87947..2d60803d3b 100644
--- a/azure/azure-tests.ts
+++ b/azure/azure-tests.ts
@@ -1,7 +1,4 @@
-///
-
-
-import Azure = require("azure");
+import Azure = require("azure");
var ts = new Azure.TableService();
diff --git a/backbone-associations/backbone-associations-tests.ts b/backbone-associations/backbone-associations-tests.ts
index 36dc6cbe87..eebd48895d 100644
--- a/backbone-associations/backbone-associations-tests.ts
+++ b/backbone-associations/backbone-associations-tests.ts
@@ -1,9 +1,9 @@
-///
-///
-
// borrowed from the Backbone.Associations tutorials
// separated out into modules to avoid namespace clashes
-namespace Backbone.Associations.Tests {
+
+import * as Backbone from 'backbone';
+
+namespace BackboneAssociationsTests {
namespace OneToOne {
class EmployeeWithManager extends Backbone.AssociatedModel {
constructor(options?) {
diff --git a/backbone-associations/backbone-associations.d.ts b/backbone-associations/backbone-associations.d.ts
index c093c01854..84532c482d 100644
--- a/backbone-associations/backbone-associations.d.ts
+++ b/backbone-associations/backbone-associations.d.ts
@@ -3,9 +3,9 @@
// Definitions by: Craig Brett
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+import * as Backbone from 'backbone';
-declare namespace Backbone {
+declare module 'backbone' {
export module Associations {
/** Defines a 1:Many relationship type */
export var Many: string;
diff --git a/backbone-associations/tsconfig.json b/backbone-associations/tsconfig.json
index effc71d799..5e684a6e2b 100644
--- a/backbone-associations/tsconfig.json
+++ b/backbone-associations/tsconfig.json
@@ -2,7 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
- "noImplicitAny": true,
+ "noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": "../"
}
diff --git a/backbone-relational/backbone-relational-tests.ts b/backbone-relational/backbone-relational-tests.ts
index a642c66716..90433cd153 100644
--- a/backbone-relational/backbone-relational-tests.ts
+++ b/backbone-relational/backbone-relational-tests.ts
@@ -1,6 +1,4 @@
-///
-///
-///
+import * as Backbone from 'backbone';
class House extends Backbone.RelationalModel {
// The 'relations' property, on the House's prototype. Initialized separately for each
diff --git a/backbone-relational/backbone-relational.d.ts b/backbone-relational/backbone-relational.d.ts
index d51991e55d..336ef15794 100644
--- a/backbone-relational/backbone-relational.d.ts
+++ b/backbone-relational/backbone-relational.d.ts
@@ -3,11 +3,11 @@
// Definitions by: Eirik Hoem
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
///
-///
-declare namespace Backbone {
+import * as Backbone from 'backbone';
+
+declare module 'backbone' {
class RelationalModel extends Model {
/**
* Do not use, prefer TypeScript's extend functionality.
diff --git a/backbone.layoutmanager/backbone.layoutmanager-tests.ts b/backbone.layoutmanager/backbone.layoutmanager-tests.ts
index 93c87cf197..30876abc23 100644
--- a/backbone.layoutmanager/backbone.layoutmanager-tests.ts
+++ b/backbone.layoutmanager/backbone.layoutmanager-tests.ts
@@ -1,7 +1,7 @@
-///
-///
///
+import * as Backbone from 'backbone';
+
// Example code.
class DisplayView extends Backbone.View {
constructor(options?: Backbone.ViewOptions) {
diff --git a/backbone.layoutmanager/backbone.layoutmanager.d.ts b/backbone.layoutmanager/backbone.layoutmanager.d.ts
index 2051458367..03bf23ac42 100644
--- a/backbone.layoutmanager/backbone.layoutmanager.d.ts
+++ b/backbone.layoutmanager/backbone.layoutmanager.d.ts
@@ -5,9 +5,10 @@
///
///
-///
-declare namespace Backbone {
+import * as Backbone from 'backbone';
+
+declare module 'backbone' {
interface LayoutOptions extends ViewOptions {
template?: string;
diff --git a/backbone.localstorage/backbone.localstorage.d.ts b/backbone.localstorage/backbone.localstorage.d.ts
index 25c9e4cb72..dcbb92174c 100644
--- a/backbone.localstorage/backbone.localstorage.d.ts
+++ b/backbone.localstorage/backbone.localstorage.d.ts
@@ -3,9 +3,13 @@
// Definitions by: Louis Grignon
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+import * as Backbone from 'backbone';
-declare namespace Backbone {
+declare global {
+ import Store = Backbone.LocalStorage;
+}
+
+declare module 'backbone' {
interface Serializer {
serialize(item: any): any;
deserialize(data: any): any;
@@ -47,5 +51,4 @@ declare namespace Backbone {
}
}
-import Store = Backbone.LocalStorage;
diff --git a/backbone.marionette/marionette.d.ts b/backbone.marionette/index.d.ts
similarity index 99%
rename from backbone.marionette/marionette.d.ts
rename to backbone.marionette/index.d.ts
index f6276831e4..fd49a89cc1 100644
--- a/backbone.marionette/marionette.d.ts
+++ b/backbone.marionette/index.d.ts
@@ -3,11 +3,13 @@
// Definitions by: Zeeshan Hamid , Natan Vivo , Sven Tschui
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+import * as Backbone from 'backbone';
+
+export as namespace Marionette;
+export = Marionette;
// declarations for Backbone.BabySitter and Backbone.Wreqr, different projects but included in MarionetteJS
-declare namespace Backbone {
-
+declare module 'backbone' {
// Backbone.BabySitter
class ChildViewContainer> {
@@ -1504,9 +1506,3 @@ declare namespace Marionette {
static getBehaviorClass(options: any, key: string): any;
}
}
-
-declare module 'backbone.marionette' {
- import Backbone = require('backbone');
-
- export = Marionette;
-}
diff --git a/backbone.marionette/marionette-tests.ts b/backbone.marionette/marionette-tests.ts
index 6a688467af..b5eb9d07c6 100644
--- a/backbone.marionette/marionette-tests.ts
+++ b/backbone.marionette/marionette-tests.ts
@@ -1,6 +1,7 @@
-///
+import * as Marionette from 'backbone.marionette';
+import * as Backbone from 'backbone';
-namespace Marionette.Tests {
+namespace MarionetteTests {
class DestroyWarn extends Marionette.Behavior {
// you can set default options
// just like you can in your Backbone Models
diff --git a/backbone.paginator/backbone.paginator-tests.ts b/backbone.paginator/backbone.paginator-tests.ts
index c05a07b9d1..50a4a0b247 100644
--- a/backbone.paginator/backbone.paginator-tests.ts
+++ b/backbone.paginator/backbone.paginator-tests.ts
@@ -1,7 +1,8 @@
///
-///
///
+import * as Backbone from 'backbone';
+
namespace BackbonePaginatorTests {
class TestModel extends Backbone.Model{};
diff --git a/backbone.paginator/backbone.paginator.d.ts b/backbone.paginator/backbone.paginator.d.ts
index b256919893..521ccda8bf 100644
--- a/backbone.paginator/backbone.paginator.d.ts
+++ b/backbone.paginator/backbone.paginator.d.ts
@@ -3,10 +3,9 @@
// Definitions by: Nyamazing
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
-
-declare namespace Backbone {
+import * as Backbone from 'backbone';
+declare module 'backbone' {
interface PageableState {
firstPage?: number;
lastPage?: number;
diff --git a/backbone.radio/backbone.radio.d.ts b/backbone.radio/backbone.radio.d.ts
index 50895b0275..8b5b2e6b74 100644
--- a/backbone.radio/backbone.radio.d.ts
+++ b/backbone.radio/backbone.radio.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Peter Palotas
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+HTMLElement
declare namespace Backbone {
interface Radio {
diff --git a/backbone/backbone-tests.ts b/backbone/backbone-tests.ts
index 3669a6c4e1..128ab5cf0f 100644
--- a/backbone/backbone-tests.ts
+++ b/backbone/backbone-tests.ts
@@ -1,4 +1,3 @@
-///
///
function test_events() {
diff --git a/backbone/backbone-with-lodash-tests.ts b/backbone/backbone-with-lodash-tests.ts
index e0b04880bf..0082eb6963 100644
--- a/backbone/backbone-with-lodash-tests.ts
+++ b/backbone/backbone-with-lodash-tests.ts
@@ -1,314 +1,315 @@
///
///
-///
-function test_events() {
+namespace WithLoDash {
+ function test_events() {
- var object = new Backbone.Events();
- object.on("alert", (eventName: string) => alert("Triggered " + eventName));
+ var object = new Backbone.Events();
+ object.on("alert", (eventName: string) => alert("Triggered " + eventName));
- object.trigger("alert", "an event");
+ object.trigger("alert", "an event");
- var onChange = () => alert('whatever');
- var context: any;
+ 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"
- }
+ object.off("change", onChange);
+ object.off("change");
+ object.off(null, onChange);
+ object.off(null, null, context);
+ object.off();
}
- 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
- }
+ class SettingDefaults extends Backbone.Model {
- // or set it like this
- initialize() {
- this.defaults = {
- name: "Joe"
- }
+ // 'defaults' could be set in one of the following ways:
- }
-
- // 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");
-}
-
-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);
-}
-
-//////////
-
-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');
+ defaults() {
+ return {
+ name: "Joe"
}
}
- function test_fetch() {
- var model = new Employee({ id: 1 });
- model.fetch({
- success: () => { },
- error: () => { }
- });
+ 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
}
- function test_set() {
- var model = new Employee;
- model.set({ name: 'JoeDoe', age: 21 }, { validate: false });
- model.set('name', 'JoeDoes', { validate: false });
+ // or set it like this
+ initialize() {
+ this.defaults = {
+ name: "Joe"
+ }
+
}
- function test_destroy() {
- var model = new Employee;
- model.destroy({
- wait: true,
- success: (m?, response?, options?) => { },
- error: (m?, jqxhr?, options?) => { }
- });
+ // same patterns could be used for setting 'Router.routes' and 'View.events'
+ }
- model.destroy({
- success: (m?, response?, options?) => { },
- error: (m?, jqxhr?) => { }
- });
+ class Sidebar extends Backbone.Model {
- model.destroy({
- success: () => { },
- error: (m?, jqxhr?) => { }
- });
+ 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);
}
- function test_save() {
- var model = new Employee;
+ set(attributes: any, options?: any): Backbone.Model {
+ return Backbone.Model.prototype.set.call(this, attributes, options);
+ }
+ }
- model.save({
- name: 'Joe Doe',
- age: 21
- },
- {
+ 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");
+ }
+
+ 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);
+ }
+
+ //////////
+
+ 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,
- validate: false,
success: (m?, response?, options?) => { },
error: (m?, jqxhr?, options?) => { }
});
- model.save({
- name: 'Joe Doe',
- age: 21
- },
- {
+ 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 })
+ }
}
- function test_validate() {
- var model = new Employee;
+ namespace Collection {
+ function test_fetch() {
+ var collection = new EmployeeCollection;
+ collection.fetch({ reset: true });
+ }
- model.validate({ name: 'JoeDoe', age: 21 }, { validateAge: false })
+ 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);
+ }
}
}
-
- 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);
- }
- }
-}
+}
\ No newline at end of file
diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts
deleted file mode 100644
index 65e273a61f..0000000000
--- a/backbone/backbone.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-// Type definitions for Backbone 1.0.0
-// Project: http://backbonejs.org/
-// Definitions by: Boris Yankov , Natan Vivo
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-///
-///
diff --git a/backbone/backbone-global.d.ts b/backbone/index.d.ts
similarity index 99%
rename from backbone/backbone-global.d.ts
rename to backbone/index.d.ts
index b42b6208ad..2dd9f5ff26 100644
--- a/backbone/backbone-global.d.ts
+++ b/backbone/index.d.ts
@@ -5,6 +5,11 @@
///
+export = Backbone;
+export as namespace Backbone;
+
+import * as _ from 'underscore';
+
declare namespace Backbone {
interface AddOptions extends Silenceable {
@@ -388,7 +393,3 @@ declare namespace Backbone {
function noConflict(): typeof Backbone;
var $: JQueryStatic;
}
-
-declare module "backbone" {
- export = Backbone;
-}
diff --git a/backgrid/backgrid-tests.ts b/backgrid/backgrid-tests.ts
index f2a41a5587..7c575fc9a6 100644
--- a/backgrid/backgrid-tests.ts
+++ b/backgrid/backgrid-tests.ts
@@ -1,7 +1,7 @@
-///
-///
///
+import * as Backgrid from 'backgrid';
+import * as Backbone from 'backbone';
/*
Uses getters and setters and requires ES >= 5
diff --git a/backgrid/backgrid.d.ts b/backgrid/index.d.ts
similarity index 96%
rename from backgrid/backgrid.d.ts
rename to backgrid/index.d.ts
index d208faf415..83dc86bcbe 100644
--- a/backgrid/backgrid.d.ts
+++ b/backgrid/index.d.ts
@@ -3,7 +3,10 @@
// Definitions by: Jeremy Lujan
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+import * as Backbone from 'backbone';
+
+export as namespace Backgrid;
+export = Backgrid;
declare namespace Backgrid {
@@ -122,7 +125,3 @@ declare namespace Backgrid {
}
}
-
-declare module "backgrid" {
- export = Backgrid;
-}
diff --git a/backgrid/tsconfig.json b/backgrid/tsconfig.json
index effc71d799..5e684a6e2b 100644
--- a/backgrid/tsconfig.json
+++ b/backgrid/tsconfig.json
@@ -2,7 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
- "noImplicitAny": true,
+ "noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": "../"
}
diff --git a/bcryptjs/bcryptjs-tests.ts b/bcryptjs/bcryptjs-tests.ts
index acfc48e439..83b67c17cc 100644
--- a/bcryptjs/bcryptjs-tests.ts
+++ b/bcryptjs/bcryptjs-tests.ts
@@ -1,5 +1,3 @@
-///
-
import bcryptjs = require("bcryptjs");
let str: string;
diff --git a/benchmark/benchmark-tests.ts b/benchmark/benchmark-tests.ts
index 363e522b0b..8fbe2b1d92 100644
--- a/benchmark/benchmark-tests.ts
+++ b/benchmark/benchmark-tests.ts
@@ -1,4 +1,3 @@
-///
import Benchmark = require("benchmark");
var suite = new Benchmark.Suite;
diff --git a/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts b/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts
index a677cd2a4d..9a7ce37577 100644
--- a/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts
+++ b/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Eric Todd
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace Microsoft.Maps.AdvancedShapes {
diff --git a/bingmaps/Microsoft.Maps.Directions.d.ts b/bingmaps/Microsoft.Maps.Directions.d.ts
index fd0622f880..b2e1ce27cb 100644
--- a/bingmaps/Microsoft.Maps.Directions.d.ts
+++ b/bingmaps/Microsoft.Maps.Directions.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Eric Todd
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace Microsoft.Maps.Directions {
diff --git a/bingmaps/Microsoft.Maps.Search.d.ts b/bingmaps/Microsoft.Maps.Search.d.ts
index d13163ef25..8d198ee9af 100644
--- a/bingmaps/Microsoft.Maps.Search.d.ts
+++ b/bingmaps/Microsoft.Maps.Search.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Eric Todd
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace Microsoft.Maps.Search {
diff --git a/bingmaps/Microsoft.Maps.Traffic.d.ts b/bingmaps/Microsoft.Maps.Traffic.d.ts
index 1451c09000..de62786176 100644
--- a/bingmaps/Microsoft.Maps.Traffic.d.ts
+++ b/bingmaps/Microsoft.Maps.Traffic.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Eric Todd
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace Microsoft.Maps.Traffic {
diff --git a/bingmaps/Microsoft.Maps.VenueMaps.d.ts b/bingmaps/Microsoft.Maps.VenueMaps.d.ts
index 2d67bb3e69..f267ea4b25 100644
--- a/bingmaps/Microsoft.Maps.VenueMaps.d.ts
+++ b/bingmaps/Microsoft.Maps.VenueMaps.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Eric Todd
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace Microsoft.Maps.VenueMaps {
diff --git a/bingmaps/bingmaps-tests.ts b/bingmaps/bingmaps-tests.ts
index 08b3decd5b..c595fa1f6f 100644
--- a/bingmaps/bingmaps-tests.ts
+++ b/bingmaps/bingmaps-tests.ts
@@ -1,4 +1,4 @@
-///
+///
///
///
///
diff --git a/blissfuljs/blissfuljs.d.ts b/blissfuljs/blissfuljs.d.ts
index 9338929f16..af90d97caf 100644
--- a/blissfuljs/blissfuljs.d.ts
+++ b/blissfuljs/blissfuljs.d.ts
@@ -26,13 +26,13 @@ declare namespace BlissNS {
create(tag: "audio"): HTMLAudioElement;
create(tag: "base"): HTMLBaseElement;
create(tag: "basefont"): HTMLBaseFontElement;
- create(tag: "blockquote"): HTMLBlockElement;
+ create(tag: "blockquote"): HTMLQuoteElement;
create(tag: "body"): HTMLBodyElement;
create(tag: "br"): HTMLBRElement;
create(tag: "button"): HTMLButtonElement;
create(tag: "canvas"): HTMLCanvasElement;
create(tag: "datalist"): HTMLDataListElement;
- create(tag: "dd"): HTMLDDElement;
+ create(tag: "dd"): HTMLElement;
create(tag: "directory"): HTMLDirectoryElement;
create(tag: "div"): HTMLDivElement;
create(tag: "embeded"): HTMLEmbedElement;
@@ -80,13 +80,13 @@ declare namespace BlissNS {
create(tag: "audio", options: Object): HTMLAudioElement;
create(tag: "base", options: Object): HTMLBaseElement;
create(tag: "basefont", options: Object): HTMLBaseFontElement;
- create(tag: "blockquote", options: Object): HTMLBlockElement;
+ create(tag: "blockquote", options: Object): HTMLQuoteElement;
create(tag: "body", options: Object): HTMLBodyElement;
create(tag: "br", options: Object): HTMLBRElement;
create(tag: "button", options: Object): HTMLButtonElement;
create(tag: "canvas", options: Object): HTMLCanvasElement;
create(tag: "datalist", options: Object): HTMLDataListElement;
- create(tag: "dd", options: Object): HTMLDDElement;
+ create(tag: "dd", options: Object): HTMLElement;
create(tag: "directory", options: Object): HTMLDirectoryElement;
create(tag: "div", options: Object): HTMLDivElement;
create(tag: "embeded", options: Object): HTMLEmbedElement;
@@ -375,44 +375,44 @@ declare namespace BlissNS {
getBoundingClientRect(): ClientRect;
getClientRects(): ClientRectList;
getElementsByTagName(name: "a"): NodeListOf;
- getElementsByTagName(name: "abbr"): NodeListOf;
- getElementsByTagName(name: "acronym"): NodeListOf;
- getElementsByTagName(name: "address"): NodeListOf;
+ getElementsByTagName(name: "abbr"): NodeListOf;
+ getElementsByTagName(name: "acronym"): NodeListOf;
+ getElementsByTagName(name: "address"): NodeListOf;
getElementsByTagName(name: "applet"): NodeListOf;
getElementsByTagName(name: "area"): NodeListOf;
getElementsByTagName(name: "article"): NodeListOf;
getElementsByTagName(name: "aside"): NodeListOf;
getElementsByTagName(name: "audio"): NodeListOf;
- getElementsByTagName(name: "b"): NodeListOf;
+ getElementsByTagName(name: "b"): NodeListOf;
getElementsByTagName(name: "base"): NodeListOf;
getElementsByTagName(name: "basefont"): NodeListOf;
- getElementsByTagName(name: "bdo"): NodeListOf;
- getElementsByTagName(name: "big"): NodeListOf;
- getElementsByTagName(name: "blockquote"): NodeListOf;
+ getElementsByTagName(name: "bdo"): NodeListOf;
+ getElementsByTagName(name: "big"): NodeListOf;
+ getElementsByTagName(name: "blockquote"): NodeListOf;
getElementsByTagName(name: "body"): NodeListOf;
getElementsByTagName(name: "br"): NodeListOf;
getElementsByTagName(name: "button"): NodeListOf;
getElementsByTagName(name: "canvas"): NodeListOf;
getElementsByTagName(name: "caption"): NodeListOf;
- getElementsByTagName(name: "center"): NodeListOf;
+ getElementsByTagName(name: "center"): NodeListOf;
getElementsByTagName(name: "circle"): NodeListOf;
- getElementsByTagName(name: "cite"): NodeListOf;
+ getElementsByTagName(name: "cite"): NodeListOf;
getElementsByTagName(name: "clippath"): NodeListOf;
- getElementsByTagName(name: "code"): NodeListOf;
+ getElementsByTagName(name: "code"): NodeListOf;
getElementsByTagName(name: "col"): NodeListOf;
getElementsByTagName(name: "colgroup"): NodeListOf;
getElementsByTagName(name: "datalist"): NodeListOf;
- getElementsByTagName(name: "dd"): NodeListOf;
+ getElementsByTagName(name: "dd"): NodeListOf;
getElementsByTagName(name: "defs"): NodeListOf;
getElementsByTagName(name: "del"): NodeListOf;
getElementsByTagName(name: "desc"): NodeListOf;
- getElementsByTagName(name: "dfn"): NodeListOf;
+ getElementsByTagName(name: "dfn"): NodeListOf;
getElementsByTagName(name: "dir"): NodeListOf;
getElementsByTagName(name: "div"): NodeListOf;
getElementsByTagName(name: "dl"): NodeListOf;
- getElementsByTagName(name: "dt"): NodeListOf;
+ getElementsByTagName(name: "dt"): NodeListOf;
getElementsByTagName(name: "ellipse"): NodeListOf;
- getElementsByTagName(name: "em"): NodeListOf;
+ getElementsByTagName(name: "em"): NodeListOf;
getElementsByTagName(name: "embed"): NodeListOf;
getElementsByTagName(name: "feblend"): NodeListOf;
getElementsByTagName(name: "fecolormatrix"): NodeListOf;
@@ -460,22 +460,22 @@ declare namespace BlissNS {
getElementsByTagName(name: "hgroup"): NodeListOf;
getElementsByTagName(name: "hr"): NodeListOf;
getElementsByTagName(name: "html"): NodeListOf;
- getElementsByTagName(name: "i"): NodeListOf;
+ getElementsByTagName(name: "i"): NodeListOf;
getElementsByTagName(name: "iframe"): NodeListOf;
getElementsByTagName(name: "image"): NodeListOf;
getElementsByTagName(name: "img"): NodeListOf;
getElementsByTagName(name: "input"): NodeListOf;
getElementsByTagName(name: "ins"): NodeListOf;
- getElementsByTagName(name: "isindex"): NodeListOf;
- getElementsByTagName(name: "kbd"): NodeListOf;
- getElementsByTagName(name: "keygen"): NodeListOf;
+ getElementsByTagName(name: "isindex"): NodeListOf;
+ getElementsByTagName(name: "kbd"): NodeListOf;
+ getElementsByTagName(name: "keygen"): NodeListOf;
getElementsByTagName(name: "label"): NodeListOf;
getElementsByTagName(name: "legend"): NodeListOf;
getElementsByTagName(name: "li"): NodeListOf;
getElementsByTagName(name: "line"): NodeListOf;
getElementsByTagName(name: "lineargradient"): NodeListOf;
getElementsByTagName(name: "link"): NodeListOf;
- getElementsByTagName(name: "listing"): NodeListOf;
+ getElementsByTagName(name: "listing"): NodeListOf;
getElementsByTagName(name: "map"): NodeListOf;
getElementsByTagName(name: "mark"): NodeListOf;
getElementsByTagName(name: "marker"): NodeListOf;
@@ -485,8 +485,8 @@ declare namespace BlissNS {
getElementsByTagName(name: "meta"): NodeListOf;
getElementsByTagName(name: "metadata"): NodeListOf;
getElementsByTagName(name: "nav"): NodeListOf;
- getElementsByTagName(name: "nextid"): NodeListOf;
- getElementsByTagName(name: "nobr"): NodeListOf;
+ getElementsByTagName(name: "nextid"): NodeListOf;
+ getElementsByTagName(name: "nobr"): NodeListOf;
getElementsByTagName(name: "noframes"): NodeListOf;
getElementsByTagName(name: "noscript"): NodeListOf;
getElementsByTagName(name: "object"): NodeListOf;
@@ -497,7 +497,7 @@ declare namespace BlissNS {
getElementsByTagName(name: "param"): NodeListOf;
getElementsByTagName(name: "path"): NodeListOf;
getElementsByTagName(name: "pattern"): NodeListOf;
- getElementsByTagName(name: "plaintext"): NodeListOf;
+ getElementsByTagName(name: "plaintext"): NodeListOf;
getElementsByTagName(name: "polygon"): NodeListOf;
getElementsByTagName(name: "polyline"): NodeListOf;
getElementsByTagName(name: "pre"): NodeListOf;
@@ -505,22 +505,22 @@ declare namespace BlissNS {
getElementsByTagName(name: "q"): NodeListOf;
getElementsByTagName(name: "radialgradient"): NodeListOf;
getElementsByTagName(name: "rect"): NodeListOf;
- getElementsByTagName(name: "rt"): NodeListOf;
- getElementsByTagName(name: "ruby"): NodeListOf;
- getElementsByTagName(name: "s"): NodeListOf;
- getElementsByTagName(name: "samp"): NodeListOf;
+ getElementsByTagName(name: "rt"): NodeListOf;
+ getElementsByTagName(name: "ruby"): NodeListOf;
+ getElementsByTagName(name: "s"): NodeListOf;
+ getElementsByTagName(name: "samp"): NodeListOf;
getElementsByTagName(name: "script"): NodeListOf;
getElementsByTagName(name: "section"): NodeListOf;
getElementsByTagName(name: "select"): NodeListOf;
- getElementsByTagName(name: "small"): NodeListOf;
+ getElementsByTagName(name: "small"): NodeListOf;
getElementsByTagName(name: "source"): NodeListOf;
getElementsByTagName(name: "span"): NodeListOf;
getElementsByTagName(name: "stop"): NodeListOf;
- getElementsByTagName(name: "strike"): NodeListOf;
- getElementsByTagName(name: "strong"): NodeListOf;
+ getElementsByTagName(name: "strike"): NodeListOf;
+ getElementsByTagName(name: "strong"): NodeListOf;
getElementsByTagName(name: "style"): NodeListOf;
- getElementsByTagName(name: "sub"): NodeListOf;
- getElementsByTagName(name: "sup"): NodeListOf;
+ getElementsByTagName(name: "sub"): NodeListOf;
+ getElementsByTagName(name: "sup"): NodeListOf;
getElementsByTagName(name: "svg"): NodeListOf;
getElementsByTagName(name: "switch"): NodeListOf;
getElementsByTagName(name: "symbol"): NodeListOf;
@@ -537,11 +537,11 @@ declare namespace BlissNS {
getElementsByTagName(name: "tr"): NodeListOf;
getElementsByTagName(name: "track"): NodeListOf;
getElementsByTagName(name: "tspan"): NodeListOf;
- getElementsByTagName(name: "tt"): NodeListOf;
- getElementsByTagName(name: "u"): NodeListOf;
+ getElementsByTagName(name: "tt"): NodeListOf;
+ getElementsByTagName(name: "u"): NodeListOf;
getElementsByTagName(name: "ul"): NodeListOf;
getElementsByTagName(name: "use"): NodeListOf;
- getElementsByTagName(name: "var"): NodeListOf;
+ getElementsByTagName(name: "var"): NodeListOf;
getElementsByTagName(name: "video"): NodeListOf;
getElementsByTagName(name: "view"): NodeListOf;
getElementsByTagName(name: "wbr"): NodeListOf;
diff --git a/bootstrap.paginator/bootstrap.paginator.d.ts b/bootstrap.paginator/bootstrap.paginator.d.ts
index 805850c88d..57add3458d 100644
--- a/bootstrap.paginator/bootstrap.paginator.d.ts
+++ b/bootstrap.paginator/bootstrap.paginator.d.ts
@@ -5,25 +5,24 @@
///
-interface PaginatorOptions{
+interface PaginatorOptions {
alignment?: string;
size?: string;
- itemContainerClass?: (type, page, current) => string;
+ itemContainerClass?: (type: string, page: number, current: number) => string;
currentPage?: number;
numberOfPages?: number;
totalPages?: number;
- pageUrl?: (type, page, current) => string;
+ pageUrl?: (type: string, page: number, current: number) => string;
shouldShowPage?: boolean;
- itemTexts?: (type:string, page:number, current:number) => string;
- tooltipTitles?: (type, page, current) => string;
+ itemTexts?: (type: string, page: number, current: number) => string;
+ tooltipTitles?: (type: string, page: number, current: number) => string;
useBootstrapTooltip?: boolean;
bootstrapTooltipOptions?: {};
bootstrapMajorVersion?: number;
- onPageClicked?: (event, originalEvent, type, page) => void;
- onPageChanged?: (event, originalEvent, type, page) => void;
+ onPageClicked?: (event: any, originalEvent: any, type: string, page: number) => void;
+ onPageChanged?: (event: any, originalEvent: any, type: string, page: number) => void;
}
interface JQuery {
- bootstrapPaginator(): JQuery;
- bootstrapPaginator(options: PaginatorOptions): JQuery;
+ bootstrapPaginator(options?: PaginatorOptions): JQuery;
}
diff --git a/bootstrap.v3.datetimepicker/tsconfig.json b/bootstrap.v3.datetimepicker/tsconfig.json
index effc71d799..3a7c6b28cb 100644
--- a/bootstrap.v3.datetimepicker/tsconfig.json
+++ b/bootstrap.v3.datetimepicker/tsconfig.json
@@ -1,4 +1,5 @@
{
+ "files": ["bootstrap.v3.datetimepicker.d.ts", "bootstrap.v3.datetimepicker-tests.ts"],
"compilerOptions": {
"module": "commonjs",
"target": "es6",
diff --git a/breeze/breeze-tests.ts b/breeze/breeze-tests.ts
index 022f4e3c16..537aae5a5d 100644
--- a/breeze/breeze-tests.ts
+++ b/breeze/breeze-tests.ts
@@ -133,7 +133,7 @@ function test_entityManager() {
metadataStore: metadataStore
});
- return new breeze.QueryOptions({
+ new breeze.QueryOptions({
mergeStrategy: null,
fetchStrategy: this.fetchStrategy
});
@@ -415,25 +415,25 @@ function test_entityQuery() {
function test_entityState() {
var anEntity: breeze.Entity;
var es = anEntity.entityAspect.entityState;
- return es.isAdded();
- return es === breeze.EntityState.Added;
+ es.isAdded();
+ es === breeze.EntityState.Added;
var es = anEntity.entityAspect.entityState;
- return es.isAddedModifiedOrDeleted();
- return es === breeze.EntityState.Added || es === breeze.EntityState.Modified || es === breeze.EntityState.Deleted;
+ es.isAddedModifiedOrDeleted();
+ es === breeze.EntityState.Added || es === breeze.EntityState.Modified || es === breeze.EntityState.Deleted;
var es = anEntity.entityAspect.entityState;
- return es.isDeleted();
- return es === breeze.EntityState.Deleted;
+ es.isDeleted();
+ es === breeze.EntityState.Deleted;
var es = anEntity.entityAspect.entityState;
- return es.isDetached();
- return es === breeze.EntityState.Detached;
+ es.isDetached();
+ es === breeze.EntityState.Detached;
var es = anEntity.entityAspect.entityState;
- return es.isModified();
- return es === breeze.EntityState.Modified;
+ es.isModified();
+ es === breeze.EntityState.Modified;
var es = anEntity.entityAspect.entityState;
- return es.isUnchanged();
- return es === breeze.EntityState.Unchanged;
+ es.isUnchanged();
+ es === breeze.EntityState.Unchanged;
var es = anEntity.entityAspect.entityState;
- return es.isUnchangedOrModified();
+ es.isUnchangedOrModified();
return es === breeze.EntityState.Unchanged || es === breeze.EntityState.Modified;
}
diff --git a/browser-sync/browser-sync-tests.ts b/browser-sync/browser-sync-tests.ts
index 822c941d9f..45cfd11c30 100644
--- a/browser-sync/browser-sync-tests.ts
+++ b/browser-sync/browser-sync-tests.ts
@@ -1,4 +1,3 @@
-///
import browserSync = require("browser-sync");
(() => {
diff --git a/browserify/browserify-tests.ts b/browserify/browserify-tests.ts
index b4096a7f98..68ebb59c7f 100644
--- a/browserify/browserify-tests.ts
+++ b/browserify/browserify-tests.ts
@@ -1,5 +1,3 @@
-///
-
import browserify = require("browserify");
import fs = require("fs");
import stream = require('stream');
diff --git a/bson/bson-tests.ts b/bson/bson-tests.ts
index a454ed2366..e1e1c5d323 100644
--- a/bson/bson-tests.ts
+++ b/bson/bson-tests.ts
@@ -1,5 +1,3 @@
-///
-
import * as bson from 'bson';
let BSON = new bson.BSONPure.BSON();
diff --git a/bucks/bucks-tests.ts b/bucks/bucks-tests.ts
index 5ebbd882cf..6062494231 100644
--- a/bucks/bucks-tests.ts
+++ b/bucks/bucks-tests.ts
@@ -98,7 +98,6 @@ function error() {
var b = new Bucks();
b.then(function start() {
throw new Error('error in start');
- return 'start';
}).error(function onError(e, next) {
// e => 'error in start'
return next();
diff --git a/bull/bull-tests.tsx b/bull/bull-tests.tsx
index bd25efc0c9..d2b5249254 100644
--- a/bull/bull-tests.tsx
+++ b/bull/bull-tests.tsx
@@ -87,16 +87,17 @@ interface VideoJob extends Queue.Job {
videoQueue.process( ( job: VideoJob ) => { // don't forget to remove the done callback!
// Simply return a promise
- return fetchVideo( job.data.url ).then( transcodeVideo );
+ fetchVideo( job.data.url ).then( transcodeVideo );
// Handles promise rejection
- return Promise.reject( new Error( 'error transcoding' ) );
+ Promise.reject( new Error( 'error transcoding' ) );
// Passes the value the promise is resolved with to the "completed" event
- return Promise.resolve( { framerate: 29.5 /* etc... */ } );
+ Promise.resolve( { framerate: 29.5 /* etc... */ } );
+
+ // same as
+ Promise.reject( new Error( 'some unexpected error' ) );
// If the job throws an unhandled exception it is also handled correctly
throw new Error( 'some unexpected error' );
- // same as
- return Promise.reject( new Error( 'some unexpected error' ) );
} );
diff --git a/bunyan-logentries/bunyan-logentries-tests.ts b/bunyan-logentries/bunyan-logentries-tests.ts
index 8a9a1ab27a..a644d028e4 100644
--- a/bunyan-logentries/bunyan-logentries-tests.ts
+++ b/bunyan-logentries/bunyan-logentries-tests.ts
@@ -1,6 +1,3 @@
-
-///
-
import bunyan = require("bunyan");
import bunyanLogentries = require("bunyan-logentries");
diff --git a/bytes/bytes-tests.ts b/bytes/bytes-tests.ts
index 4a981aee47..8df0bcbf18 100644
--- a/bytes/bytes-tests.ts
+++ b/bytes/bytes-tests.ts
@@ -1,6 +1,4 @@
-///
-
-import bytes = require('bytes');
+import bytes = require('bytes');
// 1024*1024 = 1048576
console.log(bytes(104857));
diff --git a/chocolatechipjs/chocolatechipjs.d.ts b/chocolatechipjs/chocolatechipjs.d.ts
index df54d62951..9ac2ae8c52 100644
--- a/chocolatechipjs/chocolatechipjs.d.ts
+++ b/chocolatechipjs/chocolatechipjs.d.ts
@@ -677,6 +677,11 @@ interface ChocolateChipElementArray extends Array {
*/
hasnt(contained: HTMLElement): ChocolateChipElementArray;
+ /**
+ * Same overload as is present in the base type
+ */
+ find(predicate: (value: HTMLElement, index: number, obj: HTMLElement[]) => boolean, thisArg?: any): HTMLElement;
+
/**
* Get the descendants of each element in the current set of matched elements, filtered by a selector or element.
*
@@ -1247,11 +1252,6 @@ interface Promise {
}
interface PromiseConstructor {
- /**
- * A reference to the prototype.
- */
- prototype: Promise;
-
/**
* Creates a new Promise.
*
diff --git a/chrome/tsconfig.json b/chrome/tsconfig.json
index effc71d799..5e684a6e2b 100644
--- a/chrome/tsconfig.json
+++ b/chrome/tsconfig.json
@@ -2,7 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
- "noImplicitAny": true,
+ "noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": "../"
}
diff --git a/cli/cli-tests.ts b/cli/cli-tests.ts
index fd84afc0f4..294cb7dd8b 100644
--- a/cli/cli-tests.ts
+++ b/cli/cli-tests.ts
@@ -92,10 +92,10 @@ console.log(cli.args);
// ==============================================================================
//You can (optionally) boost the width of output with:
-cli.width = 120;
+// cli.width = 120;
//You can also adjust the width of the options/command definitions
-cli.option_width = 25;
+// cli.option_width = 25;
var long_desc = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s '
+ 'standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make'
diff --git a/closure-compiler/closure-compiler-tests.ts b/closure-compiler/closure-compiler-tests.ts
index e0bd650a36..3dd827a0f8 100644
--- a/closure-compiler/closure-compiler-tests.ts
+++ b/closure-compiler/closure-compiler-tests.ts
@@ -1,4 +1,3 @@
-///
import {compile} from 'closure-compiler';
compile('some.source()', {'check-only': null},
diff --git a/closure-compiler/closure-compiler.d.ts b/closure-compiler/index.d.ts
similarity index 53%
rename from closure-compiler/closure-compiler.d.ts
rename to closure-compiler/index.d.ts
index 9f97f74081..a253dca835 100644
--- a/closure-compiler/closure-compiler.d.ts
+++ b/closure-compiler/index.d.ts
@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-type Callback = (err: Error, stdout: string, stderr: string) => any;
-declare function compile(src: string, callback: Callback): void;
-declare function compile(src: string, options: { [k: string]: string | string[] },
+export type Callback = (err: Error, stdout: string, stderr: string) => any;
+export function compile(src: string, callback: Callback): void;
+export function compile(src: string, options: { [k: string]: string | string[] },
callback: Callback): void;
diff --git a/colors/colors.d.ts b/colors/colors.d.ts
index 07c4c19e06..6814edd66a 100644
--- a/colors/colors.d.ts
+++ b/colors/colors.d.ts
@@ -108,7 +108,6 @@ interface String {
bgWhite: string;
reset: string;
- bold: string;
dim: string;
italic: string;
underline: string;
diff --git a/complex/complex-tests.ts b/complex/complex-tests.ts
index 46a5f5c69b..23074d104d 100644
--- a/complex/complex-tests.ts
+++ b/complex/complex-tests.ts
@@ -1,5 +1,3 @@
-///
-
import Complex from 'complex';
var z: Complex = new Complex(2, 3);
diff --git a/complex/complex.d.ts b/complex/index.d.ts
similarity index 99%
rename from complex/complex.d.ts
rename to complex/index.d.ts
index ebaa6565f9..90ad161ffc 100644
--- a/complex/complex.d.ts
+++ b/complex/index.d.ts
@@ -3,8 +3,7 @@
// Definitions by: Aya Morisawa
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-export declare default class Complex {
+export default class Complex {
/**
* @param real The real part of the number
* @param im The imaginary part of the number
diff --git a/connect-mongo/index.d.ts b/connect-mongo/index.d.ts
index a96a34d47a..445f033c52 100644
--- a/connect-mongo/index.d.ts
+++ b/connect-mongo/index.d.ts
@@ -3,12 +3,8 @@
// Definitions by: Mizuki Yamamoto
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-
-///
///
-
import * as express from 'express';
import * as mongoose from 'mongoose';
import * as mongodb from 'mongodb';
diff --git a/connect-slashes/connect-slashes-tests.ts b/connect-slashes/connect-slashes-tests.ts
index f4c8ac965c..f94705ca29 100644
--- a/connect-slashes/connect-slashes-tests.ts
+++ b/connect-slashes/connect-slashes-tests.ts
@@ -1,5 +1,3 @@
-///
-
import express = require('express');
import slashes = require('connect-slashes');
diff --git a/connect-timeout/connect-timeout-tests.ts b/connect-timeout/connect-timeout-tests.ts
index c65eb35a2c..7071e9d1d6 100644
--- a/connect-timeout/connect-timeout-tests.ts
+++ b/connect-timeout/connect-timeout-tests.ts
@@ -1,8 +1,5 @@
///
-///
-
-
import * as express from "express";
import * as timeout from "connect-timeout";
import * as bodyParser from "body-parser";
diff --git a/connect-timeout/connect-timeout.d.ts b/connect-timeout/connect-timeout.d.ts
index 51423e7f09..80b3c56a6c 100644
--- a/connect-timeout/connect-timeout.d.ts
+++ b/connect-timeout/connect-timeout.d.ts
@@ -3,8 +3,6 @@
// Definitions by: Cyril Schumacher
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-
declare namespace Express {
export interface Request {
/**
@@ -21,7 +19,7 @@ declare namespace Express {
}
declare module "connect-timeout" {
- import express = require("../express");
+ import express = require("express");
namespace e {
/**
diff --git a/cordova/cordova-tests.ts b/cordova/cordova-tests.ts
index 7e97305a25..f9179ae7ac 100644
--- a/cordova/cordova-tests.ts
+++ b/cordova/cordova-tests.ts
@@ -269,8 +269,6 @@ window.plugins.pushNotification.unregister(() => { }, () => { });
// Network Plugin
//----------------------------------------------------------------------
-console.log('Connection type is: ' + navigator.connectionSpeed);
-
var connType = navigator.connection.type;
if (connType == Connection.WIFI) {
console.log('Congratulations, you\'re with fast Internet!');
diff --git a/core-decorators/tsconfig.json b/core-decorators/tsconfig.json
index effc71d799..cf91544f8f 100644
--- a/core-decorators/tsconfig.json
+++ b/core-decorators/tsconfig.json
@@ -4,6 +4,7 @@
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
- "baseUrl": "../"
+ "baseUrl": "../",
+ "experimentalDecorators": true
}
}
\ No newline at end of file
diff --git a/core-js/tsconfig.json b/core-js/tsconfig.json
index effc71d799..e8a71bb27d 100644
--- a/core-js/tsconfig.json
+++ b/core-js/tsconfig.json
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
- "target": "es6",
+ "target": "es5",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../"
diff --git a/couchbase/couchbase-tests.ts b/couchbase/couchbase-tests.ts
index a1a3ee6bba..547133754b 100644
--- a/couchbase/couchbase-tests.ts
+++ b/couchbase/couchbase-tests.ts
@@ -1,5 +1,3 @@
-///
-
import couchbase = require('couchbase');
var cluster = new couchbase.Cluster('couchbase://127.0.0.1');
var bucket = cluster.openBucket('default');
diff --git a/cross-storage/cross-storage-tests.ts b/cross-storage/cross-storage-tests.ts
index 9e6b4204ab..66373c79db 100644
--- a/cross-storage/cross-storage-tests.ts
+++ b/cross-storage/cross-storage-tests.ts
@@ -1,8 +1,5 @@
-///
-
import { CrossStorageClient, CrossStorageHub } from "cross-storage";
-
const client = new CrossStorageClient("http://foo.com", {
timeout: 0,
frameId: "null"
diff --git a/crossfilter/crossfilter-tests.ts b/crossfilter/crossfilter-tests.ts
index fb80ddd9bb..bbde39494d 100644
--- a/crossfilter/crossfilter-tests.ts
+++ b/crossfilter/crossfilter-tests.ts
@@ -10,24 +10,24 @@ interface Payment {
}
var payments = crossfilter([
- {date: "2011-11-14T16:17:54Z", quantity: 2, total: 190, tip: 100, type: "tab"},
- {date: "2011-11-14T16:20:19Z", quantity: 2, total: 190, tip: 100, type: "tab"},
- {date: "2011-11-14T16:28:54Z", quantity: 1, total: 300, tip: 200, type: "visa"},
- {date: "2011-11-14T16:30:43Z", quantity: 2, total: 90, tip: 0, type: "tab"},
- {date: "2011-11-14T16:48:46Z", quantity: 2, total: 90, tip: 0, type: "tab"},
- {date: "2011-11-14T16:53:41Z", quantity: 2, total: 90, tip: 0, type: "tab"},
- {date: "2011-11-14T16:54:06Z", quantity: 1, total: 100, tip: 0, type: "cash"},
- {date: "2011-11-14T16:58:03Z", quantity: 2, total: 90, tip: 0, type: "tab"},
- {date: "2011-11-14T17:07:21Z", quantity: 2, total: 90, tip: 0, type: "tab"},
- {date: "2011-11-14T17:22:59Z", quantity: 2, total: 90, tip: 0, type: "tab"},
- {date: "2011-11-14T17:25:45Z", quantity: 2, total: 200, tip: 0, type: "cash"},
- {date: "2011-11-14T17:29:52Z", quantity: 1, total: 200, tip: 100, type: "visa"}
+ { date: "2011-11-14T16:17:54Z", quantity: 2, total: 190, tip: 100, type: "tab" },
+ { date: "2011-11-14T16:20:19Z", quantity: 2, total: 190, tip: 100, type: "tab" },
+ { date: "2011-11-14T16:28:54Z", quantity: 1, total: 300, tip: 200, type: "visa" },
+ { date: "2011-11-14T16:30:43Z", quantity: 2, total: 90, tip: 0, type: "tab" },
+ { date: "2011-11-14T16:48:46Z", quantity: 2, total: 90, tip: 0, type: "tab" },
+ { date: "2011-11-14T16:53:41Z", quantity: 2, total: 90, tip: 0, type: "tab" },
+ { date: "2011-11-14T16:54:06Z", quantity: 1, total: 100, tip: 0, type: "cash" },
+ { date: "2011-11-14T16:58:03Z", quantity: 2, total: 90, tip: 0, type: "tab" },
+ { date: "2011-11-14T17:07:21Z", quantity: 2, total: 90, tip: 0, type: "tab" },
+ { date: "2011-11-14T17:22:59Z", quantity: 2, total: 90, tip: 0, type: "tab" },
+ { date: "2011-11-14T17:25:45Z", quantity: 2, total: 200, tip: 0, type: "cash" },
+ { date: "2011-11-14T17:29:52Z", quantity: 1, total: 200, tip: 100, type: "visa" }
]);
-var total_payments : number = payments.groupAll().reduce(
- function(p,v) { return p+=v.total; },
- function(p,v) { return p-=v.total; },
- function() { return 0; } ).value();
+var total_payments: number = payments.groupAll().reduce(
+ function(p: number, v: any) { return p += v.total; },
+ function(p: number, v: any) { return p -= v.total; },
+ function() { return 0; }).value();
var paymentsByTotal = payments.dimension((d) => d.total);
@@ -49,13 +49,13 @@ paymentsByTotal.filterFunction(d => 0 <= d && d < 10 || 20 <= d && d < 30);
paymentsByTotal.filterAll(); // selects all payments
var topPayments = paymentsByTotal.top(4); // the top four payments, by total
-{var p: Payment = topPayments[0];} // the biggest payment
+{ var p: Payment = topPayments[0]; } // the biggest payment
topPayments[1]; // the second-biggest payment
var allPayments = paymentsByTotal.top(Infinity);
var bottomPayments = paymentsByTotal.bottom(4); // the bottom four payments, by total
-{var p: Payment = bottomPayments[0];} // the smallest payment
+{ var p: Payment = bottomPayments[0]; } // the smallest payment
bottomPayments[1]; // the second-smallest payment
var paymentGroupsByTotal = paymentsByTotal.group(total => Math.floor(total / 100));
@@ -71,8 +71,8 @@ paymentGroupsByTotal.reduceCount();
var paymentsByType = payments.dimension(d => d.type),
paymentVolumeByType = paymentsByType.group().reduceSum(d => d.total),
topTypes = paymentVolumeByType.top(1);
-{var s: string = topTypes[0].key;} // the top payment type (e.g., "tab")
-{var n: number = topTypes[0].value;} // the payment volume for that type (e.g., 900)
+{ var s: string = topTypes[0].key; } // the top payment type (e.g., "tab")
+{ var n: number = topTypes[0].value; } // the payment volume for that type (e.g., 900)
interface Group {
count: number;
@@ -91,8 +91,8 @@ function reduceRemove(p: Group, v: Payment) {
return p;
}
-function reduceInitial() : Group {
- return {count: 0, total: 0};
+function reduceInitial(): Group {
+ return { count: 0, total: 0 };
}
function orderValue(p: Group) {
diff --git a/crossroads/crossroads.d.ts b/crossroads/crossroads.d.ts
index 74da9cc0dd..53e07e8812 100644
--- a/crossroads/crossroads.d.ts
+++ b/crossroads/crossroads.d.ts
@@ -3,6 +3,7 @@
// Definitions by: Diullei Gomes
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+///
declare namespace CrossroadsJs {
diff --git a/cryptojs/cryptojs.d.ts b/cryptojs/cryptojs.d.ts
index ca7cfcc219..d537641462 100644
--- a/cryptojs/cryptojs.d.ts
+++ b/cryptojs/cryptojs.d.ts
@@ -7,6 +7,10 @@ declare var CryptoJS: CryptoJS.CryptoJSStatic;
declare namespace CryptoJS{
namespace lib{
+ type SomeArray = ArrayBuffer |
+ Int8Array | Int16Array | Int32Array |
+ Uint8Array | Uint16Array | Uint32Array;
+
interface Base{
extend(overrides: Object): Object
init(...args: any[]): void
@@ -19,21 +23,13 @@ declare namespace CryptoJS{
interface WordArray extends Base{
words: number[]
sigBytes: number
+
+ init(typedArray: SomeArray): void
init(words?: number[], sigBytes?: number): void
+
+ create(typedArray: SomeArray): WordArray;
create(words?: number[], sigBytes?: number): WordArray
- init(typedArray: ArrayBuffer): void
- init(typedArray: Int8Array): void
-
- //Because TypeScript uses a structural type system then we don't need (& can't)
- //declare oveload function init, create for the following type (same as Int8Array):
- //then Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array
- //Note also: Uint8ClampedArray is not defined in lib.d.ts & not supported in IE
- //@see http://compatibility.shwups-cms.ch/en/home?&property=Uint8ClampedArray
-
- create(typedArray: ArrayBuffer): WordArray
- create(typedArray: Int8Array): WordArray
-
toString(encoder?: enc.IEncoder): string
concat(wordArray: WordArray): WordArray
clamp(): void
diff --git a/css/css-tests.ts b/css/css-tests.ts
index d223679e26..81ca2a2f70 100644
--- a/css/css-tests.ts
+++ b/css/css-tests.ts
@@ -1,5 +1,3 @@
-///
-
import css = require("css");
// Check that user can parse, modify and persist CSS content
diff --git a/css/css.d.ts b/css/index.d.ts
similarity index 87%
rename from css/css.d.ts
rename to css/index.d.ts
index 2dabf77799..c892d5c3a2 100644
--- a/css/css.d.ts
+++ b/css/index.d.ts
@@ -11,7 +11,7 @@
/**
* css.parse options
*/
-interface ParserOptions {
+export interface ParserOptions {
/** Silently fail on parse errors */
silent?: boolean;
/** The path to the file containing css. Makes errors and source maps more helpful, by letting them know where code comes from. */
@@ -21,7 +21,7 @@ interface ParserOptions {
/**
* css.stringify options
*/
-interface StringifyOptions {
+export interface StringifyOptions {
/** The string used to indent the output. Defaults to two spaces. */
indent?: string;
/** Omit comments and extraneous whitespace. */
@@ -43,7 +43,7 @@ interface StringifyOptions {
/**
* Error thrown during parsing.
*/
-interface ParserError {
+export interface ParserError {
/** The full error message with the source position. */
message?: string;
/** The error message without position. */
@@ -64,7 +64,7 @@ interface ParserError {
* Information about a position in the code.
* The line and column numbers are 1-based: The first line is 1 and the first column of a line is 1 (not 0).
*/
-interface Position {
+export interface Position {
line?: number;
column?: number;
}
@@ -72,7 +72,7 @@ interface Position {
/**
* Base AST Tree Node.
*/
-interface Node {
+export interface Node {
/** The possible values are the ones listed in the Types section on https://github.com/reworkcss/css page. */
type?: string;
/** A reference to the parent node, or null if the node has no parent. */
@@ -88,14 +88,14 @@ interface Node {
};
}
-interface Rule extends Node {
+export interface Rule extends Node {
/** The list of selectors of the rule, split on commas. Each selector is trimmed from whitespace and comments. */
selectors?: Array;
/** Array of nodes with the types declaration and comment. */
declarations?: Array;
}
-interface Declaration extends Node {
+export interface Declaration extends Node {
/** The property name, trimmed from whitespace and comments. May not be empty. */
property?: string;
/** The value of the property, trimmed from whitespace and comments. Empty values are allowed. */
@@ -105,14 +105,14 @@ interface Declaration extends Node {
/**
* A rule-level or declaration-level comment. Comments inside selectors, properties and values etc. are lost.
*/
-interface Comment extends Node {
+export interface Comment extends Node {
comment?: string;
}
/**
* The @charset at-rule.
*/
-interface Charset {
+export interface Charset {
/** The part following @charset. */
charset?: string;
}
@@ -120,7 +120,7 @@ interface Charset {
/**
* The @custom-media at-rule
*/
-interface CustomMedia {
+export interface CustomMedia {
/** The ---prefixed name. */
name?: string;
/** The part following the name. */
@@ -130,7 +130,7 @@ interface CustomMedia {
/**
* The @document at-rule.
*/
-interface Document {
+export interface Document {
/** The part following @document. */
document?: string;
/** The vendor prefix in @document, or undefined if there is none. */
@@ -142,7 +142,7 @@ interface Document {
/**
* The @font-face at-rule.
*/
-interface FontFace {
+export interface FontFace {
/** Array of nodes with the types declaration and comment. */
declarations?: Array;
}
@@ -150,7 +150,7 @@ interface FontFace {
/**
* The @host at-rule.
*/
-interface Host {
+export interface Host {
/** Array of nodes with the types rule, comment and any of the at-rule types. */
rules?: Array;
}
@@ -158,7 +158,7 @@ interface Host {
/**
* The @import at-rule.
*/
-interface Import {
+export interface Import {
/** The part following @import. */
import?: string;
}
@@ -166,7 +166,7 @@ interface Import {
/**
* The @keyframes at-rule.
*/
-interface KeyFrames {
+export interface KeyFrames {
/** The name of the keyframes rule. */
name?: string;
/** The vendor prefix in @keyframes, or undefined if there is none. */
@@ -175,7 +175,7 @@ interface KeyFrames {
keyframes?: Array;
}
-interface KeyFrame {
+export interface KeyFrame {
/** The list of "selectors" of the keyframe rule, split on commas. Each “selector” is trimmed from whitespace. */
values?: Array;
/** Array of nodes with the types declaration and comment. */
@@ -185,7 +185,7 @@ interface KeyFrame {
/**
* The @media at-rule.
*/
-interface Media {
+export interface Media {
/** The part following @media. */
media?: string;
/** Array of nodes with the types rule, comment and any of the at-rule types. */
@@ -195,7 +195,7 @@ interface Media {
/**
* The @namespace at-rule.
*/
-interface Namespace {
+export interface Namespace {
/** The part following @namespace. */
namespace?: string;
}
@@ -203,7 +203,7 @@ interface Namespace {
/**
* The @page at-rule.
*/
-interface Page {
+export interface Page {
/** The list of selectors of the rule, split on commas. Each selector is trimmed from whitespace and comments. */
selectors?: Array;
/** Array of nodes with the types declaration and comment. */
@@ -213,7 +213,7 @@ interface Page {
/**
* The @supports at-rule.
*/
-interface Supports {
+export interface Supports {
/** The part following @supports. */
supports?: string;
/** Array of nodes with the types rule, comment and any of the at-rule types. */
@@ -221,12 +221,12 @@ interface Supports {
}
/** All at-rules. */
-type AtRule = Charset | CustomMedia | Document | FontFace | Host | Import | KeyFrames | Media | Namespace | Page | Supports;
+export type AtRule = Charset | CustomMedia | Document | FontFace | Host | Import | KeyFrames | Media | Namespace | Page | Supports;
/**
* The root node returned by css.parse.
*/
-interface Stylesheet extends Node {
+export interface Stylesheet extends Node {
stylesheet?: {
/** Array of nodes with the types rule, comment and any of the at-rule types. */
rules?: Array;
@@ -244,7 +244,7 @@ interface Stylesheet extends Node {
* @param {ParserOptions} options - CSS parser options.
* @return {Stylesheet} AST object built using provides CSS code.
*/
-declare function parse(code: string, options?: ParserOptions): Stylesheet;
+export function parse(code: string, options?: ParserOptions): Stylesheet;
/**
* Accepts an AST object (as css.parse produces) and returns a CSS string.
@@ -253,4 +253,4 @@ declare function parse(code: string, options?: ParserOptions): Stylesheet;
* @param {StringifyOptions} options - AST tree to string serializaiton options.
* @return {string} CSS code.
*/
-declare function stringify(stylesheet: Stylesheet, options?: StringifyOptions): string;
+export function stringify(stylesheet: Stylesheet, options?: StringifyOptions): string;
diff --git a/dat-gui/dat-gui-tests.ts b/dat-gui/dat-gui-tests.ts
index 19b34dd43f..6eaa187bc7 100644
--- a/dat-gui/dat-gui-tests.ts
+++ b/dat-gui/dat-gui-tests.ts
@@ -105,11 +105,11 @@ var FizzyText = function () {
var gui = new dat.GUI();
var controller = gui.add(fizzyText, 'maxSize', 0, 10);
- controller.onChange(function (value) {
+ controller.onChange(function (value: any) {
// Fires on every change, drag, keypress, etc.
});
- controller.onFinishChange(function (value) {
+ controller.onFinishChange(function (value: any) {
// Fires when a controller loses focus.
alert("The new value is " + value);
});
@@ -163,11 +163,11 @@ var FizzyText = function () {
var gui = new dat.GUI();
var controller = gui.add(obj, 'maxSize', 0, 10);
- controller.onChange(function (value) {
+ controller.onChange(function (value: any) {
// Fires on every change, drag, keypress, etc.
});
- controller.onFinishChange(function (value) {
+ controller.onFinishChange(function (value: any) {
// Fires when a controller loses focus.
alert("The new value is " + value);
});
diff --git a/dc/tsconfig.json b/dc/tsconfig.json
index effc71d799..52a70c8e46 100644
--- a/dc/tsconfig.json
+++ b/dc/tsconfig.json
@@ -1,4 +1,5 @@
{
+ "files": ["dc.d.ts", "dc-tests.ts"],
"compilerOptions": {
"module": "commonjs",
"target": "es6",
diff --git a/decorum/decorum-tests.ts b/decorum/decorum-tests.ts
index 4a51b09555..b648bdf8ca 100644
--- a/decorum/decorum-tests.ts
+++ b/decorum/decorum-tests.ts
@@ -92,7 +92,7 @@ Validator.decorate(MyOtherModel, {
]
});
-var otherValidator = Validator.new(new MyOtherModel());
+var otherValidator = Validator.new(MyOtherModel());
otherValidator.validateField('foo', '');
// Custom validator
diff --git a/decorum/tsconfig.json b/decorum/tsconfig.json
index effc71d799..cf91544f8f 100644
--- a/decorum/tsconfig.json
+++ b/decorum/tsconfig.json
@@ -4,6 +4,7 @@
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
- "baseUrl": "../"
+ "baseUrl": "../",
+ "experimentalDecorators": true
}
}
\ No newline at end of file
diff --git a/del/del-tests.ts b/del/del-tests.ts
index d3c45c9659..071fdcc3ad 100644
--- a/del/del-tests.ts
+++ b/del/del-tests.ts
@@ -1,4 +1,3 @@
-///
import del = require("del");
var paths = ["build", "dist/**/*.js"];
diff --git a/depd/depd-tests.ts b/depd/depd-tests.ts
index 14dfbe72c4..99330a757d 100644
--- a/depd/depd-tests.ts
+++ b/depd/depd-tests.ts
@@ -1,6 +1,4 @@
-///
-
-import depd = require('depd');
+import depd = require('depd');
var deprecate = depd("depd-tests");
diff --git a/dexie/dexie-tests.ts b/dexie/dexie-tests.ts
index 10597dfd4b..7eb6a75dbb 100644
--- a/dexie/dexie-tests.ts
+++ b/dexie/dexie-tests.ts
@@ -1,4 +1,4 @@
-import Dexie from "./dexie";
+import Dexie from "dexie";
interface IFriend {
id?: number,
diff --git a/domo/domo-tests.ts b/domo/domo-tests.ts
index cce14fb681..2b0e5788b2 100644
--- a/domo/domo-tests.ts
+++ b/domo/domo-tests.ts
@@ -1,6 +1,6 @@
///
-function opacity(pct) {
+function opacity(pct: number) {
return { opacity: String(pct / 100), filter: "alpha(opacity=" + pct + ")" }
}
@@ -31,7 +31,7 @@ var blue = "#3B5998";
var gray = "#3B3B3B";
var defaultRadius = 10;
-function roundedCorners(radius) {
+function roundedCorners(radius: number) {
return {
borderRadius: radius,
WebkitBorderRadius: radius,
@@ -58,9 +58,3 @@ var normalStyles =
STYLE.on("a img", { borderWidth: 0 })
);
-var domo = domo.global(false);
-
-domo.HTML(
- domo.HEAD(domo.TITLE("Hello, world.")),
- domo.BODY("Hello, world.")
-);
\ No newline at end of file
diff --git a/draft-js/tsconfig.json b/draft-js/tsconfig.json
index effc71d799..9a9976d457 100644
--- a/draft-js/tsconfig.json
+++ b/draft-js/tsconfig.json
@@ -4,6 +4,7 @@
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
- "baseUrl": "../"
+ "baseUrl": "../",
+ "jsx": "react"
}
}
\ No newline at end of file
diff --git a/dts-bundle/dts-bundle-tests.ts b/dts-bundle/dts-bundle-tests.ts
index 63ba70ca0b..2ed11868dd 100644
--- a/dts-bundle/dts-bundle-tests.ts
+++ b/dts-bundle/dts-bundle-tests.ts
@@ -1,4 +1,3 @@
-///
///
import dts = require("dts-bundle");
import os = require("os");
diff --git a/durandal/tsconfig.json b/durandal/tsconfig.json
index effc71d799..90961fb005 100644
--- a/durandal/tsconfig.json
+++ b/durandal/tsconfig.json
@@ -1,4 +1,5 @@
{
+ "files": ["durandal.d.ts", "durandal-tests.ts"],
"compilerOptions": {
"module": "commonjs",
"target": "es6",
diff --git a/electron-json-storage/electron-json-storage-tests.ts b/electron-json-storage/electron-json-storage-tests.ts
index 04461840d1..bb1155a3c8 100644
--- a/electron-json-storage/electron-json-storage-tests.ts
+++ b/electron-json-storage/electron-json-storage-tests.ts
@@ -1,5 +1,4 @@
-
-///
+///
import electron = require('electron');
import storage = require('electron-json-storage');
diff --git a/email-addresses/email-addresses-tests.ts b/email-addresses/email-addresses-tests.ts
index b43289d86c..7bf713e2c5 100644
--- a/email-addresses/email-addresses-tests.ts
+++ b/email-addresses/email-addresses-tests.ts
@@ -1,5 +1,3 @@
-///
-
import addrs = require('email-addresses');
var result: Object;
diff --git a/express-brute-memcached/express-brute-memcached-tests.ts b/express-brute-memcached/express-brute-memcached-tests.ts
index 3d1c976229..37dadf6189 100644
--- a/express-brute-memcached/express-brute-memcached-tests.ts
+++ b/express-brute-memcached/express-brute-memcached-tests.ts
@@ -1,5 +1,3 @@
-///
-
import * as express from "express";
import * as ExpressBrute from "express-brute";
import MemcachedStore from "express-brute-memcached";
diff --git a/giraffe/giraffe.d.ts b/giraffe/giraffe.d.ts
index 71b45cd653..c27a84e735 100644
--- a/giraffe/giraffe.d.ts
+++ b/giraffe/giraffe.d.ts
@@ -3,7 +3,8 @@
// Definitions by: Matt McCray
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
+///
declare namespace Giraffe {
diff --git a/jointjs/jointjs.d.ts b/jointjs/jointjs.d.ts
index b5de0684f0..5db7fc9eb4 100644
--- a/jointjs/jointjs.d.ts
+++ b/jointjs/jointjs.d.ts
@@ -3,8 +3,7 @@
// Definitions by: Aidan Reel , David Durman , Ewout Van Gossum
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
-
+///
declare namespace joint {
diff --git a/knockback/knockback.d.ts b/knockback/knockback.d.ts
index 5392e838ba..1243b54afb 100644
--- a/knockback/knockback.d.ts
+++ b/knockback/knockback.d.ts
@@ -3,8 +3,8 @@
// Definitions by: Boris Yankov
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
///
+///
declare namespace Knockback {
interface EventWatcherOptions {
diff --git a/lodash/tsconfig.json b/lodash/tsconfig.json
index 71362aab75..e9bc1b063a 100644
--- a/lodash/tsconfig.json
+++ b/lodash/tsconfig.json
@@ -1,5 +1,5 @@
{
- "files": ["lodash.d.ts", "lodash-tests.d.ts"],
+ "files": ["lodash.d.ts", "lodash-tests.ts"],
"compilerOptions": {
"module": "commonjs",
"target": "es6",
diff --git a/ncp/ncp-tests.ts b/ncp/ncp-tests.ts
index f1ce04c21e..753fb734e8 100644
--- a/ncp/ncp-tests.ts
+++ b/ncp/ncp-tests.ts
@@ -1,5 +1,3 @@
-///
-
import ncp = require('ncp');
import stream = require('stream');
diff --git a/rappid/rappid.d.ts b/rappid/rappid.d.ts
index 2922228759..c4a4ce6dd1 100644
--- a/rappid/rappid.d.ts
+++ b/rappid/rappid.d.ts
@@ -4,10 +4,9 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///
-///
declare namespace joint{
- namespace ui{
+ namespace ui {
interface Handle {
name : string;
position : string;
diff --git a/underscore/index.d.ts b/underscore/index.d.ts
new file mode 100644
index 0000000000..86565b6d6a
--- /dev/null
+++ b/underscore/index.d.ts
@@ -0,0 +1,5916 @@
+// Type definitions for Underscore 1.7.0
+// Project: http://underscorejs.org/
+// Definitions by: Boris Yankov , Josh Baldwin , Christopher Currens
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare var _: _.UnderscoreStatic;
+export = _;
+export as namespace _;
+
+declare module _ {
+ /**
+ * underscore.js _.throttle options.
+ **/
+ interface ThrottleSettings {
+
+ /**
+ * If you'd like to disable the leading-edge call, pass this as false.
+ **/
+ leading?: boolean;
+
+ /**
+ * If you'd like to disable the execution on the trailing-edge, pass false.
+ **/
+ trailing?: boolean;
+ }
+
+ /**
+ * underscore.js template settings, set templateSettings or pass as an argument
+ * to 'template()' to override defaults.
+ **/
+ interface TemplateSettings {
+ /**
+ * Default value is '/<%([\s\S]+?)%>/g'.
+ **/
+ evaluate?: RegExp;
+
+ /**
+ * Default value is '/<%=([\s\S]+?)%>/g'.
+ **/
+ interpolate?: RegExp;
+
+ /**
+ * Default value is '/<%-([\s\S]+?)%>/g'.
+ **/
+ escape?: RegExp;
+
+ /**
+ * By default, 'template()' places the values from your data in the local scope via the 'with' statement.
+ * However, you can specify a single variable name with this setting.
+ **/
+ variable?: string;
+ }
+
+ interface Collection { }
+
+ // Common interface between Arrays and jQuery objects
+ interface List extends Collection {
+ [index: number]: T;
+ length: number;
+ }
+
+ interface Dictionary extends Collection {
+ [index: string]: T;
+ }
+
+ interface ListIterator {
+ (value: T, index: number, list: List): TResult;
+ }
+
+ interface ObjectIterator {
+ (element: T, key: string, list: Dictionary): TResult;
+ }
+
+ interface MemoIterator {
+ (prev: TResult, curr: T, index: number, list: List): TResult;
+ }
+
+ interface MemoObjectIterator {
+ (prev: TResult, curr: T, key: string, list: Dictionary): TResult;
+ }
+
+ interface UnderscoreStatic {
+ /**
+ * Underscore OOP Wrapper, all Underscore functions that take an object
+ * as the first parameter can be invoked through this function.
+ * @param key First argument to Underscore object functions.
+ **/
+ (value: _.Dictionary): Underscore;
+ (value: Array): Underscore;
+ (value: T): Underscore;
+
+ /* *************
+ * Collections *
+ ************* */
+
+ /**
+ * Iterates over a list of elements, yielding each in turn to an iterator function. The iterator is
+ * bound to the context object, if one is passed. Each invocation of iterator is called with three
+ * arguments: (element, index, list). If list is a JavaScript object, iterator's arguments will be
+ * (value, key, object). Delegates to the native forEach function if it exists.
+ * @param list Iterates over this list of elements.
+ * @param iterator Iterator function for each element `list`.
+ * @param context 'this' object in `iterator`, optional.
+ **/
+ each(
+ list: _.List,
+ iterator: _.ListIterator,
+ context?: any): _.List;
+
+ /**
+ * @see _.each
+ * @param object Iterates over properties of this object.
+ * @param iterator Iterator function for each property on `object`.
+ * @param context 'this' object in `iterator`, optional.
+ **/
+ each(
+ object: _.Dictionary,
+ iterator: _.ObjectIterator,
+ context?: any): _.Dictionary;
+
+ /**
+ * @see _.each
+ **/
+ forEach(
+ list: _.List,
+ iterator: _.ListIterator,
+ context?: any): _.List;
+
+ /**
+ * @see _.each
+ **/
+ forEach(
+ object: _.Dictionary,
+ iterator: _.ObjectIterator,
+ context?: any): _.Dictionary;
+
+ /**
+ * Produces a new array of values by mapping each value in list through a transformation function
+ * (iterator). If the native map method exists, it will be used instead. If list is a JavaScript
+ * object, iterator's arguments will be (value, key, object).
+ * @param list Maps the elements of this array.
+ * @param iterator Map iterator function for each element in `list`.
+ * @param context `this` object in `iterator`, optional.
+ * @return The mapped array result.
+ **/
+ map(
+ list: _.List,
+ iterator: _.ListIterator,
+ context?: any): TResult[];
+
+ /**
+ * @see _.map
+ * @param object Maps the properties of this object.
+ * @param iterator Map iterator function for each property on `object`.
+ * @param context `this` object in `iterator`, optional.
+ * @return The mapped object result.
+ **/
+ map(
+ object: _.Dictionary,
+ iterator: _.ObjectIterator,
+ context?: any): TResult[];
+
+ /**
+ * @see _.map
+ **/
+ collect(
+ list: _.List,
+ iterator: _.ListIterator,
+ context?: any): TResult[];
+
+ /**
+ * @see _.map
+ **/
+ collect(
+ object: _.Dictionary