diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 06ca43b24c..7ebdcc514f 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -1127,6 +1127,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](mongoose-auto-increment/mongoose-auto-increment.d.ts) [mongoose-auto-increment](https://github.com/codetunnel/mongoose-auto-increment) by [Aya Morisawa](https://github.com/AyaMorisawa)
* [:link:](mongoose-deep-populate/mongoose-deep-populate.d.ts) [mongoose-deep-populate](https://github.com/buunguyen/mongoose-deep-populate) by [Aya Morisawa](https://github.com/AyaMorisawa)
* [:link:](mongoose-mock/mongoose-mock.d.ts) [mongoose-mock](https://github.com/JohanObrink/mongoose-mock) by [jt000](https://github.com/jt000)
+* [:link:](mongoose-promise/mongoose-promise.d.ts) [mongoose-promise](http://mongoosejs.com/docs/api.html#promise-js) by [simonxca](https://github.com/simonxca)
* [:link:](morgan/morgan.d.ts) [morgan](https://github.com/expressjs/morgan) by [James Roland Cabresos](https://github.com/staticfunction)
* [:link:](mousetrap/mousetrap-global-bind.d.ts) [Mousetrap 1.4.6's global-bind extension](http://craig.is/killing/mice#extensions.global) by [Andrew Bradley](https://github.com/cspotcode)
* [:link:](mousetrap/mousetrap.d.ts) [Mousetrap 1.5.x](http://craig.is/killing/mice) by [Dániel Tar](https://github.com/qcz)
diff --git a/angular-environment/angular-environment.d.ts b/angular-environment/angular-environment.d.ts
index 483474410c..94972d1383 100644
--- a/angular-environment/angular-environment.d.ts
+++ b/angular-environment/angular-environment.d.ts
@@ -14,6 +14,11 @@ declare namespace angular.environment {
* loads the correct environment variables.
*/
check: () => void;
+ /**
+ * Retrieves the correct version of a
+ * variable for the current environment.
+ */
+ read: (key: string) => any;
}
interface Service {
/**
diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts
index 8e2bdfdf43..4464c599e3 100644
--- a/angular-material/angular-material-tests.ts
+++ b/angular-material/angular-material-tests.ts
@@ -30,7 +30,11 @@ myApp.config((
myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.IBottomSheetService) => {
$scope['openBottomSheet'] = () => {
$mdBottomSheet.show({
- template: 'Hello!'
+ template: 'Hello!',
+ clickOutsideToClose: true,
+ disableBackdrop: true,
+ disableParentScroll: false,
+ parent: () => {}
});
};
$scope['hideBottomSheet'] = $mdBottomSheet.hide.bind($mdBottomSheet, 'hide');
@@ -115,6 +119,14 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia
$scope['close'] = () => $mdSidenav(componentId).close();
$scope['isOpen'] = $mdSidenav(componentId).isOpen();
$scope['isLockedOpen'] = $mdSidenav(componentId).isLockedOpen();
+
+ $scope['asyncLookup'] = $mdSidenav(componentId, true).then((instance) => {
+ instance.toggle();
+ instance.open();
+ instance.close();
+ instance.isOpen();
+ instance.isLockedOpen();
+ });
});
myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => {
diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts
index 2769945a7b..5e780fe005 100644
--- a/angular-material/angular-material.d.ts
+++ b/angular-material/angular-material.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Angular Material 1.0.0-rc5+ (angular.material module)
+// Type definitions for Angular Material 1.1.0-rc5+ (angular.material module)
// Project: https://github.com/angular/material
// Definitions by: Alex Staroselsky , Blake Bigelow , Peter Hajdu
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -19,11 +19,12 @@ declare namespace angular.material {
preserveScope?: boolean; // default: false
controller?: string|Function;
locals?: {[index: string]: any};
- targetEvent?: MouseEvent;
- resolve?: {[index: string]: angular.IPromise}
+ clickOutsideToClose?: boolean;
+ disableBackdrop?: boolean;
+ escapeToClose?: boolean;
+ resolve?: {[index: string]: angular.IPromise};
controllerAs?: string;
- bindToController?: boolean;
- parent?: string|Element|JQuery; // default: root node
+ parent?: Function|string|Object; // default: root node
disableParentScroll?: boolean; // default: true
}
@@ -134,6 +135,7 @@ declare namespace angular.material {
}
interface ISidenavService {
+ (component: string, enableWait: boolean): angular.IPromise;
(component: string): ISidenavObject;
}
diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts
index e9175a25ce..2d9469ef80 100644
--- a/angularjs/angular.d.ts
+++ b/angularjs/angular.d.ts
@@ -1715,6 +1715,12 @@ declare namespace angular {
* Whether transclusion is enabled. Enabled by default.
*/
transclude?: boolean | string | {[slot: string]: string};
+ /**
+ * Requires the controllers of other directives and binds them to this component's controller.
+ * The object keys specify the property names under which the required controllers (object values) will be bound.
+ * Note that the required controllers will not be available during the instantiation of the controller,
+ * but they are guaranteed to be available just before the $onInit method is executed!
+ */
require?: {[controller: string]: string};
}
diff --git a/app-root-path/app-root-path-tests.ts b/app-root-path/app-root-path-tests.ts
new file mode 100644
index 0000000000..64d8cdab6b
--- /dev/null
+++ b/app-root-path/app-root-path-tests.ts
@@ -0,0 +1,10 @@
+///
+import * as root from 'app-root-path';
+
+let resolvedPath: string;
+resolvedPath = root.resolve('../dir');
+resolvedPath = root.path;
+resolvedPath = root.toString();
+let resolvedModule: any = root.require('app-root-path');
+root.setPath('C:\\app-root');
+
diff --git a/app-root-path/app-root-path.d.ts b/app-root-path/app-root-path.d.ts
new file mode 100644
index 0000000000..7cccc59e01
--- /dev/null
+++ b/app-root-path/app-root-path.d.ts
@@ -0,0 +1,39 @@
+// Type definitions for app-root-path 1.2.1
+// Project: https://github.com/inxilpro/node-app-root-path
+// Definitions by: Shant Marouti
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare module 'app-root-path' {
+ interface RootPath {
+
+ /**
+ * Application root directory absolute path
+ * @type {string}
+ */
+ path: string;
+
+ /**
+ * Resolves relative path from root to absolute path
+ * @param {string} pathToModule
+ * @returns {string}
+ */
+ resolve(pathToModule: string): string;
+
+ /**
+ * Resolve module by relative addressing from root
+ * @param {string} pathToModule
+ * @returns {*}
+ */
+ require(pathToModule: string): any;
+
+ /**
+ * Explicitly set root path
+ * @param {string} explicitlySetPath
+ */
+ setPath(explicitlySetPath: string): void;
+
+ toString(): string;
+ }
+ var RootPath: RootPath;
+ export = RootPath;
+}
\ No newline at end of file
diff --git a/applicationinsights-js/applicationinsights-js.d.ts b/applicationinsights-js/applicationinsights-js.d.ts
index d9ad3c1c9d..9047f44b9f 100644
--- a/applicationinsights-js/applicationinsights-js.d.ts
+++ b/applicationinsights-js/applicationinsights-js.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for ApplicationInsights-JS v0.22.14
+// Type definitions for ApplicationInsights-JS v0.23.2
// Project: https://github.com/Microsoft/ApplicationInsights-JS
// Definitions by: Kamil Szostak
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -788,3 +788,9 @@ declare module Microsoft.ApplicationInsights {
_onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error): any;
}
}
+
+declare module 'applicationinsights-js' {
+ export = appInsights;
+}
+
+declare var appInsights: Microsoft.ApplicationInsights.IAppInsights;
\ No newline at end of file
diff --git a/google.visualization/google.visualization-tests.ts b/google.visualization/google.visualization-tests.ts
index a5b1352dee..3453e2124c 100644
--- a/google.visualization/google.visualization-tests.ts
+++ b/google.visualization/google.visualization-tests.ts
@@ -488,3 +488,25 @@ function test_formatter_PatternFormat() {
table.draw(view, { allowHtml: true, showRowNumber: true, width: '100%', height: '100%' });
}
+
+function test_ChartsLoad() {
+ google.charts.load('current', {packages: ['corechart', 'table', 'sankey']});
+
+ function drawChart() {
+ // Define the chart to be drawn.
+ var data = new google.visualization.DataTable();
+ data.addColumn('string', 'Element');
+ data.addColumn('number', 'Percentage');
+ data.addRows([
+ ['Nitrogen', 0.78],
+ ['Oxygen', 0.21],
+ ['Other', 0.01]
+ ]);
+
+ // Instantiate and draw the chart.
+ var chart = new google.visualization.PieChart(document.getElementById('myPieChart'));
+ chart.draw(data, null);
+ }
+
+ google.charts.setOnLoadCallback(drawChart);
+}
diff --git a/google.visualization/google.visualization.d.ts b/google.visualization/google.visualization.d.ts
index a2a4bf21aa..a4dc1b7b1a 100644
--- a/google.visualization/google.visualization.d.ts
+++ b/google.visualization/google.visualization.d.ts
@@ -9,6 +9,12 @@ declare namespace google {
function setOnLoadCallback(handler: Function): void;
function setOnLoadCallback(handler: () => void): void;
+ // https://developers.google.com/chart/interactive/docs/basic_load_libs
+ namespace charts {
+ function load(version: string, packages: Object): void;
+ function setOnLoadCallback(handler: Function): void;
+ }
+
//https://developers.google.com/chart/interactive/docs/reference
namespace visualization {
@@ -141,6 +147,7 @@ declare namespace google {
id?: string;
role?: string;
pattern?: string;
+ p?: any;
}
export interface DataObject {
diff --git a/gulp-insert/gulp-insert-tests.ts b/gulp-insert/gulp-insert-tests.ts
new file mode 100644
index 0000000000..e420cf5e4a
--- /dev/null
+++ b/gulp-insert/gulp-insert-tests.ts
@@ -0,0 +1,21 @@
+///
+///
+
+import * as gulp from 'gulp';
+import * as insert from 'gulp-insert';
+
+gulp.task('gulp-insert-tests', () => {
+ return gulp.src('*.js')
+ .pipe(insert.prepend('/* Inserted using gulp-insert prepend method */\n'))
+ .pipe(insert.prepend('\n/* Inserted using gulp-insert append method */'))
+ .pipe(insert.wrap(
+ '/* Inserted using gulp-insert wrap method */\n',
+ '\n/* Inserted using gulp-insert wrap method */'
+ ))
+ .pipe(insert.transform((contents, file) => {
+ var comment = '/* Local file: ' + file.path + ' */\n';
+ return comment + contents;
+ }))
+ .pipe(gulp.dest('gulp-insert'));
+});
+
diff --git a/gulp-insert/gulp-insert.d.ts b/gulp-insert/gulp-insert.d.ts
new file mode 100644
index 0000000000..9777280d5b
--- /dev/null
+++ b/gulp-insert/gulp-insert.d.ts
@@ -0,0 +1,52 @@
+// Type definitions for gulp-insert 0.5.0
+// Project: https://github.com/rschmukler/gulp-insert
+// Definitions by: Shant Marouti
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+///
+
+declare module 'gulp-insert' {
+
+ import File = require('vinyl');
+
+ interface Transformer {
+ (contents: string, file: File): string
+ }
+
+ namespace Insert {
+
+ /**
+ * Prepends a string onto the contents
+ * @param {string} content
+ * @returns {NodeJS.ReadWriteStream}
+ */
+ function prepend(content: string): NodeJS.ReadWriteStream;
+
+ /**
+ * Appends a string onto the contents
+ * @param {string} content
+ * @returns {NodeJS.ReadWriteStream}
+ */
+ function append(content: string): NodeJS.ReadWriteStream;
+
+ /**
+ * Wraps the contents with two strings
+ * @param {string} prepend
+ * @param {string} append
+ * @returns {NodeJS.ReadWriteStream}
+ */
+ function wrap(prepend: string, append: string): NodeJS.ReadWriteStream;
+
+ /**
+ * Calls a function with the contents of the file
+ * @param {Transformer} transformer
+ * @returns {NodeJS.ReadWriteStream}
+ */
+ function transform(transformer: Transformer): NodeJS.ReadWriteStream;
+
+ }
+
+ module Insert { }
+ export = Insert;
+}
\ No newline at end of file
diff --git a/iscroll/iscroll-5-tests.ts b/iscroll/iscroll-5-tests.ts
index 07255e8333..b04d91c029 100644
--- a/iscroll/iscroll-5-tests.ts
+++ b/iscroll/iscroll-5-tests.ts
@@ -33,4 +33,10 @@ myScroll1.scrollToElement(document.getElementById('selectedElement'), 250);
myScroll2.on('scrollStart', function () { console.log('scroll started'); });
var myScroll9 = new IScroll(document.getElementById('wrapper'));
-var myScroll10 = new IScroll(document.getElementById('wrapper'), { scrollbarClass: 'myScrollbar' });
\ No newline at end of file
+var myScroll10 = new IScroll(document.getElementById('wrapper'), { scrollbarClass: 'myScrollbar' });
+
+var myScroll11 = new IScroll(document.getElementById('wrapper'), { preventDefaultException: [ /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ ] });
+var myScroll12 = new IScroll(document.getElementById('wrapper'), { preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ } });
+
+var myScroll13 = new IScroll(document.getElementById('wrapper'), { bounceEasing: 'circular' });
+var myScroll14 = new IScroll(document.getElementById('wrapper'), { bounceEasing: { style: 'cubic-bezier(0,0,1,1)', fn: function (k) { return k; } } });
diff --git a/iscroll/iscroll-5.d.ts b/iscroll/iscroll-5.d.ts
index 0b972e2863..31e9acaf6c 100644
--- a/iscroll/iscroll-5.d.ts
+++ b/iscroll/iscroll-5.d.ts
@@ -51,10 +51,10 @@ interface IScrollOptions {
bounceTime?: number;
///String or function
- bounceEasing?: any;
+ bounceEasing?: string|{ style: string, fn: (k: any) => any };
preventDefault?: boolean;
- preventDefaultException?: boolean;
+ preventDefaultException?: Array|Object;
HWCompositing?: boolean;
diff --git a/jsonwebtoken/jsonwebtoken.d.ts b/jsonwebtoken/jsonwebtoken.d.ts
index 201d351a7a..091301e2b2 100644
--- a/jsonwebtoken/jsonwebtoken.d.ts
+++ b/jsonwebtoken/jsonwebtoken.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for jsonwebtoken 6.2.0
+// Type definitions for jsonwebtoken 7.1.6
// Project: https://github.com/auth0/node-jsonwebtoken
// Definitions by: Maxime LUCE , Daniel Heim
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -49,14 +49,17 @@ declare module "jsonwebtoken" {
jwtid?: string;
noTimestamp?: boolean;
header?: Object;
+ encoding?: string;
}
export interface VerifyOptions {
algorithms?: string[];
- audience?: string;
- issuer?: string;
+ audience?: string | string[];
+ clockTolerance?: number;
+ issuer?: string | string[];
ignoreExpiration?: boolean;
ignoreNotBefore?: boolean;
+ jwtId?: string;
subject?: string;
/**
*@deprecated
diff --git a/karma/karma-tests.ts b/karma/karma-tests.ts
index 31a3948275..712f4f119b 100644
--- a/karma/karma-tests.ts
+++ b/karma/karma-tests.ts
@@ -28,6 +28,12 @@ karma.runner.run({port: 9876}, (exitCode: number) => {
process.exit(exitCode);
});
+karma.stopper.stop({port: 9876}, function(exitCode) {
+ if (exitCode === 0) {
+ console.log('Server stop as initiated')
+ }
+ process.exit(exitCode)
+});
//var Server = require('karma').Server; => cannot use this syntax otherwise Server is of type any
var server = new karma.Server({logLevel: 'debug', port: 9876}, function(exitCode: number) {
@@ -48,7 +54,7 @@ server.on('run_complete', (browsers, results) => {
results.error = false;
results.exitCode = 0;
results.failed = 9;
- results.success = 10;
+ results.success = 10;
});
//var runner = require('karma').runner; => cannot use this syntax otherwise runner is of type any
diff --git a/karma/karma.d.ts b/karma/karma.d.ts
index e0fcfba7b9..95c1baede4 100644
--- a/karma/karma.d.ts
+++ b/karma/karma.d.ts
@@ -27,6 +27,7 @@ declare module 'karma' {
server: DeprecatedServer;
Server: Server;
runner: Runner;
+ stopper: Stopper;
launcher: Launcher;
VERSION: string;
}
@@ -56,6 +57,15 @@ declare module 'karma' {
run(options?: ConfigOptions | ConfigFile, callback?: ServerCallback): void;
}
+
+ interface Stopper {
+ /**
+ * This function will signal a running server to stop. The equivalent of karma stop.
+ */
+ stop(options?: ConfigOptions, callback?: ServerCallback): void;
+ }
+
+
interface TestResults {
disconnected: boolean;
error: boolean;
@@ -81,7 +91,7 @@ declare module 'karma' {
refreshFiles(): Promise;
on(event: string, listener: Function): this;
-
+
/**
* Listen to the 'run_complete' event.
*/
diff --git a/lodash/lodash-3.10-tests.ts b/lodash/lodash-3.10-tests.ts
index 0a2debfa00..2616822f6e 100644
--- a/lodash/lodash-3.10-tests.ts
+++ b/lodash/lodash-3.10-tests.ts
@@ -7700,8 +7700,13 @@ namespace TestRound {
// _.sum
namespace TestSum {
let array: number[];
+ let objectArray: { 'age': number }[];
+
let list: _.List;
+ let objectList: _.List<{ 'age': number }>;
+
let dictionary: _.Dictionary;
+ let objectDictionary: _.Dictionary<{ 'age': number }>;
let listIterator: (value: number, index: number, collection: _.List) => number;
let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => number;
@@ -7713,36 +7718,36 @@ namespace TestSum {
result = _.sum(array);
result = _.sum(array, listIterator);
result = _.sum(array, listIterator, any);
- result = _.sum(array, '');
+ result = _.sum(objectArray, 'age');
result = _.sum(list);
result = _.sum(list);
result = _.sum(list, listIterator);
result = _.sum(list, listIterator, any);
- result = _.sum(list, '');
+ result = _.sum(objectList, 'age');
result = _.sum(dictionary);
result = _.sum(dictionary);
result = _.sum(dictionary, dictionaryIterator);
result = _.sum(dictionary, dictionaryIterator, any);
- result = _.sum(dictionary, '');
+ result = _.sum(objectDictionary, 'age');
result = _(array).sum();
result = _(array).sum(listIterator);
result = _(array).sum(listIterator, any);
- result = _(array).sum('');
+ result = _(objectArray).sum('age');
result = _(list).sum();
result = _(list).sum(listIterator);
result = _(list).sum(listIterator, any);
- result = _(list).sum('');
+ result = _(objectList).sum('age');
result = _(dictionary).sum();
result = _(dictionary).sum(dictionaryIterator);
result = _(dictionary).sum(dictionaryIterator, any);
- result = _(dictionary).sum('');
+ result = _(objectDictionary).sum('age');
}
{
@@ -7751,18 +7756,18 @@ namespace TestSum {
result = _(array).chain().sum();
result = _(array).chain().sum(listIterator);
result = _(array).chain().sum(listIterator, any);
- result = _(array).chain().sum('');
+ result = _(objectArray).chain().sum('');
result = _(list).chain().sum();
result = _(list).chain().sum(listIterator);
result = _(list).chain().sum(listIterator, any);
- result = _(list).chain().sum('');
+ result = _(objectList).chain().sum('age');
result = _(dictionary).chain().sum();
result = _(dictionary).chain().sum(dictionaryIterator);
result = _(dictionary).chain().sum(dictionaryIterator, any);
- result = _(dictionary).chain().sum('');
+ result = _(objectDictionary).chain().sum('age');
}
}
diff --git a/lodash/lodash-3.10.d.ts b/lodash/lodash-3.10.d.ts
index 3948215468..eca84d937f 100644
--- a/lodash/lodash-3.10.d.ts
+++ b/lodash/lodash-3.10.d.ts
@@ -12065,8 +12065,8 @@ declare module _ {
/**
* @see _.sum
*/
- sum(
- collection: List|Dictionary,
+ sum(
+ collection: List<{}>|Dictionary<{}>,
iteratee: string
): number;
diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts
index ec20e06b1f..8ec22e98de 100644
--- a/lodash/lodash-tests.ts
+++ b/lodash/lodash-tests.ts
@@ -7896,49 +7896,41 @@ namespace TestSum {
// _.sumBy
namespace TestSumBy {
let array: number[];
+ let objectArray: { 'age': number }[];
+
let list: _.List;
- let dictionary: _.Dictionary;
+ let objectList: _.List<{ 'age': number }>;
let listIterator: (value: number, index: number, collection: _.List) => number;
- let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => number;
{
let result: number;
- result = _.sumBy(array);
- result = _.sumBy(array, listIterator);
- result = _.sumBy(array, '');
+ result = _.sumBy(array);
+ result = _.sumBy(array, listIterator);
+ result = _.sumBy(objectArray, 'age');
+ result = _.sumBy(objectArray, { 'age': 30 });
-
- result = _.sumBy(list);
- result = _.sumBy(list, listIterator);
- result = _.sumBy(list, '');
-
- result = _.sumBy(dictionary);
- result = _.sumBy(dictionary, dictionaryIterator);
- result = _.sumBy(dictionary, '');
+ result = _.sumBy(list);
+ result = _.sumBy(list, listIterator);
+ result = _.sumBy(objectList, 'age');
+ result = _.sumBy(objectList, { 'age': 30 });
result = _(array).sumBy(listIterator);
- result = _(array).sumBy('');
+ result = _(objectArray).sumBy('age');
- result = _(list).sumBy(listIterator);
- result = _(list).sumBy('');
-
- result = _(dictionary).sumBy(dictionaryIterator);
- result = _(dictionary).sumBy('');
+ result = _(list).sumBy(listIterator);
+ result = _(objectList).sumBy('age');
}
{
let result: _.LoDashExplicitWrapper;
result = _(array).chain().sumBy(listIterator);
- result = _(array).chain().sumBy('');
+ result = _(objectArray).chain().sumBy('age');
- result = _(list).chain().sumBy(listIterator);
- result = _(list).chain().sumBy('');
-
- result = _(dictionary).chain().sumBy(dictionaryIterator);
- result = _(dictionary).chain().sumBy('');
+ result = _(list).chain().sumBy(listIterator);
+ result = _(objectList).chain().sumBy('age');
}
}
diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts
index 3396ea447a..35c6611596 100644
--- a/lodash/lodash.d.ts
+++ b/lodash/lodash.d.ts
@@ -13475,31 +13475,28 @@ declare module _ {
iteratee: ListIterator
): number;
- /**
- * @see _.sumBy
- **/
- sumBy(
- collection: Dictionary,
- iteratee: DictionaryIterator
- ): number;
-
/**
* @see _.sumBy
*/
- sumBy(
- collection: List|Dictionary,
+ sumBy(
+ collection: List<{}>,
iteratee: string
): number;
/**
* @see _.sumBy
*/
- sumBy(collection: List|Dictionary): number;
+ sumBy(
+ collection: List
+ ): number;
/**
* @see _.sumBy
*/
- sumBy(collection: List|Dictionary): number;
+ sumBy(
+ collection: List<{}>,
+ iteratee: Dictionary<{}>
+ ): number;
}
interface LoDashImplicitArrayWrapper {
@@ -13518,15 +13515,15 @@ declare module _ {
/**
* @see _.sumBy
*/
- sumBy(): number;
+ sumBy(iteratee: Dictionary<{}>): number;
}
interface LoDashImplicitObjectWrapper {
/**
* @see _.sumBy
- **/
- sumBy(
- iteratee: ListIterator|DictionaryIterator
+ */
+ sumBy(
+ iteratee: ListIterator<{}, number>
): number;
/**
@@ -13537,7 +13534,7 @@ declare module _ {
/**
* @see _.sumBy
*/
- sumBy(): number;
+ sumBy(iteratee: Dictionary<{}>): number;
}
interface LoDashExplicitArrayWrapper {
@@ -13557,14 +13554,19 @@ declare module _ {
* @see _.sumBy
*/
sumBy(): LoDashExplicitWrapper;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy(iteratee: Dictionary<{}>): LoDashExplicitWrapper;
}
interface LoDashExplicitObjectWrapper {
/**
* @see _.sumBy
*/
- sumBy(
- iteratee: ListIterator|DictionaryIterator
+ sumBy(
+ iteratee: ListIterator<{}, number>
): LoDashExplicitWrapper;
/**
@@ -13575,7 +13577,7 @@ declare module _ {
/**
* @see _.sumBy
*/
- sumBy(): LoDashExplicitWrapper;
+ sumBy(iteratee: Dictionary<{}>): LoDashExplicitWrapper;
}
/**********
diff --git a/mailparser/mailparser-tests.ts b/mailparser/mailparser-tests.ts
index b7df9adb44..d52c011fe1 100644
--- a/mailparser/mailparser-tests.ts
+++ b/mailparser/mailparser-tests.ts
@@ -3,7 +3,7 @@
import mailparser_mod = require("mailparser");
import MailParser = mailparser_mod.MailParser;
import ParsedMail = mailparser_mod.ParsedMail;
-
+import Attachment = mailparser_mod.Attachment;
var mailparser = new MailParser();
@@ -61,7 +61,7 @@ var mp = new MailParser({
streamAttachments: true
})
-mp.on("attachment", function(attachment, mail){
+mp.on("attachment", function(attachment : Attachment, mail : ParsedMail){
var output = fs.createWriteStream(attachment.generatedFileName);
attachment.stream.pipe(output);
});
diff --git a/mailparser/mailparser.d.ts b/mailparser/mailparser.d.ts
index 94e99308d9..bc50dcc509 100644
--- a/mailparser/mailparser.d.ts
+++ b/mailparser/mailparser.d.ts
@@ -8,6 +8,8 @@
declare module 'mailparser' {
+ import StreamModule = require("stream");
+ import Stream = StreamModule.Stream;
import WritableStream = NodeJS.WritableStream;
import EventEmitter = NodeJS.EventEmitter;
@@ -36,6 +38,7 @@ declare module 'mailparser' {
generatedFileName: string; // e.g. 'image.png'
checksum: string; // the md5 hash of the file, e.g. 'e4cef4c6e26037bcf8166905207ea09b'
content: Buffer; // possibly a SlowBuffer
+ stream: Stream; // a stream to read the attachment if streamAttachments is set to true
}
// emitted with the 'end' event
diff --git a/material-ui/material-ui-tests.tsx b/material-ui/material-ui-tests.tsx
index d1188ac3fb..c47f82858b 100644
--- a/material-ui/material-ui-tests.tsx
+++ b/material-ui/material-ui-tests.tsx
@@ -680,7 +680,7 @@ const FlatButtonExampleComplex = () => (
Label before}
labelPosition="before"
primary={true}
style={styles.button}
@@ -741,7 +741,7 @@ const RaisedButtonExampleComplex = () => (
Label before}
labelPosition="before"
primary={true}
icon={}
diff --git a/material-ui/material-ui.d.ts b/material-ui/material-ui.d.ts
index 984f57e987..58a36f9cf9 100644
--- a/material-ui/material-ui.d.ts
+++ b/material-ui/material-ui.d.ts
@@ -662,7 +662,7 @@ declare namespace __MaterialUI {
hoverColor?: string;
href?: string;
icon?: React.ReactNode;
- label?: string;
+ label?: React.ReactNode;
labelPosition?: "before" | "after";
labelStyle?: React.CSSProperties;
linkButton?: boolean;
@@ -688,7 +688,7 @@ declare namespace __MaterialUI {
fullWidth?: boolean;
href?: string;
icon?: React.ReactNode;
- label?: string;
+ label?: React.ReactNode;
labelColor?: string;
labelPosition?: "before" | "after";
labelStyle?: React.CSSProperties;
diff --git a/mocha/mocha.d.ts b/mocha/mocha.d.ts
index eb167c83c9..5304f9333a 100644
--- a/mocha/mocha.d.ts
+++ b/mocha/mocha.d.ts
@@ -29,10 +29,6 @@ interface MochaSetupOptions {
grep?: any;
}
-interface MochaDone {
- (error?: Error): void;
-}
-
declare var mocha: Mocha;
declare var describe: Mocha.IContextDefinition;
declare var xdescribe: Mocha.IContextDefinition;
@@ -46,55 +42,29 @@ declare var xit: Mocha.ITestDefinition;
declare var test: Mocha.ITestDefinition;
declare var specify: Mocha.ITestDefinition;
-declare function before(action: () => void): void;
+interface MochaDone {
+ (error?: any): any;
+}
-declare function before(action: (done: MochaDone) => void): void;
+interface ActionFunction {
+ (done: MochaDone): any | PromiseLike
+}
-declare function before(description: string, action: () => void): void;
-
-declare function before(description: string, action: (done: MochaDone) => void): void;
-
-declare function setup(action: () => void): void;
-
-declare function setup(action: (done: MochaDone) => void): void;
-
-declare function after(action: () => void): void;
-
-declare function after(action: (done: MochaDone) => void): void;
-
-declare function after(description: string, action: () => void): void;
-
-declare function after(description: string, action: (done: MochaDone) => void): void;
-
-declare function teardown(action: () => void): void;
-
-declare function teardown(action: (done: MochaDone) => void): void;
-
-declare function beforeEach(action: () => void): void;
-
-declare function beforeEach(action: (done: MochaDone) => void): void;
-
-declare function beforeEach(description: string, action: () => void): void;
-
-declare function beforeEach(description: string, action: (done: MochaDone) => void): void;
-
-declare function suiteSetup(action: () => void): void;
-
-declare function suiteSetup(action: (done: MochaDone) => void): void;
-
-declare function afterEach(action: () => void): void;
-
-declare function afterEach(action: (done: MochaDone) => void): void;
-
-declare function afterEach(description: string, action: () => void): void;
-
-declare function afterEach(description: string, action: (done: MochaDone) => void): void;
-
-declare function suiteTeardown(action: () => void): void;
-
-declare function suiteTeardown(action: (done: MochaDone) => void): void;
+declare function setup(action: ActionFunction): void;
+declare function teardown(action: ActionFunction): void;
+declare function suiteSetup(action: ActionFunction): void;
+declare function suiteTeardown(action: ActionFunction): void;
+declare function before(action: ActionFunction): void;
+declare function before(description: string, action: ActionFunction): void;
+declare function after(action: ActionFunction): void;
+declare function after(description: string, action: ActionFunction): void;
+declare function beforeEach(action: ActionFunction): void;
+declare function beforeEach(description: string, action: ActionFunction): void;
+declare function afterEach(action: ActionFunction): void;
+declare function afterEach(description: string, action: ActionFunction): void;
declare class Mocha {
+ currentTest: Mocha.ITestDefinition;
constructor(options?: {
grep?: RegExp;
ui?: string;
@@ -176,13 +146,11 @@ declare namespace Mocha {
}
interface ITestDefinition {
- (expectation: string, assertion?: () => void): ITest;
- (expectation: string, assertion?: (done: MochaDone) => void): ITest;
- only(expectation: string, assertion?: () => void): ITest;
- only(expectation: string, assertion?: (done: MochaDone) => void): ITest;
- skip(expectation: string, assertion?: () => void): void;
- skip(expectation: string, assertion?: (done: MochaDone) => void): void;
+ (expectation: string, assertion?: ActionFunction): ITest;
+ only(expectation: string, assertion?: ActionFunction): ITest;
+ skip(expectation: string, assertion?: ActionFunction): void;
timeout(ms: number): void;
+ state: "failed" | "passed";
}
export module reporters {
diff --git a/mongoose-promise/mongoose-promise-tests.ts b/mongoose-promise/mongoose-promise-tests.ts
new file mode 100644
index 0000000000..e7bda80c6d
--- /dev/null
+++ b/mongoose-promise/mongoose-promise-tests.ts
@@ -0,0 +1,46 @@
+///
+
+var cb = function () {};
+
+var mongopromise: MongoosePromise;
+mongopromise.addBack(function (err, arg) {
+ err.stack;
+ arg.toFixed();
+}).addBack(function (err, arg1, arg2) {
+ err.stack;
+ arg1.toFixed();
+ arg2.toFixed();
+});
+mongopromise.addCallback(function (arg) {
+ arg.toFixed();
+}).addCallback(function (arg1, arg2) {
+ arg1.toFixed();
+ arg2.toFixed();
+});
+mongopromise.addErrback(function (err) {
+ err.stack;
+}).addErrback(cb);
+mongopromise.catch(function (err) {
+ err.stack;
+}).catch(cb);
+mongopromise.end();
+mongopromise.error(999).error([]);
+mongopromise.on('init', cb).on('init', cb);
+mongopromise.reject({}).reject('').reject(new Error('hi'));
+mongopromise.resolve(new Error('hi'), {}).resolve();
+mongopromise.then(function (arg) {
+ arg.toFixed();
+ return 9;
+}, function (err) {
+ err.stack;
+ return 9;
+}).then(function (arg1, arg2) {
+ arg1.toFixed();
+ arg2.toFixed();
+});
+mongopromise.complete();
+/* static properties */
+MongoosePromise.ES6(function (complete, error) {
+ complete.apply(this);
+ error.apply(this);
+});
\ No newline at end of file
diff --git a/mongoose-promise/mongoose-promise.d.ts b/mongoose-promise/mongoose-promise.d.ts
new file mode 100644
index 0000000000..d2622bb6f9
--- /dev/null
+++ b/mongoose-promise/mongoose-promise.d.ts
@@ -0,0 +1,128 @@
+// Type definitions for Mongoose-Promise 4.5.4
+// Project: http://mongoosejs.com/
+// Definitions by: simonxca
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+/*
+ * These are the default promises included in the Mongoose v4.x
+ * definitions. They will be deprecated beginning Mongoose V5.x
+ * in favor of native ES6 Promises.
+ *
+ * You can switch the promise library that mongoose uses by:
+ *
+ * 1. Including this somewhere in your code:
+ * mongoose.Promise = YOUR_PROMISE;
+ *
+ * 2. Including this somewhere in your main .d.ts file:
+ * type MongoosePromise = YOUR_PROMISE;
+ */
+
+/*
+ * http://mongoosejs.com/docs/api.html#promise-js
+ *
+ * Callback signatures are from the mPromise type definitions.
+ */
+interface MongoosePromise {
+ /**
+ * Promise constructor.
+ * Promises are returned from executed queries.
+ * @param fn a function which will be called when the promise
+ * is resolved that accepts fn(err, ...){} as signature
+ * @event err Emits when the promise is rejected
+ * @event complete Emits when the promise is fulfilled
+ * @deprecated Mongoose 5.0 will use native promises by default (or bluebird, if native
+ * promises are not present) but still support plugging in your own ES6-compatible
+ * promises library. Mongoose 5.0 will not support mpromise.
+ */
+ new(fn?: (err: any, arg: T) => void): MongoosePromise;
+ new(fn?: (err: any, ...args: T[]) => void): MongoosePromise;
+}
+
+declare class MongoosePromise {
+ /**
+ * Adds a single function as a listener to both err and complete.
+ * It will be executed with traditional node.js argument position when the promise is resolved.
+ * @deprecated Use onResolve instead.
+ */
+ addBack(listener: (err: any, arg: T) => void): this;
+ addBack(listener: (err: any, ...args: T[]) => void): this;
+
+ /**
+ * Adds a listener to the complete (success) event.
+ * @deprecated Adds a listener to the complete (success) event.
+ */
+ addCallback(listener: (arg: T) => void): this;
+ addCallback(listener: (...args: T[]) => void): this;
+
+ /**
+ * Adds a listener to the err (rejected) event.
+ * @deprecated Use onReject instead.
+ */
+ addErrback(listener: (err: any) => void): this;
+
+ /** ES6-style .catch() shorthand */
+ catch(onReject?: (err: any) => void | TRes | PromiseLike): MongoosePromise;
+
+ /**
+ * Signifies that this promise was the last in a chain of then()s: if a handler passed
+ * to the call to then which produced this promise throws, the exception will go uncaught.
+ */
+ end(): void;
+
+ /**
+ * Rejects this promise with err.
+ * If the promise has already been fulfilled or rejected, not action is taken.
+ * Differs from #reject by first casting err to an Error if it is not instanceof Error.
+ */
+ error(err: any): this;
+
+ /**
+ * Adds listener to the event.
+ * If event is either the success or failure event and the event has already been emitted,
+ * thelistener is called immediately and passed the results of the original emitted event.
+ */
+ on(event: string, listener: Function): this;
+
+ /**
+ * Rejects this promise with reason.
+ * If the promise has already been fulfilled or rejected, not action is taken.
+ */
+ reject(reason: Object | string | Error): this;
+
+ /**
+ * Resolves this promise to a rejected state if err is passed or a fulfilled state if no err is passed.
+ * If the promise has already been fulfilled or rejected, not action is taken.
+ * err will be cast to an Error if not already instanceof Error.
+ * NOTE: overrides mpromise#resolve to provide error casting.
+ * @param err error or null
+ * @param val value to fulfill the promise with
+ */
+ resolve(err?: any, val?: Object): this;
+
+ /**
+ * Creates a new promise and returns it. If onFulfill or onReject are passed, they are added as
+ * SUCCESS/ERROR callbacks to this promise after the nextTick.
+ * Conforms to promises/A+ specification.
+ */
+ then(onFulFill: (arg: T) => void | TRes | PromiseLike,
+ onReject?: (err: any) => void | TRes | PromiseLike): MongoosePromise;
+ then(onFulfill: (...args: T[]) => void | TRes | PromiseLike,
+ onReject?: (err: any) => void | TRes | PromiseLike): MongoosePromise;
+
+ /**
+ * Fulfills this promise with passed arguments. Alias of mpromise#fulfill.
+ * @deprecated Use fulfill instead.
+ */
+ complete(args: T): this;
+ complete(...args: T[]): this;
+
+ /** Fulfills this promise with passed arguments. */
+ fulfill(...args: T[]): this;
+ fulfill(arg: T): this;
+
+ /** ES6-style promise constructor wrapper around mpromise. */
+ static ES6(resolver: (
+ complete: (...args: TRes[]) => void | TRes | PromiseLike,
+ error: (e: any) => void | TRes | PromiseLike
+ ) => void): MongoosePromise;
+}
\ No newline at end of file
diff --git a/mongoose/mongoose-tests.ts b/mongoose/mongoose-tests.ts
index de2bffaf05..f6253bab1a 100644
--- a/mongoose/mongoose-tests.ts
+++ b/mongoose/mongoose-tests.ts
@@ -1,5 +1,4 @@
///
-///
import * as mongoose from 'mongoose';
var fs = require('fs');
@@ -28,7 +27,7 @@ mongoose.connect(connectUri, {
autoIndex: true
},
mongos: true
-}).then(cb).onReject;
+}).then(cb).fulfill();
mongoose.connect(connectUri, function (error) {
error.stack;
});
@@ -102,9 +101,15 @@ coll1.getIndexes();
coll1.collectionName;
coll1.conn;
coll1.name;
-coll1.insureIndex();
+coll1.ensureIndex();
coll1.find({});
-coll1.insert({}, {}, {});
+coll1.insert({}, {});
+
+var coll2 = new mongoose.Collection('', new mongoose.Connection(null));
+coll2.$format(999).toLowerCase();
+/* inherited properties */
+coll2.initializeOrderedBulkOp;
+coll2.indexExists;
/*
* section connection.js
@@ -862,10 +867,10 @@ schemaembedded.sparse(true);
*/
var aggregate: mongoose.Aggregate