From ccb835b2b49d12a6ed8ccc39775ed28b49e2314f Mon Sep 17 00:00:00 2001 From: VorobeY1326 Date: Fri, 20 May 2016 20:25:55 +0500 Subject: [PATCH 01/39] Definitions for jquery.tooltipster 3.3.0 --- jquery.tooltipster/jquery.tooltipster.d.ts | 41 ++++++++++++++++------ 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/jquery.tooltipster/jquery.tooltipster.d.ts b/jquery.tooltipster/jquery.tooltipster.d.ts index a4df0a36e3..13260f15fe 100644 --- a/jquery.tooltipster/jquery.tooltipster.d.ts +++ b/jquery.tooltipster/jquery.tooltipster.d.ts @@ -1,6 +1,6 @@ -// Type definitions for jQuery Tooltipster 3.0.5 +// Type definitions for jQuery Tooltipster 3.3.0 // Project: https://github.com/iamceege/tooltipster -// Definitions by: Patrick Magee +// Definitions by: Patrick Magee , Dmitry Pesterev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -21,14 +21,13 @@ interface JQueryTooltipsterOptions { */ arrowColor?: any; /** - * If autoClose is set to false, the tooltip will never close unless you call the 'close' method yourself. Default: true + * If autoClose is set to false, the tooltip will never close unless you call the 'hide' method yourself. Default: true */ autoClose?: boolean; /** * If set, this will override the content of the tooltip. Default: null - * @type string, jQuery object */ - content?: any; + content?: string | JQuery; /** * If the content of the tooltip is provided as a string, it is displayed as plain text by default. If this content should actually be interpreted as HTML, set this option to true. Default: false */ @@ -38,15 +37,19 @@ interface JQueryTooltipsterOptions { */ contentCloning?: boolean; /** + * Tooltipster logs notices into the console when you're doing something you ideally shouldn't be doing. Set to false to disable logging. Default: true + */ + debug?: boolean; + /** * Delay how long it takes (in milliseconds) for the tooltip to start animating in. Default: 200 */ delay?: number; /** - * Set a fixed width for the tooltip. The tooltip will always be a consistent width - no matter your content size. Default: 0 (auto width) + * Set a minimum width for the tooltip. Default: 0 (auto width) */ - fixedWidth?: number; + minWidth?: number; /** - * Set a max width for the tooltip. If the tooltip ends up being smaller than the set max width, the tooltip's width will be set automatically. Default: 0 (no max width) + * Set a maximum width for the tooltip. Default: null (no max width) */ maxWidth?: number; /** @@ -66,10 +69,13 @@ interface JQueryTooltipsterOptions { */ functionAfter?: (origin) => void; /** - * If using the iconDesktop or iconTouch options, this sets the content for your icon. Default: '(?)' - * @type string, jQuery object + * If true, the tooltip will close if its origin is clicked. This option only applies when 'trigger' is 'hover' and 'autoClose' is false. Default: false */ - icon?: any; + hideOnClick?: boolean; + /** + * If using the iconDesktop or iconTouch options, this sets the content for your icon. Default: '(?)' + */ + icon?: string | JQuery; /** * If you provide a jQuery object to the 'icon' option, this sets if it is a clone of this object that should actually be used. Default: true */ @@ -95,6 +101,10 @@ interface JQueryTooltipsterOptions { */ interactiveTolerance?: number; /** + * Allows you to put multiple tooltips on a single element. Read further instructions down this page. Default: false + */ + multiple?: boolean; + /** * Offsets the tooltip (in pixels) farther left/right from the origin. Default: 0 */ offsetX?: number; @@ -116,6 +126,15 @@ interface JQueryTooltipsterOptions { */ positionTracker?: boolean; /** + * Called after the tooltip has been repositioned by the position tracker (if enabled). Default: A function that will close the tooltip if the trigger is 'hover' and autoClose is false. + */ + positionTrackerCallback?: (origin) => void; + /** + * Specify if a TITLE attribute should be restored on the HTML element after a call to the 'destroy' method. This attribute may be omitted, or be restored with the value that existed before Tooltipster was initialized, or be restored with the stringified value of the current content. Note: in case of multiple tooltips on a single element, only the last destroyed tooltip may trigger a restoration. Default: 'current' + * 'none', 'previous' or 'current' + */ + restoration?: string; + /** * Set the speed of the animation. Default: 350 */ speed?: number; From da38d0569abda73fd1b8b6d768781059433adbf2 Mon Sep 17 00:00:00 2001 From: VorobeY1326 Date: Fri, 20 May 2016 20:26:56 +0500 Subject: [PATCH 02/39] Updated tests to test type union in content --- jquery.tooltipster/jquery.tooltipster-tests.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jquery.tooltipster/jquery.tooltipster-tests.ts b/jquery.tooltipster/jquery.tooltipster-tests.ts index 8a8f29acae..df5ec17e51 100644 --- a/jquery.tooltipster/jquery.tooltipster-tests.ts +++ b/jquery.tooltipster/jquery.tooltipster-tests.ts @@ -2,7 +2,7 @@ // Type definition tests for jQuery Tooltipster 3.0.5 // Project: https://github.com/iamceege/tooltipster -// Definitions by: Patrick Magee +// Definitions by: Patrick Magee , Dmitry Pesterev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Tests taken from the getting started section of the Tooltipster website @@ -13,6 +13,10 @@ $(document).ready(function () { $('#my-tooltip').tooltipster({ content: $(' This text is in bold case !') }); + + $('#my-tooltip').tooltipster({ + content: 'string test' + }); }); @@ -191,4 +195,4 @@ $(document).ready(function () { }); }); -$('#my-special-tooltip').tooltipster('content', 'My new content'); \ No newline at end of file +$('#my-special-tooltip').tooltipster('content', 'My new content'); From 15e410b756322c505802ab2b006cda295d808ccb Mon Sep 17 00:00:00 2001 From: VorobeY1326 Date: Fri, 20 May 2016 20:27:34 +0500 Subject: [PATCH 03/39] Version --- jquery.tooltipster/jquery.tooltipster-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.tooltipster/jquery.tooltipster-tests.ts b/jquery.tooltipster/jquery.tooltipster-tests.ts index df5ec17e51..21a5446c12 100644 --- a/jquery.tooltipster/jquery.tooltipster-tests.ts +++ b/jquery.tooltipster/jquery.tooltipster-tests.ts @@ -1,6 +1,6 @@ /// -// Type definition tests for jQuery Tooltipster 3.0.5 +// Type definition tests for jQuery Tooltipster 3.3.0 // Project: https://github.com/iamceege/tooltipster // Definitions by: Patrick Magee , Dmitry Pesterev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 24e002e47f43ffea46b4673e1baecd154e21f996 Mon Sep 17 00:00:00 2001 From: yyc <395976266@qq.com> Date: Tue, 24 Jan 2017 06:23:05 +0800 Subject: [PATCH 04/39] fix: cannon add version --- cannon/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cannon/index.d.ts b/cannon/index.d.ts index 6551e07b32..9b62c45fc4 100644 --- a/cannon/index.d.ts +++ b/cannon/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for cannon -// Project: https://github.com/clark-stevenson/cannon.d.ts +// Project: https://github.com/clark-stevenson/cannon.d.ts v0.1.0 // Definitions by: Clark Stevenson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 523089f06262971369335d239708d641c75068d4 Mon Sep 17 00:00:00 2001 From: yyc <395976266@qq.com> Date: Tue, 24 Jan 2017 06:34:43 +0800 Subject: [PATCH 05/39] fix: fix version --- cannon/index.d.ts | 4 ++-- wonder-commonlib/index.d.ts | 2 +- wonder-frp/index.d.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cannon/index.d.ts b/cannon/index.d.ts index 9b62c45fc4..45e005d53d 100644 --- a/cannon/index.d.ts +++ b/cannon/index.d.ts @@ -1,5 +1,5 @@ -// Type definitions for cannon -// Project: https://github.com/clark-stevenson/cannon.d.ts v0.1.0 +// Type definitions for cannon 0.1 +// Project: https://github.com/clark-stevenson/cannon.d.ts // Definitions by: Clark Stevenson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/wonder-commonlib/index.d.ts b/wonder-commonlib/index.d.ts index 3421de0125..464b6ada4e 100644 --- a/wonder-commonlib/index.d.ts +++ b/wonder-commonlib/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for wonder-commonlib v0.1.0 +// Type definitions for wonder-commonlib 0.1 // Project: https://github.com/yyc-git/Wonder-CommonLib // Definitions by: YYC // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/wonder-frp/index.d.ts b/wonder-frp/index.d.ts index c5e69d2dd9..c7459d6690 100644 --- a/wonder-frp/index.d.ts +++ b/wonder-frp/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for wonder-frp v0.1.0 +// Type definitions for wonder-frp 0.1 // Project: https://github.com/yyc-git/Wonder-FRP // Definitions by: YYC // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From e4d1e2176b0888a73b389ebeddd271c4ff123a50 Mon Sep 17 00:00:00 2001 From: bkim54 Date: Tue, 31 Jan 2017 10:40:16 -0800 Subject: [PATCH 06/39] updating kafka-node typings to have ConsumerGroup --- kafka-node/index.d.ts | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/kafka-node/index.d.ts b/kafka-node/index.d.ts index b3a67c4b9a..d77b180ef3 100644 --- a/kafka-node/index.d.ts +++ b/kafka-node/index.d.ts @@ -59,6 +59,13 @@ export declare class HighLevelConsumer { close(force: boolean, cb: () => any): void; } +export declare class ConsumerGroup { + constructor(options: ConsumerGroupOptions, topics: string[]); + on(eventName: string, cb: (message: string) => any): void; + on(eventName: string, cb: (error: any) => any): void; + close(force: boolean, cb: (error: any) => any): void; +} + export declare class Offset { constructor(client: Client); on(eventName: string, cb: () => any): Offset; @@ -66,6 +73,7 @@ export declare class Offset { commit(groupId: string, payloads: Array, cb: (error: any, data: any) => any): void; fetchCommits(groupId: string, payloads: Array, cb: (error: any, data: any) => any): void; fetchLatestOffsets(topics: Array, cb: (error: any, data: any) => any): void; + fetchEarliestOffsets(topics: Array, cb: (error: any, data: any) => any): void; on(eventName: string, cb: (error: any) => any): Offset; } @@ -74,6 +82,11 @@ export declare class KeyedMessage { } // # Interfaces +export interface AckBatchOptions { + noAckBatchSize: number | null, + noAckBatchAge: number | null +} + export interface ZKOptions { sessionTimeout?: number; spinDelay?: number; @@ -99,6 +112,27 @@ export interface ConsumerOptions { encoding?: string; } +export interface CustomPartitionAssignmentProtocol { + name: string; + version: number; + userData: {}; + assign: (topicPattern: any, groupMembers: any, callback: (error: any, result: any) => void) => void; +} + +export interface ConsumerGroupOptions { + host: string; + zk?: ZKOptions; + batch?: AckBatchOptions; + ssl?: boolean; + id: string; + groupId: string; + sessionTimeout: number; + protocol: Array<"roundrobin" | "range" | CustomPartitionAssignmentProtocol>; + fromOffset: "earliest" | "latest" | "none"; + migrateHLC: false; + migrateRolling: true; +} + export interface Topic { topic: string; offset?: number; @@ -129,4 +163,3 @@ export interface FetchRequest { topic: string; offset?: number; } - From cf8502eea5b3802a6b8ef095341f2aa8e97a057c Mon Sep 17 00:00:00 2001 From: bkim54 Date: Tue, 31 Jan 2017 10:42:50 -0800 Subject: [PATCH 07/39] updated return types to void of event listeners --- kafka-node/index.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/kafka-node/index.d.ts b/kafka-node/index.d.ts index d77b180ef3..87a28f0ee7 100644 --- a/kafka-node/index.d.ts +++ b/kafka-node/index.d.ts @@ -13,24 +13,24 @@ export declare class Client { export declare class Producer { constructor(client: Client); - on(eventName: string, cb: () => any): Producer; - on(eventName: string, cb: (error: any) => any): Producer; + on(eventName: string, cb: () => any): void; + on(eventName: string, cb: (error: any) => any): void; send(payloads: Array, cb: (error: any, data: any) => any): void; createTopics(topics: Array, async: boolean, cb?: (error: any, data: any) => any): void; } export declare class HighLevelProducer { constructor(client: Client); - on(eventName: string, cb: () => any): HighLevelProducer; - on(eventName: string, cb: (error: any) => any): HighLevelProducer; + on(eventName: string, cb: () => any): void; + on(eventName: string, cb: (error: any) => any): void; send(payloads: Array, cb: (error: any, data: any) => any): void; createTopics(topics: Array, async: boolean, cb?: (error: any, data: any) => any): void; } export declare class Consumer { constructor(client: Client, fetchRequests: Array, options: ConsumerOptions); - on(eventName: string, cb: (message: string) => any): Consumer; - on(eventName: string, cb: (error: any) => any): Consumer; + on(eventName: string, cb: (message: string) => any): void; + on(eventName: string, cb: (error: any) => any): void; addTopics(topics: Array, cb: (error: any, added: boolean) => any): void; addTopics(topics: Array, cb: (error: any, added: boolean) => any, fromOffset: boolean): void; removeTopics(topics: Array, cb: (error: any, removed: boolean) => any): void; @@ -45,8 +45,8 @@ export declare class Consumer { export declare class HighLevelConsumer { constructor(client: Client, payloads: Array, options: ConsumerOptions); - on(eventName: string, cb: (message: string) => any): HighLevelConsumer; - on(eventName: string, cb: (error: any) => any): HighLevelConsumer; + on(eventName: string, cb: (message: string) => any): void; + on(eventName: string, cb: (error: any) => any): void; addTopics(topics: Array, cb: (error: any, added: boolean) => any): void; addTopics(topics: Array, cb: (error: any, added: boolean) => any, fromOffset: boolean): void; removeTopics(topics: Array, cb: (error: any, removed: boolean) => any): void; @@ -68,13 +68,13 @@ export declare class ConsumerGroup { export declare class Offset { constructor(client: Client); - on(eventName: string, cb: () => any): Offset; + on(eventName: string, cb: () => any): void; fetch(payloads: Array, cb: (error: any, data: any) => any): void; commit(groupId: string, payloads: Array, cb: (error: any, data: any) => any): void; fetchCommits(groupId: string, payloads: Array, cb: (error: any, data: any) => any): void; fetchLatestOffsets(topics: Array, cb: (error: any, data: any) => any): void; fetchEarliestOffsets(topics: Array, cb: (error: any, data: any) => any): void; - on(eventName: string, cb: (error: any) => any): Offset; + on(eventName: string, cb: (error: any) => any): void; } export declare class KeyedMessage { From 0142723d38c506d3030636c1bafdd3d466b16916 Mon Sep 17 00:00:00 2001 From: bkim54 Date: Tue, 31 Jan 2017 10:46:45 -0800 Subject: [PATCH 08/39] updated constructors --- kafka-node/index.d.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kafka-node/index.d.ts b/kafka-node/index.d.ts index 87a28f0ee7..c4b51741df 100644 --- a/kafka-node/index.d.ts +++ b/kafka-node/index.d.ts @@ -20,7 +20,7 @@ export declare class Producer { } export declare class HighLevelProducer { - constructor(client: Client); + constructor(client: Client, options: any); on(eventName: string, cb: () => any): void; on(eventName: string, cb: (error: any) => any): void; send(payloads: Array, cb: (error: any, data: any) => any): void; @@ -28,7 +28,7 @@ export declare class HighLevelProducer { } export declare class Consumer { - constructor(client: Client, fetchRequests: Array, options: ConsumerOptions); + constructor(client: Client, fetchRequests: Array, options: ConsumerOptions); on(eventName: string, cb: (message: string) => any): void; on(eventName: string, cb: (error: any) => any): void; addTopics(topics: Array, cb: (error: any, added: boolean) => any): void; @@ -157,9 +157,5 @@ export interface OffsetCommitRequest { export interface OffsetFetchRequest { topic: string; partition?: number; -} - -export interface FetchRequest { - topic: string; offset?: number; } From 7469b11708a1032296a608c7de24660e50dc0195 Mon Sep 17 00:00:00 2001 From: bkim54 Date: Tue, 31 Jan 2017 10:48:19 -0800 Subject: [PATCH 09/39] added id to consumerOptions --- kafka-node/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/kafka-node/index.d.ts b/kafka-node/index.d.ts index c4b51741df..ae9235d2e9 100644 --- a/kafka-node/index.d.ts +++ b/kafka-node/index.d.ts @@ -103,6 +103,7 @@ export interface ProduceRequest { export interface ConsumerOptions { groupId?: string; + id?: string; autoCommit?: boolean; autoCommitIntervalMs?: number; fetchMaxWaitMs?: number; From 48d061a1a5359f6bde13aa1260c96c2b2798e8ba Mon Sep 17 00:00:00 2001 From: bkim54 Date: Tue, 31 Jan 2017 12:01:32 -0800 Subject: [PATCH 10/39] making options in HLP constructor optional --- kafka-node/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kafka-node/index.d.ts b/kafka-node/index.d.ts index ae9235d2e9..8f51b3dfb0 100644 --- a/kafka-node/index.d.ts +++ b/kafka-node/index.d.ts @@ -20,7 +20,7 @@ export declare class Producer { } export declare class HighLevelProducer { - constructor(client: Client, options: any); + constructor(client: Client, options?: any); on(eventName: string, cb: () => any): void; on(eventName: string, cb: (error: any) => any): void; send(payloads: Array, cb: (error: any, data: any) => any): void; From 9dfd9d9860172c7a70c9a3c8108152f69f39a6f0 Mon Sep 17 00:00:00 2001 From: bkim54 Date: Tue, 31 Jan 2017 14:27:31 -0800 Subject: [PATCH 11/39] added tests for ConsumerGroup and offsets --- kafka-node/kafka-node-tests.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/kafka-node/kafka-node-tests.ts b/kafka-node/kafka-node-tests.ts index a5b9e9ca3e..65ca7abb81 100644 --- a/kafka-node/kafka-node-tests.ts +++ b/kafka-node/kafka-node-tests.ts @@ -138,6 +138,24 @@ hlConsumer.resumeTopics([ hlConsumer.close(true, function () {}); +var ackBatchOptions = {'noAckBatchSize': 1024, 'noAckBatchAge': 10}; +var cgOptions: kafka.ConsumerGroupOptions = { + host: 'localhost:2181/', + batch: ackBatchOptions, + groupId: 'groupID', + id: 'consumerID', + sessionTimeout: 15000, + protocol: ["roundrobin"], + fromOffset: "latest", + migrateHLC: false, + migrateRolling: true +}; + +var consumerGroup = new kafka.ConsumerGroup( cgOptions, ['topic1']); +consumerGroup.on('error', (err) => {}); +consumerGroup.on('message', (msg) => {}); +consumerGroup.close(true, () => {}); + var offset = new kafka.Offset(basicClient); offset.on('ready', function(){}); @@ -154,3 +172,6 @@ offset.commit('groupId', [ offset.fetchCommits('groupId', [ { topic: 't', partition: 0 } ], function (err, data) {}); + +offset.fetchLatestOffsets(['t'], (err, offsets) => {}) +offset.fetchEarliestOffsets(['t'], (err, offsets) => {}) From c4ed2ff42e43da783d3e248cc04a35800e2a33e0 Mon Sep 17 00:00:00 2001 From: bkim54 Date: Tue, 31 Jan 2017 14:33:02 -0800 Subject: [PATCH 12/39] updating comment, type definitions for kafka-node 1.3.3 --- kafka-node/index.d.ts | 2 +- kafka-node/kafka-node-tests.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/kafka-node/index.d.ts b/kafka-node/index.d.ts index 8f51b3dfb0..018b1a6f9e 100644 --- a/kafka-node/index.d.ts +++ b/kafka-node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for kafka-node 0.2.22 +// Type definitions for kafka-node 1.3.3 // Project: https://github.com/SOHU-Co/kafka-node/ // Definitions by: Daniel Imrie-Situnayake // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/kafka-node/kafka-node-tests.ts b/kafka-node/kafka-node-tests.ts index 65ca7abb81..557c40de8c 100644 --- a/kafka-node/kafka-node-tests.ts +++ b/kafka-node/kafka-node-tests.ts @@ -1,4 +1,3 @@ - import kafka = require('kafka-node'); var basicClient = new kafka.Client('localhost:2181/', 'sendMessage'); From df23346707493018518e7c8cd04d7e6e7dce1f05 Mon Sep 17 00:00:00 2001 From: sreimer15 Date: Tue, 31 Jan 2017 23:05:21 -0800 Subject: [PATCH 13/39] Fixed Type of webNavigation.webnavigationEventFilter --- chrome/index.d.ts | 12 ++++++------ chrome/test/index.ts | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/chrome/index.d.ts b/chrome/index.d.ts index 2822dd421e..cf6c93ec8f 100644 --- a/chrome/index.d.ts +++ b/chrome/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Chrome extension development // Project: http://developer.chrome.com/extensions/ -// Definitions by: Matthew Kimber , otiai10 , couven92 , RReverser +// Definitions by: Matthew Kimber , otiai10 , couven92 , RReverser , sreimer15 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -7062,13 +7062,12 @@ declare namespace chrome.webNavigation { transitionQualifiers: string[]; } - interface WebNavigationEventFilter { - /** Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event. */ - url: chrome.events.UrlFilter[]; + interface WebNavigationRequestFilter extends chrome.webRequest.RequestFilter { + /** fulfills the webRequest.RequestFilter interface even though it is under web navigation **/ } interface WebNavigationEvent extends chrome.events.Event<(details: T) => void> { - addListener(callback: (details: T) => void, filters?: WebNavigationEventFilter): void; + addListener(callback: (details: T) => void, filters?: WebNavigationRequestFilter): void; } interface WebNavigationFramedEvent extends WebNavigationEvent {} @@ -7178,7 +7177,8 @@ declare namespace chrome.webRequest { */ types?: string[]; /** A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out. */ - urls: string[]; + urls: string[] | RegExp[] | ""; + /** Optional. */ windowId?: number; } diff --git a/chrome/test/index.ts b/chrome/test/index.ts index 7788397a4c..3074b8a0c3 100644 --- a/chrome/test/index.ts +++ b/chrome/test/index.ts @@ -171,6 +171,29 @@ function catBlock () { ["blocking"]); } +// webNavigation.onBeforeNavigate.addListener example similar api to onBeforeRequest but without extra spec +function beforeRedditNavigation() { + chrome.webNavigation.onBeforeNavigate.addListener(function (requestDetails) { + console.log("URL we want to redirect to: " + requestDetails.url); + // NOTE: This will search for top level frames with the value -1. + if (requestDetails.parentFrameId != -1) { + return; + } + + let url = new URL(requestDetails.url); + let splitUrl = url.hostname.split('.'); + //` Note: Does not cover the XX.co.uk type edge case + let host = (splitUrl[(splitUrl.length -1) - 1]); + + if (host === null) { + return; + } else if (host === "reddit") { + alert("Were you trying to go on reddit, during working hours? :(") + return; + } + },{urls: ["http://*/*"], types: ["image"]}); +} + // contrived settings example function proxySettings() { chrome.proxy.settings.get({ incognito: true }, (details) => { From d0128ad5161c0975513ca4ff745f3ba9e8f2b65d Mon Sep 17 00:00:00 2001 From: Artur Eshenbrener Date: Fri, 3 Feb 2017 18:13:17 +0300 Subject: [PATCH 14/39] react: make defaultProps Optional Actually, defaultProps is `Optional

