From fdaff332fb1a6b53813b08bada97d6d5a348683c Mon Sep 17 00:00:00 2001 From: lonsenluo Date: Sun, 12 Feb 2017 17:37:53 +0800 Subject: [PATCH 01/25] [mongoose] add unwind method with new params type In mongodb 3.2, the unwind operator can with a object params. --- mongoose/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mongoose/index.d.ts b/mongoose/index.d.ts index 40821b8968..7ef5615436 100644 --- a/mongoose/index.d.ts +++ b/mongoose/index.d.ts @@ -2163,6 +2163,11 @@ declare module "mongoose" { * @param fields the field(s) to unwind */ unwind(...fields: string[]): this; + /** + * Appends new custom $unwind operator(s) to this aggregate pipeline + * new in mongodb 3.2 + */ + unwind(...opts: { path: string, includeArrayIndex?: string, preserveNullAndEmptyArrays?: boolean }[]): this; } /* From bfd7ecdd3b5841f92a1f654fa83bfa5a536645c4 Mon Sep 17 00:00:00 2001 From: lonsenluo Date: Tue, 14 Feb 2017 00:26:31 +0800 Subject: [PATCH 02/25] [mongoose] add unwind method with new params type In mongodb 3.2, the unwind operator can with a object params. --- mongoose/mongoose-tests.ts | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/mongoose/mongoose-tests.ts b/mongoose/mongoose-tests.ts index c6dfe20fdc..dc170dccd9 100644 --- a/mongoose/mongoose-tests.ts +++ b/mongoose/mongoose-tests.ts @@ -1016,7 +1016,41 @@ aggregate.sort('field -test'); aggregate.then(cb).catch(cb); aggregate.unwind("tags").unwind('tags'); aggregate.unwind("a", "b", "c").unwind('tag1', 'tag2'); - +aggregate.unwind( + { + path: "tags", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }) + .unwind({ + path: "tags", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }); +aggregate.unwind( + { + path: "a", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }, { + path: "b", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }, { + path: "c", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }) + .unwind({ + path: "tag1", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }, { + path: "tag2", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }); + /* * section schematype.js * http://mongoosejs.com/docs/api.html#schematype-js From 97fe0d3297f08784f9934a030a118b6e7a4df994 Mon Sep 17 00:00:00 2001 From: Joe Skeen Date: Tue, 14 Feb 2017 16:10:09 -0700 Subject: [PATCH 03/25] Add definitions for jquery.tools (overlay widget only) --- jquery.tools/index.d.ts | 159 +++++++++++++++++++++++++ jquery.tools/jquery.tools-tests.ts | 182 +++++++++++++++++++++++++++++ jquery.tools/tsconfig.json | 23 ++++ jquery.tools/tslint.json | 1 + 4 files changed, 365 insertions(+) create mode 100644 jquery.tools/index.d.ts create mode 100644 jquery.tools/jquery.tools-tests.ts create mode 100644 jquery.tools/tsconfig.json create mode 100644 jquery.tools/tslint.json diff --git a/jquery.tools/index.d.ts b/jquery.tools/index.d.ts new file mode 100644 index 0000000000..5431918bbc --- /dev/null +++ b/jquery.tools/index.d.ts @@ -0,0 +1,159 @@ +// Type definitions for jQuery TOOLS 1.2 +// Project: https://github.com/jquerytools/jquerytools +// Definitions by: Joe Skeen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +/// + +declare interface JQuery { + overlay(opts?: JQueryTools.overlay.OverlayOptions): JQuery; + overlay(opts?: JQueryTools.overlay.OverlayOptions): T; + data(key: 'overlay'): JQueryTools.overlay.Overlay; +} + +declare interface JQueryStatic { + tools: JQueryTools.ToolsStatic; +} + +/** jQuery Tools (http://jquerytools.github.io/documentation/overlay/index.html) */ +declare namespace JQueryTools { + interface ToolsStatic { + overlay: overlay.OverlayStatic; + } + + namespace overlay { + interface OverlayStatic { + addEffect(effectName: string, + effectFn: (this: Overlay, position: CssOptions, done: Function) => void, + closeFn: (this: Overlay, done: Function) => void): void; + } + + type CssOptions = { [key: string]: any; }; + + interface OverlayOptions { + /** + * A jQuery selector for the closing elements inside the overlay. These + * can be any elements such as links, buttons or images. If this is not + * supplied, a close element is auto-generated. Read more about this in + * defining close actions. + */ + close?: JQuery; + /** + * By default, overlays are closed when the mouse is clicked outside the + * overlay area. Setting this property to false suppresses this behaviour + * which is suitable for modal dialogs. + * @default true + */ + closeOnClick?: boolean; + /** + * By default, overlays are closed when the ESC keyboard key is pressed. + * Setting this property to false suppresses this behaviour. + * @default true + */ + closeOnEsc?: boolean; + /** The speed to close the overlay, in milliseconds */ + closeSpeed?: number; + /** + * The effect to be used when an overlay is opened and closed. This can + * dramatically change the behaviour of the overlay. By default this tool + * uses an effect called "default" which is a simple show/hide effect. + * @default 'default' + */ + effect?: 'default' | string; + /** + * since 1.2.0. whether overlay stays in the same position while the screen + * is scrolled. This is the default behaviour for all browsers except IE6 + * and below. IE6 does not support fixed positioning. If this property is + * set to false then the overlay is positioned in relationship to the document + * so that when the screen is scrolled then the overlay moves along with the document. + * @default true + */ + fixed?: boolean; + /** + * Previously known as expose. Overlay is very often used together with the + * Mask Tool. Because of this, the support for this feature has been built + * inside the tool. This option accepts the mask configuration. This is either + * a simple string specifying the background color of the mask or a more complex + * object literal specifying more configuration variables. See an example of an + * overlay together with mask. By default masking is disabled. + */ + mask?: string | MaskOptions; + /** + * Specifies how far from the left-hand edge of the screen the overlay should be + * placed. By default the overlay is horizontally centered with the value "center" + * but you can also supply a numerical value specifying a distance in pixels. + * @default 'center' + */ + left?: 'center' | number; + /** + * If enabled then the overlay loads immediately after it has been initialized. + * @default false + */ + load?: boolean; + /** + * By default, there can be only one overlay on the page at once. Setting this + * property to false allows you to have multiple overlay instances. + * @default true + */ + oneInstance?: boolean; + /** + * The speed of the fade-in animation on the "default" effect. Valid values are + * 'slow', 'normal' and 'fast', or you can supply a numerical value (in milliseconds). + * By setting this property to 0, the overlay will appear immediately without any animation. + * @default 'normal' + */ + speed?: 'slow' | 'normal' | 'fast' | number; + /** + * The element to be overlayed (if not specified in the rel attribute of the triggering element). + */ + target?: Element; + /** + * Specifies how far from the top edge of the screen the overlay should be placed. + * Acceptable values are an integer number specifying a distance in pixels, a string + * (such as '15%') specifying a percentage value or "center" in which case the overlay + * is vertically centered. Percentage values work consistently at different screen resolutions. + * @default '10%' + */ + top?: 'center' | string | number; + + /** + * before the overlay is displayed. The overlay has already been positioned at the + * location from where it will start animating. + */ + onBeforeLoad?: (this: Overlay, event: JQueryEventObject) => void; + /** when the overlay has completely been displayed */ + onLoad?: (this: Overlay, event: JQueryEventObject) => void; + /** before the overlay is closed */ + onBeforeClose?: (this: Overlay, event: JQueryEventObject) => void; + /** when the overlay is closed */ + onClose?: (this: Overlay, event: JQueryEventObject) => void; + } + + interface MaskOptions { + /** CSS color string (i.e. hex value) */ + color?: string; + /** load speed in milliseconds */ + loadSpeed?: number; + /** Opacity of mask. Between 0 and 1. */ + opacity?: number; + } + + interface Overlay { + /** Closes the overlay. */ + close(): Overlay; + /** Returns the closing element(s) as a jQuery object. */ + getClosers(): JQuery; + /** Returns the configuration for the overlay. */ + getConf(): OverlayOptions; + /** Returns the overlayed element as a jQuery object. */ + getOverlay(): JQuery; + /** Returns the triggering element as a jQuery object. */ + getTrigger(): JQuery; + /** Returns `true` if the overlay is opened. */ + isOpened(): boolean; + /** Opens the overlay. */ + load(): Overlay; + } + } +} diff --git a/jquery.tools/jquery.tools-tests.ts b/jquery.tools/jquery.tools-tests.ts new file mode 100644 index 0000000000..86375b53ab --- /dev/null +++ b/jquery.tools/jquery.tools-tests.ts @@ -0,0 +1,182 @@ +/// + +/* from documentation at http://jquerytools.github.io/documentation/overlay/index.html */ + + $("img[rel]").overlay(); + + var triggers = $(".modalInput").overlay({ +  + // some mask tweaks suitable for modal dialogs + mask: { + color: '#ebecff', + loadSpeed: 200, + opacity: 0.9 + }, +  + closeOnClick: false + }); + + var buttons = $("#yesno button").click(function(this: JQuery, e) { +  + // get user input + var yes = buttons.index(this) === 0; +  + // do something with the answer + triggers.eq(0).html("You clicked " + (yes ? "yes" : "no")); + }); + +// select one or more elements to be overlay triggers +$(".my_overlay_trigger").overlay({ + // one configuration property + mask: { + color: '#ccc' + }, + // another property + top: 50 + // ... the rest of the configuration properties +}); + +$("#prompt form").submit(function(this: JQuery, e) { +  + // close the overlay + triggers.eq(1).overlay().close(); + //or more straightforward: + triggers.data('overlay').close(); +  + // get user input + var input = $("input", this).val(); +  + // do something with the answer + triggers.eq(1).html(input); +  + // do not submit the form + return e.preventDefault(); + }); + +$.tools.overlay.addEffect('', function() {}, function() {}); + +/* custom effects */ +$.tools.overlay.addEffect("myEffect", function(position, done) { + /* + - 'this' variable is a reference to the overlay API + - here we use jQuery's fadeIn() method to perform the effect + */ + this.getOverlay().css(position).fadeIn(this.getConf().speed, done); + }, +  + // close function + function(done) { + // fade out the overlay + this.getOverlay().fadeOut(this.getConf().closeSpeed, done); + } +); + +$("#apple img[rel]").overlay({effect: 'apple'}); + + // select the overlay element - and "make it an overlay" + $("#facebox").overlay({ + // custom top position + top: 260, + // some mask tweaks suitable for facebox-looking dialogs + mask: { + // you might also consider a "transparent" color for the mask + color: '#fff', + // load mask a little faster + loadSpeed: 200, + // very transparent + opacity: 0.5 + }, + // disable this for modal dialog-type of overlays + closeOnClick: false, + // load it immediately after the construction + load: true +}); + +$(function() { +  + // if the function argument is given to overlay, + // it is assumed to be the onBeforeLoad event listener + $("a[rel]").overlay({ +  + mask: 'darkred', + effect: 'apple', +  + onBeforeLoad: function() { +  + // grab wrapper element inside content + var wrap = this.getOverlay().find(".contentWrap"); +  + // load the page specified in the trigger + wrap.load(this.getTrigger().attr("href")); + } +  + }); +}); + +$(function() { + // positions for each overlay + var positions = [ + [0, 530], + [400, 20], + [400, 530], + [0, 20] + ]; +  + // setup triggers + $("button[rel]").each(function(this: JQuery, i) { +  + $(this).overlay({ +  + // common configuration for each overlay + oneInstance: false, + closeOnClick: false, +  + // setup custom finish position + top: positions[i][0], + left: positions[i][1], +  + // use apple effect + effect: 'apple' +  + }); + }); +}); + +// loading animation +$.tools.overlay.addEffect("drop", function(css, done) { +  + // use Overlay API to gain access to crucial elements + var conf = this.getConf(), + overlay = this.getOverlay(); +  + // determine initial position for the overlay + if (conf.fixed) { + css['position'] = 'fixed'; + } else { + css['top'] += $(window).scrollTop(); + css['left'] += $(window).scrollLeft(); + css['position'] = 'absolute'; + } +  + // position the overlay and show it + overlay.css(css).show(); +  + // begin animating with our custom easing + overlay.animate( + { top: '+=55', opacity: 1, width: '+=20'}, 400, 'drop', done + ); +  + /* closing animation */ +}, function(done) { + this.getOverlay().animate( + {top:'-=55', opacity:0, width:'-=20'}, 300, 'drop', + function(this: JQuery) { + $(this).hide(); + done.call(null); + }); +}); + +$("img[rel]").overlay({ + effect: 'drop', + mask: '#789' +}); diff --git a/jquery.tools/tsconfig.json b/jquery.tools/tsconfig.json new file mode 100644 index 0000000000..64e79cb10d --- /dev/null +++ b/jquery.tools/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jquery.tools-tests.ts" + ] +} \ No newline at end of file diff --git a/jquery.tools/tslint.json b/jquery.tools/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/jquery.tools/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 0099aac357bf21a0c6a6a255124c6be8397b2c18 Mon Sep 17 00:00:00 2001 From: Joe Skeen Date: Tue, 14 Feb 2017 16:20:51 -0700 Subject: [PATCH 04/25] fix implicit any issues for TS 2.0 --- jquery.tools/jquery.tools-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.tools/jquery.tools-tests.ts b/jquery.tools/jquery.tools-tests.ts index 86375b53ab..44c1ddea64 100644 --- a/jquery.tools/jquery.tools-tests.ts +++ b/jquery.tools/jquery.tools-tests.ts @@ -16,7 +16,7 @@ closeOnClick: false }); - var buttons = $("#yesno button").click(function(this: JQuery, e) { + var buttons = $("#yesno button").click(function(this: JQuery, e: JQueryEventObject) {   // get user input var yes = buttons.index(this) === 0; @@ -36,7 +36,7 @@ $(".my_overlay_trigger").overlay({ // ... the rest of the configuration properties }); -$("#prompt form").submit(function(this: JQuery, e) { +$("#prompt form").submit(function(this: JQuery, e: JQueryEventObject) {   // close the overlay triggers.eq(1).overlay().close(); @@ -123,7 +123,7 @@ $(function() { ];   // setup triggers - $("button[rel]").each(function(this: JQuery, i) { + $("button[rel]").each(function(this: JQuery, i: number) {   $(this).overlay({   From 862e6f6b1466f6a1570649041da256fb98e62ea7 Mon Sep 17 00:00:00 2001 From: Joe Skeen Date: Tue, 14 Feb 2017 16:35:31 -0700 Subject: [PATCH 05/25] Fix linting issues --- jquery.tools/index.d.ts | 86 +++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/jquery.tools/index.d.ts b/jquery.tools/index.d.ts index 5431918bbc..1ab90e260a 100644 --- a/jquery.tools/index.d.ts +++ b/jquery.tools/index.d.ts @@ -24,102 +24,104 @@ declare namespace JQueryTools { namespace overlay { interface OverlayStatic { - addEffect(effectName: string, - effectFn: (this: Overlay, position: CssOptions, done: Function) => void, - closeFn: (this: Overlay, done: Function) => void): void; + addEffect(effectName: string, + effectFn: (this: Overlay, position: CssOptions, done: () => void) => void, + closeFn: (this: Overlay, done: () => void) => void): void; } - type CssOptions = { [key: string]: any; }; + interface CssOptions { + [key: string]: any; + } interface OverlayOptions { /** - * A jQuery selector for the closing elements inside the overlay. These - * can be any elements such as links, buttons or images. If this is not - * supplied, a close element is auto-generated. Read more about this in - * defining close actions. + * A jQuery selector for the closing elements inside the overlay. These + * can be any elements such as links, buttons or images. If this is not + * supplied, a close element is auto-generated. Read more about this in + * defining close actions. */ close?: JQuery; /** - * By default, overlays are closed when the mouse is clicked outside the - * overlay area. Setting this property to false suppresses this behaviour - * which is suitable for modal dialogs. + * By default, overlays are closed when the mouse is clicked outside the + * overlay area. Setting this property to false suppresses this behaviour + * which is suitable for modal dialogs. * @default true */ closeOnClick?: boolean; /** - * By default, overlays are closed when the ESC keyboard key is pressed. - * Setting this property to false suppresses this behaviour. + * By default, overlays are closed when the ESC keyboard key is pressed. + * Setting this property to false suppresses this behaviour. * @default true */ closeOnEsc?: boolean; /** The speed to close the overlay, in milliseconds */ closeSpeed?: number; /** - * The effect to be used when an overlay is opened and closed. This can - * dramatically change the behaviour of the overlay. By default this tool + * The effect to be used when an overlay is opened and closed. This can + * dramatically change the behaviour of the overlay. By default this tool * uses an effect called "default" which is a simple show/hide effect. * @default 'default' */ effect?: 'default' | string; /** - * since 1.2.0. whether overlay stays in the same position while the screen - * is scrolled. This is the default behaviour for all browsers except IE6 - * and below. IE6 does not support fixed positioning. If this property is - * set to false then the overlay is positioned in relationship to the document - * so that when the screen is scrolled then the overlay moves along with the document. + * since 1.2.0. whether overlay stays in the same position while the screen + * is scrolled. This is the default behaviour for all browsers except IE6 + * and below. IE6 does not support fixed positioning. If this property is + * set to false then the overlay is positioned in relationship to the document + * so that when the screen is scrolled then the overlay moves along with the document. * @default true */ fixed?: boolean; /** - * Previously known as expose. Overlay is very often used together with the - * Mask Tool. Because of this, the support for this feature has been built - * inside the tool. This option accepts the mask configuration. This is either - * a simple string specifying the background color of the mask or a more complex - * object literal specifying more configuration variables. See an example of an + * Previously known as expose. Overlay is very often used together with the + * Mask Tool. Because of this, the support for this feature has been built + * inside the tool. This option accepts the mask configuration. This is either + * a simple string specifying the background color of the mask or a more complex + * object literal specifying more configuration variables. See an example of an * overlay together with mask. By default masking is disabled. */ mask?: string | MaskOptions; - /** + /** * Specifies how far from the left-hand edge of the screen the overlay should be - * placed. By default the overlay is horizontally centered with the value "center" - * but you can also supply a numerical value specifying a distance in pixels. + * placed. By default the overlay is horizontally centered with the value "center" + * but you can also supply a numerical value specifying a distance in pixels. * @default 'center' */ left?: 'center' | number; /** - * If enabled then the overlay loads immediately after it has been initialized. + * If enabled then the overlay loads immediately after it has been initialized. * @default false */ load?: boolean; /** - * By default, there can be only one overlay on the page at once. Setting this - * property to false allows you to have multiple overlay instances. + * By default, there can be only one overlay on the page at once. Setting this + * property to false allows you to have multiple overlay instances. * @default true */ oneInstance?: boolean; /** - * The speed of the fade-in animation on the "default" effect. Valid values are - * 'slow', 'normal' and 'fast', or you can supply a numerical value (in milliseconds). - * By setting this property to 0, the overlay will appear immediately without any animation. + * The speed of the fade-in animation on the "default" effect. Valid values are + * 'slow', 'normal' and 'fast', or you can supply a numerical value (in milliseconds). + * By setting this property to 0, the overlay will appear immediately without any animation. * @default 'normal' */ speed?: 'slow' | 'normal' | 'fast' | number; /** - * The element to be overlayed (if not specified in the rel attribute of the triggering element). + * The element to be overlayed (if not specified in the rel attribute of the triggering element). */ target?: Element; /** - * Specifies how far from the top edge of the screen the overlay should be placed. - * Acceptable values are an integer number specifying a distance in pixels, a string - * (such as '15%') specifying a percentage value or "center" in which case the overlay - * is vertically centered. Percentage values work consistently at different screen resolutions. + * Specifies how far from the top edge of the screen the overlay should be placed. + * Acceptable values are an integer number specifying a distance in pixels, a string + * (such as '15%') specifying a percentage value or "center" in which case the overlay + * is vertically centered. Percentage values work consistently at different screen resolutions. * @default '10%' */ top?: 'center' | string | number; - /** - * before the overlay is displayed. The overlay has already been positioned at the - * location from where it will start animating. + /** + * before the overlay is displayed. The overlay has already been positioned at the + * location from where it will start animating. */ onBeforeLoad?: (this: Overlay, event: JQueryEventObject) => void; /** when the overlay has completely been displayed */ From d7bd7663d79f5697b3f871999184ac968a0c597e Mon Sep 17 00:00:00 2001 From: Pablo Ois Lagarde Date: Tue, 14 Feb 2017 21:52:04 -0300 Subject: [PATCH 06/25] [request] Support jsonReviver and jsonReplacer options --- request/index.d.ts | 2 ++ request/request-tests.ts | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/request/index.d.ts b/request/index.d.ts index edf31b9a9b..d576c82e3b 100644 --- a/request/index.d.ts +++ b/request/index.d.ts @@ -91,6 +91,8 @@ declare namespace request { qsStringifyOptions?: any; qsParseOptions?: any; json?: any; + jsonReviver?: (key: string, value: any) => any; + jsonReplacer?: (key: string, value: any) => any; multipart?: RequestPart[] | Multipart; agent?: http.Agent | https.Agent; agentOptions?: any; diff --git a/request/request-tests.ts b/request/request-tests.ts index b26149533b..1bd81760c8 100644 --- a/request/request-tests.ts +++ b/request/request-tests.ts @@ -91,6 +91,12 @@ var options: request.Options = { aws: aws, qs: obj, json: value, + jsonReviver: (key: string, value: any) => { + + }, + jsonReplacer: (key: string, value: any) => { + + }, multipart: value, agent: new http.Agent(), agentOptions: value, From c093ee6b1168a1bb3d1a41502f1de6aeabfc0988 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Tue, 14 Feb 2017 22:00:38 -0800 Subject: [PATCH 07/25] Add options to AggressiveMergingPlugin --- webpack/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 8b5a4d9938..1a762b29a5 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -759,7 +759,10 @@ declare namespace webpack { namespace optimize { class AggressiveMergingPlugin extends Plugin { - constructor(options: any); + constructor(options?: { + minSize?: number; + maxSize?: number; + }); } class CommonsChunkPlugin extends Plugin { From beb1e4e94517e708a8500e4e873d1f87e29d2bf1 Mon Sep 17 00:00:00 2001 From: casperno Date: Wed, 15 Feb 2017 07:21:59 +0100 Subject: [PATCH 08/25] Update index.d.ts Added missing pad method to Rectangle: pad(top: number, left: number, bottom: number, right: number): Rectangle; --- easeljs/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/easeljs/index.d.ts b/easeljs/index.d.ts index a5916a56f2..d47f631728 100644 --- a/easeljs/index.d.ts +++ b/easeljs/index.d.ts @@ -735,6 +735,7 @@ declare namespace createjs { intersection(rect: Rectangle): Rectangle; intersects(rect: Rectangle): boolean; isEmpty(): boolean; + pad(top: number, left: number, bottom: number, right: number): Rectangle; setValues(x?: number, y?: number, width?: number, height?: number): Rectangle; toString(): string; union(rect: Rectangle): Rectangle; From 6b69d0b34be465220c66ffd8b8de5ae2da3e2529 Mon Sep 17 00:00:00 2001 From: Bastien Date: Wed, 15 Feb 2017 09:58:57 +0100 Subject: [PATCH 09/25] Add missing parameters for instant() Add parameters forceLanguage and sanitizeStrategy for instant() --- angular-translate/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angular-translate/index.d.ts b/angular-translate/index.d.ts index 19e1962fab..3b911ba313 100644 --- a/angular-translate/index.d.ts +++ b/angular-translate/index.d.ts @@ -51,8 +51,8 @@ declare module 'angular' { cloakClassName(name: string): ITranslateProvider; fallbackLanguage(langKey?: string): string; fallbackLanguage(langKey?: string[]): string; - instant(translationId: string, interpolateParams?: any, interpolationId?: string): string; - instant(translationId: string[], interpolateParams?: any, interpolationId?: string): { [key: string]: string }; + instant(translationId: string, interpolateParams?: any, interpolationId?: string, forceLanguage?: string, sanitizeStrategy?: string): string; + instant(translationId: string[], interpolateParams?: any, interpolationId?: string, forceLanguage?: string, sanitizeStrategy?: string): { [key: string]: string }; isPostCompilingEnabled(): boolean; preferredLanguage(langKey?: string): string; proposedLanguage(): string; From 70654e04826ae75c49985368b389c6cdbb91c7e5 Mon Sep 17 00:00:00 2001 From: Leo Liang Date: Wed, 15 Feb 2017 17:05:04 +0800 Subject: [PATCH 10/25] ShellJS: ExecOptions extends child_process.ExecOptions --- shelljs/index.d.ts | 4 ++-- shelljs/shelljs-tests.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shelljs/index.d.ts b/shelljs/index.d.ts index 5e812947fd..a8f2196dab 100644 --- a/shelljs/index.d.ts +++ b/shelljs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ShellJS v0.6.0 +// Type definitions for ShellJS v0.7.6 // Project: http://shelljs.org // Definitions by: Niklas Mollenhauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -466,7 +466,7 @@ export interface ExecCallback { (code: number, stdout: string, stderr: string): any; } -export interface ExecOptions { +export interface ExecOptions extends child.ExecOptions { silent?: boolean; async?: boolean; } diff --git a/shelljs/shelljs-tests.ts b/shelljs/shelljs-tests.ts index a78b8e44e1..6c155e5aee 100644 --- a/shelljs/shelljs-tests.ts +++ b/shelljs/shelljs-tests.ts @@ -97,7 +97,7 @@ var pid = asyncVersion3.pid; shell.exec("node --version", { silent: true }, function (code, stdout, stderr) { var version = stdout; }); -shell.exec("node --version", { silent: true, async: true }, function (code, stdout, stderr) { +shell.exec("node --version", { silent: true, async: true, cwd: '/usr/local/bin' }, function (code, stdout, stderr) { var version = stdout; }); shell.exec("node --version", function (code, stdout, stderr) { From a4fcf4a0f2cc0847e60765fe6c3375b3394a1537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Wed, 15 Feb 2017 19:21:00 +0900 Subject: [PATCH 11/25] Server#close takes a callback function. --- socket.io/index.d.ts | 2 +- socket.io/socket.io-tests.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/socket.io/index.d.ts b/socket.io/index.d.ts index bf46ca1160..2333dc8fe2 100644 --- a/socket.io/index.d.ts +++ b/socket.io/index.d.ts @@ -180,7 +180,7 @@ declare namespace SocketIO { /** * Closes the server connection */ - close():void; + close( fn ?: () => void ):void; /** * The event fired when we get a new connection diff --git a/socket.io/socket.io-tests.ts b/socket.io/socket.io-tests.ts index 442e677751..ea3d97e21f 100644 --- a/socket.io/socket.io-tests.ts +++ b/socket.io/socket.io-tests.ts @@ -143,3 +143,14 @@ function testUsingItJustAsACrossBrowserWebSocket() { socket.on('disconnect', function () { }); }); } + +function testClosingServerWithCallback() { + var io = socketIO.listen(80); + io.close(function() { + }); +} + +function testClosingServerWithoutCallback() { + var io = socketIO.listen(80); + io.close(); +} From 9c326e61b30f442a16f6006b8c85c1eb384f750d Mon Sep 17 00:00:00 2001 From: Mikael Kohlmyr Date: Wed, 15 Feb 2017 12:58:27 +0100 Subject: [PATCH 12/25] Fixed the interface for RSVP.hash to accept object literal instead of array (#1) * fixed interface for RSVP.hash to accept object literal instead of array * added self to definitions by header * changed version header to most recently published (3.3.3) --- rsvp/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rsvp/index.d.ts b/rsvp/index.d.ts index f4a8fd0a1a..f8dbb67a18 100644 --- a/rsvp/index.d.ts +++ b/rsvp/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for RSVP 3.0.9 -// Project: github.com/tildeio/rsvp.js 3.0.9 -// Definitions by: Taylor Brown +// Type definitions for RSVP 3.3.3 +// Project: github.com/tildeio/rsvp.js 3.3.3 +// Definitions by: Taylor Brown , Mikael Kohlmyr // Definitions: https://github.com/borisyankov/DefinitelyTyped // Some of this file was taken from the type definitions for es6-promise https://github.com/borisyankov/DefinitelyTyped/blob/master/es6-promise/es6-promise.d.ts @@ -220,8 +220,8 @@ declare module RSVP { * having to remember the initial order like you would with all(). * */ - export function hash(promises: Thenable[]): Promise; - export function hash(promises: any[]): Promise; + export function hash(promises: { [key: string]: Thenable }): Promise<{ [key: string]: T }>; + export function hash(promises: { [key: string]: any }): Promise<{ [key: string]: T }>; /** `RSVP.map` is similar to JavaScript's native `map` method, except that it From a02153713e2f96b3b01a9c5dde943b434a566439 Mon Sep 17 00:00:00 2001 From: Mikael Kohlmyr Date: Wed, 15 Feb 2017 14:39:31 +0100 Subject: [PATCH 13/25] Update index.d.ts --- rsvp/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rsvp/index.d.ts b/rsvp/index.d.ts index f8dbb67a18..a831944a8f 100644 --- a/rsvp/index.d.ts +++ b/rsvp/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for RSVP 3.3.3 -// Project: github.com/tildeio/rsvp.js 3.3.3 +// Project: https://github.com/tildeio/rsvp.js // Definitions by: Taylor Brown , Mikael Kohlmyr // Definitions: https://github.com/borisyankov/DefinitelyTyped From bdacde8d08be20a3f57ce602afc2174dcda81e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Denis?= Date: Wed, 15 Feb 2017 15:53:30 +0100 Subject: [PATCH 14/25] [gapi.auth2] Fix prompt param type in GoogleAuth.signIn and similar methods --- gapi.auth2/gapi.auth2-tests.ts | 7 +++++++ gapi.auth2/index.d.ts | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gapi.auth2/gapi.auth2-tests.ts b/gapi.auth2/gapi.auth2-tests.ts index 2cfaa49980..15fd8b4e2b 100644 --- a/gapi.auth2/gapi.auth2-tests.ts +++ b/gapi.auth2/gapi.auth2-tests.ts @@ -19,6 +19,13 @@ function test_getAuthInstance(){ var auth = gapi.auth2.getAuthInstance(); } +function test_signIn(){ + gapi.auth2.getAuthInstance().signIn({ + scope: 'email profile', + prompt: 'content' + }); +} + function test_getAuthResponse(){ var user = gapi.auth2.getAuthInstance().currentUser.get(); var authResponse = user.getAuthResponse(); diff --git a/gapi.auth2/index.d.ts b/gapi.auth2/index.d.ts index 6037f0238e..c30f37d013 100644 --- a/gapi.auth2/index.d.ts +++ b/gapi.auth2/index.d.ts @@ -34,7 +34,7 @@ declare namespace gapi.auth2 { signIn(options?: { app_package_name?: string; fetch_basic_profile?: boolean; - prompt?: boolean; + prompt?: string; scope?: string; }, optionBuilder?: SigninOptionsBuilder): any; @@ -62,7 +62,7 @@ declare namespace gapi.auth2 { attachClickHandler(container: any, options: { app_package_name?: string; fetch_basic_profile?: boolean; - prompt?: boolean; + prompt?: string; scope?: string; }, onsuccess: (googleUser: GoogleUser) => any, onfailure: (reason: string) => any): any; } @@ -167,7 +167,7 @@ declare namespace gapi.auth2 { signIn(options?: { app_package_name?: string; fetch_basic_profile?: boolean; - prompt?: boolean; + prompt?: string; scope?: string; }, optionBuilder?: SigninOptionsBuilder): any; @@ -177,7 +177,7 @@ declare namespace gapi.auth2 { grant(options?: { app_package_name?: string; fetch_basic_profile?: boolean; - prompt?: boolean; + prompt?: string; scope?: string; }, optionBuilder?: SigninOptionsBuilder): any; From 422f8bc40117b19266031cc9533e29857107ae88 Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Wed, 15 Feb 2017 08:59:57 -0600 Subject: [PATCH 15/25] Make @types/later compatible with strictNullChecks projects --- later/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/later/index.d.ts b/later/index.d.ts index c5c2449a00..5dd68ec90a 100644 --- a/later/index.d.ts +++ b/later/index.d.ts @@ -142,7 +142,7 @@ declare namespace later { * For acces to custom time periods created as extension to the later static type * and modifiers created on the later modifier static type. */ - [ timeperiodAndModifierName: string ]: number[]; + [ timeperiodAndModifierName: string ]: number[] | undefined; } interface ParseStatic { From f001b91f4b071b328c3f6a820dffc8d1fb7af283 Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Wed, 15 Feb 2017 09:16:03 -0600 Subject: [PATCH 16/25] Modify tests --- later/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/later/tsconfig.json b/later/tsconfig.json index 78a6cefd34..add4a07667 100644 --- a/later/tsconfig.json +++ b/later/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From 0879b9b363265e300ffd343e508936d19b3e22dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Denis?= Date: Wed, 15 Feb 2017 16:18:03 +0100 Subject: [PATCH 17/25] [gapi.auth2] Extract SigninOption type and document it Fix GoogleAuth.signIn param as a union type --- gapi.auth2/gapi.auth2-tests.ts | 9 ++++++ gapi.auth2/index.d.ts | 57 +++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/gapi.auth2/gapi.auth2-tests.ts b/gapi.auth2/gapi.auth2-tests.ts index 15fd8b4e2b..621ca6f056 100644 --- a/gapi.auth2/gapi.auth2-tests.ts +++ b/gapi.auth2/gapi.auth2-tests.ts @@ -26,6 +26,15 @@ function test_signIn(){ }); } +function test_signInOptionsBuild(){ + var options = new gapi.auth2.SigninOptionsBuilder(); + options.setAppPackageName('com.example.app'); + options.setFetchBasicProfile(true); + options.setPrompt('select_account'); + options.setScope('profile').setScope('email'); + gapi.auth2.getAuthInstance().signIn(options); +} + function test_getAuthResponse(){ var user = gapi.auth2.getAuthInstance().currentUser.get(); var authResponse = user.getAuthResponse(); diff --git a/gapi.auth2/index.d.ts b/gapi.auth2/index.d.ts index c30f37d013..6146a87e28 100644 --- a/gapi.auth2/index.d.ts +++ b/gapi.auth2/index.d.ts @@ -31,12 +31,7 @@ declare namespace gapi.auth2 { /** * Signs in the user using the specified options. */ - signIn(options?: { - app_package_name?: string; - fetch_basic_profile?: boolean; - prompt?: string; - scope?: string; - }, optionBuilder?: SigninOptionsBuilder): any; + signIn(options?: SigninOptions | SigninOptionsBuilder): any; /** * Signs out all accounts from the application. @@ -59,12 +54,8 @@ declare namespace gapi.auth2 { /** * Attaches the sign-in flow to the specified container's click handler. */ - attachClickHandler(container: any, options: { - app_package_name?: string; - fetch_basic_profile?: boolean; - prompt?: string; - scope?: string; - }, onsuccess: (googleUser: GoogleUser) => any, onfailure: (reason: string) => any): any; + attachClickHandler(container: any, options: SigninOptions, + onsuccess: (googleUser: GoogleUser) => any, onfailure: (reason: string) => any): any; } export interface IsSignedIn{ @@ -93,6 +84,32 @@ declare namespace gapi.auth2 { listen(listener: (user: GoogleUser) => any): void; } + export interface SigninOptions { + /** + * The package name of the Android app to install over the air. + * See Android app installs from your web site: + * https://developers.google.com/identity/sign-in/web/android-app-installs + */ + app_package_name?: string; + /** + * Fetch users' basic profile information when they sign in. + * Adds 'profile', 'email' and 'openid' to the requested scopes. + * True if unspecified. + */ + fetch_basic_profile?: boolean; + /** + * Specifies whether to prompt the user for re-authentication. + * See OpenID Connect Request Parameters: + * https://openid.net/specs/openid-connect-basic-1_0.html#RequestParameters + */ + prompt?: string; + /** + * The scopes to request, as a space-delimited string. + * Optional if fetch_basic_profile is not set to false. + */ + scope?: string; + } + export class SigninOptionsBuilder { setAppPackageName(name: string): any; setFetchBasicProfile(fetch: boolean): any; @@ -164,22 +181,12 @@ declare namespace gapi.auth2 { * When you use GoogleUser.signIn(), the sign-in flow skips the account chooser step. * See GoogleAuth.signIn(). */ - signIn(options?: { - app_package_name?: string; - fetch_basic_profile?: boolean; - prompt?: string; - scope?: string; - }, optionBuilder?: SigninOptionsBuilder): any; + signIn(options?: SigninOptions | SigninOptionsBuilder): any; /** - * + * See GoogleUser.signIn() */ - grant(options?: { - app_package_name?: string; - fetch_basic_profile?: boolean; - prompt?: string; - scope?: string; - }, optionBuilder?: SigninOptionsBuilder): any; + grant(options?: SigninOptions | SigninOptionsBuilder): any; /** * Get permission from the user to access the specified scopes offline. From 8ca677c1aab7059e2f929a176e56af0ca525a008 Mon Sep 17 00:00:00 2001 From: Marc Neumann Date: Wed, 15 Feb 2017 18:30:49 +0100 Subject: [PATCH 18/25] Added type definitions for node-xmpp-client --- node-xmpp-client/index.d.ts | 73 ++++++++++++++++++++++ node-xmpp-client/node-xmpp-client-tests.ts | 21 +++++++ node-xmpp-client/tsconfig.json | 13 ++++ 3 files changed, 107 insertions(+) create mode 100644 node-xmpp-client/index.d.ts create mode 100644 node-xmpp-client/node-xmpp-client-tests.ts create mode 100644 node-xmpp-client/tsconfig.json diff --git a/node-xmpp-client/index.d.ts b/node-xmpp-client/index.d.ts new file mode 100644 index 0000000000..894c3dead8 --- /dev/null +++ b/node-xmpp-client/index.d.ts @@ -0,0 +1,73 @@ +// Type definitions for Node Xmpp Client 3.1.3 +// Project: https://github.com/node-xmpp/node-xmpp/tree/master/packages/node-xmpp-client/ +// Definitions by: PJakcson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export declare class Client { + static Stanza: Stanza; + + constructor(options: XmppOptions); + + /** + * Connect to Xmpp-Server + */ + connect(): void; + + disconnect(): void; + + on(event: string, c: (err: any, r: any) => any): void; + + send(stanza: any): void; + + end(): void; +} + +interface Stanza extends Element { + new(name: string, attr: any): Stanza; + from: string; + to: string; + id: string; + type: string; +} + +interface Element { + is(name: string, xmlns: string): boolean; + getName(): string; + getNS(): string; + findNS(prefix: string): string; + getXmlns(): string; + setAttrs(attrs: any): void; + getAttrs(): any; + + up(): Element; + c(name: string, attrs?: any): Element; + cnode(child: Element): Element; + t(text: string): Element; + remove(el: Element, xmnls: string): Element; + attr(attr: any, val: any): any; + + toString(): string; + toJSON(): any; +} + +interface XmppOptions { + jid: string; + password: string; + host?: string; + port?: number; + reconnect?: boolean; + autostart?: boolean; // if we start connecting to a given port + register?: boolean; // register account before authentication + legacySSL?: boolean; // connect to the legacy SSL port, requires at least the host to be specified + credentials?: any; // Dictionary (optional) - TLS or SSL key and certificate credentials + actAs?: string; // if admin user act on behalf of another user (just user) + disallowTLS?: boolean; // prevent upgrading the connection to a secure one via TLS + preferred?: string; // Preferred SASL mechanism to use + bosh?: Bosh; +} + +interface Bosh { + url?: string + prebind?: (error, data) => void; +} diff --git a/node-xmpp-client/node-xmpp-client-tests.ts b/node-xmpp-client/node-xmpp-client-tests.ts new file mode 100644 index 0000000000..6ff2803197 --- /dev/null +++ b/node-xmpp-client/node-xmpp-client-tests.ts @@ -0,0 +1,21 @@ +import {Client} from './index'; + +let client = new Client({ + jid: 'user@example.com', + password: 'password' +}); + +client.on('online', function () { + console.log('online') +}); + +client.on('stanza', function (stanza) { + console.log('Incoming stanza: ', stanza.toString()) +}); + +let stanza = new Client.Stanza('chat', {}) + .c('show').t('chat').up() + .c('status').t('message'); +this.client.send(stanza); + +client.end(); diff --git a/node-xmpp-client/tsconfig.json b/node-xmpp-client/tsconfig.json new file mode 100644 index 0000000000..54d5c2a02f --- /dev/null +++ b/node-xmpp-client/tsconfig.json @@ -0,0 +1,13 @@ +{ + "files": [ + "index.d.ts", + "node-xmpp-client-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "sourceMap": true + }, + "exclude": [ + ] +} From 911723cfa7f9bc07d2585d98c113d0e31a582ee3 Mon Sep 17 00:00:00 2001 From: Marc Neumann Date: Wed, 15 Feb 2017 18:59:07 +0100 Subject: [PATCH 19/25] Minor adjustments and added tslist.json. --- node-xmpp-client/index.d.ts | 12 ++++-------- node-xmpp-client/node-xmpp-client-tests.ts | 6 ++++-- node-xmpp-client/tsconfig.json | 14 ++++++++------ node-xmpp-client/tslint.json | 3 +++ 4 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 node-xmpp-client/tslint.json diff --git a/node-xmpp-client/index.d.ts b/node-xmpp-client/index.d.ts index 894c3dead8..3c70f44f50 100644 --- a/node-xmpp-client/index.d.ts +++ b/node-xmpp-client/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Node Xmpp Client 3.1.3 +// Type definitions for node-xmpp-client 3.1 // Project: https://github.com/node-xmpp/node-xmpp/tree/master/packages/node-xmpp-client/ // Definitions by: PJakcson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,9 +9,6 @@ export declare class Client { constructor(options: XmppOptions); - /** - * Connect to Xmpp-Server - */ connect(): void; disconnect(): void; @@ -19,11 +16,10 @@ export declare class Client { on(event: string, c: (err: any, r: any) => any): void; send(stanza: any): void; - - end(): void; } interface Stanza extends Element { + // tslint:disable-next-line new(name: string, attr: any): Stanza; from: string; to: string; @@ -68,6 +64,6 @@ interface XmppOptions { } interface Bosh { - url?: string - prebind?: (error, data) => void; + url?: string; + prebind?: (error: any, data: any) => void; } diff --git a/node-xmpp-client/node-xmpp-client-tests.ts b/node-xmpp-client/node-xmpp-client-tests.ts index 6ff2803197..1e4c215462 100644 --- a/node-xmpp-client/node-xmpp-client-tests.ts +++ b/node-xmpp-client/node-xmpp-client-tests.ts @@ -5,6 +5,8 @@ let client = new Client({ password: 'password' }); +client.connect(); + client.on('online', function () { console.log('online') }); @@ -16,6 +18,6 @@ client.on('stanza', function (stanza) { let stanza = new Client.Stanza('chat', {}) .c('show').t('chat').up() .c('status').t('message'); -this.client.send(stanza); +client.send(stanza); -client.end(); +client.disconnect(); diff --git a/node-xmpp-client/tsconfig.json b/node-xmpp-client/tsconfig.json index 54d5c2a02f..fface20c51 100644 --- a/node-xmpp-client/tsconfig.json +++ b/node-xmpp-client/tsconfig.json @@ -1,13 +1,15 @@ { - "files": [ - "index.d.ts", - "node-xmpp-client-tests.ts" - ], "compilerOptions": { "module": "commonjs", "target": "es5", - "sourceMap": true + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "noEmit": true, + "forceConsistentCasingInFileNames": true }, - "exclude": [ + "files": [ + "index.d.ts", + "node-xmpp-client-tests.ts" ] } diff --git a/node-xmpp-client/tslint.json b/node-xmpp-client/tslint.json new file mode 100644 index 0000000000..ec365f164b --- /dev/null +++ b/node-xmpp-client/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} From a531496e5c95fd8f23886da8f2bd263341902166 Mon Sep 17 00:00:00 2001 From: Marc Neumann Date: Wed, 15 Feb 2017 19:02:01 +0100 Subject: [PATCH 20/25] Minor comment. --- node-xmpp-client/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node-xmpp-client/index.d.ts b/node-xmpp-client/index.d.ts index 3c70f44f50..97e7cdfa73 100644 --- a/node-xmpp-client/index.d.ts +++ b/node-xmpp-client/index.d.ts @@ -19,6 +19,8 @@ export declare class Client { } interface Stanza extends Element { + // This has to be used for the static class initializer new Client.Stanza(..). If there is a better way feel free to + // contribute. // tslint:disable-next-line new(name: string, attr: any): Stanza; from: string; From e90288f791fcf43bdf80f3ba5e37032bd45d31a7 Mon Sep 17 00:00:00 2001 From: Marc Neumann Date: Wed, 15 Feb 2017 19:03:24 +0100 Subject: [PATCH 21/25] Added lib in tsconfig. --- node-xmpp-client/tsconfig.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node-xmpp-client/tsconfig.json b/node-xmpp-client/tsconfig.json index fface20c51..03d7dfa4db 100644 --- a/node-xmpp-client/tsconfig.json +++ b/node-xmpp-client/tsconfig.json @@ -1,7 +1,9 @@ { "compilerOptions": { "module": "commonjs", - "target": "es5", + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, From 29e48f54a7a806fa6b3ce7f739555b377363df35 Mon Sep 17 00:00:00 2001 From: Marc Neumann Date: Wed, 15 Feb 2017 19:13:25 +0100 Subject: [PATCH 22/25] Switch to es6 part II. --- node-xmpp-client/index.d.ts | 2 +- node-xmpp-client/node-xmpp-client-tests.ts | 3 +-- node-xmpp-client/tsconfig.json | 5 +++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/node-xmpp-client/index.d.ts b/node-xmpp-client/index.d.ts index 97e7cdfa73..874df37de7 100644 --- a/node-xmpp-client/index.d.ts +++ b/node-xmpp-client/index.d.ts @@ -13,7 +13,7 @@ export declare class Client { disconnect(): void; - on(event: string, c: (err: any, r: any) => any): void; + on(event: string, c: (e: any, d: any) => any): void; send(stanza: any): void; } diff --git a/node-xmpp-client/node-xmpp-client-tests.ts b/node-xmpp-client/node-xmpp-client-tests.ts index 1e4c215462..52a54a0453 100644 --- a/node-xmpp-client/node-xmpp-client-tests.ts +++ b/node-xmpp-client/node-xmpp-client-tests.ts @@ -8,11 +8,10 @@ let client = new Client({ client.connect(); client.on('online', function () { - console.log('online') }); client.on('stanza', function (stanza) { - console.log('Incoming stanza: ', stanza.toString()) + let _ = stanza; }); let stanza = new Client.Stanza('chat', {}) diff --git a/node-xmpp-client/tsconfig.json b/node-xmpp-client/tsconfig.json index 03d7dfa4db..c76db9a985 100644 --- a/node-xmpp-client/tsconfig.json +++ b/node-xmpp-client/tsconfig.json @@ -7,6 +7,11 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, From 853d2cbfd4db052172ac60c3a7e3f4258ad163b7 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 15 Feb 2017 13:34:07 -0800 Subject: [PATCH 23/25] steed: Clean up callbacks --- steed/index.d.ts | 19 +++++++++---------- steed/tslint.json | 6 ++++++ 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 steed/tslint.json diff --git a/steed/index.d.ts b/steed/index.d.ts index ba4b199999..4865c8efa8 100644 --- a/steed/index.d.ts +++ b/steed/index.d.ts @@ -3,22 +3,21 @@ // Definitions by: Paul Isache // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - declare namespace steed { interface Dictionary { [key: string]: T; } - interface ErrorCallback { (err?: T): void; } + type ErrorCallback = (err?: T) => void; - interface SteedResultCallback { (err: E, result: T): void; } - interface SteedResultArrayCallback { (err: E, results: T[]): void; } - interface SteedResultObjectCallback { (err: E, results: Dictionary): void; } + type SteedResultCallback = (err: E, result: T) => void; + type SteedResultArrayCallback = (err: E, results: T[]) => void; + type SteedResultObjectCallback = (err: E, results: Dictionary) => void; - interface SteedWorker { (task: T, callback: ErrorCallback): void; } - interface SteedIterator { (item: T, callback: ErrorCallback): void; } - interface SteedResultIterator { (item: T, callback: SteedResultCallback): void; } - interface SteedFunction { (callback: (err?: E, result?: T) => void): void; } + type SteedWorker = (task: T, callback: ErrorCallback) => void; + type SteedIterator = (item: T, callback: ErrorCallback) => void; + type SteedResultIterator = (item: T, callback: SteedResultCallback) => void; + type SteedFunction = (callback: (err?: E, result?: T) => void) => void; interface SteedQueue { - push(task: T | T[], callback?: ErrorCallback | SteedResultCallback): void; + push(task: T | T[], callback?: SteedResultCallback): void; unshift(task: T | T[], callback?: ErrorCallback): void; pause(): void; resume(): void; diff --git a/steed/tslint.json b/steed/tslint.json new file mode 100644 index 0000000000..f05741c59b --- /dev/null +++ b/steed/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false + } +} From c0403d346fd210aeed6648e008ad6831ad452f28 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Wed, 15 Feb 2017 23:42:36 +0200 Subject: [PATCH 24/25] fix web-bluetooth typings fix the type of `optionalServices` in `RequestDeviceOptions` --- web-bluetooth/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-bluetooth/index.d.ts b/web-bluetooth/index.d.ts index 219dd65f5e..f30269239c 100644 --- a/web-bluetooth/index.d.ts +++ b/web-bluetooth/index.d.ts @@ -17,7 +17,7 @@ interface BluetoothRequestDeviceFilter { interface RequestDeviceOptions { filters: BluetoothRequestDeviceFilter[]; - optionalServices?: number[]; + optionalServices?: BluetoothServiceUUID[]; acceptAllDevices?: boolean; } From ecc0953d04b2bc7866d8186df8e2c4bfdfb3cc34 Mon Sep 17 00:00:00 2001 From: Joe Skeen Date: Thu, 16 Feb 2017 10:10:33 -0700 Subject: [PATCH 25/25] remove string literal from union with string type --- jquery.tools/index.d.ts | 4 ++-- jquery.tools/jquery.tools-tests.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.tools/index.d.ts b/jquery.tools/index.d.ts index 1ab90e260a..e511a961fd 100644 --- a/jquery.tools/index.d.ts +++ b/jquery.tools/index.d.ts @@ -62,7 +62,7 @@ declare namespace JQueryTools { * uses an effect called "default" which is a simple show/hide effect. * @default 'default' */ - effect?: 'default' | string; + effect?: string; /** * since 1.2.0. whether overlay stays in the same position while the screen * is scrolled. This is the default behaviour for all browsers except IE6 @@ -117,7 +117,7 @@ declare namespace JQueryTools { * is vertically centered. Percentage values work consistently at different screen resolutions. * @default '10%' */ - top?: 'center' | string | number; + top?: string | number; /** * before the overlay is displayed. The overlay has already been positioned at the diff --git a/jquery.tools/jquery.tools-tests.ts b/jquery.tools/jquery.tools-tests.ts index 44c1ddea64..f8a4e39f90 100644 --- a/jquery.tools/jquery.tools-tests.ts +++ b/jquery.tools/jquery.tools-tests.ts @@ -29,7 +29,7 @@ $(".my_overlay_trigger").overlay({ // one configuration property mask: { - color: '#ccc' + color: '#ccc' }, // another property top: 50