` --- react/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react/index.d.ts b/react/index.d.ts index f25e5c0afd..e929e5ed7a 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -207,7 +207,7 @@ declare namespace React { (props: P & { children?: ReactNode }, context?: any): ReactElement | null; propTypes?: ValidationMap

; contextTypes?: ValidationMap; - defaultProps?: P; + defaultProps?: Partial

; displayName?: string; } @@ -216,7 +216,7 @@ declare namespace React { propTypes?: ValidationMap

; contextTypes?: ValidationMap; childContextTypes?: ValidationMap; - defaultProps?: P; + defaultProps?: Partial

; displayName?: string; } From 1b19290993e68920c4123aea25980ae335ca3f41 Mon Sep 17 00:00:00 2001 From: yyc <395976266@qq.com> Date: Sat, 4 Feb 2017 17:54:55 +0800 Subject: [PATCH 15/39] fix: fix wonder-commonlib,wonder-frp->index.d.ts->global type --- wonder-commonlib/index.d.ts | 5 +++-- wonder-frp/index.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wonder-commonlib/index.d.ts b/wonder-commonlib/index.d.ts index 464b6ada4e..9c6881920d 100644 --- a/wonder-commonlib/index.d.ts +++ b/wonder-commonlib/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for wonder-commonlib 0.1 +// Type definitions for wonder-commonlib 0.1.1 // Project: https://github.com/yyc-git/Wonder-CommonLib // Definitions by: YYC // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -21,7 +21,8 @@ declare module wdCb { } } -declare var global: any, window: Window; +declare var global:NodeJS.Global,window:Window; + declare module wdCb { var root: any; } diff --git a/wonder-frp/index.d.ts b/wonder-frp/index.d.ts index c7459d6690..bb9b146112 100644 --- a/wonder-frp/index.d.ts +++ b/wonder-frp/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for wonder-frp 0.1 +// Type definitions for wonder-frp 0.1.1 // Project: https://github.com/yyc-git/Wonder-FRP // Definitions by: YYC // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -103,7 +103,7 @@ declare module wdFrp { } } -declare var global: any, window: Window; +declare var global:NodeJS.Global,window:Window; declare module wdFrp { var root: any; } From 1be45766a6d6f0c2de3bcf0bd9e76ed93b806980 Mon Sep 17 00:00:00 2001 From: yyc <395976266@qq.com> Date: Sat, 4 Feb 2017 18:53:07 +0800 Subject: [PATCH 16/39] fix: reference to node --- wonder-commonlib/index.d.ts | 3 +++ wonder-frp/index.d.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/wonder-commonlib/index.d.ts b/wonder-commonlib/index.d.ts index 9c6881920d..1cad038d52 100644 --- a/wonder-commonlib/index.d.ts +++ b/wonder-commonlib/index.d.ts @@ -3,6 +3,9 @@ // Definitions by: YYC // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + declare module wdCb { class JudgeUtils { static isArray(arr: any): boolean; diff --git a/wonder-frp/index.d.ts b/wonder-frp/index.d.ts index bb9b146112..00910bc80d 100644 --- a/wonder-frp/index.d.ts +++ b/wonder-frp/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +/// declare module wdFrp { class JudgeUtils extends wdCb.JudgeUtils { From 01536df168ebf2629cd25a7606660db9b558c260 Mon Sep 17 00:00:00 2001 From: Hinell Date: Mon, 6 Feb 2017 00:02:44 +0300 Subject: [PATCH 17/39] [mongodb] collection.findOne is coming back Closes #14444 Quick fix according to docs and mongodb issue tracker: http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#findOne https://jira.mongodb.org/browse/NODE-890 --- mongodb/index.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/mongodb/index.d.ts b/mongodb/index.d.ts index bab845a01d..3603b8877c 100644 --- a/mongodb/index.d.ts +++ b/mongodb/index.d.ts @@ -620,11 +620,8 @@ export interface Collection { /** @deprecated */ find(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOne - /** @deprecated use find().limit(1).next(function(err, doc){}) */ findOne(filter: Object, callback: MongoCallback): void; - /** @deprecated use find().limit(1).next(function(err, doc){}) */ findOne(filter: Object, options?: FindOneOptions): Promise; - /** @deprecated use find().limit(1).next(function(err, doc){}) */ findOne(filter: Object, options: FindOneOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndDelete findOneAndDelete(filter: Object, callback: MongoCallback): void; From 7ca457781255646ae9375ffdc01e025185ea7ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondrej=20Slint=C3=A1k?= Date: Mon, 6 Feb 2017 23:39:25 +0100 Subject: [PATCH 18/39] Add extended AuthenticateOptions interface to passport-facebook This is useful since passing options with authType to passport's authenticate method fails since passport itself doesn't know about it. You can use this extended instead to retype it to the one that this method supports instead. --- passport-facebook/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/passport-facebook/index.d.ts b/passport-facebook/index.d.ts index bcc742dae5..7b6cedeac5 100644 --- a/passport-facebook/index.d.ts +++ b/passport-facebook/index.d.ts @@ -19,6 +19,10 @@ interface Profile extends passport.Profile { _json: any; } +export interface AuthenticateOptions extends passport.AuthenticateOptions { + authType?: string; +} + interface IStrategyOption { clientID: string; clientSecret: string; From 84d5133f5d09312f93922b5e5042fec199767189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Tue, 7 Feb 2017 00:23:17 +0100 Subject: [PATCH 19/39] range-parser --- range-parser/index.d.ts | 26 ++++++++++++++++++++++++++ range-parser/range-parser-tests.ts | 9 +++++++++ range-parser/tsconfig.json | 20 ++++++++++++++++++++ range-parser/tslint.json | 1 + 4 files changed, 56 insertions(+) create mode 100644 range-parser/index.d.ts create mode 100644 range-parser/range-parser-tests.ts create mode 100644 range-parser/tsconfig.json create mode 100644 range-parser/tslint.json diff --git a/range-parser/index.d.ts b/range-parser/index.d.ts new file mode 100644 index 0000000000..ceb5e17ff6 --- /dev/null +++ b/range-parser/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for range-parser 1.2 +// Project: https://github.com/jshttp/range-parser +// Definitions by: Tomek Łaziuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare const RangeParser: RangeParser.RangeParser; + +declare namespace RangeParser { + export interface Ranges extends Array { + type: string; + } + export interface Range { + start: number; + end: number; + } + export interface Options { + combine?: boolean; + } + export const enum Result { + invaild = -2, + unsatisifiable = -1, + } + export type RangeParser = (size: number, str: string, options?: Options) => Result | Ranges; +} + +export = RangeParser; diff --git a/range-parser/range-parser-tests.ts b/range-parser/range-parser-tests.ts new file mode 100644 index 0000000000..d3d70563bb --- /dev/null +++ b/range-parser/range-parser-tests.ts @@ -0,0 +1,9 @@ +import * as RangeParser from 'range-parser'; + +console.assert(RangeParser(200, `malformed`) === RangeParser.Result.invaild); +console.assert(RangeParser(200, `bytes=500-20`) === RangeParser.Result.unsatisifiable); + +const range = RangeParser(1000, `bytes=0-499`); + +console.assert(range.type === `bytes`); +console.assert(range.length === 1); diff --git a/range-parser/tsconfig.json b/range-parser/tsconfig.json new file mode 100644 index 0000000000..7c7f4ffd03 --- /dev/null +++ b/range-parser/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "range-parser-tests.ts" + ] +} diff --git a/range-parser/tslint.json b/range-parser/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/range-parser/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 0deee581f54a47beeb1ebc35f0755145e7a358a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Tue, 7 Feb 2017 09:52:44 +0100 Subject: [PATCH 20/39] cannot redeclare block-scoped variable fix --- range-parser/index.d.ts | 3 +-- range-parser/range-parser-tests.ts | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/range-parser/index.d.ts b/range-parser/index.d.ts index ceb5e17ff6..e90f448e11 100644 --- a/range-parser/index.d.ts +++ b/range-parser/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Tomek Łaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare const RangeParser: RangeParser.RangeParser; +declare function RangeParser(size: number, str: string, options?: RangeParser.Options): RangeParser.Result | RangeParser.Ranges; declare namespace RangeParser { export interface Ranges extends Array { @@ -20,7 +20,6 @@ declare namespace RangeParser { invaild = -2, unsatisifiable = -1, } - export type RangeParser = (size: number, str: string, options?: Options) => Result | Ranges; } export = RangeParser; diff --git a/range-parser/range-parser-tests.ts b/range-parser/range-parser-tests.ts index d3d70563bb..77dab456c1 100644 --- a/range-parser/range-parser-tests.ts +++ b/range-parser/range-parser-tests.ts @@ -5,5 +5,7 @@ console.assert(RangeParser(200, `bytes=500-20`) === RangeParser.Result.unsatisif const range = RangeParser(1000, `bytes=0-499`); -console.assert(range.type === `bytes`); -console.assert(range.length === 1); +if (typeof range !== 'number') { + console.assert(range.type === `bytes`); + console.assert(range.length === 1); +} From 4a8052290cc86a13f677cc25a5a9b82a64318b47 Mon Sep 17 00:00:00 2001 From: Yaroslav Serhieiev Date: Tue, 7 Feb 2017 13:08:46 +0200 Subject: [PATCH 21/39] jasmine: added keyof validation to spyOn --- jasmine-es6-promise-matchers/index.d.ts | 1 + jasmine-expect/index.d.ts | 1 + jasmine-jquery/index.d.ts | 1 + jasmine-matchers/index.d.ts | 1 + jasmine-node/index.d.ts | 1 + jasmine-promise-matchers/index.d.ts | 1 + jasmine/index.d.ts | 3 ++- jasminewd2/index.d.ts | 1 + karma-jasmine/index.d.ts | 1 + 9 files changed, 10 insertions(+), 1 deletion(-) diff --git a/jasmine-es6-promise-matchers/index.d.ts b/jasmine-es6-promise-matchers/index.d.ts index 493a6a5312..89e3146c2c 100644 --- a/jasmine-es6-promise-matchers/index.d.ts +++ b/jasmine-es6-promise-matchers/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/bvaughn/jasmine-es6-promise-matchers // Definitions by: Stephen Lautier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/jasmine-expect/index.d.ts b/jasmine-expect/index.d.ts index c8ffd8dced..c2ee7e0ee5 100644 --- a/jasmine-expect/index.d.ts +++ b/jasmine-expect/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/JamieMason/Jasmine-Matchers // Definitions by: UserPixel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/jasmine-jquery/index.d.ts b/jasmine-jquery/index.d.ts index cbd713fd37..fb91e0c37b 100644 --- a/jasmine-jquery/index.d.ts +++ b/jasmine-jquery/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/velesin/jasmine-jquery // Definitions by: Gregor Stamac // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// /// diff --git a/jasmine-matchers/index.d.ts b/jasmine-matchers/index.d.ts index 23990c8364..ac44d25c1c 100644 --- a/jasmine-matchers/index.d.ts +++ b/jasmine-matchers/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/uxebu/jasmine-matchers // Definitions by: Bart van der Schoor // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /* Typings 2013 Bart van der Schoor diff --git a/jasmine-node/index.d.ts b/jasmine-node/index.d.ts index 59a3b11d8a..5c8022d706 100644 --- a/jasmine-node/index.d.ts +++ b/jasmine-node/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/mhevery/jasmine-node // Definitions by: Sven Reglitzki // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/jasmine-promise-matchers/index.d.ts b/jasmine-promise-matchers/index.d.ts index 1693c9fdca..c511019b62 100644 --- a/jasmine-promise-matchers/index.d.ts +++ b/jasmine-promise-matchers/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/bvaughn/jasmine-promise-matchers // Definitions by: Matthew Hill // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/jasmine/index.d.ts b/jasmine/index.d.ts index 7bf232acba..e18361dec4 100644 --- a/jasmine/index.d.ts +++ b/jasmine/index.d.ts @@ -2,6 +2,7 @@ // Project: http://jasmine.github.io/ // Definitions by: Boris Yankov , Theodore Brown , David Pärsson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 // For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts @@ -35,7 +36,7 @@ interface DoneFn extends Function { fail: (message?: Error|string) => void; } -declare function spyOn(object: any, method: string): jasmine.Spy; +declare function spyOn(object: T, method: keyof T): jasmine.Spy; declare function runs(asyncMethod: Function): void; declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; diff --git a/jasminewd2/index.d.ts b/jasminewd2/index.d.ts index cff5236b50..9d8ecde76e 100644 --- a/jasminewd2/index.d.ts +++ b/jasminewd2/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/angular/jasminewd // Definitions by: Sammy Jelin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/karma-jasmine/index.d.ts b/karma-jasmine/index.d.ts index a5f0a22f5b..46b7978251 100644 --- a/karma-jasmine/index.d.ts +++ b/karma-jasmine/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/karma-runner/karma-jasmine // Definitions by: Michel Salib // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// From 9db4204e1b6285529308bf075ac3e0459f0a3355 Mon Sep 17 00:00:00 2001 From: rinzeb Date: Tue, 7 Feb 2017 13:21:31 +0100 Subject: [PATCH 22/39] Update xlsx typings Add optional 'options' parameter to function sheet_to_csv. (https://github.com/SheetJS/js-xlsx/blob/53f7f6d9446ccd680c9b13992d6dcdccde49a8f6/bits/90_utils.js#L132) --- xlsx/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlsx/index.d.ts b/xlsx/index.d.ts index 3c78abb140..4e4eb060f7 100644 --- a/xlsx/index.d.ts +++ b/xlsx/index.d.ts @@ -143,7 +143,7 @@ export interface IUtils { range?: any; header?: "A"|number|string[]; }):T[]; - sheet_to_csv(worksheet: IWorkSheet):any; + sheet_to_csv(worksheet: IWorkSheet, options?: { FS: string, RS: string }): string; sheet_to_formulae(worksheet: IWorkSheet):any; encode_cell(cell: ICell): any; encode_range(s: ICell, e: ICell): any; From 1c2b6defd2d31dfa01a53167a22235b0ca65d508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Tue, 7 Feb 2017 14:51:18 +0100 Subject: [PATCH 23/39] xdg-basedir --- xdg-basedir/index.d.ts | 11 +++++++++++ xdg-basedir/tsconfig.json | 20 ++++++++++++++++++++ xdg-basedir/tslint.json | 1 + xdg-basedir/xdg-basedir-tests.ts | 3 +++ 4 files changed, 35 insertions(+) create mode 100644 xdg-basedir/index.d.ts create mode 100644 xdg-basedir/tsconfig.json create mode 100644 xdg-basedir/tslint.json create mode 100644 xdg-basedir/xdg-basedir-tests.ts diff --git a/xdg-basedir/index.d.ts b/xdg-basedir/index.d.ts new file mode 100644 index 0000000000..d18bc389f9 --- /dev/null +++ b/xdg-basedir/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for xdg-basedir 2.0 +// Project: https://github.com/sindresorhus/xdg-basedir +// Definitions by: Tomek Łaziuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export const data: string | null; +export const config: string | null; +export const cache: string | null; +export const runtime: string | null; +export const dataDirs: string[]; +export const configDirs: string[]; diff --git a/xdg-basedir/tsconfig.json b/xdg-basedir/tsconfig.json new file mode 100644 index 0000000000..44428e6cc7 --- /dev/null +++ b/xdg-basedir/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "xdg-basedir-tests.ts" + ] +} diff --git a/xdg-basedir/tslint.json b/xdg-basedir/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/xdg-basedir/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/xdg-basedir/xdg-basedir-tests.ts b/xdg-basedir/xdg-basedir-tests.ts new file mode 100644 index 0000000000..a6b7073c18 --- /dev/null +++ b/xdg-basedir/xdg-basedir-tests.ts @@ -0,0 +1,3 @@ +import * as xdg from 'xdg-basedir'; + +console.log(JSON.stringify(xdg, undefined, 2)); From 0055a7b7589ee0fe2d1770b7ad0150c7e009da96 Mon Sep 17 00:00:00 2001 From: VorobeY1326 Date: Tue, 7 Feb 2017 19:24:55 +0500 Subject: [PATCH 24/39] Definition for dropkickjs library --- dropkickjs/dropkickjs-tests.ts | 91 ++++++++++++++++++++++++++++++++++ dropkickjs/index.d.ts | 52 +++++++++++++++++++ dropkickjs/tsconfig.json | 20 ++++++++ dropkickjs/tslint.json | 1 + 4 files changed, 164 insertions(+) create mode 100644 dropkickjs/dropkickjs-tests.ts create mode 100644 dropkickjs/index.d.ts create mode 100644 dropkickjs/tsconfig.json create mode 100644 dropkickjs/tslint.json diff --git a/dropkickjs/dropkickjs-tests.ts b/dropkickjs/dropkickjs-tests.ts new file mode 100644 index 0000000000..af46b43c02 --- /dev/null +++ b/dropkickjs/dropkickjs-tests.ts @@ -0,0 +1,91 @@ +/// + +//constructor +var constructorNoOptions = new Dropkick('#my-select'); +var constructorNoOptions2 = new Dropkick(new HTMLSelectElement()); +var constructorOptions = new Dropkick('#my-select', {}); +var constructorOptions2 = new Dropkick(new HTMLSelectElement(), {}); + +//options +var options : DropkickOptions = { + disabled: true, + form: new HTMLFormElement(), + length: 1, + mobile: true, + multiple: true, + options: ['test'], + selectedIndex: 0, + selectedOptions: ['test'], + value: 'test', + change() { }, + close() { }, + open() { }, + initialize: () => { } +} +var withFullOptions = new Dropkick('#test', options); + +var dk = new Dropkick('#test'); + +//fields (same as options) +var o1 = dk.disabled; +var o2 = dk.form; +var o3 = dk.length; +var o4 = dk.mobile; +var o5 = dk.multiple; +var o6 = dk.options; +var o7 = dk.selectedIndex; +var o8 = dk.selectedOptions; +var o9 = dk.value; + +//methods +dk.add('new'); +dk.add(new HTMLSelectElement()); +dk.add('new', 'old'); +dk.add('new', 1); + +dk.disable(); +dk.disable(false); +dk.disable(4, true); +dk.disable(4); + +dk.dispose(); + +dk.focus(); + +dk.hide(4); +dk.hide(4, false); + +var node = dk.item(4); + +dk.open(); + +dk.refresh(); + +dk.remove(4); + +dk.reset(); +dk.reset(true); + +var words = dk.search("qwer", "fuzzy"); + +var node2 = dk.select(4); +var node3 = dk.select("AL"); +var node4 = dk.select(4, true); + +var node5 = dk.selectOne(4); +var node6 = dk.selectOne(4, true); + +//real life example +var fieldValue = ''; +var selectOptions : DropkickOptions = { + open(this: Dropkick) { + const optionsList = (this).data.elem.lastChild; //undocumented but useful data field + if (optionsList.scrollWidth > optionsList.offsetWidth) { + optionsList.style.width = optionsList.scrollWidth + 25 + 'px'; + } + }, + change: () => { + fieldValue = select.value; + } +}; +var select = new Dropkick('#select', options); \ No newline at end of file diff --git a/dropkickjs/index.d.ts b/dropkickjs/index.d.ts new file mode 100644 index 0000000000..80818ff789 --- /dev/null +++ b/dropkickjs/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for dropkickjs v2.1.9 +// Project: http://dropkickjs.com/ +// Definitions by Dmitry Pesterev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface DropkickOptions { + disabled?: boolean; + form?: Node; + length?: number; + mobile?: boolean; + multiple?: boolean; + options?: Array; + selectedIndex?: number; + selectedOptions?: Array; + value?: string; + + change?: () => void; + close?: () => void; + initialize?: () => void; + open?: () => void; +} + +declare class Dropkick { + constructor(id: string, options?: DropkickOptions); + constructor(element: HTMLElement, options?: DropkickOptions); + + add(value: string | Node, before?: number | string): void; + close(): void; + disable(disabled?: boolean): void; + disable(index: number, disabled?: boolean): void; + dispose(): void; + focus(): void; + hide(index: number, hidden?: boolean): void; + item(index: number): Node; + open(): void; + refresh(): void; + remove(index: number): void; + reset(clear?: boolean): void; + search(string: string, mode?: string): Array; + select(element: number|string, selectDisabled?: boolean): Node; + selectOne(element: number, selectDisabled?: boolean): Node; + + disabled: boolean; + form: Node; + length: number; + mobile: boolean; + multiple: boolean; + options: Array; + selectedIndex: number; + selectedOptions: Array; + value: string; +} \ No newline at end of file diff --git a/dropkickjs/tsconfig.json b/dropkickjs/tsconfig.json new file mode 100644 index 0000000000..e0699ecf5c --- /dev/null +++ b/dropkickjs/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dropkickjs-tests.ts" + ] +} \ No newline at end of file diff --git a/dropkickjs/tslint.json b/dropkickjs/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/dropkickjs/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From e6d4014e92ddca6cdf9c50a30de4cb754a743d79 Mon Sep 17 00:00:00 2001 From: VorobeY1326 Date: Tue, 7 Feb 2017 19:40:38 +0500 Subject: [PATCH 25/39] Header fix --- dropkickjs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dropkickjs/index.d.ts b/dropkickjs/index.d.ts index 80818ff789..1884749629 100644 --- a/dropkickjs/index.d.ts +++ b/dropkickjs/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for dropkickjs v2.1.9 // Project: http://dropkickjs.com/ -// Definitions by Dmitry Pesterev +// Definitions by: Dmitry Pesterev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface DropkickOptions { From 59dc6f0c84c28bcebe2b5016eb58f940e7c73f88 Mon Sep 17 00:00:00 2001 From: VorobeY1326 Date: Tue, 7 Feb 2017 19:46:40 +0500 Subject: [PATCH 26/39] Fixed tslint warnings --- dropkickjs/index.d.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dropkickjs/index.d.ts b/dropkickjs/index.d.ts index 1884749629..8af96c1a57 100644 --- a/dropkickjs/index.d.ts +++ b/dropkickjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for dropkickjs v2.1.9 +// Type definitions for dropkickjs v2.1 // Project: http://dropkickjs.com/ // Definitions by: Dmitry Pesterev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,9 +9,9 @@ interface DropkickOptions { length?: number; mobile?: boolean; multiple?: boolean; - options?: Array; + options?: string[]; selectedIndex?: number; - selectedOptions?: Array; + selectedOptions?: string[]; value?: string; change?: () => void; @@ -21,8 +21,7 @@ interface DropkickOptions { } declare class Dropkick { - constructor(id: string, options?: DropkickOptions); - constructor(element: HTMLElement, options?: DropkickOptions); + constructor(id: string|HTMLElement, options?: DropkickOptions); add(value: string | Node, before?: number | string): void; close(): void; @@ -36,7 +35,7 @@ declare class Dropkick { refresh(): void; remove(index: number): void; reset(clear?: boolean): void; - search(string: string, mode?: string): Array; + search(string: string, mode?: string): string[]; select(element: number|string, selectDisabled?: boolean): Node; selectOne(element: number, selectDisabled?: boolean): Node; @@ -45,8 +44,8 @@ declare class Dropkick { length: number; mobile: boolean; multiple: boolean; - options: Array; + options: string[]; selectedIndex: number; - selectedOptions: Array; + selectedOptions: string[]; value: string; } \ No newline at end of file From 723a4cdf203a7326e70e921b704ee57c57bf83ac Mon Sep 17 00:00:00 2001 From: VorobeY1326 Date: Tue, 7 Feb 2017 19:49:58 +0500 Subject: [PATCH 27/39] And now tslint will pass --- dropkickjs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dropkickjs/index.d.ts b/dropkickjs/index.d.ts index 8af96c1a57..1e0a4f4acf 100644 --- a/dropkickjs/index.d.ts +++ b/dropkickjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for dropkickjs v2.1 +// Type definitions for dropkickjs 2.1 // Project: http://dropkickjs.com/ // Definitions by: Dmitry Pesterev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From ac9820de677bd91276e414022a87a6ad1963e39c Mon Sep 17 00:00:00 2001 From: "Regis Gaughan, III" Date: Tue, 7 Feb 2017 16:54:31 -0500 Subject: [PATCH 28/39] Add `multiple` boolean to IDialogOptions --- angular-material/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/angular-material/index.d.ts b/angular-material/index.d.ts index 9118cd92c2..0e27fe3b60 100644 --- a/angular-material/index.d.ts +++ b/angular-material/index.d.ts @@ -106,6 +106,7 @@ declare module 'angular' { onComplete?: Function; onRemoving?: Function; skipHide?: boolean; + multiple?: boolean; fullscreen?: boolean; // default: false } From b5024898146da195593be678ad95819c2e6aef4d Mon Sep 17 00:00:00 2001 From: Anil Anar Date: Wed, 8 Feb 2017 11:22:19 +0100 Subject: [PATCH 29/39] babel-traverse: add "module" as one of possible values for Binding.kind --- babel-traverse/babel-traverse-tests.ts | 13 +++++++++++++ babel-traverse/index.d.ts | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/babel-traverse/babel-traverse-tests.ts b/babel-traverse/babel-traverse-tests.ts index c02efe44ad..3779852c5f 100644 --- a/babel-traverse/babel-traverse-tests.ts +++ b/babel-traverse/babel-traverse-tests.ts @@ -109,3 +109,16 @@ const v1: Visitor = { path.scope.rename("n"); } }; + +// Binding.kind +const BindingKindTest: Visitor = { + Identifier(path) { + const kind = path.scope.getBinding("str").kind; + kind === 'module'; + kind === 'const'; + kind === 'let'; + kind === 'var'; + // The following should fail when uncommented + // kind === 'anythingElse'; + }, +}; diff --git a/babel-traverse/index.d.ts b/babel-traverse/index.d.ts index 67dd119e91..e307cd664d 100644 --- a/babel-traverse/index.d.ts +++ b/babel-traverse/index.d.ts @@ -126,7 +126,7 @@ export class Binding { identifier: t.Identifier; scope: Scope; path: NodePath; - kind: 'var' | 'let' | 'const'; + kind: 'var' | 'let' | 'const' | 'module'; referenced: boolean; references: number; referencePaths: NodePath[]; From 220b2c7aded9659f0b5ce4a3c2ef074effae7031 Mon Sep 17 00:00:00 2001 From: anwalkers Date: Wed, 8 Feb 2017 18:31:05 -0800 Subject: [PATCH 30/39] Fix leaflet to compile with latest TypeScript v2.1.6. --- leaflet/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/leaflet/index.d.ts b/leaflet/index.d.ts index bf6f9103a1..f6f256e388 100644 --- a/leaflet/index.d.ts +++ b/leaflet/index.d.ts @@ -689,7 +689,7 @@ declare namespace L { /** * Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection, GeoJSONFeatureCollection or Multipoint). */ - toGeoJSON(): GeoJSONFeatureCollection | GeoJSONFeature; + toGeoJSON(): GeoJSONFeatureCollection | GeoJSONFeature | GeoJSONGeometryCollection; /** * Adds the given layer to the group. @@ -743,7 +743,7 @@ declare namespace L { */ getLayerId(layer: Layer): number; - feature: GeoJSONFeatureCollection | GeoJSONFeature; + feature: GeoJSONFeatureCollection | GeoJSONFeature | GeoJSONGeometryCollection; } /** From 3189feae7c21fedb44b2a01cb6755dc478ed49f8 Mon Sep 17 00:00:00 2001 From: Mikael Peigney Date: Thu, 9 Feb 2017 23:59:21 +0100 Subject: [PATCH 31/39] [Dockerode] Fix Dockerode.getNode return type --- dockerode/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerode/index.d.ts b/dockerode/index.d.ts index 2c5caaf9cc..c317d5d32e 100644 --- a/dockerode/index.d.ts +++ b/dockerode/index.d.ts @@ -578,7 +578,7 @@ declare class Dockerode { getTask(id: string): Dockerode.Task; - getNode(id: string): Node; + getNode(id: string): Dockerode.Node; getNetwork(id: string): Dockerode.Network; @@ -640,4 +640,4 @@ declare class Dockerode { modem: any; } -export = Dockerode; \ No newline at end of file +export = Dockerode; From e875fc829ac9daa6ce81bf04dbdbb1607ee8fe53 Mon Sep 17 00:00:00 2001 From: Artur Eshenbrener Date: Fri, 10 Feb 2017 11:02:43 +0300 Subject: [PATCH 32/39] react: make defaultProps Partial

Added a test, which ensures that defaultProps are Partial --- react/test/index.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/react/test/index.ts b/react/test/index.ts index 38ad574aa4..64d5d9d918 100644 --- a/react/test/index.ts +++ b/react/test/index.ts @@ -689,3 +689,18 @@ type InputChangeEvent = React.ChangeEvent; type InputFormEvent = React.FormEvent; const changeEvent:InputChangeEvent = undefined as any; const formEvent:InputFormEvent = changeEvent; + +// defaultProps should be optional of props +{ + interface ComponentProps { + prop1: string; + prop2: string; + prop3?: string; + } + class ComponentWithDefaultProps extends React.Component { + static defaultProps = { + prop3: "default value", + }; + } + const VariableWithAClass: React.ComponentClass = ComponentWithDefaultProps; +} From 10e53688547ad0c771dc005b2cb008490726b87f Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 10 Feb 2017 10:08:14 +0000 Subject: [PATCH 33/39] react-router: Fix RedirectFunction not being exported --- react-router/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/react-router/index.d.ts b/react-router/index.d.ts index da1f23c87e..84b9f2c152 100644 --- a/react-router/index.d.ts +++ b/react-router/index.d.ts @@ -33,6 +33,7 @@ export { RoutePattern, RouterProps, RouterState, + RedirectFunction, StringifyQuery, Query } from "react-router/lib/Router"; From 1c72cb38128093e86f3557a7fa573dea31514a76 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 10 Feb 2017 10:14:12 +0000 Subject: [PATCH 34/39] Update react-router-tests.tsx --- react-router/react-router-tests.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/react-router/react-router-tests.tsx b/react-router/react-router-tests.tsx index 894dfec8c7..79e9012d53 100644 --- a/react-router/react-router-tests.tsx +++ b/react-router/react-router-tests.tsx @@ -17,7 +17,8 @@ import { InjectedRouter, Link, RouterContext, - LinkProps + LinkProps, + RedirectFunction } from "react-router"; const NavLink = (props: LinkProps) => ( From 0e0bef8276d66cd32d416ff7698c2ae7afb361b5 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 10 Feb 2017 12:25:50 +0000 Subject: [PATCH 35/39] react-router added routes to RouteComponentProps --- react-router/lib/Router.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/react-router/lib/Router.d.ts b/react-router/lib/Router.d.ts index 95b2e38267..aba09a19a3 100644 --- a/react-router/lib/Router.d.ts +++ b/react-router/lib/Router.d.ts @@ -90,6 +90,7 @@ export interface RouteComponentProps { params: P & R; route: PlainRoute; router: InjectedRouter; + routes: PlainRoute[]; routeParams: R; } From b274efe1be35f09854bf64f4d456f4fd87a94d56 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 10 Feb 2017 12:31:25 +0000 Subject: [PATCH 36/39] Update react-router-tests.tsx --- react-router/react-router-tests.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react-router/react-router-tests.tsx b/react-router/react-router-tests.tsx index 79e9012d53..de3450e803 100644 --- a/react-router/react-router-tests.tsx +++ b/react-router/react-router-tests.tsx @@ -93,10 +93,12 @@ class NotFound extends React.Component<{}, {}> { } +interface UsersProps extends RouteComponentProps<{}, {}> { } -class Users extends React.Component<{}, {}> { +class Users extends React.Component { render() { + const { location, params, routes, routes, router, routeParams } = this.props; return

This is a user list
From 844f14e366b9c2dab783537c17b25d680742e532 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 10 Feb 2017 12:45:15 +0000 Subject: [PATCH 37/39] Update react-router-tests.tsx --- react-router/react-router-tests.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/react-router/react-router-tests.tsx b/react-router/react-router-tests.tsx index de3450e803..59186914e4 100644 --- a/react-router/react-router-tests.tsx +++ b/react-router/react-router-tests.tsx @@ -18,7 +18,8 @@ import { Link, RouterContext, LinkProps, - RedirectFunction + RedirectFunction, + RouteComponentProps } from "react-router"; const NavLink = (props: LinkProps) => ( @@ -98,7 +99,7 @@ interface UsersProps extends RouteComponentProps<{}, {}> { } class Users extends React.Component { render() { - const { location, params, routes, routes, router, routeParams } = this.props; + const { location, params, route, routes, router, routeParams } = this.props; return
This is a user list
From 40e2508b97df2890a26c7b1d0d5b4b598b4b66aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B8is=C3=A6ther=20Rasch?= Date: Fri, 10 Feb 2017 15:26:22 +0100 Subject: [PATCH 38/39] Add Visual Studio IDE support files to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f7927724d5..5b79863e52 100644 --- a/.gitignore +++ b/.gitignore @@ -38,5 +38,6 @@ node_modules .sublimets .settings/launch.json +.vs .vscode yarn.lock From b5730354b012988b284345b0baf0a873d169bbe7 Mon Sep 17 00:00:00 2001 From: Curtis Warren Date: Fri, 10 Feb 2017 10:46:19 -0600 Subject: [PATCH 39/39] Add definitions for react-sticky --- react-sticky/index.d.ts | 27 +++++++++++++++++++++++++++ react-sticky/react-sticky-tests.tsx | 9 +++++++++ react-sticky/tsconfig.json | 25 +++++++++++++++++++++++++ react-sticky/tslint.json | 2 ++ 4 files changed, 63 insertions(+) create mode 100644 react-sticky/index.d.ts create mode 100644 react-sticky/react-sticky-tests.tsx create mode 100644 react-sticky/tsconfig.json create mode 100644 react-sticky/tslint.json diff --git a/react-sticky/index.d.ts b/react-sticky/index.d.ts new file mode 100644 index 0000000000..b3070b046a --- /dev/null +++ b/react-sticky/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for react-sticky 5.0 +// Project: https://github.com/captivationsoftware/react-sticky +// Definitions by: Matej Lednicky , Curtis Warren +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import * as React from "react"; + +declare module "react-sticky" { + + export var StickyContainer: React.ComponentClass>; + + export interface StickyProps { + isActive: boolean; + className: string; + style: any; + stickyClassName: string; + stickyStyle: any; + topOffset: number; + bottomOffset: number; + onStickyStateChange: (isSticky: boolean) => void; + } + + export var Sticky: React.ComponentClass; + +} + diff --git a/react-sticky/react-sticky-tests.tsx b/react-sticky/react-sticky-tests.tsx new file mode 100644 index 0000000000..7ab99bf0c7 --- /dev/null +++ b/react-sticky/react-sticky-tests.tsx @@ -0,0 +1,9 @@ +import {Sticky, StickyContainer} from "react-sticky"; +import * as React from "react"; + +const StickyComponent: JSX.Element = + + undefined}> + + ; + diff --git a/react-sticky/tsconfig.json b/react-sticky/tsconfig.json new file mode 100644 index 0000000000..e2ea2938d1 --- /dev/null +++ b/react-sticky/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "jsx": "react", + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-sticky-tests.tsx" + ] +} + diff --git a/react-sticky/tslint.json b/react-sticky/tslint.json new file mode 100644 index 0000000000..ccdb64abf2 --- /dev/null +++ b/react-sticky/tslint.json @@ -0,0 +1,2 @@ +{ "extends": "../tslint.json" } +