From 771eca0e7db693c4675cb3b78e3e2b2c5b53eea3 Mon Sep 17 00:00:00 2001 From: Niklas Mollenhauer Date: Sat, 20 Sep 2014 10:10:07 +0200 Subject: [PATCH 001/135] Add podcast --- podcast/podcast-tests.ts | 56 ++++++++++++++++++++++++++++ podcast/podcast.d.ts | 80 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 podcast/podcast-tests.ts create mode 100644 podcast/podcast.d.ts diff --git a/podcast/podcast-tests.ts b/podcast/podcast-tests.ts new file mode 100644 index 000000000..c8989d7a8 --- /dev/null +++ b/podcast/podcast-tests.ts @@ -0,0 +1,56 @@ +/// + +import Podcast = require('podcast'); + +/* lets create an rss feed */ +var feed = new Podcast({ + title: 'title', + description: 'description', + feed_url: 'http://example.com/rss.xml', + site_url: 'http://example.com', + image_url: 'http://example.com/icon.png', + docs: 'http://example.com/rss/docs.html', + author: 'Dylan Greene', + managingEditor: 'Dylan Greene', + webMaster: 'Dylan Greene', + copyright: '2013 Dylan Greene', + language: 'en', + categories: ['Category 1','Category 2','Category 3'], + pubDate: new Date('May 20, 2012 04:00:00 GMT'), + ttl: 60, + itunesAuthor: 'Max Nowack', + itunesSubtitle: 'I am a sub title', + itunesSummary: 'I am a summary', + itunesOwner: { name: 'Max Nowack', email:'max@unsou.de' }, + itunesExplicit: false, + itunesCategory: { + "name": "Entertainment", + "subcats": null + }, + itunesImage: 'http://link.to/image.png' +}); + +/* loop over data and add to feed */ +feed.item({ + title: 'item title', + description: 'use this for the content. It can include html.', + url: 'http://example.com/article4?this&that', // link to the item + guid: '1123', // optional - defaults to url + categories: ['Category 1','Category 2','Category 3','Category 4'], // optional - array of item categories + author: 'Guest Author', // optional - defaults to feed author property + date: new Date('May 27, 2012'), + lat: 33.417974, //optional latitude field for GeoRSS + long: -111.933231, //optional longitude field for GeoRSS + enclosure : {url:'...', file:'path-to-file'}, // optional enclosure + itunesAuthor: 'Max Nowack', + itunesExplicit: false, + itunesSubtitle: 'I am a sub title', + itunesSummary: 'I am a summary', + itunesDuration: 12345, + itunesKeywords: ['javascript','podcast'] +}); + +// cache the xml to send to clients +var xml = feed.xml(); + +console.log(xml); diff --git a/podcast/podcast.d.ts b/podcast/podcast.d.ts new file mode 100644 index 000000000..cfe4766ad --- /dev/null +++ b/podcast/podcast.d.ts @@ -0,0 +1,80 @@ +// Type definitions for podcast v0.1.0 +// Project: http://github.com/maxnowack/node-podcast +// Definitions by: Niklas Mollenhauer +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface PodcastStatic +{ + new(options: IFeedOptions): PodcastStatic; + + item(options: IItemOptions): void; + xml(indent?: string): string; +} + +interface IFeedOptions +{ + title: string; + description?: string; + generator?: string; + feed_url: string; + site_url: string; + image_url?: string; + docs?: string; + author: string; + managingEditor?: string; + webMaster?: string; + copyright?: string; + language?: string; + categories?: string[]; + pubDate?: Date; + ttl?: number; + itunesAuthor?: string; + itunesSubtitle?: string; + itunesSummary?: string; + itunesOwner?: IItunesOwner; + itunesExplicit?: boolean; + itunesCategory?: IItunesCategory; + itunesImage?: string; +} + +interface IItunesOwner +{ + name: string; + email: string; +} +interface IItunesCategory +{ + name: string; + subcats: IItunesSubCategory[] +} +interface IItunesSubCategory +{ + name: string; + subcat: string[] /* ? */ +} + +interface IItemOptions +{ + title: string; + description: string; + url: string; + guid: string; + categories?: string[]; + author?: string; + date: Date; + lat?: number; + long?: number; + itunesAuthor?: string; + itunesExplicit?: boolean; + itunesSubtitle?: string; + itunesSummary?: string; + itunesDuration?: number; + itunesKeywords?: string[]; +} + +declare var Podcast: PodcastStatic; + +declare module "podcast" +{ + export = Podcast; +} From 2a63a2d7102eee1659f596f8655fbe4ff577583c Mon Sep 17 00:00:00 2001 From: Niklas Mollenhauer Date: Sat, 20 Sep 2014 10:13:53 +0200 Subject: [PATCH 002/135] Add myself to contributors --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 10ebf956d..540d91252 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -288,6 +288,7 @@ All definitions files include a header with the author and editors, so at some p * [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov)) * [PixiJS](https://github.com/GoodBoyDigital/pixi.js) (by [Pedro Casaubon](https://github.com/xperiments)) * [Platform](https://github.com/bestiejs/platform.js) (by [Jake Hickman](https://github.com/JakeH)) +* [podcast](http://github.com/maxnowack/node-podcast) (by [Niklas Mollenhauer](https://github.com/nikeee)) * [PouchDB](http://pouchdb.com) (by [Bill Sears](https://github.com/MrBigDog2U/)) * [PreloadJS](http://www.createjs.com/#!/PreloadJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) * [ProgressJs](http://usablica.github.io/progress.js/) (by [Shunsuke Ohtani](https://github.com/zaneli)) From 2773ff5fb820af23f6f9a853ea801da7dd7a83f9 Mon Sep 17 00:00:00 2001 From: AdaskoTheBeAsT Date: Sat, 11 Oct 2014 14:56:31 +0200 Subject: [PATCH 003/135] move_node copy_node fixed move_node copy_node fixed --- jstree/jstree-tests.ts | 5 +++++ jstree/jstree.d.ts | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/jstree/jstree-tests.ts b/jstree/jstree-tests.ts index e059589a6..f8bcb7de1 100644 --- a/jstree/jstree-tests.ts +++ b/jstree/jstree-tests.ts @@ -104,3 +104,8 @@ var treeWithNewCheckboxProperties = $('#treeWithNewCheckboxProperties').jstree({ } }); + +var tree = $('a').jstree(); +tree.move_node('a', 'b', 0, (node: any, new_par: any, pos: any) => { }, true, true); +tree.copy_node('a', 'b', 0, (node: any, new_par: any, pos: any) => { }, true, true); + diff --git a/jstree/jstree.d.ts b/jstree/jstree.d.ts index 689232104..70b20ecff 100644 --- a/jstree/jstree.d.ts +++ b/jstree/jstree.d.ts @@ -1004,9 +1004,10 @@ interface JSTree extends JQuery { * @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0` * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position * @param {Boolean} internal parameter indicating if the parent node has been loaded + * @param {Boolean} internal parameter indicating if the tree should be redrawn * @trigger move_node.jstree */ - move_node: (obj: any, par: any, pos?: any, callback?: any, internal?: boolean) => void; + move_node: (obj: any, par: any, pos?: any, callback?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean) => void; /** * copy a node to a new parent @@ -1016,9 +1017,10 @@ interface JSTree extends JQuery { * @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0` * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position * @param {Boolean} internal parameter indicating if the parent node has been loaded + * @param {Boolean} internal parameter indicating if the tree should be redrawn * @trigger model.jstree copy_node.jstree */ - copy_node: (obj: any, par: any, pos?: any, callback?: any, internal?: boolean) => void; + copy_node: (obj: any, par: any, pos?: any, callback?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean) => void; /** * cut a node (a later call to `paste(obj)` would move the node) From 2692538517b85242735868764275ab7a62a8da75 Mon Sep 17 00:00:00 2001 From: AdaskoTheBeAsT Date: Sun, 12 Oct 2014 12:19:25 +0200 Subject: [PATCH 004/135] copy_node move_node comments fixed copy_node move_node comments fixed --- jstree/jstree.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jstree/jstree.d.ts b/jstree/jstree.d.ts index 70b20ecff..5d4be29bf 100644 --- a/jstree/jstree.d.ts +++ b/jstree/jstree.d.ts @@ -1003,8 +1003,8 @@ interface JSTree extends JQuery { * @param {mixed} par the new parent * @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0` * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position - * @param {Boolean} internal parameter indicating if the parent node has been loaded - * @param {Boolean} internal parameter indicating if the tree should be redrawn + * @param {Boolean} is_loaded internal parameter indicating if the parent node has been loaded + * @param {Boolean} skip_redraw internal parameter indicating if the tree should be redrawn * @trigger move_node.jstree */ move_node: (obj: any, par: any, pos?: any, callback?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean) => void; @@ -1016,8 +1016,8 @@ interface JSTree extends JQuery { * @param {mixed} par the new parent * @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0` * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position - * @param {Boolean} internal parameter indicating if the parent node has been loaded - * @param {Boolean} internal parameter indicating if the tree should be redrawn + * @param {Boolean} is_loaded internal parameter indicating if the parent node has been loaded + * @param {Boolean} skip_redraw internal parameter indicating if the tree should be redrawn * @trigger model.jstree copy_node.jstree */ copy_node: (obj: any, par: any, pos?: any, callback?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean) => void; From 0189519510c5ad99a0a417d28b897a78032be31a Mon Sep 17 00:00:00 2001 From: Igor Kriklivets Date: Tue, 21 Oct 2014 13:30:34 +0400 Subject: [PATCH 005/135] T155655: fix --- devextreme/dx.chartjs.d.ts | 59 ++++++------ devextreme/dx.phonejs.d.ts | 186 ++++++++++++++++++------------------ devextreme/dx.webappjs.d.ts | 170 ++++++++++++++++---------------- 3 files changed, 214 insertions(+), 201 deletions(-) diff --git a/devextreme/dx.chartjs.d.ts b/devextreme/dx.chartjs.d.ts index b893163f6..0999c8211 100644 --- a/devextreme/dx.chartjs.d.ts +++ b/devextreme/dx.chartjs.d.ts @@ -4,8 +4,9 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// -declare module DevExpress { -export function abstract(): void; + +declare module DevExpress { + export function abstract(): void; export var rtlEnabled: boolean; export var hardwareBackButton: JQueryCallback; interface Endpoint { @@ -83,8 +84,8 @@ export function abstract(): void; }): void; } } -declare module DevExpress.data { -export interface DataError extends Error { +declare module DevExpress.data { + export interface DataError extends Error { httpStatus?: number; errorDetails?: any; } @@ -204,7 +205,7 @@ export interface DataError extends Error { export module queryAdapters { export function odata(queryOptions: ODataQueryOptions): RemoteQuery; } -export interface DataSourceOptions { + export interface DataSourceOptions { map? (item: any): any; postProcess? (result: any[]): any; pageSize: number; @@ -244,7 +245,7 @@ export interface DataSourceOptions { load(): JQueryPromise; dispose(): void; } -export interface StoreOptions { + export interface StoreOptions { key?: any; errorHandler?: ErrorHandler; loaded?: (result: Array) => void; @@ -350,7 +351,11 @@ export interface StoreOptions { objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; } } -declare module DevExpress.ui { +declare module DevExpress.ui { + export var themes: { + current(): string; + current(themeName: string): void; + }; interface ViewportOptions { allowPan?: boolean; allowZoom?: boolean; @@ -406,7 +411,7 @@ declare module DevExpress.ui { export function confirm(options: DialogOptions): JQueryPromise; export function confirm(message: string, title?: string): JQueryPromise; } -export interface CollectionContainerWidgetOptions extends WidgetOptions { + export interface CollectionContainerWidgetOptions extends WidgetOptions { items?: Array; itemTemplate?: any; itemRender?: Function; @@ -423,7 +428,7 @@ export interface CollectionContainerWidgetOptions extends WidgetOptions { constructor(element: Element, options?: CollectionContainerWidgetOptions); constructor(element: JQuery, options?: CollectionContainerWidgetOptions); } -export interface WidgetOptions extends ComponentOptions { + export interface WidgetOptions extends ComponentOptions { contentReadyAction?: any; width?: any; height?: any; @@ -437,7 +442,7 @@ export interface WidgetOptions extends ComponentOptions { repaint(): void; addTemplate(template: ITemplate): void; } -export interface dxEditorOptions extends WidgetOptions { + export interface dxEditorOptions extends WidgetOptions { value?: any; valueChangeAction?: any; } @@ -446,8 +451,8 @@ export interface dxEditorOptions extends WidgetOptions { constructor(element: JQuery, options?: dxEditorOptions); } } -declare module DevExpress.viz { -export class Chart extends Component { +declare module DevExpress.viz { + export class Chart extends Component { constructor(element: Element, options?: viz.charts.ChartOptions); constructor(element: JQuery, options?: viz.charts.ChartOptions); clearSelection(): void; @@ -563,8 +568,8 @@ export class Chart extends Component { convertCoordinates(x: number, y: number): Array; } } -declare module DevExpress.viz.charts { -interface z_BaseLegendOptions { +declare module DevExpress.viz.charts { + interface z_BaseLegendOptions { backgroundColor?: string; hoverMode?: string; customizeText?: (arg: { @@ -930,8 +935,8 @@ interface z_BaseLegendOptions { asyncSeriesRendering?: boolean; } } -declare module DevExpress.viz.charts.series { -export interface z_BasePointStyle { +declare module DevExpress.viz.charts.series { + export interface z_BasePointStyle { color?: string; border?: { visible?: boolean; @@ -1249,8 +1254,8 @@ export interface z_BasePointStyle { isHovered(): boolean; } } -declare module DevExpress.viz.common { -export interface FontOptions { +declare module DevExpress.viz.common { + export interface FontOptions { color?: string; family?: string; opacity?: number; @@ -1300,8 +1305,8 @@ export interface FontOptions { } } } -declare module DevExpress.viz.gauges { -interface CustomizeTextArgument { +declare module DevExpress.viz.gauges { + interface CustomizeTextArgument { value: number; valueText: string; color: string; @@ -1537,8 +1542,8 @@ interface CustomizeTextArgument { pathModified?: boolean; } } -declare module DevExpress.viz.map { -interface TooltipOptions extends common.BaseTooltipOptions { +declare module DevExpress.viz.map { + interface TooltipOptions extends common.BaseTooltipOptions { customizeText?: (arg: Proxy) => string; customizeTooltip?: (arg: Proxy) => common.CustomizeTooltipResult; borderColor?: string; @@ -1634,8 +1639,8 @@ interface TooltipOptions extends common.BaseTooltipOptions { coordinates(): Array; } } -declare module DevExpress.viz.rangeSelector { -export interface SelectedRange { +declare module DevExpress.viz.rangeSelector { + export interface SelectedRange { startValue: any; endValue: any; } interface CustomizeTextArgument { @@ -1764,8 +1769,8 @@ export interface SelectedRange { pathModified?: boolean; } } -declare module DevExpress.viz.sparklines { -interface z_SparklineTooltipFormatObject { +declare module DevExpress.viz.sparklines { + interface z_SparklineTooltipFormatObject { firstValue?: string; lastValue?: string; maxValue?: string; @@ -1839,7 +1844,7 @@ interface z_SparklineTooltipFormatObject { } } interface JQuery { -dxChart(options?: DevExpress.viz.charts.ChartOptions): JQuery; + dxChart(options?: DevExpress.viz.charts.ChartOptions): JQuery; dxChart(method: string, param1?:any, param2?:any): any; dxPieChart(options?: DevExpress.viz.charts.PieOptions): JQuery; dxPieChart(method: string, param1?: any, param2?: any): any; diff --git a/devextreme/dx.phonejs.d.ts b/devextreme/dx.phonejs.d.ts index 3feee01ca..c432f239d 100644 --- a/devextreme/dx.phonejs.d.ts +++ b/devextreme/dx.phonejs.d.ts @@ -5,8 +5,8 @@ /// -declare module DevExpress { -export function abstract(): void; +declare module DevExpress { + export function abstract(): void; export var rtlEnabled: boolean; export var hardwareBackButton: JQueryCallback; interface Endpoint { @@ -84,8 +84,8 @@ export function abstract(): void; }): void; } } -declare module DevExpress.data { -export interface DataError extends Error { +declare module DevExpress.data { + export interface DataError extends Error { httpStatus?: number; errorDetails?: any; } @@ -205,7 +205,7 @@ export interface DataError extends Error { export module queryAdapters { export function odata(queryOptions: ODataQueryOptions): RemoteQuery; } -export interface DataSourceOptions { + export interface DataSourceOptions { map? (item: any): any; postProcess? (result: any[]): any; pageSize: number; @@ -245,7 +245,7 @@ export interface DataSourceOptions { load(): JQueryPromise; dispose(): void; } -export interface StoreOptions { + export interface StoreOptions { key?: any; errorHandler?: ErrorHandler; loaded?: (result: Array) => void; @@ -351,8 +351,8 @@ export interface StoreOptions { objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; } } -declare module DevExpress.framework { -export interface dxViewOptions { +declare module DevExpress.framework { + export interface dxViewOptions { name: string; title?: string; layout?: string; @@ -690,8 +690,8 @@ export interface dxViewOptions { [key: string]: { execute(e: any): void; } }; } -declare module DevExpress.framework.html { -export interface ILayoutController { +declare module DevExpress.framework.html { + export interface ILayoutController { viewReleased: JQueryCallback; init(options: InitLayoutControllerOptions): void; activate(): void; @@ -793,7 +793,11 @@ export interface ILayoutController { viewPort(): JQuery; } } -declare module DevExpress.ui { +declare module DevExpress.ui { + export var themes: { + current(): string; + current(themeName: string): void; + }; interface ViewportOptions { allowPan?: boolean; allowZoom?: boolean; @@ -849,7 +853,7 @@ declare module DevExpress.ui { export function confirm(options: DialogOptions): JQueryPromise; export function confirm(message: string, title?: string): JQueryPromise; } -export interface CollectionContainerWidgetOptions extends WidgetOptions { + export interface CollectionContainerWidgetOptions extends WidgetOptions { items?: Array; itemTemplate?: any; itemRender?: Function; @@ -866,7 +870,7 @@ export interface CollectionContainerWidgetOptions extends WidgetOptions { constructor(element: Element, options?: CollectionContainerWidgetOptions); constructor(element: JQuery, options?: CollectionContainerWidgetOptions); } -export interface WidgetOptions extends ComponentOptions { + export interface WidgetOptions extends ComponentOptions { contentReadyAction?: any; width?: any; height?: any; @@ -880,7 +884,7 @@ export interface WidgetOptions extends ComponentOptions { repaint(): void; addTemplate(template: ITemplate): void; } -export interface dxEditorOptions extends WidgetOptions { + export interface dxEditorOptions extends WidgetOptions { value?: any; valueChangeAction?: any; } @@ -888,7 +892,7 @@ export interface dxEditorOptions extends WidgetOptions { constructor(element: Element, options?: dxEditorOptions); constructor(element: JQuery, options?: dxEditorOptions); } -export interface dxAutocompleteOptions extends dxDropDownEditorOptions { + export interface dxAutocompleteOptions extends dxDropDownEditorOptions { minSearchLength?: number; searchTimeout?: number; placeholder?: string; @@ -904,7 +908,7 @@ export interface dxAutocompleteOptions extends dxDropDownEditorOptions { constructor(element: Element, options?: dxAutocompleteOptions); constructor(element: JQuery, options?: dxAutocompleteOptions); } -export interface dxButtonOptions extends WidgetOptions { + export interface dxButtonOptions extends WidgetOptions { type?: string; text?: string; icon?: string; @@ -915,12 +919,12 @@ export interface dxButtonOptions extends WidgetOptions { constructor(element: Element, options?: dxButtonOptions); constructor(element: JQuery, options?: dxButtonOptions); } -export interface dxCheckBoxOptions extends dxEditorOptions { } + export interface dxCheckBoxOptions extends dxEditorOptions { } export class dxCheckBox extends dxEditor { constructor(element: Element, options?: dxCheckBoxOptions); constructor(element: JQuery, options?: dxCheckBoxOptions); } -export interface dxCalendarOptions extends dxEditorOptions { + export interface dxCalendarOptions extends dxEditorOptions { value?: Date; min?: Date; max?: Date; @@ -930,7 +934,7 @@ export interface dxCalendarOptions extends dxEditorOptions { constructor(element: Element, options?: dxEditorOptions); constructor(element: JQuery, options?: dxEditorOptions); } -export interface dxDateBoxOptions extends dxTextEditorOptions { + export interface dxDateBoxOptions extends dxTextEditorOptions { format?: string; useNativePicker?: boolean; value?: Date; @@ -946,7 +950,7 @@ export interface dxDateBoxOptions extends dxTextEditorOptions { constructor(element: Element, options?: dxDateBoxOptions); constructor(element: JQuery, options?: dxDateBoxOptions); } -export interface dxTextEditorOptions extends dxEditorOptions { + export interface dxTextEditorOptions extends dxEditorOptions { valueChangeEvent?: string; placeholder?: string; readOnly?: boolean; @@ -970,7 +974,7 @@ export interface dxTextEditorOptions extends dxEditorOptions { focus(): void; blur(): void; } -export interface dxListOptions extends CollectionContainerWidgetOptions { + export interface dxListOptions extends CollectionContainerWidgetOptions { pullRefreshEnabled?: boolean; autoPagingEnabled?: boolean; scrollingEnabled?: boolean; @@ -1036,7 +1040,7 @@ export interface dxListOptions extends CollectionContainerWidgetOptions { scrollTo(targetLocation: number): void; scrollTop(): number; } -export interface dxLoadPanelOptions extends dxOverlayOptions { + export interface dxLoadPanelOptions extends dxOverlayOptions { message?: string; width?: number; height?: number; @@ -1052,7 +1056,7 @@ export interface dxLoadPanelOptions extends dxOverlayOptions { show(): void; toggle(showing: boolean): void; } -export interface dxLookupOptions extends dxEditorOptions { + export interface dxLookupOptions extends dxEditorOptions { dataSource?: data.DataSource; displayValue?: string; title?: string; @@ -1104,7 +1108,7 @@ export interface dxLookupOptions extends dxEditorOptions { close(): void; open(): void; } -export interface dxMapOptions extends WidgetOptions { + export interface dxMapOptions extends WidgetOptions { location?: any; width?: number; height?: number; @@ -1133,12 +1137,12 @@ export interface dxMapOptions extends WidgetOptions { addRoute(routeOptions: any, callback: Function): JQueryPromise; removeRoute(route: any): void; } -export interface dxNavBarOptions extends dxTabsOptions { } + export interface dxNavBarOptions extends dxTabsOptions { } export class dxNavBar extends dxTabs { constructor(element: Element, options?: dxNavBarOptions); constructor(element: JQuery, options?: dxNavBarOptions); } -export interface dxNumberBoxOptions extends dxTextEditorOptions { + export interface dxNumberBoxOptions extends dxTextEditorOptions { min?: number; max?: number; value?: number; @@ -1149,7 +1153,7 @@ export interface dxNumberBoxOptions extends dxTextEditorOptions { constructor(element: Element, options?: dxNumberBoxOptions); constructor(element: JQuery, options?: dxNumberBoxOptions); } -export interface dxOverlayOptions extends WidgetOptions { + export interface dxOverlayOptions extends WidgetOptions { activeStateEnabled?: boolean; shading?: boolean; closeOnOutsideClick?: boolean; @@ -1171,7 +1175,7 @@ export interface dxOverlayOptions extends WidgetOptions { show(): void; toggle(showing: boolean): void; } -export interface dxPopupOptions extends dxOverlayOptions { + export interface dxPopupOptions extends dxOverlayOptions { title?: string; showTitle?: boolean; fullScreen?: boolean; @@ -1185,21 +1189,21 @@ export interface dxPopupOptions extends dxOverlayOptions { constructor(element: Element, options?: dxPopupOptions); constructor(element: JQuery, options?: dxPopupOptions); } -export interface dxPopoverOptions extends dxPopupOptions { + export interface dxPopoverOptions extends dxPopupOptions { target?: any; } export class dxPopover extends dxPopup { constructor(element: Element, options?: dxPopoverOptions); constructor(element: JQuery, options?: dxPopoverOptions); } -export interface dxTooltipOptions extends dxPopoverOptions { + export interface dxTooltipOptions extends dxPopoverOptions { target?: any; } export class dxTooltip extends dxPopover { constructor(element: Element, options?: dxTooltipOptions); constructor(element: JQuery, options?: dxTooltipOptions); } -export interface dxRadioGroupOptions extends CollectionContainerWidgetOptions { + export interface dxRadioGroupOptions extends CollectionContainerWidgetOptions { layout?: string; name?: string; value?: Object; @@ -1209,7 +1213,7 @@ export interface dxRadioGroupOptions extends CollectionContainerWidgetOptions { constructor(element: Element, options?: dxRadioGroupOptions); constructor(element: JQuery, options?: dxRadioGroupOptions); } -export interface dxRangeSliderOptions extends dxSliderOptions { + export interface dxRangeSliderOptions extends dxSliderOptions { start?: number; end?: number; } @@ -1217,7 +1221,7 @@ export interface dxRangeSliderOptions extends dxSliderOptions { constructor(element: Element, options?: dxRangeSliderOptions); constructor(element: JQuery, options?: dxRangeSliderOptions); } -export interface dxScrollableOptions extends ComponentOptions { + export interface dxScrollableOptions extends ComponentOptions { startAction?: any; scrollAction?: any; endAction?: any; @@ -1247,7 +1251,7 @@ export interface dxScrollableOptions extends ComponentOptions { scrollTo(targetLocation: number): void; scrollTo(targetLocation: Object): void; } -export interface dxScrollViewOptions extends dxScrollableOptions { + export interface dxScrollViewOptions extends dxScrollableOptions { pullingDownText?: string; pulledDownText?: string; refreshingText?: string; @@ -1262,7 +1266,7 @@ export interface dxScrollViewOptions extends dxScrollableOptions { toggleLoading(showOrHide: boolean): void; refresh(): void; } -export interface dxSelectBoxOptions extends dxAutocompleteOptions { + export interface dxSelectBoxOptions extends dxAutocompleteOptions { fieldTemplate?: any; displayValue?: string; multiSelectEnabled?: boolean; @@ -1274,7 +1278,7 @@ export interface dxSelectBoxOptions extends dxAutocompleteOptions { constructor(element: Element, options?: dxSelectBoxOptions); constructor(element: JQuery, options?: dxSelectBoxOptions); } -export interface dxSliderOptions extends dxEditorOptions { + export interface dxSliderOptions extends dxEditorOptions { min?: number; max?: number; step?: number; @@ -1295,12 +1299,12 @@ export interface dxSliderOptions extends dxEditorOptions { constructor(element: Element, options?: dxSliderOptions); constructor(element: JQuery, options?: dxSliderOptions); } -export interface dxTabsOptions extends CollectionContainerWidgetOptions { } + export interface dxTabsOptions extends CollectionContainerWidgetOptions { } export class dxTabs extends CollectionContainerWidget { constructor(element: Element, options?: dxTabsOptions); constructor(element: JQuery, options?: dxTabsOptions); } -export interface dxTextAreaOptions extends dxTextEditorOptions { + export interface dxTextAreaOptions extends dxTextEditorOptions { cols?: number; rows?: number; } @@ -1308,14 +1312,14 @@ export interface dxTextAreaOptions extends dxTextEditorOptions { constructor(element: Element, options?: dxTextAreaOptions); constructor(element: JQuery, options?: dxTextAreaOptions); } -export interface dxTextBoxOptions extends dxTextEditorOptions { + export interface dxTextBoxOptions extends dxTextEditorOptions { maxLength?: any; } export class dxTextBox extends dxTextEditor { constructor(element: Element, options?: dxTextBoxOptions); constructor(element: JQuery, options?: dxTextBoxOptions); } -export interface dxToastOptions extends dxOverlayOptions { + export interface dxToastOptions extends dxOverlayOptions { message?: string; type?: string; displayTime?: number; @@ -1324,7 +1328,7 @@ export interface dxToastOptions extends dxOverlayOptions { constructor(element: Element, options?: dxToastOptions); constructor(element: JQuery, options?: dxToastOptions); } -export interface dxToolbarOptions extends CollectionContainerWidgetOptions { + export interface dxToolbarOptions extends CollectionContainerWidgetOptions { menuItemRender?: Function; menuItemTemplate?: any; submenuType?: string; @@ -1334,7 +1338,7 @@ export interface dxToolbarOptions extends CollectionContainerWidgetOptions { constructor(element: Element, options?: dxToolbarOptions); constructor(element: JQuery, options?: dxToolbarOptions); } -export interface dxDropDownEditorOptions extends dxTextBoxOptions { + export interface dxDropDownEditorOptions extends dxTextBoxOptions { closeAction?: any; openAction?: any; } @@ -1342,14 +1346,14 @@ export interface dxDropDownEditorOptions extends dxTextBoxOptions { constructor(element: Element, options?: dxDropDownEditorOptions); constructor(element: JQuery, options?: dxDropDownEditorOptions); } -export interface dxLoadIndicatorOptions extends WidgetOptions { + export interface dxLoadIndicatorOptions extends WidgetOptions { indicatorSrc?: string; } export class dxLoadIndicator extends Widget { constructor(element: Element, options?: dxLoadIndicatorOptions); constructor(element: JQuery, options?: dxLoadIndicatorOptions); } -export interface dxMultiViewOptions extends CollectionContainerWidgetOptions { + export interface dxMultiViewOptions extends CollectionContainerWidgetOptions { loop?: boolean; swipeEnabled?: boolean; animationEnabled?: boolean; @@ -1359,7 +1363,7 @@ export interface dxMultiViewOptions extends CollectionContainerWidgetOptions { constructor(element: Element, options?: dxMultiViewOptions); constructor(element: JQuery, options?: dxMultiViewOptions); } -export interface dxGalleryOptions extends CollectionContainerWidgetOptions { + export interface dxGalleryOptions extends CollectionContainerWidgetOptions { activeStateEnabled?: boolean; animationDuration?: number; loop?: boolean; @@ -1377,7 +1381,7 @@ export interface dxGalleryOptions extends CollectionContainerWidgetOptions { prevItem(animation?: boolean): JQueryPromise; nextItem(animation?: boolean): JQueryPromise; } -export interface dxActionSheetOptions extends CollectionContainerWidgetOptions { + export interface dxActionSheetOptions extends CollectionContainerWidgetOptions { usePopover?: boolean; target?: any; title?: string; @@ -1394,7 +1398,7 @@ export interface dxActionSheetOptions extends CollectionContainerWidgetOptions { show(): void; hide(): void; } -export interface dxDropDownMenuOptions extends WidgetOptions { + export interface dxDropDownMenuOptions extends WidgetOptions { items?: Array; itemClickAction?: any; dataSource?: data.DataSource; @@ -1410,7 +1414,7 @@ export interface dxDropDownMenuOptions extends WidgetOptions { constructor(element: Element, options?: dxDropDownMenuOptions); constructor(element: JQuery, options?: dxDropDownMenuOptions); } -export interface dxPanoramaOptions extends CollectionContainerWidgetOptions { + export interface dxPanoramaOptions extends CollectionContainerWidgetOptions { title?: string; backgroundImage?: any; } @@ -1418,12 +1422,12 @@ export interface dxPanoramaOptions extends CollectionContainerWidgetOptions { constructor(element: Element, options?: dxPanoramaOptions); constructor(element: JQuery, options?: dxPanoramaOptions); } -export interface dxPivotOptions extends CollectionContainerWidgetOptions { } + export interface dxPivotOptions extends CollectionContainerWidgetOptions { } export class dxPivot extends CollectionContainerWidget { constructor(element: Element, options?: dxPivotOptions); constructor(element: JQuery, options?: dxPivotOptions); } -export interface dxSwitchOptions extends dxEditorOptions { + export interface dxSwitchOptions extends dxEditorOptions { onText?: string; offText?: string; } @@ -1431,7 +1435,7 @@ export interface dxSwitchOptions extends dxEditorOptions { constructor(element: Element, options?: dxSwitchOptions); constructor(element: JQuery, options?: dxSwitchOptions); } -export interface dxTileViewOptions extends CollectionContainerWidgetOptions { + export interface dxTileViewOptions extends CollectionContainerWidgetOptions { bounceEnabled?: boolean; showScrollbar?: boolean; listHeight?: number; @@ -1443,7 +1447,7 @@ export interface dxTileViewOptions extends CollectionContainerWidgetOptions { constructor(element: Element, options?: dxTileViewOptions); constructor(element: JQuery, options?: dxTileViewOptions); } -export interface dxSlideOutOptions extends CollectionContainerWidgetOptions { + export interface dxSlideOutOptions extends CollectionContainerWidgetOptions { activeStateEnabled?: boolean; menuItemRender? (itemData: any, itemIndex: number, itemElement: Element): any; menuItemTemplate?: any; @@ -1461,43 +1465,43 @@ export interface dxSlideOutOptions extends CollectionContainerWidgetOptions { toggleMenuVisibility(showing?: boolean): JQueryPromise; } } -interface JQuery { -dxAutocomplete(options?: DevExpress.ui.dxAutocompleteOptions): JQuery; -dxButton(options?: DevExpress.ui.dxButtonOptions): JQuery; -dxCheckBox(options?: DevExpress.ui.dxCheckBoxOptions): JQuery; -dxCalendar(options?: DevExpress.ui.dxCalendarOptions): JQuery; -dxDateBox(options?: DevExpress.ui.dxDateBoxOptions): JQuery; -dxTextEditor(options?: DevExpress.ui.dxTextEditorOptions): JQuery; -dxList(options?: DevExpress.ui.dxListOptions): JQuery; -dxLoadPanel(options?: DevExpress.ui.dxLoadPanelOptions): JQuery; -dxLookup(options?: DevExpress.ui.dxLookupOptions): JQuery; -dxMap(options?: DevExpress.ui.dxMapOptions): JQuery; -dxNavBar(options?: DevExpress.ui.dxNavBarOptions): JQuery; -dxNumberBox(options?: DevExpress.ui.dxNumberBoxOptions): JQuery; -dxOverlay(options?: DevExpress.ui.dxOverlayOptions): JQuery; -dxPopup(options?: DevExpress.ui.dxPopupOptions): JQuery; -dxPopover(options?: DevExpress.ui.dxPopoverOptions): JQuery; -dxTooltip(options?: DevExpress.ui.dxTooltipOptions): JQuery; -dxRadioGroup(options?: DevExpress.ui.dxRadioGroupOptions): JQuery; -dxRangeSlider(options?: DevExpress.ui.dxRangeSliderOptions): JQuery; -dxScrollable(options?: DevExpress.ui.dxScrollableOptions): JQuery; -dxScrollView(options?: DevExpress.ui.dxScrollViewOptions): JQuery; -dxSelectBox(options?: DevExpress.ui.dxSelectBoxOptions): JQuery; -dxSlider(options?: DevExpress.ui.dxSliderOptions): JQuery; -dxTabs(options?: DevExpress.ui.dxTabsOptions): JQuery; -dxTextArea(options?: DevExpress.ui.dxTextAreaOptions): JQuery; -dxTextBox(options?: DevExpress.ui.dxTextBoxOptions): JQuery; -dxToast(options?: DevExpress.ui.dxToastOptions): JQuery; -dxToolbar(options?: DevExpress.ui.dxToolbarOptions): JQuery; -dxDropDownEditor(options?: DevExpress.ui.dxDropDownEditorOptions): JQuery; -dxLoadIndicator(options?: DevExpress.ui.dxLoadIndicatorOptions): JQuery; -dxMultiView(options?: DevExpress.ui.dxMultiViewOptions): JQuery; -dxGallery(options?: DevExpress.ui.dxGalleryOptions): JQuery; -dxActionSheet(options?: DevExpress.ui.dxActionSheetOptions): JQuery; -dxDropDownMenu(options?: DevExpress.ui.dxDropDownMenuOptions): JQuery; -dxPanorama(options?: DevExpress.ui.dxPanoramaOptions): JQuery; -dxPivot(options?: DevExpress.ui.dxPivotOptions): JQuery; -dxSwitch(options?: DevExpress.ui.dxSwitchOptions): JQuery; -dxTileView(options?: DevExpress.ui.dxTileViewOptions): JQuery; -dxSlideOut(options?: DevExpress.ui.dxSlideOutOptions): JQuery; +interface JQuery { + dxAutocomplete(options?: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxButton(options?: DevExpress.ui.dxButtonOptions): JQuery; + dxCheckBox(options?: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxCalendar(options?: DevExpress.ui.dxCalendarOptions): JQuery; + dxDateBox(options?: DevExpress.ui.dxDateBoxOptions): JQuery; + dxTextEditor(options?: DevExpress.ui.dxTextEditorOptions): JQuery; + dxList(options?: DevExpress.ui.dxListOptions): JQuery; + dxLoadPanel(options?: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLookup(options?: DevExpress.ui.dxLookupOptions): JQuery; + dxMap(options?: DevExpress.ui.dxMapOptions): JQuery; + dxNavBar(options?: DevExpress.ui.dxNavBarOptions): JQuery; + dxNumberBox(options?: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxOverlay(options?: DevExpress.ui.dxOverlayOptions): JQuery; + dxPopup(options?: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(options?: DevExpress.ui.dxPopoverOptions): JQuery; + dxTooltip(options?: DevExpress.ui.dxTooltipOptions): JQuery; + dxRadioGroup(options?: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxRangeSlider(options?: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxScrollable(options?: DevExpress.ui.dxScrollableOptions): JQuery; + dxScrollView(options?: DevExpress.ui.dxScrollViewOptions): JQuery; + dxSelectBox(options?: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxSlider(options?: DevExpress.ui.dxSliderOptions): JQuery; + dxTabs(options?: DevExpress.ui.dxTabsOptions): JQuery; + dxTextArea(options?: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTextBox(options?: DevExpress.ui.dxTextBoxOptions): JQuery; + dxToast(options?: DevExpress.ui.dxToastOptions): JQuery; + dxToolbar(options?: DevExpress.ui.dxToolbarOptions): JQuery; + dxDropDownEditor(options?: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxLoadIndicator(options?: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxMultiView(options?: DevExpress.ui.dxMultiViewOptions): JQuery; + dxGallery(options?: DevExpress.ui.dxGalleryOptions): JQuery; + dxActionSheet(options?: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(options?: DevExpress.ui.dxDropDownMenuOptions): JQuery; + dxPanorama(options?: DevExpress.ui.dxPanoramaOptions): JQuery; + dxPivot(options?: DevExpress.ui.dxPivotOptions): JQuery; + dxSwitch(options?: DevExpress.ui.dxSwitchOptions): JQuery; + dxTileView(options?: DevExpress.ui.dxTileViewOptions): JQuery; + dxSlideOut(options?: DevExpress.ui.dxSlideOutOptions): JQuery; } \ No newline at end of file diff --git a/devextreme/dx.webappjs.d.ts b/devextreme/dx.webappjs.d.ts index 9946a9fc4..fd236e5e4 100644 --- a/devextreme/dx.webappjs.d.ts +++ b/devextreme/dx.webappjs.d.ts @@ -5,8 +5,8 @@ /// -declare module DevExpress { -export function abstract(): void; +declare module DevExpress { + export function abstract(): void; export var rtlEnabled: boolean; export var hardwareBackButton: JQueryCallback; interface Endpoint { @@ -84,8 +84,8 @@ export function abstract(): void; }): void; } } -declare module DevExpress.data { -export interface DataError extends Error { +declare module DevExpress.data { + export interface DataError extends Error { httpStatus?: number; errorDetails?: any; } @@ -205,7 +205,7 @@ export interface DataError extends Error { export module queryAdapters { export function odata(queryOptions: ODataQueryOptions): RemoteQuery; } -export interface DataSourceOptions { + export interface DataSourceOptions { map? (item: any): any; postProcess? (result: any[]): any; pageSize: number; @@ -245,7 +245,7 @@ export interface DataSourceOptions { load(): JQueryPromise; dispose(): void; } -export interface StoreOptions { + export interface StoreOptions { key?: any; errorHandler?: ErrorHandler; loaded?: (result: Array) => void; @@ -351,8 +351,8 @@ export interface StoreOptions { objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; } } -declare module DevExpress.framework { -export interface dxViewOptions { +declare module DevExpress.framework { + export interface dxViewOptions { name: string; title?: string; layout?: string; @@ -690,8 +690,8 @@ export interface dxViewOptions { [key: string]: { execute(e: any): void; } }; } -declare module DevExpress.framework.html { -export interface ILayoutController { +declare module DevExpress.framework.html { + export interface ILayoutController { viewReleased: JQueryCallback; init(options: InitLayoutControllerOptions): void; activate(): void; @@ -793,7 +793,11 @@ export interface ILayoutController { viewPort(): JQuery; } } -declare module DevExpress.ui { +declare module DevExpress.ui { + export var themes: { + current(): string; + current(themeName: string): void; + }; interface ViewportOptions { allowPan?: boolean; allowZoom?: boolean; @@ -849,7 +853,7 @@ declare module DevExpress.ui { export function confirm(options: DialogOptions): JQueryPromise; export function confirm(message: string, title?: string): JQueryPromise; } -export interface CollectionContainerWidgetOptions extends WidgetOptions { + export interface CollectionContainerWidgetOptions extends WidgetOptions { items?: Array; itemTemplate?: any; itemRender?: Function; @@ -866,7 +870,7 @@ export interface CollectionContainerWidgetOptions extends WidgetOptions { constructor(element: Element, options?: CollectionContainerWidgetOptions); constructor(element: JQuery, options?: CollectionContainerWidgetOptions); } -export interface WidgetOptions extends ComponentOptions { + export interface WidgetOptions extends ComponentOptions { contentReadyAction?: any; width?: any; height?: any; @@ -880,7 +884,7 @@ export interface WidgetOptions extends ComponentOptions { repaint(): void; addTemplate(template: ITemplate): void; } -export interface dxEditorOptions extends WidgetOptions { + export interface dxEditorOptions extends WidgetOptions { value?: any; valueChangeAction?: any; } @@ -888,7 +892,7 @@ export interface dxEditorOptions extends WidgetOptions { constructor(element: Element, options?: dxEditorOptions); constructor(element: JQuery, options?: dxEditorOptions); } -export interface dxAutocompleteOptions extends dxDropDownEditorOptions { + export interface dxAutocompleteOptions extends dxDropDownEditorOptions { minSearchLength?: number; searchTimeout?: number; placeholder?: string; @@ -904,7 +908,7 @@ export interface dxAutocompleteOptions extends dxDropDownEditorOptions { constructor(element: Element, options?: dxAutocompleteOptions); constructor(element: JQuery, options?: dxAutocompleteOptions); } -export interface dxButtonOptions extends WidgetOptions { + export interface dxButtonOptions extends WidgetOptions { type?: string; text?: string; icon?: string; @@ -915,12 +919,12 @@ export interface dxButtonOptions extends WidgetOptions { constructor(element: Element, options?: dxButtonOptions); constructor(element: JQuery, options?: dxButtonOptions); } -export interface dxCheckBoxOptions extends dxEditorOptions { } + export interface dxCheckBoxOptions extends dxEditorOptions { } export class dxCheckBox extends dxEditor { constructor(element: Element, options?: dxCheckBoxOptions); constructor(element: JQuery, options?: dxCheckBoxOptions); } -export interface dxCalendarOptions extends dxEditorOptions { + export interface dxCalendarOptions extends dxEditorOptions { value?: Date; min?: Date; max?: Date; @@ -930,7 +934,7 @@ export interface dxCalendarOptions extends dxEditorOptions { constructor(element: Element, options?: dxEditorOptions); constructor(element: JQuery, options?: dxEditorOptions); } -export interface dxDateBoxOptions extends dxTextEditorOptions { + export interface dxDateBoxOptions extends dxTextEditorOptions { format?: string; useNativePicker?: boolean; value?: Date; @@ -946,7 +950,7 @@ export interface dxDateBoxOptions extends dxTextEditorOptions { constructor(element: Element, options?: dxDateBoxOptions); constructor(element: JQuery, options?: dxDateBoxOptions); } -export interface dxTextEditorOptions extends dxEditorOptions { + export interface dxTextEditorOptions extends dxEditorOptions { valueChangeEvent?: string; placeholder?: string; readOnly?: boolean; @@ -970,7 +974,7 @@ export interface dxTextEditorOptions extends dxEditorOptions { focus(): void; blur(): void; } -export interface dxListOptions extends CollectionContainerWidgetOptions { + export interface dxListOptions extends CollectionContainerWidgetOptions { pullRefreshEnabled?: boolean; autoPagingEnabled?: boolean; scrollingEnabled?: boolean; @@ -1036,7 +1040,7 @@ export interface dxListOptions extends CollectionContainerWidgetOptions { scrollTo(targetLocation: number): void; scrollTop(): number; } -export interface dxLoadPanelOptions extends dxOverlayOptions { + export interface dxLoadPanelOptions extends dxOverlayOptions { message?: string; width?: number; height?: number; @@ -1052,7 +1056,7 @@ export interface dxLoadPanelOptions extends dxOverlayOptions { show(): void; toggle(showing: boolean): void; } -export interface dxLookupOptions extends dxEditorOptions { + export interface dxLookupOptions extends dxEditorOptions { dataSource?: data.DataSource; displayValue?: string; title?: string; @@ -1104,7 +1108,7 @@ export interface dxLookupOptions extends dxEditorOptions { close(): void; open(): void; } -export interface dxMapOptions extends WidgetOptions { + export interface dxMapOptions extends WidgetOptions { location?: any; width?: number; height?: number; @@ -1133,12 +1137,12 @@ export interface dxMapOptions extends WidgetOptions { addRoute(routeOptions: any, callback: Function): JQueryPromise; removeRoute(route: any): void; } -export interface dxNavBarOptions extends dxTabsOptions { } + export interface dxNavBarOptions extends dxTabsOptions { } export class dxNavBar extends dxTabs { constructor(element: Element, options?: dxNavBarOptions); constructor(element: JQuery, options?: dxNavBarOptions); } -export interface dxNumberBoxOptions extends dxTextEditorOptions { + export interface dxNumberBoxOptions extends dxTextEditorOptions { min?: number; max?: number; value?: number; @@ -1149,7 +1153,7 @@ export interface dxNumberBoxOptions extends dxTextEditorOptions { constructor(element: Element, options?: dxNumberBoxOptions); constructor(element: JQuery, options?: dxNumberBoxOptions); } -export interface dxOverlayOptions extends WidgetOptions { + export interface dxOverlayOptions extends WidgetOptions { activeStateEnabled?: boolean; shading?: boolean; closeOnOutsideClick?: boolean; @@ -1171,7 +1175,7 @@ export interface dxOverlayOptions extends WidgetOptions { show(): void; toggle(showing: boolean): void; } -export interface dxPopupOptions extends dxOverlayOptions { + export interface dxPopupOptions extends dxOverlayOptions { title?: string; showTitle?: boolean; fullScreen?: boolean; @@ -1185,21 +1189,21 @@ export interface dxPopupOptions extends dxOverlayOptions { constructor(element: Element, options?: dxPopupOptions); constructor(element: JQuery, options?: dxPopupOptions); } -export interface dxPopoverOptions extends dxPopupOptions { + export interface dxPopoverOptions extends dxPopupOptions { target?: any; } export class dxPopover extends dxPopup { constructor(element: Element, options?: dxPopoverOptions); constructor(element: JQuery, options?: dxPopoverOptions); } -export interface dxTooltipOptions extends dxPopoverOptions { + export interface dxTooltipOptions extends dxPopoverOptions { target?: any; } export class dxTooltip extends dxPopover { constructor(element: Element, options?: dxTooltipOptions); constructor(element: JQuery, options?: dxTooltipOptions); } -export interface dxRadioGroupOptions extends CollectionContainerWidgetOptions { + export interface dxRadioGroupOptions extends CollectionContainerWidgetOptions { layout?: string; name?: string; value?: Object; @@ -1209,7 +1213,7 @@ export interface dxRadioGroupOptions extends CollectionContainerWidgetOptions { constructor(element: Element, options?: dxRadioGroupOptions); constructor(element: JQuery, options?: dxRadioGroupOptions); } -export interface dxRangeSliderOptions extends dxSliderOptions { + export interface dxRangeSliderOptions extends dxSliderOptions { start?: number; end?: number; } @@ -1217,7 +1221,7 @@ export interface dxRangeSliderOptions extends dxSliderOptions { constructor(element: Element, options?: dxRangeSliderOptions); constructor(element: JQuery, options?: dxRangeSliderOptions); } -export interface dxScrollableOptions extends ComponentOptions { + export interface dxScrollableOptions extends ComponentOptions { startAction?: any; scrollAction?: any; endAction?: any; @@ -1247,7 +1251,7 @@ export interface dxScrollableOptions extends ComponentOptions { scrollTo(targetLocation: number): void; scrollTo(targetLocation: Object): void; } -export interface dxScrollViewOptions extends dxScrollableOptions { + export interface dxScrollViewOptions extends dxScrollableOptions { pullingDownText?: string; pulledDownText?: string; refreshingText?: string; @@ -1262,7 +1266,7 @@ export interface dxScrollViewOptions extends dxScrollableOptions { toggleLoading(showOrHide: boolean): void; refresh(): void; } -export interface dxSelectBoxOptions extends dxAutocompleteOptions { + export interface dxSelectBoxOptions extends dxAutocompleteOptions { fieldTemplate?: any; displayValue?: string; multiSelectEnabled?: boolean; @@ -1274,7 +1278,7 @@ export interface dxSelectBoxOptions extends dxAutocompleteOptions { constructor(element: Element, options?: dxSelectBoxOptions); constructor(element: JQuery, options?: dxSelectBoxOptions); } -export interface dxSliderOptions extends dxEditorOptions { + export interface dxSliderOptions extends dxEditorOptions { min?: number; max?: number; step?: number; @@ -1295,12 +1299,12 @@ export interface dxSliderOptions extends dxEditorOptions { constructor(element: Element, options?: dxSliderOptions); constructor(element: JQuery, options?: dxSliderOptions); } -export interface dxTabsOptions extends CollectionContainerWidgetOptions { } + export interface dxTabsOptions extends CollectionContainerWidgetOptions { } export class dxTabs extends CollectionContainerWidget { constructor(element: Element, options?: dxTabsOptions); constructor(element: JQuery, options?: dxTabsOptions); } -export interface dxTextAreaOptions extends dxTextEditorOptions { + export interface dxTextAreaOptions extends dxTextEditorOptions { cols?: number; rows?: number; } @@ -1308,14 +1312,14 @@ export interface dxTextAreaOptions extends dxTextEditorOptions { constructor(element: Element, options?: dxTextAreaOptions); constructor(element: JQuery, options?: dxTextAreaOptions); } -export interface dxTextBoxOptions extends dxTextEditorOptions { + export interface dxTextBoxOptions extends dxTextEditorOptions { maxLength?: any; } export class dxTextBox extends dxTextEditor { constructor(element: Element, options?: dxTextBoxOptions); constructor(element: JQuery, options?: dxTextBoxOptions); } -export interface dxToastOptions extends dxOverlayOptions { + export interface dxToastOptions extends dxOverlayOptions { message?: string; type?: string; displayTime?: number; @@ -1324,7 +1328,7 @@ export interface dxToastOptions extends dxOverlayOptions { constructor(element: Element, options?: dxToastOptions); constructor(element: JQuery, options?: dxToastOptions); } -export interface dxToolbarOptions extends CollectionContainerWidgetOptions { + export interface dxToolbarOptions extends CollectionContainerWidgetOptions { menuItemRender?: Function; menuItemTemplate?: any; submenuType?: string; @@ -1334,7 +1338,7 @@ export interface dxToolbarOptions extends CollectionContainerWidgetOptions { constructor(element: Element, options?: dxToolbarOptions); constructor(element: JQuery, options?: dxToolbarOptions); } -export interface dxDropDownEditorOptions extends dxTextBoxOptions { + export interface dxDropDownEditorOptions extends dxTextBoxOptions { closeAction?: any; openAction?: any; } @@ -1342,14 +1346,14 @@ export interface dxDropDownEditorOptions extends dxTextBoxOptions { constructor(element: Element, options?: dxDropDownEditorOptions); constructor(element: JQuery, options?: dxDropDownEditorOptions); } -export interface dxLoadIndicatorOptions extends WidgetOptions { + export interface dxLoadIndicatorOptions extends WidgetOptions { indicatorSrc?: string; } export class dxLoadIndicator extends Widget { constructor(element: Element, options?: dxLoadIndicatorOptions); constructor(element: JQuery, options?: dxLoadIndicatorOptions); } -export interface dxMultiViewOptions extends CollectionContainerWidgetOptions { + export interface dxMultiViewOptions extends CollectionContainerWidgetOptions { loop?: boolean; swipeEnabled?: boolean; animationEnabled?: boolean; @@ -1359,7 +1363,7 @@ export interface dxMultiViewOptions extends CollectionContainerWidgetOptions { constructor(element: Element, options?: dxMultiViewOptions); constructor(element: JQuery, options?: dxMultiViewOptions); } -export interface dxGalleryOptions extends CollectionContainerWidgetOptions { + export interface dxGalleryOptions extends CollectionContainerWidgetOptions { activeStateEnabled?: boolean; animationDuration?: number; loop?: boolean; @@ -1377,7 +1381,7 @@ export interface dxGalleryOptions extends CollectionContainerWidgetOptions { prevItem(animation?: boolean): JQueryPromise; nextItem(animation?: boolean): JQueryPromise; } -export interface dxDataGridFilterDescriptions { + export interface dxDataGridFilterDescriptions { '='?: string; '<>'?: string; '<'?: string; @@ -1562,7 +1566,7 @@ export interface dxDataGridFilterDescriptions { isScrollbarVisible: () => boolean; getTopVisibleRowData: () => {}; } -export interface dxMenuOptions extends CollectionContainerWidgetOptions { + export interface dxMenuOptions extends CollectionContainerWidgetOptions { orientation?: string; submenuDirection?: string; showFirstSubmenuMode?: string; @@ -1595,7 +1599,7 @@ export interface dxMenuOptions extends CollectionContainerWidgetOptions { constructor(element: Element, options?: dxContextMenuOptions); constructor(element: JQuery, options?: dxContextMenuOptions); } -export interface dxColorPickerOptions extends dxDropDownEditorOptions { + export interface dxColorPickerOptions extends dxDropDownEditorOptions { editAlphaChannel?: boolean; applyButtonText?: string; cancelButtonText?: string; @@ -1605,40 +1609,40 @@ export interface dxColorPickerOptions extends dxDropDownEditorOptions { constructor(element: JQuery, options?: dxColorPickerOptions); } } -interface JQuery { -dxAutocomplete(options?: DevExpress.ui.dxAutocompleteOptions): JQuery; -dxButton(options?: DevExpress.ui.dxButtonOptions): JQuery; -dxCheckBox(options?: DevExpress.ui.dxCheckBoxOptions): JQuery; -dxCalendar(options?: DevExpress.ui.dxCalendarOptions): JQuery; -dxDateBox(options?: DevExpress.ui.dxDateBoxOptions): JQuery; -dxTextEditor(options?: DevExpress.ui.dxTextEditorOptions): JQuery; -dxList(options?: DevExpress.ui.dxListOptions): JQuery; -dxLoadPanel(options?: DevExpress.ui.dxLoadPanelOptions): JQuery; -dxLookup(options?: DevExpress.ui.dxLookupOptions): JQuery; -dxMap(options?: DevExpress.ui.dxMapOptions): JQuery; -dxNavBar(options?: DevExpress.ui.dxNavBarOptions): JQuery; -dxNumberBox(options?: DevExpress.ui.dxNumberBoxOptions): JQuery; -dxOverlay(options?: DevExpress.ui.dxOverlayOptions): JQuery; -dxPopup(options?: DevExpress.ui.dxPopupOptions): JQuery; -dxPopover(options?: DevExpress.ui.dxPopoverOptions): JQuery; -dxTooltip(options?: DevExpress.ui.dxTooltipOptions): JQuery; -dxRadioGroup(options?: DevExpress.ui.dxRadioGroupOptions): JQuery; -dxRangeSlider(options?: DevExpress.ui.dxRangeSliderOptions): JQuery; -dxScrollable(options?: DevExpress.ui.dxScrollableOptions): JQuery; -dxScrollView(options?: DevExpress.ui.dxScrollViewOptions): JQuery; -dxSelectBox(options?: DevExpress.ui.dxSelectBoxOptions): JQuery; -dxSlider(options?: DevExpress.ui.dxSliderOptions): JQuery; -dxTabs(options?: DevExpress.ui.dxTabsOptions): JQuery; -dxTextArea(options?: DevExpress.ui.dxTextAreaOptions): JQuery; -dxTextBox(options?: DevExpress.ui.dxTextBoxOptions): JQuery; -dxToast(options?: DevExpress.ui.dxToastOptions): JQuery; -dxToolbar(options?: DevExpress.ui.dxToolbarOptions): JQuery; -dxDropDownEditor(options?: DevExpress.ui.dxDropDownEditorOptions): JQuery; -dxLoadIndicator(options?: DevExpress.ui.dxLoadIndicatorOptions): JQuery; -dxMultiView(options?: DevExpress.ui.dxMultiViewOptions): JQuery; -dxGallery(options?: DevExpress.ui.dxGalleryOptions): JQuery; -dxDataGrid(options?: DevExpress.ui.dxDataGridOptions): JQuery; -dxMenu(options?: DevExpress.ui.dxMenuOptions): JQuery; +interface JQuery { + dxAutocomplete(options?: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxButton(options?: DevExpress.ui.dxButtonOptions): JQuery; + dxCheckBox(options?: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxCalendar(options?: DevExpress.ui.dxCalendarOptions): JQuery; + dxDateBox(options?: DevExpress.ui.dxDateBoxOptions): JQuery; + dxTextEditor(options?: DevExpress.ui.dxTextEditorOptions): JQuery; + dxList(options?: DevExpress.ui.dxListOptions): JQuery; + dxLoadPanel(options?: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLookup(options?: DevExpress.ui.dxLookupOptions): JQuery; + dxMap(options?: DevExpress.ui.dxMapOptions): JQuery; + dxNavBar(options?: DevExpress.ui.dxNavBarOptions): JQuery; + dxNumberBox(options?: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxOverlay(options?: DevExpress.ui.dxOverlayOptions): JQuery; + dxPopup(options?: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(options?: DevExpress.ui.dxPopoverOptions): JQuery; + dxTooltip(options?: DevExpress.ui.dxTooltipOptions): JQuery; + dxRadioGroup(options?: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxRangeSlider(options?: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxScrollable(options?: DevExpress.ui.dxScrollableOptions): JQuery; + dxScrollView(options?: DevExpress.ui.dxScrollViewOptions): JQuery; + dxSelectBox(options?: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxSlider(options?: DevExpress.ui.dxSliderOptions): JQuery; + dxTabs(options?: DevExpress.ui.dxTabsOptions): JQuery; + dxTextArea(options?: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTextBox(options?: DevExpress.ui.dxTextBoxOptions): JQuery; + dxToast(options?: DevExpress.ui.dxToastOptions): JQuery; + dxToolbar(options?: DevExpress.ui.dxToolbarOptions): JQuery; + dxDropDownEditor(options?: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxLoadIndicator(options?: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxMultiView(options?: DevExpress.ui.dxMultiViewOptions): JQuery; + dxGallery(options?: DevExpress.ui.dxGalleryOptions): JQuery; + dxDataGrid(options?: DevExpress.ui.dxDataGridOptions): JQuery; + dxMenu(options?: DevExpress.ui.dxMenuOptions): JQuery; dxContextMenu(options?: DevExpress.ui.dxContextMenuOptions): JQuery; -dxColorPicker(options?: DevExpress.ui.dxColorPickerOptions): JQuery; + dxColorPicker(options?: DevExpress.ui.dxColorPickerOptions): JQuery; } \ No newline at end of file From 4846f970d2c4ea260f5fa90ae641414fa71ba3a7 Mon Sep 17 00:00:00 2001 From: Aymeric Beaumet Date: Tue, 21 Oct 2014 18:32:27 +0200 Subject: [PATCH 006/135] add bunyan-logentries definitions --- CONTRIBUTORS.md | 1 + bunyan-logentries/bunyan-logentries-test.ts | 14 ++++++++++++++ bunyan-logentries/bunyan-logentries.d.ts | 17 +++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 bunyan-logentries/bunyan-logentries-test.ts create mode 100644 bunyan-logentries/bunyan-logentries.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 84f0c9190..a4fce2940 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -49,6 +49,7 @@ All definitions files include a header with the author and editors, so at some p * [Browser Harness](https://github.com/scriby/browser-harness) (by [Chris Scribner](https://github.com/scriby)) * [bucks](https://github.com/CyberAgent/bucks.js) (by [Shunsuke Ohtani](https://github.com/zaneli)) * [bunyan](https://github.com/trentm/node-bunyan) (by [Alex Mikhalev](https://github.com/amikhalev)) +* [bunyan-logentries](https://github.com/nemtsov/node-bunyan-logentries) (by [Aymeric Beaumet](http://aymericbeaumet.me)) * [CasperJS](http://casperjs.org) (by [Jed Mao](https://github.com/jedmao)) * [CanvasJS](http://canvasjs.com) (by [Mark Overholt](https://github.com/mover5)) * [Cheerio](https://github.com/MatthewMueller/cheerio) (by [Bret Little](https://github.com/blittle)) diff --git a/bunyan-logentries/bunyan-logentries-test.ts b/bunyan-logentries/bunyan-logentries-test.ts new file mode 100644 index 000000000..d0e487489 --- /dev/null +++ b/bunyan-logentries/bunyan-logentries-test.ts @@ -0,0 +1,14 @@ +/// +/// + +import bunyan = require("bunyan"); +import bunyanLogentries = require("bunyan-logentries"); + +var logger: bunyan.Logger = bunyan.createLogger({ + name: "foobar", + streams: [{ + level: "info", + stream: bunyanLogentries.createStream({token: "foobar"}), + type: "raw" + }] +}); diff --git a/bunyan-logentries/bunyan-logentries.d.ts b/bunyan-logentries/bunyan-logentries.d.ts new file mode 100644 index 000000000..de012b68a --- /dev/null +++ b/bunyan-logentries/bunyan-logentries.d.ts @@ -0,0 +1,17 @@ +// Type definitions for node-bunyan-logentries v0.1.0 +// Project: https://github.com/nemtsov/node-bunyan-logentries +// Definitions by: Aymeric Beaumet +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "bunyan-logentries" { + import bunyan = require("bunyan"); + + interface StreamOptions { + token: string; + } + + export function createStream(options: StreamOptions): NodeJS.WritableStream; +} From b5f6b3d5b10ef19cb3138329a7c0d51313cc2fb4 Mon Sep 17 00:00:00 2001 From: Aymeric Beaumet Date: Tue, 21 Oct 2014 19:14:40 +0200 Subject: [PATCH 007/135] make node_redis inherits from EventEmitter --- redis/redis-tests.ts | 4 +++- redis/redis.d.ts | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/redis/redis-tests.ts b/redis/redis-tests.ts index e64fa7378..9c7003541 100644 --- a/redis/redis-tests.ts +++ b/redis/redis-tests.ts @@ -51,7 +51,9 @@ client.exists(str, numCallback); client.publish(str, value); client.subscribe(str); + client.on(str, messageHandler); +client.once(str, messageHandler); // ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- @@ -61,4 +63,4 @@ client.get(args, resCallback); client.set(args); client.set(args, resCallback); -client.incr(str, resCallback); \ No newline at end of file +client.incr(str, resCallback); diff --git a/redis/redis.d.ts b/redis/redis.d.ts index 913257d7c..a3bd49e91 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -5,6 +5,8 @@ // Imported from: https://github.com/soywiz/typescript-node-definitions/redis.d.ts +/// + declare module "redis" { export function createClient(port_arg: number, host_arg?: string, options?: ClientOpts): RedisClient; export function createClient(unix_socket: string, options?: ClientOpts): RedisClient; @@ -43,7 +45,7 @@ declare module "redis" { auth_pass?: boolean; } - interface RedisClient { + interface RedisClient extends NodeJS.EventEmitter { // event: connect // event: error // event: message @@ -76,7 +78,6 @@ declare module "redis" { publish(channel: string, value: any): void; subscribe(channel: string): void; - on(channel: string, handler: MessageHandler): void; /* commands = set_union([ From 20795bdd53b38d689a22569d362ca6cd6bc4973d Mon Sep 17 00:00:00 2001 From: satoru kimura Date: Wed, 22 Oct 2014 15:31:28 +0900 Subject: [PATCH 008/135] Add dat.GUI definitions. --- CONTRIBUTORS.md | 1 + dat.gui/dat.gui-tests.ts | 159 +++++++++++++++++++++++++++++ dat.gui/dat.gui-tests.ts.tscparams | 1 + dat.gui/dat.gui.d.ts | 57 +++++++++++ 4 files changed, 218 insertions(+) create mode 100644 dat.gui/dat.gui-tests.ts create mode 100644 dat.gui/dat.gui-tests.ts.tscparams create mode 100644 dat.gui/dat.gui.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 84f0c9190..af48d572b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -67,6 +67,7 @@ All definitions files include a header with the author and editors, so at some p * [Crossfilter](https://github.com/square/crossfilter) (by [Schmulik Raskin](https://github.com/schmuli)) * [crypto-js](https://code.google.com/p/crypto-js/) (by [Gia Bảo @ Sân Đình](https://github.com/giabao)). @see [cryptojs.d.ts repo](https://github.com/giabao/cryptojs.d.ts) * [d3.js](http://d3js.org/) (from TypeScript samples) +* [dat.GUI](https://github.com/dataarts/dat.gui) (by [gyoh_k](https://github.com/gyohk)) * [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) (by [Maksim Kozhukh](http://github.com/mkozhukh)) * [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) (by [Maksim Kozhukh](http://github.com/mkozhukh)) * [diff](https://github.com/kpdecker/jsdiff) (by [vvakame](http://github.com/vvakame)) diff --git a/dat.gui/dat.gui-tests.ts b/dat.gui/dat.gui-tests.ts new file mode 100644 index 000000000..fc3bf5de7 --- /dev/null +++ b/dat.gui/dat.gui-tests.ts @@ -0,0 +1,159 @@ +///////////////////////////////////////////////////////////// +// http://workshop.chromeexperiments.com/examples/gui/ +////////////////////////////////////////////////////////////// + +/// + + +// ------------ config +var FizzyText = function () { + return { + message: 'dat.gui', + speed: 0.8, + displayOutline: false, + explode: function () {}, + noiseStrength: 0.5 + // Define render logic ... + } +}; + +// ------------ 1. Basic Usage +() => { + window.onload = function () { + var text = FizzyText(); + var gui = new dat.GUI(); + gui.add(text, 'message'); + gui.add(text, 'speed', -5, 5); + gui.add(text, 'displayOutline'); + gui.add(text, 'explode'); + }; +} +// ------------ 2. Constraining Input +() => { + var text = FizzyText(); + var gui = new dat.GUI(); + gui.add(text, 'noiseStrength').step(5); // Increment amount + gui.add(text, 'growthSpeed', -5, 5); // Min and max + gui.add(text, 'maxSize').min(0).step(0.25); // Mix and match + +// Choose from accepted values + gui.add(text, 'message', ['pizza', 'chrome', 'hooray']); + +// Choose from named values + gui.add(text, 'speed', {Stopped: 0, Slow: 0.1, Fast: 5}); +} +// ------------ 3. Folders +() => { + var text = FizzyText(); + var gui = new dat.GUI(); + + var f1 = gui.addFolder('Flow Field'); + f1.add(text, 'speed'); + f1.add(text, 'noiseStrength'); + + var f2 = gui.addFolder('Letters'); + f2.add(text, 'growthSpeed'); + f2.add(text, 'maxSize'); + f2.add(text, 'message'); + + f2.open(); +} +// ------------ 4. Color Controllers +() => { + var FizzyText = function () { + return { + color0: "#ffae23", // CSS string + color1: [0, 128, 255], // RGB array + color2: [0, 128, 255, 0.3], // RGB with alpha + color3: {h: 350, s: 0.9, v: 0.3} // Hue, saturation, value + + // Define render logic ... + } + }; + + window.onload = function () { + + var text = FizzyText(); + var gui = new dat.GUI(); + + gui.addColor(text, 'color0'); + gui.addColor(text, 'color1'); + gui.addColor(text, 'color2'); + gui.addColor(text, 'color3'); + + }; +} +// ------------ 5. Saving Values +() => { + var fizzyText = FizzyText(); + var gui = new dat.GUI(); + + gui.remember(fizzyText); +} + +// ------------ 6. Presets +() => { + var gui = new dat.GUI({ + load: JSON, + preset: 'Flow' + }); +} + +// ------------ 7. Events +() => { + var fizzyText = FizzyText(); + var gui = new dat.GUI(); + var controller = gui.add(fizzyText, 'maxSize', 0, 10); + + controller.onChange(function (value) { + // Fires on every change, drag, keypress, etc. + }); + + controller.onFinishChange(function (value) { + // Fires when a controller loses focus. + alert("The new value is " + value); + }); +} + +// ------------ 8. Custom Placement +() => { + var gui = new dat.GUI({autoPlace: false}); + + var customContainer = document.getElementById('my-gui-container'); + customContainer.appendChild(gui.domElement); +} +// ------------ 9. Updating the Display Automatically +() => { + var fizzyText = FizzyText(); + var gui = new dat.GUI(); + + gui.add(fizzyText, 'noiseStrength', 0, 100).listen(); + + var update = function () { + requestAnimationFrame(update); + fizzyText.noiseStrength = Math.random(); + }; + + update(); +} +// ------------ 10. Updating the Display Manually +() => { + var fizzyText = FizzyText(); + var gui = new dat.GUI(); + + gui.add(fizzyText, 'noiseStrength', 0, 100); + + var update = function () { + var dt = new Date(); + requestAnimationFrame(update); + fizzyText.noiseStrength = Math.cos(dt.getTime()); + + // Iterate over all controllers + for (var i in gui.__controllers) { + gui.__controllers[i].updateDisplay(); + } + + }; + + update(); +} diff --git a/dat.gui/dat.gui-tests.ts.tscparams b/dat.gui/dat.gui-tests.ts.tscparams new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/dat.gui/dat.gui-tests.ts.tscparams @@ -0,0 +1 @@ + diff --git a/dat.gui/dat.gui.d.ts b/dat.gui/dat.gui.d.ts new file mode 100644 index 000000000..c17cb5bd7 --- /dev/null +++ b/dat.gui/dat.gui.d.ts @@ -0,0 +1,57 @@ +// Type definitions for dat.GUI v0.5 +// Project: https://github.com/dataarts/dat.gui +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module dat { + export class GUI { + constructor(option?: GUIParams); + + __controllers: GUIController[]; + __folders: GUI[]; + domElement: HTMLElement; + + add(target: Object, propName:string): GUIController; + add(target: Object, propName:string, min: number, max: number): GUIController; + add(target: Object, propName:string, status: boolean): GUIController; + add(target: Object, propName:string, items:string[]): GUIController; + add(target: Object, propName:string, items:number[]): GUIController; + add(target: Object, propName:string, items:Object): GUIController; + + addColor(target: Object, propName:string): GUIController; + addColor(target: Object, propName:string, color: string): GUIController; + addColor(target: Object, propName:string, rgba: number[]): GUIController; // rgb or rgba + addColor(target: Object, propName:string, hsv:{h:number; s:number; v:number}): GUIController; + + addFolder(propName:string): GUI; + + close(): void; + open(): void; + remember(target: Object): void; + } + + export interface GUIParams{ + autoPlace?: boolean; + closed?: boolean; + load?: any; + name?: string; + preset?: string; + width?: number; + } + + export class GUIController { + destroy(): void; + fire(): GUIController; + getValue(): any; + isModified(): boolean; + listen(): GUIController; + min(n: number): GUIController; + remove(target: GUIController): void; + setValue(value: any): GUIController; + step(n: number): GUIController; + updateDisplay(): void; + + onChange: (value?: any) => void; + onFinishChange: (value?: any) => void; + } +} From 600e24f64f6474127f3fc612b3c761adb8c23e6b Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Wed, 22 Oct 2014 10:21:24 +0200 Subject: [PATCH 009/135] Add typings for checksum-0.1.1. --- CONTRIBUTORS.md | 1 + checksum/checksum-tests.ts | 14 ++++++++++++ checksum/checksum.d.ts | 44 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 checksum/checksum-tests.ts create mode 100644 checksum/checksum.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 84f0c9190..be8c9c02d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -51,6 +51,7 @@ All definitions files include a header with the author and editors, so at some p * [bunyan](https://github.com/trentm/node-bunyan) (by [Alex Mikhalev](https://github.com/amikhalev)) * [CasperJS](http://casperjs.org) (by [Jed Mao](https://github.com/jedmao)) * [CanvasJS](http://canvasjs.com) (by [Mark Overholt](https://github.com/mover5)) +* [checksum](https://github.com/dshaw/checksum) (by [Rogier Schouten](https://github.com/rogierschouten)) * [Cheerio](https://github.com/MatthewMueller/cheerio) (by [Bret Little](https://github.com/blittle)) * [Chosen](http://harvesthq.github.com/chosen/) (by [Boris Yankov](https://github.com/borisyankov)) * [Chroma.js](https://github.com/gka/chroma.js) (by [Sebastian Brückner](https://github.com/invliD)) diff --git a/checksum/checksum-tests.ts b/checksum/checksum-tests.ts new file mode 100644 index 000000000..de9faaa98 --- /dev/null +++ b/checksum/checksum-tests.ts @@ -0,0 +1,14 @@ +/// + +import checksum = require("checksum"); + +var s: string = checksum("abcd"); +var t: string = checksum("abcd", { algorithm: 'sha1' }); + +checksum.file("myfile.txt", (error: Error, hash: string): void => { + // do nothing +}); + +checksum.file("myfile.txt", { algorithm: 'sha1' }, (error: Error, hash: string): void => { + // do nothing +}); diff --git a/checksum/checksum.d.ts b/checksum/checksum.d.ts new file mode 100644 index 000000000..63f24224e --- /dev/null +++ b/checksum/checksum.d.ts @@ -0,0 +1,44 @@ +// Type definitions for checksum 0.1.1 +// Project: https://github.com/dshaw/checksum +// Definitions by: Rogier Schouten +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "checksum" { + + module checksum { + /** + * Options object for all functions + */ + interface ChecksumOptions { + /** + * Algorithm to use, default 'sha1' + * Can be 'sha1' or 'md5' (see module 'crypto'). + */ + algorithm?: string; + } + + /** + * Generate the checksum for a file on disk + * @param filename The file name + * @param callback Callback which is called with the result or an error + */ + function file(filename: string, callback: (error: Error, hash: string) => void): void; + /** + * Generate the checksum for a file on disk + * @param filename The file name + * @param options Options object to indicate hash algo + * @param callback Callback which is called with the result or an error + */ + function file(filename: string, options: ChecksumOptions, callback: (error: Error, hash: string) => void): void; + } + + /** + * Generates a checksum for the given value + * @param value Any value + * @param options Allows to set the algorithm + * @returns Checksum + */ + function checksum(value: any, options?: checksum.ChecksumOptions): string; + + export = checksum; +} From e24d68612a0048da55539684f5cd3da4f3ed85b0 Mon Sep 17 00:00:00 2001 From: Martin Poelstra Date: Wed, 22 Oct 2014 12:20:07 +0200 Subject: [PATCH 010/135] Add typings for 'yargs'. --- CONTRIBUTORS.md | 1 + yargs/yargs-tests.ts | 157 +++++++++++++++++++++++++++++++++++++++++++ yargs/yargs.d.ts | 116 ++++++++++++++++++++++++++++++++ 3 files changed, 274 insertions(+) create mode 100644 yargs/yargs-tests.ts create mode 100644 yargs/yargs.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 84f0c9190..ab6dd4d37 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -421,6 +421,7 @@ All definitions files include a header with the author and editors, so at some p * [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) (by [Michel Salib](https://github.com/michelsalib)) * [xpath](https://github.com/goto100/xpath) (by [Andrew Bradley](https://github.com/cspotcode)) * [XRegExp](http://xregexp.com/) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [yargs](https://github.com/chevex/yargs) (by [Martin Poelstra](https://github.com/poelstra)) * [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/)) * [YouTube Analytics API](https://developers.google.com/youtube/analytics/) (by [Frank M](https://github.com/sgtfrankieboy)) * [YouTube Data API](https://developers.google.com/youtube/v3/) (by [Frank M](https://github.com/sgtfrankieboy/)) diff --git a/yargs/yargs-tests.ts b/yargs/yargs-tests.ts new file mode 100644 index 000000000..4e6d742a2 --- /dev/null +++ b/yargs/yargs-tests.ts @@ -0,0 +1,157 @@ +// Type definition tests for yargs +// Project: https://github.com/chevex/yargs +// Definitions by: Martin Poelstra +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +import yargs = require('yargs'); + +// Examples taken from yargs website +// https://github.com/chevex/yargs + +// With yargs, the options be just a hash! +function xup() { + var argv = yargs.argv; + + if (argv.rif - 5 * argv.xup > 7.138) { + console.log('Plunder more riffiwobbles!'); + } + else { + console.log('Drop the xupptumblers!'); + } +} + +// And non-hyphenated options too! Just use argv._! +function nonopt() { + var argv = yargs.argv; + console.log('(%d,%d)', argv.x, argv.y); + console.log(argv._); +} + +// Yargs even counts your booleans! +function count() { + var argv = yargs + .count('verbose') + .alias('v', 'verbose') + .argv; + + var VERBOSE_LEVEL: number = argv.verbose; + + function WARN() { VERBOSE_LEVEL >= 0 && console.log.apply(console, arguments); } + function INFO() { VERBOSE_LEVEL >= 1 && console.log.apply(console, arguments); } + function DEBUG() { VERBOSE_LEVEL >= 2 && console.log.apply(console, arguments); } +} + +// Tell users how to use yer options and make demands. +function divide() { + var argv = yargs + .usage('Usage: $0 -x [num] -y [num]') + .demand(['x', 'y']) + .argv; + + console.log(argv.x / argv.y); +} + +// After yer demands have been met, demand more! Ask for non-hypenated arguments! +function demand_count() { + var argv = yargs + .demand(2) + .argv; + console.dir(argv); +} + +// EVEN MORE SHIVER ME TIMBERS! +function default_singles() { + var argv = yargs + .default('x', 10) + .default('y', 10) + .argv + ; + console.log(argv.x + argv.y); +} +function default_hash() { + var argv = yargs + .default({ x: 10, y: 10 }) + .argv + ; + console.log(argv.x + argv.y); +} + +// And if you really want to get all descriptive about it... +function boolean_single() { + var argv = yargs + .boolean('v') + .argv + ; + console.dir(argv.v); + console.dir(argv._); +} +function boolean_double() { + var argv = yargs + .boolean(['x', 'y', 'z']) + .argv + ; + console.dir([argv.x, argv.y, argv.z]); + console.dir(argv._); +} + +// Yargs is here to help you... +function line_count() { + var argv = yargs + .usage('Count the lines in a file.\nUsage: $0') + .example('$0 -f', 'count the lines in the given file') + .demand('f') + .alias('f', 'file') + .describe('f', 'Load a file') + .argv + ; +} + +// Below are tests for individual methods. +// Not all methods are covered yet, and neither are all possible invocations of methods. + +function Argv_parsing() { + var argv1 = yargs.argv; + var argv2 = yargs(['-x', '1', '-y', '2']).argv; + var argv3 = yargs.parse(['-x', '1', '-y', '2']); + console.log(argv1.x, argv2.x, argv3.x); +} + +function Argv$options() { + var argv1 = yargs + .options('f', { + alias: 'file', + default: '/etc/passwd', + }) + .argv + ; + + var argv2 = yargs + .alias('f', 'file') + .default('f', '/etc/passwd') + .argv + ; +} + +function Argv$help() { + var yargs1 = yargs + .usage("$0 -operand1 number -operand2 number -operation [add|subtract]"); + var s: string = yargs1.help(); +} + +function Argv$showHelpOnFail() { + var argv = yargs + .usage('Count the lines in a file.\nUsage: $0') + .demand('f') + .alias('f', 'file') + .describe('f', 'Load a file') + .showHelpOnFail(false, "Specify --help for available options") + .argv; +} + +function Argv$showHelp() { + var yargs1 = yargs + .usage("$0 -operand1 number -operand2 number -operation [add|subtract]"); + yargs1.showHelp(); +} diff --git a/yargs/yargs.d.ts b/yargs/yargs.d.ts new file mode 100644 index 000000000..c09583526 --- /dev/null +++ b/yargs/yargs.d.ts @@ -0,0 +1,116 @@ +// Type definitions for yargs +// Project: https://github.com/chevex/yargs +// Definitions by: Martin Poelstra +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "yargs" { + + module yargs { + interface Argv { + argv: any; + (...args: any[]): any; + parse(...args: any[]): any; + + alias(shortName: string, longName: string): Argv; + alias(aliases: { [shortName: string]: string }): Argv; + alias(aliases: { [shortName: string]: string[] }): Argv; + + default(key: string, value: any): Argv; + default(defaults: { [key: string]: any}): Argv; + + demand(key: string, msg: string): Argv; + demand(key: string, required?: boolean): Argv; + demand(keys: string[], msg: string): Argv; + demand(keys: string[], required?: boolean): Argv; + demand(positionals: number, required?: boolean): Argv; + demand(positionals: number, msg: string): Argv; + + require(key: string, msg: string): Argv; + require(key: string, required: boolean): Argv; + require(keys: number[], msg: string): Argv; + require(keys: number[], required: boolean): Argv; + require(positionals: number, required: boolean): Argv; + require(positionals: number, msg: string): Argv; + + required(key: string, msg: string): Argv; + required(key: string, required: boolean): Argv; + required(keys: number[], msg: string): Argv; + required(keys: number[], required: boolean): Argv; + required(positionals: number, required: boolean): Argv; + required(positionals: number, msg: string): Argv; + + requiresArg(key: string): Argv; + requiresArg(keys: string[]): Argv; + + describe(key: string, description: string): Argv; + describe(descriptions: { [key: string]: string }): Argv; + + option(key: string, options: Options): Argv; + option(options: { [key: string]: Options }): Argv; + options(key: string, options: Options): Argv; + options(options: { [key: string]: Options }): Argv; + + usage(message: string, options?: { [key: string]: Options }): Argv; + usage(options?: { [key: string]: Options }): Argv; + + example(command: string, description: string): Argv; + + check(func: (argv: { [key: string]: any }, aliases: { [alias: string]: string }) => boolean): Argv; + check(func: (argv: { [key: string]: any }, aliases: { [alias: string]: string }) => string): Argv; + + boolean(key: string): Argv; + boolean(keys: string[]): Argv; + + string(key: string): Argv; + string(keys: string[]): Argv; + + config(key: string): Argv; + config(keys: string[]): Argv; + + wrap(columns: number): Argv; + + strict(): Argv; + + help(): string; + help(option: string, description?: string): Argv; + + version(version: string, option: string, description?: string): Argv; + + showHelpOnFail(enable: boolean, message?: string): Argv; + + showHelp(func?: (message: string) => any): Argv; + + /* Undocumented */ + + normalize(key: string): Argv; + normalize(keys: string[]): Argv; + + implies(key: string, value: string): Argv; + implies(implies: { [key: string]: string }): Argv; + + count(key: string): Argv; + count(keys: string[]): Argv; + + fail(func: (msg: string) => any): void; + } + + interface Options { + type?: string; + alias?: any; + demand?: any; + required?: any; + require?: any; + default?: any; + boolean?: any; + string?: any; + count?: any; + describe?: any; + description?: any; + desc?: any; + requiresArg?: any; + } + } + + var yargs: yargs.Argv; + export = yargs; +} From d325c983f9b1057f6dc4c3aadab7ede05b0924d4 Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Wed, 22 Oct 2014 14:25:15 +0200 Subject: [PATCH 011/135] headers function in http promise callbacks: passing no name arg returns entire headers object. --- angularjs/angular.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 67d538f37..199a67557 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1201,7 +1201,7 @@ declare module ng { } interface IHttpPromiseCallback { - (data: T, status: number, headers: (headerName: string) => string, config: IRequestConfig): void; + (data: T, status: number, headers: (headerName?: string) => string, config: IRequestConfig): void; } interface IHttpPromiseCallbackArg { From 04080791c56187944b71aecbbb0a9f2a37672f87 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 22 Oct 2014 15:40:26 +0200 Subject: [PATCH 012/135] Updated Ladda definition to v0.9.4 --- ladda/ladda-tests.ts | 6 +++++ ladda/ladda.d.ts | 61 ++++++++++++++++++++++---------------------- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/ladda/ladda-tests.ts b/ladda/ladda-tests.ts index 24956950c..710407de6 100644 --- a/ladda/ladda-tests.ts +++ b/ladda/ladda-tests.ts @@ -12,6 +12,9 @@ var l = Ladda.create(document.querySelector('.my-button')); // Start loading l.start(); +// Start loading after a delay +l.startAfter(300); + // Will display a progress bar for 50% of the button width l.setProgress(0.5); @@ -24,6 +27,9 @@ l.toggle(); // Check the current state l.isLoading(); +// Remove the element +l.remove(); + // Test bind Ladda.bind('button.ladda-button', { timeout: 42, callback: btn => alert('Clicked!!!') }); Ladda.bind('button.ladda-button'); diff --git a/ladda/ladda.d.ts b/ladda/ladda.d.ts index fc4f43b41..b464a31c5 100644 --- a/ladda/ladda.d.ts +++ b/ladda/ladda.d.ts @@ -1,35 +1,36 @@ -// Type definitions for Ladda 0.7.0 +// Type definitions for Ladda 0.9.4 // Project: https://github.com/hakimel/Ladda // Definitions by: Danil Flores // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module Ladda { - - interface ILaddaButton { - start(): ILaddaButton; - - stop(): ILaddaButton; - - toggle(): ILaddaButton; - - setProgress(progress: number): ILaddaButton; - - enable(): ILaddaButton; - - disable(): ILaddaButton; - - isLoading(): boolean; - } - - interface ILaddaOptions { - timeout?: number; - callback?: (instance: ILaddaButton) => void; - } - - function bind(target: HTMLElement, options?: ILaddaOptions): void; - function bind(cssSelector: string, options?: ILaddaOptions): void; - - function create(button: Element): ILaddaButton; - - function stopAll(): void; +interface ILaddaButton { + start(): ILaddaButton; + startAfter(delay: number): ILaddaButton + stop(): ILaddaButton; + toggle(): ILaddaButton; + setProgress(progress: number): ILaddaButton; + enable(): ILaddaButton; + disable(): ILaddaButton; + isLoading(): boolean; + remove(): void; +} + +interface ILaddaOptions { + timeout?: number; + callback?: (instance: ILaddaButton) => void; +} + +interface ILadda { + bind(target: HTMLElement, options?: ILaddaOptions): void; + bind(cssSelector: string, options?: ILaddaOptions): void; + + create(button: Element): ILaddaButton; + + stopAll(): void; +} + +declare var Ladda: ILadda; + +declare module "ladda" { + export = Ladda; } From d50b10def24af9bc69dad45413af93edea37ee1e Mon Sep 17 00:00:00 2001 From: Brandon Luong Date: Wed, 22 Oct 2014 14:04:53 -0700 Subject: [PATCH 013/135] Making accessor have optional arguments and include index --- d3/d3.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 4bb10a5d1..79b578ddf 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -89,7 +89,7 @@ declare module D3 { * @param arr Array to search * @param map Accsessor function */ - min(arr: T[], map: (v: T) => U): U; + min(arr: T[], map: (v?: T, i?: number) => U): U; /** * Find the minimum value in an array * @@ -102,7 +102,7 @@ declare module D3 { * @param arr Array to search * @param map Accsessor function */ - max(arr: T[], map: (v: T) => U): U; + max(arr: T[], map: (v?: T, i?: number) => U): U; /** * Find the maximum value in an array * From c4733bccc5eb3ca97400649df8d43445a631e223 Mon Sep 17 00:00:00 2001 From: Brandon Luong Date: Wed, 22 Oct 2014 14:14:56 -0700 Subject: [PATCH 014/135] pairs document --- d3/d3.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 4bb10a5d1..79d06df5e 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -233,6 +233,13 @@ declare module D3 { */ transpose(matrix: any[]): any[]; /** + * Creates an array containing tuples of adjacent pairs + * + * @param arr An array containing entries to pair + * @returns any[][] An array of 2-element tuples for each pair + */ + pairs(arr: any[]): any[][]; + /** * List the keys of an associative array. * * @param map Array of objects to get the key values from From 10a78d43235e7ccc358ea36c43c9f36d90c75c15 Mon Sep 17 00:00:00 2001 From: Phips Peter Date: Wed, 22 Oct 2014 17:11:22 -0700 Subject: [PATCH 015/135] Adding createElement This is based off the work of @jnetterf in https://github.com/Asana/typed-react/pull/24/files#diff-4 --- react/react.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/react/react.d.ts b/react/react.d.ts index 2d6696066..40522920f 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -12,6 +12,12 @@ declare module React { export function createFactory

(clazz: ReactComponentFactory

): ReactComponentFactory

; + export function createElement

(clazz: ReactComponentFactory

, props: P, ...children: any[]): ReactComponentElement

; + + export function createElement(type: string, props: DomAttributes, ...children: any[]): ReactHTMLElement; + + export function createElement(type: string, props: SvgAttributes, ...children: any[]): ReactSVGElement; + export function render

(component: ReactComponentElement

, container: Element, callback?: () => void): ReactComponentElement

; export function render(component: ReactHTMLElement, container: Element, callback?: () => void): ReactHTMLElement; From e87a55df386cfd70519e7d519a4df94a1450a8fc Mon Sep 17 00:00:00 2001 From: SaschaNaz Date: Thu, 23 Oct 2014 16:46:23 +0900 Subject: [PATCH 016/135] jszip: reformat jsdoc --- jszip/jszip.d.ts | 72 +++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 41 deletions(-) diff --git a/jszip/jszip.d.ts b/jszip/jszip.d.ts index 4c571dc95..2f05895bd 100644 --- a/jszip/jszip.d.ts +++ b/jszip/jszip.d.ts @@ -8,115 +8,105 @@ declare module jszip { /** * Get a file from the archive * - * @param path {string} relative path to file - * - * @return {JSZipFile} file matching path, null if no file found + * @param Path relative path to file + * @return File matching path, null if no file found */ file(path: string): JSZipFile; /** * Get files matching a RegExp from archive * - * @param path {RegExp} RegExp to match - * - * @return {JSZipFile[]} return all matching files or an empty array + * @param path RegExp to match + * @return Return all matching files or an empty array */ file(path: RegExp): JSZipFile[]; /** * Add a file to the archive * - * @param path {string} relative path to file - * @param content {any} content of the file - * @param options {JSZipOptions} optional information about the file - * - * @return {JSZip} JSZip object + * @param path Relative path to file + * @param content Content of the file + * @param options Optional information about the file + * @return JSZip object */ file(path: string, content: any, options?: JSZipOptions): JSZip; /** * Return an new JSZip instance with the given folder as root * - * @param name {string} name of the folder - * - * @return {JSZip} new JSZip object with the given folder as root or null + * @param name Name of the folder + * @return New JSZip object with the given folder as root or null */ folder(name: string): JSZip; /** * Returns new JSZip instances with the matching folders as root * - * @param name {RegExp} RegExp to match - * - * @return {JSZipFile[]} new array of JSZipFile objects which match the RegExp + * @param name RegExp to match + * @return New array of JSZipFile objects which match the RegExp */ folder(name: RegExp): JSZipFile[]; /** * Removes the file or folder from the archive * - * @param path {string} relative path of file or folder - * - * @return {JSZip} returns the JSZip instance + * @param path Relative path of file or folder + * @return Returns the JSZip instance */ remove(path: string): JSZip; /** * Generates a new archive * - * @param options {JSZipGeneratorOptions} optional options for the generator - * - * @return {any} the serialized archive + * @param options Optional options for the generator + * @return The serialized archive */ generate(options?: JSZipGeneratorOptions): any; /** * Deserialize zip file * - * @param data {any} serialized zip file - * @param options {JSZipOptions} options for deserializing - * - * @return {JSZip} returns the JSZip instance + * @param data Serialized zip file + * @param options Options for deserializing + * @return Returns the JSZip instance */ load(data: any, options: JSZipOptions): JSZip; /** * Get all files wchich match the given filter function * - * @param {function} filter function - * - * @return {JSZipFile[]} array of matched elements + * @param predicate Filter function + * @return Array of matched elements */ filter(predicate: (relativePath: string, file: JSZipFile) => boolean): JSZipFile[]; /** * Calculate crc32 of given string * - * @param data {string} string to calculate crc32 from - * @param crc {number} optional: initializer for crc calc - * - * @return {number} calculated crc32 number + * @param data String to calculate crc32 from + * @param crc Optional: initializer for crc calc + * @return Calculated crc32 number */ crc32(data: string, crc?: number): number; /** * Clone JSSZip instance * - * return {JSZip} cloned instsance + * @return Cloned instsance */ clone(): JSZip; /** * UTF8 encode a string * - * @param data {string} string to encode + * @param data String to encode */ utf8encode(data: string): string; /** * UTF8 decode a string * - * @param data {string} string to decode + * @param data String to decode */ utf8decode(data: string): string; @@ -166,13 +156,13 @@ declare var JSZip: { * Create JSZip instance * If no parameters given an empty zip archive will be created * - * @param data {any} serialized zip archive - * @param options {JSZipOptions} description of the serialized zip archive + * @param data Serialized zip archive + * @param options Description of the serialized zip archive */ - new(data?: any, options?: jszip.JSZipOptions): jszip.JSZip; + new (data?: any, options?: jszip.JSZipOptions): jszip.JSZip; prototype: jszip.JSZip; - support : jszip.JSZipSupport; + support: jszip.JSZipSupport; } declare var JSZipBase64: { From 2d34cd049c239c91ed4409930944819abd175319 Mon Sep 17 00:00:00 2001 From: SaschaNaz Date: Thu, 23 Oct 2014 21:18:19 +0900 Subject: [PATCH 017/135] jszip: adjust to match current API --- jszip/jszip.d.ts | 277 +++++++++++++++++++++++------------------------ 1 file changed, 137 insertions(+), 140 deletions(-) diff --git a/jszip/jszip.d.ts b/jszip/jszip.d.ts index 2f05895bd..399fcb9a3 100644 --- a/jszip/jszip.d.ts +++ b/jszip/jszip.d.ts @@ -3,155 +3,146 @@ // Definitions by: mzeiher // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module jszip { - export interface JSZip { - /** - * Get a file from the archive - * - * @param Path relative path to file - * @return File matching path, null if no file found - */ - file(path: string): JSZipFile; +interface JSZip { + /** + * Get a file from the archive + * + * @param Path relative path to file + * @return File matching path, null if no file found + */ + file(path: string): JSZipObject; - /** - * Get files matching a RegExp from archive - * - * @param path RegExp to match - * @return Return all matching files or an empty array - */ - file(path: RegExp): JSZipFile[]; + /** + * Get files matching a RegExp from archive + * + * @param path RegExp to match + * @return Return all matching files or an empty array + */ + file(path: RegExp): JSZipObject[]; - /** - * Add a file to the archive - * - * @param path Relative path to file - * @param content Content of the file - * @param options Optional information about the file - * @return JSZip object - */ - file(path: string, content: any, options?: JSZipOptions): JSZip; + /** + * Add a file to the archive + * + * @param path Relative path to file + * @param content Content of the file + * @param options Optional information about the file + * @return JSZip object + */ + file(path: string, data: any, options?: JSZipFileOptions): JSZip; - /** - * Return an new JSZip instance with the given folder as root - * - * @param name Name of the folder - * @return New JSZip object with the given folder as root or null - */ - folder(name: string): JSZip; + /** + * Return an new JSZip instance with the given folder as root + * + * @param name Name of the folder + * @return New JSZip object with the given folder as root or null + */ + folder(name: string): JSZip; - /** - * Returns new JSZip instances with the matching folders as root - * - * @param name RegExp to match - * @return New array of JSZipFile objects which match the RegExp - */ - folder(name: RegExp): JSZipFile[]; + /** + * Returns new JSZip instances with the matching folders as root + * + * @param name RegExp to match + * @return New array of JSZipFile objects which match the RegExp + */ + folder(name: RegExp): JSZipObject[]; - /** - * Removes the file or folder from the archive - * - * @param path Relative path of file or folder - * @return Returns the JSZip instance - */ - remove(path: string): JSZip; + /** + * Get all files wchich match the given filter function + * + * @param predicate Filter function + * @return Array of matched elements + */ + filter(predicate: (relativePath: string, file: JSZipObject) => boolean): JSZipObject[]; - /** - * Generates a new archive - * - * @param options Optional options for the generator - * @return The serialized archive - */ - generate(options?: JSZipGeneratorOptions): any; + /** + * Removes the file or folder from the archive + * + * @param path Relative path of file or folder + * @return Returns the JSZip instance + */ + remove(path: string): JSZip; - /** - * Deserialize zip file - * - * @param data Serialized zip file - * @param options Options for deserializing - * @return Returns the JSZip instance - */ - load(data: any, options: JSZipOptions): JSZip; + /** + * Generates a new archive + * + * @param options Optional options for the generator + * @return The serialized archive + */ + generate(options?: JSZipGeneratorOptions): any; - /** - * Get all files wchich match the given filter function - * - * @param predicate Filter function - * @return Array of matched elements - */ - filter(predicate: (relativePath: string, file: JSZipFile) => boolean): JSZipFile[]; + /** + * Deserialize zip file + * + * @param data Serialized zip file + * @param options Options for deserializing + * @return Returns the JSZip instance + */ + load(data: any, options: JSZipLoadOptions): JSZip; +} - /** - * Calculate crc32 of given string - * - * @param data String to calculate crc32 from - * @param crc Optional: initializer for crc calc - * @return Calculated crc32 number - */ - crc32(data: string, crc?: number): number; +interface JSZipObject { + name: string; + data: any; + options: JSZipFileOptions; - /** - * Clone JSSZip instance - * - * @return Cloned instsance - */ - clone(): JSZip; + asText(): string; + asBinary(): string; + asArrayBuffer(): ArrayBuffer; + asUint8Array(): Uint8Array; + //asNodeBuffer(): Buffer; +} - /** - * UTF8 encode a string - * - * @param data String to encode - */ - utf8encode(data: string): string; +interface JSZipFileOptions { + base64?: boolean; + binary?: boolean; + date?: Date; + compression?: string; + comment?: string; + optimizedBinaryString?: boolean; + createFolders?: boolean; +} - /** - * UTF8 decode a string - * - * @param data String to decode - */ - utf8decode(data: string): string; +interface JSZipObjectOptions { + /** deprecated */ + base64: boolean; + /** deprecated */ + binary: boolean; + /** deprecated */ + dir: boolean; + /** deprecated */ + date: Date; + compression: string; +} - } +interface JSZipGeneratorOptions { + /** deprecated */ + base64?: boolean; + /** DEFLATE or STORE */ + compression?: string; + /** base64 (default), string, uint8array, blob */ + type?: string; + comment?: string; +} - export interface JSZipSupport { - arraybuffer: boolean; - uint8array: boolean; - blob: boolean; - } +interface JSZipLoadOptions { + base64?: boolean; + checkCRC32?: boolean; + optimizedBinaryString?: boolean; + createFolders?: boolean; +} - export interface JSZipGeneratorOptions { - base64?: boolean; //deprecated - compression: string; //DEFLATE or STORE - type: string; //base64 (default), string, uint8array, blob - } - - export interface JSZipOptions { - base64: boolean; - checkCRC32: boolean; - } - - export interface JSZipFile { - name: string; - data: any; - options: JSZipFileOptions; - - asText(): string; - asBinary(): any; - asArrayBuffer(): ArrayBuffer; - asUint8Array(): Uint8Array; - } - - export interface JSZipFileOptions { - base64: boolean; - binary: boolean; - dir: boolean; - date: Date; - } - - export interface JSZipBase64 { - } +interface JSZipSupport { + arraybuffer: boolean; + uint8array: boolean; + blob: boolean; + nodebuffer: boolean; } declare var JSZip: { + /** + * Create JSZip instance + */ + (): JSZip; /** * Create JSZip instance * If no parameters given an empty zip archive will be created @@ -159,15 +150,21 @@ declare var JSZip: { * @param data Serialized zip archive * @param options Description of the serialized zip archive */ - new (data?: any, options?: jszip.JSZipOptions): jszip.JSZip; + (data: any, options?: JSZipLoadOptions): JSZip; - prototype: jszip.JSZip; - support: jszip.JSZipSupport; -} + /** + * Create JSZip instance + */ + new (): JSZip; + /** + * Create JSZip instance + * If no parameters given an empty zip archive will be created + * + * @param data Serialized zip archive + * @param options Description of the serialized zip archive + */ + new (data: any, options?: JSZipLoadOptions): JSZip; -declare var JSZipBase64: { - encode(input: string, utf8?: any): string; - decode(input: string, utf8?: any): string; - - prototype: jszip.JSZipBase64; + prototype: JSZip; + support: JSZipSupport; } \ No newline at end of file From daf8112e3c826717f28d1ca22bf7f79517d2b527 Mon Sep 17 00:00:00 2001 From: SaschaNaz Date: Thu, 23 Oct 2014 21:58:24 +0900 Subject: [PATCH 018/135] jszip: update test suite --- jszip/jszip-tests.ts | 39 ++++++++++++++++----------------------- jszip/jszip.d.ts | 6 ++++-- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/jszip/jszip-tests.ts b/jszip/jszip-tests.ts index 9222cbb5b..97fd10450 100644 --- a/jszip/jszip-tests.ts +++ b/jszip/jszip-tests.ts @@ -1,4 +1,3 @@ -/// /// var SEVERITY = { @@ -10,30 +9,29 @@ var SEVERITY = { } function testJSZip() { - var newJszip = new JSZip(); newJszip.file("test.txt", "test string"); newJszip.file("test/test.txt", "test string"); - var serializedZip = newJszip.generate({compression: "DEFLATE", type:"base64"}); + var serializedZip = newJszip.generate({compression: "DEFLATE", type: "base64"}); newJszip = new JSZip(); newJszip.load(serializedZip, {base64: true, checkCRC32: true}); - if(newJszip.file("test.txt").data === "test string") { + if (newJszip.file("test.txt").asText() === "test string") { log(SEVERITY.INFO, "all ok"); } else { log(SEVERITY.ERROR, "no matching file found"); } - if(newJszip.file("test/test.txt").data === "test string") { + if (newJszip.file("test/test.txt").asText() === "test string") { log(SEVERITY.INFO, "all ok"); } else { log(SEVERITY.ERROR, "no matching file found"); } var folder = newJszip.folder("test"); - if(folder.file("test.txt").data == "test string") { + if(folder.file("test.txt").asText() == "test string") { log(SEVERITY.INFO, "all ok"); } else { @@ -44,7 +42,7 @@ function testJSZip() { if(folders.length == 1) { log(SEVERITY.INFO, "all ok"); - if(folders[0].options.dir == true) { + if(folders[0].dir == true) { log(SEVERITY.INFO, "all ok"); } else { @@ -57,7 +55,7 @@ function testJSZip() { var files = newJszip.file(new RegExp("^test")); if(files.length == 2) { log(SEVERITY.INFO, "all ok"); - if(files[0].data == "test string" && files[1].data == "test string") { + if (files[0].asText() == "test string" && files[1].asText() == "test string") { log(SEVERITY.INFO, "all ok"); } else { @@ -68,11 +66,11 @@ function testJSZip() { log(SEVERITY.ERROR, "wrong number of files"); } - var filterFiles = newJszip.filter((relativePath: string, file: jszip.JSZipFile) => { - if(file.data == "test string") { - return true; - } - return false; + var filterFiles = newJszip.filter((relativePath: string, file: JSZipObject) => { + if (file.asText() == "test string") { + return true; + } + return false; }); if(filterFiles.length == 2) { @@ -84,11 +82,11 @@ function testJSZip() { newJszip.remove("test/test.txt"); - filterFiles = newJszip.filter((relativePath: string, file: jszip.JSZipFile) => { - if(file.data == "test string") { - return true; - } - return false; + filterFiles = newJszip.filter((relativePath: string, file: JSZipObject) => { + if (file.asText() == "test string") { + return true; + } + return false; }); if(filterFiles.length == 1) { @@ -97,11 +95,6 @@ function testJSZip() { else { log(SEVERITY.ERROR, "wrong number of files"); } - - log(SEVERITY.INFO, newJszip.crc32("Test")); - log(SEVERITY.INFO, newJszip.utf8encode("Test")); - log(SEVERITY.INFO, newJszip.utf8decode("Test")); - newJszip.clone(); } function log(severity:number, message: any) { diff --git a/jszip/jszip.d.ts b/jszip/jszip.d.ts index 399fcb9a3..038b52957 100644 --- a/jszip/jszip.d.ts +++ b/jszip/jszip.d.ts @@ -82,8 +82,10 @@ interface JSZip { interface JSZipObject { name: string; - data: any; - options: JSZipFileOptions; + dir: boolean; + date: Date; + comment: string; + options: JSZipObjectOptions; asText(): string; asBinary(): string; From bd93df164f236dd376256567118c36a8418ed6b3 Mon Sep 17 00:00:00 2001 From: satoru kimura Date: Wed, 22 Oct 2014 16:39:07 +0900 Subject: [PATCH 019/135] Added utility classes of three.js (and minor modifications). --- threejs/examples/CSS3DRenderer.d.ts | 32 +++++++++++++++++ threejs/examples/Detector.d.ts | 16 +++++++++ threejs/examples/OrbitControls.d.ts | 42 ++++++++++++++++++++++ threejs/examples/TrackballControls.d.ts | 33 +++++++++++++++++ threejs/tests/css3d/css3d_periodictable.ts | 1 - threejs/tests/examples/Detector.ts | 10 ++++++ threejs/tests/three-tests-setup.ts | 13 +++---- threejs/three-tests.ts | 2 ++ threejs/three.d.ts | 8 ++++- 9 files changed, 147 insertions(+), 10 deletions(-) create mode 100644 threejs/examples/CSS3DRenderer.d.ts create mode 100644 threejs/examples/Detector.d.ts create mode 100644 threejs/examples/OrbitControls.d.ts create mode 100644 threejs/examples/TrackballControls.d.ts create mode 100644 threejs/tests/examples/Detector.ts diff --git a/threejs/examples/CSS3DRenderer.d.ts b/threejs/examples/CSS3DRenderer.d.ts new file mode 100644 index 000000000..1d557b334 --- /dev/null +++ b/threejs/examples/CSS3DRenderer.d.ts @@ -0,0 +1,32 @@ +// Type definitions for CSS3DRenderer.js +// Project: https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CSS3DRenderer.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// This renderer does not work in IE. Can be found here for more information. +// https://github.com/mrdoob/three.js/issues/4783 + +/// + +declare module THREE { + class CSS3DObject extends Object3D { + constructor(element: any); + + element: any; + } + + class CSS3DSprite extends CSS3DObject { + constructor(element: any); + + } + + + class CSS3DRenderer { + constructor(); + + domElement:HTMLElement; + + setSize(width: number, height: number): void; + render(scene: THREE.Scene, camera: THREE.Camera): void; + } +} \ No newline at end of file diff --git a/threejs/examples/Detector.d.ts b/threejs/examples/Detector.d.ts new file mode 100644 index 000000000..b02478061 --- /dev/null +++ b/threejs/examples/Detector.d.ts @@ -0,0 +1,16 @@ +// Type definitions for Detector.js +// Project: https://github.com/mrdoob/three.js/blob/master/examples/js/Detector.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface DetectorStatic { + canvas: boolean; + webgl: boolean; + workers: boolean; + fileapi: boolean; + + getWebGLErrorMessage(): HTMLElement; + addGetWebGLMessage(parameters?: {id?: string; parent?: HTMLElement}): void; +} + +declare var Detector: DetectorStatic; diff --git a/threejs/examples/OrbitControls.d.ts b/threejs/examples/OrbitControls.d.ts new file mode 100644 index 000000000..7671489ae --- /dev/null +++ b/threejs/examples/OrbitControls.d.ts @@ -0,0 +1,42 @@ +// Type definitions for OrbitControls.js +// Project: https://github.com/mrdoob/three.js/blob/master/examples/js/controls/OrbitControls.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module THREE { + class OrbitControls { + constructor(object:Camera, domElement?:HTMLElement); + + object:Camera; + domElement:HTMLElement; + + // API + enabled: boolean; + target: THREE.Vector3; + + // deprecated + center: THREE.Vector3; + + noZoom: boolean; + zoomSpeed: number; + minDistance: number; + maxDistance: number; + noRotate: boolean; + rotateSpeed: number; + noPan: boolean; + keyPanSpeed: number; + autoRotate: boolean; + autoRotateSpeed: number; + minPolarAngle: number; + maxPolarAngle: number; + minAzimuthAngle: number; + maxAzimuthAngle: number; + noKeys: boolean; + keys: { LEFT: number; UP: number; RIGHT: number; BOTTOM: number; }; + mouseButtons: { ORBIT: MOUSE; ZOOM: MOUSE; PAN: MOUSE; }; + + update():void; + } +} \ No newline at end of file diff --git a/threejs/examples/TrackballControls.d.ts b/threejs/examples/TrackballControls.d.ts new file mode 100644 index 000000000..33d69011d --- /dev/null +++ b/threejs/examples/TrackballControls.d.ts @@ -0,0 +1,33 @@ +// Type definitions for TrackballControls.js +// Project: https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module THREE { + class TrackballControls { + constructor(object:Camera, domElement?:HTMLElement); + + object:Camera; + domElement:HTMLElement; + + // API + enabled:boolean; + screen:{ left: number; top: number; width: number; height: number }; + rotateSpeed:number; + zoomSpeed:number; + panSpeed:number; + noRotate:boolean; + noZoom:boolean; + noPan:boolean; + noRoll:boolean; + staticMoving:boolean; + dynamicDampingFactor:number; + minDistance:number; + maxDistance:number; + keys:number[]; + + update():void; + } +} \ No newline at end of file diff --git a/threejs/tests/css3d/css3d_periodictable.ts b/threejs/tests/css3d/css3d_periodictable.ts index 6ce32c42f..2f304dac0 100644 --- a/threejs/tests/css3d/css3d_periodictable.ts +++ b/threejs/tests/css3d/css3d_periodictable.ts @@ -247,7 +247,6 @@ } // - renderer = new THREE.CSS3DRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); renderer.domElement.style.position = 'absolute'; diff --git a/threejs/tests/examples/Detector.ts b/threejs/tests/examples/Detector.ts new file mode 100644 index 000000000..0f30fdd31 --- /dev/null +++ b/threejs/tests/examples/Detector.ts @@ -0,0 +1,10 @@ +/// +/// + + +() => { + if ( !Detector.canvas || !Detector.webgl || !Detector.workers || !Detector.fileapi ){ + var errorElement = Detector.getWebGLErrorMessage(); + Detector.addGetWebGLMessage(); + } +} \ No newline at end of file diff --git a/threejs/tests/three-tests-setup.ts b/threejs/tests/three-tests-setup.ts index 33b36098b..af594582f 100644 --- a/threejs/tests/three-tests-setup.ts +++ b/threejs/tests/three-tests-setup.ts @@ -2,20 +2,18 @@ // https://github.com/mrdoob/three.js/tree/master/examples ////////////////////////////////////////////////////////////// -declare var Stats: any; -declare var Detector: any; +/// +/// +/// +/// +/// declare module THREE { var AWDLoader: any; - var CSS3DSprite: any; - var CSS3DRenderer: any; - var CSS3DObject: any; var DotScreenShader: any; - var TrackballControls: any; var FlyControls: any; var RenderPass: any; var EffectComposer: any; - var OrbitControls: any; var RGBShiftShader: any; var RenderPass: any; var BloomPass: any; @@ -23,4 +21,3 @@ declare module THREE { var FXAAShader: any; var CopyShader: any; } - diff --git a/threejs/three-tests.ts b/threejs/three-tests.ts index 46a563a6d..c99f08f23 100644 --- a/threejs/three-tests.ts +++ b/threejs/three-tests.ts @@ -57,3 +57,5 @@ THE SOFTWARE. /// /// +// examples test. +/// diff --git a/threejs/three.d.ts b/threejs/three.d.ts index 7a2ee5ede..f114cd958 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -8,6 +8,12 @@ interface WebGLRenderingContext {} declare module THREE { export var REVISION: string; + // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button + export enum MOUSE { } + export var LEFT: MOUSE; + export var MIDDLE: MOUSE; + export var RIGHT: MOUSE; + // GL STATE CONSTANTS export enum CullFace { } export var CullFaceNone: CullFace; @@ -923,7 +929,7 @@ declare module THREE { */ dispose(): void; - //These properties does not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added. + //These properties do not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added. bones: Bone[]; animation: AnimationData; animations: AnimationData[]; From ad6ef710f19e428019c90542b858d96b4ec212ec Mon Sep 17 00:00:00 2001 From: jimmejardine Date: Fri, 24 Oct 2014 17:02:52 +0100 Subject: [PATCH 020/135] Improved return type of getTextContent(): Created TextContent interface --- pdf/pdf.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pdf/pdf.d.ts b/pdf/pdf.d.ts index 94733c3e3..8496a6c40 100644 --- a/pdf/pdf.d.ts +++ b/pdf/pdf.d.ts @@ -255,7 +255,7 @@ interface PDFPageProxy { /** * A promise that is resolved with the string that is the text content frm the page. **/ - getTextContext(): PDFPromise; + getTextContent(): PDFPromise; /** * marked as future feature @@ -268,6 +268,20 @@ interface PDFPageProxy { destroy(): void; } +interface TextContentItem { + str: string; + transform: number[]; // [0..5] 4=x, 5=y + width: number; + height: number; + dir: string; // Left-to-right (ltr), etc + fontName: string; // A lookup into the styles map of the owning TextContent +} + +interface TextContent { + items: TextContentItem[]; + styles: any; +} + /** * A PDF document and page is built of many objects. E.g. there are objects for fonts, images, rendering code and such. These objects might get processed inside of a worker. The `PDFObjects` implements some basic functions to manage these objects. **/ From fe09ccfd68e9fcab455b584e5b2d82f40cd95ae4 Mon Sep 17 00:00:00 2001 From: Seon-Wook Park Date: Sat, 25 Oct 2014 02:32:13 +0200 Subject: [PATCH 021/135] Add visionmedia/debug, a tiny npm package for debugging --- debug/debug-tests.ts | 20 ++++++++++++++++++++ debug/debug.d.ts | 30 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 debug/debug-tests.ts create mode 100644 debug/debug.d.ts diff --git a/debug/debug-tests.ts b/debug/debug-tests.ts new file mode 100644 index 000000000..63a0a3ac4 --- /dev/null +++ b/debug/debug-tests.ts @@ -0,0 +1,20 @@ +/// +/// + +import debug = require("debug"); + +debug.disable(); +debug.enable("DefinitelyTyped:*"); + +var log: debug.Debugger = debug("DefinitelyTyped:log"); + +log("Just text"); +log("Formatted test (%d arg)", 1); +log("Formatted %s (%d args)", "test", 2); + +log("Enabled?: %s", debug.enabled("DefinitelyTyped:log")); +log("Namespace: %s", log.namespace); + +var error: debug.Debugger = debug("DefinitelyTyped:error"); +error.log = console.error.bind(console); +error("This should be printed to stderr"); diff --git a/debug/debug.d.ts b/debug/debug.d.ts new file mode 100644 index 000000000..1a71725a8 --- /dev/null +++ b/debug/debug.d.ts @@ -0,0 +1,30 @@ +// Type definitions for debug +// Project: https://github.com/visionmedia/debug +// Definitions by: Seon-Wook Park +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "debug" { + + function d(namespace: string): d.Debugger; + + module d { + export var log: Function; + + function enable(namespaces: string): void; + function disable(): void; + + function enabled(namespace: string): boolean; + + export interface Debugger { + (formatter: any, ...args: any[]): void; + + enabled: boolean; + log: Function; + namespace: string; + } + } + + export = d; + +} + From 3fd8df8c07b007567dc8b53731e273107e8e18d0 Mon Sep 17 00:00:00 2001 From: Seon-Wook Park Date: Sat, 25 Oct 2014 02:35:20 +0200 Subject: [PATCH 022/135] Add package debug to CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 84f0c9190..c0bbb6e20 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -67,6 +67,7 @@ All definitions files include a header with the author and editors, so at some p * [Crossfilter](https://github.com/square/crossfilter) (by [Schmulik Raskin](https://github.com/schmuli)) * [crypto-js](https://code.google.com/p/crypto-js/) (by [Gia Bảo @ Sân Đình](https://github.com/giabao)). @see [cryptojs.d.ts repo](https://github.com/giabao/cryptojs.d.ts) * [d3.js](http://d3js.org/) (from TypeScript samples) +* [debug](https://github.com/visionmedia/debug) (by [Seon-Wook Park](https://github.com/swook)) * [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) (by [Maksim Kozhukh](http://github.com/mkozhukh)) * [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) (by [Maksim Kozhukh](http://github.com/mkozhukh)) * [diff](https://github.com/kpdecker/jsdiff) (by [vvakame](http://github.com/vvakame)) From 266b7f00b7f6b544e6d99dbb08311cdd6e14237b Mon Sep 17 00:00:00 2001 From: Thomas Dall'Agnese Date: Sat, 25 Oct 2014 13:14:36 +0900 Subject: [PATCH 023/135] Add "has" in the LanguageChains "has" is the same as "have" but makes the sentences more "natural". Added it in the LanguageChains to make WebStorm recognise it. --- chai/chai.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/chai/chai.d.ts b/chai/chai.d.ts index fc767c639..a2ef1379b 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -94,6 +94,7 @@ declare module chai { that: Expect; and: Expect; have: Expect; + has: Expect; with: Expect; at: Expect; of: Expect; From d37305a75c4777f5388632b9f626b35276e8af6e Mon Sep 17 00:00:00 2001 From: Shinya Ohira Date: Sun, 26 Oct 2014 23:53:24 +0900 Subject: [PATCH 024/135] Add register definition to hapi --- hapi/hapi-tests.ts | 20 ++++++++++++++++++++ hapi/hapi.d.ts | 1 + 2 files changed, 21 insertions(+) diff --git a/hapi/hapi-tests.ts b/hapi/hapi-tests.ts index fcc870af6..da28b97a3 100644 --- a/hapi/hapi-tests.ts +++ b/hapi/hapi-tests.ts @@ -5,6 +5,26 @@ import Hapi = require('hapi'); // Create a server with a host and port var server = Hapi.createServer('localhost', 8000); +// Add plugins +var plugin: any = { + register: function (plugin: Object, options: Object, next: Function) { + next(); + } +}; + +plugin.register.attributes = { + name: 'test', + version: '1.0.0' +}; + +server.pack.register(plugin, (err: Object) => { + if (err) { throw err; } +}); + +server.pack.register([plugin], (err: Object) => { + if (err) { throw err; } +}); + // Add the route server.route({ method: 'GET', diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index 6276c8765..09453737a 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -103,6 +103,7 @@ declare module Hapi { export class Pack { require(name: string, options: {}, callback: Function): void; + register(plugins: any, options?: Object, callback?: Function, state?: Object): void; } export interface ServerView { From 1599c00cba857aca23b725c669103c7d935c8a8b Mon Sep 17 00:00:00 2001 From: Suwato Date: Mon, 27 Oct 2014 10:30:28 +0900 Subject: [PATCH 025/135] add-angular-notify.d.ts --- CONTRIBUTORS.md | 1 + angular-notify/angular-notify-tests.ts | 31 +++++++ angular-notify/angular-notify.d.ts | 116 +++++++++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 angular-notify/angular-notify-tests.ts create mode 100644 angular-notify/angular-notify.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 84f0c9190..33405d0b2 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -19,6 +19,7 @@ All definitions files include a header with the author and editors, so at some p * [Angular Hotkeys](https://github.com/chieffancypants/angular-hotkeys/) (by [Jason Zhao](https://github.com/jlz27)) * [angular-http-auth](https://github.com/witoldsz/angular-http-auth) (by [vvakame](https://github.com/vvakame)) * [Angular Protractor](https://github.com/angular/protractor) (by [Bill Armstrong](https://github.com/BillArmstrong)) +* [Angular notify](https://github.com/cgross/angular-notify) (by [Suwato](https://github.com/Suwato)) * [Angular Translate](http://pascalprecht.github.io/angular-translate/) (by [Michel Salib](https://github.com/michelsalib)) * [Angular UI Bootstrap](http://angular-ui.github.io/bootstrap) (by [Brian Surowiec](https://github.com/xt0rted)) * [any-db](https://github.com/grncdr/node-any-db) (by [Rogier Schouten](https://github.com/rogier-schouten)) diff --git a/angular-notify/angular-notify-tests.ts b/angular-notify/angular-notify-tests.ts new file mode 100644 index 000000000..d5e52b1d1 --- /dev/null +++ b/angular-notify/angular-notify-tests.ts @@ -0,0 +1,31 @@ +/// + +var myapp = angular.module("myapp", ["cgNotify"]); + +myapp.controller("MyController", ["$scope", "cgNotify", + function ($scope:ng.IScope, notify:ng.cgNotify.INotifyService) { // <-- Inject notify + + var notifyObj = notify("Your notification message"); // <-- Call notify with your message + notifyObj.close(); + + notify.config({ + startTop: 10, + verticalSpacing: 15, + duration: 10000, + templateUrl: "angular-notify.html", + position: "center", + container: document.body + }); + + notify( { + message: "My message", + templateUrl: "my_template.html", + position: "center", + container: document.body, + classes: "", // <-- CSS class names + $scope: $scope + }); // <-- Call notify with your message + option + + notify.closeAll(); + } +]); \ No newline at end of file diff --git a/angular-notify/angular-notify.d.ts b/angular-notify/angular-notify.d.ts new file mode 100644 index 000000000..bbb7c1e6b --- /dev/null +++ b/angular-notify/angular-notify.d.ts @@ -0,0 +1,116 @@ +// Type definitions for angular-notify 2.0.2 +// Project: https://github.com/cgross/angular-notify +// Definitions by: Suwato +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module ng.cgNotify { + + interface INotifyService { + + /** + * The notify function can either be passed a string or an object. + * This function will return an object with a close() method and a message property. + * @param message + */ + (message:string):INotify; + + /** + * When passing an object, the object parameters can be: + * @param option + */ + (option:{ + /** + * Required. The message to show. + */ + message : string; + + /** + * Optional. A custom template for the UI of the message. + */ + templateUrl? : string; + + /** + * Optional. A list of custom CSS classes to apply to the message element. + */ + classes? : string; + + /** + * Optional. A string containing any valid Angular HTML which will be shown instead of the regular message text. + * The string must contain one root element like all valid Angular HTML templates (so wrap everything in a ). + */ + messageTemplate? : string; + + /** + * Optional. A valid Angular scope object. The scope of the template will be created by calling $new() on this scope. + */ + $scope? : ng.IScope; + + /** + * Optional. Currently center and right are the only acceptable values. + */ + position? : string; + + /** + * Optional. Element that contains each notification. Defaults to document.body. + */ + container? : any; + }):INotify; + + + /** + * Call config to set the default configuration options for angular-notify. + * The following options may be specified in the given object: + * @param option + */ + config(option:{ + /** + * The default duration (in milliseconds) of each message. A duration of 0 will prevent messages from closing automatically. + */ + duration? : number; + + /** + * The Y pixel value where messages will be shown. + */ + startTop? : number; + + /** + * The number of pixels that should be reserved between messages vertically. + */ + verticalSpacing? : number; + + /** + * The default message template. + */ + templateUrl? : string; + + /** + * The default position of each message. Currently only center and right are the supported values. + */ + position? : string; + + /** + * The default element that contains each notification. Defaults to document.body. + */ + container? : any; + }):void; + + /** + * Closes all currently open notifications. + */ + closeAll():void; + } + + interface INotify{ + /** + * The message to show. + */ + message:string; + + /** + * Close this open notifications. + */ + close():void; + } +} \ No newline at end of file From 0efa290ca632196325008c96603fb5d9abccbc5c Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 27 Oct 2014 11:22:46 +0900 Subject: [PATCH 026/135] update angular.d.ts --- angularjs/angular-tests.ts | 6 ++++++ angularjs/angular.d.ts | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index ad1eef90c..e4f6d35ba 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -250,6 +250,12 @@ httpFoo.then((x) => { x.toFixed(); }); +httpFoo.success((data, status, headers, config) => { + var h = headers("test"); + h.charAt(0); + var hs = headers(); + hs.concat(["test"]); +}); function test_angular_forEach() { var values: { [key: string]: string } = { name: 'misko', gender: 'male' }; diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 199a67557..47f1e83d1 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1200,8 +1200,13 @@ declare module ng { url: string; } + interface IHttpHeadersGetter { + (): { [name: string]: string; }; + (headerName: string): string; + } + interface IHttpPromiseCallback { - (data: T, status: number, headers: (headerName?: string) => string, config: IRequestConfig): void; + (data: T, status: number, headers: IHttpHeadersGetter, config: IRequestConfig): void; } interface IHttpPromiseCallbackArg { From 7252edb0ec1a0ddcc7b8d320b4d73ab8f4b0fb93 Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 27 Oct 2014 11:26:08 +0900 Subject: [PATCH 027/135] fix broken test --- angularjs/angular-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index e4f6d35ba..7adb0bab0 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -254,7 +254,7 @@ httpFoo.success((data, status, headers, config) => { var h = headers("test"); h.charAt(0); var hs = headers(); - hs.concat(["test"]); + hs["content-type"].charAt(1); }); function test_angular_forEach() { From 796f857dcbdf46f2a5ba5b367d608cff4e48bbff Mon Sep 17 00:00:00 2001 From: Keisuke Oohashi Date: Mon, 27 Oct 2014 11:46:19 +0900 Subject: [PATCH 028/135] Rename module, directory and filename to follow CONTRIBUTING.md --- notify.js/notify.js-tests.ts => notifyjs/notifyjs-tests.ts | 2 +- notify.js/notify.js.d.ts => notifyjs/notifyjs.d.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename notify.js/notify.js-tests.ts => notifyjs/notifyjs-tests.ts (96%) rename notify.js/notify.js.d.ts => notifyjs/notifyjs.d.ts (96%) diff --git a/notify.js/notify.js-tests.ts b/notifyjs/notifyjs-tests.ts similarity index 96% rename from notify.js/notify.js-tests.ts rename to notifyjs/notifyjs-tests.ts index 7652a0a91..8771224c8 100644 --- a/notify.js/notify.js-tests.ts +++ b/notifyjs/notifyjs-tests.ts @@ -1,4 +1,4 @@ -/// +/// function test_Notify_constructor() { //Min diff --git a/notify.js/notify.js.d.ts b/notifyjs/notifyjs.d.ts similarity index 96% rename from notify.js/notify.js.d.ts rename to notifyjs/notifyjs.d.ts index 651b91ac5..f36b8fbcd 100644 --- a/notify.js/notify.js.d.ts +++ b/notifyjs/notifyjs.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare var Notify: { - new (title : string , options? : notify.INotifyOption): notify.INotify; + new (title : string , options? : notifyjs.INotifyOption): notifyjs.INotify; /** * Check is permission is needed for the user to receive notifications. @@ -26,7 +26,7 @@ declare var Notify: { isSupported() : boolean; } -declare module notify { +declare module notifyjs { /** * Interface for Web Notifications API Wrapper. From b5f13fa66c871faeba09806bd2b39f8c61a8cc9f Mon Sep 17 00:00:00 2001 From: Michael Kourlas Date: Sun, 26 Oct 2014 23:03:34 -0400 Subject: [PATCH 029/135] Change window.plugins type to interface Change the type of window.plugins from an object literal specific to Push.d.ts to an interface called Plugins, which can be modified by other code. --- cordova/plugins/Push.d.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cordova/plugins/Push.d.ts b/cordova/plugins/Push.d.ts index 9b6623486..2415aa419 100644 --- a/cordova/plugins/Push.d.ts +++ b/cordova/plugins/Push.d.ts @@ -7,14 +7,16 @@ // Licensed under the MIT license. interface Window { - plugins: { - /** - * This plugin allows to receive push notifications. The Android implementation uses - * Google's GCM (Google Cloud Messaging) service, - * whereas the iOS version is based on Apple APNS Notifications - */ - pushNotification: PushNotification - } + plugins: Plugins +} + +interface Plugins { + /** + * This plugin allows to receive push notifications. The Android implementation uses + * Google's GCM (Google Cloud Messaging) service, + * whereas the iOS version is based on Apple APNS Notifications + */ + pushNotification: PushNotification } /** From 1c3f72ebf06767b2cea469579f218812ca9104c8 Mon Sep 17 00:00:00 2001 From: satoru kimura Date: Mon, 27 Oct 2014 15:49:37 +0900 Subject: [PATCH 030/135] Changed the module name to fit the npm package. --- dat.gui/dat.gui-tests.ts => dat-gui/dat-gui-tests.ts | 2 +- .../dat-gui-tests.ts.tscparams | 0 dat.gui/dat.gui.d.ts => dat-gui/dat-gui.d.ts | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename dat.gui/dat.gui-tests.ts => dat-gui/dat-gui-tests.ts (99%) rename dat.gui/dat.gui-tests.ts.tscparams => dat-gui/dat-gui-tests.ts.tscparams (100%) rename dat.gui/dat.gui.d.ts => dat-gui/dat-gui.d.ts (100%) diff --git a/dat.gui/dat.gui-tests.ts b/dat-gui/dat-gui-tests.ts similarity index 99% rename from dat.gui/dat.gui-tests.ts rename to dat-gui/dat-gui-tests.ts index fc3bf5de7..cd71e2471 100644 --- a/dat.gui/dat.gui-tests.ts +++ b/dat-gui/dat-gui-tests.ts @@ -2,7 +2,7 @@ // http://workshop.chromeexperiments.com/examples/gui/ ////////////////////////////////////////////////////////////// -/// +/// // ------------ config diff --git a/dat.gui/dat.gui-tests.ts.tscparams b/dat-gui/dat-gui-tests.ts.tscparams similarity index 100% rename from dat.gui/dat.gui-tests.ts.tscparams rename to dat-gui/dat-gui-tests.ts.tscparams diff --git a/dat.gui/dat.gui.d.ts b/dat-gui/dat-gui.d.ts similarity index 100% rename from dat.gui/dat.gui.d.ts rename to dat-gui/dat-gui.d.ts From 67469b12e480f8e1df580dd82c993f14e0c087ac Mon Sep 17 00:00:00 2001 From: error Date: Mon, 27 Oct 2014 10:31:35 -0500 Subject: [PATCH 031/135] remove cast method --- es6-promise/es6-promise-commonjs-tests.ts | 6 ------ es6-promise/es6-promise-tests.ts | 6 ------ es6-promise/es6-promise.d.ts | 12 +----------- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/es6-promise/es6-promise-commonjs-tests.ts b/es6-promise/es6-promise-commonjs-tests.ts index 4bcb4d057..b5a2fcbe4 100644 --- a/es6-promise/es6-promise-commonjs-tests.ts +++ b/es6-promise/es6-promise-commonjs-tests.ts @@ -22,12 +22,6 @@ var constructResult1 = new Promise((resolve: (promise: Thenable) }); promiseString = constructResult1; -//cast test -var castResult = Promise.cast('a string'); -promiseString = castResult; -var castResult1 = Promise.cast(Promise.resolve('a string')); -promiseString = castResult1; - //resolve test var resolveResult = Promise.resolve('a string'); promiseString = resolveResult; diff --git a/es6-promise/es6-promise-tests.ts b/es6-promise/es6-promise-tests.ts index 402328eb5..3bf5d3707 100644 --- a/es6-promise/es6-promise-tests.ts +++ b/es6-promise/es6-promise-tests.ts @@ -20,12 +20,6 @@ var constructResult1 = new Promise((resolve:(promise: Thenable) }); promiseString = constructResult1; -//cast test -var castResult = Promise.cast('a string'); -promiseString = castResult; -var castResult1 = Promise.cast(Promise.resolve('a string')); -promiseString = castResult1; - //resolve test var resolveResult = Promise.resolve('a string'); promiseString = resolveResult; diff --git a/es6-promise/es6-promise.d.ts b/es6-promise/es6-promise.d.ts index 9bb8d79f2..c71f7daca 100644 --- a/es6-promise/es6-promise.d.ts +++ b/es6-promise/es6-promise.d.ts @@ -118,23 +118,13 @@ declare class Promise implements Thenable { } declare module Promise { - /** - * Returns promise (only if promise.constructor == Promise) - */ - function cast(promise: Promise): Promise; - /** - * Make a promise that fulfills to obj. - */ - function cast(object: R): Promise; - /** * Make a new promise from the thenable. * A thenable is promise-like in as far as it has a "then" method. - * This also creates a new promise if you pass it a genuine JavaScript promise, making it less efficient for casting than Promise.cast. */ function resolve(thenable?: Thenable): Promise; /** - * Make a promise that fulfills to obj. Same as Promise.cast(obj) in this situation. + * Make a promise that fulfills to obj. */ function resolve(object?: R): Promise; From 1036916639cc4b646fac4a7202f28347dfb299b3 Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Tue, 28 Oct 2014 02:53:19 +0900 Subject: [PATCH 032/135] Fix --noImplicitAny error --- knockout.es5/knockout.es5-tests.ts | 2 +- knockout.es5/knockout.es5.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/knockout.es5/knockout.es5-tests.ts b/knockout.es5/knockout.es5-tests.ts index c51b9bc9d..f35ea44b8 100644 --- a/knockout.es5/knockout.es5-tests.ts +++ b/knockout.es5/knockout.es5-tests.ts @@ -5,7 +5,7 @@ var empty = {}, observable = ko.observable(123), computed = ko.computed(function () { return observable() + 1; }), model = { prop: 100 }, - notifiedValues = []; + notifiedValues: any[] = []; // Basic properties diff --git a/knockout.es5/knockout.es5.d.ts b/knockout.es5/knockout.es5.d.ts index 651d7d40f..6eb210a20 100644 --- a/knockout.es5/knockout.es5.d.ts +++ b/knockout.es5/knockout.es5.d.ts @@ -19,7 +19,7 @@ interface KnockoutDefinePropertyOptions { } interface Array { - remove(item): T[]; + remove(item: T): T[]; removeAll(items: T[]): T[]; removeAll(): T[]; From 431e440847cb048ac203794e1283cfca58f95add Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Tue, 28 Oct 2014 04:00:43 +0900 Subject: [PATCH 033/135] Add knockout-secure-binding.d.ts --- .../knockout-secure-binding-test.ts | 23 ++++++++++++++ .../knockout-secure-binding.d.ts | 31 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 knockout-secure-binding/knockout-secure-binding-test.ts create mode 100644 knockout-secure-binding/knockout-secure-binding.d.ts diff --git a/knockout-secure-binding/knockout-secure-binding-test.ts b/knockout-secure-binding/knockout-secure-binding-test.ts new file mode 100644 index 000000000..1420a24f1 --- /dev/null +++ b/knockout-secure-binding/knockout-secure-binding-test.ts @@ -0,0 +1,23 @@ +/// + +// knockout-secure-binding +// The MIT License(MIT) +// Copyright(c) 2013 Brian M Hunt +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +import ksp = require('knockout-secure-binding'); + +function testt(): void { + // https://github.com/brianmhunt/knockout-secure-binding + var options = { + attribute: "data-bind", // default "data-sbind" + globals: window, // default {} + bindings: ko.bindingHandlers, // default ko.bindingHandlers + noVirtualElements: false // default true + }; + + ko.bindingProvider.instance = new ko.secureBindingsProvider(options); + ko.bindingProvider.instance = new ksp(options); +} \ No newline at end of file diff --git a/knockout-secure-binding/knockout-secure-binding.d.ts b/knockout-secure-binding/knockout-secure-binding.d.ts new file mode 100644 index 000000000..2ae571a2a --- /dev/null +++ b/knockout-secure-binding/knockout-secure-binding.d.ts @@ -0,0 +1,31 @@ +// Type definitions for knockout-secure-binding +// Project: https://github.com/brianmhunt/knockout-secure-binding +// Definitions by: Pine Mizune +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface KnockoutSecureBindingOptions { + attribute?: string; + globals?: any; + bindings?: KnockoutBindingHandlers; + noVirtualElements?: boolean; +} + +interface KnockoutSecureBindingProvider extends KnockoutBindingProvider { + new (options?: KnockoutSecureBindingOptions): KnockoutBindingProvider; +} + +interface KnockoutStatic { + secureBindingsProvider: { + new (options?: KnockoutSecureBindingOptions): KnockoutBindingProvider; + }; +} + +declare module "knockout-secure-binding" { + var klass: { + new (options?: KnockoutSecureBindingOptions): KnockoutBindingProvider; + }; + + export = klass; +} \ No newline at end of file From 70d7fc3befbfaf0b6ee3ee8c6ba36b28ef6970e5 Mon Sep 17 00:00:00 2001 From: Chintan Shah Date: Tue, 28 Oct 2014 01:11:57 +0530 Subject: [PATCH 034/135] Added svg-pan-zoom typings and their test file. Updated CONTRIBUTORS.md. --- CONTRIBUTORS.md | 1 + svg-pan-zoom/svg-pan-zoom-test.ts | 77 +++++++++++++++ svg-pan-zoom/svg-pan-zoom.d.ts | 151 ++++++++++++++++++++++++++++++ 3 files changed, 229 insertions(+) create mode 100644 svg-pan-zoom/svg-pan-zoom-test.ts create mode 100644 svg-pan-zoom/svg-pan-zoom.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 52c592cc3..ab6984db6 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -382,6 +382,7 @@ All definitions files include a header with the author and editors, so at some p * [Store.js](https://github.com/marcuswestin/store.js/) (by [Vincent Bortone](https://github.com/vbortone)) * [stylus](https://github.com/LearnBoost/stylus) (by [Maxime LUCE](https://github.com/SomaticIT)) * [Sugar](http://sugarjs.com/) (by [Josh Baldwin](https://github.com/jbaldwin/)) +* [svg-pan-zoom] (https://github.com/ariutta/svg-pan-zoom) (by [Chintan Shah] (https://github.com/Promact)) * [swfobject](https://code.google.com/p/swfobject/) (by [rou](https://github.com/rou)) * [Swiper](http://www.idangero.us/sliders/swiper) (by [Sebastián Galiano](https://github.com/sgaliano)) * [SwipeView](http://cubiq.org/swipeview) (by [Boris Yankov](https://github.com/borisyankov)) diff --git a/svg-pan-zoom/svg-pan-zoom-test.ts b/svg-pan-zoom/svg-pan-zoom-test.ts new file mode 100644 index 000000000..2cb34b7c5 --- /dev/null +++ b/svg-pan-zoom/svg-pan-zoom-test.ts @@ -0,0 +1,77 @@ +/// + +var svgPanZoomOptions : SvgPanZoom.OptionConfig = { + panEnabled: true // enable or disable panning (default enabled) + , controlIconsEnabled: false // insert icons to give user an option in addition to mouse events to control pan/zoom (default disabled) + , zoomEnabled: true // enable or disable zooming (default enabled) + , dblClickZoomEnabled: true // enable or disable zooming by double clicking (default enabled) + , zoomScaleSensitivity: 0.2 // Zoom sensitivity + , minZoom: 0.5 // Minimum Zoom level + , maxZoom: 10 // Maximum Zoom level + , fit: true // enable or disable viewport fit in SVG (default true) + , center: true // enable or disable viewport centering in SVG (default true) + , beforeZoom: null + , onZoom: function(){} + , beforePan: null + , onPan: function(){} + , refreshRate: 60 // in hz +}; + +var panZoomTiger: SvgPanZoom.ISvgPanZoom = svgPanZoom('#demo-tiger'); + +var svgElement = document.querySelector('#demo-tiger'); +panZoomTiger = svgPanZoom(svgElement); + +panZoomTiger = svgPanZoom('#demo-tiger', { + panEnabled: true + , controlIconsEnabled: false + , zoomEnabled: true + , dblClickZoomEnabled: true + , zoomScaleSensitivity: 0.2 + , minZoom: 0.5 + , maxZoom: 10 + , fit: true + , center: true + , refreshRate: 'auto' + , beforeZoom: function(){} + , onZoom: function(){} + , beforePan: function(){} + , onPan: function(){} +}); + +// Pan to rendered point x = 50, y = 50 +panZoomTiger.pan({x: 50, y: 50}); + +// Pan by x = 50, y = 50 of rendered pixels +panZoomTiger.panBy({x: 50, y: 50}); + +// Set zoom level to 2 +panZoomTiger.zoom(2); + +// Zoom by 130% +panZoomTiger.zoomBy(1.3); + +// Set zoom level to 2 at point +panZoomTiger.zoomAtPoint(2, {x: 50, y: 50}); + +// Zoom by 130% at point +panZoomTiger.zoomAtPointBy(1.3, {x: 50, y: 50}); + +panZoomTiger.zoomIn(); +panZoomTiger.zoomOut(); +panZoomTiger.resetZoom(); + +panZoomTiger.enablePan(); +panZoomTiger.disablePan(); + +panZoomTiger.enableZoom(); +panZoomTiger.disableZoom(); + +panZoomTiger.fit(); +panZoomTiger.center(); + +panZoomTiger.resize(); // update SVG cached size and controls positions +panZoomTiger.fit(true); // dropCache and fit +panZoomTiger.center(true); // dropCache and center + +delete panZoomTiger; \ No newline at end of file diff --git a/svg-pan-zoom/svg-pan-zoom.d.ts b/svg-pan-zoom/svg-pan-zoom.d.ts new file mode 100644 index 000000000..75f223d7e --- /dev/null +++ b/svg-pan-zoom/svg-pan-zoom.d.ts @@ -0,0 +1,151 @@ +// Type definitions for svg-pan-zoom v2.3.9 +// Project: https://github.com/ariutta/svg-pan-zoom +// Definitions by: Chintan Shah +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module SvgPanZoom { + + interface OptionConfig { + panEnabled?: boolean; // enable or disable panning (default enabled) + controlIconsEnabled?: boolean; // insert icons to give user an option in addition to mouse events to control pan/zoom (default disabled) + zoomEnabled?: boolean; // enable or disable zooming (default enabled) + dblClickZoomEnabled?: boolean; // enable or disable zooming by double clicking (default enabled) + zoomScaleSensitivity?: number; // Zoom sensitivity + minZoom?: number; // Minimum Zoom level + maxZoom?: number; // Maximum Zoom level + fit?: boolean; // enable or disable viewport fit in SVG (default true) + center?: boolean; // enable or disable viewport centering in SVG (default true) + beforeZoom?: (scale:number) => void; + onZoom?: (scale:number) => void; + beforePan?: (point:IPoint) => void; + onPan?: (point:IPoint) => void; + refreshRate?: any; // in hz + } + + interface IPoint { + x: number; + y: number; + } + + interface ISvgPanZoom { + /** + * Creates a new SvgPanZoom instance with given element selector. + * + * @param svg selector of the tag on which it is to be applied. + * @param options provides customization options at the initialization of the object. + */ + (svg:any, options?:OptionConfig): ISvgPanZoom; + + /** + * Enables Panning on svg element + */ + enablePan(): void; + + /** + * Disables panning on svg element + */ + disablePan(): void; + + /** + * Checks if Panning is enabled or not + * @return true or false based on panning settings + */ + isPanEnabled(): boolean; + + + setBeforePan(fn: (point:IPoint)=> void): void; + + setOnPan(fn: (point:IPoint)=> void): void; + + enableZoom(): void; + + disableZoom(): void; + + isZoomEnabled(): boolean; + + enableControlIcons(): void; + + disableControlIcons(): void; + + isControlIconsEnabled(): boolean; + + enableDblClickZoom(): void; + + disableDblClickZoom(): void; + + setZoomScaleSensitivity(scale: number): void; + + setMinZoom(zoom: number): void; + + setMaxZoom(zoom: number): void; + + setBeforeZoom(fn: (scale: number) => void): void; + + setOnZoom(fn: (scale: number) => void): void; + + zoom(scale: number):void; + + zoomIn(): void; + + zoomOut(): void; + + zoomBy(scale: number): void; + + resetZoom(): void; + + /** + * Get zoom scale/level + * + * @return {float} zoom scale + */ + getZoom(): number; + + /** + * Adjust viewport size (only) so it will fit in SVG + * Does not center image + * + * @param {bool} dropCache drop viewBox cache and recalculate SVG's viewport sizes. Default false + */ + fit(dropCache?: boolean): void; + + /** + * Adjust viewport pan (only) so it will be centered in SVG + * Does not zoom/fit image + * + * @param {bool} dropCache drop viewBox cache and recalculate SVG's viewport sizes. Default false + */ + center(dropCache?: boolean): void; + + /** + * Recalculates cached svg dimensions and controls position + */ + resize(): void; + + /** + * Pan to a rendered position + * + * @param {object} point {x: 0, y: 0} + */ + pan(point: IPoint): void; + + /** + * Relatively pan the graph by a specified rendered position vector + * + * @param {object} point {x: 0, y: 0} + */ + panBy(point: IPoint): void; + + /** + * Get pan vector + * + * @return {object} {x: 0, y: 0} + */ + getPan(): IPoint; + + zoomAtPoint(scale:number, point:IPoint): boolean; + + zoomAtPointBy(scale:number, point:IPoint): boolean; + } +} + +declare var svgPanZoom:SvgPanZoom.ISvgPanZoom; \ No newline at end of file From ca4d1a714c5723920063788f712f194cb2548fbc Mon Sep 17 00:00:00 2001 From: David Morgantini Date: Mon, 27 Oct 2014 21:08:16 +0000 Subject: [PATCH 035/135] upgrade to q v 1.0.1 --- q/Q.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/q/Q.d.ts b/q/Q.d.ts index 1352115e3..3e7371ead 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -331,8 +331,8 @@ declare module Q { */ export function reject(reason?: any): Promise; - export function promise(resolver: (resolve: (val: IPromise) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise; - export function promise(resolver: (resolve: (val: T) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise; + export function Promise(resolver: (resolve: (val: IPromise) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise; + export function Promise(resolver: (resolve: (val: T) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise; /** * Creates a new version of func that accepts any combination of promise and non-promise values, converting them to their fulfillment values before calling the original func. The returned version also always returns a promise: if func does a return or throw, then Q.promised(func) will return fulfilled or rejected promise, respectively. From d23701f380e72798edf98914be759fd8bcd6e693 Mon Sep 17 00:00:00 2001 From: Genady Sergeev Date: Wed, 29 Oct 2014 11:33:55 +0200 Subject: [PATCH 036/135] Added get_element and get/set_id properties. --- microsoft-ajax/microsoft.ajax.d.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/microsoft-ajax/microsoft.ajax.d.ts b/microsoft-ajax/microsoft.ajax.d.ts index 7dc9ccd60..aaec9efdf 100644 --- a/microsoft-ajax/microsoft.ajax.d.ts +++ b/microsoft-ajax/microsoft.ajax.d.ts @@ -3121,6 +3121,33 @@ declare module Sys { */ toggleCssClass(className: string): void; + //#endregion + + //#region Properties + + /** + * Gets the HTML Document Object Model (DOM) element that the current Sys.UI.Control object is associated with. + * @return The DOM element that the current Control object is associated with. + */ + get_element(): Sys.UI.DomElement; + /** + * Gets or sets the identifier for the Sys.UI.Control object. + * A generated identifier that consists of the ID of the associated Sys.UI.DomElement, the "$" character, and the name value of the Control object. + */ + get_id(): string; + /** + * Gets or sets the identifier for the Sys.UI.Control object. + * @param value + * The string value to use as the identifier. + */ + set_id(value: string): void; + /* + * Gets or sets the name of the Sys.UI.Control object. + * If you do not explicitly set the name property, getting the property value sets it to its default value, which is equal to the type of the Control object. The name property remains null until it is accessed. + * @param value + * A string value to use as the name. + */ + //#endregion } /** From f985712d93a0cf684c645b84f8ad177b0d23156f Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Wed, 29 Oct 2014 11:19:49 +0100 Subject: [PATCH 037/135] Add typings for timezonecomplete-1.9.0 --- .../timezonecomplete-1.8.0-tests.ts | 203 +++ timezonecomplete/timezonecomplete-1.8.0.d.ts | 1190 +++++++++++++++++ timezonecomplete/timezonecomplete-tests.ts | 2 + timezonecomplete/timezonecomplete.d.ts | 19 +- 4 files changed, 1413 insertions(+), 1 deletion(-) create mode 100644 timezonecomplete/timezonecomplete-1.8.0-tests.ts create mode 100644 timezonecomplete/timezonecomplete-1.8.0.d.ts diff --git a/timezonecomplete/timezonecomplete-1.8.0-tests.ts b/timezonecomplete/timezonecomplete-1.8.0-tests.ts new file mode 100644 index 000000000..5ab586475 --- /dev/null +++ b/timezonecomplete/timezonecomplete-1.8.0-tests.ts @@ -0,0 +1,203 @@ +/// + +import tc = require("timezonecomplete-1.8.0"); + +var b: boolean; +var n: number; +var s: string; +var w: tc.WeekDay; + +b = tc.isLeapYear(2014); +n = tc.daysInMonth(2014, 10); +n = tc.daysInYear(2014); +n = tc.dayOfYear(2014, 1, 2); +w = tc.firstWeekDayOfMonth(2014, 1, tc.WeekDay.Sunday); +w = tc.lastWeekDayOfMonth(2014, 1, tc.WeekDay.Sunday); +n = tc.weekDayOnOrAfter(2014, 1, 14, tc.WeekDay.Monday); +n = tc.weekDayOnOrBefore(2014, 1, 14, tc.WeekDay.Monday); +n = tc.secondOfDay(13, 59, 59); +n = tc.weekOfMonth(2014, 1, 1); + +// DURATION + +var d: tc.Duration; +var d1: tc.Duration = tc.Duration.hours(24); +var d2: tc.Duration = tc.Duration.minutes(24); +var d3: tc.Duration = tc.Duration.seconds(24); +var d4: tc.Duration = tc.Duration.milliseconds(24); +var d5: tc.Duration = new tc.Duration(24); +var d6: tc.Duration = new tc.Duration("00:01"); +var d7: tc.Duration = d6.clone(); + +n = d7.wholeHours(); +n = d7.hours(); +n = d7.minutes(); +n = d7.minute(); +n = d7.seconds(); +n = d7.second(); +n = d7.milliseconds(); +n = d7.millisecond(); +s = d7.sign(); +b = d7.lessThan(d6); +b = d7.greaterThan(d6); +d = d7.min(d6); +d = d7.max(d6); +d = d7.multiply(3); +d = d7.divide(0.3); +d = d7.add(d6); +d = d7.sub(d6); +s = d7.toString(); + +// TIMEZONE + +var t: tc.TimeZone; +var k: tc.TimeZoneKind; + +t = tc.TimeZone.local(); +t = tc.TimeZone.utc(); +t = tc.TimeZone.zone(2); +t = tc.TimeZone.zone("+01:00"); +s = t.name(); +k = t.kind(); +b = t.equals(t); +b = t.isUtc(); +n = t.offsetForUtc(2014, 1, 1, 13, 0, 5, 123); +n = t.offsetForZone(2014, 1, 1, 13, 0, 5, 123); +n = t.offsetForUtcDate(new Date(2014, 1, 1, 13, 0, 5, 123), tc.DateFunctions.Get); +n = t.offsetForZoneDate(new Date(2014, 1, 1, 13, 0, 5, 123), tc.DateFunctions.GetUTC); +s = t.toString(); +s = tc.TimeZone.offsetToString(2); +n = tc.TimeZone.stringToOffset("+00:01"); + +// REALTIMESOURCE + +var date: Date = (new tc.RealTimeSource()).now(); + +// DATETIME + +var dt: tc.DateTime; + +var ts: tc.TimeSource = tc.DateTime.timeSource; + +dt = tc.DateTime.nowLocal(); +dt = tc.DateTime.nowUtc(); +dt = tc.DateTime.now(tc.TimeZone.local()); +dt = new tc.DateTime(); +dt = new tc.DateTime("2014-01-01T13:05:01.123 UTC"); +dt = new tc.DateTime("2014-01-01T13:05:01.123", tc.TimeZone.utc()); +dt = new tc.DateTime(date, tc.DateFunctions.Get); +dt = new tc.DateTime(date, tc.DateFunctions.Get, tc.TimeZone.utc()); +dt = new tc.DateTime(2014, 1, 1, 13, 5, 1, 123); +dt = new tc.DateTime(2014, 1, 1, 13, 5, 1, 123, tc.TimeZone.utc()); +dt = new tc.DateTime(89949284); +dt = new tc.DateTime(89949284, tc.TimeZone.utc()); +dt = dt.clone(); +t = dt.zone(); +n = dt.offset(); +n = dt.year(); +n = dt.month(); +n = dt.day(); +n = dt.hour(); +n = dt.minute(); +n = dt.second(); +n = dt.weekNumber(); +n = dt.weekOfMonth(); +n = dt.secondOfDay(); +n = dt.dayOfYear(); +n = dt.millisecond(); +n = dt.unixUtcMillis(); +n = dt.utcYear(); +n = dt.utcMonth(); +n = dt.utcDay(); +n = dt.utcHour(); +n = dt.utcMinute(); +n = dt.utcSecond(); +n = dt.utcMillisecond(); +n = dt.utcWeekNumber(); +n = dt.utcWeekOfMonth(); +n = dt.utcSecondOfDay(); +n = dt.utcDayOfYear(); +s = dt.format("%Y-%m-%d"); +dt.convert(tc.TimeZone.local()); +dt = dt.toZone(tc.TimeZone.utc()); +date = dt.toDate(); +dt = dt.add(tc.Duration.seconds(2)); +dt = dt.add(2, tc.TimeUnit.Year); +dt = dt.add(2, tc.TimeUnit.Month); +dt = dt.add(2, tc.TimeUnit.Week); +dt = dt.add(2, tc.TimeUnit.Day); +dt = dt.add(2, tc.TimeUnit.Hour); +dt = dt.add(2, tc.TimeUnit.Minute); +dt = dt.add(2, tc.TimeUnit.Second); +dt = dt.addLocal(2, tc.TimeUnit.Second); +dt = dt.sub(tc.Duration.seconds(2)); +dt = dt.sub(2, tc.TimeUnit.Year); +dt = dt.sub(2, tc.TimeUnit.Month); +dt = dt.sub(2, tc.TimeUnit.Week); +dt = dt.sub(2, tc.TimeUnit.Day); +dt = dt.sub(2, tc.TimeUnit.Hour); +dt = dt.sub(2, tc.TimeUnit.Minute); +dt = dt.sub(2, tc.TimeUnit.Second); +dt = dt.subLocal(2, tc.TimeUnit.Second); +d = dt.diff(new tc.DateTime(9289234, tc.TimeZone.local())); +b = dt.lessThan(new tc.DateTime(9289234, tc.TimeZone.local())); +b = dt.lessEqual(new tc.DateTime(9289234, tc.TimeZone.local())); +b = dt.greaterThan(new tc.DateTime(9289234, tc.TimeZone.local())); +b = dt.greaterEqual(new tc.DateTime(9289234, tc.TimeZone.local())); +dt = dt.min(new tc.DateTime(9289234, tc.TimeZone.local())); +dt = dt.max(new tc.DateTime(9289234, tc.TimeZone.local())); +s = dt.toIsoString(); +s = dt.toString(); +s = dt.toUtcString(); + +var wd: tc.WeekDay; +wd = dt.weekDay(); +wd = dt.utcWeekDay(); + +// PERIOD + +s = tc.periodDstToString(tc.PeriodDst.RegularIntervals); +s = tc.periodDstToString(tc.PeriodDst.RegularLocalTime); + +var p: tc.Period; + +p = new tc.Period(tc.DateTime.nowLocal(), 1, tc.TimeUnit.Hour, tc.PeriodDst.RegularLocalTime); +dt = p.start(); +n = p.amount(); +var tu: tc.TimeUnit = p.unit(); +var pd: tc.PeriodDst = p.dst(); +dt = p.findFirst(tc.DateTime.nowLocal()); +dt = p.findNext(dt); +s = p.toIsoString(); +s = p.toString(); +b = p.isBoundary(dt); + + +// GLOBALS +d = tc.min(tc.Duration.seconds(2), tc.Duration.seconds(3)); +d = tc.max(tc.Duration.seconds(2), tc.Duration.seconds(3)); + +dt = tc.min(new tc.DateTime(2), new tc.DateTime(3)); +dt = tc.max(new tc.DateTime(2), new tc.DateTime(3)); + + + + + + + + + + + + + + + + + + + + + + diff --git a/timezonecomplete/timezonecomplete-1.8.0.d.ts b/timezonecomplete/timezonecomplete-1.8.0.d.ts new file mode 100644 index 000000000..c8ff2310b --- /dev/null +++ b/timezonecomplete/timezonecomplete-1.8.0.d.ts @@ -0,0 +1,1190 @@ +// Type definitions for timezonecomplete 1.8.0 +// Project: https://github.com/SpiritIT/timezonecomplete +// Definitions by: Rogier Schouten +// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Generated by dts-bundle v0.2.0 + +declare module 'timezonecomplete-1.8.0' { + import basics = require("__timezonecomplete/basics"); + export import TimeUnit = basics.TimeUnit; + export import WeekDay = basics.WeekDay; + export import isLeapYear = basics.isLeapYear; + export import daysInMonth = basics.daysInMonth; + export import daysInYear = basics.daysInYear; + export import firstWeekDayOfMonth = basics.firstWeekDayOfMonth; + export import lastWeekDayOfMonth = basics.lastWeekDayOfMonth; + export import weekDayOnOrAfter = basics.weekDayOnOrAfter; + export import weekDayOnOrBefore = basics.weekDayOnOrBefore; + export import weekNumber = basics.weekNumber; + export import weekOfMonth = basics.weekOfMonth; + export import dayOfYear = basics.dayOfYear; + export import secondOfDay = basics.secondOfDay; + import datetime = require("__timezonecomplete/datetime"); + export import DateTime = datetime.DateTime; + import duration = require("__timezonecomplete/duration"); + export import Duration = duration.Duration; + import javascript = require("__timezonecomplete/javascript"); + export import DateFunctions = javascript.DateFunctions; + import period = require("__timezonecomplete/period"); + export import Period = period.Period; + export import PeriodDst = period.PeriodDst; + export import periodDstToString = period.periodDstToString; + import timesource = require("__timezonecomplete/timesource"); + export import TimeSource = timesource.TimeSource; + export import RealTimeSource = timesource.RealTimeSource; + import timezone = require("__timezonecomplete/timezone"); + export import NormalizeOption = timezone.NormalizeOption; + export import TimeZoneKind = timezone.TimeZoneKind; + export import TimeZone = timezone.TimeZone; + import globals = require("__timezonecomplete/globals"); + export import min = globals.min; + export import max = globals.max; +} + +declare module '__timezonecomplete/basics' { + import javascript = require("__timezonecomplete/javascript"); + /** + * Day-of-week. Note the enum values correspond to JavaScript day-of-week: + * Sunday = 0, Monday = 1 etc + */ + export enum WeekDay { + Sunday = 0, + Monday = 1, + Tuesday = 2, + Wednesday = 3, + Thursday = 4, + Friday = 5, + Saturday = 6, + } + /** + * Time units + */ + export enum TimeUnit { + Second = 0, + Minute = 1, + Hour = 2, + Day = 3, + Week = 4, + Month = 5, + Year = 6, + } + /** + * @return True iff the given year is a leap year. + */ + export function isLeapYear(year: number): boolean; + /** + * The days in a given year + */ + export function daysInYear(year: number): number; + /** + * @param year The full year + * @param month The month 1-12 + * @return The number of days in the given month + */ + export function daysInMonth(year: number, month: number): number; + /** + * Returns the day of the year of the given date [0..365]. January first is 0. + * + * @param year The year e.g. 1986 + * @param month Month 1-12 + * @param day Day of month 1-31 + */ + export function dayOfYear(year: number, month: number, day: number): number; + /** + * Returns the last instance of the given weekday in the given month + * + * @param year The year + * @param month the month 1-12 + * @param weekDay the desired week day + * + * @return the last occurrence of the week day in the month + */ + export function lastWeekDayOfMonth(year: number, month: number, weekDay: WeekDay): number; + /** + * Returns the first instance of the given weekday in the given month + * + * @param year The year + * @param month the month 1-12 + * @param weekDay the desired week day + * + * @return the first occurrence of the week day in the month + */ + export function firstWeekDayOfMonth(year: number, month: number, weekDay: WeekDay): number; + /** + * Returns the day-of-month that is on the given weekday and which is >= the given day. + * Throws if the month has no such day. + */ + export function weekDayOnOrAfter(year: number, month: number, day: number, weekDay: WeekDay): number; + /** + * Returns the day-of-month that is on the given weekday and which is <= the given day. + * Throws if the month has no such day. + */ + export function weekDayOnOrBefore(year: number, month: number, day: number, weekDay: WeekDay): number; + /** + * The week of this month. There is no official standard for this, + * but we assume the same rules for the weekNumber (i.e. + * week 1 is the week that has the 4th day of the month in it) + * + * @param year The year + * @param month The month [1-12] + * @param day The day [1-31] + * @return Week number [1-5] + */ + export function weekOfMonth(year: number, month: number, day: number): number; + /** + * The ISO 8601 week number for the given date. Week 1 is the week + * that has January 4th in it, and it starts on Monday. + * See https://en.wikipedia.org/wiki/ISO_week_date + * + * @param year Year e.g. 1988 + * @param month Month 1-12 + * @param day Day of month 1-31 + * + * @return Week number 1-53 + */ + export function weekNumber(year: number, month: number, day: number): number; + /** + * Convert a unix milli timestamp into a TimeT structure. + * This does NOT take leap seconds into account. + */ + export function unixToTimeNoLeapSecs(unixMillis: number): TimeStruct; + /** + * Convert a year, month, day etc into a unix milli timestamp. + * This does NOT take leap seconds into account. + * + * @param year Year e.g. 1970 + * @param month Month 1-12 + * @param day Day 1-31 + * @param hour Hour 0-23 + * @param minute Minute 0-59 + * @param second Second 0-59 (no leap seconds) + * @param milli Millisecond 0-999 + */ + export function timeToUnixNoLeapSecs(year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, milli?: number): number; + /** + * Convert a TimeT structure into a unix milli timestamp. + * This does NOT take leap seconds into account. + */ + export function timeToUnixNoLeapSecs(tm: TimeStruct): number; + /** + * Return the day-of-week. + * This does NOT take leap seconds into account. + */ + export function weekDayNoLeapSecs(unixMillis: number): WeekDay; + /** + * N-th second in the day, counting from 0 + */ + export function secondOfDay(hour: number, minute: number, second: number): number; + /** + * Basic representation of a date and time + */ + export class TimeStruct { + /** + * Year, 1970-... + */ + year: number; + /** + * Month 1-12 + */ + month: number; + /** + * Day of month, 1-31 + */ + day: number; + /** + * Hour 0-23 + */ + hour: number; + /** + * Minute 0-59 + */ + minute: number; + /** + * Seconds, 0-59 + */ + second: number; + /** + * Milliseconds 0-999 + */ + milli: number; + /** + * Create a TimeStruct from a number of unix milliseconds + */ + static fromUnix(unixMillis: number): TimeStruct; + /** + * Create a TimeStruct from a JavaScript date + * + * @param d The date + * @param df Which functions to take (getX() or getUTCX()) + */ + static fromDate(d: Date, df: javascript.DateFunctions): TimeStruct; + /** + * Returns a TimeStruct from an ISO 8601 string WITHOUT time zone + */ + static fromString(s: string): TimeStruct; + /** + * Constructor + * + * @param year Year e.g. 1970 + * @param month Month 1-12 + * @param day Day 1-31 + * @param hour Hour 0-23 + * @param minute Minute 0-59 + * @param second Second 0-59 (no leap seconds) + * @param milli Millisecond 0-999 + */ + constructor(/** + * Year, 1970-... + */ + year?: number, /** + * Month 1-12 + */ + month?: number, /** + * Day of month, 1-31 + */ + day?: number, /** + * Hour 0-23 + */ + hour?: number, /** + * Minute 0-59 + */ + minute?: number, /** + * Seconds, 0-59 + */ + second?: number, /** + * Milliseconds 0-999 + */ + milli?: number); + /** + * Validate a TimeStruct, returns false if invalid. + */ + validate(): boolean; + /** + * The day-of-year 0-365 + */ + yearDay(): number; + /** + * Returns this time as a unix millisecond timestamp + * Does NOT take leap seconds into account. + */ + toUnixNoLeapSecs(): number; + /** + * Deep equals + */ + equals(other: TimeStruct): boolean; + /** + * < operator + */ + lessThan(other: TimeStruct): boolean; + clone(): TimeStruct; + valueOf(): number; + /** + * ISO 8601 string YYYY-MM-DDThh:mm:ss.nnn + */ + toString(): string; + inspect(): string; + } +} + +declare module '__timezonecomplete/datetime' { + import basics = require("__timezonecomplete/basics"); + import duration = require("__timezonecomplete/duration"); + import javascript = require("__timezonecomplete/javascript"); + import timesource = require("__timezonecomplete/timesource"); + import timezone = require("__timezonecomplete/timezone"); + /** + * DateTime class which is time zone-aware + * and which can be mocked for testing purposes. + */ + export class DateTime { + /** + * Actual time source in use. Setting this property allows to + * fake time in tests. DateTime.nowLocal() and DateTime.nowUtc() + * use this property for obtaining the current time. + */ + static timeSource: timesource.TimeSource; + /** + * Current date+time in local time (derived from DateTime.timeSource.now()). + */ + static nowLocal(): DateTime; + /** + * Current date+time in UTC time (derived from DateTime.timeSource.now()). + */ + static nowUtc(): DateTime; + /** + * Current date+time in the given time zone (derived from DateTime.timeSource.now()). + * @param timeZone The desired time zone. + */ + static now(timeZone: timezone.TimeZone): DateTime; + /** + * Constructor. Creates current time in local timezone. + */ + constructor(); + /** + * Constructor + * Non-existing local times are normalized by rounding up to the next DST offset. + * + * @param isoString String in ISO 8601 format. Instead of ISO time zone, + * it may include a space and then and IANA time zone. + * e.g. "2007-04-05T12:30:40.500" (no time zone, naive date) + * e.g. "2007-04-05T12:30:40.500+01:00" (UTC offset without daylight saving time) + * or "2007-04-05T12:30:40.500Z" (UTC) + * or "2007-04-05T12:30:40.500 Europe/Amsterdam" (IANA time zone, with daylight saving time if applicable) + * @param timeZone if given, the date in the string is assumed to be in this time zone. + * Note that it is NOT CONVERTED to the time zone. Useful + * for strings without a time zone + */ + constructor(isoString: string, timeZone?: timezone.TimeZone); + /** + * Constructor. You provide a date, then you say whether to take the + * date.getYear()/getXxx methods or the date.getUTCYear()/date.getUTCXxx methods, + * and then you state which time zone that date is in. + * Non-existing local times are normalized by rounding up to the next DST offset. + * Note that the Date class has bugs and inconsistencies when constructing them with times around + * DST changes. + * + * @param date A date object. + * @param getters Specifies which set of Date getters contains the date in the given time zone: the + * Date.getXxx() methods or the Date.getUTCXxx() methods. + * @param timeZone The time zone that the given date is assumed to be in (may be null for unaware dates) + */ + constructor(date: Date, getFuncs: javascript.DateFunctions, timeZone?: timezone.TimeZone); + /** + * Constructor. Note that unlike JavaScript dates we require fields to be in normal ranges. + * Use the add(duration) or sub(duration) for arithmetic. + * @param year The full year (e.g. 2014) + * @param month The month [1-12] (note this deviates from JavaScript Date) + * @param day The day of the month [1-31] + * @param hour The hour of the day [0-24) + * @param minute The minute of the hour [0-59] + * @param second The second of the minute [0-59] + * @param millisecond The millisecond of the second [0-999] + * @param timeZone The time zone, or null (for unaware dates) + */ + constructor(year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number, timeZone?: timezone.TimeZone); + /** + * Constructor + * @param unixTimestamp milliseconds since 1970-01-01T00:00:00.000 + * @param timeZone the time zone that the timestamp is assumed to be in (usually UTC). + */ + constructor(unixTimestamp: number, timeZone?: timezone.TimeZone); + /** + * @return a copy of this object + */ + clone(): DateTime; + /** + * @return The time zone that the date is in. May be null for unaware dates. + */ + zone(): timezone.TimeZone; + /** + * Zone name abbreviation at this time + * @param dstDependent (default true) set to false for a DST-agnostic abbreviation + * @return The abbreviation + */ + zoneAbbreviation(dstDependent?: boolean): string; + /** + * @return the offset w.r.t. UTC in minutes. Returns 0 for unaware dates and for UTC dates. + */ + offset(): number; + /** + * @return The full year e.g. 2014 + */ + year(): number; + /** + * @return The month 1-12 (note this deviates from JavaScript Date) + */ + month(): number; + /** + * @return The day of the month 1-31 + */ + day(): number; + /** + * @return The hour 0-23 + */ + hour(): number; + /** + * @return the minutes 0-59 + */ + minute(): number; + /** + * @return the seconds 0-59 + */ + second(): number; + /** + * @return the milliseconds 0-999 + */ + millisecond(): number; + /** + * @return the day-of-week (the enum values correspond to JavaScript + * week day numbers) + */ + weekDay(): basics.WeekDay; + /** + * Returns the day number within the year: Jan 1st has number 0, + * Jan 2nd has number 1 etc. + * + * @return the day-of-year [0-366] + */ + dayOfYear(): number; + /** + * The ISO 8601 week number. Week 1 is the week + * that has January 4th in it, and it starts on Monday. + * See https://en.wikipedia.org/wiki/ISO_week_date + * + * @return Week number [1-53] + */ + weekNumber(): number; + /** + * The week of this month. There is no official standard for this, + * but we assume the same rules for the weekNumber (i.e. + * week 1 is the week that has the 4th day of the month in it) + * + * @return Week number [1-5] + */ + weekOfMonth(): number; + /** + * Returns the number of seconds that have passed on the current day + * Does not consider leap seconds + * + * @return seconds [0-86399] + */ + secondOfDay(): number; + /** + * @return Milliseconds since 1970-01-01T00:00:00.000Z + */ + unixUtcMillis(): number; + /** + * @return The full year e.g. 2014 + */ + utcYear(): number; + /** + * @return The UTC month 1-12 (note this deviates from JavaScript Date) + */ + utcMonth(): number; + /** + * @return The UTC day of the month 1-31 + */ + utcDay(): number; + /** + * @return The UTC hour 0-23 + */ + utcHour(): number; + /** + * @return The UTC minutes 0-59 + */ + utcMinute(): number; + /** + * @return The UTC seconds 0-59 + */ + utcSecond(): number; + /** + * Returns the UTC day number within the year: Jan 1st has number 0, + * Jan 2nd has number 1 etc. + * + * @return the day-of-year [0-366] + */ + utcDayOfYear(): number; + /** + * @return The UTC milliseconds 0-999 + */ + utcMillisecond(): number; + /** + * @return the UTC day-of-week (the enum values correspond to JavaScript + * week day numbers) + */ + utcWeekDay(): basics.WeekDay; + /** + * The ISO 8601 UTC week number. Week 1 is the week + * that has January 4th in it, and it starts on Monday. + * See https://en.wikipedia.org/wiki/ISO_week_date + * + * @return Week number [1-53] + */ + utcWeekNumber(): number; + /** + * The week of this month. There is no official standard for this, + * but we assume the same rules for the weekNumber (i.e. + * week 1 is the week that has the 4th day of the month in it) + * + * @return Week number [1-5] + */ + utcWeekOfMonth(): number; + /** + * Returns the number of seconds that have passed on the current day + * Does not consider leap seconds + * + * @return seconds [0-86399] + */ + utcSecondOfDay(): number; + /** + * Convert this date to the given time zone (in-place). + * Throws if this date does not have a time zone. + * @return this (for chaining) + */ + convert(zone?: timezone.TimeZone): DateTime; + /** + * Returns this date converted to the given time zone. + * Unaware dates can only be converted to unaware dates (clone) + * Converting an unaware date to an aware date throws an exception. Use the constructor + * if you really need to do that. + * + * @param zone The new time zone. This may be null to create unaware date. + * @return The converted date + */ + toZone(zone?: timezone.TimeZone): DateTime; + /** + * Convert to JavaScript date with the zone time in the getX() methods. + * Unless the timezone is local, the Date.getUTCX() methods will NOT be correct. + * This is because Date calculates getUTCX() from getX() applying local time zone. + */ + toDate(): Date; + /** + * Add a time duration relative to UTC. Note that this simply adds a number + * of milliseconds to UTC and converts back to zone(), + * There is not DST handling. + * @return this + duration + */ + add(duration: duration.Duration): DateTime; + /** + * Add an amount of time relative to UTC, as regularly as possible. + * + * Adding e.g. 1 hour will increment the utcHour() field, adding 1 month + * increments the utcMonth() field. + * Adding an amount of units leaves lower units intact. E.g. + * adding a month will leave the day() field untouched if possible. + * + * Note adding Months or Years will clamp the date to the end-of-month if + * the start date was at the end of a month, i.e. contrary to JavaScript + * Date#setUTCMonth() it will not overflow into the next month + * + * In case of DST changes, the utc time fields are still untouched but local + * time fields may shift. + */ + add(amount: number, unit: basics.TimeUnit): DateTime; + /** + * Add an amount of time to the zone time, as regularly as possible. + * + * Adding e.g. 1 hour will increment the hour() field of the zone + * date by one. In case of DST changes, the time fields may additionally + * increase by the DST offset, if a non-existing local time would + * be reached otherwise. + * + * Adding a unit of time will leave lower-unit fields intact, unless the result + * would be a non-existing time. Then an extra DST offset is added. + * + * Note adding Months or Years will clamp the date to the end-of-month if + * the start date was at the end of a month, i.e. contrary to JavaScript + * Date#setUTCMonth() it will not overflow into the next month + */ + addLocal(amount: number, unit: basics.TimeUnit): DateTime; + /** + * Same as add(-1*duration); + */ + sub(duration: duration.Duration): DateTime; + /** + * Same as add(-1*amount, unit); + */ + sub(amount: number, unit: basics.TimeUnit): DateTime; + /** + * Same as addLocal(-1*amount, unit); + */ + subLocal(amount: number, unit: basics.TimeUnit): DateTime; + /** + * Time difference between two DateTimes + * @return this - other + */ + diff(other: DateTime): duration.Duration; + /** + * @return True iff (this < other) + */ + lessThan(other: DateTime): boolean; + /** + * @return True iff (this <= other) + */ + lessEqual(other: DateTime): boolean; + /** + * @return True iff this and other represent the same time in UTC + */ + equals(other: DateTime): boolean; + /** + * @return True iff this and other represent the same time and + * have the same zone + */ + identical(other: DateTime): boolean; + /** + * @return True iff this > other + */ + greaterThan(other: DateTime): boolean; + /** + * @return True iff this >= other + */ + greaterEqual(other: DateTime): boolean; + /** + * @return The minimum of this and other + */ + min(other: DateTime): DateTime; + /** + * @return The maximum of this and other + */ + max(other: DateTime): DateTime; + /** + * Proper ISO 8601 format string with any IANA zone converted to ISO offset + * E.g. "2014-01-01T23:15:33+01:00" for Europe/Amsterdam + */ + toIsoString(): string; + /** + * Return a string representation of the DateTime according to the + * specified format. The format is implemented as the LDML standard + * (http://unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns) + * + * @param formatString The format specification (e.g. "dd/MM/yyyy HH:mm:ss") + * @return The string representation of this DateTime + */ + format(formatString: string): string; + /** + * Modified ISO 8601 format string with IANA name if applicable. + * E.g. "2014-01-01T23:15:33.000 Europe/Amsterdam" + */ + toString(): string; + /** + * Used by util.inspect() + */ + inspect(): string; + /** + * The valueOf() method returns the primitive value of the specified object. + */ + valueOf(): any; + /** + * Modified ISO 8601 format string in UTC without time zone info + */ + toUtcString(): string; + } +} + +declare module '__timezonecomplete/duration' { + /** + * Time duration. Create one e.g. like this: var d = Duration.hours(1). + * Note that time durations do not take leap seconds etc. into account: + * one hour is simply represented as 3600000 milliseconds. + */ + export class Duration { + /** + * Construct a time duration + * @param n Number of hours + * @return A duration of n hours + */ + static hours(n: number): Duration; + /** + * Construct a time duration + * @param n Number of minutes + * @return A duration of n minutes + */ + static minutes(n: number): Duration; + /** + * Construct a time duration + * @param n Number of seconds + * @return A duration of n seconds + */ + static seconds(n: number): Duration; + /** + * Construct a time duration + * @param n Number of milliseconds + * @return A duration of n milliseconds + */ + static milliseconds(n: number): Duration; + /** + * Construct a time duration of 0 + */ + constructor(); + /** + * Construct a time duration from a number of milliseconds + */ + constructor(milliseconds: number); + /** + * Construct a time duration from a string in format + * [-]h[:m[:s[.n]]] e.g. -01:00:30.501 + */ + constructor(input: string); + /** + * @return another instance of Duration with the same value. + */ + clone(): Duration; + /** + * The entire duration in milliseconds (negative or positive) + */ + milliseconds(): number; + /** + * The millisecond part of the duration (always positive) + * @return e.g. 400 for a -01:02:03.400 duration + */ + millisecond(): number; + /** + * The entire duration in seconds (negative or positive, fractional) + * @return e.g. 1.5 for a 1500 milliseconds duration + */ + seconds(): number; + /** + * The second part of the duration (always positive) + * @return e.g. 3 for a -01:02:03.400 duration + */ + second(): number; + /** + * The entire duration in minutes (negative or positive, fractional) + * @return e.g. 1.5 for a 90000 milliseconds duration + */ + minutes(): number; + /** + * The minute part of the duration (always positive) + * @return e.g. 2 for a -01:02:03.400 duration + */ + minute(): number; + /** + * The entire duration in hours (negative or positive, fractional) + * @return e.g. 1.5 for a 5400000 milliseconds duration + */ + hours(): number; + /** + * The hour part of the duration (always positive). + * Note that this part can exceed 23 hours, because for + * now, we do not have a days() function + * @return e.g. 25 for a -25:02:03.400 duration + */ + wholeHours(): number; + /** + * Sign + * @return "-" if the duration is negative + */ + sign(): string; + /** + * @return True iff (this < other) + */ + lessThan(other: Duration): boolean; + /** + * @return True iff (this <= other) + */ + lessEqual(other: Duration): boolean; + /** + * @return True iff this and other represent the same time duration + */ + equals(other: Duration): boolean; + /** + * @return True iff this > other + */ + greaterThan(other: Duration): boolean; + /** + * @return True iff this >= other + */ + greaterEqual(other: Duration): boolean; + /** + * @return The minimum (most negative) of this and other + */ + min(other: Duration): Duration; + /** + * @return The maximum (most positive) of this and other + */ + max(other: Duration): Duration; + /** + * Multiply with a fixed number. + * @return a new Duration of (this * value) + */ + multiply(value: number): Duration; + /** + * Divide by a fixed number. + * @return a new Duration of (this / value) + */ + divide(value: number): Duration; + /** + * Add a duration. + * @return a new Duration of (this + value) + */ + add(value: Duration): Duration; + /** + * Subtract a duration. + * @return a new Duration of (this - value) + */ + sub(value: Duration): Duration; + /** + * String in [-]hh:mm:ss.nnn notation. All fields are + * always present except the sign. + */ + toFullString(): string; + /** + * String in [-]hh[:mm[:ss[.nnn]]] notation. Fields are + * added as necessary + */ + toString(): string; + /** + * Used by util.inspect() + */ + inspect(): string; + /** + * The valueOf() method returns the primitive value of the specified object. + */ + valueOf(): any; + } +} + +declare module '__timezonecomplete/javascript' { + /** + * Indicates how a Date object should be interpreted. + * Either we can take getYear(), getMonth() etc for our field + * values, or we can take getUTCYear(), getUtcMonth() etc to do that. + */ + export enum DateFunctions { + /** + * Use the Date.getFullYear(), Date.getMonth(), ... functions. + */ + Get = 0, + /** + * Use the Date.getUTCFullYear(), Date.getUTCMonth(), ... functions. + */ + GetUTC = 1, + } +} + +declare module '__timezonecomplete/period' { + import basics = require("__timezonecomplete/basics"); + import datetime = require("__timezonecomplete/datetime"); + /** + * Specifies how the period should repeat across the day + * during DST changes. + */ + export enum PeriodDst { + /** + * Keep repeating in similar intervals measured in UTC, + * unaffected by Daylight Saving Time. + * E.g. a repetition of one hour will take one real hour + * every time, even in a time zone with DST. + * Leap seconds, leap days and month length + * differences will still make the intervals different. + */ + RegularIntervals = 0, + /** + * Ensure that the time at which the intervals occur stay + * at the same place in the day, local time. So e.g. + * a period of one day, starting at 8:05AM Europe/Amsterdam time + * will always start at 8:05 Europe/Amsterdam. This means that + * in UTC time, some intervals will be 25 hours and some + * 23 hours during DST changes. + * Another example: an hourly interval will be hourly in local time, + * skipping an hour in UTC for a DST backward change. + */ + RegularLocalTime = 1, + } + /** + * Convert a PeriodDst to a string: "regular intervals" or "regular local time" + */ + export function periodDstToString(p: PeriodDst): string; + /** + * Repeating time period: consists of a starting point and + * a time length. This class accounts for leap seconds and leap days. + */ + export class Period { + /** + * Constructor + * LIMITATION: if dst equals RegularLocalTime, and unit is Second, Minute or Hour, + * then the amount must be a factor of 24. So 120 seconds is allowed while 121 seconds is not. + * This is due to the enormous processing power required by these cases. They are not + * implemented and you will get an assert. + * + * @param start The start of the period. If the period is in Months or Years, and + * the day is 29 or 30 or 31, the results are maximised to end-of-month. + * @param amount The amount of units. + * @param unit The unit. + * @param dst Specifies how to handle Daylight Saving Time. Not relevant + * if the time zone of the start datetime does not have DST. + */ + constructor(start: datetime.DateTime, amount: number, unit: basics.TimeUnit, dst: PeriodDst); + /** + * The start date + */ + start(): datetime.DateTime; + /** + * The amount of units + */ + amount(): number; + /** + * The unit + */ + unit(): basics.TimeUnit; + /** + * The dst handling mode + */ + dst(): PeriodDst; + /** + * The first occurrence of the period greater than + * the given date. The given date need not be at a period boundary. + * Pre: the fromdate and startdate must either both have timezones or not + * @param fromDate: the date after which to return the next date + * @return the first date matching the period after fromDate, given + * in the same zone as the fromDate. + */ + findFirst(fromDate: datetime.DateTime): datetime.DateTime; + /** + * Returns the next timestamp in the period. The given timestamp must + * be at a period boundary, otherwise the answer is incorrect. + * This function has MUCH better performance than findFirst. + * Returns the datetime "count" times away from the given datetime. + * @param prev Boundary date. Must have a time zone (any time zone) iff the period start date has one. + * @param count Optional, must be >= 1 and whole. + * @return (prev + count * period), in the same timezone as prev. + */ + findNext(prev: datetime.DateTime, count?: number): datetime.DateTime; + /** + * Checks whether the given date is on a period boundary + * (expensive!) + */ + isBoundary(occurrence: datetime.DateTime): boolean; + /** + * Returns an ISO duration string e.g. + * 2014-01-01T12:00:00.000+01:00/P1H + * 2014-01-01T12:00:00.000+01:00/PT1M (one minute) + * 2014-01-01T12:00:00.000+01:00/P1M (one month) + */ + toIsoString(): string; + /** + * A string representation e.g. + * "10 years, starting at 2014-03-01T12:00:00 Europe/Amsterdam, keeping regular intervals". + */ + toString(): string; + /** + * Used by util.inspect() + */ + inspect(): string; + } +} + +declare module '__timezonecomplete/timesource' { + /** + * For testing purposes, we often need to manipulate what the current + * time is. This is an interface for a custom time source object + * so in tests you can use a custom time source. + */ + export interface TimeSource { + /** + * Return the current date+time as a javascript Date object + */ + now(): Date; + } + /** + * Default time source, returns actual time + */ + export class RealTimeSource implements TimeSource { + now(): Date; + } +} + +declare module '__timezonecomplete/timezone' { + import javascript = require("__timezonecomplete/javascript"); + /** + * The type of time zone + */ + export enum TimeZoneKind { + /** + * Local time offset as determined by JavaScript Date class. + */ + Local = 0, + /** + * Fixed offset from UTC, without DST. + */ + Offset = 1, + /** + * IANA timezone managed through Olsen TZ database. Includes + * DST if applicable. + */ + Proper = 2, + } + /** + * Option for TimeZone#normalizeLocal() + */ + export enum NormalizeOption { + /** + * Normalize non-existing times by ADDING the DST offset + */ + Up = 0, + /** + * Normalize non-existing times by SUBTRACTING the DST offset + */ + Down = 1, + } + /** + * Time zone. The object is immutable because it is cached: + * requesting a time zone twice yields the very same object. + * Note that we use time zone offsets inverted w.r.t. JavaScript Date.getTimezoneOffset(), + * i.e. offset 90 means +01:30. + * + * Time zones come in three flavors: the local time zone, as calculated by JavaScript Date, + * a fixed offset ("+01:30") without DST, or a IANA timezone ("Europe/Amsterdam") with DST + * applied depending on the time zone rules. + */ + export class TimeZone { + /** + * The local time zone for a given date. Note that + * the time zone varies with the date: amsterdam time for + * 2014-01-01 is +01:00 and amsterdam time for 2014-07-01 is +02:00 + */ + static local(): TimeZone; + /** + * The UTC time zone. + */ + static utc(): TimeZone; + /** + * Returns a time zone object from the cache. If it does not exist, it is created. + * @return The time zone with the given offset w.r.t. UTC in minutes, e.g. 90 for +01:30 + */ + static zone(offset: number): TimeZone; + /** + * Returns a time zone object from the cache. If it does not exist, it is created. + * @param s: Empty string for local time, a TZ database time zone name (e.g. Europe/Amsterdam) + * or an offset string (either +01:30, +0130, +01, Z). For a full list of names, see: + * https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + */ + static zone(s: string): TimeZone; + /** + * Do not use this constructor, use the static + * TimeZone.zone() method instead. + * @param name NORMALIZED name, assumed to be correct + */ + constructor(name: string); + /** + * The time zone identifier. Can be an offset "-01:30" or an + * IANA time zone name "Europe/Amsterdam", or "localtime" for + * the local time zone. + */ + name(): string; + /** + * The kind of time zone (Local/Offset/Proper) + */ + kind(): TimeZoneKind; + /** + * Equality operator. Maps zero offsets and different names for UTC onto + * each other. Other time zones are not mapped onto each other. + */ + equals(other: TimeZone): boolean; + /** + * Is this zone equivalent to UTC? + */ + isUtc(): boolean; + /** + * Does this zone have Daylight Saving Time at all? + */ + hasDst(): boolean; + /** + * Calculate timezone offset from a UTC time. + * + * @param year Full year + * @param month Month 1-12 (note this deviates from JavaScript date) + * @param day Day of month 1-31 + * @param hour Hour 0-23 + * @param minute Minute 0-59 + * @param second Second 0-59 + * @param millisecond Millisecond 0-999 + * + * @return the offset of this time zone with respect to UTC at the given time, in minutes. + */ + offsetForUtc(year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number): number; + /** + * Calculate timezone offset from a zone-local time (NOT a UTC time). + * @param year local full year + * @param month local month 1-12 (note this deviates from JavaScript date) + * @param day local day of month 1-31 + * @param hour local hour 0-23 + * @param minute local minute 0-59 + * @param second local second 0-59 + * @param millisecond local millisecond 0-999 + * @return the offset of this time zone with respect to UTC at the given time, in minutes. + */ + offsetForZone(year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number): number; + /** + * Note: will be removed in version 2.0.0 + * + * Convenience function, takes values from a Javascript Date + * Calls offsetForUtc() with the contents of the date + * + * @param date: the date + * @param funcs: the set of functions to use: get() or getUTC() + */ + offsetForUtcDate(date: Date, funcs: javascript.DateFunctions): number; + /** + * Note: will be removed in version 2.0.0 + * + * Convenience function, takes values from a Javascript Date + * Calls offsetForUtc() with the contents of the date + * + * @param date: the date + * @param funcs: the set of functions to use: get() or getUTC() + */ + offsetForZoneDate(date: Date, funcs: javascript.DateFunctions): number; + /** + * Zone abbreviation at given UTC timestamp e.g. CEST for Central European Summer Time. + * + * @param year Full year + * @param month Month 1-12 (note this deviates from JavaScript date) + * @param day Day of month 1-31 + * @param hour Hour 0-23 + * @param minute Minute 0-59 + * @param second Second 0-59 + * @param millisecond Millisecond 0-999 + * @param dstDependent (default true) set to false for a DST-agnostic abbreviation + * + * @return "local" for local timezone, the offset for an offset zone, or the abbreviation for a proper zone. + */ + abbreviationForUtc(year: number, month: number, day: number, hour?: number, minute?: number, second?: number, millisecond?: number, dstDependent?: boolean): string; + /** + * Normalizes non-existing local times by adding a forward offset change. + * During a forward standard offset change or DST offset change, some amount of + * local time is skipped. Therefore, this amount of local time does not exist. + * This function adds the amount of forward change to any non-existing time. After all, + * this is probably what the user meant. + * + * @param localUnixMillis Unix timestamp in zone time + * @param opt (optional) Round up or down? Default: up + * + * @returns Unix timestamp in zone time, normalized. + */ + normalizeZoneTime(localUnixMillis: number, opt?: NormalizeOption): number; + /** + * The time zone identifier (normalized). + * Either "localtime", IANA name, or "+hh:mm" offset. + */ + toString(): string; + /** + * Used by util.inspect() + */ + inspect(): string; + /** + * Convert an offset number into an offset string + * @param offset The offset in minutes from UTC e.g. 90 minutes + * @return the offset in ISO notation "+01:30" for +90 minutes + */ + static offsetToString(offset: number): string; + /** + * String to offset conversion. + * @param s Formats: "-01:00", "-0100", "-01", "Z" + * @return offset w.r.t. UTC in minutes + */ + static stringToOffset(s: string): number; + } +} + +declare module '__timezonecomplete/globals' { + import datetime = require("__timezonecomplete/datetime"); + import duration = require("__timezonecomplete/duration"); + /** + * Returns the minimum of two DateTimes + */ + export function min(d1: datetime.DateTime, d2: datetime.DateTime): datetime.DateTime; + /** + * Returns the minimum of two Durations + */ + export function min(d1: duration.Duration, d2: duration.Duration): duration.Duration; + /** + * Returns the maximum of two DateTimes + */ + export function max(d1: datetime.DateTime, d2: datetime.DateTime): datetime.DateTime; + /** + * Returns the maximum of two Durations + */ + export function max(d1: duration.Duration, d2: duration.Duration): duration.Duration; +} + diff --git a/timezonecomplete/timezonecomplete-tests.ts b/timezonecomplete/timezonecomplete-tests.ts index 5ad8c8129..19dcd84c7 100644 --- a/timezonecomplete/timezonecomplete-tests.ts +++ b/timezonecomplete/timezonecomplete-tests.ts @@ -7,6 +7,7 @@ var n: number; var s: string; var w: tc.WeekDay; +n = tc.timeUnitToMilliseconds(tc.TimeUnit.Month); b = tc.isLeapYear(2014); n = tc.daysInMonth(2014, 10); n = tc.daysInYear(2014); @@ -28,6 +29,7 @@ var d4: tc.Duration = tc.Duration.milliseconds(24); var d5: tc.Duration = new tc.Duration(24); var d6: tc.Duration = new tc.Duration("00:01"); var d7: tc.Duration = d6.clone(); +var d8: tc.Duration = new tc.Duration(4, tc.TimeUnit.Second); n = d7.wholeHours(); n = d7.hours(); diff --git a/timezonecomplete/timezonecomplete.d.ts b/timezonecomplete/timezonecomplete.d.ts index a652335bb..4bf2a6a28 100644 --- a/timezonecomplete/timezonecomplete.d.ts +++ b/timezonecomplete/timezonecomplete.d.ts @@ -1,4 +1,4 @@ -// Type definitions for timezonecomplete 1.8.0 +// Type definitions for timezonecomplete 1.9.0 // Project: https://github.com/SpiritIT/timezonecomplete // Definitions by: Rogier Schouten // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -8,6 +8,7 @@ declare module 'timezonecomplete' { import basics = require("__timezonecomplete/basics"); export import TimeUnit = basics.TimeUnit; export import WeekDay = basics.WeekDay; + export import timeUnitToMilliseconds = basics.timeUnitToMilliseconds; export import isLeapYear = basics.isLeapYear; export import daysInMonth = basics.daysInMonth; export import daysInYear = basics.daysInYear; @@ -68,6 +69,15 @@ declare module '__timezonecomplete/basics' { Month = 5, Year = 6, } + /** + * Approximate number of milliseconds for a time unit. + * A day is assumed to have 24 hours, a month is assumed to equal 30 days + * and a year is set to 365 days. + * + * @param unit Time unit e.g. TimeUnit.Month + * @returns The number of milliseconds. + */ + export function timeUnitToMilliseconds(unit: TimeUnit): number; /** * @return True iff the given year is a leap year. */ @@ -662,6 +672,7 @@ declare module '__timezonecomplete/datetime' { } declare module '__timezonecomplete/duration' { + import basics = require("__timezonecomplete/basics"); /** * Time duration. Create one e.g. like this: var d = Duration.hours(1). * Note that time durations do not take leap seconds etc. into account: @@ -705,6 +716,12 @@ declare module '__timezonecomplete/duration' { * [-]h[:m[:s[.n]]] e.g. -01:00:30.501 */ constructor(input: string); + /** + * Construct a duration from an amount and a time unit. + * @param amount Number of units + * @param unit A time unit i.e. TimeUnit.Second, TimeUnit.Hour etc. + */ + constructor(amount: number, unit: basics.TimeUnit); /** * @return another instance of Duration with the same value. */ From 39a4dda864b5f282b196ee3d6a67a255b22d00f7 Mon Sep 17 00:00:00 2001 From: Tim Dumol Date: Wed, 29 Oct 2014 16:38:03 +0800 Subject: [PATCH 038/135] Add static methods of CKEDITOR.plugins and CKEDITOR.dialog. --- ckeditor/ckeditor-tests.ts | 38 ++++++++++++++++++++++++++++- ckeditor/ckeditor.d.ts | 49 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) diff --git a/ckeditor/ckeditor-tests.ts b/ckeditor/ckeditor-tests.ts index 976b85717..326fe92c6 100644 --- a/ckeditor/ckeditor-tests.ts +++ b/ckeditor/ckeditor-tests.ts @@ -251,4 +251,40 @@ function test_dom_window() { var size = win.getViewPaneSize(); alert(size.width); alert(size.height); -} \ No newline at end of file +} + +function test_adding_dialog_by_path() { + CKEDITOR.dialog.add( 'abbrDialog', this.path + 'dialogs/abbr.js' ); +} + +function test_adding_dialog_by_definition() { + CKEDITOR.dialog.add( 'abbrDialog', function ( editor: CKEDITOR.editor ) { + return { + title: 'Abbreviation Properties', + minWidth: 400, + minHeight: 200, + + contents: [ + { + id: 'tab-basic', + label: 'Basic Settings', + elements: [] + }, + { + id: 'tab-adv', + label: 'Advanced Settings', + elements: [] + } + ] + }; + }); +} + +function test_adding_plugin() { + CKEDITOR.plugins.add( 'abbr', { + icons: 'abbr', + init: function( editor: CKEDITOR.editor ) { + // empty logic + } + }); +} diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index a1bb1c481..6a0ed9775 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -619,6 +619,24 @@ declare module CKEDITOR { } } + interface IPluginDefinition { + hidpi?: boolean; + lang?: any; // should be string | string[] + requires?: any; // should be string | string[]a + afterInit?(editor: editor): any; + beforeInit?(editor: editor): any; + init?(editor: editor): any; + onLoad?(): any; + } + + function add(name: string, definition?: IPluginDefinition): void; + function addExternal(name: string, path: string, fileName: string): void; + function get(name: string): any; + function getFilePath(name: string): string; + function getPath(name: string): string; + function load(name: string, callback: string, scope: any): void; + function setLang(pluginName: string, languageCode: string, languageEntries: any): void; + } @@ -963,4 +981,35 @@ declare module CKEDITOR { addFocusable(element: CKEDITOR.dom.element, index: number): void; } + module tools { + var callFunction: Function; + } + + module dialog { + interface IDialogDefinition { + buttons?: any[]; + contents?: any[]; + height?: number; + minHeight?: number; + minWidth?: number; + onCancel?: Function; + onLoad?: Function; + onOk?: Function; + onShow?: Function; + resizable?: number; + title?: string; + width?: number; + } + + function add(name: string, path: string): void; + function add(name: string, dialogDefinition: IDialogDefinition): void; + function addIframe(name: string, title: string, minWidth: number, + minHeight: number, onContentLoad: Function, userDefinition: any): void; + function addUIElement(typeName: string, builder: Function): void; + function cancelButton(): void; + function exists(name: string): void; + function getCurrent(): void; + function isTabEnabled(editor: editor, dialogName: string, tabName: string): boolean; + function okButton(): void; + } } From e16d9f71f5b0a898895bf84c6237772b963ef1b9 Mon Sep 17 00:00:00 2001 From: Tim Dumol Date: Wed, 29 Oct 2014 17:45:48 +0800 Subject: [PATCH 039/135] Add properties of CKEDITOR.widgets.repository. --- ckeditor/ckeditor-tests.ts | 13 +++++ ckeditor/ckeditor.d.ts | 107 ++++++++++++++++++++++++++++++++++++- 2 files changed, 119 insertions(+), 1 deletion(-) diff --git a/ckeditor/ckeditor-tests.ts b/ckeditor/ckeditor-tests.ts index 326fe92c6..523c2c515 100644 --- a/ckeditor/ckeditor-tests.ts +++ b/ckeditor/ckeditor-tests.ts @@ -288,3 +288,16 @@ function test_adding_plugin() { } }); } + +function test_adding_widget() { + function wrapper(editor: CKEDITOR.editor) { + editor.widgets.add("widgetty", { + button: "Activate widgetty", + template: "", + dialog: "widgetty", + init: function() { + // no logic + } + }); + } +} diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index 6a0ed9775..491ae0157 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -614,8 +614,113 @@ declare module CKEDITOR { module widget { - class repository { + interface IWidget { + allowedContent: any; + button: string; + contentForms: Object; + contentTransformations: Object; + data: Function; + defaults: Object; + dialog: String; + downcast: any; // should be string | Function + downcasts: Object; + draggable: boolean; + editables: Object; + init: Function; + inline: Boolean; + insert: Function; + mask: Boolean; + name: String; + parts: Object; + pathName: string; + requiredContent: any; + styleToAllowedContentRules: Function; + styleableElements: string; + template: string; + upcast: any; // should be string | Function + upcasts: Object; + addClass(className: string): void; + applyStyle(style: any): void; // any should be CKEDITOR.style + capture(): void; + checkStyleActive(style: any): boolean; // any should be CKEDITOR.style + define(name: string, meta: {errorProof?: boolean}): void; + destroy(offline?: boolean): void; + destroyEditable(editableName:string, offline?: boolean): void; + edit(): boolean; + fire(eventName: string, data?: Object, editor?: editor): any; // should be boolean | Object + fireOnce(eventName: string, data?: Object, editor?: editor): any; // should be boolean | Object + focus(): void; + getClasses(): Object; + hasClass(className: string, Whether: boolean): void; + hasListeners(eventName: string): boolean; + initEditable(editableName: string, definition: any): boolean; // any should be CKEDITOR.plugins.widget.nestedEditable.definition + isInited(): boolean; + isReady(): boolean; + on(eventName: string, listenerFunction: Function, + scopeObj: Object, listenerData: Object, priority: number): Object; + once(): void; + removeAllListeners(): void; + removeClass(className: string): void; + removeListener(evnetName: string, listenerFunction: Function): void; + removeStyle(style: any): void; // any should be CKEDITOR.style + setData(keyOrData: any, value?: Object): IWidget; // any should be string | Object + setFocused(selected: boolean): IWidget; + setSelected(selected: boolean): IWidget; + toFeature(): any; // should be CKEDITOR.feature + updateDragHandlerPosition(): void; + } + + interface IWidgetDefinition { + allowedContent?: any; + button?: string; + contentForms?: Object; + contentTransformations?: Object; + data?: Function; + defaults?: Object; + dialog?: String; + downcast?: any; // should be string | Function + downcasts?: Object; + draggable?: boolean; + edit?: Function; + editables?: Object; + init?: Function; + inline?: Boolean; + insert?: Function; + mask?: Boolean; + name?: String; + parts?: Object; + pathName?: string; + requiredContent?: any; + styleToAllowedContentRules?: Function; + styleableElements?: string; + template?: string; + upcast?: any; // should be string | Function + upcasts?: Object; + toFeature?(): any; // should be CKEDITOR.feature + } + + class repository { + add(name: string, widgetDef: IWidgetDefinition): void; + addUpcastCallback(callback: Function): void; + capture(): void; + checkSelection(): void; + checkWidgets(options?: {initOnlyNew?: boolean; focusInited?: boolean}): void; + define(name: string, meta?: {errorProof?: boolean}): void; + del(widget: IWidget): void; + destroy(widget: IWidget, offline?: boolean): void; + destroyAll(offline?: boolean): void; + finalizeCreation(container: any): void; + fire(eventName: string, data: Object, editor: editor): any; // should be boolean | Object + getByElement(element: any, checkWrapperOnly: boolean): IWidget; + hasListeners(eventName: string): boolean; + initOn(element: any, widgetDef?: IWidgetDefinition, startupData?: Object): IWidget; + initOnAll(container?: any): IWidget[]; + on(eventName: string, listenerFunction: Function, scopeObj?: Object, listenerData?: Object, priority?: number): Object; + once(): void; + parseElementClasses(classes: string): Object; + removeAllListeners(eventName: string, listenerFunction: Function): void; + wrapElement(element: any, widgetName?: string): any; } } From 9b46da2218e044dcffe9f83cd7d03592af6795a4 Mon Sep 17 00:00:00 2001 From: Tim Dumol Date: Wed, 29 Oct 2014 17:00:31 +0800 Subject: [PATCH 040/135] Add sum() to sugar.d.ts. The nullary version of sum() was missing in sugar.d.ts (ony the unary version was present). --- sugar/sugar.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sugar/sugar.d.ts b/sugar/sugar.d.ts index de418b65e..11569a3b6 100644 --- a/sugar/sugar.d.ts +++ b/sugar/sugar.d.ts @@ -2820,7 +2820,7 @@ interface Array { * @see subtract **/ subtract(args: T[]): T[]; - + /** * Sums all values in the array. * @param map Property on each element in the array or callback function to sum up the elements. @@ -2836,6 +2836,11 @@ interface Array { **/ sum(map: string): number; + /** + * @see sum + **/ + sum(): number; + /** * @see sum **/ From 5d542e01133b06b84890cc7101a7a790877ee353 Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Wed, 29 Oct 2014 21:59:01 +0900 Subject: [PATCH 041/135] Add contributor --- CONTRIBUTORS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 52c592cc3..2bb25f2cc 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -245,7 +245,8 @@ All definitions files include a header with the author and editors, so at some p * [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC)) * [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov)) * [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel)) -* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) +* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) +* [Knockout Secure Binding](https://github.com/brianmhunt/knockout-secure-binding) (by [Pine Mizune](https://github.com/pine613)) * [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig)) * [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising)) * [Knockstrap](http://faulknercs.github.io/Knockstrap/) (by [Adam Pluciński](https://github.com/adaskothebeast)) From 83c228755fe21c6da6aa2fecde019b3fec42172e Mon Sep 17 00:00:00 2001 From: Justin Filip Date: Mon, 27 Oct 2014 15:34:46 -0400 Subject: [PATCH 042/135] Add type description for cookie.js --- CONTRIBUTORS.md | 1 + cookiejs/cookiejs-tests.ts | 30 ++++++++++++++++++++++++++++++ cookiejs/cookiejs.d.ts | 24 ++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 cookiejs/cookiejs-tests.ts create mode 100644 cookiejs/cookiejs.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 083204e8f..9152d04b1 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -64,6 +64,7 @@ All definitions files include a header with the author and editors, so at some p * [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) * [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem) and [vvakame](https://github.com/vvakame)) * [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [cookie.js](https://github.com/js-coder/cookie.js) (by [Boltmade](https://github.com/Boltmade)) * [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/)) * [Cordovarduino](https://github.com/stereolux/cordovarduino) (by [Hendrik Maus](https://github.com/hendrikmaus)) * [Couchbase / Couchnode](https://github.com/couchbase/couchnode) (by [Basarat Ali Syed](https://github.com/basarat)) diff --git a/cookiejs/cookiejs-tests.ts b/cookiejs/cookiejs-tests.ts new file mode 100644 index 000000000..b4dd6927b --- /dev/null +++ b/cookiejs/cookiejs-tests.ts @@ -0,0 +1,30 @@ +/// + +// Based on https://github.com/js-coder/cookie.js/blob/gh-pages/tests/spec.js + +cookie.set({a: '1', b: '2', c: '3'}); + +cookie; +cookie.enabled(); + +cookie.set('n', '5'); + +cookie.get('a'); +cookie.get('__undef__'); +cookie.get('__undef__', 'fallback'); +cookie.get(['a', 'b']); +cookie.get(['a', '__undef__'], 'fallback'); + +cookie('a'); +cookie('__undef__'); +cookie('__undef__', 'fallback'); +cookie(['a', 'b']); +cookie(['a', '__undef__'], 'fallback'); + +cookie.remove('a'); +cookie.remove('a', 'b'); +cookie.remove(['a', 'b']); + +cookie.empty(); + +cookie.all(); diff --git a/cookiejs/cookiejs.d.ts b/cookiejs/cookiejs.d.ts new file mode 100644 index 000000000..bdd71f021 --- /dev/null +++ b/cookiejs/cookiejs.d.ts @@ -0,0 +1,24 @@ +// Type definitions for cookie.js v1.0.0 +// Project: https://github.com/js-coder/cookie.js +// Definitions by: Boltmade +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare function cookie(key : string, fallback?: string) : string; +declare function cookie(keys : string[], fallback?: string) : string; + +declare module cookie { + export function set(key : string, value : string, options? : any) : void; + export function set(obj : any, options? : any) : void; + export function remove(key : string) : void; + export function remove(keys : string[]) : void; + export function remove(...args : string[]) : void; + export function empty() : void; + export function get(key : string, fallback?: string) : string; + export function get(keys : string[], fallback?: string) : string; + export function all() : any; + export function enabled() : boolean; +} + +declare module "cookiejs" { + export = cookie; +} From ace121de7a46f244110ea9d8cdc512c33146b31d Mon Sep 17 00:00:00 2001 From: Justin Filip Date: Tue, 28 Oct 2014 14:35:13 -0400 Subject: [PATCH 043/135] Add type definitions for Qajax --- CONTRIBUTORS.md | 1 + qajax/qajax-tests.ts | 68 ++++++++++++++++++++++++++++++++++++++++++++ qajax/qajax.d.ts | 27 ++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 qajax/qajax-tests.ts create mode 100644 qajax/qajax.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 083204e8f..2561b16b9 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -336,6 +336,7 @@ All definitions files include a header with the author and editors, so at some p * [ProgressJs](http://usablica.github.io/progress.js/) (by [Shunsuke Ohtani](https://github.com/zaneli)) * [promise-pool](https://github.com/vilic/promise-pool) (by [VILIC VANE](https://github.com/vilic)) * [Q](https://github.com/kriskowal/q) (by Barrie Nemetchek, Andrew Gaspar) +* [Qajax](https://github.com/gre/qajax) (by [Boltmade](https://github.com/Boltmade)) * [Q-io](https://github.com/kriskowal/q-io) (by [Bart van der Schoor](https://github.com/Bartvds)) * [q-retry](https://github.com/vilic/q-retry) (by [VILIC VANE](https://github.com/vilic)) * [QUnit](http://qunitjs.com/) (by [Diullei Gomes](https://github.com/Diullei)) diff --git a/qajax/qajax-tests.ts b/qajax/qajax-tests.ts new file mode 100644 index 000000000..820dce455 --- /dev/null +++ b/qajax/qajax-tests.ts @@ -0,0 +1,68 @@ +/// + +// Based on https://github.com/gre/qajax/blob/master/test/qajax.js + +function resetDefaults () { + Qajax.defaults.logs = true; + Qajax.defaults.timeout = 1000; + Qajax.defaults.method = "GET"; + Qajax.defaults.headers = {}; + Qajax.defaults.base = ""; +} + +var sample01url = "/test/dataset/sample01.json"; +var sample01json = [ + { "name": "Jerome", "age": 20 }, + { "name": "Gerard", "age": 30 }, + { "name": "Martine", "age": 43 } +]; + +var emptyUrl = "/test/dataset/empty"; + +function urlWithOptions (url : string, options : any) { + return url+"?"+Qajax.serialize(options); +} + +Qajax; +Qajax.filterStatus; +Qajax.filterSuccess; +Qajax.getJSON; +Qajax.serialize({ foo: 123, bar: "toto" }); +Qajax.getJSON(sample01url).then((res) => true, (err) => true); +Qajax(sample01url).then(Qajax.filterSuccess).then(Qajax.toJSON); +Qajax(emptyUrl, { params: { status: 404 } }).then(Qajax.filterSuccess).then(Qajax.toJSON); +Qajax({method: "POST", url: "/ECHO", data: "1234567890\nazerty\nuiopqsdfghjklm\nwxcvbn\n"}).then(Qajax.filterSuccess); +Qajax({method: "POST", url: "/ECHO", data: { foo: 123, bar: { value: 42 }, arr: [1, 2, 3] }}).then(Qajax.filterSuccess).then(Qajax.toJSON); +Qajax({ url: emptyUrl, params: { status: 201 } }).then(Qajax.filterStatus(200)); +Qajax({method: "POST", url: emptyUrl, params: { status: 500 }}).then(Qajax.filterSuccess).then(Qajax.toJSON); + +var cancellationD = Q.defer(); +var cancellation = cancellationD.promise; +Qajax({ cancellation: cancellation, url: urlWithOptions(emptyUrl, { latency: 400 }) }).then(Qajax.filterSuccess).then(Qajax.toJSON); + +Qajax.defaults.timeout = 200; +Qajax({method: "DELETE", url: sample01url, params: { latency: 500 }}); + +resetDefaults(); +Qajax({method: "POST", url: sample01url, params: { latency: 300 }, timeout: 2000}); + +Qajax.defaults.timeout = 200; +Qajax({method: "DELETE", url: sample01url, params: { latency: 500 }, timeout: 0}); + +resetDefaults(); +Qajax({headers: { "X-Hello": "world" }, method: "GET", url: "/ECHO_HEADERS"}).then(Qajax.filterSuccess).then(Qajax.toJSON); +Qajax({headers: { "X-Hi": "world" }, method: "GET", url: "/ECHO_HEADERS"}).then(Qajax.filterSuccess).then(Qajax.toJSON); +Qajax.defaults.headers = {"X-Foo": "bar"}; +Qajax({method: "GET", url: "/ECHO_HEADERS"}).then(Qajax.filterSuccess).then(Qajax.toJSON); + +resetDefaults(); +Qajax("sample01.json", {base: "/test/dataset/"}).then(Qajax.filterSuccess).then(Qajax.toJSON); +Qajax.defaults.base = "/test/dataset/"; +Qajax("empty").then(Qajax.filterSuccess); + +resetDefaults(); +Qajax.defaults.method = "POST"; +Qajax("/ECHO", { data: "1234567890\nazerty\nuiopqsdfghjklm\nwxcvbn\n", responseType: "text/plain" }).then(Qajax.filterSuccess); + +resetDefaults(); +Qajax.getJSON(urlWithOptions(sample01url, { latency: 50 })).then((res) => true, (err) => true, () => true); diff --git a/qajax/qajax.d.ts b/qajax/qajax.d.ts new file mode 100644 index 000000000..6989ea6d2 --- /dev/null +++ b/qajax/qajax.d.ts @@ -0,0 +1,27 @@ +// Type definitions for Qajax +// Project: https://github.com/gre/qajax +// Definitions by: Boltmade +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare function Qajax(url : string) : Q.Promise; +declare function Qajax(options : any) : Q.Promise; +declare function Qajax(url : string, options : any) : Q.Promise; + +declare module Qajax { + export var defaults : any; + export function filterStatus(validStatus : number) : (xhr : XMLHttpRequest) => Q.Promise; + export function filterStatus(validStatus : (status : number) => boolean) : (xhr : XMLHttpRequest) => Q.Promise; + export function filterSuccess() : Q.Promise; + + export function toJSON(xhr : XMLHttpRequest) : Q.Promise; + + export function getJSON(url : string) : Q.Promise; + + export function serialize(paramsObj : any) : string; +} + +declare module "qajax" { + export = Qajax; +} From 4e0f83c02ff424e386272685bf567c0dfd9ab09c Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Thu, 30 Oct 2014 01:33:59 +0900 Subject: [PATCH 044/135] Add cookie --- cookie/cookie-test.ts | 33 +++++++++++++++++++++++++++++++++ cookie/cookie.d.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 cookie/cookie-test.ts create mode 100644 cookie/cookie.d.ts diff --git a/cookie/cookie-test.ts b/cookie/cookie-test.ts new file mode 100644 index 000000000..fccb4b0d3 --- /dev/null +++ b/cookie/cookie-test.ts @@ -0,0 +1,33 @@ +/// + +import cookie = require('cookie'); + +function test_serialize(): void { + var retVal: string; + + retVal = cookie.serialize('foo', 'bar'); + retVal = cookie.serialize('foo', 'bar', { httpOnly: true }); +} + +function test_parse(): void { + var retVal: { [key: string]: string }; + + retVal = cookie.parse('foo=bar; bar=baz;'); + retVal = cookie.parse('foo=bar; bar=baz', { decode: x => x }); +} + +function test_options(): void { + var serializeOptions: CookieSerializeOptions = { + encode: (x: string) => x, + path: '/', + expires: new Date(), + maxAge: 200, + domain: 'example.com', + secure: false, + httpOnly: false + }; + + var parseOptios: CookieParseOptions = { + decode: (x: string) => x + }; +} diff --git a/cookie/cookie.d.ts b/cookie/cookie.d.ts new file mode 100644 index 000000000..a7151fc9f --- /dev/null +++ b/cookie/cookie.d.ts @@ -0,0 +1,28 @@ +// Type definitions for cookie v0.1.2 +// Project: https://github.com/jshttp/cookie +// Definitions by: Pine Mizune +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface CookieSerializeOptions { + encode?: (val: string) => string; + path?: string; + expires?: Date; + maxAge?: number; + domain?: string; + secure?: boolean; + httpOnly?: boolean; +} + +interface CookieParseOptions { + decode?: (val: string) => string; +} + +interface CookieStatic { + serialize(name: string, val: string, options?: CookieSerializeOptions): string; + parse(str: string, options?: CookieParseOptions): { [key: string]: string }; +} + +declare module "cookie" { + var cookie: CookieStatic; + export = cookie; +} From dcdb42d2556b01992e2bc41f81ee9c01ab38f827 Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Thu, 30 Oct 2014 01:38:12 +0900 Subject: [PATCH 045/135] Add contributor --- CONTRIBUTORS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 083204e8f..d6c24bc1c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -63,7 +63,8 @@ All definitions files include a header with the author and editors, so at some p * [Clone](https://github.com/pvorb/node-clone) (by [Kieran Simpson](https://github.com/kierans)) * [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) * [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem) and [vvakame](https://github.com/vvakame)) -* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [cookie](https://github.com/jshttp/cookie) (by [Pine Mizune](https://github.com/jshttp/cookie)) * [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/)) * [Cordovarduino](https://github.com/stereolux/cordovarduino) (by [Hendrik Maus](https://github.com/hendrikmaus)) * [Couchbase / Couchnode](https://github.com/couchbase/couchnode) (by [Basarat Ali Syed](https://github.com/basarat)) From 9d05959feaaa5e869b5ba49159a5a27c3bd47311 Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Thu, 30 Oct 2014 03:09:35 +0900 Subject: [PATCH 046/135] Bugfix --- zepto/zepto.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zepto/zepto.d.ts b/zepto/zepto.d.ts index d85072a66..5aa3aa825 100644 --- a/zepto/zepto.d.ts +++ b/zepto/zepto.d.ts @@ -1576,7 +1576,7 @@ interface ZeptoAjaxSettings { contentType?: string; dataType?: string; timeout?: number; - headers?: string; + headers?: { [key: string]: string }; async?: boolean; global?: boolean; context?: any; From f41b28ef4b632e37f6f32f86b8a5f8379de15a38 Mon Sep 17 00:00:00 2001 From: "Mackay, John" Date: Wed, 29 Oct 2014 14:26:14 -0700 Subject: [PATCH 047/135] Adding Angular 1.3's 'bindToController' directive property --- angularjs/angular.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 47f1e83d1..2c1436096 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1381,6 +1381,7 @@ declare module ng { compile?: IDirectiveCompileFn; controller?: any; controllerAs?: string; + bindToController?: boolean; link?: IDirectiveLinkFn; name?: string; priority?: number; From 2c2a82beb3e084314498f1b087ddd6b21a8c79b2 Mon Sep 17 00:00:00 2001 From: FredrikBorgstrom Date: Thu, 30 Oct 2014 01:01:28 +0100 Subject: [PATCH 048/135] applyBindings: made the viewmodel optional In order to use it for binding custom components, you can use appyBindings() without any arguments. --- knockout/knockout.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index f193438fd..861fc8fe3 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -412,7 +412,7 @@ interface KnockoutStatic { virtualElements: KnockoutVirtualElements; extenders: KnockoutExtenders; - applyBindings(viewModel: any, rootNode?: any): void; + applyBindings(viewModel?: any, rootNode?: any): void; applyBindingsToDescendants(viewModel: any, rootNode: any): void; applyBindingAccessorsToNode(node: Node, bindings: (bindingContext: KnockoutBindingContext, node: Node) => {}, bindingContext: KnockoutBindingContext): void; applyBindingAccessorsToNode(node: Node, bindings: {}, bindingContext: KnockoutBindingContext): void; From 99ac1b45ac8aa50de138bddeb7f1e78a4ceeaa1d Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Wed, 29 Oct 2014 20:18:28 -0500 Subject: [PATCH 049/135] Add backwards compat aliases in htmlparser2, and Parser constructor's (optional) 'options' argument --- htmlparser2/htmlparser2.d.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htmlparser2/htmlparser2.d.ts b/htmlparser2/htmlparser2.d.ts index 77fb0b983..ccf36d512 100644 --- a/htmlparser2/htmlparser2.d.ts +++ b/htmlparser2/htmlparser2.d.ts @@ -61,18 +61,26 @@ declare module "htmlparser2" { } export class Parser { - constructor(handler: Handler); + constructor(handler: Handler, options?: Options); /*** * Parses a chunk of data and calls the corresponding callbacks. * @param input */ write(input:string):void; + /*** + * alias for backwards compat + */ + parseChunk(input:string):void; /*** * Parses the end of the buffer and clears the stack, calls onend. */ end():void; + /*** + * alias for backwards compat + */ + done():void; /*** @@ -86,4 +94,4 @@ declare module "htmlparser2" { */ reset():void; } -} \ No newline at end of file +} From 9046f20cb6b8676b91e638d45c60a9f1d2ca663e Mon Sep 17 00:00:00 2001 From: Michele Ursino Date: Thu, 30 Oct 2014 03:42:12 +0000 Subject: [PATCH 050/135] Allows to pass a generic Object to Logger.child() - see https://github.com/trentm/node-bunyan#logchild --- bunyan/bunyan.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/bunyan/bunyan.d.ts b/bunyan/bunyan.d.ts index d26049bc3..3c780c48e 100644 --- a/bunyan/bunyan.d.ts +++ b/bunyan/bunyan.d.ts @@ -15,6 +15,7 @@ declare module "bunyan" { addStream(stream:Stream):void; addSerializers(serializers:Serializers):void; child(options:LoggerOptions, simple?:boolean):Logger; + child(obj:Object, simple?:boolean):Logger; reopenFileStreams():void; level(value:any /* number | string */):void; From 62b76782c869d09c879f47bb84a75185da7640be Mon Sep 17 00:00:00 2001 From: satoru kimura Date: Thu, 30 Oct 2014 12:21:49 +0900 Subject: [PATCH 051/135] Changed the file structure for ease of handling from tsd and added several utility classes. --- .../{examples/Detector.d.ts => detector.d.ts} | 0 .../examples/{Detector.ts => detector.ts} | 0 threejs/tests/three-tests-setup.ts | 23 +++++++-------- threejs/three-copyshader.d.ts | 10 +++++++ ...Renderer.d.ts => three-css3drenderer.d.ts} | 2 +- threejs/three-effectcomposer.d.ts | 28 ++++++++++++++++++ threejs/three-maskpass.d.ts | 29 +++++++++++++++++++ ...Controls.d.ts => three-orbitcontrols.d.ts} | 2 +- threejs/three-renderpass.d.ts | 27 +++++++++++++++++ threejs/three-shaderpass.d.ts | 25 ++++++++++++++++ threejs/three-tests.ts | 2 +- ...rols.d.ts => three-trackballcontrols.d.ts} | 2 +- 12 files changed, 134 insertions(+), 16 deletions(-) rename threejs/{examples/Detector.d.ts => detector.d.ts} (100%) rename threejs/tests/examples/{Detector.ts => detector.ts} (100%) create mode 100644 threejs/three-copyshader.d.ts rename threejs/{examples/CSS3DRenderer.d.ts => three-css3drenderer.d.ts} (95%) create mode 100644 threejs/three-effectcomposer.d.ts create mode 100644 threejs/three-maskpass.d.ts rename threejs/{examples/OrbitControls.d.ts => three-orbitcontrols.d.ts} (96%) create mode 100644 threejs/three-renderpass.d.ts create mode 100644 threejs/three-shaderpass.d.ts rename threejs/{examples/TrackballControls.d.ts => three-trackballcontrols.d.ts} (95%) diff --git a/threejs/examples/Detector.d.ts b/threejs/detector.d.ts similarity index 100% rename from threejs/examples/Detector.d.ts rename to threejs/detector.d.ts diff --git a/threejs/tests/examples/Detector.ts b/threejs/tests/examples/detector.ts similarity index 100% rename from threejs/tests/examples/Detector.ts rename to threejs/tests/examples/detector.ts diff --git a/threejs/tests/three-tests-setup.ts b/threejs/tests/three-tests-setup.ts index af594582f..235dd631d 100644 --- a/threejs/tests/three-tests-setup.ts +++ b/threejs/tests/three-tests-setup.ts @@ -3,21 +3,20 @@ ////////////////////////////////////////////////////////////// /// -/// -/// -/// -/// +/// +/// +/// +/// +/// +/// +/// +/// declare module THREE { var AWDLoader: any; - var DotScreenShader: any; var FlyControls: any; - var RenderPass: any; - var EffectComposer: any; - var RGBShiftShader: any; - var RenderPass: any; var BloomPass: any; - var ShaderPass: any; - var FXAAShader: any; - var CopyShader: any; + var DotScreenShader: Shader; + var RGBShiftShader: Shader; + var FXAAShader: Shader; } diff --git a/threejs/three-copyshader.d.ts b/threejs/three-copyshader.d.ts new file mode 100644 index 000000000..5eb92ae2b --- /dev/null +++ b/threejs/three-copyshader.d.ts @@ -0,0 +1,10 @@ +// Type definitions for CopyShader.js +// Project: https://github.com/mrdoob/three.js/blob/r68/examples/js/shaders/CopyShader.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module THREE { + export var CopyShader: Shader; +} diff --git a/threejs/examples/CSS3DRenderer.d.ts b/threejs/three-css3drenderer.d.ts similarity index 95% rename from threejs/examples/CSS3DRenderer.d.ts rename to threejs/three-css3drenderer.d.ts index 1d557b334..6f8a3679d 100644 --- a/threejs/examples/CSS3DRenderer.d.ts +++ b/threejs/three-css3drenderer.d.ts @@ -6,7 +6,7 @@ // This renderer does not work in IE. Can be found here for more information. // https://github.com/mrdoob/three.js/issues/4783 -/// +/// declare module THREE { class CSS3DObject extends Object3D { diff --git a/threejs/three-effectcomposer.d.ts b/threejs/three-effectcomposer.d.ts new file mode 100644 index 000000000..2066e6f00 --- /dev/null +++ b/threejs/three-effectcomposer.d.ts @@ -0,0 +1,28 @@ +// Type definitions for EffectComposer.js +// Project: https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/EffectComposer.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// + +declare module THREE { + export class EffectComposer { + constructor( renderer: WebGLRenderer, renderTarget?: WebGLRenderTarget); + + renderTarget1: WebGLRenderTarget; + renderTarget2: WebGLRenderTarget; + writeBuffer: WebGLRenderTarget; + readBuffer: WebGLRenderTarget; + passes: any[]; + copyPass: ShaderPass; + + swapBuffers(): void; + addPass(pass: any): void; + insertPass(pass: any, index: number): void; + render(delta: number): void; + reset(renderTarget?: WebGLRenderTarget): void; + setSize( width: number, height: number ): void; + } +} diff --git a/threejs/three-maskpass.d.ts b/threejs/three-maskpass.d.ts new file mode 100644 index 000000000..9576b3569 --- /dev/null +++ b/threejs/three-maskpass.d.ts @@ -0,0 +1,29 @@ +// Type definitions for MaskPass.js +// Project: https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/MaskPass.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module THREE { + export class MaskPass { + constructor( scene: Scene, camera: Camera); + + scene: Scene; + camera: Camera; + enabled: boolean; + clear: boolean; + needsSwap: boolean; + inverse: boolean; + + render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number): void; + } + + export class ClearMaskPass { + constructor(); + + enabled: boolean; + + render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number): void; + } +} diff --git a/threejs/examples/OrbitControls.d.ts b/threejs/three-orbitcontrols.d.ts similarity index 96% rename from threejs/examples/OrbitControls.d.ts rename to threejs/three-orbitcontrols.d.ts index 7671489ae..099f68754 100644 --- a/threejs/examples/OrbitControls.d.ts +++ b/threejs/three-orbitcontrols.d.ts @@ -3,7 +3,7 @@ // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// declare module THREE { class OrbitControls { diff --git a/threejs/three-renderpass.d.ts b/threejs/three-renderpass.d.ts new file mode 100644 index 000000000..4d94c575e --- /dev/null +++ b/threejs/three-renderpass.d.ts @@ -0,0 +1,27 @@ +// Type definitions for RenderPass.js +// Project: https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/RenderPass.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module THREE { + export class RenderPass { + constructor( scene: Scene, camera: Camera, overrideMaterial?: Material, clearColor?: Color, clearAlpha?: number ); + constructor( scene: Scene, camera: Camera, overrideMaterial?: Material, clearColor?: string, clearAlpha?: number ); + constructor( scene: Scene, camera: Camera, overrideMaterial?: Material, clearColor?: number, clearAlpha?: number ); + + scene: Scene; + camera: Camera; + overrideMaterial: Material; + clearColor: any; // Color or string or number + clearAlpha: number; + oldClearColor: Color; + oldClearAlpha: number; + enabled: boolean; + clear: boolean; + needsSwap: boolean; + + render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number): void; + } +} diff --git a/threejs/three-shaderpass.d.ts b/threejs/three-shaderpass.d.ts new file mode 100644 index 000000000..470aa46d7 --- /dev/null +++ b/threejs/three-shaderpass.d.ts @@ -0,0 +1,25 @@ +// Type definitions for ShaderPass.js +// Project: https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/ShaderPass.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module THREE { + export class ShaderPass { + constructor( shader: Shader, textureID?: string ); + + textureID: string; + uniforms: any; + material: ShaderMaterial; + renderToScreen: boolean; + enabled: boolean; + needsSwap: boolean; + clear: boolean; + camera: Camera; + scene: Scene; + quad: Mesh; + + render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number): void; + } +} diff --git a/threejs/three-tests.ts b/threejs/three-tests.ts index c99f08f23..0693d40bd 100644 --- a/threejs/three-tests.ts +++ b/threejs/three-tests.ts @@ -58,4 +58,4 @@ THE SOFTWARE. /// // examples test. -/// +/// diff --git a/threejs/examples/TrackballControls.d.ts b/threejs/three-trackballcontrols.d.ts similarity index 95% rename from threejs/examples/TrackballControls.d.ts rename to threejs/three-trackballcontrols.d.ts index 33d69011d..b4bda75ee 100644 --- a/threejs/examples/TrackballControls.d.ts +++ b/threejs/three-trackballcontrols.d.ts @@ -3,7 +3,7 @@ // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// declare module THREE { class TrackballControls { From 0e1e696d9140cecadad392381fdffcab657bd1dc Mon Sep 17 00:00:00 2001 From: ryiwamoto Date: Fri, 31 Oct 2014 01:07:34 +0900 Subject: [PATCH 052/135] add eventemitter2 --- CONTRIBUTORS.md | 1 + eventemitter2/eventemitter2-tests.ts | 92 +++++++++++++++++ eventemitter2/eventemitter2.d.ts | 146 +++++++++++++++++++++++++++ 3 files changed, 239 insertions(+) create mode 100644 eventemitter2/eventemitter2-tests.ts create mode 100644 eventemitter2/eventemitter2.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 70c85efb2..234fdad56 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -91,6 +91,7 @@ All definitions files include a header with the author and editors, so at some p * [ES6-Promises](https://github.com/jakearchibald/ES6-Promises) (by [François de Campredon](https://github.com/fdecampredon/)) * [Esprima](http://esprima.org/) (by [Teppei Sato](https://github.com/teppeis)) * [expect.js](https://github.com/LearnBoost/expect.js) (by [Teppei Sato](https://github.com/teppeis)) +* [EventEmitter2](https://github.com/asyncly/EventEmitter2) (by [Ryo Iwamoto](https://github.com/ryiwamoto)) * [expectations](https://github.com/spmason/expectations) (by [vvakame](https://github.com/vvakame)) * [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [express-session](https://www.npmjs.org/package/express-session) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) diff --git a/eventemitter2/eventemitter2-tests.ts b/eventemitter2/eventemitter2-tests.ts new file mode 100644 index 000000000..831561b87 --- /dev/null +++ b/eventemitter2/eventemitter2-tests.ts @@ -0,0 +1,92 @@ +/// + +// import eventemitter2 = require("eventemitter2"); +// var EventEmitter2 = eventemitter2.EventEmitter2; + +function testConfiguration() { + var foo = new EventEmitter2({ + wildcard: true, + delimiter: '::', + newListener: false, + maxListeners: 20 + }); + var bar = new EventEmitter2({}); + var bazz = new EventEmitter2(); +} + +var server = new EventEmitter2(); + +function testAddListener() { + server.addListener('data', function (value1: any, value2: any, value3: any) { + console.log('The event was raised!'); + }); + + server.addListener('data', function (value: any) { + console.log('The event was raised!'); + }); +} + +function testOn() { + server.on('data', function (value1: any, value2: any, value3: any) { + console.log('The event was raised!'); + }); + + server.on('data', function (value: any) { + console.log('The event was raised!'); + }); +} + +function testOnAny() { + server.onAny(function (value: any) { + console.log('All events trigger this.'); + }); +} + +function testOffAny() { + server.offAny(function (value: any) { + console.log('The event was raised!'); + }); +} + +function testOnce() { + server.once('get', function (value: any) { + console.log('Ah, we have our first value!'); + }); +} + +function testMany() { + server.many('get', 4, function (value: any) { + console.log('This event will be listened to exactly four times.'); + }); +} + +function testRemoveListener() { + var callback = function (value: any) { + console.log('someone connected!'); + }; + server.on('get', callback); + server.removeListener('get', callback); +} + +function testRemoveAllListeners() { + server.removeAllListeners(["test::event", "another::test::event"]); + server.removeAllListeners("test"); + server.removeAllListeners(); +} + +function testSetMaxListeners() { + server.setMaxListeners(40); +} + +function testListeners() { + console.log(server.listeners('get')); +} + +function testListenersAny() { + console.log(server.listenersAny()[0]); +} + +function testEmit() { + server.emit('foo.bazz'); + server.emit(['foo', 'bar']); +} diff --git a/eventemitter2/eventemitter2.d.ts b/eventemitter2/eventemitter2.d.ts new file mode 100644 index 000000000..a02124c37 --- /dev/null +++ b/eventemitter2/eventemitter2.d.ts @@ -0,0 +1,146 @@ +// Type definitions for EventEmitter2 v0.14.4 +// Project: https://github.com/asyncly/EventEmitter2 +// Definitions by: ryiwamoto +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module eventemitter2 { + interface Configuration { + /** + * use wildcards + */ + wildcard?: boolean; + + /** + * the delimiter used to segment namespaces, defaults to `.`. + */ + delimiter?: string; + + /** + * if you want to emit the newListener event set to true. + */ + newListener?: boolean; + + /** + * max listeners that can be assigned to an event, default 10. + */ + maxListeners?: number; + } + + export class EventEmitter2 { + /** + * @param conf + */ + constructor(conf?: Configuration); + + /** + * Adds a listener to the end of the listeners array for the specified event. + * @param event + * @param listener + */ + addListener(event: string, listener: Function): EventEmitter2; + + /** + * Adds a listener to the end of the listeners array for the specified event. + * @param event + * @param listener + */ + on(event: string, listener: Function): EventEmitter2; + + /** + * Adds a listener that will be fired when any event is emitted. + * @param listener + */ + onAny(listener: Function): EventEmitter2; + + /** + * Removes the listener that will be fired when any event is emitted. + * @param listener + */ + offAny(listener: Function): EventEmitter2; + + /** + * Adds a one time listener for the event. + * The listener is invoked only the first time the event is fired, after which it is removed. + * @param event + * @param listener + */ + once(event: string, listener: Function): EventEmitter2; + + /** + * Adds a listener that will execute n times for the event before being removed. + * The listener is invoked only the first n times the event is fired, after which it is removed. + * @param event + * @param timesToListen + * @param listener + */ + many(event: string, timesToListen: number, listener: Function): EventEmitter2; + + /** + * Remove a listener from the listener array for the specified event. + * Caution: changes array indices in the listener array behind the listener. + * @param event + * @param listener + */ + removeListener(event: string, listener: Function): EventEmitter2; + + /** + * Remove a listener from the listener array for the specified event. + * Caution: changes array indices in the listener array behind the listener. + * @param event + * @param listener + */ + off(event: string, listener: Function): EventEmitter2; + + /** + * Removes all listeners, or those of the specified event. + * @param event + */ + removeAllListeners(event?: string): EventEmitter2; + + /** + * Removes all listeners, or those of the specified event. + * @param events + */ + removeAllListeners(events: string[]): EventEmitter2; + + /** + * By default EventEmitters will print a warning if more than 10 listeners are added to it. + * This is a useful default which helps finding memory leaks. + * Obviously not all Emitters should be limited to 10. This function allows that to be increased. + * Set to zero for unlimited. + * @param n + */ + setMaxListeners(n: number): void; + + /** + * Returns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners. + * @param event + */ + listeners(event: string): Function[]; + + /** + * Returns an array of listeners that are listening for any event that is specified. + * This array can be manipulated, e.g. to remove listeners. + */ + listenersAny(): Function[]; + + /** + * Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. + * @param event + * @param args + */ + emit(event: string, ...args: string[]): boolean; + + /** + * Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. + * @param event + */ + emit(event: string[]): boolean; + } +} + +declare module "eventemitter2" { + export = eventemitter2; +} + +declare var EventEmitter2: typeof eventemitter2.EventEmitter2; From 0573a8bf5d76b261f71ef4f6576d036ca0e3de59 Mon Sep 17 00:00:00 2001 From: Yang Guan Date: Fri, 31 Oct 2014 00:25:51 -0700 Subject: [PATCH 053/135] Add type definitions for heatmap.js --- heatmap.js/heatmap-tests.ts | 42 +++++++++++ heatmap.js/heatmap.d.ts | 134 ++++++++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+) create mode 100644 heatmap.js/heatmap-tests.ts create mode 100644 heatmap.js/heatmap.d.ts diff --git a/heatmap.js/heatmap-tests.ts b/heatmap.js/heatmap-tests.ts new file mode 100644 index 000000000..c61458fae --- /dev/null +++ b/heatmap.js/heatmap-tests.ts @@ -0,0 +1,42 @@ +/// + +var baseLayer = L.tileLayer( + 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { + attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © CloudMade', + maxZoom: 18 + }); + +var testData: HeatmapDataObject = { + max: 8, + data: [ + { + lat: 24.6408, + lng:46.7728, + count: 3 + }, { + lat: 50.75, + lng: -1.55, + count: 1 + } + ] +}; + +var config : HeatmapConfiguration = { + radius: 2, + maxOpacity: .8, + scaleRadius: true, + useLocalExtrema: true, + latField: 'lat', + lngField: 'lng', + valueField: 'count' +}; + +var heatmapLayer = new HeatmapOverlay(config); + +var map = new L.Map('map-canvas', { + center: new L.LatLng(25.6586, -80.3568), + zoom: 4, + layers: [baseLayer, heatmapLayer] +}); + +heatmapLayer.setData(testData); diff --git a/heatmap.js/heatmap.d.ts b/heatmap.js/heatmap.d.ts new file mode 100644 index 000000000..bff76db98 --- /dev/null +++ b/heatmap.js/heatmap.d.ts @@ -0,0 +1,134 @@ +// Type definitions for heatmap.js v2.0 +// Project: https://github.com/pa7/heatmap.js/ +// Definitions by: Yang Guan +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/* + * Configuration object of a heatmap + */ +interface HeatmapConfiguration { + + /* + * A background color string in form of hexcode, color name, or rgb(a) + */ + backgroundColor?: string; + + /* + * An object that represents the gradient + */ + gradient?: any; + + /* + * The radius each datapoint will have (if not specified on the datapoint + * itself) + */ + radius?: number; + + /* + * The radius each datapoint will have (if not specified on the datapoint + * itself) + */ + useLocalExtrema?: boolean; + + /* + * A global opacity for the whole heatmap. This overrides maxOpacity and + * minOpacity if set + */ + opacity?: number; + + /* + * The maximal opacity the highest value in the heatmap will have. (will be + * overridden if opacity set) + * Default value: 0.6 + */ + maxOpacity?: number; + + /* + * The minimum opacity the lowest value in the heatmap will have (will be + * overridden if opacity set) + */ + minOpacity?: number; + + /* + * The blur factor that will be applied to all datapoints. The higher the + * blur factor is, the smoother the gradients will be + * Default value: 0.85 + */ + blur?: number; + + /* + * The property name of your latitude coordinate in a datapoint + * Default value: 'x' + */ + latField?: string; + + /* + * The property name of your longitude coordinate in a datapoint + * Default value: 'y' + */ + lngField?: string; + + /* + * The property name of your y coordinate in a datapoint + */ + valueField: string; +} + +/* + * A single data point on a heatmap. The keys are specified by + * HeatmapConfig.latField, HeatmapConfig.lngField and HeatmapConfig.valueField + */ +interface HeatmapDataPoint { + [index: string] : number; +} + +/* + * An object representing the set of data points on a heatmap. + */ +interface HeatmapDataObject { + + /* + * Max value of of the valueField + */ + max?: number; + + /* + * Min value of of the valueField + */ + min?: number; + + /* + * An array of HeatmapDataPoints + */ + data: HeatmapDataPoint[]; +} + +/* + * The overlay layer to be added onto leaflet map + */ +declare class HeatmapOverlay { + + /* + * Initialization function + */ + constructor(configuration: HeatmapConfiguration) + + /* + * Create DOM elements for othe overlay, adding them to map panes and + * puts listeners on relevant map events + */ + onAdd(map: L.Map): void; + + /* + * Remove the overlay's elements from the DOM and remove listeners + * previously added by onAdd() + */ + onRemove(map: L.Map): void; + + /* + * Initialize a heatmap instance with the given dataset + */ + setData(data: {}): void; +} From e0d184fc836d56ad435c926885dc67a4fb3729d8 Mon Sep 17 00:00:00 2001 From: Damiano Date: Fri, 31 Oct 2014 18:04:28 +0100 Subject: [PATCH 054/135] Update ckeditor Added toolbarGroups and removePlugins on configuration object. http://docs.ckeditor.com/#!/guide/dev_toolbar --- ckeditor/ckeditor.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index 491ae0157..315f9bdf1 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -550,11 +550,17 @@ declare module CKEDITOR { } + interface toolbarGroups { + name?: string; + groups?: string[]; + } interface config { startupMode?: string; removeButtons?: string; + removePlugins?: string; toolbar?: any; + toolbarGroups?: toolbarGroups[]; skin?: string; language?: string; plugins?: string; From 05896329891138898edee72177aefa1e3482453d Mon Sep 17 00:00:00 2001 From: Yang Guan Date: Fri, 31 Oct 2014 12:20:52 -0700 Subject: [PATCH 055/135] Update contributor list --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 234fdad56..197492f8b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -140,6 +140,7 @@ All definitions files include a header with the author and editors, so at some p * [HashMap](https://github.com/flesler/hashmap) (by [Rafał Wrzeszcz](https://wrzasq.pl)) * [HashSet](http://www.timdown.co.uk/jshashtable/jshashset.html) (by [Sergey Gerasimov](https://github.com/gerich-home)) * [Hashtable](http://www.timdown.co.uk/jshashtable/) (by [Sergey Gerasimov](https://github.com/gerich-home)) +* [heatmap.js](https://github.com/pa7/heatmap.js/) (by [Yang Guan](https://github.com/lookuptable)) * [HelloJS](http://adodson.com/hello.js) (by [Pavel Zika](https://github.com/PavelPZ)) * [Highcharts](http://www.highcharts.com/) (by [damianog](https://github.com/damianog)) * [Highland](http://highlandjs.org/) (by [Bart van der Schoor](https://github.com/Bartvds/)) From 9e30e0687f1345fbfce0769b29e76d8962e8465e Mon Sep 17 00:00:00 2001 From: ryiwamoto Date: Fri, 31 Oct 2014 20:30:59 +0900 Subject: [PATCH 056/135] add wolfy87-eventemitter --- CONTRIBUTORS.md | 1 + .../wolfy87-eventemitter-test.ts | 111 ++++ .../wolfy87-eventemitter.d.ts | 512 ++++++++++++++++++ 3 files changed, 624 insertions(+) create mode 100644 wolfy87-eventemitter/wolfy87-eventemitter-test.ts create mode 100644 wolfy87-eventemitter/wolfy87-eventemitter.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 234fdad56..9d27a0d1d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -427,6 +427,7 @@ All definitions files include a header with the author and editors, so at some p * [websocket](https://github.com/Worlize/WebSocket-Node) (by [Paul Loyd](https://github.com/loyd)) * [WinJS](http://msdn.microsoft.com/en-us/library/windows/apps/br229773.aspx) (from TypeScript samples) * [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) (from TypeScript samples) +* [wolfy87-eventemitter](https://github.com/Wolfy87/EventEmitter) (by [Ryo Iwamoto](https://github.com/ryiwamoto)) * [ws](http://einaros.github.io/ws/) (by [Paul Loyd](https://github.com/loyd)) * [x2js](https://code.google.com/p/x2js/) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) * [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) (by [Michel Salib](https://github.com/michelsalib)) diff --git a/wolfy87-eventemitter/wolfy87-eventemitter-test.ts b/wolfy87-eventemitter/wolfy87-eventemitter-test.ts new file mode 100644 index 000000000..adef23a39 --- /dev/null +++ b/wolfy87-eventemitter/wolfy87-eventemitter-test.ts @@ -0,0 +1,111 @@ +/// + +//import EventEmitter = require("wolfy87-eventemitter"); + +var emitter = new EventEmitter(); + +var listener = function (value: any) { + console.log("The event was raised."); +}; + +function testGetListeners() { + var listeners: Function[] = emitter.getListeners("foo"); + var listenersSearchedByRegexp: {[key:string]: Function} = emitter.getListeners(/^foo/); +} + +function testFlattenListeners() { + var listeners: Function[] = emitter.flattenListeners([{listener: listener}]); +} + +function testGetListenersAsObject() { + emitter.getListenersAsObject("foo"); + emitter.getListenersAsObject(/^foo/); +} + +function testAddListener() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .addListener("foo", listener) + .addListener(/^foo/, listener); +} + +function testOn() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .on("foo", listener) + .on(/^foo/, listener); +} + +function testAddOnceListener() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .addOnceListener("foo", listener) + .addOnceListener(/^foo/, listener); +} + +function testOnce() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .once("foo", listener) + .once(/^foo/, listener); +} + +function testDefineEvent() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.defineEvent("foo"); +} + +function testDefineEvents() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.defineEvents(["foo", "bar"]); +} + +function testAddListeners() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .addListeners("foo", [listener]) + .addListeners({ + "foo": listener, + "bar": [listener] + }); +} + +function testRemoveListeners() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .removeListeners("foo", [listener]) + .removeListeners({ + "foo": listener, + "bar": [listener] + }); +} + +function testRemoveListener() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.removeListener("foo", listener); +} + +function testManipulateListeners() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .manipulateListeners(true, "foo", [listener]) + .manipulateListeners(true, { + "foo": listener + }); +} + +function testRemoveEvent() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.removeEvent("foo").removeEvent(); +} + +function testEmitEvent() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.emitEvent("foo", ["arg1", "arg2"]).emitEvent("foo"); +} + +function testTrigger() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.trigger("foo", ["arg1", "arg2"]).trigger("foo"); +} + +function testEmit() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.emit("foo", ["arg1", "arg2"]).emit("foo"); +} + +function testSetOnceReturnValue() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.setOnceReturnValue(false); +} + +function testNoConflict() { + var NoConflictEventEmitter = EventEmitter.noConflict(); + var e: Wolfy87EventEmitter.EventEmitter = new NoConflictEventEmitter(); +} + diff --git a/wolfy87-eventemitter/wolfy87-eventemitter.d.ts b/wolfy87-eventemitter/wolfy87-eventemitter.d.ts new file mode 100644 index 000000000..59c17284a --- /dev/null +++ b/wolfy87-eventemitter/wolfy87-eventemitter.d.ts @@ -0,0 +1,512 @@ +// Type definitions for wolfy87-eventemitter v4.2.9 +// Project: https://github.com/Wolfy87/EventEmitter +// Definitions by: ryiwamoto +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Wolfy87EventEmitter { + + /** + * Hash Object for manipulating multiple events. + */ + interface MultipleEvents { + [event:string]: any //Function | Function[] + } + + /** + * Class for managing events. + * Can be extended to provide event functionality in other classes. + * + * @class EventEmitter Manages event registering and emitting. + */ + export class EventEmitter { + /** + * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version. + * @return {Function} Non conflicting EventEmitter class. + */ + static noConflict(): typeof EventEmitter; + + /** + * Returns the listener array for the specified event. + * Will initialise the event object and listener arrays if required. + * Will return an object if you use a regex search. The object contains keys for each matched event. + * So /ba[rz]/ might return an object containing bar and baz. + * But only if you have either defined them with defineEvent or added some listeners to them. + * Each property in the object response is an array of listener functions. + * + * @param {string|RegExp} event Name of the event to return the listeners from. + * @return {Function[|Object]} All listener functions for the event. + */ + getListeners(event: string): Function[]; + + /** + * Returns the listener array for the specified event. + * Will initialise the event object and listener arrays if required. + * Will return an object if you use a regex search. The object contains keys for each matched event. + * So /ba[rz]/ might return an object containing bar and baz. + * But only if you have either defined them with defineEvent or added some listeners to them. + * Each property in the object response is an array of listener functions. + * + * @param {string|RegExp} event Name of the event to return the listeners from. + * @return {Function[]|Object} All listener functions for the event. + */ + getListeners(event: RegExp): {[event:string]: Function}; + + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {string|RegExp} event Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addListener(event: string, listener: Function): EventEmitter; + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {string|RegExp} event Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addListener(event: RegExp, listener: Function): EventEmitter; + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {string|RegExp} event Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + on(event: string, listener: Function): EventEmitter; + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {string|RegExp} event Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + on(event: RegExp, listener: Function): EventEmitter; + + /** + * Takes a list of listener objects and flattens it into a list of listener functions. + * + * @param {Object[]} listeners Raw listener objects. + * @return {Function[]} Just the listener functions. + */ + flattenListeners(listeners: {listener: Function}[]): Function[]; + + /** + * Fetches the requested listeners via getListeners but will always return the results inside an object. + * This is mainly for internal use but others may find it useful. + * + * @param event {string|RegExp} Name of the event to return the listeners from. + * @return {Object} All listener functions for an event in object + */ + getListenersAsObject(event: string): {[event:string]: Function}; + + /** + * Fetches the requested listeners via getListeners but will always return the results inside an object. + * This is mainly for internal use but others may find it useful. + * + * @param event {string|RegExp} Name of the event to return the listeners from. + * @return {Object} All listener functions for an event in object + */ + getListenersAsObject(event: RegExp): {[event:string]: Function}; + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after it's first execution. + * + * @param event {string|RegExp} Name of the event to attach the listener to. + * @param listener {Function} Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addOnceListener(event: string, listener: Function): EventEmitter; + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after it's first execution. + * + * @param event {string|RegExp} Name of the event to attach the listener to. + * @param listener {Function} Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addOnceListener(event: RegExp, listener: Function): EventEmitter; + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after it's first execution. + * + * @param event {string|RegExp} Name of the event to attach the listener to. + * @param listener {Function} Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + once(event: string, listener: Function): EventEmitter; + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after it's first execution. + * + * @param event {string|RegExp} Name of the event to attach the listener to. + * @param listener {Function} Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + once(event: RegExp, listener: Function): EventEmitter; + + /** + * Defines an event name. + * This is required if you want to use a regex to add a listener to multiple events at once. + * If you don't do this then how do you expect it to know what event to add to? + * Should it just add to every possible match for a regex? No. That is scary and bad. + * You need to tell it what event names should be matched by a regex. + * + * @param {string} event Name of the event to create. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + defineEvent(event: string): EventEmitter; + + /** + * Defines an event name. + * This is required if you want to use a regex to add a listener to multiple events at once. + * If you don't do this then how do you expect it to know what event to add to? + * Should it just add to every possible match for a regex? No. That is scary and bad. + * You need to tell it what event names should be matched by a regex. + * + * @param {string[]} events Name of the event to create. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + defineEvents(events: string[]): EventEmitter; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} event Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeListener(event: string, listener: Function): EventEmitter; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} event Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeListener(event: RegExp, listener: Function): EventEmitter; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} event Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + off(event: string, listener: Function): EventEmitter; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} event Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + off(event: RegExp, listener: Function): EventEmitter; + + /** + * Adds listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can add to multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added. + * You can also pass it a regular expression to add the array of listeners to all events that match it. + * Yeah, this function does quite a bit. That's probably a bad thing. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add to multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addListeners(event: string, listeners: Function[]): EventEmitter; + + /** + * Adds listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can add to multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added. + * You can also pass it a regular expression to add the array of listeners to all events that match it. + * Yeah, this function does quite a bit. That's probably a bad thing. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add to multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addListeners(event: RegExp, listeners: Function[]): EventEmitter; + + /** + * Adds listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can add to multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added. + * You can also pass it a regular expression to add the array of listeners to all events that match it. + * Yeah, this function does quite a bit. That's probably a bad thing. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add to multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addListeners(event: MultipleEvents): EventEmitter; + + /** + * Removes listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be removed. + * You can also pass it a regular expression to remove the listeners from all events that match it. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeListeners(event: string, listeners: Function[]): EventEmitter; + + /** + * Removes listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be removed. + * You can also pass it a regular expression to remove the listeners from all events that match it. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeListeners(event: RegExp, listeners: Function[]): EventEmitter; + + /** + * Removes listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be removed. + * You can also pass it a regular expression to remove the listeners from all events that match it. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeListeners(event: MultipleEvents): EventEmitter; + + /** + * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. + * You should really use those instead, this is a little lower level. + * The first argument will determine if the listeners are removed (true) or added (false). + * If you pass an object as the second argument you can add/remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added/removed. + * You can also pass it a regular expression to manipulate the listeners of all events that match it. + * + * @param {Boolean} remove True if you want to remove listeners, false if you want to add. + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add/remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add/remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + manipulateListeners(remove: boolean, event: string, listeners: Function[]): EventEmitter; + + /** + * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. + * You should really use those instead, this is a little lower level. + * The first argument will determine if the listeners are removed (true) or added (false). + * If you pass an object as the second argument you can add/remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added/removed. + * You can also pass it a regular expression to manipulate the listeners of all events that match it. + * + * @param {Boolean} remove True if you want to remove listeners, false if you want to add. + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add/remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add/remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + manipulateListeners(remove: boolean, event: RegExp, listeners: Function[]): EventEmitter; + + /** + * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. + * You should really use those instead, this is a little lower level. + * The first argument will determine if the listeners are removed (true) or added (false). + * If you pass an object as the second argument you can add/remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added/removed. + * You can also pass it a regular expression to manipulate the listeners of all events that match it. + * + * @param {Boolean} remove True if you want to remove listeners, false if you want to add. + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add/remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add/remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + manipulateListeners(remove: boolean, event: MultipleEvents): EventEmitter; + + /** + * Removes all listeners from a specified event. + * If you do not specify an event then all listeners will be removed. + * That means every event will be emptied. + * You can also pass a regex to remove all events that match it. + * + * @param {String|RegExp} [event] Optional name of the event to remove all listeners for. + * Will remove from every event if not passed. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeEvent(event?: string): EventEmitter; + + /** + * Removes all listeners from a specified event. + * If you do not specify an event then all listeners will be removed. + * That means every event will be emptied. + * You can also pass a regex to remove all events that match it. + * + * @param {String|RegExp} [event] Optional name of the event to remove all listeners for. + * Will remove from every event if not passed. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeEvent(event?: RegExp): EventEmitter; + + /** + * Alias of removeEvent. + * + * Added to mirror the node API. + */ + removeAllListeners(event: string): EventEmitter; + + /** + * Alias of removeEvent. + * + * Added to mirror the node API. + */ + removeAllListeners(event: RegExp): EventEmitter; + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + emitEvent(event: string, ...args: any[]): EventEmitter; + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + emitEvent(event: RegExp, ...args: any[]): EventEmitter; + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + trigger(event: string, ...args: any[]): EventEmitter; + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + trigger(event: RegExp, ...args: any[]): EventEmitter; + + /** + * Subtly different from emitEvent in that it will pass its arguments on to the listeners, + * as opposed to taking a single array of arguments to pass on. + * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {... any[]} args Optional additional arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + emit(event: string, ...args: any[]): EventEmitter; + + /** + * Subtly different from emitEvent in that it will pass its arguments on to the listeners, + * as opposed to taking a single array of arguments to pass on. + * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {... any[]} args Optional additional arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + emit(event: RegExp, ...args: any[]): EventEmitter; + + /** + * Sets the current value to check against when executing listeners. If a + * listeners return value matches the one set here then it will be removed + * after execution. This value defaults to true. + * + * @param {any} value The new value to check for when executing listeners. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + setOnceReturnValue(value: any): EventEmitter; + } +} + +declare module "wolfy87-eventemitter" { + export = EventEmitter; +} + +declare var EventEmitter: typeof Wolfy87EventEmitter.EventEmitter; + From d290ea22c1d83d337aaa5e04fc01b3240acfa41e Mon Sep 17 00:00:00 2001 From: RHAD1969 Date: Sat, 1 Nov 2014 19:47:18 +0100 Subject: [PATCH 057/135] Update breeze.d.ts Added: createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: StrategySymbol): Entity; to the breeze class. --- breeze/breeze.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/breeze/breeze.d.ts b/breeze/breeze.d.ts index fab5dd077..7aad436ba 100644 --- a/breeze/breeze.d.ts +++ b/breeze/breeze.d.ts @@ -376,6 +376,7 @@ declare module breeze { clear(): void; createEmptyCopy(): EntityManager; createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol) : Entity; + createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: StrategySymbol): Entity; createEntity(entityType: EntityType, config?: {}, entityState?: EntityStateSymbol): Entity; detachEntity(entity: Entity): boolean; executeQuery(query: string, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Q.Promise; From 9fbcb5108ecda264110ce15d2a9d5d7ad65968fe Mon Sep 17 00:00:00 2001 From: Philipp Simon Schmidt Date: Sun, 2 Nov 2014 01:04:13 +0000 Subject: [PATCH 058/135] Allow param and fparam be executed without a parameterName --- purl/purl.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/purl/purl.d.ts b/purl/purl.d.ts index 00312595e..0686b6269 100644 --- a/purl/purl.d.ts +++ b/purl/purl.d.ts @@ -1,10 +1,14 @@ -// Type definitions for Purl 2.3.1 +// Type definitions for Purl 2.3.1 // Project: https://github.com/allmarkedup/purl // Definitions by: Daniel Ferreira Monteiro Alves // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module purl { + interface ParameterMap { + [parameterName: string]: string; + } + export interface Url { /** @@ -15,6 +19,7 @@ declare module purl { /** * The .param() method is used to return the values of querystring parameters. */ + param(): ParameterMap; param(parameterName: string): string; /** @@ -27,6 +32,7 @@ declare module purl { /** * Gets a parameter from the fragment segment */ + fparam(): ParameterMap; fparam(parameterName: string): string; /** From 0cca9182b9048d37ddb64b4445d70f6603bb881a Mon Sep 17 00:00:00 2001 From: satoru kimura Date: Sun, 2 Nov 2014 20:54:51 +0900 Subject: [PATCH 059/135] update to three.js r69. --- physijs/tests/body.ts | 2 +- physijs/tests/constraints_car.ts | 2 +- physijs/tests/jenga.ts | 2 +- physijs/tests/vehicle.ts | 1 + .../canvas/canvas_camera_orthographic.ts | 2 +- threejs/tests/canvas/canvas_materials.ts | 2 +- threejs/tests/three-tests-setup.ts | 2 + threejs/three-canvasrenderer.d.ts | 57 ++ threejs/three-projector.d.ts | 97 +++ threejs/three.d.ts | 624 ++++++++---------- 10 files changed, 421 insertions(+), 370 deletions(-) create mode 100644 threejs/three-canvasrenderer.d.ts create mode 100644 threejs/three-projector.d.ts diff --git a/physijs/tests/body.ts b/physijs/tests/body.ts index acf9df500..649805c03 100644 --- a/physijs/tests/body.ts +++ b/physijs/tests/body.ts @@ -1,6 +1,6 @@ /// /// - +/// Physijs.scripts.worker = '../physijs_worker.js'; Physijs.scripts.ammo = 'examples/js/ammo.js'; diff --git a/physijs/tests/constraints_car.ts b/physijs/tests/constraints_car.ts index b74c44449..4202b0c04 100644 --- a/physijs/tests/constraints_car.ts +++ b/physijs/tests/constraints_car.ts @@ -1,6 +1,6 @@ /// /// - +/// Physijs.scripts.worker = '../physijs_worker.js'; Physijs.scripts.ammo = 'examples/js/ammo.js'; diff --git a/physijs/tests/jenga.ts b/physijs/tests/jenga.ts index 05bbd7861..e2eeecc94 100644 --- a/physijs/tests/jenga.ts +++ b/physijs/tests/jenga.ts @@ -1,6 +1,6 @@ /// /// - +/// Physijs.scripts.worker = '../physijs_worker.js'; Physijs.scripts.ammo = 'examples/js/ammo.js'; diff --git a/physijs/tests/vehicle.ts b/physijs/tests/vehicle.ts index 1b11066fe..ef064f038 100644 --- a/physijs/tests/vehicle.ts +++ b/physijs/tests/vehicle.ts @@ -1,5 +1,6 @@ /// /// +/// var TWEEN: any; var SimplexNoise: any; diff --git a/threejs/tests/canvas/canvas_camera_orthographic.ts b/threejs/tests/canvas/canvas_camera_orthographic.ts index 7391d978b..54ac792d2 100644 --- a/threejs/tests/canvas/canvas_camera_orthographic.ts +++ b/threejs/tests/canvas/canvas_camera_orthographic.ts @@ -50,7 +50,7 @@ var material1 = new THREE.LineBasicMaterial({ color: 0x000000, opacity: 0.2 }); var line = new THREE.Line(geometry, material1); - line.type = THREE.LinePieces; + line.mode = THREE.LinePieces; scene.add(line); // Cubes diff --git a/threejs/tests/canvas/canvas_materials.ts b/threejs/tests/canvas/canvas_materials.ts index 0d8f8a631..e65dfe3be 100644 --- a/threejs/tests/canvas/canvas_materials.ts +++ b/threejs/tests/canvas/canvas_materials.ts @@ -45,7 +45,7 @@ var material = new THREE.LineBasicMaterial({ color: 0xffffff, opacity: 0.2 }); var line = new THREE.Line(geometry, material); - line.type = THREE.LinePieces; + line.mode = THREE.LinePieces; scene.add(line); // Spheres diff --git a/threejs/tests/three-tests-setup.ts b/threejs/tests/three-tests-setup.ts index 235dd631d..edb913a3d 100644 --- a/threejs/tests/three-tests-setup.ts +++ b/threejs/tests/three-tests-setup.ts @@ -4,7 +4,9 @@ /// /// +/// /// +/// /// /// /// diff --git a/threejs/three-canvasrenderer.d.ts b/threejs/three-canvasrenderer.d.ts new file mode 100644 index 000000000..c751d8722 --- /dev/null +++ b/threejs/three-canvasrenderer.d.ts @@ -0,0 +1,57 @@ +// Type definitions for CanvasRenderer.js +// Project: https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module THREE { + export interface SpriteCanvasMaterialParameters extends MaterialParameters{ + color?: number; + + } + + export class SpriteCanvasMaterial extends Material { + constructor(parameters?: SpriteCanvasMaterialParameters); + + color: Color; + + program(context: any, color: Color): void; + clone(): SpriteCanvasMaterial; + } + + export interface CanvasRendererParameters { + canvas?: HTMLCanvasElement; + devicePixelRatio?: number; + } + + export class CanvasRenderer implements Renderer { + constructor(parameters?: CanvasRendererParameters); + + domElement: HTMLCanvasElement; + devicePixelRatio: number; + autoClear: boolean; + sortObjects: boolean; + sortElements: boolean; + info: { render: { vertices: number; faces: number; }; }; + + supportsVertexTextures(): void; + setFaceCulling(): void; + setSize(width: number, height: number, updateStyle?: boolean): void; + setViewport(x: number, y: number, width: number, height: number): void; + setScissor(): void; + enableScissorTest(): void; + setClearColor(color: Color, opacity?: number): void; + setClearColor(color: string, opacity?: number): void; + setClearColor(color: number, opacity?: number): void; + setClearColorHex(hex: number, alpha?: number): void; + getClearColor(): Color; + getClearAlpha(): number; + getMaxAnisotropy(): number; + clear(): void; + clearColor(): void; + clearDepth(): void; + clearStencil(): void; + render(scene: Scene, camera: Camera): void; + } +} \ No newline at end of file diff --git a/threejs/three-projector.d.ts b/threejs/three-projector.d.ts new file mode 100644 index 000000000..11d674188 --- /dev/null +++ b/threejs/three-projector.d.ts @@ -0,0 +1,97 @@ +// Type definitions for Projector.js +// Project: https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/Projector.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module THREE { + // Renderers / Renderables ///////////////////////////////////////////////////////////////////// + export class RenderableObject { + constructor(); + + id: number; + object: Object; + z: number; + } + + export class RenderableFace { + constructor(); + + id: number; + v1: RenderableVertex; + v2: RenderableVertex; + v3: RenderableVertex; + normalModel: Vector3; + vertexNormalsModel: Vector3[]; + vertexNormalsLength: number; + color: Color; + material: Material; + uvs: Vector2[][]; + z: number; + + } + + export class RenderableVertex { + constructor(); + + position: Vector3; + positionWorld: Vector3; + positionScreen: Vector4; + visible: boolean; + + copy(vertex: RenderableVertex): void; + } + + export class RenderableLine { + constructor(); + + id: number; + v1: RenderableVertex; + v2: RenderableVertex; + vertexColors: Color[]; + material: Material; + z: number; + } + + export class RenderableSprite { + constructor(); + + id: number; + object: Object; + x: number; + y: number; + z: number; + rotation: number; + scale: Vector2; + material: Material; + } + + /** + * Projects points between spaces. + */ + export class Projector { + constructor(); + + // deprecated. + projectVector(vector: Vector3, camera: Camera): Vector3; + + // deprecated. + unprojectVector(vector: Vector3, camera: Camera): Vector3; + + /** + * Transforms a 3D scene object into 2D render data that can be rendered in a screen with your renderer of choice, projecting and clipping things out according to the used camera. + * If the scene were a real scene, this method would be the equivalent of taking a picture with the camera (and developing the film would be the next step, using a Renderer). + * + * @param scene scene to project. + * @param camera camera to use in the projection. + * @param sort select whether to sort elements using the Painter's algorithm. + */ + projectScene(scene: Scene, camera: Camera, sortObjects: boolean, sortElements?: boolean): { + objects: Object3D[]; // Mesh, Line or other object + sprites: Object3D[]; // Sprite or Particle + lights: Light[]; + elements: Face3[]; // Line, Particle, Face3 or Face4 + }; + } +} \ No newline at end of file diff --git a/threejs/three.d.ts b/threejs/three.d.ts index f114cd958..2a5535cbb 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -3,6 +3,8 @@ // Definitions by: Kon , Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + interface WebGLRenderingContext {} declare module THREE { @@ -67,6 +69,8 @@ declare module THREE { export var AddEquation: BlendingEquation; export var SubtractEquation: BlendingEquation; export var ReverseSubtractEquation: BlendingEquation; + export var MinEquation: BlendingEquation; + export var MaxEquation: BlendingEquation; // custom blending destination factors export enum BlendingDstFactor { } @@ -143,12 +147,18 @@ declare module THREE { export var LuminanceAlphaFormat: PixelFormat; // Compressed texture formats + // DDS / ST3C Compressed texture formats export enum CompressedPixelFormat { } export var RGB_S3TC_DXT1_Format: CompressedPixelFormat; export var RGBA_S3TC_DXT1_Format: CompressedPixelFormat; export var RGBA_S3TC_DXT3_Format: CompressedPixelFormat; export var RGBA_S3TC_DXT5_Format: CompressedPixelFormat; + // PVRTC compressed texture formats + export var RGB_PVRTC_4BPPV1_Format: CompressedPixelFormat; + export var RGB_PVRTC_2BPPV1_Format: CompressedPixelFormat; + export var RGBA_PVRTC_4BPPV1_Format: CompressedPixelFormat; + export var RGBA_PVRTC_2BPPV1_Format: CompressedPixelFormat; // Cameras //////////////////////////////////////////////////////////////////////////////////////// @@ -171,6 +181,8 @@ declare module THREE { */ projectionMatrix: Matrix4; + getWorldDirection(optionalTarget?: Vector3): Vector3; + /** * This make the camera look at the vector position in local space. * @param vector point to look at @@ -209,6 +221,8 @@ declare module THREE { */ constructor(left: number, right: number, top: number, bottom: number, near?: number, far?: number); + zoom: number; + /** * Camera frustum left plane. */ @@ -265,6 +279,8 @@ declare module THREE { */ constructor(fov?: number, aspect?: number, near?: number, far?: number); + zoom: number; + /** * Camera frustum vertical field of view, from bottom to top of view, in degrees. */ @@ -345,8 +361,10 @@ declare module THREE { array: number[]; itemSize: number; + needsUpdate: boolean; length: number; + copyAt(index1: number, attribute: BufferAttribute, index2: number): void; set(value: number): BufferAttribute; setX(index: number, x: number): BufferAttribute; setY(index: number, y: number): BufferAttribute; @@ -354,6 +372,7 @@ declare module THREE { setXY(index: number, x: number, y: number): BufferAttribute; setXYZ(index: number, x: number, y: number, z: number): BufferAttribute; setXYZW(index: number, x: number, y: number, z: number, w: number): BufferAttribute; + clone(): BufferAttribute; } // deprecated @@ -420,7 +439,9 @@ declare module THREE { id: number; uuid: string; name: string; + type: string; attributes: BufferAttribute[]; + attributesKeys: string[]; drawcalls: { start: number; count: number; index: number; }[]; offsets: { start: number; count: number; index: number; }[]; boundingBox: BoundingBox3D; @@ -436,6 +457,9 @@ declare module THREE { */ applyMatrix(matrix: Matrix4): void; + // this method is currently empty. + center(): void; + fromGeometry( geometry: Geometry, settings?: any ): BufferGeometry; /** @@ -469,6 +493,7 @@ declare module THREE { merge(): void; normalizeNormals(): void; reorderBuffers(indexBuffer: number, indexMap: number[], vertexCount: number): void; + toJSON(): any; clone(): BufferGeometry; /** @@ -729,6 +754,8 @@ declare module THREE { */ name: string; + type: string; + /** * The array of vertices hold every position of points of the model. * To signal an update in this array, Geometry.verticesNeedUpdate needs to be set to true. @@ -852,11 +879,6 @@ declare module THREE { */ lineDistancesNeedUpdate: boolean; - /** - * Set to true if an array has changed in length. - */ - buffersNeedUpdate: boolean; - /** * */ @@ -867,6 +889,8 @@ declare module THREE { */ applyMatrix(matrix: Matrix4): void; + fromBufferGeometry(geometry: BufferGeometry): Geometry; + /** * */ @@ -916,7 +940,7 @@ declare module THREE { */ mergeVertices(): number; - makeGroups(usesFaceMaterial: boolean, maxVerticesInGroup: number): void; + toJSON(): any; /** * Creates a new clone of the Geometry. @@ -929,6 +953,7 @@ declare module THREE { */ dispose(): void; + //These properties do not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added. bones: Bone[]; animation: AnimationData; @@ -962,6 +987,8 @@ declare module THREE { */ name: string; + type: string; + /** * Object's parent in the scene graph. */ @@ -1174,17 +1201,7 @@ declare module THREE { */ remove(object: Object3D): void; - /** - * - */ - raycast(raycaster: Raycaster, intersects: any): void; - - /** - * Translates object along arbitrary axis by distance. - * @param distance Distance. - * @param axis Translation direction. - */ - traverse(callback: (object: Object3D) => any): void; + getChildByName( name: string, recursive?: boolean ): Object3D; /** * Searches through the object's children and returns the first with a matching id, optionally recursive. @@ -1193,7 +1210,6 @@ declare module THREE { */ getObjectById(id: string, recursive: boolean): Object3D; - /** * Searches through the object's children and returns the first with a matching name, optionally recursive. * @param name String to match to the children's Object3d.name property. @@ -1201,8 +1217,20 @@ declare module THREE { */ getObjectByName(name: string, recursive?: boolean): Object3D; + getWorldPosition(optionalTarget: Vector3): Vector3; + getWorldQuaternion(optionalTarget: Quaternion): Quaternion; + getWorldRotation(optionalTarget: Euler): Euler; + getWorldScale(optionalTarget: Vector3): Vector3; + getWorldDirection(optionalTarget: Vector3): Vector3; - getChildByName( name: string, recursive?: boolean ): Object3D; + /** + * Translates object along arbitrary axis by distance. + * @param distance Distance. + * @param axis Translation direction. + */ + traverse(callback: (object: Object3D) => any): void; + + traverseVisible(callback: (object: Object3D) => any): void; /** * Updates local transform. @@ -1214,6 +1242,8 @@ declare module THREE { */ updateMatrixWorld(force: boolean): void; + toJSON(): any; + /** * * @param object @@ -1229,37 +1259,6 @@ declare module THREE { } - /** - * Projects points between spaces. - */ - export class Projector { - constructor(); - - projectVector(vector: Vector3, camera: Camera): Vector3; - - unprojectVector(vector: Vector3, camera: Camera): Vector3; - - /** - * Translates a 2D point from NDC (Normalized Device Coordinates) to a Raycaster that can be used for picking. NDC range from [-1..1] in x (left to right) and [1.0 .. -1.0] in y (top to bottom). - */ - pickingRay(vector: Vector3, camera: Camera): Raycaster; - - /** - * Transforms a 3D scene object into 2D render data that can be rendered in a screen with your renderer of choice, projecting and clipping things out according to the used camera. - * If the scene were a real scene, this method would be the equivalent of taking a picture with the camera (and developing the film would be the next step, using a Renderer). - * - * @param scene scene to project. - * @param camera camera to use in the projection. - * @param sort select whether to sort elements using the Painter's algorithm. - */ - projectScene(scene: Scene, camera: Camera, sortObjects: boolean, sortElements?: boolean): { - objects: Object3D[]; // Mesh, Line or other object - sprites: Object3D[]; // Sprite or Particle - lights: Light[]; - elements: Face3[]; // Line, Particle, Face3 or Face4 - }; - } - export interface Intersection { distance: number; point: Vector3; @@ -1296,6 +1295,7 @@ declare module THREE { */ export class Light extends Object3D { constructor(hex?: number); + color: Color; clone(light?: Light): Light; @@ -1749,6 +1749,12 @@ declare module THREE { clear(): void; } + export class CompressedTextureLoader{ + constructor(); + + load(url: string, onLoad: (bufferGeometry: BufferGeometry) => void, onError?: (event: any) => void): void; + } + /* * GeometryLoader class is experimental, and it is not yet included in the compiled source code. * @@ -1909,6 +1915,8 @@ declare module THREE { */ name: string; + type: string; + /** * Defines which of the face sides will be rendered - front, back or both. * Default is THREE.FrontSide. Other options are THREE.BackSide and THREE.DoubleSide. @@ -1994,6 +2002,7 @@ declare module THREE { needsUpdate: boolean; setValues(values: Object): void; + toJSON(): any; clone(material?:Material): Material; dispose(): void; @@ -2119,6 +2128,7 @@ declare module THREE { constructor(materials?: Material[]); materials: Material[]; + toJSON(): any; clone(): MeshFaceMaterial; } @@ -2342,20 +2352,6 @@ declare module THREE { clone(): ShaderMaterial; } - export interface SpriteCanvasMaterialParameters extends MaterialParameters{ - color?: number; - - } - - export class SpriteCanvasMaterial extends Material { - constructor(parameters?: SpriteCanvasMaterialParameters); - - color: Color; - - program(context: any, color: Color): void; - clone(): SpriteCanvasMaterial; - } - export interface SpriteMaterialParameters extends MaterialParameters{ color?: number; map?: Texture; @@ -2835,11 +2831,6 @@ declare module THREE { */ randFloatSpread(range: number): number; - /** - * Returns -1 if x is less than 0, 1 if x is greater than 0, and 0 if x is zero. - */ - sign(x: number): number; - degToRad(degrees: number): number; radToDeg(radians: number): number; @@ -3237,6 +3228,10 @@ declare module THREE { equals(v: Quaternion): boolean; fromArray(n: number[]): Quaternion; toArray(): number[]; + + fromArray(xyzw: number[], offset?: number): Quaternion; + toArray(xyzw?: number[], offset?: number): number[]; + onChange: () => void; /** @@ -3617,9 +3612,10 @@ declare module THREE { * Checks for strict equality of this vector and v. */ equals(v: Vector2): boolean; - fromArray(xy: number[]): Vector2; - toArray(): number[]; + fromArray(xy: number[], offset?: number): Vector2; + + toArray(xy?: number[], offset?: number): number[]; /** * Clones this vector. */ @@ -3708,6 +3704,8 @@ declare module THREE { applyMatrix4(m: Matrix4): Vector3; applyProjection(m: Matrix4): Vector3; applyQuaternion(q: Quaternion): Vector3; + project(camrea: Camera): Vector3; + unproject(camera: Camera): Vector3; transformDirection(m: Matrix4): Vector3; divide(v: Vector3): Vector3; @@ -3794,8 +3792,10 @@ declare module THREE { * Checks for strict equality of this vector and v. */ equals(v: Vector3): boolean; - fromArray(xyz: number[]): Vector3; - toArray(): number[]; + + fromArray(xyz: number[], offset?: number): Vector3; + + toArray(xyz?: number[], offset?: number): number[]; /** * Clones this vector. @@ -3942,8 +3942,9 @@ declare module THREE { */ equals(v: Vector4): boolean; - fromArray(xyzw: number[]): number[]; - toArray(): number[]; + fromArray(xyzw: number[], offset?: number): Vector4; + + toArray(xyzw?: number[], offset?: number): number[]; /** * Clones this vector. @@ -3957,33 +3958,59 @@ declare module THREE { constructor(belongsToSkin: SkinnedMesh); skin: SkinnedMesh; + } - accumulatedRotWeight: number; - accumulatedPosWeight: number; - accumulatedSclWeight: number; + export class Group extends Object3D { + constructor(); + } - updateMatrixWorld(forceUpdate?: boolean): void; + export interface LensFlareProperty { + texture: Texture; // Texture + size: number; // size in pixels (-1 = use texture.width) + distance: number; // distance (0-1) from light source (0=at light source) + x: number; + y: number; + z: number; // screen position (-1 => 1) z = 0 is ontop z = 1 is back + scale: number; // scale + rotation: number; // rotation + opacity: number; // opacity + color: Color; // color + blending: Blending; + } + + export class LensFlare extends Object3D { + constructor(texture?: Texture, size?: number, distance?: number, blending?: Blending, color?: Color); + + lensFlares: LensFlareProperty[]; + positionScreen: Vector3; + customUpdateCallback: (object: LensFlare) => void; + + add(texture: Texture, size?: number, distance?: number, blending?: Blending, color?: Color): void; + add(obj: Object3D): void; + + + updateLensFlares(): void; } export class Line extends Object3D { - constructor(geometry?: Geometry, material?: LineDashedMaterial, type?: number); - constructor(geometry?: Geometry, material?: LineBasicMaterial, type?: number); - constructor(geometry?: Geometry, material?: ShaderMaterial, type?: number); - constructor(geometry?: BufferGeometry, material?: LineDashedMaterial, type?: number); - constructor(geometry?: BufferGeometry, material?: LineBasicMaterial, type?: number); - constructor(geometry?: BufferGeometry, material?: ShaderMaterial, type?: number); + constructor(geometry?: Geometry, material?: LineDashedMaterial, mode?: number); + constructor(geometry?: Geometry, material?: LineBasicMaterial, mode?: number); + constructor(geometry?: Geometry, material?: ShaderMaterial, mode?: number); + constructor(geometry?: BufferGeometry, material?: LineDashedMaterial, mode?: number); + constructor(geometry?: BufferGeometry, material?: LineBasicMaterial, mode?: number); + constructor(geometry?: BufferGeometry, material?: ShaderMaterial, mode?: number); geometry: Geometry; material: LineBasicMaterial; - type: LineType; + mode: LineMode; raycast(raycaster: Raycaster, intersects: any): void; clone(object?: Line): Line; } - enum LineType{} - var LineStrip: LineType; - var LinePieces: LineType; + enum LineMode{} + var LineStrip: LineMode; + var LinePieces: LineMode; export class LOD extends Object3D { constructor(); @@ -4119,7 +4146,6 @@ declare module THREE { material: SpriteMaterial; raycast(raycaster: Raycaster, intersects: any): void; - updateMatrix(): void; clone(object?: Sprite): Sprite; } @@ -4132,46 +4158,6 @@ declare module THREE { domElement: HTMLCanvasElement; } - export interface CanvasRendererParameters { - canvas?: HTMLCanvasElement; - devicePixelRatio?: number; - } - - export class CanvasRenderer implements Renderer { - constructor(parameters?: CanvasRendererParameters); - - domElement: HTMLCanvasElement; - devicePixelRatio: number; - autoClear: boolean; - sortObjects: boolean; - sortElements: boolean; - info: { render: { vertices: number; faces: number; }; }; - - supportsVertexTextures(): void; - setFaceCulling(): void; - setSize(width: number, height: number, updateStyle?: boolean): void; - setViewport(x: number, y: number, width: number, height: number): void; - setScissor(): void; - enableScissorTest(): void; - setClearColor(color: Color, opacity?: number): void; - setClearColor(color: string, opacity?: number): void; - setClearColor(color: number, opacity?: number): void; - setClearColorHex(hex: number, alpha?: number): void; - getClearColor(): Color; - getClearAlpha(): number; - getMaxAnisotropy(): number; - clear(): void; - clearColor(): void; - clearDepth(): void; - clearStencil(): void; - render(scene: Scene, camera: Camera): void; - } - - export interface RendererPlugin { - init(renderer: WebGLRenderer): void; - render(scene: Scene, camera: Camera, currentWidth: number, currentHeight: number): void; - } - export interface WebGLRendererParameters { /** * A Canvas where the renderer draws its output. @@ -4289,11 +4275,6 @@ declare module THREE { */ shadowMapEnabled: boolean; - /** - * Default is true. - */ - shadowMapAutoUpdate: boolean; - /** * Defines shadow map type (unfiltered, percentage close filtering, percentage close filtering with bilinear filtering in shader) * Options are THREE.BasicShadowMap, THREE.PCFShadowMap, THREE.PCFSoftShadowMap. Default is THREE.PCFShadowMap. @@ -4330,18 +4311,6 @@ declare module THREE { */ autoScaleCubemaps: boolean; - /** - * An array with render plugins to be applied before rendering. - * Default is an empty array, or []. - */ - renderPluginsPre: RendererPlugin[]; - - /** - * An array with render plugins to be applied after rendering. - * Default is an empty array, or []. - */ - renderPluginsPost: RendererPlugin[]; - /** * An object with a series of statistical information about the graphics board memory and the rendering process. Useful for debugging or just for the sake of curiosity. The object contains the following fields: */ @@ -4373,6 +4342,8 @@ declare module THREE { supportsFloatTextures(): boolean; supportsStandardDerivatives(): boolean; supportsCompressedTextureS3TC(): boolean; + supportsCompressedTexturePVRTC(): boolean; + supportsBlendMinMax(): boolean; getMaxAnisotropy(): number; getPrecision(): string; @@ -4434,16 +4405,7 @@ declare module THREE { clearDepth(): void; clearStencil(): void; clearTarget(renderTarget:WebGLRenderTarget, color: boolean, depth: boolean, stencil: boolean): void; - - /** - * Initialises the postprocessing plugin, and adds it to the renderPluginsPost array. - */ - addPostPlugin(plugin: RendererPlugin): void; - - /** - * Initialises the preprocessing plugin, and adds it to the renderPluginsPre array. - */ - addPrePlugin(plugin: RendererPlugin): void; + resetGLState(): void; /** * Tells the shadow map plugin to update using the passed scene and camera parameters. @@ -4466,7 +4428,6 @@ declare module THREE { */ render(scene: Scene, camera: Camera, renderTarget?: RenderTarget, forceClear?: boolean): void; renderImmediateObject(camera: Camera, lights: Light[], fog: Fog, material: Material, object: Object3D): void; - initMaterial(material: Material, lights: Light[], fog: Fog, object: Object3D): void; /** * Used for setting the gl frontFace, cullFace states in the GPU, thus enabling/disabling face culling when rendering. @@ -4479,8 +4440,10 @@ declare module THREE { setDepthTest(depthTest: boolean): void; setDepthWrite(depthWrite: boolean): void; setBlending(blending: Blending, blendEquation: BlendingEquation, blendSrc: BlendingSrcFactor, blendDst: BlendingDstFactor): void; + uploadTexture(texture: Texture): void; setTexture(texture: Texture, slot: number): void; setRenderTarget(renderTarget: RenderTarget): void; + } export interface RenderTarget { @@ -4534,67 +4497,6 @@ declare module THREE { activeCubeFace: number; // PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5 } - // Renderers / Renderables ///////////////////////////////////////////////////////////////////// - export class RenderableFace { - constructor(); - - id: number; - v1: RenderableVertex; - v2: RenderableVertex; - v3: RenderableVertex; - normalModel: Vector3; - vertexNormalsModel: Vector3[]; - vertexNormalsLength: number; - color: Color; - material: Material; - uvs: Vector2[][]; - z: number; - - } - - export class RenderableLine { - constructor(); - - id: number; - v1: RenderableVertex; - v2: RenderableVertex; - vertexColors: Color[]; - material: Material; - z: number; - } - - export class RenderableObject { - constructor(); - - id: number; - object: Object; - z: number; - } - - export class RenderableSprite { - constructor(); - - id: number; - object: Object; - x: number; - y: number; - z: number; - rotation: number; - scale: Vector2; - material: Material; - } - - export class RenderableVertex { - constructor(); - - position: Vector3; - positionWorld: Vector3; - positionScreen: Vector4; - visible: boolean; - - copy(vertex: RenderableVertex): void; - } - // Renderers / Shaders ///////////////////////////////////////////////////////////////////// export interface ShaderChunk { [name: string]: string; @@ -4692,14 +4594,57 @@ declare module THREE { }; // Renderers / WebGL ///////////////////////////////////////////////////////////////////// + export class WebGLExtensions{ + constructor(gl: any); // WebGLRenderingContext + + get(name: string): any; + } + export class WebGLProgram{ constructor(renderer: WebGLRenderer, code: string, material: ShaderMaterial, parameters: WebGLRendererParameters); + + attributes: any; + attributesKeys: string[]; + id: number; + code: string; + usedTimes: number; + program: any; + vertexShader: WebGLShader; + fragmentShader: WebGLShader; } export class WebGLShader{ constructor(gl: any, type: string, string: string); } + // Renderers / WebGL / Plugins ///////////////////////////////////////////////////////////////////// + export interface RendererPlugin { + init(renderer: WebGLRenderer): void; + render(scene: Scene, camera: Camera, currentWidth: number, currentHeight: number): void; + } + + export class LensFlarePlugin implements RendererPlugin { + constructor(); + + init(renderer: Renderer): void; + render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; + } + + export class ShadowMapPlugin implements RendererPlugin { + constructor(); + + init(renderer: Renderer): void; + render(scene: Scene, camera: Camera): void; + update(scene: Scene, camera: Camera): void; + } + + export class SpritePlugin implements RendererPlugin { + constructor(); + + init(renderer: Renderer): void; + render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; + } + // Scenes ///////////////////////////////////////////////////////////////////// export interface IFog { @@ -4771,10 +4716,7 @@ declare module THREE { overrideMaterial: Material; autoUpdate: boolean; - /** - * Default is false. - */ - matrixAutoUpdate: boolean; + clone(): Scene; } // Textures ///////////////////////////////////////////////////////////////////// @@ -4795,6 +4737,7 @@ declare module THREE { image: { width: number; height: number; }; mipmaps: ImageData[]; + flipY: boolean; generateMipmaps: boolean; clone(): CompressedTexture; @@ -4840,7 +4783,7 @@ declare module THREE { export class Texture { constructor( - image: any, // HTMLImageElement or HTMLCanvasElement + image: any, // HTMLImageElement or HTMLCanvasElement ( or HTMLVideoElement) mapping?: Mapping, wrapS?: Wrapping, wrapT?: Wrapping, @@ -4919,6 +4862,22 @@ declare module THREE { dispatchEvent(event: { type: string; target: any; }): void; } + class VideoTexture extends Texture { + constructor( + video: HTMLVideoElement, + mapping?: MappingConstructor, + wrapS?: Wrapping, + wrapT?: Wrapping, + magFilter?: TextureFilter, + minFilter?: TextureFilter, + format?: PixelFormat, + type?: TextureDataType, + anisotropy?: number + ); + + generateMipmaps: boolean; + } + // Extras ///////////////////////////////////////////////////////////////////// export interface TypefaceData { @@ -5012,6 +4971,7 @@ declare module THREE { play(startTime?: number, weight?: number): void; stop(): void; reset(): void; + resetBlendWeights(): void; update(deltaTimeMS: number): void; getNextKeyWith(type: string, h: number, key: number): KeyFrame; getPrevKeyWith(type: string, h: number, key: number): KeyFrame; @@ -5065,6 +5025,32 @@ declare module THREE { update(deltaTimeMS: number): void; } + // Extras / Audio ///////////////////////////////////////////////////////////////////// + + export class Audio extends Object3D { + constructor(listener: AudioListener); + type: string; + context: AudioContext; + source: AudioBufferSourceNode; + gain: GainNode; + panner: PannerNode; + + load(file: string): Audio; + setLoop(value: boolean): void; + setRefDistance(value: number): void; + setRolloffFactor(value: number): void; + updateMatrixWorld(force?: boolean): void; + } + + export class AudioListener extends Object3D { + constructor(); + + type: string; + context: AudioContext; + + updateMatrixWorld(force?: boolean): void; + } + // Extras / Core ///////////////////////////////////////////////////////////////////// /** @@ -5172,13 +5158,6 @@ declare module THREE { export class Gyroscope extends Object3D { constructor(); - translationWorld: Vector3; - translationObject: Vector3; - quaternionWorld: Quaternion; - quaternionObject: Quaternion; - scaleWorld: Vector3; - scaleObject: Vector3; - updateMatrixWorld(force?: boolean): void; } @@ -5366,9 +5345,6 @@ declare module THREE { heightSegments: number; depthSegments: number; }; - widthSegments: number; - heightSegments: number; - depthSegments: number; } export class CircleGeometry extends Geometry { @@ -5380,10 +5356,6 @@ declare module THREE { thetaStart: number; thetaLength: number; }; - radius: number; - segments: number; - thetaStart: number; - thetaLength: number; } // deprecated @@ -5409,54 +5381,60 @@ declare module THREE { heightSegments: number; openEnded: boolean; }; - radiusTop: number; - radiusBottom: number; - height: number; - radialSegments: number; - heightSegments: number; - openEnded: boolean; + } + + export class DodecahedronGeometry extends Geometry { + constructor(radius: number, detail: number); + + parameters: { + radius: number; + detail: number; + }; } export class ExtrudeGeometry extends Geometry { constructor(shape?: Shape, options?: any); constructor(shapes?: Shape[], options?: any); + WorldUVGenerator: { + generateTopUV(geometry: Geometry, indexA: number, indexB: number, indexC: number): Vector2[]; + generateSideWallUV(geometry: Geometry, indexA: number, indexB: number, indexC: number, indexD: number): Vector2[]; + }; + addShapeList(shapes: Shape[], options?: any): void; addShape(shape: Shape, options?: any): void; } export class IcosahedronGeometry extends PolyhedronGeometry { constructor(radius: number, detail: number); - - parameters: { - radius: number; - detail: number; - }; - radius: number; - detail: number; } export class LatheGeometry extends Geometry { constructor(points: Vector3[], segments?: number, phiStart?: number, phiLength?: number); - + + parameters: { + points: Vector3[]; + segments: number; + phiStart: number; + phiLength: number; + }; } export class OctahedronGeometry extends PolyhedronGeometry { constructor(radius: number, detail: number); - - parameters: { - radius: number; - detail: number; - }; - radius: number; - detail: number; } export class ParametricGeometry extends Geometry { - constructor(func: (u: number, v: number) => Vector3, slices: number, stacks: number, useTris?: boolean); + constructor(func: (u: number, v: number) => Vector3, slices: number, stacks: number); + + parameters: { + func: (u: number, v: number) => Vector3; + slices: number; + stacks: number; + }; } - export class PlaneGeometry extends Geometry { + export class PlaneBufferGeometry extends Geometry { constructor(width: number, height: number, widthSegments?: number, heightSegments?: number); parameters: { @@ -5465,24 +5443,40 @@ declare module THREE { widthSegments: number; heightSegments: number; }; - width: number; - height: number; - widthSegments: number; - heightSegments: number; + } + + export class PlaneGeometry extends PlaneBufferGeometry { } export class PolyhedronGeometry extends Geometry { constructor(vertices: Vector3[], faces: Face3[], radius?: number, detail?: number); + + parameters: { + vertices: Vector3[]; + faces: Face3[]; + radius: number; + detail: number; + }; } export class RingGeometry extends Geometry { constructor(innerRadius?: number, outerRadius?: number, thetaSegments?: number, phiSegments?: number, thetaStart?: number, thetaLength?: number); + + parameters: { + innerRadius: number; + outerRadius: number; + thetaSegments: number; + phiSegments: number; + thetaStart: number; + thetaLength: number; + }; } export class ShapeGeometry extends Geometry { constructor(shape: Shape, options?: any); constructor(shapes: Shape[], options?: any); + addShapeList(shapes: Shape[], options: any): ShapeGeometry; addShape(shape: Shape, options?: any): void; } @@ -5513,13 +5507,6 @@ declare module THREE { thetaStart: number; thetaLength: number; }; - radius: number; - widthSegments: number; - heightSegments: number; - phiStart: number; - phiLength: number; - thetaStart: number; - thetaLength: number; } export class TetrahedronGeometry extends PolyhedronGeometry { @@ -5552,11 +5539,6 @@ declare module THREE { tubularSegments: number; arc: number; }; - radius: number; - tube: number; - radialSegments: number; - tubularSegments: number; - arc: number; } export class TorusKnotGeometry extends Geometry { @@ -5571,13 +5553,6 @@ declare module THREE { q: number; heightScale: number; }; - radius: number; - tube: number; - radialSegments: number; - tubularSegments: number; - p: number; - q: number; - heightScale: number; } export class TubeGeometry extends Geometry { @@ -5590,11 +5565,6 @@ declare module THREE { radialSegments: number; closed: boolean; }; - path: Path; - segments: number; - radius: number; - radialSegments: number; - closed: boolean; tangents: Vector3[]; normals: Vector3[]; binormals: Vector3[]; @@ -5749,34 +5719,6 @@ declare module THREE { render(renderCallback:Function): void; } - export interface LensFlareProperty { - texture: Texture; // Texture - size: number; // size in pixels (-1 = use texture.width) - distance: number; // distance (0-1) from light source (0=at light source) - x: number; - y: number; - z: number; // screen position (-1 => 1) z = 0 is ontop z = 1 is back - scale: number; // scale - rotation: number; // rotation - opacity: number; // opacity - color: Color; // color - blending: Blending; - } - - export class LensFlare extends Object3D { - constructor(texture?: Texture, size?: number, distance?: number, blending?: Blending, color?: Color); - - lensFlares: LensFlareProperty[]; - positionScreen: Vector3; - customUpdateCallback: (object: LensFlare) => void; - - add(texture: Texture, size?: number, distance?: number, blending?: Blending, color?: Color): void; - add(obj: Object3D): void; - - - updateLensFlares(): void; - } - export interface MorphBlendMeshAnimation { startFrame: number; endFrame: number; @@ -5813,54 +5755,6 @@ declare module THREE { stopAnimation(name: string): void; update(delta: number): void; } - - // Extras / Renderers / Plugins ///////////////////////////////////////////////////////////////////// - - export class DepthPassPlugin implements RendererPlugin { - constructor(); - - enabled: boolean; - renderTarget: RenderTarget; - - init(renderer: Renderer): void; - render(scene: Scene, camera: Camera): void; - update(scene: Scene, camera: Camera): void; - } - - export class LensFlarePlugin implements RendererPlugin { - constructor(); - - init(renderer: Renderer): void; - render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; - } - - export class ShadowMapPlugin implements RendererPlugin { - constructor(); - - init(renderer: Renderer): void; - render(scene: Scene, camera: Camera): void; - update(scene: Scene, camera: Camera): void; - } - - export class SpritePlugin implements RendererPlugin { - constructor(); - - init(renderer: Renderer): void; - render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; - } - - // Extras / Shaders ///////////////////////////////////////////////////////////////////// - - export var ShaderFlares: { - 'lensFlareVertexTexture': { - vertexShader: string; - fragmentShader: string; - }; - 'lensFlare': { - vertexShader: string; - fragmentShader: string; - }; - }; } declare module 'three' { From 5eba93f5813418f10da92861def0ed1bdc6b9815 Mon Sep 17 00:00:00 2001 From: progre Date: Mon, 3 Nov 2014 12:11:41 +0900 Subject: [PATCH 060/135] move to legacy --- .../socket.io-0.9-tests.ts} | 46 +++--- .../socket.io-0.9-tests.ts.tscparams} | 2 +- .../socket.io-0.9.d.ts} | 140 +++++++++--------- 3 files changed, 94 insertions(+), 94 deletions(-) rename socket.io/{socket.io-tests.ts => legacy/socket.io-0.9-tests.ts} (96%) rename socket.io/{socket.io-tests.ts.tscparams => legacy/socket.io-0.9-tests.ts.tscparams} (50%) rename socket.io/{socket.io.d.ts => legacy/socket.io-0.9.d.ts} (96%) diff --git a/socket.io/socket.io-tests.ts b/socket.io/legacy/socket.io-0.9-tests.ts similarity index 96% rename from socket.io/socket.io-tests.ts rename to socket.io/legacy/socket.io-0.9-tests.ts index 0b29890ca..40f0c6b89 100644 --- a/socket.io/socket.io-tests.ts +++ b/socket.io/legacy/socket.io-0.9-tests.ts @@ -1,24 +1,24 @@ -import io = require('socket.io'); - -var socketManager = io.listen(80); - -socketManager.sockets.on('connection', socket => { - socket.emit('news', { hello: 'world' }); - socket.on('my other event', data => { - console.log(data); - }); -}); - -// Storing data Associated to a client. -// Server side sample -io.listen(80).sockets.on('connection', function (socket) { - socket.on('set nickname', function (name) { - socket.set('nickname', name, function () { socket.emit('ready'); }); - }); - - socket.on('msg', function () { - socket.get('nickname', function (err, name) { - console.log('Chat message by ', name); - }); - }); +import io = require('socket.io'); + +var socketManager = io.listen(80); + +socketManager.sockets.on('connection', socket => { + socket.emit('news', { hello: 'world' }); + socket.on('my other event', data => { + console.log(data); + }); +}); + +// Storing data Associated to a client. +// Server side sample +io.listen(80).sockets.on('connection', function (socket) { + socket.on('set nickname', function (name) { + socket.set('nickname', name, function () { socket.emit('ready'); }); + }); + + socket.on('msg', function () { + socket.get('nickname', function (err, name) { + console.log('Chat message by ', name); + }); + }); }); \ No newline at end of file diff --git a/socket.io/socket.io-tests.ts.tscparams b/socket.io/legacy/socket.io-0.9-tests.ts.tscparams similarity index 50% rename from socket.io/socket.io-tests.ts.tscparams rename to socket.io/legacy/socket.io-0.9-tests.ts.tscparams index d3f5a12fa..8b1378917 100644 --- a/socket.io/socket.io-tests.ts.tscparams +++ b/socket.io/legacy/socket.io-0.9-tests.ts.tscparams @@ -1 +1 @@ - + diff --git a/socket.io/socket.io.d.ts b/socket.io/legacy/socket.io-0.9.d.ts similarity index 96% rename from socket.io/socket.io.d.ts rename to socket.io/legacy/socket.io-0.9.d.ts index 184468b12..44edbb174 100644 --- a/socket.io/socket.io.d.ts +++ b/socket.io/legacy/socket.io-0.9.d.ts @@ -1,70 +1,70 @@ -// Type definitions for socket.io -// Project: http://socket.io/ -// Definitions by: William Orr -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -/// - -declare module "socket.io" { - import http = require('http'); - - export function listen(server: http.Server, options: any, fn: Function): SocketManager; - export function listen(server: http.Server, fn?: Function): SocketManager; - export function listen(port: Number): SocketManager; - - - interface Socket { - id: string; - json:any; - log: any; - volatile: any; - broadcast: any; - handshake: any; - in(room: string): Socket; - to(room: string): Socket; - join(name: string, fn: Function): Socket; - leave(name: string, fn: Function): Socket; - set(key: string, value: any, fn: Function): Socket; - get(key: string, fn: Function): Socket; - has(key: string, fn: Function): Socket; - del(key: string, fn: Function): Socket; - disconnect(): Socket; - send(data: any, fn: Function): Socket; - emit(ev: any, ...data:any[]): Socket; - on(ns: string, fn: Function): Socket; - } - - interface SocketNamespace { - clients(room: string): Socket[]; - log: any; - store: any; - json: any; - volatile: any; - in(room: string): SocketNamespace; - on(evt: string, fn: (socket: Socket) => void): SocketNamespace; - to(room: string): SocketNamespace; - except(id: any): SocketNamespace; - send(data: any): any; - emit(ev: any, ...data:any[]): Socket; - socket(sid: any, readable: boolean): Socket; - authorization(fn: Function): SocketNamespace; - } - - interface SocketManager { - get(key: any): any; - set(key: any, value: any): SocketManager; - enable(key: any): SocketManager; - disable(key: any): SocketManager; - enabled(key: any): boolean; - disabled(key: any): boolean; - configure(env: string, fn: Function): SocketManager; - configure(fn: Function): SocketManager; - of(nsp: string): SocketNamespace; - on(ns: string, fn: Function): SocketManager; - sockets: SocketNamespace; - } - - -} - +// Type definitions for socket.io +// Project: http://socket.io/ +// Definitions by: William Orr +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +declare module "socket.io" { + import http = require('http'); + + export function listen(server: http.Server, options: any, fn: Function): SocketManager; + export function listen(server: http.Server, fn?: Function): SocketManager; + export function listen(port: Number): SocketManager; + + + interface Socket { + id: string; + json:any; + log: any; + volatile: any; + broadcast: any; + handshake: any; + in(room: string): Socket; + to(room: string): Socket; + join(name: string, fn: Function): Socket; + leave(name: string, fn: Function): Socket; + set(key: string, value: any, fn: Function): Socket; + get(key: string, fn: Function): Socket; + has(key: string, fn: Function): Socket; + del(key: string, fn: Function): Socket; + disconnect(): Socket; + send(data: any, fn: Function): Socket; + emit(ev: any, ...data:any[]): Socket; + on(ns: string, fn: Function): Socket; + } + + interface SocketNamespace { + clients(room: string): Socket[]; + log: any; + store: any; + json: any; + volatile: any; + in(room: string): SocketNamespace; + on(evt: string, fn: (socket: Socket) => void): SocketNamespace; + to(room: string): SocketNamespace; + except(id: any): SocketNamespace; + send(data: any): any; + emit(ev: any, ...data:any[]): Socket; + socket(sid: any, readable: boolean): Socket; + authorization(fn: Function): SocketNamespace; + } + + interface SocketManager { + get(key: any): any; + set(key: any, value: any): SocketManager; + enable(key: any): SocketManager; + disable(key: any): SocketManager; + enabled(key: any): boolean; + disabled(key: any): boolean; + configure(env: string, fn: Function): SocketManager; + configure(fn: Function): SocketManager; + of(nsp: string): SocketNamespace; + on(ns: string, fn: Function): SocketManager; + sockets: SocketNamespace; + } + + +} + From e5a6aa1c49c0ad4df32f0678cb93485b9b24f795 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Sun, 2 Nov 2014 22:20:59 -0600 Subject: [PATCH 061/135] Declare jszip as a module, too. --- jszip/jszip.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jszip/jszip.d.ts b/jszip/jszip.d.ts index 038b52957..df571793b 100644 --- a/jszip/jszip.d.ts +++ b/jszip/jszip.d.ts @@ -169,4 +169,8 @@ declare var JSZip: { prototype: JSZip; support: JSZipSupport; -} \ No newline at end of file +} + +declare module "jszip" { + export = JSZip; +} From 7e58e7c469d9775d03fcdee4bde8ff45132e6fa0 Mon Sep 17 00:00:00 2001 From: Carl-Erik Kopseng Date: Mon, 3 Nov 2014 11:53:12 +0100 Subject: [PATCH 062/135] Revert "Fixed error in test for indexedDB" --- modernizr/modernizr.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modernizr/modernizr.d.ts b/modernizr/modernizr.d.ts index 25043375c..5827bbf9e 100644 --- a/modernizr/modernizr.d.ts +++ b/modernizr/modernizr.d.ts @@ -75,7 +75,7 @@ interface ModernizrStatic { history: boolean; audio: Audioboolean; video: Videoboolean; - indexedDB: boolean; + indexeddb: boolean; input: Inputboolean; inputtypes: InputTypesboolean; localstorage: boolean; From 6810682be11601c3cdd332ae986ede246c7cebb9 Mon Sep 17 00:00:00 2001 From: Jakub Olek Date: Mon, 3 Nov 2014 13:39:36 +0100 Subject: [PATCH 063/135] add definitions for Headroom --- Headroom/headroom-tests.ts | 13 +++++++++++++ Headroom/headroom.d.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Headroom/headroom-tests.ts create mode 100644 Headroom/headroom.d.ts diff --git a/Headroom/headroom-tests.ts b/Headroom/headroom-tests.ts new file mode 100644 index 000000000..e0e83449e --- /dev/null +++ b/Headroom/headroom-tests.ts @@ -0,0 +1,13 @@ +/// + +new Headroom(document.getElementById('siteHead')); + +new Headroom(document.getElementsByClassName('siteHead')[0]); + +new Headroom(document.getElementsByClassName('siteHead')[0], { + tolerance: 34 +}); + +new Headroom(document.getElementsByClassName('siteHead')[0], { + offset: 500 +}); diff --git a/Headroom/headroom.d.ts b/Headroom/headroom.d.ts new file mode 100644 index 000000000..b4fc3133e --- /dev/null +++ b/Headroom/headroom.d.ts @@ -0,0 +1,28 @@ +// Type definitions for headroom.js v0.7.0 +// Project: http://wicky.nillia.ms/headroom.js/ +// Definitions by: Jakub Olek +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface HeadroomOptions { + offset?: number; + tolerance?: any; + classes?: { + initial?: string; + pinned?: string; + unpinned?: string; + top?: string; + notTop?: string; + }; + scroller?: Element; + onPin?: () => void; + onUnPin?: () => void; + onTop?: () => void; + onNotTop?: () => void; + +} + +declare class Headroom { + constructor(element: Node, options?: HeadroomOptions); + constructor(element: Element, options?: HeadroomOptions); + init: () => void; +} From bafa39895f5294f75357a5fa649d92fb4231226a Mon Sep 17 00:00:00 2001 From: vingarg Date: Mon, 3 Nov 2014 19:50:00 +0530 Subject: [PATCH 064/135] Added interface for rowGrid.js --- jquery.rowGrid/jquery.rowGrid.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 jquery.rowGrid/jquery.rowGrid.d.ts diff --git a/jquery.rowGrid/jquery.rowGrid.d.ts b/jquery.rowGrid/jquery.rowGrid.d.ts new file mode 100644 index 000000000..4b136d2ba --- /dev/null +++ b/jquery.rowGrid/jquery.rowGrid.d.ts @@ -0,0 +1,17 @@ +// Type definitions for jQuery rowGrid.js plugin (v1.0.2) +// Project: https://github.com/brunjo/rowGrid.js +// Definitions by: Vinayak Garg +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface JQueryRowGridJSOptions { + minMargin?: number; + maxMargin?: number; + itemSelector: string; +} + +interface JQuery { + rowGrid(options?: JQueryRowGridJSOptions): JQuery; + rowGrid(appended: string): JQuery; +} \ No newline at end of file From 3a8f59bc933292f1cb89438e8c3b7a1b722b4ce3 Mon Sep 17 00:00:00 2001 From: vingarg Date: Mon, 3 Nov 2014 20:02:55 +0530 Subject: [PATCH 065/135] Added name in CONTRIBUTORS.md --- CONTRIBUTORS.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9d27a0d1d..639abfb7a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -63,7 +63,7 @@ All definitions files include a header with the author and editors, so at some p * [Clone](https://github.com/pvorb/node-clone) (by [Kieran Simpson](https://github.com/kierans)) * [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) * [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem) and [vvakame](https://github.com/vvakame)) -* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) * [cookie](https://github.com/jshttp/cookie) (by [Pine Mizune](https://github.com/jshttp/cookie)) * [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/)) * [Cordovarduino](https://github.com/stereolux/cordovarduino) (by [Hendrik Maus](https://github.com/hendrikmaus)) @@ -207,6 +207,7 @@ All definitions files include a header with the author and editors, so at some p * [jQuery.pnotify](http://sciactive.github.io/pnotify/) (by [David Sichau](https://github.com/DavidSichau/)) * [jQuery.postMessage](http://benalman.com/projects/jquery-postmessage-plugin/) (by [Junle Li](https://github.com/lijunle)) * [jQuery.prettyphoto](https://github.com/scaron/prettyphoto) (by [Paul Gaske](https://github.com/pgaske)) +* [jQuery.rowGrid](https://github.com/brunjo/rowGrid.js) (by [Vinayak Garg](https://github.com/vinayak-garg)) * [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/)) * [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/)) * [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) (by [Blake Niemyjski](https://github.com/niemyjski)) @@ -248,7 +249,7 @@ All definitions files include a header with the author and editors, so at some p * [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC)) * [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov)) * [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel)) -* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) +* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) * [Knockout Secure Binding](https://github.com/brianmhunt/knockout-secure-binding) (by [Pine Mizune](https://github.com/pine613)) * [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig)) * [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising)) @@ -326,9 +327,9 @@ All definitions files include a header with the author and editors, so at some p * [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin)) * [PeerJS](http://peerjs.com/) (by [Toshiya Nakakura](https://github.com/nakakura)) * [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame)) -* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) -* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613)) -* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) +* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) +* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613)) +* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) * [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov)) * [Physijs](http://chandlerprall.github.io/Physijs/) (by [gyoh_k](https://github.com/gyohk)) * [Pickadate.js](https://github.com/amsul/pickadate.js) (by [Adi Dahiya](https://github.com/adidahiya)) From d68d470bbd9053908f1b72ffa2c2b13b43d491ad Mon Sep 17 00:00:00 2001 From: progre Date: Mon, 3 Nov 2014 17:11:03 +0900 Subject: [PATCH 066/135] add socket.io 1.2.0 --- socket.io/legacy/socket.io-0.9-tests.ts | 2 +- socket.io/legacy/socket.io-0.9.d.ts | 4 +- socket.io/socket.io-tests.ts | 145 ++++++++++++++++++++++++ socket.io/socket.io.d.ts | 76 +++++++++++++ 4 files changed, 224 insertions(+), 3 deletions(-) create mode 100644 socket.io/socket.io-tests.ts create mode 100644 socket.io/socket.io.d.ts diff --git a/socket.io/legacy/socket.io-0.9-tests.ts b/socket.io/legacy/socket.io-0.9-tests.ts index 40f0c6b89..0d7e12bb6 100644 --- a/socket.io/legacy/socket.io-0.9-tests.ts +++ b/socket.io/legacy/socket.io-0.9-tests.ts @@ -1,4 +1,4 @@ -import io = require('socket.io'); +import io = require('socket.io-0.9'); var socketManager = io.listen(80); diff --git a/socket.io/legacy/socket.io-0.9.d.ts b/socket.io/legacy/socket.io-0.9.d.ts index 44edbb174..5ead4abde 100644 --- a/socket.io/legacy/socket.io-0.9.d.ts +++ b/socket.io/legacy/socket.io-0.9.d.ts @@ -4,9 +4,9 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// -declare module "socket.io" { +declare module "socket.io-0.9" { import http = require('http'); export function listen(server: http.Server, options: any, fn: Function): SocketManager; diff --git a/socket.io/socket.io-tests.ts b/socket.io/socket.io-tests.ts new file mode 100644 index 000000000..442e67775 --- /dev/null +++ b/socket.io/socket.io-tests.ts @@ -0,0 +1,145 @@ +import socketIO = require('socket.io'); + +function testUsingWithNodeHTTPServer() { + var app = require('http').createServer(handler); + var io = socketIO(app); + var fs = require('fs'); + + app.listen(80); + + function handler(req: any, res: any) { + fs.readFile(__dirname + '/index.html', + function (err: any, data: any) { + if (err) { + res.writeHead(500); + return res.end('Error loading index.html'); + } + + res.writeHead(200); + res.end(data); + }); + } + + io.on('connection', function (socket) { + socket.emit('news', { hello: 'world' }); + socket.on('my other event', function (data: any) { + console.log(data); + }); + }); +} + +function testUsingWithExpress() { + var app = require('express')(); + var server = require('http').Server(app); + var io = socketIO(server); + + server.listen(80); + + app.get('/', function (req: any, res: any) { + res.sendfile(__dirname + '/index.html'); + }); + + io.on('connection', function (socket) { + socket.emit('news', { hello: 'world' }); + socket.on('my other event', function (data: any) { + console.log(data); + }); + }); +} + +function testUsingWithTheExpressFramework() { + var app = require('express').createServer(); + var io = socketIO(app); + + app.listen(80); + + app.get('/', function (req: any, res: any) { + res.sendfile(__dirname + '/index.html'); + }); + + io.on('connection', function (socket) { + socket.emit('news', { hello: 'world' }); + socket.on('my other event', function (data: any) { + console.log(data); + }); + }); +} + +function testSendingAndReceivingEvents() { + var io = socketIO(80); + + io.on('connection', function (socket) { + io.emit('this', { will: 'be received by everyone' }); + + socket.on('private message', function (from: any, msg: any) { + console.log('I received a private message by ', from, ' saying ', msg); + }); + + socket.on('disconnect', function () { + io.sockets.emit('user disconnected'); + }); + }); +} + +function testRestrictingYourselfToANamespace() { + var io = socketIO.listen(80); + var chat = io + .of('/chat') + .on('connection', function (socket) { + socket.emit('a message', { + that: 'only' + , '/chat': 'will get' + }); + chat.emit('a message', { + everyone: 'in' + , '/chat': 'will get' + }); + }); + + var news = io + .of('/news') + .on('connection', function (socket) { + socket.emit('item', { news: 'item' }); + }); +} + +function testSendingVolatileMessages() { + var io = socketIO.listen(80); + + io.sockets.on('connection', function (socket) { + var tweets = setInterval(function () { + socket.volatile.emit('bieber tweet', {}); + }, 100); + + socket.on('disconnect', function () { + clearInterval(tweets); + }); + }); +} + +function testSendingAndGettingData() { + var io = socketIO.listen(80); + + io.sockets.on('connection', function (socket) { + socket.on('ferret', function (name: any, fn: any) { + fn('woot'); + }); + }); +} + +function testBroadcastingMessages() { + var io = socketIO.listen(80); + + io.sockets.on('connection', function (socket) { + socket.broadcast.emit('user connected'); + }); +} + +function testUsingItJustAsACrossBrowserWebSocket() { + var io = socketIO.listen(80); + + io.sockets.on('connection', function (socket) { + socket.on('message', function () { }); + socket.on('disconnect', function () { }); + }); +} diff --git a/socket.io/socket.io.d.ts b/socket.io/socket.io.d.ts new file mode 100644 index 000000000..ddf7ff11b --- /dev/null +++ b/socket.io/socket.io.d.ts @@ -0,0 +1,76 @@ +// Type definitions for socket.io 1.2.0 +// Project: http://socket.io/ +// Definitions by: PROGRE +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'socket.io' { + var server: SocketIOStatic; + + export = server; +} + +interface SocketIOStatic { + (): SocketIO.Server; + (srv: any, opts?: any): SocketIO.Server; + (port: number, opts?: any): SocketIO.Server; + (opts: any): SocketIO.Server; + + listen: SocketIOStatic; +} + +declare module SocketIO { + interface Server { + serveClient(v: boolean): Server; + path(v: string): Server; + adapter(v: any): Server; + origins(v: string): Server; + sockets: Namespace; + attach(srv: any, opts: any): Server; + attach(port: number, opts: any): Server; + listen(srv: any, opts: any): Server; + listen(port: number, opts: any): Server; + bind(srv: any): Server; + onconnection(socket: any): Server; + of(nsp: String): Namespace; + emit(name: string, ...args: any[]): Socket; + use(fn: Function): Namespace; + + on(event: 'connection', listener: (socket: Socket) => void): any; + on(event: 'connect', listener: (socket: Socket) => void): any; + on(event: string, listener: Function): any; + } + + interface Namespace extends NodeJS.EventEmitter { + name: String; + connected: { [id: number]: Socket }; + use(fn: Function): Namespace + + on(event: 'connection', listener: (socket: Socket) => void): any; + on(event: 'connect', listener: (socket: Socket) => void): any; + on(event: string, listener: Function): any; + } + + interface Socket { + rooms: string[]; + client: Client; + conn: Socket; + request: any; + id: string; + emit(name: string, ...args: any[]): Socket; + join(name: string, fn?: Function): Socket; + leave(name: string, fn?: Function): Socket; + to(room: string): Socket; + in(room: string): Socket; + + on(event: string, listener: Function): any; + broadcast: Socket; + volatile: Socket; + } + + interface Client { + conn: any; + request: any; + } +} From bff52380d69b6736575bc933730c777d5a93ec9e Mon Sep 17 00:00:00 2001 From: progre Date: Tue, 4 Nov 2014 00:11:09 +0900 Subject: [PATCH 067/135] add socket.io-client 1.2.0 --- .../socket.io-client-0.9-commonjs-tests.ts} | 20 +++--- .../legacy/socket.io-client-0.9-tests.ts | 10 +++ .../legacy/socket.io-client-0.9.d.ts | 40 ++++++++++++ socket.io-client/socket.io-client-tests.ts | 61 ++++++++++++++++--- socket.io-client/socket.io-client.d.ts | 56 +++++++++-------- 5 files changed, 145 insertions(+), 42 deletions(-) rename socket.io-client/{socket.io-client-commonjs-tests.ts => legacy/socket.io-client-0.9-commonjs-tests.ts} (81%) create mode 100644 socket.io-client/legacy/socket.io-client-0.9-tests.ts create mode 100644 socket.io-client/legacy/socket.io-client-0.9.d.ts diff --git a/socket.io-client/socket.io-client-commonjs-tests.ts b/socket.io-client/legacy/socket.io-client-0.9-commonjs-tests.ts similarity index 81% rename from socket.io-client/socket.io-client-commonjs-tests.ts rename to socket.io-client/legacy/socket.io-client-0.9-commonjs-tests.ts index 7b5f96747..beb8f0fad 100644 --- a/socket.io-client/socket.io-client-commonjs-tests.ts +++ b/socket.io-client/legacy/socket.io-client-0.9-commonjs-tests.ts @@ -1,10 +1,10 @@ -import io = require('socket.io-client'); - -var socket = io.connect('http://localhost:80'); - -socket.on('connect', function () { - console.log('Connected!'); - socket.emit('event', 'some test data', function () { - console.log('Sent some data.'); - }); -}); +import io = require('socket.io-client-0.9'); + +var socket = io.connect('http://localhost:80'); + +socket.on('connect', function () { + console.log('Connected!'); + socket.emit('event', 'some test data', function () { + console.log('Sent some data.'); + }); +}); diff --git a/socket.io-client/legacy/socket.io-client-0.9-tests.ts b/socket.io-client/legacy/socket.io-client-0.9-tests.ts new file mode 100644 index 000000000..717830628 --- /dev/null +++ b/socket.io-client/legacy/socket.io-client-0.9-tests.ts @@ -0,0 +1,10 @@ +/// + +var socket = io.connect('http://localhost:80'); + +socket.on('connect', function () { + console.log('Connected!'); + socket.emit('event', 'some test data', function () { + console.log('Sent some data.'); + }); +}); diff --git a/socket.io-client/legacy/socket.io-client-0.9.d.ts b/socket.io-client/legacy/socket.io-client-0.9.d.ts new file mode 100644 index 000000000..0b3626e42 --- /dev/null +++ b/socket.io-client/legacy/socket.io-client-0.9.d.ts @@ -0,0 +1,40 @@ +// Type definitions for socket.io nodejs client +// Project: http://socket.io/ +// Definitions by: Maido Kaara +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "socket.io-client-0.9" { + export = io; +} + +declare var io: SocketIOStatic; + +interface SocketIOStatic { + connect(host: string, details?: any): SocketIOClient.Socket; +} + +declare module SocketIOClient { + interface EventEmitter { + emit(name: string, ...data: any[]): any; + on(ns: string, fn: Function): EventEmitter; + addListener(ns: string, fn: Function): EventEmitter; + removeListener(ns: string, fn: Function): EventEmitter; + removeAllListeners(ns: string): EventEmitter; + once(ns: string, fn: Function): EventEmitter; + listeners(ns: string): Function[]; + } + + interface SocketNamespace extends EventEmitter { + of(name: string): SocketNamespace; + send(data: any, fn: Function): SocketNamespace; + emit(name: string): SocketNamespace; + } + + interface Socket extends EventEmitter { + of(name: string): SocketNamespace; + connect(fn: Function): Socket; + packet(data: any): Socket; + flushBuffer(): void; + disconnect(): Socket; + } +} diff --git a/socket.io-client/socket.io-client-tests.ts b/socket.io-client/socket.io-client-tests.ts index e1022c61a..215932c46 100644 --- a/socket.io-client/socket.io-client-tests.ts +++ b/socket.io-client/socket.io-client-tests.ts @@ -1,10 +1,57 @@ /// -var socket = io.connect('http://localhost:80'); - -socket.on('connect', function () { - console.log('Connected!'); - socket.emit('event', 'some test data', function () { - console.log('Sent some data.'); +function testUsingWithNodeHTTPServer() { + var socket = io('http://localhost'); + socket.on('news', function (data: any) { + console.log(data); + socket.emit('my other event', { my: 'data' }); }); -}); +} + +function testUsingWithExpress() { + var socket = io.connect('http://localhost'); + socket.on('news', function (data: any) { + console.log(data); + socket.emit('my other event', { my: 'data' }); + }); +} + +function testUsingWithTheExpressFramework() { + var socket = io.connect('http://localhost'); + socket.on('news', function (data: any) { + console.log(data); + socket.emit('my other event', { my: 'data' }); + }); +} + +function testRestrictingYourselfToANamespace() { + var chat = io.connect('http://localhost/chat') + , news = io.connect('http://localhost/news'); + + chat.on('connect', function () { + chat.emit('hi!'); + }); + + news.on('news', function () { + news.emit('woot'); + }); +} + +function testSendingAndGettingData() { + var socket = io(); + socket.on('connect', function () { + socket.emit('ferret', 'tobi', function (data: any) { + console.log(data); + }); + }); +} + +function testUsingItJustAsACrossBrowserWebSocket() { + var socket = io('http://localhost/'); + socket.on('connect', function () { + socket.emit('hi'); + + socket.on('message', function (msg: any) { + }); + }); +} diff --git a/socket.io-client/socket.io-client.d.ts b/socket.io-client/socket.io-client.d.ts index 079ca7cbb..b03cc830b 100644 --- a/socket.io-client/socket.io-client.d.ts +++ b/socket.io-client/socket.io-client.d.ts @@ -1,40 +1,46 @@ -// Type definitions for socket.io nodejs client +// Type definitions for socket.io-client 1.2.0 // Project: http://socket.io/ -// Definitions by: Maido Kaara +// Definitions by: PROGRE // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module "socket.io-client" { - export = io; +/// + +declare var io: SocketIOClientStatic; + +declare module 'socket.io-client' { + export = io; } -declare var io: SocketIOStatic; - -interface SocketIOStatic { +interface SocketIOClientStatic { + (host: string, details?: any): SocketIOClient.Socket; + (details?: any): SocketIOClient.Socket; connect(host: string, details?: any): SocketIOClient.Socket; + connect(details?: any): SocketIOClient.Socket; + protocol: number; + Socket: { new (...args: any[]): SocketIOClient.Socket }; + Manager: SocketIOClient.ManagerStatic; } declare module SocketIOClient { - interface EventEmitter { - emit(name: string, ...data: any[]): any; - on(ns: string, fn: Function): EventEmitter; - addListener(ns: string, fn: Function): EventEmitter; - removeListener(ns: string, fn: Function): EventEmitter; - removeAllListeners(ns: string): EventEmitter; - once(ns: string, fn: Function): EventEmitter; - listeners(ns: string): Function[]; + interface Socket { + on(event: string, fn: Function): Socket; + once(event: string, fn: Function): Socket; + off(event: string, fn: Function): Socket; + emit(event: string, ...args: any[]): Socket; + listeners(event: string): Function[]; + hasListeners(event: string): boolean; } - interface SocketNamespace extends EventEmitter { - of(name: string): SocketNamespace; - send(data: any, fn: Function): SocketNamespace; - emit(name: string): SocketNamespace; + interface ManagerStatic { + (url: string, opts: any): SocketIOClient.Manager; + new (url: string, opts: any): SocketIOClient.Manager; } - interface Socket extends EventEmitter { - of(name: string): SocketNamespace; - connect(fn: Function): Socket; - packet(data: any): Socket; - flushBuffer(): void; - disconnect(): Socket; + interface Manager { + reconnection(v: boolean): Manager; + reconnectionAttempts(v: boolean): Manager; + reconnectionDelay(v: boolean): Manager; + reconnectionDelayMax(v: boolean): Manager; + timeout(v: boolean): Manager; } } From 5868972ea7b9d804a806519d4ef4c8cba6476b00 Mon Sep 17 00:00:00 2001 From: Xiaohan Zhang Date: Mon, 3 Nov 2014 13:37:12 -0800 Subject: [PATCH 068/135] Add applyAsync to IRootScopeService --- angularjs/angular.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 2c1436096..4659da761 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -482,6 +482,9 @@ declare module ng { $apply(): any; $apply(exp: string): any; $apply(exp: (scope: IScope) => any): any; + + $applyAsync(exp: string): any; + $applyAsync(exp: (scope: IScope) => any): any; $broadcast(name: string, ...args: any[]): IAngularEvent; $destroy(): void; From 17df17872947da251560c3ba61f8a4cbf051bc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20De=20Saint=20Florent?= Date: Mon, 3 Nov 2014 17:08:23 -0500 Subject: [PATCH 069/135] Update Q.d.ts with optional onRejected parameter Spread method does not require onRejected param. From Q documentation: function eventualAdd(a, b) { return Q.spread([a, b], function (a, b) { return a + b; }) } --- q/Q.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/q/Q.d.ts b/q/Q.d.ts index 3e7371ead..59e891c52 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -248,43 +248,43 @@ declare module Q { * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: any[], onFulfilled: (...args: any[]) => IPromise, onRejected: (reason: any) => IPromise): Promise; + export function spread(promises: any[], onFulfilled: (...args: any[]) => IPromise, onRejected?: (reason: any) => IPromise): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: any[], onFulfilled: (...args: any[]) => IPromise, onRejected: (reason: any) => U): Promise; + export function spread(promises: any[], onFulfilled: (...args: any[]) => IPromise, onRejected?: (reason: any) => U): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: any[], onFulfilled: (...args: any[]) => U, onRejected: (reason: any) => IPromise): Promise; + export function spread(promises: any[], onFulfilled: (...args: any[]) => U, onRejected?: (reason: any) => IPromise): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: any[], onFulfilled: (...args: any[]) => U, onRejected: (reason: any) => U): Promise; + export function spread(promises: any[], onFulfilled: (...args: any[]) => U, onRejected?: (reason: any) => U): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => IPromise, onRejected: (reason: any) => IPromise): Promise; + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => IPromise, onRejected?: (reason: any) => IPromise): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => IPromise, onRejected: (reason: any) => U): Promise; + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => IPromise, onRejected?: (reason: any) => U): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => U, onRejected: (reason: any) => IPromise): Promise; + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => U, onRejected?: (reason: any) => IPromise): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => U, onRejected: (reason: any) => U): Promise; + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => U, onRejected?: (reason: any) => U): Promise; /** * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected before ms milliseconds, the returned promise will be rejected with an Error with the given message. If message is not supplied, the message will be "Timed out after " + ms + " ms". From d41f971197675d244b72db63fb8b180fbc35e086 Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Tue, 4 Nov 2014 16:41:19 +0900 Subject: [PATCH 070/135] Fix a bug --- zepto/zepto.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zepto/zepto.d.ts b/zepto/zepto.d.ts index 5aa3aa825..aa497b03f 100644 --- a/zepto/zepto.d.ts +++ b/zepto/zepto.d.ts @@ -993,6 +993,12 @@ interface ZeptoCollection { **/ prependTo(content: HTMLElement[]): ZeptoCollection; + /** + * @see ZeptoCollection.prependTo + * @param content + **/ + prependTo(content: ZeptoCollection): ZeptoCollection; + /** * Get the previous sibling—optionally filtered by selector—of each element in the collection. * @param selector From 5559466c5484bec46643fa9ff980f5aa0552d370 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Tue, 4 Nov 2014 19:08:20 +0900 Subject: [PATCH 071/135] update typefiles --- superagent/superagent.d.ts | 2 ++ supertest/supertest-tests.ts | 29 +++++++++++++++++++++- supertest/supertest.d.ts | 47 +++++++++++++++++++++++++++++------- 3 files changed, 68 insertions(+), 10 deletions(-) diff --git a/superagent/superagent.d.ts b/superagent/superagent.d.ts index 9e6f9c4b5..0abed7438 100644 --- a/superagent/superagent.d.ts +++ b/superagent/superagent.d.ts @@ -79,6 +79,8 @@ declare module "superagent" { subscribe(url: string, callback?: (err: Error, res: Response) => void): Request; unsubscribe(url: string, callback?: (err: Error, res: Response) => void): Request; patch(url: string, callback?: (err: Error, res: Response) => void): Request; + search(url: string, callback?: (err: Error, res: Response) => void): Request; + connect(url: string, callback?: (err: Error, res: Response) => void): Request; parse(fn: Function): Request; saveCookies(res: Response): void; attachCookies(req: Request): void; diff --git a/supertest/supertest-tests.ts b/supertest/supertest-tests.ts index c4bdfb271..120cb43c0 100644 --- a/supertest/supertest-tests.ts +++ b/supertest/supertest-tests.ts @@ -29,4 +29,31 @@ request req.expect(200, (err, res) => { if (err) throw err; }); - }); \ No newline at end of file + }); + +// cookie scenario, new version +var client = supertest.agent(app); +client + .post('/login') + .end((err, res) => { + if (err) throw err; + + client.get('/admin') + .expect(200, (err, res) => { + if (err) throw err; + }); + }); + +// functional expect +supertest(app) + .get('/') + .expect(hasPreviousAndNextKeys) + .end((err, res) => { + if (err) throw err; + }); + +function hasPreviousAndNextKeys(res: supertest.Response) { + if (!('next' in res.body)) return "missing next key"; + if (!('prev' in res.body)) throw new Error("missing prev key"); +} + diff --git a/supertest/supertest.d.ts b/supertest/supertest.d.ts index 9b60431f0..075102a53 100644 --- a/supertest/supertest.d.ts +++ b/supertest/supertest.d.ts @@ -1,4 +1,4 @@ -// Type definitions for SuperTest 0.8.0 +// Type definitions for SuperTest 0.14.0 // Project: https://github.com/visionmedia/supertest // Definitions by: Alex Varju // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -12,19 +12,21 @@ declare module "supertest" { interface Test extends superagent.Request { url: string; serverAddress(app: any, path: string): string; - expect(status: number, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(status: number, body: string, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(body: string, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(body: RegExp, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(body: Object, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(field: string, val: string, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(field: string, val: RegExp, callback?: (err: Error, res: superagent.Response) => void): Test; + expect(status: number, callback?: (err: Error, res: Response) => void): Test; + expect(status: number, body: string, callback?: (err: Error, res: Response) => void): Test; + expect(body: string, callback?: (err: Error, res: Response) => void): Test; + expect(body: RegExp, callback?: (err: Error, res: Response) => void): Test; + expect(body: Object, callback?: (err: Error, res: Response) => void): Test; + expect(field: string, val: string, callback?: (err: Error, res: Response) => void): Test; + expect(field: string, val: RegExp, callback?: (err: Error, res: Response) => void): Test; + expect(checker: (res: Response) => any): Test; set(field: string, val: string): Test; set(field: Object): Test; query(val: Object): Test; send(data: string): Test; send(data: Object): Test; } + interface Response extends superagent.Response {} interface SuperTest { get(url: string): Test; @@ -52,7 +54,34 @@ declare module "supertest" { patch(url: string): Test; } - function agent(): superagent.Agent; + interface TestAgent extends superagent.Agent { + get(url: string, callback?: (err: Error, res: Response) => void): Test; + post(url: string, callback?: (err: Error, res: Response) => void): Test; + put(url: string, callback?: (err: Error, res: Response) => void): Test; + head(url: string, callback?: (err: Error, res: Response) => void): Test; + del(url: string, callback?: (err: Error, res: Response) => void): Test; + options(url: string, callback?: (err: Error, res: Response) => void): Test; + trace(url: string, callback?: (err: Error, res: Response) => void): Test; + copy(url: string, callback?: (err: Error, res: Response) => void): Test; + lock(url: string, callback?: (err: Error, res: Response) => void): Test; + mkcol(url: string, callback?: (err: Error, res: Response) => void): Test; + move(url: string, callback?: (err: Error, res: Response) => void): Test; + propfind(url: string, callback?: (err: Error, res: Response) => void): Test; + proppatch(url: string, callback?: (err: Error, res: Response) => void): Test; + unlock(url: string, callback?: (err: Error, res: Response) => void): Test; + report(url: string, callback?: (err: Error, res: Response) => void): Test; + mkactivity(url: string, callback?: (err: Error, res: Response) => void): Test; + checkout(url: string, callback?: (err: Error, res: Response) => void): Test; + merge(url: string, callback?: (err: Error, res: Response) => void): Test; + //m-search(url: string, callback?: (err: Error, res: Response) => void): Test; + notify(url: string, callback?: (err: Error, res: Response) => void): Test; + subscribe(url: string, callback?: (err: Error, res: Response) => void): Test; + unsubscribe(url: string, callback?: (err: Error, res: Response) => void): Test; + patch(url: string, callback?: (err: Error, res: Response) => void): Test; + search(url: string, callback?: (err: Error, res: Response) => void): Test; + connect(url: string, callback?: (err: Error, res: Response) => void): Test; + } + function agent(app?: any): supertest.TestAgent; } function supertest(app: any): supertest.SuperTest; From 56bdc23f7832bd2563a58d08f41f102e49d294c8 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Tue, 4 Nov 2014 21:15:58 +0900 Subject: [PATCH 072/135] add agent methods --- supertest/supertest.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/supertest/supertest.d.ts b/supertest/supertest.d.ts index 075102a53..cb2bb78b3 100644 --- a/supertest/supertest.d.ts +++ b/supertest/supertest.d.ts @@ -20,11 +20,22 @@ declare module "supertest" { expect(field: string, val: string, callback?: (err: Error, res: Response) => void): Test; expect(field: string, val: RegExp, callback?: (err: Error, res: Response) => void): Test; expect(checker: (res: Response) => any): Test; + + attach(field: string, file: string, filename: string): Test; + redirects(n: number): Test; + part(): Test; set(field: string, val: string): Test; set(field: Object): Test; + type(val: string): Test; query(val: Object): Test; send(data: string): Test; send(data: Object): Test; + buffer(val: boolean): Test; + timeout(ms: number): Test; + clearTimeout(): Test; + auth(user: string, name: string): Test; + field(name: string, val: string): Test; + end(callback?: (err: Error, res: Response) => void): Test; } interface Response extends superagent.Response {} From bf24c30aaa7d87e683ef781abd18702b441b6e54 Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Tue, 4 Nov 2014 12:21:55 -0800 Subject: [PATCH 073/135] Update TestUtils.findRenderedComponentWithType This function gets that actual React component rather than the element. This allows the tester to call functions like setState on the component as shown in the new test. --- react-addons/react-addons-tests.ts | 20 +++++++++++++------- react-addons/react-addons.d.ts | 5 +++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/react-addons/react-addons-tests.ts b/react-addons/react-addons-tests.ts index 4834d6e23..7a835dfeb 100644 --- a/react-addons/react-addons-tests.ts +++ b/react-addons/react-addons-tests.ts @@ -113,21 +113,27 @@ React.addons.TestUtils.Simulate.click(node); React.addons.TestUtils.Simulate.change(node); React.addons.TestUtils.Simulate.keyDown(node, {key: "Enter"}); -var GoodbyeMessage = React.createClass({displayName: 'GoodbyeMessage', +var Greeting = React.createClass({displayName: 'Greeting', + getInitialState: function() { + return {morning: true}; + }, render: function() { - return React.DOM.div(null, "Goodbye ", (>this).props.name); + var me = >this; + return React.DOM.div(null, (me.state.morning ? "Hello" : "Goodbye "), me.props.name); } }); -React.addons.TestUtils.renderIntoDocument(GoodbyeMessage({name: "John"})); + +var root = React.addons.TestUtils.renderIntoDocument(Greeting({name: "John"})); +var greeting = React.addons.TestUtils.findRenderedComponentWithType(root, Greeting); +greeting.setState({ + morning: false +}); var isImportant: boolean; var isRead: boolean; var cx = React.addons.classSet; -var classes = cx({ +var classes: string = cx({ 'message': true, 'message-important': isImportant, 'message-read': isRead }); - - - diff --git a/react-addons/react-addons.d.ts b/react-addons/react-addons.d.ts index 35fc5f1fb..686dd0563 100644 --- a/react-addons/react-addons.d.ts +++ b/react-addons/react-addons.d.ts @@ -93,8 +93,9 @@ declare module React { findRenderedDOMComponentWithClass(tree: ReactElement, className: string): ReactElement; scryRenderedDOMComponentsWithTag(tree: ReactElement, className: string): ReactElement[]; findRenderedDOMComponentWithTag(tree: ReactElement, tagName: string): ReactElement; - scryFindRenderedComponentsWithTag(tree: ReactElement, componentClass: Function): ReactElement[]; - findRenderedComponentWithType(tree: ReactElement, componentClass: Function): ReactElement; + scryRenderedComponentsWithTag(tree: ReactElement, componentClass: Function): ReactElement[]; + findRenderedComponentWithType

(tree: ReactElement, componentClass: ReactComponentFactory

): Component; + scryRenderedComponentsWithType

(tree: ReactElement, componentClass: ReactComponentFactory

): Component[]; } export interface SyntheticEventData { From 5c44d00ca60516e637e93283eb0ca02bc0781a78 Mon Sep 17 00:00:00 2001 From: Yang Guan Date: Tue, 4 Nov 2014 15:18:20 -0800 Subject: [PATCH 074/135] Correct a comment --- heatmap.js/heatmap.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/heatmap.js/heatmap.d.ts b/heatmap.js/heatmap.d.ts index bff76db98..04b038c25 100644 --- a/heatmap.js/heatmap.d.ts +++ b/heatmap.js/heatmap.d.ts @@ -27,8 +27,8 @@ interface HeatmapConfiguration { radius?: number; /* - * The radius each datapoint will have (if not specified on the datapoint - * itself) + * Indicate whether the heatmap should use a global extrema or a local + * extrema (the maximum and minimum of the currently displayed viewport) */ useLocalExtrema?: boolean; From 0a16b7f522b801a0eb741eea4cf9ed74d5f67e1f Mon Sep 17 00:00:00 2001 From: Yang Guan Date: Tue, 4 Nov 2014 17:00:14 -0800 Subject: [PATCH 075/135] Put variables into alphabetical order --- heatmap.js/heatmap.d.ts | 78 ++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/heatmap.js/heatmap.d.ts b/heatmap.js/heatmap.d.ts index 04b038c25..012e3f9d9 100644 --- a/heatmap.js/heatmap.d.ts +++ b/heatmap.js/heatmap.d.ts @@ -15,28 +15,29 @@ interface HeatmapConfiguration { */ backgroundColor?: string; + /* + * The blur factor that will be applied to all datapoints. The higher the + * blur factor is, the smoother the gradients will be + * Default value: 0.85 + */ + blur?: number; + /* * An object that represents the gradient */ gradient?: any; /* - * The radius each datapoint will have (if not specified on the datapoint - * itself) + * The property name of your latitude coordinate in a datapoint + * Default value: 'x' */ - radius?: number; + latField?: string; /* - * Indicate whether the heatmap should use a global extrema or a local - * extrema (the maximum and minimum of the currently displayed viewport) + * The property name of your longitude coordinate in a datapoint + * Default value: 'y' */ - useLocalExtrema?: boolean; - - /* - * A global opacity for the whole heatmap. This overrides maxOpacity and - * minOpacity if set - */ - opacity?: number; + lngField?: string; /* * The maximal opacity the highest value in the heatmap will have. (will be @@ -52,26 +53,25 @@ interface HeatmapConfiguration { minOpacity?: number; /* - * The blur factor that will be applied to all datapoints. The higher the - * blur factor is, the smoother the gradients will be - * Default value: 0.85 + * A global opacity for the whole heatmap. This overrides maxOpacity and + * minOpacity if set */ - blur?: number; + opacity?: number; /* - * The property name of your latitude coordinate in a datapoint - * Default value: 'x' + * The radius each datapoint will have (if not specified on the datapoint + * itself) */ - latField?: string; + radius?: number; /* - * The property name of your longitude coordinate in a datapoint - * Default value: 'y' + * Indicate whether the heatmap should use a global extrema or a local + * extrema (the maximum and minimum of the currently displayed viewport) */ - lngField?: string; + useLocalExtrema?: boolean; /* - * The property name of your y coordinate in a datapoint + * The property name of the value/weight in a datapoint */ valueField: string; } @@ -81,28 +81,28 @@ interface HeatmapConfiguration { * HeatmapConfig.latField, HeatmapConfig.lngField and HeatmapConfig.valueField */ interface HeatmapDataPoint { - [index: string] : number; + [index: string]: number; } /* - * An object representing the set of data points on a heatmap. + * An object representing the set of data points on a heatmap */ -interface HeatmapDataObject { - - /* - * Max value of of the valueField - */ - max?: number; - - /* - * Min value of of the valueField - */ - min?: number; +interface HeatmapData { /* * An array of HeatmapDataPoints */ data: HeatmapDataPoint[]; + + /* + * Max value of the valueField + */ + max?: number; + + /* + * Min value of the valueField + */ + min?: number; } /* @@ -116,8 +116,8 @@ declare class HeatmapOverlay { constructor(configuration: HeatmapConfiguration) /* - * Create DOM elements for othe overlay, adding them to map panes and - * puts listeners on relevant map events + * Create DOM elements for an overlay, adding them to map panes and puts + * listeners on relevant map events */ onAdd(map: L.Map): void; @@ -130,5 +130,5 @@ declare class HeatmapOverlay { /* * Initialize a heatmap instance with the given dataset */ - setData(data: {}): void; + setData(data: HeatmapData): void; } From f8c4f8dfb1e6a38afefdce0d1caf949ed3b66e4b Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 3 Nov 2014 18:14:50 +0900 Subject: [PATCH 076/135] update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1081 ++++++++++++++++++++++++++++------------------- 1 file changed, 641 insertions(+), 440 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9d27a0d1d..2b4c0083c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,443 +1,644 @@ # Contributors -This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url. +This document generated by [dt-contributors-generator](https://github.com/vvakame/dt-contributors-generator). +(but run scripts are manual operation. please wait :P) +* [:link:](accounting/accounting.d.ts) [accounting.js](http://josscrowcroft.github.io/accounting.js) by [Sergey Gerasimov](https://github.com/gerich-home) +* [:link:](ace/ace.d.ts) [Ace Ajax.org Cloud9 Editor](http://ace.ajax.org) by [Diullei Gomes](https://github.com/Diullei) +* [:link:](add2home/add2home.d.ts) [add2home](http://cubiq.org/add-to-home-screen) by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw) +* [:link:](alertify/alertify.d.ts) [alertify](http://fabien-d.github.io/alertify.js) by [John Jeffery](http://github.com/jjeffery) +* [:link:](amcharts/AmCharts.d.ts) [amCharts](http://www.amcharts.com) by [aleksey-bykov](https://github.com/aleksey-bykov) +* [:link:](amplifyjs/amplifyjs.d.ts) [AmplifyJs](http://amplifyjs.com) by [Jonas Eriksson](https://github.com/joeriks) +* [:link:](angular-file-upload/angular-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/angular-file-upload) by [John Reilly](https://github.com/johnnyreilly) +* [:link:](angularjs/angular.d.ts) [Angular JS](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) +* [:link:](angularjs/angular-animate.d.ts) [Angular JS (ngAnimate module)](http://angularjs.org) by [Michel Salib](https://github.com/michelsalib), [Adi Dahiya](https://github.com/adidahiya) +* [:link:](angularjs/angular-cookies.d.ts) [Angular JS (ngCookies module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) +* [:link:](angularjs/angular-mocks.d.ts) [Angular JS (ngMock, ngMockE2E module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) +* [:link:](angularjs/angular-resource.d.ts) [Angular JS (ngResource module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar), [Michael Jess](http://github.com/miffels) +* [:link:](angularjs/angular-route.d.ts) [Angular JS (ngRoute module)](http://angularjs.org) by [Jonathan Park](https://github.com/park9140) +* [:link:](angularjs/angular-sanitize.d.ts) [Angular JS (ngSanitize module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) +* [:link:](angular-ui/angular-ui-router.d.ts) [Angular JS (ui.router module)](https://github.com/angular-ui/ui-router) by [Michel Salib](https://github.com/michelsalib) +* [:link:](angular-protractor/angular-protractor.d.ts) [Angular Protractor](https://github.com/angular/protractor) by [Bill Armstrong](https://github.com/BillArmstrong) +* [:link:](angularjs/angular-scenario.d.ts) [Angular Scenario Testing](http://angularjs.org) by [RomanoLindano](https://github.com/RomanoLindano) +* [:link:](angular-translate/angular-translate.d.ts) [Angular Translate (pascalprecht.translate module)](https://github.com/PascalPrecht/angular-translate) by [Michel Salib](https://github.com/michelsalib) +* [:link:](angular-ui-bootstrap/angular-ui-bootstrap.d.ts) [Angular UI Bootstrap](https://github.com/angular-ui/bootstrap) by [Brian Surowiec](https://github.com/xt0rted) +* [:link:](angular-bootstrap-lightbox/angular-bootstrap-lightbox.d.ts) [angular-bootstrap-lightbox](https://github.com/compact/angular-bootstrap-lightbox) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](angular-hotkeys/angular-hotkeys.d.ts) [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) by [Jason Zhao](https://github.com/jlz27) +* [:link:](angular-http-auth/angular-http-auth.d.ts) [angular-http-auth](https://github.com/witoldsz/angular-http-auth) by [vvakame](https://github.com/vvakame) +* [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped) +* [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin Biegała](https://github.com/Biegal) +* [:link:](angular-agility/angular-agility.d.ts) [AngularAgility](https://github.com/AngularAgility/AngularAgility) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](angularfire/angularfire.d.ts) [AngularFire](http://angularfire.com) by [Dénes Harmath](http://github.com/thSoft) +* [:link:](angularLocalStorage/angularLocalStorage.d.ts) [AngularLocalStorage](https://github.com/agrublev/angularLocalStorage) by [Horiuchi_H](https://github.com/horiuchi) +* [:link:](ansicolors/ansicolors.d.ts) [ansicolors](https://github.com/thlorenz/ansicolors) by [rogierschouten](https://github.com/rogierschouten) +* [:link:](any-db/any-db.d.ts) [any-db](https://github.com/grncdr/node-any-db) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](any-db-transaction/any-db-transaction.d.ts) [any-db-transaction](https://github.com/grncdr/node-any-db-transaction) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](cordova/cordova.d.ts) [Apache Cordova](http://cordova.apache.org) by [Microsoft Open Technologies Inc.](http://msopentech.com) +* [:link:](appframework/appframework.d.ts) [AppFramework](http://app-framework-software.intel.com) by [kyo_ago](https://github.com/kyo-ago) +* [:link:](arbiter/Arbiter.d.ts) [Arbiter.js](http://arbiterjs.com) by [Arash Shakery](https://github.com/arash16) +* [:link:](asciify/asciify.d.ts) [asciify](https://www.npmjs.org/package/asciify) by [Alan Norbauer](http://alan.norbauer.com) +* [:link:](assert/assert.d.ts) [assert and power-assert](https://github.com/Jxck/assert) by [vvakame](https://github.com/vvakame) +* [:link:](assertion-error/assertion-error.d.ts) [assertion-error 1.0 0](https://github.com/chaijs/assertion-error) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](async/async.d.ts) [Async](https://github.com/caolan/async) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](atmosphere/atmosphere.d.ts) [Atmosphere](https://github.com/Atmosphere/atmosphere-javascript) by [Kai Toedter](https://github.com/toedter) +* [:link:](atom/atom.d.ts) [Atom](https://atom.io) by [vvakame](https://github.com/vvakame) +* [:link:](atpl/atpl.d.ts) [atpl](https://github.com/soywiz/atpl.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](auth0/auth0.d.ts) [Auth0.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) +* [:link:](auth0.widget/auth0.widget.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) +* [:link:](aws-sdk/aws-sdk.d.ts) [aws-sdk](https://github.com/aws/aws-sdk-js) by [midknight41](https://github.com/midknight41) +* [:link:](node-azure/azure.d.ts) [Azure SDK for Node -](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](backbone/backbone.d.ts) [Backbone](http://backbonejs.org) by [Boris Yankov](https://github.com/borisyankov), [Natan Vivo](https://github.com/nvivo) +* [:link:](backbone-relational/backbone-relational.d.ts) [Backbone-relational](http://backbonerelational.org) by [Eirik Hoem](https://github.com/eirikhm) +* [:link:](backgrid/backgrid.d.ts) [Backgrid](http://backgridjs.com) by [Jeremy Lujan](https://github.com/jlujan) +* [:link:](bcrypt/bcrypt.d.ts) [bcrypt](https://www.npmjs.org/package/bcrypt) by [Peter Harris](https://github.com/codeanimal) +* [:link:](bgiframe/typescript.bgiframe.d.ts) [bgiframe](https://github.com/sumegizoltan/BgiFrame) by [Zoltan Sumegi](https://github.com/sumegizoltan) +* [:link:](big.js/big.js.d.ts) [big.js](https://github.com/MikeMcl/big.js) by [Steve Ognibene](https://github.com/nycdotnet) +* [:link:](bigint/bigint.d.ts) [BigInt](https://github.com/Evgenus/BigInt) by [Eugene Chernyshov](https://github.com/Evgenus) +* [:link:](big-integer/big-integer.d.ts) [BigInteger.js](https://github.com/peterolson/BigInteger.js) by [Ingo Bürk](https://github.com/Airblader) +* [:link:](bigscreen/bigscreen.d.ts) [BigScreen](http://brad.is/coding/BigScreen) by [Douglas Eichelberger](https://github.com/dduugg) +* [:link:](bluebird/bluebird.d.ts) [bluebird](https://github.com/petkaantonov/bluebird) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](body-parser/body-parser.d.ts) [body-parser](http://expressjs.com) by [Santi Albo](https://github.com/santialbo), [VILIC VANE](https://vilic.info), [Jonathan Häberle](https://github.com/dreampulse) +* [:link:](bootbox/bootbox.d.ts) [Bootbox](https://github.com/makeusabrew/bootbox) by [Vincent Bortone](https://github.com/vbortone), [Kon Pik](https://github.com/konpikwastaken) +* [:link:](bootstrap/bootstrap.d.ts) [Bootstrap](http://twitter.github.com/bootstrap) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts) [Bootstrap datetimepicker v3](http://eonasdan.github.io/bootstrap-datetimepicker) by [Jesica N. Fera](https://github.com/bayitajesi) +* [:link:](bootstrap-notify/bootstrap-notify.d.ts) [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker) +* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker) +* [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin) +* [:link:](breeze/breeze.d.ts) [Breeze](http://www.breezejs.com) by [Boris Yankov](https://github.com/borisyankov), [IdeaBlade](https://github.com/IdeaBlade/Breeze) +* [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby) +* [:link:](browserify/browserify.d.ts) [Browserify](http://browserify.org) by [Andrew Gaspar](https://github.com/AndrewGaspar) +* [:link:](bucks/bucks.d.ts) [bucks.js](https://github.com/CyberAgent/bucks.js) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](buffer-equal/buffer-equal.d.ts) [buffer-equal 1.0 0](https://github.com/substack/node-buffer-equal) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](bl/bl.d.ts) [BufferList](https://github.com/rvagg/bl) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](bufferstream/bufferstream.d.ts) [bufferstream](https://github.com/dodo/node-bufferstream) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine -](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) +* [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com) +* [:link:](canvasjs/canvasjs.d.ts) [CanvasJS v1.5.1 GA](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5) +* [:link:](threejs/three-canvasrenderer.d.ts) [CanvasRenderer.js](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](casperjs/casperjs.d.ts) [CasperJS v1.0.0 API](http://casperjs.org) by [Jed Mao](https://github.com/jedmao) +* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Hunsaker](https://github.com/jedhunsaker), [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](chai-datetime/chai-datetime.d.ts) [chai-datetime](https://github.com/gaslight/chai-datetime.git) by [Cliff Burger](https://github.com/cliffburger) +* [:link:](chai-fuzzy/chai-fuzzy.d.ts) [chai-fuzzy 1.3.0 assert style](http://chaijs.com/plugins/chai-fuzzy) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](chai-jquery/chai-jquery.d.ts) [chai-jquery](https://github.com/chaijs/chai-jquery) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) +* [:link:](chalk/chalk.d.ts) [chalk](https://github.com/sindresorhus/chalk) by [Diullei Gomes](https://github.com/Diullei), [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](chartjs/chart.d.ts) [Chart.js](https://github.com/nnnick/Chart.js) by [Steve Fenton](https://github.com/Steve-Fenton) +* [:link:](devextreme/dx.chartjs.d.ts) [ChartJS](http://js.devexpress.com/WebDevelopment/Charts) by [DevExpress Inc.](http://devexpress.com) +* [:link:](checksum/checksum.d.ts) [checksum](https://github.com/dshaw/checksum) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](cheerio/cheerio.d.ts) [Cheerio](https://github.com/cheeriojs/cheerio) by [Bret Little](https://github.com/blittle), [VILIC VANE](http://vilic.info), [Wayne Maurer](https://github.com/wmaurer) +* [:link:](chosen/chosen.jquery.d.ts) [Chosen.JQuery](http://harvesthq.github.com/chosen) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](chroma-js/chroma-js.d.ts) [Chroma.js](https://github.com/gka/chroma.js) by [Sebastian Brückner](https://github.com/invliD) +* [:link:](chrome/chrome.d.ts) [Chrome extension development](http://developer.chrome.com/extensions) by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10) +* [:link:](chrome/chrome-app.d.ts) [Chrome packaged application development](http://developer.chrome.com/apps) by [Adam Lay](https://github.com/AdamLay), [MIZUNE Pine](https://github.com/pine613), [MIZUSHIMA Junki](https://github.com/mzsm) +* [:link:](ckeditor/ckeditor.d.ts) [CKEditor](http://ckeditor.com) by [Ondrej Sevcik](https://github.com/ondrejsevcik) +* [:link:](clone/clone.d.ts) [clone](https://github.com/pvorb/node-clone) by [Kieran Simpson](https://github.com/kierans/DefinitelyTyped) +* [:link:](codemirror/codemirror.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [mihailik](https://github.com/mihailik) +* [:link:](colors/colors.d.ts) [Colors.js 0.6.0-1](https://github.com/Marak/colors.js) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](cometd/cometd.d.ts) [CometD](http://cometd.org) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](commander/commander.d.ts) [commanderjs](https://github.com/visionmedia/commander.js) by [Marcelo Dezem](http://github.com/mdezem), [vvakame](http://github.com/vvakame) +* [:link:](compression/compression.d.ts) [compression](https://github.com/expressjs/compression) by [Santi Albo](https://github.com/santialbo) +* [:link:](configstore/configstore.d.ts) [configstore](https://github.com/yeoman/configstore) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](consolidate/consolidate.d.ts) [consolidate](https://github.com/visionmedia/consolidate.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](convert-source-map/convert-source-map.d.ts) [convert-source-map](https://github.com/thlorenz/convert-source-map) by [Andrew Gaspar](https://github.com/AndrewGaspar) +* [:link:](cookie/cookie.d.ts) [cookie](https://github.com/jshttp/cookie) by [Pine Mizune](https://github.com/pine613) +* [:link:](cookie-parser/cookie-parser.d.ts) [cookie-parser](https://github.com/expressjs/cookie-parser) by [Santi Albo](https://github.com/santialbo) +* [:link:](threejs/three-copyshader.d.ts) [CopyShader.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/shaders/CopyShader.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](cordova-ionic/plugins/keyboard.d.ts) [Cordova Keyboard plugin](https://github.com/driftyco/ionic-plugins-keyboard) by [Hendrik Maus](https://github.com/hendrikmaus) +* [:link:](cordovarduino/cordovarduino.d.ts) [Cordovarduino plugin](https://github.com/stereolux/cordovarduino) by [Hendrik Maus](https://github.com/hendrikmaus) +* [:link:](couchbase/couchbase.d.ts) [Couchbase Couchnode](https://github.com/couchbase/couchnode) by [Basarat Ali Syed](https://github.com/basarat) +* [:link:](createjs/createjs.d.ts) [CreateJS](http://www.createjs.com) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist), [Satoru Kimura](https://github.com/gyohk) +* [:link:](crossfilter/crossfilter.d.ts) [CrossFilter](https://github.com/square/crossfilter) by [Schmulik Raskin](https://github.com/schmuli) +* [:link:](crossroads/crossroads.d.ts) [Crossroads.js](http://millermedeiros.github.io/crossroads.js) by [Diullei Gomes](https://github.com/diullei) +* [:link:](cryptojs/cryptojs.d.ts) [CryptoJS](https://code.google.com/p/crypto-js) by [Gia Bảo @ Sân Đình](https://github.com/giabao) +* [:link:](googlemaps.infobubble/google.maps.infobubble.d.ts) [CSS3 InfoBubble with tabs for Google Maps API V3](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/src) by [Johan Nilsson](https://github.com/Dashue) +* [:link:](threejs/three-css3drenderer.d.ts) [CSS3DRenderer.js](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CSS3DRenderer.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](csurf/csurf.d.ts) [csurf](https://www.npmjs.org/package/csurf) by [Hiroki Horiuchi](https://github.com/horiuchi) +* [:link:](md5/md5.d.ts) [CybozuLabs.MD5](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) by [MIZUNE Pine](https://github.com/pine613) +* [:link:](d3/d3.d.ts) [d3JS](http://d3js.org) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](dat-gui/dat-gui.d.ts) [dat.GUI](https://github.com/dataarts/dat.gui) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](date.format.js/date.format.d.ts) [Date Format](http://blog.stevenlevithan.com/archives/date-time-format) by [Rob Stutton](https://github.com/balrob) +* [:link:](datejs/datejs.d.ts) [DateJS](http://www.datejs.com) by [David Khristepher Santos](http://github.com/rupertavery) +* [:link:](dcjs/dc.d.ts) [DCJS](https://github.com/dc-js) by [hans windhoff](https://github.com/hansrwindhoff) +* [:link:](debug/debug.d.ts) [debug](https://github.com/visionmedia/debug) by [Seon-Wook Park](https://github.com/swook) +* [:link:](deep-diff/deep-diff.d.ts) [deep-diff](https://github.com/flitbit/diff) by [ZauberNerd](https://github.com/ZauberNerd) +* [:link:](deep-freeze/deep-freeze.d.ts) [deep-freeze](https://github.com/substack/deep-freeze) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](detect-indent/detect-indent.d.ts) [detect-indent](https://github.com/sindresorhus/detect-indent) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](threejs/detector.d.ts) [Detector.js](https://github.com/mrdoob/three.js/blob/master/examples/js/Detector.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](dhtmlxgantt/dhtmlxgantt.d.ts) [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) by [Maksim Kozhukh](http://github.com/mkozhukh) +* [:link:](dhtmlxscheduler/dhtmlxscheduler.d.ts) [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) by [Maksim Kozhukh](http://github.com/mkozhukh) +* [:link:](diff/diff.d.ts) [diff](https://github.com/kpdecker/jsdiff) by [vvakame](https://github.com/vvakame) +* [:link:](docCookies/docCookies.d.ts) [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) by [Jon Egerton](https://github.com/jonegerton) +* [:link:](dock-spawn/dock-spawn.d.ts) [Dock Spawn](http://dockspawn.com) by [Drew Noakes](https://drewnoakes.com) +* [:link:](dojo/dojo.d.ts) [Dojo](http://dojotoolkit.org) by [Michael Van Sickle](https://github.com/vansimke) +* [:link:](domo/domo.d.ts) [Domo](http://domo-js.com) by [Steve Fenton](https://github.com/Steve-Fenton) +* [:link:](domready/domready.d.ts) [domready](https://github.com/ded/domready) by [Christian Holm Nielsen](https://github.com/dotnetnerd) +* [:link:](dot/dot.d.ts) [doT](https://github.com/olado/doT) by [ZombieHunter](https://github.com/ZombieHunter) +* [:link:](dropboxjs/dropboxjs.d.ts) [dropbox-js](https://github.com/dropbox/dropbox-js) by [Steve Fenton](https://github.com/Steve-Fenton), [Pedro Casaubon](https://github.com/xperiments) +* [:link:](dropzone/dropzone.d.ts) [Dropzone](http://www.dropzonejs.com) by [Natan Vivo](https://github.com/nvivo) +* [:link:](durandal/durandal.d.ts) [Durandal](http://durandaljs.com) by [Blue Spire](https://github.com/BlueSpire) +* [:link:](easeljs/easeljs.d.ts) [EaselJS](http://www.createjs.com/#!/EaselJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist) +* [:link:](easy-table/easy-table.d.ts) [easy-table](https://github.com/eldargab/easy-table) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](easystarjs/easystarjs.d.ts) [EasyStar.js](http://easystarjs.com) by [Magnus Gustafsson](https://github.com/borundin) +* [:link:](threejs/three-effectcomposer.d.ts) [EffectComposer.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/EffectComposer.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan) +* [:link:](elm/elm.d.ts) [Elm](http://elm-lang.org) by [Dénes Harmath](https://github.com/thSoft) +* [:link:](ember/ember.d.ts) [Ember.js](http://emberjs.com) by [Jed Mao](https://github.com/jedmao) +* [:link:](emissary/emissary.d.ts) [emissary](https://github.com/atom/emissary) by [vvakame](https://github.com/vvakame) +* [:link:](emscripten/emscripten.d.ts) [Emscripten](http://kripken.github.io/emscripten-site/index.html) by [Kensuke Matsuzaki](https://github.com/zakki) +* [:link:](epiceditor/epiceditor.d.ts) [EpicEditor](http://epiceditor.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](errorhandler/errorhandler.d.ts) [errorhandler](https://github.com/expressjs/errorhandler) by [Santi Albo](https://github.com/santialbo) +* [:link:](es6-promise/es6-promise.d.ts) [es6-promise](https://github.com/jakearchibald/ES6-Promise) by [François de Campredon](https://github.com/fdecampredon) +* [:link:](esprima/esprima.d.ts) [Esprima](http://esprima.org) by [teppeis](https://github.com/teppeis) +* [:link:](eventemitter2/eventemitter2.d.ts) [EventEmitter2](https://github.com/asyncly/EventEmitter2) by [ryiwamoto](https://github.com/ryiwamoto) +* [:link:](exit/exit.d.ts) [exit](https://github.com/cowboy/node-exit) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/LearnBoost/expect.js) by [Teppei Sato](https://github.com/teppeis) +* [:link:](expectations/expectations.d.ts) [expectations.js](https://github.com/spmason/expectations) by [vvakame](https://github.com/vvakame) +* [:link:](express/express.d.ts) [Express 4.x](http://expressjs.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](express-myconnection/express-myconnection.d.ts) [express-myconnection](https://www.npmjs.org/package/express-myconnection) by [Michael Ferris](https://github.com/Cellule) +* [:link:](express-session/express-session.d.ts) [express-session](https://www.npmjs.org/package/express-session) by [Hiroki Horiuchi](https://github.com/horiuchi) +* [:link:](express-validator/express-validator.d.ts) [express-validator](https://github.com/ctavan/express-validator) by [Nathan Ridley](https://github.com/axefrog), [Jonathan Häberle](http://dreampulse.de) +* [:link:](extjs/ExtJS.d.ts) [ExtJS](http://www.sencha.com/products/extjs) by [Brian Kotek](https://github.com/brian428) +* [:link:](fabricjs/fabricjs.d.ts) [FabricJS](http://fabricjs.com) by [Oliver Klemencic](https://github.com/oklemencic) +* [:link:](fbsdk/fbsdk.d.ts) [Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Joshua Strobl](https://github.com/JoshStrobl) +* [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](fastclick/fastclick.d.ts) [FastClick](https://github.com/ftlabs/fastclick) by [Shinnosuke Watanabe](https://github.com/shinnn) +* [:link:](fibers/fibers.d.ts) [fibers](https://github.com/laverdet/node-fibers) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](filewriter/filewriter.d.ts) [File API: Writer](http://www.w3.org/TR/file-writer-api) by [Kon](http://phyzkit.net) +* [:link:](filesystem/filesystem.d.ts) [File System API](http://www.w3.org/TR/file-system-api) by [Kon](http://phyzkit.net) +* [:link:](Finch/Finch.d.ts) [Finch](https://github.com/stoodder/finchjs) by [David Sichau](https://github.com/DavidSichau) +* [:link:](findup-sync/findup-sync.d.ts) [findup-sync](https://github.com/cowboy/node-findup-sync) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](fingerprintjs/fingerprint.d.ts) [fingerprintjs](https://github.com/Valve/fingerprintjs) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](state-machine/state-machine.d.ts) [Finite State Machine](https://github.com/jakesgordon/javascript-state-machine) by [Boris Yankov](https://github.com/borisyankov), [Maarten Docter](https://github.com/mdocter), [William Sears](https://github.com/MrBigDog2U) +* [:link:](firebase/firebase.d.ts) [Firebase API](https://www.firebase.com/docs/javascript/firebase) by [Vincent Botone](https://github.com/vbortone) +* [:link:](firebase/firebase-simplelogin.d.ts) [Firebase Simple Login](https://www.firebase.com/docs/security/simple-login-overview.html) by [Wilker Lucio](http://github.com/wilkerlucio) +* [:link:](flexSlider/flexSlider.d.ts) [FlexSlider 2 jquery plugin](https://github.com/woothemes/FlexSlider) by [Diullei Gomes](https://github.com/diullei) +* [:link:](flight/flight.d.ts) [Flight](http://flightjs.github.com/flight) by [Jonathan Hedrén](https://github.com/jonathanhedren) +* [:link:](flipsnap/flipsnap.d.ts) [flipsnap.js](http://pxgrid.github.io/js-flipsnap) by [kubosho](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki) +* [:link:](flot/jquery.flot.d.ts) [Flot](http://www.flotcharts.org) by [Matt Burland](https://github.com/burlandm) +* [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Douglas Eichelberger](https://github.com/dduugg) +* [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](fpsmeter/FPSMeter.d.ts) [FPSmeter](http://darsa.in/fpsmeter) by [Aaron Lampros](http://github.com/alampros) +* [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](fs-extra/fs-extra.d.ts) [fs-extra](https://github.com/jprichardson/node-fs-extra) by [midknight41](https://github.com/midknight41) +* [:link:](ftdomdelegate/ftdomdelegate.d.ts) [ftdomdelegate](https://github.com/ftlabs/ftdomdelegate) by [Christian Holm Nielsen](https://github.com/dotnetnerd) +* [:link:](fullCalendar/fullCalendar.d.ts) [FullCalendar](http://arshaw.com/fullcalendar) by [Neil Stalker](https://github.com/nestalk) +* [:link:](fuse/fuse.d.ts) [Fuse.js](https://github.com/krisk/Fuse) by [Greg Smith](https://github.com/smrq) +* [:link:](gamepad/gamepad.d.ts) [Gamepad API](http://www.w3.org/TR/gamepad) by [Kon](http://phyzkit.net) +* [:link:](gamequery/gamequery.d.ts) [gameQuery](http://gamequeryjs.com) by [David Laubreiter](https://github.com/Laubi) +* [:link:](gently/gently.d.ts) [gently](https://www.npmjs.org/package/gently) by [bonnici](https://github.com/bonnici) +* [:link:](geojson/geojson.d.ts) [GeoJSON Format Specification](http://geojson.org) by [Jacob Bruun](https://github.com/cobster) +* [:link:](giraffe/giraffe.d.ts) [Giraffe](https://github.com/barc/backbone.giraffe) by [Matt McCray](https://github.com/darthapo) +* [:link:](gldatepicker/gldatepicker.d.ts) [glDatePicker](http://glad.github.com/glDatePicker) by [Dániel Tar](https://github.com/qcz) +* [:link:](glob/glob.d.ts) [Glob](https://github.com/isaacs/node-glob) by [vvakame](https://github.com/vvakame) +* [:link:](glob-stream/glob-stream.d.ts) [glob-stream](http://github.com/wearefractal/glob-stream) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](globalize/globalize.d.ts) [Globalize](https://github.com/jquery/globalize) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](goJS/goJS.d.ts) [GoJS](http://gojs.net) by [Barbara Duckworth](https://github.com/barbara42) +* [:link:](google.analytics/ga.d.ts) [Google Analytics (Classic and Universal)](https://developers.google.com/analytics/devguides/collection/gajs) by [Ronnie Haakon Hegelund](http://ronniehegelund.blogspot.dk), [Pat Kujawa](http://patkujawa.com) +* [:link:](gapi/gapi.d.ts) [Google API Client](https://code.google.com/p/google-api-javascript-client) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](google.feeds/google.feed.api.d.ts) [Google Feed Apis](https://developers.google.com/feed) by [RodneyJT](https://github.com/RodneyJT) +* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](googlemaps/google.maps.d.ts) [Google Geolocation](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk) +* [:link:](gapi.pagespeedonline/gapi.pagespeedonline.d.ts) [Google Page Speed Online Api](https://developers.google.com/speed/pagespeed) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73) +* [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](gapi.urlshortener/gapi.urlshortener.d.ts) [Google Url Shortener API](https://developers.google.com/url-shortener) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](google.visualization/google.visualization.d.ts) [Google Visualisation Apis](https://developers.google.com/chart) by [Dan Ludwig](https://github.com/danludwig) +* [:link:](gae.channel.api/gae.channel.api.d.ts) [GoogleAppEngine's Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) by [vvakame](https://github.com/vvakame) +* [:link:](graceful-fs/graceful-fs.d.ts) [graceful-fs](https://github.com/cowboy/graceful-fs) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](greasemonkey/greasemonkey.d.ts) [Greasemonkey](http://www.greasespot.net) by [Kota Saito](https://github.com/kotas) +* [:link:](greensock/greensock.d.ts) [GreenSock Animation Platform](http://www.greensock.com/get-started-js) by [Robert S](https://github.com/codebelt) +* [:link:](gridfs-stream/gridfs-stream.d.ts) [gridfs-stream](https://github.com/aheckmann/gridfs-stream) by [Lior Mualem](https://github.com/liorm) +* [:link:](gruntjs/gruntjs.d.ts) [Grunt 0.4.x](http://gruntjs.com) by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat) +* [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com) +* [:link:](gulp-util/gulp-util.d.ts) [gulp-util v3.0.x](https://github.com/gulpjs/gulp-util) by [jedmao](https://github.com/jedmao) +* [:link:](hammerjs/hammerjs.d.ts) [Hammer.js](http://eightmedia.github.com/hammer.js) by [Boris Yankov](https://github.com/borisyankov), [Drew Noakes](https://drewnoakes.com) +* [:link:](handlebars/handlebars.d.ts) [Handlebars](http://handlebarsjs.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](hapi/hapi.d.ts) [hapi](http://github.com/spumko/hapi) by [Hakubo](http://github.com/hakubo) +* [:link:](hashmap/hashmap.d.ts) [HashMap](https://github.com/flesler/hashmap) by [Rafał Wrzeszcz](http://wrzasq.pl) +* [:link:](hellojs/hellojs.d.ts) [hello.js](http://adodson.com/hello.js) by [Pavel Zika](https://github.com/PavelPZ) +* [:link:](highcharts/highcharts.d.ts) [Highcharts](http://www.highcharts.com) by [Damiano Gambarotto](http://github.com/damianog) +* [:link:](highland/highland.d.ts) [Highland](http://highlandjs.org) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](highlightjs/highlightjs.d.ts) [highlight.js](https://github.com/isagalaev/highlight.js) by [Niklas Mollenhauer](https://github.com/nikeee), [Jeremy Hull](https://github.com/sourrust) +* [:link:](history/history.d.ts) [History.js](https://github.com/browserstate/history.js) by [Boris Yankov](https://github.com/borisyankov), [Gidon Junge](https://github.com/gjunge) +* [:link:](howlerjs/howler.d.ts) [howler.js](https://github.com/goldfire/howler.js) by [Pedro Casaubon](https://github.com/xperiments) +* [:link:](html2canvas/html2canvas.d.ts) [html2canvas.js](https://github.com/niklasvh/html2canvas) by [Richard Hepburn](https://github.com/rwhepburn) +* [:link:](htmlparser2/htmlparser2.d.ts) [htmlparser2 v3.7.x](https://github.com/fb55/htmlparser2) by [James Roland Cabresos](https://github.com/staticfunction) +* [:link:](http-string-parser/http-string-parser.d.ts) [http-string-parser](https://github.com/apiaryio/http-string-parser) by [MIZUNE Pine](https://github.com/pine613) +* [:link:](humane/humane.d.ts) [Humane](http://wavded.github.com/humane-js) by [jmvrbanac](https://github.com/jmvrbanac) +* [:link:](i18n-node/i18n-node.d.ts) [i18n-node](https://github.com/mashpie/i18n-node) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Maarten Docter](https://github.com/mdocter) +* [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz) +* [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](impress/impress.d.ts) [Impress.js](https://github.com/bartaz/impress.js) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](inflection/inflection.d.ts) [inflection](https://github.com/dreamerslab/node.inflection) by [Shogo Iwano](https://github.com/shiwano) +* [:link:](insight/insight.d.ts) [insight](https://github.com/yeoman/insight) by [vvakame](http://github.com/vvakame) +* [:link:](interactjs/interact.d.ts) [Interacting for interact.js](https://github.com/taye/interact.js) by [Douglas Eichelberger](https://github.com/dduugg), [Adi Dahiya](https://github.com/adidahiya) +* [:link:](intercomjs/intercom.d.ts) [intercom.js](https://github.com/diy/intercom.js) by [spencerwi](http://github.com/spencerwi) +* [:link:](cordova-ionic/cordova-ionic.d.ts) [Ionic Cordova plugins](https://github.com/driftyco) by [Hendrik Maus](https://github.com/hendrikmaus) +* [:link:](iscroll/iscroll.d.ts) [iScroll](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](iscroll/iscroll-5.d.ts) [iScroll 5](http://cubiq.org/iscroll-5-ready-for-beta-test) by [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](iscroll/iscroll-lite.d.ts) [iScroll Lite](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](iscroll/iscroll-5-lite.d.ts) [iScroll Lite 5](http://cubiq.org/iscroll-5-ready-for-beta-test) by [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](ix.js/ix.d.ts) [IxJS 1.0.6 / ix.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](ix.js/l2o.d.ts) [IxJS 1.0.6 / l2o.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](jake/jake.d.ts) [jake](https://github.com/mde/jake) by [Kon](http://phyzkit.net) +* [:link:](jasmine/jasmine.d.ts) [Jasmine](http://pivotal.github.com/jasmine) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) +* [:link:](jasmine-data_driven_tests/jasmine-data_driven_tests.d.ts) [Jasmine Data Driven Tests](https://github.com/gburghardt/jasmine-data_driven_tests) by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon) +* [:link:](jasmine-fixture/jasmine-fixture.d.ts) [Jasmine-fixture](https://github.com/searls/jasmine-fixture) by [Craig Brett](https://github.com/craigbrett17) +* [:link:](jasmine-jquery/jasmine-jquery.d.ts) [Jasmine-JQuery](https://github.com/velesin/jasmine-jquery) by [Gregor Stamac](https://github.com/gstamac) +* [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers v0.2.1 API](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jdataview/jdataview.d.ts) [jDataView](https://github.com/jDataView/jDataView) by [Ingvar Stepanyan](https://github.com/RReverser) +* [:link:](jest/jest.d.ts) [Jest](http://facebook.github.io/jest) by [Asana](https://asana.com) +* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jointjs/jointjs.d.ts) [Joint JS](http://www.jointjs.com) by [Aidan Reel](http://github.com/areel), [David Durman](http://github.com/DavidDurman) +* [:link:](jqrangeslider/jqrangeslider.d.ts) [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) by [Dániel Tar](https://github.com/qcz) +* [:link:](jquery/jquery.d.ts) [jQuery 1.10.x / 2.0.x](http://jquery.com) by [Boris Yankov](https://github.com/borisyankov), [Christian Hoffmeister](https://github.com/choffmeister), [Steve Fenton](https://github.com/Steve-Fenton), [Diullei Gomes](https://github.com/Diullei), [Tass Iliopoulos](https://github.com/tasoili), [Jason Swearingen](https://github.com/jasons-novaleaf), [Sean Hill](https://github.com/seanski), [Guus Goossens](https://github.com/Guuz), [Kelly Summerlin](https://github.com/ksummerlin), [Basarat Ali Syed](https://github.com/basarat), [Nicholas Wolverson](https://github.com/nwolverson), [Derek Cicerone](https://github.com/derekcicerone), [Andrew Gaspar](https://github.com/AndrewGaspar), [James Harrison Fisher](https://github.com/jameshfisher), [Seikichi Kondo](https://github.com/seikichi), [Benjamin Jackman](https://github.com/benjaminjackman), [Poul Sorensen](https://github.com/s093294), [Josh Strobl](https://github.com/JoshStrobl), [John Reilly](https://github.com/johnnyreilly), [Dick van den Brink](https://github.com/DickvdBrink) +* [:link:](jquery.blockUI/jquery.blockUI.d.ts) [jQuery BlockUI Plugin](http://malsup.com/jquery/block) by [Jeffrey Lee](http://blog.darkthread.net) +* [:link:](jquery.cleditor/jquery.cleditor.d.ts) [jQuery CLEditor Plugin](http://premiumsoftware.net/CLEditor) by [Jeffery Grajkowski](https://github.com/pushplay) +* [:link:](jquery.colorpicker/jquery.colorpicker.d.ts) [jQuery Colorpicker Plugin](https://github.com/vanderlee/colorpicker) by [Jeffery Grajkowski](https://github.com/pushplay) +* [:link:](jquery.contextMenu/jquery.contextMenu.d.ts) [jQuery contextMenu](http://medialize.github.com/jQuery-contextMenu) by [Natan Vivo](https://github.com/nvivo) +* [:link:](jquery.cookie/jquery.cookie.d.ts) [jQuery Cookie Plugin](https://github.com/carhartl/jquery-cookie) by [Roy Goode](https://github.com/RoyGoode) +* [:link:](jquery.cycle2/jquery.cycle2.d.ts) [jQuery Cycle2 version (build 20140216)](http://jquery.malsup.com/cycle2) by [Donny Nadolny](https://github.com/dnadolny) +* [:link:](jquery.dataTables/jquery.dataTables.d.ts) [JQuery DataTables](http://www.datatables.net) by [Armin Sander](https://github.com/pragmatrix) +* [:link:](jquery.fileupload/jquery.fileupload.d.ts) [jQuery File Upload Plugin](https://github.com/blueimp/jQuery-File-Upload) by [Rob Alarcon](https://github.com/rob-alarcon) +* [:link:](jquery.joyride/jquery.joyride.d.ts) [jQuery JoyRide Plugin](https://github.com/zurb/joyride) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](jquerymobile/jquerymobile.d.ts) [jQuery Mobile](http://jquerymobile.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](jquery.notifyBar/jquery.notifyBar.d.ts) [jQuery Notify Bar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](jquery.base64/jquery.base64.d.ts) [jQuery Plugin - base64 codec](https://github.com/yatt/jquery.base64) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki) +* [:link:](jquery.postMessage/jquery.postMessage.d.ts) [jQuery postMessage](http://benalman.com/projects/jquery-postmessage-plugin) by [Junle Li](https://github.com/lijunle) +* [:link:](jquery.prettyphoto/jquery.prettyphoto.d.ts) [jQuery prettyPhoto](https://github.com/scaron/prettyphoto) by [pgaske](https://github.com/pgaske) +* [:link:](royalslider/royalslider.d.ts) [jQuery royal-slider](http://dimsemenov.com/plugins/royal-slider/documentation) by [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](jquery.simplePagination/jquery.simplePagination.d.ts) [jQuery simplePagination.js](https://github.com/flaviusmatis/simplePagination.js) by [Natan Vivo](https://github.com/nvivo) +* [:link:](jquery.tagsmanager/jquery.tagsmanager.d.ts) [jQuery Tags Manager](http://welldonethings.com/tags/manager) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](jquery.tinycarousel/jquery.tinycarousel.d.ts) [jQuery tinycarousel](http://baijs.nl/tinycarousel) by [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](jquery.tinyscrollbar/jquery.tinyscrollbar.d.ts) [jQuery tinyscrollbar](http://baijs.nl/tinyscrollbar) by [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](jquery.tooltipster/jquery.tooltipster.d.ts) [jQuery Tooltipster](https://github.com/iamceege/tooltipster) by [Patrick Magee](https://github.com/pjmagee) +* [:link:](jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts) [jQuery UI DateTimePicker](http://trentrichardson.com/examples/timepicker) by [dougajmcdonald](https://github.com/dougajmcdonald) +* [:link:](jquery.timepicker/jquery.timepicker.d.ts) [jQuery UI Timepicker](http://fgelinas.com/code/timepicker) by [Anwar Javed](https://github.com/anwarjaved) +* [:link:](jquery-handsontable/jquery-handsontable.d.ts) [jquery-handsontable](http://handsontable.com) by [Ted John](https://github.com/intelorca) +* [:link:](jquery.menuaim/jquery.menuaim.d.ts) [jQuery-menu-aim](https://github.com/kamens/jQuery-menu-aim) by [Robert Fonseca-Ensor](http://www.robfe.com) +* [:link:](jquery.pjax/jquery.pjax.d.ts) [jquery-pjax](https://github.com/defunkt/jquery-pjax) by [Junle Li](https://github.com/lijunle) +* [:link:](jquery.address/jquery.address.d.ts) [jQuery.Address](https://github.com/asual/jquery-address) by [Martin Duparc](https://github.com/martinduparc), [Tim Klingeleers](https://github.com/mardaneus86) +* [:link:](jquery.are-you-sure/jquery.are-you-sure.d.ts) [jquery.are-you-sure.js](https://github.com/codedance/jquery.AreYouSure) by [Jon Egerton](https://github.com/jonegerton) +* [:link:](jquery.autosize/jquery.autosize.d.ts) [jquery.autosize (un-versioned)](http://www.jacklmoore.com/autosize) by [Aaron T. King](https://github.com/kingdango) +* [:link:](jquery.bbq/jquery.bbq.d.ts) [jquery.bbq](http://benalman.com/projects/jquery-bbq-plugin) by [Adam R. Smith](https://github.com/sunetos) +* [:link:](jquery.clientSideLogging/jquery.clientSideLogging.d.ts) [jquery.clientSideLogging](https://github.com/remybach/jQuery.clientSideLogging) by [Diullei Gomes](https://github.com/diullei) +* [:link:](jquery.color/jquery.color.d.ts) [jquery.color.js](https://github.com/jquery/jquery-color) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](jquery.colorbox/jquery.colorbox.d.ts) [jQuery.Colorbox](http://www.jacklmoore.com/colorbox) by [Gidon Junge](https://github.com/gjunge) +* [:link:](jquery.customSelect/jquery.customSelect.d.ts) [jquery.customSelect.js](http://adam.co/lab/jquery/customselect/) by [adamcoulombe](https://github.com/adamcoulombe) +* [:link:](jquery.cycle/jquery.cycle.d.ts) [jQuery.cycle.js](http://jquery.malsup.com/cycle) by [François Guillot](http://fguillot.developpez.com) +* [:link:](jquery.dynatree/jquery.dynatree.d.ts) [jquery.dynatree](http://code.google.com/p/dynatree) by [François de Campredon](https://github.com/fdecampredon) +* [:link:](jquery.finger/jquery.finger.d.ts) [jquery.finger.js](http://ngryman.sh/jquery.finger) by [Max Ackley](https://github.com/maxackley) +* [:link:](jquery.form/jquery.form.d.ts) [jQuery.form.js 3.26.0](http://malsup.com/jquery/form) by [François Guillot](http://fguillot.developpez.com) +* [:link:](jquery.gridster/gridster.d.ts) [jQuery.gridster](https://github.com/jbaldwin/gridster) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](jquery.jnotify/jquery.jnotify.d.ts) [jQuery.jNotify](http://jnotify.codeplex.com) by [James Curran](https://github.com/jamescurran) +* [:link:](jquery.jsignature/jquery.jsignature.d.ts) [jQuery.jsignature v2](https://github.com/willowsystems/jSignature) by [Patrick Magee](https://github.com/pjmagee) +* [:link:](jquery.noty/jquery.noty.d.ts) [jQuery.noty](http://needim.github.io/noty) by [Aaron King](https://github.com/kingdango) +* [:link:](jquery.payment/jquery.payment.d.ts) [jQuery.payment](https://github.com/stripe/jquery.payment) by [Eric J. Smith](https://github.com/ejsmith) +* [:link:](jquery.pjax.falsandtru/jquery.pjax.d.ts) [jquery.pjax.ts by falsandtru](https://github.com/falsandtru/jquery.pjax.js) by [新ゝ月 NewNotMoon](http://new.not-moon.net) +* [:link:](jquery.placeholder/jquery.placeholder.d.ts) [jquery.placeholder.js](https://github.com/mathiasbynens/jquery-placeholder) by [Peter Gill](https://github.com/majorsilence) +* [:link:](jquery.pnotify/jquery.pnotify.d.ts) [jquery.pnotify](https://github.com/sciactive/pnotify) by [David Sichau](https://github.com/DavidSichau) +* [:link:](jquery.scrollTo/jquery.scrollTo.d.ts) [jQuery.scrollTo.js](https://github.com/flesler/jquery.scrollTo) by [Neil Stalker](https://github.com/nestalk) +* [:link:](jquery.simulate/jquery.simulate.d.ts) [jquery.simulate.js](https://github.com/jquery/jquery-simulate) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](jquery.sortElements/jquery.sortElement.d.ts) [jQuery.sortElements](http://james.padolsey.com/javascript/sorting-elements-with-jquery) by [Tim Bureck](https://github.com/tbureck) +* [:link:](jquery.superLink/jquery.superLink.d.ts) [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](jquery.tile/jquery.tile.d.ts) [jquery.tile.js](https://github.com/urin/jquery.tile.js) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](jquery.timeago/jquery.timeago.d.ts) [jQuery.timeago.js](http://timeago.yarp.com) by [François Guillot](http://fguillot.developpez.com) +* [:link:](jquery.transit/jquery.transit.d.ts) [jQuery.transit.js](http://ricostacruz.com/jquery.transit) by [MrBigDog2U](https://github.com/MrBigDog2U) +* [:link:](jquery.validation/jquery.validation.d.ts) [jquery.validation](http://jqueryvalidation.org) by [François de Campredon](https://github.com/fdecampredon), [Johj Reilly](https://github.com/johnnyreilly) +* [:link:](jquery.timer/jquery.timer.d.ts) [jQueryTimer](https://github.com/jchavannes/jquery-timer) by [Joshua Strobl](https://github.com/JoshStrobl) +* [:link:](jquery.total-storage/jquery.total-storage.d.ts) [jQueryTotalStorage](https://github.com/Upstatement/jquery-total-storage) by [Jeremy Brooks](https://github.com/JeremyCBrooks) +* [:link:](jquery.ui.layout/jquery.ui.layout.d.ts) [jQueryUI](http://layout.jquery-dev.net) by [Steve Fenton](https://github.com/Steve-Fenton) +* [:link:](jqueryui/jqueryui.d.ts) [jQueryUI](http://jqueryui.com) by [Boris Yankov](https://github.com/borisyankov), [John Reilly](https://github.com/johnnyreilly) +* [:link:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) +* [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](js-signals/js-signals.d.ts) [JS-Signals](http://millermedeiros.github.io/js-signals) by [Diullei Gomes](https://github.com/diullei) +* [:link:](js-yaml/js-yaml.d.ts) [js-yaml](https://github.com/nodeca/js-yaml) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jsbn/jsbn.d.ts) [jsbn](http://www-cs-students.stanford.edu/%7Etjw/jsbn) by [Eugene Chernyshov](https://github.com/Evgenus) +* [:link:](jscrollpane/jscrollpane.d.ts) [jScrollPane](http://jscrollpane.kelvinluck.com) by [Dániel Tar](https://github.com/qcz) +* [:link:](jsdeferred/jsdeferred.d.ts) [JSDeferred](https://github.com/cho45/jsdeferred) by [Daisuke Mino](https://github.com/minodisk) +* [:link:](jsesc/jsesc.d.ts) [jsesc](https://github.com/mathiasbynens/jsesc) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jsfl/jsfl.d.ts) [JSFL](https://adobe.com) by [soywiz](https://github.com/soywiz) +* [:link:](hashset/hashset.d.ts) [jshashset](http://www.timdown.co.uk/jshashtable/jshashset.html) by [Sergey Gerasimov](https://github.com/gerich-home) +* [:link:](hashtable/hashtable.d.ts) [jshashtable](http://www.timdown.co.uk/jshashtable) by [Sergey Gerasimov](https://github.com/gerich-home) +* [:link:](json-pointer/json-pointer.d.ts) [json-pointer 1.0 l](https://www.npmjs.org/package/json-pointer) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jsoneditoronline/jsoneditoronline.d.ts) [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](JSONStream/JSONStream.d.ts) [JSONStream](http://github.com/dominictarr/JSONStream) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jsonwebtoken/jsonwebtoken.d.ts) [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](jsplumb/jquery.jsPlumb.d.ts) [jsPlumb 1.3.16 jQuery adapter](http://jsplumb.org) by [Steve Shearn](https://github.com/shearnie) +* [:link:](jsrender/jsrender.d.ts) [JsRender](http://www.jsviews.com/#jsrender) by [Kensuke Matsuzaki](https://github.com/zakki) +* [:link:](jstorage/jstorage.d.ts) [jStorage](http://www.jstorage.info) by [Danil Flores](https://github.com/dflor003) +* [:link:](jstree/jstree.d.ts) [jsTree](http://www.jstree.com) by [Adam Pluciński](https://github.com/adaskothebeast) +* [:link:](jszip/jszip.d.ts) [JSZip](http://stuk.github.com/jszip) by [mzeiher](https://github.com/mzeiher) +* [:link:](jwplayer/jwplayer.d.ts) [JW Player](http://developer.longtailvideo.com/trac) by [Martin Duparc](https://github.com/martinduparc) +* [:link:](karma-jasmine/karma-jasmine.d.ts) [karma-jasmine plugin](https://github.com/karma-runner/karma-jasmine) by [Michel Salib](https://github.com/michelsalib) +* [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509) +* [:link:](keypress/keypress.d.ts) [Keypress](https://github.com/dmauro/Keypress) by [Roger Chen](https://github.com/rcchen) +* [:link:](kineticjs/kineticjs.d.ts) [KineticJS](http://kineticjs.com) by [Basarat Ali Syed](http://www.github.com/basarat), [Ralph de Ruijter](http://www.superdopey.nl/techblog) +* [:link:](knockback/knockback.d.ts) [Knockback.js](http://kmalakoff.github.io/knockback) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](knockout/knockout.d.ts) [Knockout](http://knockoutjs.com) by [Boris Yankov](https://github.com/borisyankov), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](knockout.deferred.updates/knockout.deferred.updates.d.ts) [Knockout Deferred Updates](https://github.com/mbest/knockout-deferred-updates) by [Sebastián Galiano](https://github.com/sgaliano) +* [:link:](knockout.validation/knockout.validation.d.ts) [Knockout Validation](https://github.com/ericmbarnard/Knockout-Validation) by [Dan Ludwig](https://github.com/danludwig) +* [:link:](knockout.viewmodel/knockout.viewmodel.d.ts) [Knockout Viewmodel](http://coderenaissance.github.com/knockout.viewmodel) by [Oisin Grehan](https://github.com/oising) +* [:link:](knockout.amd.helpers/knockout-amd-helpers.d.ts) [knockout-amd-helpers](https://github.com/rniemeyer/knockout-amd-helpers) by [David Sichau](https://github.com/DavidSichau) +* [:link:](knockout.editables/ko.editables.d.ts) [knockout-editables](http://romanych.github.com/ko.editables) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](knockout.es5/knockout.es5.d.ts) [Knockout-ES5](https://github.com/SteveSanderson/knockout-es5) by [Sebastián Galiano](https://github.com/sgaliano) +* [:link:](knockout.postbox/knockout-postbox.d.ts) [knockout-postbox](https://github.com/rniemeyer/knockout-postbox) by [Judah Gabriel Himango](https://debuggerdotbreak.wordpress.com) +* [:link:](knockout.projections/knockout.projections.d.ts) [knockout-projections](https://github.com/stevesanderson/knockout-projections) by [John Reilly](https://github.com/johnnyreilly) +* [:link:](knockout-secure-binding/knockout-secure-binding.d.ts) [knockout-secure-binding](https://github.com/brianmhunt/knockout-secure-binding) by [Pine Mizune](https://github.com/pine613) +* [:link:](knockout.mapper/knockout.mapper.d.ts) [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) by [Brandon Meyer](https://github.com/BMeyerKC) +* [:link:](knockout.mapping/knockout.mapping.d.ts) [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](knockout.rx/knockout.rx.d.ts) [knockout.rx](https://github.com/Igorbek/knockout.rx) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](knockstrap/knockstrap.d.ts) [Knockstrap](http://faulknercs.github.io/Knockstrap) by [Adam Pluciński](https://github.com/adaskothebeast) +* [:link:](knockout.kogrid/ko-grid.d.ts) [ko-grid](http://knockout-contrib.github.io/KoGrid) by [huer12](https://github.com/huer12) +* [:link:](kolite/kolite.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](ladda/ladda.d.ts) [Ladda](https://github.com/hakimel/Ladda) by [Danil Flores](https://github.com/dflor003) +* [:link:](lazy.js/lazy.js.d.ts) [Lazy.js](https://github.com/dtao/lazy.js) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](leaflet/leaflet.d.ts) [Leaflet.js](https://github.com/Leaflet/Leaflet) by [Vladimir Zotov](https://github.com/rgripper) +* [:link:](jquery.leanModal/jquery.leanModal.d.ts) [leanModal.js](http://leanmodal.finelysliced.com.au) by [FinelySliced](https://github.com/FinelySliced) +* [:link:](leapmotionTS/LeapMotionTS.d.ts) [Leap Motion TS](https://github.com/logotype/LeapMotionTS) by [Victor Norgren](https://github.com/logotype) +* [:link:](less/less.d.ts) [LESS](http://lesscss.org) by [AndrewGaspar](https://github.com/AndrewGaspar) +* [:link:](levelup/levelup.d.ts) [LevelUp](https://github.com/rvagg/node-levelup) by [Bret Little](https://github.com/blittle) +* [:link:](libxmljs/libxmljs.d.ts) [Libxmljs](https://github.com/polotek/libxmljs) by [François de Campredon](https://github.com/fdecampredon) +* [:link:](dustjs-linkedin/dustjs-linkedin.d.ts) [linkedin dustjs](https://github.com/linkedin/dustjs) by [Marcelo Dezem](http://github.com/mdezem) +* [:link:](linq/linq.jquery.d.ts) [linq.jquery (from linq.js)](http://linqjs.codeplex.com) by [neuecc](http://www.codeplex.com/site/users/view/neuecc) +* [:link:](linq/linq.d.ts) [linq.js](http://linqjs.codeplex.com) by [Marcin Najder](https://github.com/marcinnajder) +* [:link:](jquery.livestampjs/jquery.livestampjs.d.ts) [Livestamp.js](http://mattbradley.github.com/livestampjs) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](lodash/lodash.d.ts) [Lo-Dash](http://lodash.com) by [Brian Zengel](https://github.com/bczengel) +* [:link:](lockfile/lockfile.d.ts) [lockfile](https://github.com/isaacs/lockfile) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](logg/logg.d.ts) [logg](https://github.com/dpup/node-logg) by [Bret Little](https://github.com/blittle) +* [:link:](long/long.d.ts) [Long.js](https://github.com/dcodeIO/Long.js) by [Toshihide Hara](https://github.com/kerug) +* [:link:](lru-cache/lru-cache.d.ts) [lru-cache](https://github.com/isaacs/node-lru-cache) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](lunr/lunr.d.ts) [lunr.js](https://github.com/olivernn/lunr.js) by [Sebastian Lenz](https://github.com/sebastian-lenz) +* [:link:](lz-string/lz-string.d.ts) [lz-string](https://github.com/pieroxy/lz-string) by [Roman Nikitin](https://github.com/M0ns1gn0r) +* [:link:](mapbox/mapbox.d.ts) [Mapbox](https://www.mapbox.com/mapbox.js) by [Maxime Fabre](https://github.com/anahkiasen) +* [:link:](mapsjs/mapsjs.d.ts) [Mapsjs](https://github.com/mapsjs) by [Matthew James Davis](https://github.com/davismj) +* [:link:](marionette/marionette.d.ts) [Marionette](https://github.com/marionettejs) by [Zeeshan Hamid](https://github.com/zhamid), [Natan Vivo](https://github.com/nvivo), [Sven Tschui](https://github.com/sventschui) +* [:link:](marked/marked.d.ts) [Marked](https://github.com/chjj/marked) by [William Orr](https://github.com/worr) +* [:link:](threejs/three-maskpass.d.ts) [MaskPass.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/MaskPass.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](mathjax/mathjax.d.ts) [MathJax](https://github.com/mathjax/MathJax) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](mCustomScrollbar/mCustomScrollbar.d.ts) [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) by [Sarah Williams](https://github.com/flurg) +* [:link:](memory-cache/memory-cache.d.ts) [memory-cache](http://github.com/ptarjan/node-cache) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](messenger/messenger.d.ts) [Messenger.js](https://github.com/HubSpot/messenger) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](meteor/meteor.d.ts) [Meteor](http://www.meteor.com) by [Dave Allen](https://github.com/fullflavedave) +* [:link:](method-override/method-override.d.ts) [method-override](https://github.com/expressjs/method-override) by [Santi Albo](https://github.com/santialbo) +* [:link:](microsoft-ajax/microsoft.ajax.d.ts) [Microsoft ASP.NET Ajax client side library](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) by [Patrick Magee](https://github.com/pjmagee) +* [:link:](microsoft-live-connect/microsoft-live-connect.d.ts) [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) by [John Vilk](https://github.com/jvilk) +* [:link:](azure-mobile-services-client/AzureMobileServicesClient.d.ts) [Microsoft Windows AzureMobile Service](http://www.windowsazure.com/en-us/develop/mobile) by [Morosinotto Daniele](https://github.com/dmorosinotto) +* [:link:](mime/mime.d.ts) [mime](https://github.com/broofa/node-mime) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](minimatch/minimatch.d.ts) [Minimatch](https://github.com/isaacs/minimatch) by [vvakame](https://github.com/vvakame) +* [:link:](minimist/minimist.d.ts) [minimist](https://github.com/substack/minimist) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](mithril/mithril.d.ts) [Mithril](http://lhorie.github.io/mithril) by [Leo Horie](https://github.com/lhorie), [Chris Bowdon](https://github.com/cbowdon) +* [:link:](mixpanel/mixpanel.d.ts) [Mixpanel](https://mixpanel.com) by [Knut Eirik Leira Hjelle](https://github.com/hjellek) +* [:link:](mixto/mixto.d.ts) [mixto](https://github.com/atom/mixto) by [vvakame](https://github.com/vvakame) +* [:link:](mkdirp/mkdirp.d.ts) [mkdirp](http://github.com/substack/node-mkdirp) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](mocha/mocha.d.ts) [mocha](http://visionmedia.github.io/mocha) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10) +* [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom) +* [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) +* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya) +* [:link:](mongodb/mongodb.d.ts) [MongoDB](https://github.com/mongodb/node-mongodb-native) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [horiuchi](https://github.com/horiuchi) +* [:link:](morgan/morgan.d.ts) [morgan](https://github.com/expressjs/morgan) by [James Roland Cabresos](https://github.com/staticfunction) +* [:link:](mousetrap/mousetrap.d.ts) [Mousetrap](http://craig.is/killing/mice) by [Dániel Tar](https://github.com/qcz) +* [:link:](moviedb/moviedb.d.ts) [MovieDB](https://github.com/danzajdband/moviedb) by [Basarat Ali Syed](https://github.com/basarat) +* [:link:](firefox/firefox.d.ts) [Mozilla Web API](https://developer.mozilla.org/en-US/docs/Web/API) by [vvakame](https://github.com/vvakame) +* [:link:](localForage/localForage.d.ts) [Mozilla's localForage](https://github.com/mozilla/localforage) by [david pichsenmeister](https://github.com/3x14159265) +* [:link:](msgpack/msgpack.d.ts) [msgpack.js - MessagePack JavaScript Implementation](https://github.com/uupaa/msgpack.js) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki) +* [:link:](msnodesql/msnodesql.d.ts) [msnodesql](https://github.com/WindowsAzure/node-sqlserver) by [Boris Yankov](https://github.com/borisyankov), [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](mu2/mu2.d.ts) [mu2](http://github.com/raycmorgan/mu) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](mustache/mustache.d.ts) [Mustache](https://github.com/janl/mustache.js) by [Mark Ashley Bell](https://github.com/markashleybell) +* [:link:](nconf/nconf.d.ts) [nconf](https://github.com/flatiron/nconf) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](ncp/ncp.d.ts) [ncp](https://github.com/AvianFlu/ncp) by [Bart van der Schoor](https://github.com/bartvds) +* [:link:](needle/needle.d.ts) [needle](https://github.com/tomas/needle) by [San Chen](https://github.com/bigsan) +* [:link:](nexpect/nexpect.d.ts) [nexpect](https://github.com/nodejitsu/nexpect) by [vvakame](http://github.com/vvakame) +* [:link:](ng-grid/ng-grid.d.ts) [ng-grid](http://angular-ui.github.io/ng-grid) by [Ken Smith](https://github.com/smithkl42), [Roland Zwaga](https://github.com/rolandzwaga), [Kent Cooper](https://github.com/kentcooper) +* [:link:](ngprogress-lite/ngprogress-lite.d.ts) [ngprogress-lite](https://github.com/voronianski/ngprogress-lite) by [Luke Forder](https://github.com/LukeForder) +* [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook) +* [:link:](nock/nock.d.ts) [nock](https://github.com/pgte/nock) by [bonnici](https://github.com/bonnici) +* [:link:](bunyan/bunyan.d.ts) [node-bunyan](https://github.com/trentm/node-bunyan) by [Alex Mikhalev](https://github.com/amikhalev) +* [:link:](bunyan-logentries/bunyan-logentries.d.ts) [node-bunyan-logentries](https://github.com/nemtsov/node-bunyan-logentries) by [Aymeric Beaumet](http://aymericbeaumet.me) +* [:link:](node-ffi/node-ffi.d.ts) [node-ffi](https://github.com/rbranson/node-ffi) by [Paul Loyd](https://github.com/loyd) +* [:link:](node-fibers/node-fibers.d.ts) [node-fibers](https://github.com/laverdet/node-fibers) by [Cary Haynie](https://github.com/caryhaynie) +* [:link:](node-form/node-form.d.ts) [node-form](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) +* [:link:](node-git/node-git.d.ts) [node-git](https://github.com/christkv/node-git) by [vvakame](https://github.com/vvakame) +* [:link:](ip/ip.d.ts) [node-ip](https://github.com/indutny/node-ip) by [Peter Harris](https://github.com/codeanimal) +* [:link:](mysql/mysql.d.ts) [node-mysql](https://github.com/felixge/node-mysql) by [William Johnston](https://github.com/wjohnsto) +* [:link:](promptly/promptly.d.ts) [node-promptly](https://github.com/IndigoUnited/node-promptly) by [Dan Spencer](https://github.com/danrspencer) +* [:link:](radius/radius.d.ts) [node-radius](https://github.com/retailnext/node-radius) by [Peter Harris](https://github.com/codeanimal) +* [:link:](node-uuid/node-uuid.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) +* [:link:](node-webkit/node-webkit.d.ts) [node-webkit](https://github.com/rogerwang/node-webkit) by [Pedro Casaubon](https://github.com/xperiments) +* [:link:](xml2js/xml2js.d.ts) [node-xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) by [Michel Salib](https://github.com/michelsalib), [Jason McNeil](https://github.com/jasonrm) +* [:link:](node/node.d.ts) [Node.js](http://nodejs.org) by [Microsoft TypeScript](http://typescriptlang.org), [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped) +* [:link:](restify/restify.d.ts) [node.js REST framework](https://github.com/mcavage/node-restify) by [Bret Little](https://github.com/blittle) +* [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](nodeunit/nodeunit.d.ts) [nodeunit](https://github.com/caolan/nodeunit) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](nomnom/nomnom.d.ts) [nomnom](https://github.com/harthur/nomnom) by [Paul Vick](https://github.com/panopticoncentral) +* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker) +* [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42) +* [:link:](npm/npm.d.ts) [npm](https://github.com/npm/npm) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](nprogress/nprogress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com) +* [:link:](numeraljs/numeraljs.d.ts) [Numeral.js](https://github.com/adamwdraper/Numeral-js) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](object-path/object-path.d.ts) [objectPath](https://github.com/mariocasciaro/object-path) by [Paulo Cesar](https://github.com/pocesar) +* [:link:](oclazyload/oclazyload.d.ts) [oc.LazyLoad](https://github.com/ocombe/ocLazyLoad) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](open/open.d.ts) [open](https://github.com/jjrdn/node-open) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](openlayers/openlayers.d.ts) [OpenLayers.js](https://github.com/openlayers/openlayers) by [Ilya Bolkhovsky](https://github.com/bolhovsky) +* [:link:](opn/opn.d.ts) [opn](https://github.com/sindresorhus/opn) by [Shinnosuke Watanabe](https://github.com/shinnn) +* [:link:](optimist/optimist.d.ts) [optimist](https://github.com/substack/node-optimist) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](threejs/three-orbitcontrols.d.ts) [OrbitControls.js](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/OrbitControls.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](parallel/parallel.d.ts) [parallel.js](http://adambom.github.io/parallel.js) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](parse/parse.d.ts) [Parse](https://parse.com) by [Ullisen Media Group](http://ullisenmedia.com) +* [:link:](parsimmon/parsimmon.d.ts) [Parsimmon](https://github.com/jneen/parsimmon) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](passport/passport.d.ts) [Passport](http://passportjs.org) by [Horiuchi_H](https://github.com/horiuchi) +* [:link:](passport-strategy/passport-strategy.d.ts) [Passport Strategy module](https://github.com/jaredhanson/passport-strategy) by [Lior Mualem](https://github.com/liorm) +* [:link:](passport-facebook/passport-facebook.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) +* [:link:](passport-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](pathwatcher/pathwatcher.d.ts) [pathwatcher](https://github.com/atom/node-pathwatcher) by [vvakame](https://github.com/vvakame) +* [:link:](pdf/pdf.d.ts) [PDF.js](https://github.com/mozilla/pdf.js) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](peerjs/Peer.d.ts) [PeerJS](http://peerjs.com) by [Toshiya Nakakura](https://github.com/nakakura) +* [:link:](pegjs/pegjs.d.ts) [PEG.js](http://pegjs.majda.cz) by [vvakame](https://github.com/vvakame) +* [:link:](persona/persona.d.ts) [Persona](http://www.mozilla.org/en-US/persona) by [James Frasca](https://github.com/Nycto) +* [:link:](pg/pg.d.ts) [pg](https://github.com/brianc/node-postgres) by [Phips Peter](http://pspeter3.com) +* [:link:](pgwmodal/pgwmodal.d.ts) [PgwModal](http://pgwjs.com/pgwmodal) by [Pine Mizune](https://github.com/pine613) +* [:link:](phantomjs/phantomjs.d.ts) [PhantomJS v1.9.0 API](https://github.com/ariya/phantomjs/wiki/API-Reference) by [Jed Hunsaker](https://github.com/jedhunsaker), [Mike Keesey](https://github.com/keesey) +* [:link:](phonegap/phonegap.d.ts) [PhoneGap](http://phonegap.com) by [Boris Yankov](https://github.com/borisyankov), [Dick van den Brink](https://github.com/DickvdBrink) +* [:link:](devextreme/dx.phonejs.d.ts) [PhoneJS](http://js.devexpress.com/MobileDevelopment) by [DevExpress Inc.](http://devexpress.com) +* [:link:](physijs/physijs.d.ts) [Physijs](http://chandlerprall.github.io/Physijs) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](pickadate/pickadate.d.ts) [pickadate.js](https://github.com/amsul/pickadate.js) by [Adi Dahiya](https://github.com/adidahiya) +* [:link:](pixi/pixi.d.ts) [PIXI](https://github.com/GoodBoyDigital/pixi.js) by [xperiments](http://github.com/xperiments) +* [:link:](platform/platform.d.ts) [Platform](https://github.com/bestiejs/platform.js) by [Jake Hickman](https://github.com/JakeH) +* [:link:](podcast/podcast.d.ts) [podcast](http://github.com/maxnowack/node-podcast) by [Niklas Mollenhauer](https://github.com/nikeee) +* [:link:](popcorn/popcorn.d.ts) [Popcorn](https://github.com/mozilla/popcorn-js) by [grapswiz](https://github.com/grapswiz) +* [:link:](pouchDB/pouch.d.ts) [Pouch](http://pouchdb.com) by [Bill Sears](https://github.com/MrBigDog2U) +* [:link:](precise/precise.d.ts) [precise](https://www.npmjs.org/package/precise) by [Peter Harris](https://github.com/codeanimal) +* [:link:](preloadjs/preloadjs.d.ts) [PreloadJS](http://www.createjs.com/#!/PreloadJS) by [Pedro Ferreira](https://bitbucket.org/drk4) +* [:link:](progressjs/progress.d.ts) [ProgressJs](http://usablica.github.io/progress.js) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](threejs/three-projector.d.ts) [Projector.js](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/Projector.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](promise-pool/promise-pool.d.ts) [promise-pool](https://github.com/vilic/promise-pool) by [VILIC VANE](https://github.com/vilic) +* [:link:](promises-a-plus/promises-a-plus.d.ts) [promises-a-plus](http://promisesaplus.com) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](pubsubjs/pubsub.d.ts) [PubSubJS](https://github.com/mroderick/PubSubJS) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](purl/purl.d.ts) [Purl](https://github.com/allmarkedup/purl) by [Daniel Ferreira Monteiro Alves](https://github.com/danfma) +* [:link:](q/Q.d.ts) [Q](https://github.com/kriskowal/q) by [Barrie Nemetchek](https://github.com/bnemetchek), [Andrew Gaspar](https://github.com/AndrewGaspar), [John Reilly](https://github.com/johnnyreilly) +* [:link:](q-io/Q-io.d.ts) [Q-io](https://github.com/kriskowal/q-io) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](q-retry/q-retry.d.ts) [q-retry](https://github.com/vilic/q-retry) by [VILIC VANE](https://github.com/vilic) +* [:link:](qajax/qajax.d.ts) [Qajax](https://github.com/gre/qajax) by [Boltmade](https://github.com/Boltmade) +* [:link:](qunit/qunit.d.ts) [QUnit](http://qunitjs.com) by [Diullei Gomes](https://github.com/diullei) +* [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall) +* [:link:](ravenjs/ravenjs.d.ts) [Raven.js](https://github.com/getsentry/raven-js) by [Santi Albo](https://github.com/santialbo) +* [:link:](react/react.d.ts) [React 0.12.RC](http://facebook.github.io/react) by [Asana](https://asana.com) +* [:link:](react-addons/react-addons.d.ts) [React with Addons 0.12.RC](http://facebook.github.io/react) by [Asana](https://asana.com) +* [:link:](readdir-stream/readdir-stream.d.ts) [readdir-stream](https://github.com/logicalparadox/readdir-stream) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal) +* [:link:](ref-array/ref-array.d.ts) [ref-array](https://github.com/TooTallNate/ref-array) by [Paul Loyd](https://github.com/loyd) +* [:link:](ref-union/ref-union.d.ts) [ref-union](https://github.com/TooTallNate/ref-union) by [Paul Loyd](https://github.com/loyd) +* [:link:](threejs/three-renderpass.d.ts) [RenderPass.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/RenderPass.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](request/request.d.ts) [request](https://github.com/mikeal/request) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [bonnici](https://github.com/bonnici), [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](requirejs/require.d.ts) [RequireJS](http://requirejs.org) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](restangular/restangular.d.ts) [Restangular](https://github.com/mgonto/restangular) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](rethinkdb/rethinkdb.d.ts) [Rethinkdb](http://rethinkdb.com) by [Sean Hess](https://seanhess.github.io) +* [:link:](reveal/reveal.d.ts) [Reveal](https://github.com/hakimel/reveal.js) by [grapswiz](https://github.com/grapswiz) +* [:link:](rickshaw/rickshaw.d.ts) [Rickshaw](http://code.shutterstock.com/rickshaw) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](rimraf/rimraf.d.ts) [rimraf](https://github.com/isaacs/rimraf) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](riotjs/riotjs.d.ts) [riot.js](https://github.com/moot/riotjs) by [vvakame](https://github.com/vvakame) +* [:link:](routie/routie.d.ts) [routie](https://github.com/jgallen23/routie) by [Adilson](https://github.com/Adilson) +* [:link:](rtree/rtree.d.ts) [rtree](https://github.com/leaflet-extras/RTree) by [Omede Firouz](https://github.com/oefirouz) +* [:link:](rx/rx.d.ts) [RxJS](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.aggregates.d.ts) [RxJS-Aggregates](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.async.d.ts) [RxJS-Async](http://rx.codeplex.com) by [zoetrope](https://github.com/zoetrope), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.backpressure.d.ts) [RxJS-BackPressure](http://rx.codeplex.com) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.binding.d.ts) [RxJS-Binding](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.coincidence.d.ts) [RxJS-Coincidence](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.experimental.d.ts) [RxJS-Experimental](https://github.com/Reactive-Extensions/RxJS) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.joinpatterns.d.ts) [RxJS-Join](http://rx.codeplex.com) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx-jquery/rx.jquery.d.ts) [RxJS-jQuery](https://github.com/Reactive-Extensions/RxJS-jQuery) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.lite.d.ts) [RxJS-Lite](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.testing.d.ts) [RxJS-Testing](https://github.com/Reactive-Extensions/RxJS) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.time.d.ts) [RxJS-Time](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.virtualtime.d.ts) [RxJS-VirtualTime](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](sammyjs/sammyjs.d.ts) [Sammy.js](http://sammyjs.org) by [Boris Yankov](https://github.com/borisyankov), [Oisin Grehan](https://github.com/oising) +* [:link:](select2/select2.d.ts) [Select2](http://ivaynberg.github.com/select2) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](selenium-webdriver/selenium-webdriver.d.ts) [Selenium WebDriverJS](https://code.google.com/p/selenium) by [Bill Armstrong](https://github.com/BillArmstrong) +* [:link:](semver/semver.d.ts) [semver](https://github.com/isaacs/node-semver) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](sendgrid/sendgrid.d.ts) [sendgrid](https://github.com/sendgrid/sendgrid-nodejs) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](threejs/three-shaderpass.d.ts) [ShaderPass.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/ShaderPass.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](shelljs/shelljs.d.ts) [ShellJS](http://shelljs.org) by [Niklas Mollenhauer](https://github.com/nikeee) +* [:link:](should/should.d.ts) [should.js](https://github.com/visionmedia/should.js) by [Alex Varju](https://github.com/varju), [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](showdown/showdown.d.ts) [Showdown](https://github.com/coreyti/showdown) by [cbowdon](https://github.com/cbowdon) +* [:link:](siesta/siesta.d.ts) [Siesta](http://www.bryntum.com/products/siesta) by [bquarmby](https://github.com/bquarmby) +* [:link:](signalr/signalr.d.ts) [SignalR](http://www.asp.net/signalr) by [Boris Yankov](https://github.com/borisyankov), [T. Michael Keesey](https://github.com/keesey) +* [:link:](signature_pad/signature_pad.d.ts) [signature_pad](https://github.com/szimek/signature_pad) by [Abubaker Bashir](https://github.com/AbubakerB) +* [:link:](simple-cw-node/simple-cw-node.d.ts) [simple-cw-node](https://github.com/astronaughts/simple-cw-node) by [vvakame](https://github.com/vvakame) +* [:link:](sinon/sinon.d.ts) [Sinon](http://sinonjs.org) by [William Sears](https://github.com/mrbigdog2u) +* [:link:](sinon-chai/sinon-chai.d.ts) [sinon-chai](https://github.com/domenic/sinon-chai) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) +* [:link:](sipml/sipml.d.ts) [SIPml5](http://sipml5.org) by [A. Groenenboom](https://github.com/chookies) +* [:link:](sjcl/sjcl.d.ts) [sjcl](http://crypto.stanford.edu/sjcl) by [Eugene Chernyshov](https://github.com/Evgenus) +* [:link:](slickgrid/SlickGrid.d.ts) [SlickGrid](https://github.com/mleibman/SlickGrid) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](slickgrid/slick.headerbuttons.d.ts) [SlickGrid HeaderButtons Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](slickgrid/slick.rowselectionmodel.d.ts) [SlickGrid RowSelectionModel Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](smoothie/smoothie.d.ts) [Smoothie Charts](https://github.com/joewalnes/smoothie) by [Drew Noakes](https://drewnoakes.com), [Mike H. Hawley](https://github.com/mikehhawley) +* [:link:](socket.io/socket.io.d.ts) [socket.io](http://socket.io) by [William Orr](https://github.com/worr) +* [:link:](socket.io-client/socket.io-client.d.ts) [socket.io nodejs client](http://socket.io) by [Maido Kaara](https://github.com/v3rm0n) +* [:link:](sockjs/sockjs.d.ts) [SockJS 0.3.x](https://github.com/sockjs/sockjs-client) by [Emil Ivanov](https://github.com/vladev) +* [:link:](sockjs-node/sockjs-node.d.ts) [sockjs-node 0.3.x](https://github.com/sockjs/sockjs-node) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) +* [:link:](soundjs/soundjs.d.ts) [SoundJS](http://www.createjs.com/#!/SoundJS) by [Pedro Ferreira](https://bitbucket.org/drk4) +* [:link:](source-map/source-map.d.ts) [source-map](https://github.com/mozilla/source-map) by [Morten Houston Ludvigsen](https://github.com/MortenHoustonLudvigsen) +* [:link:](source-map-support/source-map-support.d.ts) [source-map-support](https://github.com/evanw/source-map-support) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](space-pen/space-pen.d.ts) [SpacePen](https://github.com/atom/space-pen) by [vvakame](https://github.com/vvakame) +* [:link:](spin/spin.d.ts) [Spin.js](http://fgnass.github.com/spin.js) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) +* [:link:](sprintf/sprintf.d.ts) [sprintff](https://github.com/maritz/node-sprintff) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](sharepoint/SharePoint.d.ts) [sptypescript](http://sptypescript.codeplex.com) by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru), [Andrey Markeev](http://markeev.com) +* [:link:](sqlite3/sqlite3.d.ts) [sqlite3](https://github.com/mapbox/node-sqlite3) by [Nick Malaguti](https://github.com/nmalaguti) +* [:link:](stampit/stampit.d.ts) [stampit](https://github.com/ericelliott/stampit) by [Vasyl Boroviak](https://github.com/koresar) +* [:link:](stats/stats.d.ts) [Stats.js r11](http://github.com/mrdoob/stats.js) by [Gregory Dalton](https://github.com/gregolai) +* [:link:](status-bar/status-bar.d.ts) [status-bar](https://github.com/atom/status-bar) by [vvakame](https://github.com/vvakame) +* [:link:](storejs/storejs.d.ts) [store.js](https://github.com/marcuswestin/store.js) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](stream-to-array/stream-to-array.d.ts) [stream-to-array](https://github.com/stream-utils/stream-to-array) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Eric J. Smith](https://github.com/ejsmith) +* [:link:](stylus/stylus.d.ts) [stylus](https://github.com/LearnBoost/stylus) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](sugar/sugar.d.ts) [Sugar](http://sugarjs.com) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](superagent/superagent.d.ts) [SuperAgent](https://github.com/visionmedia/superagent) by [Alex Varju](https://github.com/varju) +* [:link:](supertest/supertest.d.ts) [SuperTest](https://github.com/visionmedia/supertest) by [Alex Varju](https://github.com/varju) +* [:link:](svg-pan-zoom/svg-pan-zoom.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [Chintan Shah](https://github.com/Promact) +* [:link:](svgjs/svgjs.d.ts) [svg.js](http://www.svgjs.com) by [Sean Hess](https://seanhess.github.io) +* [:link:](svgjs.draggable/svgjs.draggable.d.ts) [svgjs.draggable](http://www.svgjs.com) by [Luigi Trabacchin](https://github.com/LiFeleSs) +* [:link:](swfobject/swfobject.d.ts) [swfobject](https://code.google.com/p/swfobject) by [rou](https://github.com/rou) +* [:link:](swig/swig.d.ts) [swig](http://github.com/paularmstrong/swig) by [Peter Harris](https://github.com/CodeAnimal), [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](swiper/swiper.d.ts) [Swiper](https://github.com/nolimits4web/Swiper) by [Sebastián Galiano](https://github.com/sgaliano) +* [:link:](swipeview/swipeview.d.ts) [SwipeView](http://cubiq.org/swipeview) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](swiz/swiz.d.ts) [swiz](https://github.com/racker/node-swiz) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](teechart/teechart.d.ts) [TeeChart](http://www.steema.com) by [Steema Software](https://steema.com) +* [:link:](text-buffer/text-buffer.d.ts) [text-buffer](https://github.com/atom/text-buffer) by [vvakame](https://github.com/vvakame) +* [:link:](text-encoding/text-encoding.d.ts) [text-encoding](https://github.com/inexorabletash/text-encoding) by [MIZUNE Pine](https://github.com/pine613) +* [:link:](threejs/three.d.ts) [three.js r68](http://mrdoob.github.com/three.js) by [Kon](http://phyzkit.net), [Satoru Kimura](https://github.com/gyohk) +* [:link:](through/through.d.ts) [through](https://github.com/dominictarr/through) by [Andrew Gaspar](https://github.com/AndrewGaspar) +* [:link:](through2/through2.d.ts) [through2 v](https://github.com/rvagg/through2) by [Bart van der Schoor](https://github.com/Bartvds), [jedmao](https://github.com/jedmao) +* [:link:](timelinejs/timelinejs.d.ts) [timelinejs](https://github.com/NUKnightLab/TimelineJS) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](timezone-js/timezone-js.d.ts) [timezone-js](https://github.com/mde/timezone-js) by [bonnici](https://github.com/bonnici) +* [:link:](timezonecomplete/timezonecomplete.d.ts) [timezonecomplete](https://github.com/SpiritIT/timezonecomplete) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](tv4/tv4.d.ts) [Tiny Validator tv4](https://github.com/geraintluff/tv4) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](titanium/titanium.d.ts) [Titanium Movile 3.1.3.GA](http://www.appcelerator.com) by [Airam Rguez](https://github.com/airamrguez) +* [:link:](toastr/toastr.d.ts) [Toastr](https://github.com/CodeSeven/toastr) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](sencha_touch/SenchaTouch.d.ts) [Touch](http://www.sencha.com/products/touch) by [Brian Kotek](https://github.com/brian428) +* [:link:](threejs/three-trackballcontrols.d.ts) [TrackballControls.js](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](trunk8/trunk8.d.ts) [trunk8](https://github.com/rviscomi/trunk8) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](tspromise/tspromise.d.ts) [tspromise](https://github.com/soywiz/tspromise) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](tween.js/tween.js.d.ts) [tween.js r12](https://github.com/sole/tween.js) by [sunetos](https://github.com/sunetos), [jzarnikov](https://github.com/jzarnikov) +* [:link:](tweenjs/tweenjs.d.ts) [TweenJS](http://www.createjs.com/#!/TweenJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist) +* [:link:](twig/twig.d.ts) [twig](https://github.com/justjohn/twig.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](jquery.bootstrap.wizard/jquery.bootstrap.wizard.d.ts) [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](type-detect/type-detect.d.ts) [type-detect](https://github.com/chaijs/type-detect) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](typeahead/typeahead.d.ts) [typeahead.js](http://twitter.github.io/typeahead.js) by [Ivaylo Gochkov](https://github.com/igochkov), [Gidon Junge](https://github.com/gjunge) +* [:link:](typescript-services/typescriptServices.d.ts) [TypeScript-Services](https://www.npmjs.org/package/typescript-services) by [Basarat Ali Syed](http://github.com/basarat) +* [:link:](unity-webapi/unity-webapi.d.ts) [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) by [John Vrbanac](jhttps://github.com/jmvrbanac) +* [:link:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](underscore-ko/underscore-ko.d.ts) [Underscore-ko 1.2.2 with underscore](https://github.com/kamranayub/UnderscoreKO) by [Maurits Elbers](https://github.com/MagicMau) +* [:link:](underscore.string/underscore.string.d.ts) [underscore.string](https://github.com/epeli/underscore.string) by [Ry Racherbaumer](http://github.com/rygine) +* [:link:](universal-analytics/universal-analytics.d.ts) [universal-analytics](https://github.com/peaksandpies/universal-analytics) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](update-notifier/update-notifier.d.ts) [update-notifier](https://github.com/yeoman/update-notifier) by [vvakame](https://github.com/vvakame) +* [:link:](uri-templates/uri-templates.d.ts) [uri-templates](https://github.com/geraintluff/uri-templates) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](urijs/URI.d.ts) [URI.js](https://github.com/medialize/URI.js) by [RodneyJT](https://github.com/RodneyJT) +* [:link:](js-url/js-url.d.ts) [url](https://github.com/websanova/js-url) by [MIZUNE Pine](https://github.com/pine613) +* [:link:](urlrouter/urlrouter.d.ts) [urlrouter](https://github.com/fengmk2/urlrouter) by [soywiz](https://github.com/soywiz) +* [:link:](UUID/UUID.d.ts) [UUID.js core](https://github.com/LiosK/UUID.js) by [Jason Jarrett](https://github.com/staxmanade) +* [:link:](valerie/valerie.d.ts) [valerie](https://github.com/davewatts/valerie) by [Howard Richards](https://github.com/conficient) +* [:link:](vega/vega.d.ts) [Vega](http://trifacta.github.io/vega) by [Tom Crockett](http://github.com/pelotom) +* [:link:](velocity-animate/velocity-animate.d.ts) [Velocity](http://velocityjs.org) by [Greg Smith](https://github.com/smrq) +* [:link:](videojs/videojs.d.ts) [Video.js](https://github.com/zencoder/video-js) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](vimeo/froogaloop.d.ts) [Vimeo](http://developer.vimeo.com/player/js-api) by [Daz Wilkin](https://github.com/DazWilkin) +* [:link:](vinyl/vinyl.d.ts) [vinyl](https://github.com/wearefractal/vinyl) by [vvakame](https://github.com/vvakame), [jedmao](https://github.com/jedmao) +* [:link:](vinyl-fs/vinyl-fs.d.ts) [vinyl-fs](https://github.com/wearefractal/vinyl-fs) by [vvakame](https://github.com/vvakame) +* [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved) +* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net) +* [:link:](webaudioapi/waa-nightly.d.ts) [Web Audio API (nightly)](http://www.w3.org/TR/2012/WD-webaudio-20120802) by [Baruch Berger](https://github.com/bbss) +* [:link:](devextreme/dx.webappjs.d.ts) [WebAppJS](http://js.devexpress.com/WebDevelopment) by [DevExpress Inc.](http://devexpress.com) +* [:link:](webcrypto/WebCrypto.d.ts) [WebCrypto](http://www.w3.org/TR/WebCryptoAPI) by [Lucas Dixon](https://github.com/iislucas) +* [:link:](webrtc/MediaStream.d.ts) [WebRTC](http://dev.w3.org/2011/webrtc) by [Ken Smith](https://github.com/smithkl42) +* [:link:](websocket/websocket.d.ts) [websocket](https://github.com/Worlize/WebSocket-Node) by [Paul Loyd](https://github.com/loyd) +* [:link:](when/when.d.ts) [When](https://github.com/cujojs/when) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](winjs/winjs.d.ts) [WinJS](http://try.buildwinjs.com) by [TypeScript samples](https://www.typescriptlang.org), [Adam Hewitt](https://github.com/adamhewitt627), [Craig Treasure](https://github.com/craigktreasure), [Jeff Fisher](https://github.com/xirzec) +* [:link:](winrt/winrt.d.ts) [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) by [TypeScript samples](https://www.typescriptlang.org) +* [:link:](winston/winston.d.ts) [winston](https://github.com/flatiron/winston) by [bonnici](https://github.com/bonnici), [Peter Harris](https://github.com/codeanimal) +* [:link:](wolfy87-eventemitter/wolfy87-eventemitter.d.ts) [wolfy87-eventemitter](https://github.com/Wolfy87/EventEmitter) by [ryiwamoto](https://github.com/ryiwamoto) +* [:link:](wrench/wrench.d.ts) [wrench](https://github.com/ryanmcgrath/wrench-js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](ws/ws.d.ts) [ws](https://github.com/einaros/ws) by [Paul Loyd](https://github.com/loyd) +* [:link:](x2js/xml2json.d.ts) [x2js](https://code.google.com/p/x2js) by [Horiuchi_H](https://github.com/horiuchi) +* [:link:](jsfl/xJSFL.d.ts) [xJSFL](http://www.xjsfl.com) by [soywiz](https://github.com/soywiz) +* [:link:](xpath/xpath.d.ts) [xpath](https://github.com/goto100/xpath) by [Andrew Bradley](https://github.com/cspotcode) +* [:link:](xregexp/xregexp.d.ts) [XRegExp](http://xregexp.com) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](xsockets/XSockets.d.ts) [XSockets.NET](http://xsockets.net) by [Jeffery Grajkowski](https://github.com/pushplay) +* [:link:](yargs/yargs.d.ts) [yargs](https://github.com/chevex/yargs) by [Martin Poelstra](https://github.com/poelstra) +* [:link:](youtube/youtube.d.ts) [YouTube](https://developers.google.com/youtube) by [Daz Wilkin](https://github.com/DazWilkin), [Ian Obermiller](http://ianobermiller.com) +* [:link:](gapi.youtubeAnalytics/gapi.youtubeAnalytics.d.ts) [YouTube Analytics API](https://developers.google.com/youtube/analytics) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](gapi.youtube/gapi.youtube.d.ts) [YouTube Data API v3](https://developers.google.com/youtube/v3) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](yui/yui.d.ts) [yui](https://github.com/yui/yui3) by [Gia Bảo @ Sân Đình](https://github.com/giabao) +* [:link:](zepto/zepto.d.ts) [Zepto](http://zeptojs.com) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](zeroclipboard/zeroclipboard.d.ts) [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) by [Eric J. Smith](https://github.com/ejsmith), [Blake Niemyjski](https://github.com/niemyjski), [György Balássy](https://github.com/balassy) +* [:link:](node_zeromq/zmq.d.ts) [ZeroMQ Node](https://github.com/JustinTulloss/zeromq.node) by [Dave McKeown](http://github.com/davemckeown) +* [:link:](scroller/easyscroller.d.ts) [Zynga EasyScroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](scroller/scroller.d.ts) [Zynga Scroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](viewporter/viewporter.d.ts) [Zynga Viewporter](https://github.com/zynga/viewporter) by [Boris Yankov](https://github.com/borisyankov) -All definitions files include a header with the author and editors, so at some point this list will be auto-generated. - -* [accounting.js](http://josscrowcroft.github.io/accounting.js/) (by [Sergey Gerasimov](https://github.com/gerich-home)) -* [Ace Cloud9 Editor](http://ace.ajax.org/) (by [Diullei Gomes](https://github.com/Diullei)) -* [Add To Home Screen](http://cubiq.org/add-to-home-screen) (by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw)) -* [AmCharts](http://www.amcharts.com/) (by [Covobonomo](https://github.com/covobonomo/)) -* [AngularAgility](https://github.com/AngularAgility/AngularAgility) (by [Roland Zwaga](https://github.com/rolandzwaga)) -* [AngularBootstrapLightbox](https://github.com/compact/angular-bootstrap-lightbox) (by [Roland Zwaga](https://github.com/rolandzwaga)) -* [AngularFire](https://www.firebase.com/docs/angular/reference.html) (by [Dénes Harmath](https://github.com/thSoft)) -* [AngularJS](http://angularjs.org) (by [Diego Vilar](https://github.com/diegovilar)) ([wiki](https://github.com/borisyankov/DefinitelyTyped/wiki/AngularJS-Definitions-Usage-Notes)) -* [angularLocalStorage](https://github.com/agrublev/angularLocalStorage) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) -* [angular-file-upload](https://github.com/danialfarid/angular-file-upload) (by [John Reilly](https://github.com/johnnyreilly)) -* [angular-spinner](https://github.com/urish/angular-spinner) (by [Marcin Biegała](https://github.com/Biegal)) -* [AngularUI](http://angular-ui.github.io/) (by [Michel Salib](https://github.com/michelsalib)) -* [Angular Hotkeys](https://github.com/chieffancypants/angular-hotkeys/) (by [Jason Zhao](https://github.com/jlz27)) -* [angular-http-auth](https://github.com/witoldsz/angular-http-auth) (by [vvakame](https://github.com/vvakame)) -* [Angular Protractor](https://github.com/angular/protractor) (by [Bill Armstrong](https://github.com/BillArmstrong)) -* [Angular notify](https://github.com/cgross/angular-notify) (by [Suwato](https://github.com/Suwato)) -* [Angular Translate](http://pascalprecht.github.io/angular-translate/) (by [Michel Salib](https://github.com/michelsalib)) -* [Angular UI Bootstrap](http://angular-ui.github.io/bootstrap) (by [Brian Surowiec](https://github.com/xt0rted)) -* [any-db](https://github.com/grncdr/node-any-db) (by [Rogier Schouten](https://github.com/rogier-schouten)) -* [any-db-transaction](https://github.com/grncdr/node-any-db-transaction) (by [Rogier Schouten](https://github.com/rogier-schouten)) -* [AppFramework](http://app-framework-software.intel.com/) (by [Kyo Ago](https://github.com/kyo-ago)) -* [Arbiter](http://arbiterjs.com/) (by [Arash Shakery](https://github.com/arash16)) -* [asciify](https://github.com/olizilla/asciify) (by [Alan](http://alan.norbauer.com)) -* [assert](https://github.com/Jxck/assert) (by [vvakame](https://github.com/vvakame)) -* [async](https://github.com/caolan/async) (by [Boris Yankov](https://github.com/borisyankov)) -* [atmosphere](https://github.com/Atmosphere/atmosphere-javascript) (by [Kai Toedter](https://github.com/toedter)) -* [Atom](https://atom.io/) (by [vvakame](https://github.com/vvakame)) -* [Auth0](https://auth0.com/) (by [Robert McLaws](https://github.com/advancedrei)) -* [Auth0.Widget](https://auth0.com/) (by [Robert McLaws](https://github.com/advancedrei)) -* [aws-sdk-js](https://github.com/aws/aws-sdk-js) (by [midknight41](https://github.com/midknight41)) -* [Backbone.js](http://backbonejs.org/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Backbone Relational](http://backbonerelational.org/) (by [Eirik Hoem](https://github.com/eirikhm)) -* [big.js](https://github.com/MikeMcl/big.js) (by [Steve Ognibene](https://github.com/nycdotnet)) -* [BigInt](https://github.com/Evgenus/BigInt) (by [Eugene Chernyshov](https://github.com/Evgenus)) -* [BigInteger](https://github.com/peterolson/BigInteger.js) (by [Ingo Bürk](https://github.com/Airblader)) -* [BigScreen](http://brad.is/coding/BigScreen/) (by [Douglas Eichelberger](https://github.com/dduugg)) -* [Bluebird](https://github.com/petkaantonov/bluebird) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [Bootbox](https://github.com/makeusabrew/bootbox) (by [Vincent Bortone](https://github.com/vbortone/)) -* [Bootstrap](http://twitter.github.com/bootstrap/) (by [Boris Yankov](https://github.com/borisyankov)) -* [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) (by [Blake Niemyjski](https://github.com/niemyjski)) -* [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) (by [Boris Yankov](https://github.com/borisyankov)) -* [Box2DWeb](http://code.google.com/p/box2dweb/) (by [Josh Baldwin](https://github.com/jbaldwin/)) -* [Breeze](http://www.breezejs.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Browser Harness](https://github.com/scriby/browser-harness) (by [Chris Scribner](https://github.com/scriby)) -* [bucks](https://github.com/CyberAgent/bucks.js) (by [Shunsuke Ohtani](https://github.com/zaneli)) -* [bunyan](https://github.com/trentm/node-bunyan) (by [Alex Mikhalev](https://github.com/amikhalev)) -* [bunyan-logentries](https://github.com/nemtsov/node-bunyan-logentries) (by [Aymeric Beaumet](http://aymericbeaumet.me)) -* [CasperJS](http://casperjs.org) (by [Jed Mao](https://github.com/jedmao)) -* [CanvasJS](http://canvasjs.com) (by [Mark Overholt](https://github.com/mover5)) -* [checksum](https://github.com/dshaw/checksum) (by [Rogier Schouten](https://github.com/rogierschouten)) -* [Cheerio](https://github.com/MatthewMueller/cheerio) (by [Bret Little](https://github.com/blittle)) -* [Chosen](http://harvesthq.github.com/chosen/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Chroma.js](https://github.com/gka/chroma.js) (by [Sebastian Brückner](https://github.com/invliD)) -* [Chrome](http://developer.chrome.com/extensions/) (by [Matthew Kimber](https://github.com/matthewkimber) and [otiai10](https://github.com/otiai10)) -* [Chrome App](http://developer.chrome.com/apps/) (by [Adam Lay](https://github.com/AdamLay)) -* [CKEditor](https://github.com/ckeditor/ckeditor-dev) (by [Ondrej Sevcik](https://github.com/ondrejsevcik)) -* [Clone](https://github.com/pvorb/node-clone) (by [Kieran Simpson](https://github.com/kierans)) -* [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) -* [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem) and [vvakame](https://github.com/vvakame)) -* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [cookie](https://github.com/jshttp/cookie) (by [Pine Mizune](https://github.com/jshttp/cookie)) -* [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/)) -* [Cordovarduino](https://github.com/stereolux/cordovarduino) (by [Hendrik Maus](https://github.com/hendrikmaus)) -* [Couchbase / Couchnode](https://github.com/couchbase/couchnode) (by [Basarat Ali Syed](https://github.com/basarat)) -* [Crossfilter](https://github.com/square/crossfilter) (by [Schmulik Raskin](https://github.com/schmuli)) -* [crypto-js](https://code.google.com/p/crypto-js/) (by [Gia Bảo @ Sân Đình](https://github.com/giabao)). @see [cryptojs.d.ts repo](https://github.com/giabao/cryptojs.d.ts) -* [d3.js](http://d3js.org/) (from TypeScript samples) -* [dat.GUI](https://github.com/dataarts/dat.gui) (by [gyoh_k](https://github.com/gyohk)) -* [debug](https://github.com/visionmedia/debug) (by [Seon-Wook Park](https://github.com/swook)) -* [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) (by [Maksim Kozhukh](http://github.com/mkozhukh)) -* [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) (by [Maksim Kozhukh](http://github.com/mkozhukh)) -* [diff](https://github.com/kpdecker/jsdiff) (by [vvakame](http://github.com/vvakame)) -* [Dock Spawn](http://dockspawn.com) (by [Drew Noakes](https://drewnoakes.com)) -* [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) (by [Jon Egerton](https://github.com/jonegerton)) -* [domo](http://domo-js.com/) (by [Steve Fenton](https://github.com/Steve-Fenton)) -* [doT](https://github.com/olado/doT) (by [ZombieHunter](https://github.com/ZombieHunter)) -* [dust](http://linkedin.github.com/dustjs) (by [Marcelo Dezem](https://github.com/mdezem)) -* [EaselJS](http://www.createjs.com/#!/EaselJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) -* [EasyStar](http://easystarjs.com/) (by [Magnus Gustafsson](https://github.com/Borundin)) -* [Elm](http://elm-lang.org) (by [Dénes Harmath](https://github.com/thSoft)) -* [Ember.js](http://emberjs.com/) (by [Jed Mao](https://github.com/jedmao) and [Boris Yankov](https://github.com/borisyankov)) -* [emissary](https://github.com/atom/emissary) (by [vvakame](https://github.com/vvakame)) -* [Emscripten](http://kripken.github.io/emscripten-site/) (by [Kensuke MATSUZAKI](https://github.com/zakki)) -* [EpicEditor](http://epiceditor.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [ES6-Promises](https://github.com/jakearchibald/ES6-Promises) (by [François de Campredon](https://github.com/fdecampredon/)) -* [Esprima](http://esprima.org/) (by [Teppei Sato](https://github.com/teppeis)) -* [expect.js](https://github.com/LearnBoost/expect.js) (by [Teppei Sato](https://github.com/teppeis)) -* [EventEmitter2](https://github.com/asyncly/EventEmitter2) (by [Ryo Iwamoto](https://github.com/ryiwamoto)) -* [expectations](https://github.com/spmason/expectations) (by [vvakame](https://github.com/vvakame)) -* [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [express-session](https://www.npmjs.org/package/express-session) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) -* [express-myconnection](https://www.npmjs.org/package/express-myconnection) (by [Michael Ferris](https://github.com/cellule/) -* [Ext JS](http://www.sencha.com/products/extjs/) (by [Brian Kotek](https://github.com/brian428)) -* [Fabric.js](http://fabricjs.com/) (by [Oliver Klemencic](https://github.com/oklemencic/)) -* [Fancybox](http://fancybox.net/) (by [Boris Yankov](https://github.com/borisyankov)) -* [FastClick](https://github.com/ftlabs/fastclick) (by [Shinnosuke Watanabe](https://github.com/shinnn)) -* [File API: Directories and System](http://www.w3.org/TR/file-system-api/) (by [Kon](http://phyzkit.net/)) -* [File API: Writer](http://www.w3.org/TR/file-writer-api/) (by [Kon](http://phyzkit.net/)) -* [Finch](https://github.com/stoodder/finchjs) (by [David Sichau](https://github.com/DavidSichau/)) -* [fingerprintjs](https://github.com/Valve/fingerprintjs) (by [Shunsuke Ohtani](https://github.com/zaneli)) -* [Finite State Machine](https://github.com/jakesgordon/javascript-state-machine) (by [Boris Yankov](https://github.com/borisyankov)) -* [Firebase](https://www.firebase.com/docs/javascript/firebase) (by [Vincent Bortone](https://github.com/vbortone)) -* [Firefox](https://developer.mozilla.org/en-US/docs/Web/API) (by [vvakame](https://github.com/vvakame)) -* [FlexSlider](http://www.woothemes.com/flexslider/) (by [Diullei Gomes](https://github.com/Diullei)) -* [Flight by Twitter](http://flightjs.github.com/flight/) (by [Jonathan Hedrén](https://github.com/jonathanhedren)) -* [flipsnap.js](http://pxgrid.github.io/js-flipsnap/) (by [kubosho_](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki)) -* [Foundation](http://foundation.zurb.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [FPSMeter](http://darsa.in/fpsmeter/) (by [Aaron Lampros](https://github.com/alampros)) -* [fs-extra](https://github.com/jprichardson/node-fs-extra) (by [midknight41](https://github.com/midknight41)) -* [FullCalendar](http://arshaw.com/fullcalendar/) (by [Neil Stalker](https://github.com/nestalk)) -* [Fuse.js](https://github.com/krisk/Fuse) (by [Greg Smith](https://github.com/smrq)) -* [Gamepad](http://www.w3.org/TR/gamepad/) (by [Kon](http://phyzkit.net/)) -* [GeoJSON](http://geojson.org/) (by [Jake Bruun](https://github.com/cobster)) -* [Giraffe](https://github.com/barc/backbone.giraffe) (by [Matt McCray](https://github.com/darthapo)) -* [glDatePicker](http://glad.github.com/glDatePicker/) (by [Dániel Tar](https://github.com/qcz)) -* [Glob](https://github.com/isaacs/node-glob) (by [vvakame](https://github.com/vvakame)) -* [GoJS](http://gojs.net/) (by [Barbara Duckworth](https://github.com/barbara42)) -* [Greasemonkey](http://www.greasespot.net/) (by [Kota Saito](https://github.com/kotas)) -* [GreenSock Animation Platform (GSAP)](http://www.greensock.com/get-started-js/) (by [Robert S.](https://github.com/codeBelt)) -* [gridfs-stream](https://github.com/aheckmann/gridfs-stream) (by [Lior Mualem](https://github.com/liorm)) -* [Grunt JS](http://gruntjs.com/) (by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat) and [San Chen](https://github.com/bigsan)) -* [Google API Client](https://code.google.com/p/google-api-javascript-client/) (by [Frank M](https://github.com/sgtfrankieboy)) -* [Google App Engine Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) (by [vvakame](https://github.com/vvakame)) -* [GoogleMaps](https://developers.google.com/maps/) (by [Esben Nepper](https://github.com/eNepper)) -* [GoogleMaps InfoBubble](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/) (by [Johan Nilsson](https://github.com/dashue)) -* [Google Geolocation](https://code.google.com/p/geo-location-javascript/) (by [Vincent Bortone](https://github.com/vbortone)) -* [Google Page Speed Online API](https://developers.google.com/speed/pagespeed/) (by [Frank M](https://github.com/sgtfrankieboy)) -* [Google Translate API](https://developers.google.com/translate/) (by [Frank M](https://github.com/sgtfrankieboy)) -* [Google Url Shortener](https://developers.google.com/url-shortener/) (by [Frank M](https://github.com/sgtfrankieboy)) -* [gulp](http://gulpjs.com/) (by [Drew Noakes](https://drewnoakes.com)) -* [Hammer.js](http://eightmedia.github.com/hammer.js/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Hapi](http://github.com/spumko/hapi) (by [Hakubo](http://github.com/hakubo)) -* [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [HashMap](https://github.com/flesler/hashmap) (by [Rafał Wrzeszcz](https://wrzasq.pl)) -* [HashSet](http://www.timdown.co.uk/jshashtable/jshashset.html) (by [Sergey Gerasimov](https://github.com/gerich-home)) -* [Hashtable](http://www.timdown.co.uk/jshashtable/) (by [Sergey Gerasimov](https://github.com/gerich-home)) -* [HelloJS](http://adodson.com/hello.js) (by [Pavel Zika](https://github.com/PavelPZ)) -* [Highcharts](http://www.highcharts.com/) (by [damianog](https://github.com/damianog)) -* [Highland](http://highlandjs.org/) (by [Bart van der Schoor](https://github.com/Bartvds/)) -* [highlight.js](https://github.com/isagalaev/highlight.js) (by [Niklas Mollenhauer](https://github.com/nikeee) and [Jeremy Hull](https://github.com/sourrust)) -* [History.js](https://github.com/browserstate/history.js) (by [Boris Yankov](https://github.com/borisyankov)) -* [Html2Canvas.js](https://github.com/niklasvh/html2canvas/) (by [Richard Hepburn](https://github.com/rwhepburn)) -* [htmlparser2](https://github.com/fb55/htmlparser2/) (by [James Roland Cabresos](https://github.com/staticfunction)) -* [http-string-parser](https://github.com/apiaryio/http-string-parser) (by [MIZUNE Pine](https://github.com/pine613)) -* [Humane.js](http://wavded.github.com/humane-js/) (by [John Vrbanac](https://github.com/jmvrbanac)) -* [i18next](http://i18next.com/) (by [Maarten Docter](https://github.com/mdocter)) -* [i18n-node](https://github.com/mashpie/i18n-node) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [iCheck](http://damirfoy.com/iCheck/) (by [Dániel Tar](https://github.com/qcz)) -* [Impress.js](https://github.com/bartaz/impress.js) (by [Boris Yankov](https://github.com/borisyankov)) -* [Intercom.js](https://github.com/diy/intercom.js) (by [Spencer Williams](https://github.com/spencerwi)) -* [Imagemagick](http://github.com/rsms/node-imagemagick) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) -* [inflection](https://github.com/dreamerslab/node.inflection) (by [Shogo Iwano](https://github.com/shiwano)) -* [insight](https://github.com/yeoman/insight) (by [vvakame](https://github.com/vvakame)) -* [interact.js](http://github.com/taye/interact.js) (by [Douglas Eichelberger](https://github.com/dduugg)) -* [Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) (by [Douglas Eichelberger](https://github.com/dduugg)) -* [Ionic-Cordova](https://github.com/driftyco/) (by [Hendrik Maus](https://github.com/hendrikmaus)) -* [iScroll](http://cubiq.org/iscroll-4) (by [Boris Yankov](https://github.com/borisyankov) and [Christiaan Rakowski](https://github.com/csrakowski)) -* [IxJS (Interactive extensions)](https://github.com/Reactive-Extensions/IxJS) (by [Igor Oleinikov](https://github.com/Igorbek)) -* [jake](https://github.com/mde/jake) (by [Kon](http://phyzkit.net/)) -* [Jasmine](http://pivotal.github.com/jasmine/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Jasmine-data_driven_tests](https://github.com/gburghardt/jasmine-data_driven_tests) (by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon)) -* [Jasmine-jQuery](https://github.com/velesin/jasmine-jquery) (by [Gregor Stamac](https://github.com/gstamac)) -* [jDataView](https://github.com/jDataView/jDataView) (by [Ingvar Stepanyan](https://github.com/RReverser)) -* [Jest](http://facebook.github.io/jest/) (by [Joshua Smith](https://github.com/Josh211ua)) -* [JointJS](http://www.jointjs.com/) (by [Aidan Reel](http://github.com/areel)) -* [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) (by [Dániel Tar](https://github.com/qcz)) -* [jQuery](http://jquery.com/) (from TypeScript samples) -* [jQuery Mobile](http://jquerymobile.com) (by [Boris Yankov](https://github.com/borisyankov)) -* [jQuery UI](http://jqueryui.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [jQuery.Address](https://github.com/asual/jquery-address) (by [Martin Duparc](https://github.com/martinduparc/) and [Tim Klingeleers](https://github.com/mardaneus86/)) -* [jQuery.areYouSure](https://github.com/codedance/jquery.AreYouSure) (by [Jon Egerton](https://github.com/jonegerton)) -* [jQuery.autosize](http://www.jacklmoore.com/autosize/) (by [Jack Moore](http://www.jacklmoore.com/)) -* [jQuery.BBQ](http://benalman.com/projects/jquery-bbq-plugin/) (by [Adam R. Smith](https://github.com/sunetos)) -* [jQuery.CLEditor](http://premiumsoftware.net/CLEditor) (by [Jeffery Grajkowski](https://github.com/pushplay)) -* [jQuery.clientSideLogging](https://github.com/remybach/jQuery.clientSideLogging/) (by [Diullei Gomes](https://github.com/diullei/)) -* [jQuery.Colorbox](http://www.jacklmoore.com/colorbox/) (by [Gidon Junge](https://github.com/gjunge)) -* [jQuery.contextMenu](http://medialize.github.com/jQuery-contextMenu/) (by [Natan Vivo](https://github.com/nvivo/)) -* [jQuery.Cookie](https://github.com/carhartl/jquery-cookie) (by [Roy Goode](https://github.com/RoyGoode)) -* [jQuery.customSelect](https://github.com/adamcoulombe/jquery.customSelect) (by [tomato360](https://github.com/tomato360)) -* [jQuery.Cycle](http://jquery.malsup.com/cycle/) (by [François Guillot](http://fguillot.developpez.com/)) -* [jQuery.Cycle2](http://jquery.malsup.com/cycle2/) (by [Donny Nadolny](https://github.com/dnadolny)) -* [jQuery.dataTables](http://www.datatables.net) (by [Armin Sander](https://github.com/pragmatrix)) -* [jQuery.datetimepicker](http://trentrichardson.com/examples/timepicker/) (by [Doug McDonald](https://github.com/dougajmcdonald)) -* [jQuery.dynatree](http://code.google.com/p/dynatree/) (by [François de Campredon](https://github.com/fdecampredon)) -* [jQuery.Fileupload](https://github.com/blueimp/jQuery-File-Upload/) (by [Rob Alarcon](https://github.com/rob-alarcon)) -* [jQuery.Finger](http://ngryman.sh/jquery.finger/) (by [Max Ackley](https://github.com/maxackley)) -* [jQuery.Flot](http://www.flotcharts.org/) (by [Matt Burland](https://github.com/burlandm)) -* [jQuery.form](http://malsup.com/jquery/form/) (by [François Guillot](http://fguillot.developpez.com/)) -* [jQuery.Globalize](https://github.com/jquery/globalize) (by [Boris Yankov](https://github.com/borisyankov)) -* [jQuery.gridster](http://gridster.net) (by [Josh Baldwin](https://github.com/jbaldwin/gridster.d.ts)) -* [jQuery.jNotify](http://jnotify.codeplex.com) (by [James Curran](https://github.com/jamescurran/)) -* [jQuery.joyride](http://zurb.com/playground/jquery-joyride-feature-tour-plugin) (by [Vincent Bortone](https://github.com/vbortone)) -* [jQuery.jSignature](https://github.com/willowsystems/jSignature) (by [Patrick Magee](https://github.com/pjmagee)) -* [jQuery.leanModal](http://leanmodal.finelysliced.com.au/)(by [tomato360](https://github.com/tomato360)) -* [jQuery.notifyBar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar/) (by [Shunsuke Ohtani](https://github.com/zaneli)) -* [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/)) -* [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/)) -* [jQuery.pickadate](https://github.com/amsul/pickadate.js) (by [Theodore Brown](https://github.com/theodorejb)) -* [jQuery.pjax](https://github.com/defunkt/jquery-pjax) (by [Junle Li](https://github.com/lijunle)) -* [jQuery.pjax.falsandtru](https://github.com/falsandtru/jquery.pjax.js/) (by [NewNotMoon](http://new.not-moon.net/)) -* [jQuery.pnotify](http://sciactive.github.io/pnotify/) (by [David Sichau](https://github.com/DavidSichau/)) -* [jQuery.postMessage](http://benalman.com/projects/jquery-postmessage-plugin/) (by [Junle Li](https://github.com/lijunle)) -* [jQuery.prettyphoto](https://github.com/scaron/prettyphoto) (by [Paul Gaske](https://github.com/pgaske)) -* [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/)) -* [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/)) -* [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) (by [Blake Niemyjski](https://github.com/niemyjski)) -* [jQuery.tile](https://github.com/urin/jquery.tile.js) (by [Shunsuke Ohtani](https://github.com/zaneli)) -* [jQuery.timeago](http://timeago.yarp.com/) (by [François Guillot](http://fguillot.developpez.com/)) -* [jQuery.Timepicker](http://fgelinas.com/code/timepicker/) (by [Anwar Javed](https://github.com/anwarjaved)) -* [jQuery.Timer](http://jchavannes.com/jquery-timer/demo) (by [Joshua Strobl](https://github.com/JoshStrobl)) -* [jQuery.TinyCarousel](http://baijs.nl/tinycarousel/) (by [Christiaan Rakowski](https://github.com/csrakowski)) -* [jQuery.TinyScrollbar](http://baijs.nl/tinyscrollbar/) (by [Christiaan Rakowski](https://github.com/csrakowski)) -* [jQuery.tooltipster](https://github.com/iamceege/tooltipster) (by [Patrick Magee](https://github.com/pjmagee)) -* [jQuery.total-storage](https://github.com/Upstatement/jquery-total-storage) (by [Jeremy Brooks](https://github.com/JeremyCBrooks/)) -* [jQuery.Transit](http://ricostacruz.com/jquery.transit/) (by [MrBigDog2U](https://github.com/MrBigDog2U)) -* [jQuery.Validation](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) (by [Boris Yankov](https://github.com/borisyankov)) -* [jQuery.Watermark](http://jquery-watermark.googlecode.com) (by [Anwar Javed](https://github.com/anwarjaved)) -* [jQuery.base64](https://github.com/yatt/jquery.base64) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki)) -* [jquery-handsontable](https://github.com/handsontable/jquery-handsontable) (by [Ted John](https://github.com/intelorca)) -* [js-git](https://github.com/creationix/js-git) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [js-url](https://github.com/websanova/js-url) (by [MIZUNE Pine](https://github.com/pine613)) -* [js-yaml](https://github.com/nodeca/js-yaml) (by [Bart van der Schoor](https://github.com/Bartvds/)) -* [jsbn](http://www-cs-students.stanford.edu/%7Etjw/jsbn/) (by [Eugene Chernyshov](https://github.com/Evgenus)) -* [jScrollPane](http://jscrollpane.kelvinluck.com) (by [Dániel Tar](https://github.com/qcz)) -* [JSDeferred](http://cho45.stfuawsc.com/jsdeferred/) (by [Daisuke Mino](https://github.com/minodisk)) -* [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) (by [Vincent Bortone](https://github.com/vbortone/)) -* [JSON-Pointer](https://www.npmjs.org/package/json-pointer) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [JsRender](http://www.jsviews.com/#jsrender) (by [Kensuke MATSUZAKI](https://github.com/zakki)) -* [jStorage](http://www.jstorage.info/) (by [Danil Flores](https://github.com/dflor003/)) -* [jsTree](http://www.jstree.com/) (by [Adam Pluciński](https://github.com/adaskothebeast)) -* [JWPlayer](http://developer.longtailvideo.com/trac/) (by [Martin Duparc](https://github.com/martinduparc/)) -* [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) (by [Vincent Bortone](https://github.com/vbortone/)) -* [keymaster.js](https://github.com/madrobby/keymaster) (by [Marting W. Kirst](https://github.com/nitram509/)) -* [Keypress](https://github.com/dmauro/Keypress/) (by [Roger Chen](https://github.com/rcchen/)) -* [KineticJS](http://kineticjs.com/) (by [Basarat Ali Syed](https://github.com/basarat)) -* [Knockback](http://kmalakoff.github.com/knockback/) (by [Marcel Binot](https://github.com/docgit)) -* [Knockout.js](http://knockoutjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Knockout.Amd.Helpers](https://github.com/rniemeyer/knockout-amd-helpers) (by [David Sichau](https://github.com/DavidSichau/)) -* [Knockout.DeferredUpdates](https://github.com/mbest/knockout-deferred-updates) (by [Sebastián Galiano](https://github.com/sgaliano)) -* [Knockout.ES5](https://github.com/SteveSanderson/knockout-es5) (by [Sebastián Galiano](https://github.com/sgaliano)) -* [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC)) -* [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov)) -* [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel)) -* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) -* [Knockout Secure Binding](https://github.com/brianmhunt/knockout-secure-binding) (by [Pine Mizune](https://github.com/pine613)) -* [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig)) -* [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising)) -* [Knockstrap](http://faulknercs.github.io/Knockstrap/) (by [Adam Pluciński](https://github.com/adaskothebeast)) -* [ko.editables](http://romanych.github.com/ko.editables/) (by [Oisin Grehan](https://github.com/oising)) -* [KoLite](https://github.com/CodeSeven/kolite) (by [Boris Yankov](https://github.com/borisyankov)) -* [Lazy.js](http://danieltao.com/lazy.js/) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [Leaflet](https://github.com/Leaflet/Leaflet) (by [Vladimir](https://github.com/rgripper)) -* [Libxmljs](https://github.com/polotek/libxmljs) (by [François de Campredon](https://github.com/fdecampredon)) -* [ladda](https://github.com/hakimel/Ladda) (by [Danil Flores](https://github.com/dflor003)) -* [Levelup](https://github.com/rvagg/node-levelup) (by [Bret Little](https://github.com/blittle)) -* [linq.js](http://linqjs.codeplex.com/) (by [Marcin Najder](https://github.com/marcinnajder)) -* [Livestamp.js](https://github.com/mattbradley/livestampjs) (by [Vincent Bortone](https://github.com/vbortone)) -* [localForage](https://github.com/mozilla/localForage) (by [david pichsenmeister](https://github.com/3x14159265)) -* [Lodash](http://lodash.com/) (by [Brian Zengel](https://github.com/bczengel)) -* [Logg](https://github.com/dpup/node-logg) (by [Bret Little](https://github.com/blittle)) -* [Long.js](https://github.com/dcodeIO/Long.js) (by [Toshihide Hara](https://github.com/kerug)) -* [lz-string](https://github.com/pieroxy/lz-string) (by [Roman Nikitin](https://github.com/M0ns1gn0r)) -* [Mapbox](https://github.com/mapbox/mapbox.js/) (by [Maxime Fabre](https://github.com/anahkiasen)) -* [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr)) -* [MathJax](https://github.com/mathjax/MathJax) (by [Roland Zwaga](https://github.com/rolandzwaga)) -* [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) (by [Sarah Williams](https://github.com/flurg)) -* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave)) -* [md5.js](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) (by [MIZUNE Pine](https://github.com/pine613)) -* [Microsoft Ajax](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) (by [Patrick Magee](https://github.com/pjmagee)) -* [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk)) -* [Minimatch](https://github.com/isaacs/minimatch) (by [vvakame](https://github.com/vvakame)) -* [minimist](https://github.com/substack/minimist) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [Mithril](http://lhorie.github.io/mithril) (by [Leo Horie](https://github.com/lhorie) and [Chris Bowdon](https://github.com/cbowdon)) -* [Mixpanel](https://github.com/mixpanel/mixpanel-js) (by [Knut Eirik Leira Hjelle](https://github.com/hjellek)) -* [mixto](https://github.com/atom/mixto) (by [vvakame](https://github.com/vvakame)) -* [mocha-phantomjs](https://github.com/metaskills/mocha-phantomjs) (by [ErikSchierboom](https://github.com/ErikSchierboom)) -* [Modernizr](http://modernizr.com/) (by [Boris Yankov](https://github.com/borisyankov) and [Theodore Brown](https://github.com/theodorejb/)) -* [Moment.js](https://github.com/timrwood/moment) (by [Michael Lakerveld](https://github.com/Lakerfield)) -* [MongoDB](http://mongodb.github.io/node-mongodb-native/) (from TypeScript samples, updated by [Niklas Mollenhauer](https://github.com/nikeee)) -* [mongoose](http://mongoosejs.com/) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) -* [morgan](https://github.com/expressjs/morgan/) (by [James Roland Cabresos](https://github.com/staticfunction/)) -* [Mousetrap](http://craig.is/killing/mice) (by [Dániel Tar](https://github.com/qcz)) -* [msgpack.js](https://github.com/uupaa/msgpack.js) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki)) -* [msnodesql](https://github.com/WindowsAzure/node-sqlserver) (by [Boris Yankov](https://github.com/borisyankov) and [Maxime LUCE](https://github.com/SomaticIT)) -* [Mustache.js](https://github.com/janl/mustache.js) (by [Boris Yankov](https://github.com/borisyankov)) -* [mysql](https://github.com/felixge/node-mysql) (by [William Johnston](https://github.com/wjohnsto)) -* [nconf](https://github.com/flatiron/nconf) (by [Jeff Goddard](https://github.com/jedigo)) -* [needle](https://github.com/tomas/needle) (by [San Chen](https://github.com/bigsan)) -* [nexpect](https://github.com/nodejitsu/nexpect) (by [vvakame](https://github.com/vvakame)) -* [noble](https://github.com/sandeepmistry/noble) (by [Seon-Wook Park](https://github.com/swook)) -* [nock](https://github.com/pgte/nock) (by [bonnici](https://github.com/bonnici)) -* [Node.js](http://nodejs.org/) (from TypeScript samples) -* [node_redis](https://github.com/mranney/node_redis) (by [Boris Yankov](https://github.com/borisyankov)) -* [node-azure](https://github.com/Azure/azure-sdk-for-node) (by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna) and [Maxime LUCE](https://github.com/SomaticIT)) -* [node-ffi](https://github.com/rbranson/node-ffi) (by [Paul Loyd](https://github.com/loyd)) -* [node-form](https://github.com/rsamec/form) (by [Roman Samec](https://github.com/rsamec)) -* [node-git](https://github.com/christkv/node-git) (by [vvakame](https://github.com/vvakame)) -* [node-sqlserver](https://github.com/WindowsAzure/node-sqlserver) (by [Boris Yankov](https://github.com/borisyankov) and [Maxime LUCE](https://github.com/SomaticIT)) -* [nodeunit](https://github.com/caolan/nodeunit) (by [Jeff Goddard](https://github.com/jedigo)) -* [node_zeromq](https://github.com/JustinTulloss/zeromq.node) (by [Dave McKeown](https://github.com/davemckeown)) -* [node-tar](https://github.com/npm/node-tar) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [node-uuid](https://github.com/broofa/node-uuid) (by [Jeff May](https://github.com/jeffmay)) -* [notify.js](https://github.com/alexgibson/notify.js) (by [soundTricker](https://github.com/soundTricker)) -* [npm](https://github.com/npm/npm) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [NProgress](https://github.com/rstacruz/nprogress) (by [Judah Gabriel Himango](https://github.com/judahgabriel)) -* [Numeral.js](https://github.com/adamwdraper/Numeral-js) (by [Vincent Bortone](https://github.com/vbortone/)) -* [object-path](https://github.com/mariocasciaro/object-path) (by [Paulo Cesar](https://github.com/pocesar/)) -* [ocLazyLoad](https://github.com/ocombe/ocLazyLoad) (by [Roland Zwaga](https://github.com/rolandzwaga/)) -* [OpenLayers](https://github.com/openlayers/openlayers) (by [Ilya Bolkhovsky](https://github.com/bolhovsky/)) -* [opn](https://github.com/sindresorhus/opn) (by [Shinnosuke Watanabe](https://github.com/shinnn)) -* [Optimist](https://github.com/substack/node-optimist) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) -* [Passport](http://passportjs.org/) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) -* [passport-facebook](https://github.com/jaredhanson/passport-facebook) (by [James Roland Cabresos](https://github.com/staticfunction/)) -* [passport-local](https://github.com/jaredhanson/passport-local) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [passport-strategy](https://github.com/jaredhanson/passport-strategy) (by [Lior Mualem](https://github.com/liorm)) -* [pathwatcher](http://atom.github.io/node-pathwatcher/) (by [vvakame](https://github.com/vvakame)) -* [Parallel.js](https://github.com/adambom/parallel.js) (by [Josh Baldwin](https://github.com/jbaldwin)) -* [Parsimmon](https://github.com/jayferd/parsimmon) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin)) -* [PeerJS](http://peerjs.com/) (by [Toshiya Nakakura](https://github.com/nakakura)) -* [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame)) -* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) -* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613)) -* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) -* [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov)) -* [Physijs](http://chandlerprall.github.io/Physijs/) (by [gyoh_k](https://github.com/gyohk)) -* [Pickadate.js](https://github.com/amsul/pickadate.js) (by [Adi Dahiya](https://github.com/adidahiya)) -* [PixiJS](https://github.com/GoodBoyDigital/pixi.js) (by [Pedro Casaubon](https://github.com/xperiments)) -* [Platform](https://github.com/bestiejs/platform.js) (by [Jake Hickman](https://github.com/JakeH)) -* [podcast](http://github.com/maxnowack/node-podcast) (by [Niklas Mollenhauer](https://github.com/nikeee)) -* [PouchDB](http://pouchdb.com) (by [Bill Sears](https://github.com/MrBigDog2U/)) -* [PreloadJS](http://www.createjs.com/#!/PreloadJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) -* [ProgressJs](http://usablica.github.io/progress.js/) (by [Shunsuke Ohtani](https://github.com/zaneli)) -* [promise-pool](https://github.com/vilic/promise-pool) (by [VILIC VANE](https://github.com/vilic)) -* [Q](https://github.com/kriskowal/q) (by Barrie Nemetchek, Andrew Gaspar) -* [Qajax](https://github.com/gre/qajax) (by [Boltmade](https://github.com/Boltmade)) -* [Q-io](https://github.com/kriskowal/q-io) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [q-retry](https://github.com/vilic/q-retry) (by [VILIC VANE](https://github.com/vilic)) -* [QUnit](http://qunitjs.com/) (by [Diullei Gomes](https://github.com/Diullei)) -* [Raven.js](https://github.com/getsentry/raven-js) (by [Santi Albo](https://github.com/santialbo)) -* [Recaptcha.js](https://www.google.com/recaptcha) (by [Brent Jenkins](https://github.com/brentj73)) -* [Rickshaw](http://code.shutterstock.com/rickshaw/) (by [Blake Niemyjski](https://github.com/niemyjski)) -* [Riot.js](https://github.com/moot/riotjs) (by [vvakame](https://github.com/vvakame)) -* [Restify](https://github.com/mcavage/node-restify) (by [Bret Little](https://github.com/blittle)) -* [React](http://facebook.github.io/react/) (by [Phips Peter](https://github.com/pspeter3) -* [Redis](https://github.com/mranney/node_redis) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) -* [Request](https://github.com/mikeal/request) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) -* [Royalslider](http://dimsemenov.com/plugins/royal-slider/) (by [Christiaan Rakowski](https://github.com/csrakowski)) -* [Rx.js](http://rx.codeplex.com/) (by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek), [Carl de Billy](http://carl.debilly.net/), [zoetrope](https://github.com/zoetrope)) -* [Raphael](http://raphaeljs.com/) (by [CheCoxshall](https://github.com/CheCoxshall)) -* [Restangular](https://github.com/mgonto/restangular/) (by [Boris Yankov](https://github.com/borisyankov)) -* [require.js](http://requirejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/)) -* [rtree.js](https://github.com/leaflet-extras/RTree) (by [Omede Firouz](https://github.com/oefirouz)) -* [Sammy.js](http://sammyjs.org/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Select2](http://ivaynberg.github.com/select2/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Selenium WebDriverJS](https://code.google.com/p/selenium/) (by [Bill Armstrong](https://github.com/BillArmstrong)) -* [Semver](https://github.com/isaacs/node-semver) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [Sencha Touch](http://www.sencha.com/products/touch/) (by [Brian Kotek](https://github.com/brian428)) -* [sendgrid](https://github.com/sendgrid/sendgrid-nodejs) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [SharePoint](http://sptypescript.codeplex.com) (by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru) and [Andrey Markeev](http://markeev.com)) -* [ShellJS](http://shelljs.org) (by [Niklas Mollenhauer](https://github.com/nikeee)) -* [Showdown](https://github.com/coreyti/showdown) (by [Chris Bowdon](https://github.com/cbowdon)) -* [SignalR](http://www.asp.net/signalr) (by [Boris Yankov](https://github.com/borisyankov)) -* [simple-cw-node](https://github.com/astronaughts/simple-cw-node) (by [vvakame](https://github.com/vvakame)) -* [Sinon](http://sinonjs.org/) (by [William Sears](https://github.com/mrbigdog2u)) -* [SIPml](http://sipml5.org/) (by [Adriaan Groenenboom](https://github.com/chookies)) -* [sjcl](http://crypto.stanford.edu/sjcl/) (by [Eugene Chernyshov](https://github.com/Evgenus)) -* [SlickGrid](https://github.com/mleibman/SlickGrid) (by [Josh Baldwin](https://github.com/jbaldwin)) -* [smoothie](https://github.com/joewalnes/smoothie) (by [Mike H. Hawley](https://github.com/mikehhawley) and [Drew Noakes](https://drewnoakes.com)) -* [socket.io](http://socket.io) (by [William Orr](https://github.com/worr)) -* [socket.io-client](http://socket.io) (by [Maido Kaara](https://github.com/v3rm0n)) -* [SockJS](https://github.com/sockjs/sockjs-client) (by [Emil Ivanov](https://github.com/vladev)) -* [sockjs-node](https://github.com/sockjs/sockjs-node) (by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing)) -* [SoundJS](http://www.createjs.com/#!/SoundJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) -* [source-map](https://github.com/mozilla/source-map) (by [Morten Houston Ludvigsen](https://github.com/MortenHoustonLudvigsen)) -* [Spin](http://fgnass.github.com/spin.js/) (by [Boris Yankov](https://github.com/borisyankov)) -* [sqlite3](https://github.com/mapbox/node-sqlite3) (by [Nick Malaguti](https://github.com/nmalaguti)) -* [stampit](https://github.com/ericelliott/stampit) (by [Vasyl Boroviak](https://github.com/koresar)) -* [status-bar](https://github.com/atom/status-bar) (by [vvakame](https://github.com/vvakame)) -* [stripe](https://stripe.com/) (by [Eric J. Smith](https://github.com/ejsmith/)) -* [Store.js](https://github.com/marcuswestin/store.js/) (by [Vincent Bortone](https://github.com/vbortone)) -* [stylus](https://github.com/LearnBoost/stylus) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [Sugar](http://sugarjs.com/) (by [Josh Baldwin](https://github.com/jbaldwin/)) -* [svg-pan-zoom] (https://github.com/ariutta/svg-pan-zoom) (by [Chintan Shah] (https://github.com/Promact)) -* [swfobject](https://code.google.com/p/swfobject/) (by [rou](https://github.com/rou)) -* [Swiper](http://www.idangero.us/sliders/swiper) (by [Sebastián Galiano](https://github.com/sgaliano)) -* [SwipeView](http://cubiq.org/swipeview) (by [Boris Yankov](https://github.com/borisyankov)) -* [Swiz](https://github.com/racker/node-swiz) (by [Jeff Goddard](https://github.com/jedigo)) -* [TV4](https://github.com/geraintluff/tv4) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [Tags Manager](http://welldonethings.com/tags/manager) (by [Vincent Bortone](https://github.com/vbortone)) -* [Teechart](http://www.steema.com) (by [Steema](http://www.steema.com)) -* [text-buffer](https://github.com/atom/text-buffer) (by [vvakame](https://github.com/vvakame)) -* [text-encoding](https://github.com/inexorabletash/text-encoding) (by [MIZUNE Pine](https://github.com/pine613)) -* [three.js](http://mrdoob.github.com/three.js/) (by [Kon](http://phyzkit.net/)) -* [through2](https://github.com/rvagg/through2) (by [Bart van der Schoor](https://github.com/Bartvds) and [jedmao](https://github.com/jedmao)) -* [TimelineJS](https://github.com/NUKnightLab/TimelineJS) (by [Roland Zwaga](https://github.com/rolandzwaga)) -* [timezonecomplete](https://github.com/SpiritIT/timezonecomplete) (by [Rogier Schouten](https://github.com/rogierschouten)) -* [Toastr](https://github.com/CodeSeven/toastr) (by [Boris Yankov](https://github.com/borisyankov)) -* [trunk8](https://github.com/rviscomi/trunk8) (by [Blake Niemyjski](https://github.com/niemyjski)) -* [TweenJS](http://www.createjs.com/#!/TweenJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) -* [tween.js](https://github.com/sole/tween.js/) (by [Adam R. Smith](https://github.com/sunetos)) -* [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) (by [Blake Niemyjski](https://github.com/niemyjski)) -* [Twitter Typeahead](http://twitter.github.io/typeahead.js) (by [Ivaylo Gochkov](https://github.com/igochkov)) -* [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) (by [John Vrbanac](https://github.com/jmvrbanac)) -* [Underscore.js](http://underscorejs.org/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Underscore.js (Typed)](http://underscorejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/)) -* [Underscore-ko.js](https://github.com/kamranayub/UnderscoreKO) (by [Maurits Elbers](https://github.com/MagicMau)) -* [universal-analytics](https://github.com/peaksandpies/universal-analytics) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [update-notifier](https://github.com/yeoman/update-notifier) (by [vvakame](https://github.com/vvakame)) -* [uri-templates](https://github.com/geraintluff/uri-templates) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [urlrouter](https://github.com/fengmk2/urlrouter) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) -* [UUID.js](https://github.com/LiosK/UUID.js) (by [Jason Jarrett](https://github.com/staxmanade)) -* [Valerie](https://github.com/davewatts/valerie) (by [Howard Richards](https://github.com/conficient)) -* [Velocity](http://velocityjs.org/) (by [Greg Smith](https://github.com/smrq)) -* [Viewporter](https://github.com/zynga/viewporter) (by [Boris Yankov](https://github.com/borisyankov)) -* [Vimeo](http://developer.vimeo.com/player/js-api) (by [Daz Wilkin](https://github.com/DazWilkin/)) -* [vinyl](https://github.com/wearefractal/vinyl) (by [vvakame](https://github.com/vvakame/)) -* [vinyl-fs](https://github.com/wearefractal/vinyl-fs) (by [vvakame](https://github.com/vvakame/) and [jedmao](https://github.com/jedmao)) -* [WebRTC](http://dev.w3.org/2011/webrtc/editor/webrtc.html) (by [Ken Smith](https://github.com/smithkl42)) -* [websocket](https://github.com/Worlize/WebSocket-Node) (by [Paul Loyd](https://github.com/loyd)) -* [WinJS](http://msdn.microsoft.com/en-us/library/windows/apps/br229773.aspx) (from TypeScript samples) -* [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) (from TypeScript samples) -* [wolfy87-eventemitter](https://github.com/Wolfy87/EventEmitter) (by [Ryo Iwamoto](https://github.com/ryiwamoto)) -* [ws](http://einaros.github.io/ws/) (by [Paul Loyd](https://github.com/loyd)) -* [x2js](https://code.google.com/p/x2js/) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) -* [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) (by [Michel Salib](https://github.com/michelsalib)) -* [xpath](https://github.com/goto100/xpath) (by [Andrew Bradley](https://github.com/cspotcode)) -* [XRegExp](http://xregexp.com/) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [yargs](https://github.com/chevex/yargs) (by [Martin Poelstra](https://github.com/poelstra)) -* [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/)) -* [YouTube Analytics API](https://developers.google.com/youtube/analytics/) (by [Frank M](https://github.com/sgtfrankieboy)) -* [YouTube Data API](https://developers.google.com/youtube/v3/) (by [Frank M](https://github.com/sgtfrankieboy/)) -* [Zepto.js](http://zeptojs.com/) (by [Josh Baldwin](https://github.com/jbaldwin)) -* [Zynga Scroller](https://github.com/zynga/scroller) (by [Boris Yankov](https://github.com/borisyankov)) -* [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) (by [Eric J. Smith](https://github.com/ejsmith)) -* [Parse SDK](https://parse.com/docs/js_guide) (by [Ullisen Media Group, LLC](http://ullisenmedia.com)) From 822663f07620912d3d0e6827a7dbef9af79779dc Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 3 Nov 2014 18:25:33 +0900 Subject: [PATCH 077/135] fix invalid library names --- CONTRIBUTORS.md | 7 +++++-- form-data/form-data.d.ts | 2 +- ref-struct/ref-struct.d.ts | 2 +- ref/ref.d.ts | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 2b4c0083c..7bbcd3503 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -63,8 +63,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bootstrap-notify/bootstrap-notify.d.ts) [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) by [Blake Niemyjski](https://github.com/niemyjski) * [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov) * [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker) -* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker) * [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin) +* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker) * [:link:](breeze/breeze.d.ts) [Breeze](http://www.breezejs.com) by [Boris Yankov](https://github.com/borisyankov), [IdeaBlade](https://github.com/IdeaBlade/Breeze) * [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby) * [:link:](browserify/browserify.d.ts) [Browserify](http://browserify.org) by [Andrew Gaspar](https://github.com/AndrewGaspar) @@ -176,6 +176,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](flipsnap/flipsnap.d.ts) [flipsnap.js](http://pxgrid.github.io/js-flipsnap) by [kubosho](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki) * [:link:](flot/jquery.flot.d.ts) [Flot](http://www.flotcharts.org) by [Matt Burland](https://github.com/burlandm) * [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Douglas Eichelberger](https://github.com/dduugg) +* [:link:](form-data/form-data.d.ts) [form-data](https://github.com/felixge/node-form-data) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov) * [:link:](fpsmeter/FPSMeter.d.ts) [FPSmeter](http://darsa.in/fpsmeter) by [Aaron Lampros](http://github.com/alampros) * [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds) @@ -196,8 +197,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](google.analytics/ga.d.ts) [Google Analytics (Classic and Universal)](https://developers.google.com/analytics/devguides/collection/gajs) by [Ronnie Haakon Hegelund](http://ronniehegelund.blogspot.dk), [Pat Kujawa](http://patkujawa.com) * [:link:](gapi/gapi.d.ts) [Google API Client](https://code.google.com/p/google-api-javascript-client) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](google.feeds/google.feed.api.d.ts) [Google Feed Apis](https://developers.google.com/feed) by [RodneyJT](https://github.com/RodneyJT) -* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone) * [:link:](googlemaps/google.maps.d.ts) [Google Geolocation](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk) +* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone) * [:link:](gapi.pagespeedonline/gapi.pagespeedonline.d.ts) [Google Page Speed Online Api](https://developers.google.com/speed/pagespeed) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73) * [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy) @@ -490,7 +491,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](react-addons/react-addons.d.ts) [React with Addons 0.12.RC](http://facebook.github.io/react) by [Asana](https://asana.com) * [:link:](readdir-stream/readdir-stream.d.ts) [readdir-stream](https://github.com/logicalparadox/readdir-stream) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal) +* [:link:](ref/ref.d.ts) [ref](https://github.com/TooTallNate/ref) by [Paul Loyd](https://github.com/loyd) * [:link:](ref-array/ref-array.d.ts) [ref-array](https://github.com/TooTallNate/ref-array) by [Paul Loyd](https://github.com/loyd) +* [:link:](ref-struct/ref-struct.d.ts) [ref-struct](https://github.com/TooTallNate/ref-struct) by [Paul Loyd](https://github.com/loyd) * [:link:](ref-union/ref-union.d.ts) [ref-union](https://github.com/TooTallNate/ref-union) by [Paul Loyd](https://github.com/loyd) * [:link:](threejs/three-renderpass.d.ts) [RenderPass.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/RenderPass.js) by [Satoru Kimura](https://github.com/gyohk) * [:link:](request/request.d.ts) [request](https://github.com/mikeal/request) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [bonnici](https://github.com/bonnici), [Bart van der Schoor](https://github.com/Bartvds) diff --git a/form-data/form-data.d.ts b/form-data/form-data.d.ts index af0f2d799..0f22b8ff5 100644 --- a/form-data/form-data.d.ts +++ b/form-data/form-data.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fibers +// Type definitions for form-data // Project: https://github.com/felixge/node-form-data // Definitions by: Carlos Ballesteros Velasco // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/ref-struct/ref-struct.d.ts b/ref-struct/ref-struct.d.ts index 7c2019655..2a7ac02e9 100644 --- a/ref-struct/ref-struct.d.ts +++ b/ref-struct/ref-struct.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ref-union +// Type definitions for ref-struct // Project: https://github.com/TooTallNate/ref-struct // Definitions by: Paul Loyd // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/ref/ref.d.ts b/ref/ref.d.ts index 86e7840be..5967ea374 100644 --- a/ref/ref.d.ts +++ b/ref/ref.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ref-union +// Type definitions for ref // Project: https://github.com/TooTallNate/ref // Definitions by: Paul Loyd // Definitions: https://github.com/borisyankov/DefinitelyTyped From 800a7047cf275cc9f695cbd116748cd408a09d6d Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 3 Nov 2014 18:45:14 +0900 Subject: [PATCH 078/135] fix invalid version naming --- CONTRIBUTORS.md | 16 ++++++++-------- assertion-error/assertion-error.d.ts | 2 +- buffer-equal/buffer-equal.d.ts | 2 +- business-rules-engine/business-rules-engine.d.ts | 2 +- canvasjs/canvasjs.d.ts | 2 +- casperjs/casperjs.d.ts | 2 +- chai-fuzzy/chai-fuzzy.d.ts | 2 +- jasmine-matchers/jasmine-matchers.d.ts | 2 +- node-azure/azure.d.ts | 10 +++++----- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 7bbcd3503..ba5ef048f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -37,7 +37,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](arbiter/Arbiter.d.ts) [Arbiter.js](http://arbiterjs.com) by [Arash Shakery](https://github.com/arash16) * [:link:](asciify/asciify.d.ts) [asciify](https://www.npmjs.org/package/asciify) by [Alan Norbauer](http://alan.norbauer.com) * [:link:](assert/assert.d.ts) [assert and power-assert](https://github.com/Jxck/assert) by [vvakame](https://github.com/vvakame) -* [:link:](assertion-error/assertion-error.d.ts) [assertion-error 1.0 0](https://github.com/chaijs/assertion-error) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](assertion-error/assertion-error.d.ts) [assertion-error](https://github.com/chaijs/assertion-error) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](async/async.d.ts) [Async](https://github.com/caolan/async) by [Boris Yankov](https://github.com/borisyankov) * [:link:](atmosphere/atmosphere.d.ts) [Atmosphere](https://github.com/Atmosphere/atmosphere-javascript) by [Kai Toedter](https://github.com/toedter) * [:link:](atom/atom.d.ts) [Atom](https://atom.io) by [vvakame](https://github.com/vvakame) @@ -45,7 +45,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](auth0/auth0.d.ts) [Auth0.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) * [:link:](auth0.widget/auth0.widget.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) * [:link:](aws-sdk/aws-sdk.d.ts) [aws-sdk](https://github.com/aws/aws-sdk-js) by [midknight41](https://github.com/midknight41) -* [:link:](node-azure/azure.d.ts) [Azure SDK for Node -](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](node-azure/azure.d.ts) [Azure SDK for Node](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT) * [:link:](backbone/backbone.d.ts) [Backbone](http://backbonejs.org) by [Boris Yankov](https://github.com/borisyankov), [Natan Vivo](https://github.com/nvivo) * [:link:](backbone-relational/backbone-relational.d.ts) [Backbone-relational](http://backbonerelational.org) by [Eirik Hoem](https://github.com/eirikhm) * [:link:](backgrid/backgrid.d.ts) [Backgrid](http://backgridjs.com) by [Jeremy Lujan](https://github.com/jlujan) @@ -69,17 +69,17 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby) * [:link:](browserify/browserify.d.ts) [Browserify](http://browserify.org) by [Andrew Gaspar](https://github.com/AndrewGaspar) * [:link:](bucks/bucks.d.ts) [bucks.js](https://github.com/CyberAgent/bucks.js) by [Shunsuke Ohtani](https://github.com/zaneli) -* [:link:](buffer-equal/buffer-equal.d.ts) [buffer-equal 1.0 0](https://github.com/substack/node-buffer-equal) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](buffer-equal/buffer-equal.d.ts) [buffer-equal](https://github.com/substack/node-buffer-equal) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](bl/bl.d.ts) [BufferList](https://github.com/rvagg/bl) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](bufferstream/bufferstream.d.ts) [bufferstream](https://github.com/dodo/node-bufferstream) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine -](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) +* [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) * [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com) -* [:link:](canvasjs/canvasjs.d.ts) [CanvasJS v1.5.1 GA](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5) +* [:link:](canvasjs/canvasjs.d.ts) [CanvasJS](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5) * [:link:](threejs/three-canvasrenderer.d.ts) [CanvasRenderer.js](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js) by [Satoru Kimura](https://github.com/gyohk) -* [:link:](casperjs/casperjs.d.ts) [CasperJS v1.0.0 API](http://casperjs.org) by [Jed Mao](https://github.com/jedmao) +* [:link:](casperjs/casperjs.d.ts) [CasperJS](http://casperjs.org) by [Jed Mao](https://github.com/jedmao) * [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Hunsaker](https://github.com/jedhunsaker), [Bart van der Schoor](https://github.com/Bartvds) * [:link:](chai-datetime/chai-datetime.d.ts) [chai-datetime](https://github.com/gaslight/chai-datetime.git) by [Cliff Burger](https://github.com/cliffburger) -* [:link:](chai-fuzzy/chai-fuzzy.d.ts) [chai-fuzzy 1.3.0 assert style](http://chaijs.com/plugins/chai-fuzzy) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](chai-fuzzy/chai-fuzzy.d.ts) [chai-fuzzy](http://chaijs.com/plugins/chai-fuzzy) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](chai-jquery/chai-jquery.d.ts) [chai-jquery](https://github.com/chaijs/chai-jquery) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) * [:link:](chalk/chalk.d.ts) [chalk](https://github.com/sindresorhus/chalk) by [Diullei Gomes](https://github.com/Diullei), [Bart van der Schoor](https://github.com/Bartvds) * [:link:](chartjs/chart.d.ts) [Chart.js](https://github.com/nnnick/Chart.js) by [Steve Fenton](https://github.com/Steve-Fenton) @@ -247,7 +247,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jasmine-data_driven_tests/jasmine-data_driven_tests.d.ts) [Jasmine Data Driven Tests](https://github.com/gburghardt/jasmine-data_driven_tests) by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon) * [:link:](jasmine-fixture/jasmine-fixture.d.ts) [Jasmine-fixture](https://github.com/searls/jasmine-fixture) by [Craig Brett](https://github.com/craigbrett17) * [:link:](jasmine-jquery/jasmine-jquery.d.ts) [Jasmine-JQuery](https://github.com/velesin/jasmine-jquery) by [Gregor Stamac](https://github.com/gstamac) -* [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers v0.2.1 API](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](jdataview/jdataview.d.ts) [jDataView](https://github.com/jDataView/jDataView) by [Ingvar Stepanyan](https://github.com/RReverser) * [:link:](jest/jest.d.ts) [Jest](http://facebook.github.io/jest) by [Asana](https://asana.com) * [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds) diff --git a/assertion-error/assertion-error.d.ts b/assertion-error/assertion-error.d.ts index 5b63d63cf..08217c9e5 100644 --- a/assertion-error/assertion-error.d.ts +++ b/assertion-error/assertion-error.d.ts @@ -1,4 +1,4 @@ -// Type definitions for assertion-error 1.0 0 +// Type definitions for assertion-error 1.0.0 // Project: https://github.com/chaijs/assertion-error // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/buffer-equal/buffer-equal.d.ts b/buffer-equal/buffer-equal.d.ts index a3597c684..d6af4f813 100644 --- a/buffer-equal/buffer-equal.d.ts +++ b/buffer-equal/buffer-equal.d.ts @@ -1,4 +1,4 @@ -// Type definitions for buffer-equal 1.0 0 +// Type definitions for buffer-equal 0.0.1 // Project: https://github.com/substack/node-buffer-equal // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/business-rules-engine/business-rules-engine.d.ts b/business-rules-engine/business-rules-engine.d.ts index 7c17714cc..7ca758eb8 100644 --- a/business-rules-engine/business-rules-engine.d.ts +++ b/business-rules-engine/business-rules-engine.d.ts @@ -1,4 +1,4 @@ -// Type definitions for business-rules-engine - v1.0.20 +// Type definitions for business-rules-engine v1.0.20 // Project: https://github.com/rsamec/form // Definitions by: Roman Samec // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/canvasjs/canvasjs.d.ts b/canvasjs/canvasjs.d.ts index f572ce329..6de602c7e 100644 --- a/canvasjs/canvasjs.d.ts +++ b/canvasjs/canvasjs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for CanvasJS v1.5.1 GA +// Type definitions for CanvasJS v1.5.1 // Project: http://canvasjs.com/ // Definitions by: Mark Overholt // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/casperjs/casperjs.d.ts b/casperjs/casperjs.d.ts index 6cb40a6a6..f03840380 100644 --- a/casperjs/casperjs.d.ts +++ b/casperjs/casperjs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for CasperJS v1.0.0 API +// Type definitions for CasperJS v1.0.0 // Project: http://casperjs.org/ // Definitions by: Jed Mao // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/chai-fuzzy/chai-fuzzy.d.ts b/chai-fuzzy/chai-fuzzy.d.ts index 0cbb1741b..acfb515f4 100644 --- a/chai-fuzzy/chai-fuzzy.d.ts +++ b/chai-fuzzy/chai-fuzzy.d.ts @@ -1,4 +1,4 @@ -// Type definitions for chai-fuzzy 1.3.0 assert style +// Type definitions for chai-fuzzy 1.3.0 // Project: http://chaijs.com/plugins/chai-fuzzy // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/jasmine-matchers/jasmine-matchers.d.ts b/jasmine-matchers/jasmine-matchers.d.ts index 059b8075e..c7f2018e4 100644 --- a/jasmine-matchers/jasmine-matchers.d.ts +++ b/jasmine-matchers/jasmine-matchers.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jasmine-matchers v0.2.1 API +// Type definitions for jasmine-matchers v0.2.1 // Project: https://github.com/uxebu/jasmine-matchers // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/node-azure/azure.d.ts b/node-azure/azure.d.ts index 5328dd937..91c5c0bf0 100644 --- a/node-azure/azure.d.ts +++ b/node-azure/azure.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Azure SDK for Node - v0.9.16 +// Type definitions for Azure SDK for Node v0.9.16 // Project: https://github.com/WindowsAzure/azure-sdk-for-node // Definitions by: Andrew Gaspar , // Anti Veeranna , @@ -159,13 +159,13 @@ declare module "azure" { //#region Service Methods /** - * Gets the properties of a storage accounts Blob service, including Azure Storage Analytics. + * Gets the properties of a storage account�s Blob service, including Azure Storage Analytics. */ getServiceProperties(callback: StorageServicePropertiesCallback): void; getServiceProperties(options: TimeoutIntervalOptions, callback: StorageServicePropertiesCallback): void; /** - * Sets the properties of a storage accounts Blob service, including Azure Storage Analytics. + * Sets the properties of a storage account�s Blob service, including Azure Storage Analytics. * You can also use this operation to set the default request version for all incoming requests that do not have a version specified. */ setServiceProperties(serviceProperties: StorageServiceProperties, callback: StorageCallbackVoid): void; @@ -521,13 +521,13 @@ declare module "azure" { //#region Service Methods /** - * Gets the properties of a storage accounts Blob service, including Azure Storage Analytics. + * Gets the properties of a storage account�s Blob service, including Azure Storage Analytics. */ getServiceProperties(callback: StorageServicePropertiesCallback): void; getServiceProperties(options: TimeoutIntervalOptions, callback: StorageServicePropertiesCallback): void; /** - * Sets the properties of a storage accounts Blob service, including Azure Storage Analytics. + * Sets the properties of a storage account�s Blob service, including Azure Storage Analytics. * You can also use this operation to set the default request version for all incoming requests that do not have a version specified. */ setServiceProperties(serviceProperties: StorageServiceProperties, callback: StorageCallbackVoid): void; From 381882fd9e78754a3bbb522810b6a1a0746f268c Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 3 Nov 2014 19:12:43 +0900 Subject: [PATCH 079/135] fix jquery.ui.layout/jquery.ui.layout.d.ts header --- CONTRIBUTORS.md | 2 +- jquery.ui.layout/jquery.ui.layout.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ba5ef048f..da1fb51a1 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -275,6 +275,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.tinyscrollbar/jquery.tinyscrollbar.d.ts) [jQuery tinyscrollbar](http://baijs.nl/tinyscrollbar) by [Christiaan Rakowski](https://github.com/csrakowski) * [:link:](jquery.tooltipster/jquery.tooltipster.d.ts) [jQuery Tooltipster](https://github.com/iamceege/tooltipster) by [Patrick Magee](https://github.com/pjmagee) * [:link:](jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts) [jQuery UI DateTimePicker](http://trentrichardson.com/examples/timepicker) by [dougajmcdonald](https://github.com/dougajmcdonald) +* [:link:](jquery.ui.layout/jquery.ui.layout.d.ts) [jQuery UI Layout Plug-in](http://layout.jquery-dev.net) by [Steve Fenton](https://github.com/Steve-Fenton) * [:link:](jquery.timepicker/jquery.timepicker.d.ts) [jQuery UI Timepicker](http://fgelinas.com/code/timepicker) by [Anwar Javed](https://github.com/anwarjaved) * [:link:](jquery-handsontable/jquery-handsontable.d.ts) [jquery-handsontable](http://handsontable.com) by [Ted John](https://github.com/intelorca) * [:link:](jquery.menuaim/jquery.menuaim.d.ts) [jQuery-menu-aim](https://github.com/kamens/jQuery-menu-aim) by [Robert Fonseca-Ensor](http://www.robfe.com) @@ -309,7 +310,6 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.validation/jquery.validation.d.ts) [jquery.validation](http://jqueryvalidation.org) by [François de Campredon](https://github.com/fdecampredon), [Johj Reilly](https://github.com/johnnyreilly) * [:link:](jquery.timer/jquery.timer.d.ts) [jQueryTimer](https://github.com/jchavannes/jquery-timer) by [Joshua Strobl](https://github.com/JoshStrobl) * [:link:](jquery.total-storage/jquery.total-storage.d.ts) [jQueryTotalStorage](https://github.com/Upstatement/jquery-total-storage) by [Jeremy Brooks](https://github.com/JeremyCBrooks) -* [:link:](jquery.ui.layout/jquery.ui.layout.d.ts) [jQueryUI](http://layout.jquery-dev.net) by [Steve Fenton](https://github.com/Steve-Fenton) * [:link:](jqueryui/jqueryui.d.ts) [jQueryUI](http://jqueryui.com) by [Boris Yankov](https://github.com/borisyankov), [John Reilly](https://github.com/johnnyreilly) * [:link:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) * [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds) diff --git a/jquery.ui.layout/jquery.ui.layout.d.ts b/jquery.ui.layout/jquery.ui.layout.d.ts index 01ec42570..b15dd3386 100644 --- a/jquery.ui.layout/jquery.ui.layout.d.ts +++ b/jquery.ui.layout/jquery.ui.layout.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jQueryUI 1.9 +// Type definitions for jQuery UI Layout Plug-in // Project: http://layout.jquery-dev.net/ // Definitions by: Steve Fenton // Definitions: https://github.com/borisyankov/DefinitelyTyped From a3c57a84a51084b829196437416e5eed8d665496 Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Wed, 5 Nov 2014 15:01:00 +0530 Subject: [PATCH 080/135] Added test file --- jquery.rowGrid/jquery.rowGrid-tests.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 jquery.rowGrid/jquery.rowGrid-tests.ts diff --git a/jquery.rowGrid/jquery.rowGrid-tests.ts b/jquery.rowGrid/jquery.rowGrid-tests.ts new file mode 100644 index 000000000..be4cb443e --- /dev/null +++ b/jquery.rowGrid/jquery.rowGrid-tests.ts @@ -0,0 +1,24 @@ +/// +/// + +/* + * Testing different options + */ + +var options = { + minMargin: 10, + maxMargin: 35, + itemSelector: ".item" +}; + +$(".container").rowGrid(options); + + +/* + * Test endless scrolling + */ + +// append new items +$(".container").append("

"); +// arrange appended items +$(".container").rowGrid("appended"); \ No newline at end of file From f71c594fb6fdb84bf7fd28d8cda58a5ac40584a1 Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Wed, 5 Nov 2014 15:08:15 +0530 Subject: [PATCH 081/135] Fixed the comment --- jquery.rowGrid/jquery.rowGrid-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.rowGrid/jquery.rowGrid-tests.ts b/jquery.rowGrid/jquery.rowGrid-tests.ts index be4cb443e..cb11d6596 100644 --- a/jquery.rowGrid/jquery.rowGrid-tests.ts +++ b/jquery.rowGrid/jquery.rowGrid-tests.ts @@ -2,7 +2,7 @@ /// /* - * Testing different options + * Test different options */ var options = { From de91990ef21174f371ab250f68ce6ab5fb641285 Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Mon, 3 Nov 2014 19:50:00 +0530 Subject: [PATCH 082/135] Added interface for rowGrid.js --- jquery.rowGrid/jquery.rowGrid.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 jquery.rowGrid/jquery.rowGrid.d.ts diff --git a/jquery.rowGrid/jquery.rowGrid.d.ts b/jquery.rowGrid/jquery.rowGrid.d.ts new file mode 100644 index 000000000..4b136d2ba --- /dev/null +++ b/jquery.rowGrid/jquery.rowGrid.d.ts @@ -0,0 +1,17 @@ +// Type definitions for jQuery rowGrid.js plugin (v1.0.2) +// Project: https://github.com/brunjo/rowGrid.js +// Definitions by: Vinayak Garg +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface JQueryRowGridJSOptions { + minMargin?: number; + maxMargin?: number; + itemSelector: string; +} + +interface JQuery { + rowGrid(options?: JQueryRowGridJSOptions): JQuery; + rowGrid(appended: string): JQuery; +} \ No newline at end of file From b4145190265c07661b17b0c15a6fa127fd4d39ba Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Mon, 3 Nov 2014 20:02:55 +0530 Subject: [PATCH 083/135] Added name in CONTRIBUTORS.md --- CONTRIBUTORS.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9d27a0d1d..639abfb7a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -63,7 +63,7 @@ All definitions files include a header with the author and editors, so at some p * [Clone](https://github.com/pvorb/node-clone) (by [Kieran Simpson](https://github.com/kierans)) * [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) * [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem) and [vvakame](https://github.com/vvakame)) -* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) * [cookie](https://github.com/jshttp/cookie) (by [Pine Mizune](https://github.com/jshttp/cookie)) * [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/)) * [Cordovarduino](https://github.com/stereolux/cordovarduino) (by [Hendrik Maus](https://github.com/hendrikmaus)) @@ -207,6 +207,7 @@ All definitions files include a header with the author and editors, so at some p * [jQuery.pnotify](http://sciactive.github.io/pnotify/) (by [David Sichau](https://github.com/DavidSichau/)) * [jQuery.postMessage](http://benalman.com/projects/jquery-postmessage-plugin/) (by [Junle Li](https://github.com/lijunle)) * [jQuery.prettyphoto](https://github.com/scaron/prettyphoto) (by [Paul Gaske](https://github.com/pgaske)) +* [jQuery.rowGrid](https://github.com/brunjo/rowGrid.js) (by [Vinayak Garg](https://github.com/vinayak-garg)) * [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/)) * [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/)) * [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) (by [Blake Niemyjski](https://github.com/niemyjski)) @@ -248,7 +249,7 @@ All definitions files include a header with the author and editors, so at some p * [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC)) * [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov)) * [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel)) -* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) +* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) * [Knockout Secure Binding](https://github.com/brianmhunt/knockout-secure-binding) (by [Pine Mizune](https://github.com/pine613)) * [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig)) * [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising)) @@ -326,9 +327,9 @@ All definitions files include a header with the author and editors, so at some p * [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin)) * [PeerJS](http://peerjs.com/) (by [Toshiya Nakakura](https://github.com/nakakura)) * [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame)) -* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) -* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613)) -* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) +* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) +* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613)) +* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) * [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov)) * [Physijs](http://chandlerprall.github.io/Physijs/) (by [gyoh_k](https://github.com/gyohk)) * [Pickadate.js](https://github.com/amsul/pickadate.js) (by [Adi Dahiya](https://github.com/adidahiya)) From e9fa156a9c870c34dc98243e9bf9d20b83ecac1b Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Wed, 5 Nov 2014 15:01:00 +0530 Subject: [PATCH 084/135] Added test file --- jquery.rowGrid/jquery.rowGrid-tests.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 jquery.rowGrid/jquery.rowGrid-tests.ts diff --git a/jquery.rowGrid/jquery.rowGrid-tests.ts b/jquery.rowGrid/jquery.rowGrid-tests.ts new file mode 100644 index 000000000..be4cb443e --- /dev/null +++ b/jquery.rowGrid/jquery.rowGrid-tests.ts @@ -0,0 +1,24 @@ +/// +/// + +/* + * Testing different options + */ + +var options = { + minMargin: 10, + maxMargin: 35, + itemSelector: ".item" +}; + +$(".container").rowGrid(options); + + +/* + * Test endless scrolling + */ + +// append new items +$(".container").append("
"); +// arrange appended items +$(".container").rowGrid("appended"); \ No newline at end of file From 8e017781ba31f23baf611a556db312a0b5545bd6 Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Wed, 5 Nov 2014 15:08:15 +0530 Subject: [PATCH 085/135] Fixed the comment --- jquery.rowGrid/jquery.rowGrid-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.rowGrid/jquery.rowGrid-tests.ts b/jquery.rowGrid/jquery.rowGrid-tests.ts index be4cb443e..cb11d6596 100644 --- a/jquery.rowGrid/jquery.rowGrid-tests.ts +++ b/jquery.rowGrid/jquery.rowGrid-tests.ts @@ -2,7 +2,7 @@ /// /* - * Testing different options + * Test different options */ var options = { From f4c08ac9ea9ab6ed3f29b8f74082cf5d011eeece Mon Sep 17 00:00:00 2001 From: armorik83 Date: Thu, 6 Nov 2014 00:12:16 +0900 Subject: [PATCH 086/135] add yeoman-generator/yeoman-generator.d.ts --- yeoman-generator/yeoman-generator-tests.ts | 114 +++++++++++++++++ yeoman-generator/yeoman-generator.d.ts | 141 +++++++++++++++++++++ 2 files changed, 255 insertions(+) create mode 100644 yeoman-generator/yeoman-generator-tests.ts create mode 100644 yeoman-generator/yeoman-generator.d.ts diff --git a/yeoman-generator/yeoman-generator-tests.ts b/yeoman-generator/yeoman-generator-tests.ts new file mode 100644 index 000000000..84f007206 --- /dev/null +++ b/yeoman-generator/yeoman-generator-tests.ts @@ -0,0 +1,114 @@ +/// +import yeoman = require('yeoman-generator'); + +var base = yeoman.generators.Base; +var namedBase = yeoman.generators.NamedBase; + +var generator = base.extend({ + initializing: function() { + return; + }, + writing: { + app: function() { + return; + }, + other: function() { + return; + } + }, + end: function() { + return; + } +}); + +generator.argument('name', { + desc: 'desc', + required: true, + optional: true, + type: 'any', + defaults: 'any', +}); + +var compose = generator.composeWith('namespace', 'any', { + local: 'local', + link: 'link' +}); + +compose.defaultFor('name'); +compose.destinationRoot('rootPath') === 'string'; +compose.determineAppname(); +compose.getCollisionFilter()('output'); +compose.hookFor('name', { + as: 'string', + args: 'any', + options: 'any' +}); +compose.option('name', { + alias: 'string', + defaults: 'any', + desc: 'string', + hide: true, + type: 'any' +}); +var returnString: boolean; +returnString = compose.rootGeneratorName() === 'string'; +compose.run('args'); +compose.run('args', () => { + return; +}); +compose.runHooks(() => { + return; +}); +returnString = compose.sourceRoot('rootPath') === 'string'; + +var assert = yeoman.assert; + +assert.file('path'); +assert.file(['paths', 'paths']); +assert.fileContent('file', /.*/); +assert.fileContent([ + ['string', /.*/], + ['string', /.*/], + ['string', /.*/] +]); +assert.files([ + ['string', /.*/], + 'string', + ['string', /.*/], + 'string' +]); +assert.implement('subject', 'methods'); +assert.noFile('file'); +assert.noFileContent('file', /.*/); +assert.noFileContent([ + ['string', /.*/], + ['string', /.*/], + ['string', /.*/] +]); +assert.noImplement('subject', 'methods'); +assert.textEqual('value', 'expected'); + +var test = yeoman.test; +var dummyGen = test.createDummyGenerator(); +dummyGen.determineAppname(); + +var createdGen = test.createGenerator('name', ['any', 'amy'], 'args', 'options'); +createdGen.determineAppname(); + +test.decorate('context', 'method', () => { + return; // replacement +}, 'options'); +test.gruntfile('options', () => { + return; // done +}); +test.mockPrompt(createdGen, 'answers'); +test.registerDependencies(['dependencies', 'dependencies']); +test.restore(); +var runContext = test.run('generator'); + +runContext.async()(); +runContext.inDir('dirPath') + .withArguments('args') + .withGenerators(['deps', 'deps']) + .withOptions('opts') + .withPrompts('answers'); diff --git a/yeoman-generator/yeoman-generator.d.ts b/yeoman-generator/yeoman-generator.d.ts new file mode 100644 index 000000000..aed7a8f03 --- /dev/null +++ b/yeoman-generator/yeoman-generator.d.ts @@ -0,0 +1,141 @@ +// Type definitions for yeoman-generator +// Project: https://github.com/yeoman/generator +// Definitions by: Kentaro Okuno +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module yo { + export interface IYeomanGenerator { + argument(name: string, config: IArgumentConfig): void; + composeWith(namespace: string, options: any, settings?: IComposeSetting): IYeomanGenerator; + defaultFor(name: string): void; + destinationRoot(rootPath: string): string; + determineAppname(): void; + getCollisionFilter(): (output: any) => void; + hookFor(name: string, config: IHookConfig): void; + option(name: string, config: IYeomanGeneratorOption): void; + rootGeneratorName(): string; + run(args?: any): void; + run(args: any, callback?: Function): void; + runHooks(callback?: Function): void; + sourceRoot(rootPath: string): string; + } + + export interface IArgumentConfig { + desc: string; + required: boolean; + optional: boolean; + type: any; + defaults: any; + } + + export interface IComposeSetting { + local?: string; + link?: string; + } + + export interface IHookConfig { + as: string; + args: any; + options: any; + } + + export interface IYeomanGeneratorOption { + alias: string; + defaults: any; + desc: string; + hide: boolean; + type: any; + } + + export interface IQueueProps { + initializing: () => void; + prompting?: () => void; + configuring?: () => void; + default?: () => void; + writing: { + [target: string]: () => void; + }; + conflicts?: () => void; + install?: () => void; + end: () => void; + } + + export interface IBase { + new(args: string, options: any): IYeomanGenerator; + new(args: string[], options: any): IYeomanGenerator; + extend(protoProps: IQueueProps, staticProps?: any): IYeomanGenerator; + } + + export interface INamedBase { + new(args: string, options: any): IYeomanGenerator; + new(args: string[], options: any): IYeomanGenerator; + } + + export interface IAssert { + file(path: string): void; + file(paths: string[]): void; + fileContent(file: string, reg: RegExp): void; + + /** @param {[String, RegExp][]} pairs */ + fileContent(pairs: any[][]): void; + + /** @param {[String, RegExp][]|String[]} pairs */ + files(pairs: any[]): void; + + /** + * @param {Object} subject + * @param {Object|Array} methods + */ + implement(subject: any, methods: any): void; + noFile(file: string): void; + noFileContent(file: string, reg: RegExp): void; + + /** @param {[String, RegExp][]} pairs */ + noFileContent(pairs: any[][]): void; + + /** + * @param {Object} subject + * @param {Object|Array} methods + */ + noImplement(subject: any, methods: any): void; + + textEqual(value: string, expected: string): void; + } + + export interface ITestHelper { + createDummyGenerator(): IYeomanGenerator; + createGenerator(name: string, dependencies: any[], args: any, options: any): IYeomanGenerator; + decorate(context: any, method: string, replacement: Function, options: any): void; + gruntfile(options: any, done: Function): void; + mockPrompt(generator: IYeomanGenerator, answers: any): void; + registerDependencies(dependencies: string[]): void; + restore(): void; + + /** @param {String|Function} generator */ + run(generator: any): IRunContext; + } + + export interface IRunContext { + async(): Function; + inDir(dirPath: string): IRunContext; + + /** @param {String|String[]} args */ + withArguments(args: any): IRunContext; + withGenerators(dependencies: string[]): IRunContext; + withOptions(options: any): IRunContext; + withPrompts(answers: any): IRunContext; + } + + /** @type file file-utils */ + var file: any; + var assert: IAssert; + var test: ITestHelper; + var generators: { + Base: IBase; + NamedBase: INamedBase; + }; +} + +declare module "yeoman-generator" { + export = yo; +} From 0ddb142d5104efae4b45b76abe6d788396b498ee Mon Sep 17 00:00:00 2001 From: armorik83 Date: Thu, 6 Nov 2014 01:04:01 +0900 Subject: [PATCH 087/135] add yosay/yosay.d.ts --- yosay/yosay-tests.ts | 3 +++ yosay/yosay.d.ts | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 yosay/yosay-tests.ts create mode 100644 yosay/yosay.d.ts diff --git a/yosay/yosay-tests.ts b/yosay/yosay-tests.ts new file mode 100644 index 000000000..257b546ea --- /dev/null +++ b/yosay/yosay-tests.ts @@ -0,0 +1,3 @@ +/// +import yosay = require('yosay'); +yosay('Welcome to the generator!', {maxLength: 20}); \ No newline at end of file diff --git a/yosay/yosay.d.ts b/yosay/yosay.d.ts new file mode 100644 index 000000000..a46049e10 --- /dev/null +++ b/yosay/yosay.d.ts @@ -0,0 +1,9 @@ +// Type definitions for yosay +// Project: https://github.com/yeoman/yosay +// Definitions by: Kentaro Okuno +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'yosay' { + function yosay(message?: string, options?: {maxLength: number}): string; + export = yosay; +} \ No newline at end of file From 779d3e58b6d77cb0f1bcb9f7b5b56013a4ed99ae Mon Sep 17 00:00:00 2001 From: in-async Date: Thu, 6 Nov 2014 01:38:27 +0900 Subject: [PATCH 088/135] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AE=E6=9B=B4=E6=96=B0=E9=80=94=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- angularfire/angularfire-tests.ts | 45 ++++++++++++++++++++------- angularfire/angularfire.d.ts | 52 ++++++++++++++++++++++++-------- 2 files changed, 74 insertions(+), 23 deletions(-) diff --git a/angularfire/angularfire-tests.ts b/angularfire/angularfire-tests.ts index eced9d7fe..74a6c5a30 100644 --- a/angularfire/angularfire-tests.ts +++ b/angularfire/angularfire-tests.ts @@ -3,7 +3,7 @@ var myapp = angular.module("myapp", ["firebase"]); interface AngularFireScope extends ng.IScope { - items: AngularFire; + items: AngularFireArray; remoteItems: RemoteItems; } @@ -14,23 +14,46 @@ interface RemoteItems { var url = "https://myapp.firebaseio.com"; myapp.controller("MyController", ["$scope", "$firebase", - function($scope: AngularFireScope, $firebase: AngularFireService) { - $scope.items = $firebase(new Firebase(url)); + function ($scope: AngularFireScope, $firebase: AngularFireService) { + var sync = $firebase(new Firebase(url)); + + sync.$asArray() + .$loaded() + .then(function (list: AngularFireArray) { + console.log("list has " + list.length + " items"); + + list.$add({ foo: "bar" }).then(function (ref) { + ref.on("value", function (snapshot) { + if (snapshot.val().foo !== "bar") throw "error"; + }); + }); + + var item = list.$getRecord("foo"); + list.$remove("foo"); + list.$remove(0); + list.$save(); + }); + sync.$asObject() + + + $scope.items = sync.$asArray(); + $scope.object = sync.$asObject(); + $scope.items.$add({ foo: "bar" }); $scope.items.$remove("foo"); $scope.items.$remove(); $scope.items.$save(); var child = $scope.items.$child("foo"); child.$remove(); - $scope.items.$set({ bar: "baz" }); + $scope.items.$set({ bar: "baz" }); var keys = $scope.items.$getIndex(); - keys.forEach(function(key, i) { + keys.forEach(function (key, i) { console.log(i, ($scope.items)[key]); }); - $scope.items.$on("loaded", function() { + $scope.items.$on("loaded", function () { console.log("Initial data received!"); }); - $scope.items.$on("change", function() { + $scope.items.$on("change", function () { console.log("A remote change was applied locally!"); }); $scope.items.$off('loaded'); @@ -39,7 +62,7 @@ myapp.controller("MyController", ["$scope", "$firebase", } $scope.items.$bind($scope, "remoteItems"); $scope.remoteItems.bar = "foo"; - $scope.items.$bind($scope, "remote").then(function(unbind) { + $scope.items.$bind($scope, "remote").then(function (unbind) { unbind(); $scope.remoteItems.bar = "foo"; }); @@ -55,7 +78,7 @@ interface AngularFireAuthScope extends ng.IScope { } myapp.controller("MyAuthController", ["$scope", "$firebaseSimpleLogin", - function($scope: AngularFireAuthScope, $firebaseSimpleLogin: AngularFireAuthService) { + function ($scope: AngularFireAuthScope, $firebaseSimpleLogin: AngularFireAuthService) { var dataRef = new Firebase(url); $scope.loginObj = $firebaseSimpleLogin(dataRef); $scope.loginObj.$getCurrentUser().then(_ => { @@ -65,9 +88,9 @@ myapp.controller("MyAuthController", ["$scope", "$firebaseSimpleLogin", $scope.loginObj.$login('password', { email: email, password: password - }).then(function(user) { + }).then(function (user) { console.log('Logged in as: ', user.uid); - }, function(error) { + }, function (error) { console.error('Login failed: ', error); }); $scope.loginObj.$logout(); diff --git a/angularfire/angularfire.d.ts b/angularfire/angularfire.d.ts index 3f2b0aa10..f81ac243f 100644 --- a/angularfire/angularfire.d.ts +++ b/angularfire/angularfire.d.ts @@ -1,4 +1,4 @@ -// Type definitions for AngularFire 0.6.0 +// Type definitions for AngularFire 0.8.2 and Firebase Simple Login 1.6.4 // Project: http://angularfire.com // Definitions by: Dénes Harmath // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -7,25 +7,53 @@ /// interface AngularFireService { - (firebase: Firebase): AngularFire; + (firebase: Firebase, config?:any): AngularFire; } interface AngularFire { - $add(value: any): void; - $remove(key?: string): void; - $save(key?: string): void; - $child(key: string): AngularFire; - $set(value: any): void; - $getIndex(): string[]; - $on(eventType: string, callback: (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void, cancelCallback?: ()=> void, context?: Object): (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void; - $off(eventType?: string, callback?: (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void, cancelCallback?: ()=> void, context?: Object): (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void; - $bind($scope: ng.IScope, modelName: string): ng.IPromise; + $asArray(): AngularFireArray; + $asObject(): AngularFireObject; + $ref(): Firebase; + $push(data: any): ng.IPromise; + $set(key: string, data: any): ng.IPromise; + $set(data: any): ng.IPromise; + $remove(key?: string): ng.IPromise; + $update(key: string, data: any): ng.IPromise; + $update(data: any): ng.IPromise; + $transaction(updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; } interface AngularFireObject { + $id: string; $priority: number; + $value: any; + $save(): ng.IPromise; + $loaded(): ng.IPromise; + $inst(): Firebase; + $bindTo(scope: ng.IScope, varName: string): ng.IPromise; + $watch(callback: Function, context: any): Function; + $destroy(): void; + + $extendFactory(ChildClass: Object, methods?: Object); } +interface AngularFireArray extends Array { + $add(newData: any): ng.IPromise; + $save(recordOrIndex: any): ng.IPromise; + $remove(recordOrIndex: any): ng.IPromise; + $getRecord(key: string): any; + $keyAt(recordOrIndex: any): string; + $indexFor(key: string): number; + $loaded(): ng.IPromise; + $inst(): Firebase; + $watch(cb: (event: string, key: string, prevChild: string) => void, context?: any): Function; + $destroy(): void; + + $extendFactory(ChildClass:Object, methods?:Object); +} + + + interface AngularFireAuthService { (firebase: Firebase): AngularFireAuth; } @@ -34,7 +62,7 @@ interface AngularFireAuth { $getCurrentUser(): ng.IPromise; $login(provider: string, options?: Object): ng.IPromise; $logout(): void; - $createUser(email: string, password: string, noLogin?: boolean): ng.IPromise; + $createUser(email: string, password: string): ng.IPromise; $changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise; $removeUser(email: string, password: string): ng.IPromise; $sendPasswordResetEmail(email: string): ng.IPromise; From 6d29b22607b6ca611a600706991755170ab73780 Mon Sep 17 00:00:00 2001 From: Daniel Phan Date: Wed, 5 Nov 2014 16:25:13 -0800 Subject: [PATCH 089/135] Add d.ts for change-case --- change-case/change-case-tests.ts | 37 ++++++++++++++++++++++++++++++++ change-case/change-case.d.ts | 37 ++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 change-case/change-case-tests.ts create mode 100644 change-case/change-case.d.ts diff --git a/change-case/change-case-tests.ts b/change-case/change-case-tests.ts new file mode 100644 index 000000000..24276654c --- /dev/null +++ b/change-case/change-case-tests.ts @@ -0,0 +1,37 @@ +/// + +import changeCase = require("change-case"); + +var s: string; +var b: boolean; + +s = changeCase.dot(s); +s = changeCase.dotCase(s); +s = changeCase.swap(s); +s = changeCase.swapCase(s); +s = changeCase.path(s); +s = changeCase.pathCase(s); +s = changeCase.upper(s); +s = changeCase.upperCase(s); +s = changeCase.lower(s); +s = changeCase.lowerCase(s); +s = changeCase.camel(s); +s = changeCase.camelCase(s); +s = changeCase.snake(s); +s = changeCase.snakeCase(s); +s = changeCase.title(s); +s = changeCase.titleCase(s); +s = changeCase.param(s); +s = changeCase.paramCase(s); +s = changeCase.pascal(s); +s = changeCase.pascalCase(s); +s = changeCase.constant(s); +s = changeCase.constantCase(s); +s = changeCase.sentence(s); +s = changeCase.sentenceCase(s); +b = changeCase.isUpper(s); +b = changeCase.isUpperCase(s); +b = changeCase.isLower(s); +b = changeCase.isLowerCase(s); +s = changeCase.ucFirst(s); +s = changeCase.upperCaseFirst(s); diff --git a/change-case/change-case.d.ts b/change-case/change-case.d.ts new file mode 100644 index 000000000..e61d70de6 --- /dev/null +++ b/change-case/change-case.d.ts @@ -0,0 +1,37 @@ +// Type definitions for change-case +// Project: https://github.com/blakeembrey/change-case +// Definitions by: Asana +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "change-case" { + function dot(s: string): string; + function dotCase(s: string): string; + function swap(s: string): string; + function swapCase(s: string): string; + function path(s: string): string; + function pathCase(s: string): string; + function upper(s: string): string; + function upperCase(s: string): string; + function lower(s: string): string; + function lowerCase(s: string): string; + function camel(s: string): string; + function camelCase(s: string): string; + function snake(s: string): string; + function snakeCase(s: string): string; + function title(s: string): string; + function titleCase(s: string): string; + function param(s: string): string; + function paramCase(s: string): string; + function pascal(s: string): string; + function pascalCase(s: string): string; + function constant(s: string): string; + function constantCase(s: string): string; + function sentence(s: string): string; + function sentenceCase(s: string): string; + function isUpper(s: string): boolean; + function isUpperCase(s: string): boolean; + function isLower(s: string): boolean; + function isLowerCase(s: string): boolean; + function ucFirst(s: string): string; + function upperCaseFirst(s: string): string; +} From a0e56c27e72009602b8587b696ee42888f8fe5a5 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Thu, 6 Nov 2014 01:17:54 -0500 Subject: [PATCH 090/135] Adds definitions and tests for the Mousetrap global-bind extension --- .../mousetrap-global-bind-tests.ts | 42 +++++++++++++++++++ .../mousetrap-global-bind.d.ts | 11 +++++ 2 files changed, 53 insertions(+) create mode 100644 mousetrap-global-bind/mousetrap-global-bind-tests.ts create mode 100644 mousetrap-global-bind/mousetrap-global-bind.d.ts diff --git a/mousetrap-global-bind/mousetrap-global-bind-tests.ts b/mousetrap-global-bind/mousetrap-global-bind-tests.ts new file mode 100644 index 000000000..92374d862 --- /dev/null +++ b/mousetrap-global-bind/mousetrap-global-bind-tests.ts @@ -0,0 +1,42 @@ +/// + +Mousetrap.globalBind('4', function() { console.log('4'); }); +Mousetrap.globalBind("?", function() { console.log('show shortcuts!'); }); +Mousetrap.globalBind('esc', function() { console.log('escape'); }, 'keyup'); + +// combinations +Mousetrap.globalBind('command+shift+K', function() { console.log('command shift k'); }); + +// map multiple combinations to the same callback +Mousetrap.globalBind(['command+k', 'ctrl+k'], function() { + console.log('command k or control k'); + + // return false to prevent default browser behavior + // and stop event from bubbling + return false; +}); + +// gmail style sequences +Mousetrap.globalBind('g i', function() { console.log('go to inbox'); }); +Mousetrap.globalBind('* a', function() { console.log('select all'); }); + +// konami code! +Mousetrap.globalBind('up up down down left right left right b a enter', function() { + console.log('konami code'); +}); + +Mousetrap.globalBind(['ctrl+s', 'meta+s'], (e, combo) => { + if (e.preventDefault) { + e.preventDefault(); + } else { + // internet explorer + e.returnValue = false; + } +}); + +Mousetrap.unbind('?'); + +Mousetrap.trigger('esc'); +Mousetrap.trigger('esc', 'keyup'); + +Mousetrap.reset(); diff --git a/mousetrap-global-bind/mousetrap-global-bind.d.ts b/mousetrap-global-bind/mousetrap-global-bind.d.ts new file mode 100644 index 000000000..b22d5e338 --- /dev/null +++ b/mousetrap-global-bind/mousetrap-global-bind.d.ts @@ -0,0 +1,11 @@ +// Type definitions for Mousetrap 1.4.6's global-bind extension +// Project: http://craig.is/killing/mice#extensions.global +// Definitions by: Andrew Bradley +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface MousetrapStatic { + globalBind(keys: string, callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; + globalBind(keyArray: string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; +} From 1d556e1d7c7d0c0a32ca48daaa4582ed165cd01b Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Thu, 6 Nov 2014 01:31:01 -0500 Subject: [PATCH 091/135] Modified Mousetrap definition to allow Mousetrap to be loaded as an external module. - tests are also updated to test loading as an external module - mousetrap exports itself as an AMD module when an AMD define function is present --- mousetrap/mousetrap-tests.ts | 8 ++++++++ mousetrap/mousetrap.d.ts | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/mousetrap/mousetrap-tests.ts b/mousetrap/mousetrap-tests.ts index 3eac1eef1..d60d8278d 100644 --- a/mousetrap/mousetrap-tests.ts +++ b/mousetrap/mousetrap-tests.ts @@ -41,3 +41,11 @@ Mousetrap.trigger('esc'); Mousetrap.trigger('esc', 'keyup'); Mousetrap.reset(); + +// Test that Mousetrap can be loaded as an external module. +// Assume that if the externally-loaded module can be assigned to a variable with the type of global Mousetrap, +// then everything is working correctly. + +import importedMousetrap = require('mousetrap'); +var mousetrapModuleReference: typeof Mousetrap = importedMousetrap; + diff --git a/mousetrap/mousetrap.d.ts b/mousetrap/mousetrap.d.ts index dee352b42..846e1f3ce 100644 --- a/mousetrap/mousetrap.d.ts +++ b/mousetrap/mousetrap.d.ts @@ -19,3 +19,7 @@ interface MousetrapStatic { } declare var Mousetrap: MousetrapStatic; + +declare module "mousetrap" { + export = Mousetrap; +} From 5eef2e22f9980b06625e816bfc47b3bdc37d0f52 Mon Sep 17 00:00:00 2001 From: in-async Date: Thu, 6 Nov 2014 21:27:22 +0900 Subject: [PATCH 092/135] update angularfire.d.ts from 0.6.0 to 0.8.2 --- angularfire/angularfire-tests.ts | 208 ++++++++++++++++++++++--------- angularfire/angularfire.d.ts | 59 +++++---- 2 files changed, 185 insertions(+), 82 deletions(-) diff --git a/angularfire/angularfire-tests.ts b/angularfire/angularfire-tests.ts index 74a6c5a30..231c0f992 100644 --- a/angularfire/angularfire-tests.ts +++ b/angularfire/angularfire-tests.ts @@ -3,76 +3,166 @@ var myapp = angular.module("myapp", ["firebase"]); interface AngularFireScope extends ng.IScope { - items: AngularFireArray; - remoteItems: RemoteItems; -} - -interface RemoteItems { - bar: string; + data: any; } var url = "https://myapp.firebaseio.com"; -myapp.controller("MyController", ["$scope", "$firebase", - function ($scope: AngularFireScope, $firebase: AngularFireService) { - var sync = $firebase(new Firebase(url)); +myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$FirebaseArray', + function ($scope: AngularFireScope, $firebase: AngularFireService, $FirebaseObject: AngularFireObjectService, $FirebaseArray: AngularFireArrayService) { + var ref = new Firebase(url); + var sync = $firebase(ref); - sync.$asArray() - .$loaded() - .then(function (list: AngularFireArray) { - console.log("list has " + list.length + " items"); + // AngularFire + { + sync.$asArray(); + sync.$asObject(); + sync.$ref(); + sync.$remove(); + sync.$push({ foo: "foo data" }); + sync.$set("foo", 1); + sync.$set({ foo: 2 }); + sync.$update({ foo: 3 }); + sync.$update("foo", { bar: 1 }); - list.$add({ foo: "bar" }).then(function (ref) { - ref.on("value", function (snapshot) { - if (snapshot.val().foo !== "bar") throw "error"; - }); + // Increment the message count by 1 + sync.$transaction('count', function (currentCount) { + if (!currentCount) return 1; // Initial value for counter. + if (currentCount < 0) return; // Return undefined to abort transaction. + return currentCount + 1; // Increment the count by 1. + }).then(function (snapshot) { + if (!snapshot) { + // Handle aborted transaction. + } else { + // Do something. + console.log(snapshot.val()); + } + }, function (err) { + // Handle the error condition. + console.log(err.stack); }); - - var item = list.$getRecord("foo"); - list.$remove("foo"); - list.$remove(0); - list.$save(); - }); - sync.$asObject() - - - $scope.items = sync.$asArray(); - $scope.object = sync.$asObject(); - - $scope.items.$add({ foo: "bar" }); - $scope.items.$remove("foo"); - $scope.items.$remove(); - $scope.items.$save(); - var child = $scope.items.$child("foo"); - child.$remove(); - $scope.items.$set({ bar: "baz" }); - var keys = $scope.items.$getIndex(); - keys.forEach(function (key, i) { - console.log(i, ($scope.items)[key]); - }); - $scope.items.$on("loaded", function () { - console.log("Initial data received!"); - }); - $scope.items.$on("change", function () { - console.log("A remote change was applied locally!"); - }); - $scope.items.$off('loaded'); - function stopSync() { - $scope.items.$off(); } - $scope.items.$bind($scope, "remoteItems"); - $scope.remoteItems.bar = "foo"; - $scope.items.$bind($scope, "remote").then(function (unbind) { - unbind(); - $scope.remoteItems.bar = "foo"; - }); + + + // AngularFireObject + { + var obj = sync.$asObject(); + + // $id + if (obj.$id !== ref.name()) throw "error"; + + // $loaded() + obj.$loaded().then((data) => { + if (data !== obj) throw "error"; + // $priority + obj.$priority; + + // $value, $save() + obj.$value = "foobar"; + obj.$save(); + }); + + // $inst() + if (obj.$inst() !== sync) throw "error"; + + // $bindTo() + obj.$bindTo($scope, "data").then(function () { + console.log($scope.data); + $scope.data.foo = "baz"; // will be saved to Firebase + sync.$set({ foo: "baz" }); // this would update Firebase and $scope.data + }); + + // $watch() + var unwatch = obj.$watch(function () { + console.log("data changed!"); + }); + unwatch(); + + // $destroy() + obj.$destroy(); + + // $extendFactory() + var NewFactory = $FirebaseObject.$extendFactory({ + getMyFavoriteColor: function () { + return this.favoriteColor + ", no green!"; // obscure Monty Python reference + } + }); + var customObj = $firebase(ref, { objectFactory: NewFactory }).$asObject(); + } + + // AngularFireArray + { + var list = sync.$asArray(); + + // $inst() + if (list.$inst() !== sync) throw "error"; + + // $add() + list.$add({ foo: "foo value" }); + + // $keyAt() + var key = list.$keyAt(0); + + // $indexFor() + var index = list.$indexFor(key); + + // $getRecord() + var item = list.$getRecord(key); + + // $save() + item["bar"] = "bar value"; + list.$save(item); + + // $remove() + list.$remove(item); + + // $loaded() + list.$loaded().then(data => { + if (data !== list) throw "error"; + }); + + // $watch() + var unwatch = list.$watch((event, key, prevChild) => { + switch (event) { + case "child_added": + console.log(key + " added"); + break; + case "child_changed": + console.log(key + " changed"); + break; + case "child_moved": + console.log(key + " moved"); + break; + case "child_removed": + console.log(key + " removed"); + break; + default: + throw "error"; + } + }); + unwatch(); + + // $destroy() + list.$destroy(); + + // $extendFactory() + var ArrayWithSum = $FirebaseArray.$extendFactory({ + sum: function () { + var total = 0; + angular.forEach(this.$list, function (rec) { + total += rec.x; + }); + return total; + } + }); + var list = $firebase(ref, { arrayFactory: ArrayWithSum }).$asArray(); + list.$loaded().then(function () { + console.log("List has " + (list).sum() + " items"); + }); + } } ]); -var foo: AngularFireObject = { - $priority: 0 -}; - interface AngularFireAuthScope extends ng.IScope { loginObj: AngularFireAuth; } diff --git a/angularfire/angularfire.d.ts b/angularfire/angularfire.d.ts index f81ac243f..b6a0d55d2 100644 --- a/angularfire/angularfire.d.ts +++ b/angularfire/angularfire.d.ts @@ -1,4 +1,4 @@ -// Type definitions for AngularFire 0.8.2 and Firebase Simple Login 1.6.4 +// Type definitions for AngularFire 0.8.2 // Project: http://angularfire.com // Definitions by: Dénes Harmath // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -7,7 +7,7 @@ /// interface AngularFireService { - (firebase: Firebase, config?:any): AngularFire; + (firebase: Firebase, config?: any): AngularFire; } interface AngularFire { @@ -18,52 +18,65 @@ interface AngularFire { $set(key: string, data: any): ng.IPromise; $set(data: any): ng.IPromise; $remove(key?: string): ng.IPromise; - $update(key: string, data: any): ng.IPromise; + $update(key: string, data: Object): ng.IPromise; $update(data: any): ng.IPromise; $transaction(updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; + $transaction(key:string, updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; } -interface AngularFireObject { +interface AngularFireObject extends AngularFireSimpleObject { $id: string; $priority: number; $value: any; $save(): ng.IPromise; - $loaded(): ng.IPromise; - $inst(): Firebase; + $loaded(resolve?: (x: AngularFireObject) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireObject) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireObject) => void, reject?: (err: any) => any): ng.IPromise; + $inst(): AngularFire; $bindTo(scope: ng.IScope, varName: string): ng.IPromise; - $watch(callback: Function, context: any): Function; + $watch(callback: Function, context?: any): Function; $destroy(): void; - - $extendFactory(ChildClass: Object, methods?: Object); +} +interface AngularFireObjectService { + $extendFactory(ChildClass: Object, methods?: Object): Object; } -interface AngularFireArray extends Array { +interface AngularFireArray extends Array { $add(newData: any): ng.IPromise; $save(recordOrIndex: any): ng.IPromise; $remove(recordOrIndex: any): ng.IPromise; - $getRecord(key: string): any; + $getRecord(key: string): AngularFireSimpleObject; $keyAt(recordOrIndex: any): string; $indexFor(key: string): number; - $loaded(): ng.IPromise; - $inst(): Firebase; + $loaded(resolve?: (x: AngularFireArray) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireArray) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireArray) => void, reject?: (err: any) => any): ng.IPromise; + $inst(): AngularFire; $watch(cb: (event: string, key: string, prevChild: string) => void, context?: any): Function; $destroy(): void; - - $extendFactory(ChildClass:Object, methods?:Object); +} +interface AngularFireArrayService { + $extendFactory(ChildClass: Object, methods?: Object): Object; } +interface AngularFireSimpleObject { + $id: string; + $priority: number; + $value: any; + [key: string]: any; +} interface AngularFireAuthService { - (firebase: Firebase): AngularFireAuth; + (firebase: Firebase): AngularFireAuth; } interface AngularFireAuth { - $getCurrentUser(): ng.IPromise; - $login(provider: string, options?: Object): ng.IPromise; - $logout(): void; - $createUser(email: string, password: string): ng.IPromise; - $changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise; - $removeUser(email: string, password: string): ng.IPromise; - $sendPasswordResetEmail(email: string): ng.IPromise; + $getCurrentUser(): ng.IPromise; + $login(provider: string, options?: Object): ng.IPromise; + $logout(): void; + $createUser(email: string, password: string): ng.IPromise; + $changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise; + $removeUser(email: string, password: string): ng.IPromise; + $sendPasswordResetEmail(email: string): ng.IPromise; } From e0ffa8d04db54c071d276367c937fefd1df8fd67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Bourgeois?= Date: Thu, 6 Nov 2014 18:10:44 +0100 Subject: [PATCH 093/135] Missing function declaration for knockout. The destroy(function() {...}) was missing inside knockout declarations. --- knockout/knockout.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 861fc8fe3..5c9ab58f3 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -1,6 +1,6 @@ // Type definitions for Knockout v3.2.0-beta // Project: http://knockoutjs.com -// Definitions by: Boris Yankov , Igor Oleinikov +// Definitions by: Boris Yankov , Igor Oleinikov , Clément Bourgeois // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -38,6 +38,7 @@ interface KnockoutObservableArrayFunctions { removeAll(): T[]; destroy(item: T): void; + destroy(destroyFunction: (item: T) => boolean): void; destroyAll(items: T[]): void; destroyAll(): void; } From 59ea3f230968073885dc9f72bcb66747b737f2e5 Mon Sep 17 00:00:00 2001 From: Yang Guan Date: Thu, 6 Nov 2014 10:23:22 -0800 Subject: [PATCH 094/135] Modify tests for heatmap.js --- heatmap.js/heatmap-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heatmap.js/heatmap-tests.ts b/heatmap.js/heatmap-tests.ts index c61458fae..a90eb0aea 100644 --- a/heatmap.js/heatmap-tests.ts +++ b/heatmap.js/heatmap-tests.ts @@ -6,7 +6,7 @@ var baseLayer = L.tileLayer( maxZoom: 18 }); -var testData: HeatmapDataObject = { +var testData: HeatmapData = { max: 8, data: [ { From c71628e0765eb8e240d8eabd2225f64ea2e2fdb8 Mon Sep 17 00:00:00 2001 From: Jeremy Bell Date: Thu, 6 Nov 2014 16:10:37 -0500 Subject: [PATCH 095/135] Adding legacy 1.2 versions of angular-animate, angular-cookies, angular-mocks, angular-resource, angular-route, angular-sanitize, and angular-scenario to address a reference issue when you bring in the 1.2 version of the core angular library. Updated documentation links in the 1.2 versions to point to the 1.2 versions of the documentation. Labeled /angularjs/angular-*.ts as 1.3 in the headers. These will be the starting points for a deeper 1.3 update review - though they are mostly backwards compatible as-is. --- angularjs/angular-animate.d.ts | 2 +- angularjs/angular-cookies.d.ts | 2 +- angularjs/angular-mocks.d.ts | 2 +- angularjs/angular-resource.d.ts | 30 +- angularjs/angular-route.d.ts | 2 +- angularjs/angular-sanitize.d.ts | 2 +- angularjs/angular-scenario.d.ts | 2 +- angularjs/legacy/angular-1.2.d.ts | 7 + angularjs/legacy/angular-animate-1.2.d.ts | 110 +++++++ angularjs/legacy/angular-cookies-1.2.d.ts | 43 +++ angularjs/legacy/angular-mocks-1.2-tests.ts | 305 ++++++++++++++++++ angularjs/legacy/angular-mocks-1.2.d.ts | 226 +++++++++++++ .../legacy/angular-resource-1.2-tests.ts | 138 ++++++++ angularjs/legacy/angular-resource-1.2.d.ts | 152 +++++++++ angularjs/legacy/angular-route-1.2-tests.ts | 17 + angularjs/legacy/angular-route-1.2.d.ts | 145 +++++++++ .../legacy/angular-sanitize-1.2-tests.ts | 10 + angularjs/legacy/angular-sanitize-1.2.d.ts | 35 ++ angularjs/legacy/angular-scenario-1.0.d.ts | 2 +- angularjs/legacy/angular-scenario-1.2.d.ts | 166 ++++++++++ 20 files changed, 1381 insertions(+), 17 deletions(-) create mode 100644 angularjs/legacy/angular-animate-1.2.d.ts create mode 100644 angularjs/legacy/angular-cookies-1.2.d.ts create mode 100644 angularjs/legacy/angular-mocks-1.2-tests.ts create mode 100644 angularjs/legacy/angular-mocks-1.2.d.ts create mode 100644 angularjs/legacy/angular-resource-1.2-tests.ts create mode 100644 angularjs/legacy/angular-resource-1.2.d.ts create mode 100644 angularjs/legacy/angular-route-1.2-tests.ts create mode 100644 angularjs/legacy/angular-route-1.2.d.ts create mode 100644 angularjs/legacy/angular-sanitize-1.2-tests.ts create mode 100644 angularjs/legacy/angular-sanitize-1.2.d.ts create mode 100644 angularjs/legacy/angular-scenario-1.2.d.ts diff --git a/angularjs/angular-animate.d.ts b/angularjs/angular-animate.d.ts index aa12399e5..a01c93ef5 100644 --- a/angularjs/angular-animate.d.ts +++ b/angularjs/angular-animate.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2+ (ngAnimate module) +// Type definitions for Angular JS 1.3 (ngAnimate module) // Project: http://angularjs.org // Definitions by: Michel Salib , Adi Dahiya // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/angular-cookies.d.ts b/angularjs/angular-cookies.d.ts index 622221675..dc0c44908 100644 --- a/angularjs/angular-cookies.d.ts +++ b/angularjs/angular-cookies.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2 (ngCookies module) +// Type definitions for Angular JS 1.3 (ngCookies module) // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/angular-mocks.d.ts b/angularjs/angular-mocks.d.ts index 2591c006e..877071127 100644 --- a/angularjs/angular-mocks.d.ts +++ b/angularjs/angular-mocks.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2 (ngMock, ngMockE2E module) +// Type definitions for Angular JS 1.3 (ngMock, ngMockE2E module) // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 597a58e40..ed08c77dd 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2 (ngResource module) +// Type definitions for Angular JS 1.3 (ngResource module) // Project: http://angularjs.org // Definitions by: Diego Vilar , Michael Jess // Definitions: https://github.com/daptiv/DefinitelyTyped @@ -11,6 +11,16 @@ /////////////////////////////////////////////////////////////////////////////// declare module ng.resource { + /** + * Currently supported options for the $resource factory options argument. + */ + interface IResourceOptions { + /** + * If true then the trailing slashes from any calculated URL will be stripped (defaults to true) + */ + stripTrailingSlashes?: boolean; + } + /////////////////////////////////////////////////////////////////////////// // ResourceService // see http://docs.angularjs.org/api/ngResource.$resource @@ -20,17 +30,17 @@ declare module ng.resource { /////////////////////////////////////////////////////////////////////////// interface IResourceService { (url: string, paramDefaults?: any, - /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } - where deleteDescriptor : IActionDescriptor */ - actionDescriptors?: any): IResourceClass>; + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actions?: any, options?: IResourceOptions): IResourceClass>; (url: string, paramDefaults?: any, - /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } - where deleteDescriptor : IActionDescriptor */ - actionDescriptors?: any): U; + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actions?: any, options?: IResourceOptions): U; (url: string, paramDefaults?: any, - /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } - where deleteDescriptor : IActionDescriptor */ - actionDescriptors?: any): IResourceClass; + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actions?: any, options?: IResourceOptions): IResourceClass; } // Just a reference to facilitate describing new actions diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index a71299e25..949680bf2 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2 (ngRoute module) +// Type definitions for Angular JS 1.3 (ngRoute module) // Project: http://angularjs.org // Definitions by: Jonathan Park // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/angular-sanitize.d.ts b/angularjs/angular-sanitize.d.ts index a28bdb0d7..6fde0baef 100644 --- a/angularjs/angular-sanitize.d.ts +++ b/angularjs/angular-sanitize.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2 (ngSanitize module) +// Type definitions for Angular JS 1.3 (ngSanitize module) // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/angular-scenario.d.ts b/angularjs/angular-scenario.d.ts index ee71ffbea..d1b7b19f6 100644 --- a/angularjs/angular-scenario.d.ts +++ b/angularjs/angular-scenario.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular Scenario Testing +// Type definitions for Angular Scenario Testing 1.3 (ngScenario module) // Project: http://angularjs.org // Definitions by: RomanoLindano // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/legacy/angular-1.2.d.ts b/angularjs/legacy/angular-1.2.d.ts index a1a4cb15b..fb21b030a 100644 --- a/angularjs/legacy/angular-1.2.d.ts +++ b/angularjs/legacy/angular-1.2.d.ts @@ -410,6 +410,13 @@ declare module ng { cancel(promise: IPromise): boolean; } + /** + * The animation object which contains callback functions for each event that is expected to be animated. + */ + interface IAnimateCallbackObject { + eventFn(element: Node, doneFn: () => void): Function; + } + /////////////////////////////////////////////////////////////////////////// // FilterService // see http://docs.angularjs.org/api/ng.$filter diff --git a/angularjs/legacy/angular-animate-1.2.d.ts b/angularjs/legacy/angular-animate-1.2.d.ts new file mode 100644 index 000000000..307e50760 --- /dev/null +++ b/angularjs/legacy/angular-animate-1.2.d.ts @@ -0,0 +1,110 @@ +// Type definitions for Angular JS 1.2 (ngAnimate module) +// Project: http://angularjs.org +// Definitions by: Michel Salib , Adi Dahiya +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/////////////////////////////////////////////////////////////////////////////// +// ngAnimate module (angular-animate.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng.animate { + + /////////////////////////////////////////////////////////////////////////// + // AnimateService + // see https://code.angularjs.org/1.2.26/docs/api/ngAnimate/service/$animate + /////////////////////////////////////////////////////////////////////////// + interface IAnimateService extends ng.IAnimateService { + /** + * Globally enables / disables animations. + * + * @param value If provided then set the animation on or off. + * @param element If provided then the element will be used to represent the enable/disable operation. + * @returns current animation state + */ + enabled(value?: boolean, element?: JQuery): boolean; + + /** + * Appends the element to the parentElement element that resides in the document and then runs the enter animation. + * + * @param element the element that will be the focus of the enter animation + * @param parentElement the parent element of the element that will be the focus of the enter animation + * @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the enter animation + * @param doneCallback the callback function that will be called once the animation is complete + */ + enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery, doneCallback?: () => void): void; + + /** + * Runs the leave animation operation and, upon completion, removes the element from the DOM. + * + * @param element the element that will be the focus of the leave animation + * @param doneCallback the callback function that will be called once the animation is complete + */ + leave(element: JQuery, doneCallback?: () => void): void; + + /** + * Fires the move DOM operation. Just before the animation starts, the animate service will either append + * it into the parentElement container or add the element directly after the afterElement element if present. + * Then the move animation will be run. + * + * @param element the element that will be the focus of the move animation + * @param parentElement the parent element of the element that will be the focus of the move animation + * @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation + * @param doneCallback the callback function that will be called once the animation is complete + */ + move(element: JQuery, parentElement: JQuery, afterElement?: JQuery, doneCallback?: () => void): void; + + /** + * Triggers a custom animation event based off the className variable and then attaches the className + * value to the element as a CSS class. + * + * @param element the element that will be animated + * @param className the CSS class that will be added to the element and then animated + * @param doneCallback the callback function that will be called once the animation is complete + */ + addClass(element: JQuery, className: string, doneCallback?: () => void): void; + + /** + * Triggers a custom animation event based off the className variable and then removes the CSS class + * provided by the className value from the element. + * + * @param element the element that will be animated + * @param className the CSS class that will be animated and then removed from the element + * @param doneCallback the callback function that will be called once the animation is complete + */ + removeClass(element: JQuery, className: string, doneCallback?: () => void): void; + + /** + * Adds and/or removes the given CSS classes to and from the element. Once complete, the done() callback + * will be fired (if provided). + * + * @param element the element which will have its CSS classes changed removed from it + * @param add the CSS classes which will be added to the element + * @param remove the CSS class which will be removed from the element CSS classes have been set on the element + * @param doneCallback done the callback function (if provided) that will be fired after the CSS classes have been set on the element + */ + setClass(element: JQuery, add: string, remove: string, doneCallback?: () => void): void; + } + + /////////////////////////////////////////////////////////////////////////// + // AngularProvider + // see https://code.angularjs.org/1.2.26/docs/api/ngAnimate/provider/$animateProvider + /////////////////////////////////////////////////////////////////////////// + interface IAnimateProvider { + /** + * Registers a new injectable animation factory function. + * + * @param name The name of the animation. + * @param factory The factory function that will be executed to return the animation object. + */ + register(name: string, factory: () => ng.IAnimateCallbackObject): void; + + /** + * Gets and/or sets the CSS class expression that is checked when performing an animation. + * + * @param expression The className expression which will be checked against all animations. + * @returns The current CSS className expression value. If null then there is no expression value. + */ + classNameFilter(expression?: RegExp): RegExp; + } +} diff --git a/angularjs/legacy/angular-cookies-1.2.d.ts b/angularjs/legacy/angular-cookies-1.2.d.ts new file mode 100644 index 000000000..c5ff512e8 --- /dev/null +++ b/angularjs/legacy/angular-cookies-1.2.d.ts @@ -0,0 +1,43 @@ +// Type definitions for Angular JS 1.2 (ngCookies module) +// Project: http://angularjs.org +// Definitions by: Diego Vilar +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +/////////////////////////////////////////////////////////////////////////////// +// ngCookies module (angular-cookies.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng.cookies { + + /////////////////////////////////////////////////////////////////////////// + // CookieService + // see https://code.angularjs.org/1.2.26/docs/api/ngCookies/service/$cookies + /////////////////////////////////////////////////////////////////////////// + interface ICookiesService {} + + /////////////////////////////////////////////////////////////////////////// + // CookieStoreService + // see https://code.angularjs.org/1.2.26/docs/api/ngCookies/service/$cookieStore + /////////////////////////////////////////////////////////////////////////// + interface ICookieStoreService { + /** + * Returns the value of given cookie key + * @param key Id to use for lookup + */ + get(key: string): any; + /** + * Sets a value for given cookie key + * @param key Id for the value + * @param value Value to be stored + */ + put(key: string, value: any): void; + /** + * Remove given cookie + * @param key Id of the key-value pair to delete + */ + remove(key: string): void; + } + +} diff --git a/angularjs/legacy/angular-mocks-1.2-tests.ts b/angularjs/legacy/angular-mocks-1.2-tests.ts new file mode 100644 index 000000000..6f359a67c --- /dev/null +++ b/angularjs/legacy/angular-mocks-1.2-tests.ts @@ -0,0 +1,305 @@ +/// + +/////////////////////////////////////// +// IAngularStatic +/////////////////////////////////////// +var angular: ng.IAngularStatic; +var mock: ng.IMockStatic; + +mock = angular.mock; + + +/////////////////////////////////////// +// IMockStatic +/////////////////////////////////////// +var date: Date; + +mock.dump({ key: 'value' }); + +mock.inject( + function () { return 1; }, + function () { return 2; } + ); + +mock.inject( + ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }]); + +// This overload is not documented on the website, but flows from +// how the injector works. +mock.inject( + ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }], + ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 2; }]); + +mock.module('module1', 'module2'); +mock.module( + function () { return 1; }, + function () { return 2; } + ); +mock.module({ module1: function () { return 1; } }); + +date = mock.TzDate(-7, '2013-1-1T15:00:00Z'); +date = mock.TzDate(-8, 12345678); + + +/////////////////////////////////////// +// IExceptionHandlerProvider +/////////////////////////////////////// +var exceptionHandlerProvider: ng.IExceptionHandlerProvider; + +exceptionHandlerProvider.mode('log'); + + +/////////////////////////////////////// +// ITimeoutService +/////////////////////////////////////// +var timeoutService: ng.ITimeoutService; + +timeoutService.flush(); +timeoutService.flush(1234); +timeoutService.flushNext(); +timeoutService.flushNext(1234); +timeoutService.verifyNoPendingTasks(); + +//////////////////////////////////////// +// IIntervalService +//////////////////////////////////////// +var intervalService: ng.IIntervalService; +var intervalServiceTimeActuallyAdvanced: number; + +intervalServiceTimeActuallyAdvanced = intervalService.flush(); +intervalServiceTimeActuallyAdvanced = intervalService.flush(1234); + +/////////////////////////////////////// +// ILogService, ILogCall +/////////////////////////////////////// +var logService: ng.ILogService; +var logCall: ng.ILogCall; +var logs: string[]; + +logService.assertEmpty(); +logService.reset(); + +logCall = logService.debug; +logCall = logService.error; +logCall = logService.info; +logCall = logService.log; +logCall = logService.warn; + +logs = logCall.logs; + + +/////////////////////////////////////// +// IHttpBackendService +/////////////////////////////////////// +var httpBackendService: ng.IHttpBackendService; +var requestHandler: ng.mock.IRequestHandler; + +httpBackendService.flush(); +httpBackendService.flush(1234); +httpBackendService.resetExpectations(); +httpBackendService.verifyNoOutstandingExpectation(); +httpBackendService.verifyNoOutstandingRequest(); + +requestHandler = httpBackendService.expect('GET', 'http://test.local'); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data'); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data'); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); + +requestHandler = httpBackendService.expectDELETE('http://test.local'); +requestHandler = httpBackendService.expectDELETE('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.expectDELETE(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectGET('http://test.local'); +requestHandler = httpBackendService.expectGET('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.expectGET(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectHEAD('http://test.local'); +requestHandler = httpBackendService.expectHEAD('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.expectHEAD(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectJSONP('http://test.local'); +requestHandler = httpBackendService.expectJSONP(/test.local/); + +requestHandler = httpBackendService.expectPATCH('http://test.local'); +requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data'); +requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/); +requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPATCH('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/); +requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data'); +requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/); +requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.expectPOST('http://test.local'); +requestHandler = httpBackendService.expectPOST('http://test.local', 'response data'); +requestHandler = httpBackendService.expectPOST('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', /response data/); +requestHandler = httpBackendService.expectPOST('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPOST('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/); +requestHandler = httpBackendService.expectPOST(/test.local/, 'response data'); +requestHandler = httpBackendService.expectPOST(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, /response data/); +requestHandler = httpBackendService.expectPOST(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.expectPUT('http://test.local'); +requestHandler = httpBackendService.expectPUT('http://test.local', 'response data'); +requestHandler = httpBackendService.expectPUT('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', /response data/); +requestHandler = httpBackendService.expectPUT('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPUT('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/); +requestHandler = httpBackendService.expectPUT(/test.local/, 'response data'); +requestHandler = httpBackendService.expectPUT(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, /response data/); +requestHandler = httpBackendService.expectPUT(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.when('GET', 'http://test.local'); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data'); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/); +requestHandler = httpBackendService.when('GET', /test.local/, 'response data'); +requestHandler = httpBackendService.when('GET', /test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, /response data/); +requestHandler = httpBackendService.when('GET', /test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); + +requestHandler = httpBackendService.whenDELETE('http://test.local'); +requestHandler = httpBackendService.whenDELETE('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.whenDELETE(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenGET('http://test.local'); +requestHandler = httpBackendService.whenGET('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.whenGET(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenHEAD('http://test.local'); +requestHandler = httpBackendService.whenHEAD('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.whenHEAD(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenJSONP('http://test.local'); +requestHandler = httpBackendService.whenJSONP(/test.local/); + +requestHandler = httpBackendService.whenPATCH('http://test.local'); +requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data'); +requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/); +requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPATCH('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/); +requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data'); +requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/); +requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.whenPOST('http://test.local'); +requestHandler = httpBackendService.whenPOST('http://test.local', 'response data'); +requestHandler = httpBackendService.whenPOST('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', /response data/); +requestHandler = httpBackendService.whenPOST('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPOST('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/); +requestHandler = httpBackendService.whenPOST(/test.local/, 'response data'); +requestHandler = httpBackendService.whenPOST(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, /response data/); +requestHandler = httpBackendService.whenPOST(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.whenPUT('http://test.local'); +requestHandler = httpBackendService.whenPUT('http://test.local', 'response data'); +requestHandler = httpBackendService.whenPUT('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', /response data/); +requestHandler = httpBackendService.whenPUT('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPUT('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/); +requestHandler = httpBackendService.whenPUT(/test.local/, 'response data'); +requestHandler = httpBackendService.whenPUT(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, /response data/); +requestHandler = httpBackendService.whenPUT(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }, { header: 'value' }); + + +/////////////////////////////////////// +// IRequestHandler +/////////////////////////////////////// +requestHandler.passThrough(); +requestHandler.respond(function () { }); +requestHandler.respond({ key: 'value' }); +requestHandler.respond({ key: 'value' }, { header: 'value' }); +requestHandler.respond(404); +requestHandler.respond(404, { key: 'value' }); +requestHandler.respond(404, { key: 'value' }, { header: 'value' }); diff --git a/angularjs/legacy/angular-mocks-1.2.d.ts b/angularjs/legacy/angular-mocks-1.2.d.ts new file mode 100644 index 000000000..e9b0dc8d2 --- /dev/null +++ b/angularjs/legacy/angular-mocks-1.2.d.ts @@ -0,0 +1,226 @@ +// Type definitions for Angular JS 1.2 (ngMock, ngMockE2E module) +// Project: http://angularjs.org +// Definitions by: Diego Vilar +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/////////////////////////////////////////////////////////////////////////////// +// functions attached to global object (window) +/////////////////////////////////////////////////////////////////////////////// +declare var module: (...modules: any[]) => any; +declare var inject: (...fns: Function[]) => any; + +/////////////////////////////////////////////////////////////////////////////// +// ngMock module (angular-mocks.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng { + + /////////////////////////////////////////////////////////////////////////// + // AngularStatic + // We reopen it to add the MockStatic definition + /////////////////////////////////////////////////////////////////////////// + interface IAngularStatic { + mock: IMockStatic; + } + + interface IMockStatic { + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/function/angular.mock.dump + dump(obj: any): string; + + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/function/angular.mock.inject + inject(...fns: Function[]): any; + inject(...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works + + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/function/angular.mock.module + module(...modules: any[]): any; + + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/type/angular.mock.TzDate + TzDate(offset: number, timestamp: number): Date; + TzDate(offset: number, timestamp: string): Date; + } + + /////////////////////////////////////////////////////////////////////////// + // ExceptionHandlerService + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/service/$exceptionHandler + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/provider/$exceptionHandlerProvider + /////////////////////////////////////////////////////////////////////////// + interface IExceptionHandlerProvider extends IServiceProvider { + mode(mode: string): void; + } + + /////////////////////////////////////////////////////////////////////////// + // TimeoutService + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/service/$timeout + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface ITimeoutService { + flush(delay?: number): void; + flushNext(expectedDelay?: number): void; + verifyNoPendingTasks(): void; + } + + /////////////////////////////////////////////////////////////////////////// + // IntervalService + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/service/$interval + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface IIntervalService { + flush(millis?: number): number; + } + + /////////////////////////////////////////////////////////////////////////// + // LogService + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/service/$log + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface ILogService { + assertEmpty(): void; + reset(): void; + } + + interface ILogCall { + logs: string[]; + } + + /////////////////////////////////////////////////////////////////////////// + // HttpBackendService + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/service/$httpBackend + /////////////////////////////////////////////////////////////////////////// + interface IHttpBackendService { + flush(count?: number): void; + resetExpectations(): void; + verifyNoOutstandingExpectation(): void; + verifyNoOutstandingRequest(): void; + + expect(method: string, url: string, data?: string, headers?: Object): mock.IRequestHandler; + expect(method: string, url: string, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + expect(method: string, url: string, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expect(method: string, url: string, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: string, data?: Object, headers?: Object): mock.IRequestHandler; + expect(method: string, url: string, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler; + + expectDELETE(url: string, headers?: Object): mock.IRequestHandler; + expectDELETE(url: RegExp, headers?: Object): mock.IRequestHandler; + expectGET(url: string, headers?: Object): mock.IRequestHandler; + expectGET(url: RegExp, headers?: Object): mock.IRequestHandler; + expectHEAD(url: string, headers?: Object): mock.IRequestHandler; + expectHEAD(url: RegExp, headers?: Object): mock.IRequestHandler; + expectJSONP(url: string): mock.IRequestHandler; + expectJSONP(url: RegExp): mock.IRequestHandler; + + expectPATCH(url: string, data?: string, headers?: Object): mock.IRequestHandler; + expectPATCH(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPATCH(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPATCH(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + expectPATCH(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + expectPATCH(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPATCH(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPATCH(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + + expectPOST(url: string, data?: string, headers?: Object): mock.IRequestHandler; + expectPOST(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPOST(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPOST(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + expectPOST(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + expectPOST(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPOST(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPOST(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + + expectPUT(url: string, data?: string, headers?: Object): mock.IRequestHandler; + expectPUT(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPUT(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPUT(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + expectPUT(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + expectPUT(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPUT(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPUT(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + + when(method: string, url: string, data?: string, headers?: Object): mock.IRequestHandler; + when(method: string, url: string, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + when(method: string, url: string, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + when(method: string, url: string, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: string, data?: Object, headers?: Object): mock.IRequestHandler; + when(method: string, url: string, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + when(method: string, url: RegExp, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + when(method: string, url: RegExp, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + when(method: string, url: RegExp, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + when(method: string, url: RegExp, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler; + + whenDELETE(url: string, headers?: Object): mock.IRequestHandler; + whenDELETE(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + whenDELETE(url: RegExp, headers?: Object): mock.IRequestHandler; + whenDELETE(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + + whenGET(url: string, headers?: Object): mock.IRequestHandler; + whenGET(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + whenGET(url: RegExp, headers?: Object): mock.IRequestHandler; + whenGET(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + + whenHEAD(url: string, headers?: Object): mock.IRequestHandler; + whenHEAD(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + whenHEAD(url: RegExp, headers?: Object): mock.IRequestHandler; + whenHEAD(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + + whenJSONP(url: string): mock.IRequestHandler; + whenJSONP(url: RegExp): mock.IRequestHandler; + + whenPATCH(url: string, data?: string, headers?: Object): mock.IRequestHandler; + whenPATCH(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPATCH(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPATCH(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + whenPATCH(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + whenPATCH(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPATCH(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPATCH(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + + whenPOST(url: string, data?: string, headers?: Object): mock.IRequestHandler; + whenPOST(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPOST(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPOST(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + whenPOST(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + whenPOST(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPOST(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPOST(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + + whenPUT(url: string, data?: string, headers?: Object): mock.IRequestHandler; + whenPUT(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPUT(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPUT(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + whenPUT(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + whenPUT(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPUT(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPUT(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + } + + export module mock { + + // returned interface by the the mocked HttpBackendService expect/when methods + interface IRequestHandler { + respond(func: Function): void; + respond(status: number, data?: any, headers?: any): void; + respond(data: any, headers?: any): void; + + // Available wehn ngMockE2E is loaded + passThrough(): void; + } + + } + +} diff --git a/angularjs/legacy/angular-resource-1.2-tests.ts b/angularjs/legacy/angular-resource-1.2-tests.ts new file mode 100644 index 000000000..ca970f5c4 --- /dev/null +++ b/angularjs/legacy/angular-resource-1.2-tests.ts @@ -0,0 +1,138 @@ +/// + +interface IMyResource extends ng.resource.IResource { }; +interface IMyResourceClass extends ng.resource.IResourceClass { }; + +/////////////////////////////////////// +// IActionDescriptor +/////////////////////////////////////// +var actionDescriptor: ng.resource.IActionDescriptor; + +actionDescriptor.headers = { header: 'value' }; +actionDescriptor.isArray = true; +actionDescriptor.method = 'method action'; +actionDescriptor.params = { key: 'value' }; + + +/////////////////////////////////////// +// IResourceClass +/////////////////////////////////////// +var resourceClass: IMyResourceClass; +var resource: IMyResource; +var resourceArray: ng.resource.IResourceArray; + +resource = resourceClass.delete(); +resource = resourceClass.delete({ key: 'value' }); +resource = resourceClass.delete({ key: 'value' }, function () { }); +resource = resourceClass.delete(function () { }); +resource = resourceClass.delete(function () { }, function () { }); +resource = resourceClass.delete({ key: 'value' }, { key: 'value' }); +resource = resourceClass.delete({ key: 'value' }, { key: 'value' }, function () { }); +resource = resourceClass.delete({ key: 'value' }, { key: 'value' }, function () { }, function () { }); +resource.$promise.then(function(data: IMyResource) {}); + +resource = resourceClass.get(); +resource = resourceClass.get({ key: 'value' }); +resource = resourceClass.get({ key: 'value' }, function () { }); +resource = resourceClass.get(function () { }); +resource = resourceClass.get(function () { }, function () { }); +resource = resourceClass.get({ key: 'value' }, { key: 'value' }); +resource = resourceClass.get({ key: 'value' }, { key: 'value' }, function () { }); +resource = resourceClass.get({ key: 'value' }, { key: 'value' }, function () { }, function () { }); + +resourceArray = resourceClass.query(); +resourceArray = resourceClass.query({ key: 'value' }); +resourceArray = resourceClass.query({ key: 'value' }, function () { }); +resourceArray = resourceClass.query(function () { }); +resourceArray = resourceClass.query(function () { }, function () { }); +resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' }); +resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' }, function () { }); +resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' }, function () { }, function () { }); +resourceArray.push(resource); +resourceArray.$promise.then(function(data: ng.resource.IResourceArray) {}); + +resource = resourceClass.remove(); +resource = resourceClass.remove({ key: 'value' }); +resource = resourceClass.remove({ key: 'value' }, function () { }); +resource = resourceClass.remove(function () { }); +resource = resourceClass.remove(function () { }, function () { }); +resource = resourceClass.remove({ key: 'value' }, { key: 'value' }); +resource = resourceClass.remove({ key: 'value' }, { key: 'value' }, function () { }); +resource = resourceClass.remove({ key: 'value' }, { key: 'value' }, function () { }, function () { }); + +resource = resourceClass.save(); +resource = resourceClass.save({ key: 'value' }); +resource = resourceClass.save({ key: 'value' }, function () { }); +resource = resourceClass.save(function () { }); +resource = resourceClass.save(function () { }, function () { }); +resource = resourceClass.save({ key: 'value' }, { key: 'value' }); +resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { }); +resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { }, function () { }); + +/////////////////////////////////////// +// IResource +/////////////////////////////////////// + +var promise : ng.IPromise; +var arrayPromise : ng.IPromise; + +promise = resource.$delete(); +promise = resource.$delete({ key: 'value' }); +promise = resource.$delete({ key: 'value' }, function () { }); +promise = resource.$delete(function () { }); +promise = resource.$delete(function () { }, function () { }); +promise = resource.$delete({ key: 'value' }, function () { }, function () { }); +promise.then(function(data: IMyResource) {}); + +promise = resource.$get(); +promise = resource.$get({ key: 'value' }); +promise = resource.$get({ key: 'value' }, function () { }); +promise = resource.$get(function () { }); +promise = resource.$get(function () { }, function () { }); +promise = resource.$get({ key: 'value' }, function () { }, function () { }); + +arrayPromise = resourceArray[0].$query(); +arrayPromise = resourceArray[0].$query({ key: 'value' }); +arrayPromise = resourceArray[0].$query({ key: 'value' }, function () { }); +arrayPromise = resourceArray[0].$query(function () { }); +arrayPromise = resourceArray[0].$query(function () { }, function () { }); +arrayPromise = resourceArray[0].$query({ key: 'value' }, function () { }, function () { }); +arrayPromise.then(function(data: ng.resource.IResourceArray) {}); + +promise = resource.$remove(); +promise = resource.$remove({ key: 'value' }); +promise = resource.$remove({ key: 'value' }, function () { }); +promise = resource.$remove(function () { }); +promise = resource.$remove(function () { }, function () { }); +promise = resource.$remove({ key: 'value' }, function () { }, function () { }); + +promise = resource.$save(); +promise = resource.$save({ key: 'value' }); +promise = resource.$save({ key: 'value' }, function () { }); +promise = resource.$save(function () { }); +promise = resource.$save(function () { }, function () { }); +promise = resource.$save({ key: 'value' }, function () { }, function () { }); + +/////////////////////////////////////// +// IResourceService +/////////////////////////////////////// +var resourceService: ng.resource.IResourceService; +resourceClass = resourceService('test'); +resourceClass = resourceService('test'); +resourceClass = resourceService('test'); + +/////////////////////////////////////// +// IModule +/////////////////////////////////////// +var mod: ng.IModule; +var resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction; +var resourceService: ng.resource.IResourceService; + +resourceClass = resourceServiceFactoryFunction(resourceService); + +resourceServiceFactoryFunction = function (resourceService: ng.resource.IResourceService) { return resourceClass; }; +mod = mod.factory('factory name', resourceServiceFactoryFunction); + +/////////////////////////////////////// +// IResource +/////////////////////////////////////// \ No newline at end of file diff --git a/angularjs/legacy/angular-resource-1.2.d.ts b/angularjs/legacy/angular-resource-1.2.d.ts new file mode 100644 index 000000000..f3c3fbe65 --- /dev/null +++ b/angularjs/legacy/angular-resource-1.2.d.ts @@ -0,0 +1,152 @@ +// Type definitions for Angular JS 1.2 (ngResource module) +// Project: http://angularjs.org +// Definitions by: Diego Vilar , Michael Jess +// Definitions: https://github.com/daptiv/DefinitelyTyped + +/// + + +/////////////////////////////////////////////////////////////////////////////// +// ngResource module (angular-resource.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng.resource { + + /////////////////////////////////////////////////////////////////////////// + // ResourceService + // see https://code.angularjs.org/1.2.26/docs/api/ngResource/service/$resource + // Most of the following definitions were achieved by analyzing the + // actual implementation, since the documentation doesn't seem to cover + // that deeply. + /////////////////////////////////////////////////////////////////////////// + interface IResourceService { + (url: string, paramDefaults?: any, + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actionDescriptors?: any): IResourceClass>; + (url: string, paramDefaults?: any, + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actionDescriptors?: any): U; + (url: string, paramDefaults?: any, + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actionDescriptors?: any): IResourceClass; + } + + // Just a reference to facilitate describing new actions + interface IActionDescriptor { + method: string; + isArray?: boolean; + params?: any; + headers?: any; + } + + // Baseclass for everyresource with default actions. + // If you define your new actions for the resource, you will need + // to extend this interface and typecast the ResourceClass to it. + // + // In case of passing the first argument as anything but a function, + // it's gonna be considered data if the action method is POST, PUT or + // PATCH (in other words, methods with body). Otherwise, it's going + // to be considered as parameters to the request. + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L461-L465 + // + // Only those methods with an HTTP body do have 'data' as first parameter: + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L463 + // More specifically, those methods are POST, PUT and PATCH: + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L432 + // + // Also, static calls always return the IResource (or IResourceArray) retrieved + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L549 + interface IResourceClass { + new(dataOrParams? : any) : T; + get(): T; + get(params: Object): T; + get(success: Function, error?: Function): T; + get(params: Object, success: Function, error?: Function): T; + get(params: Object, data: Object, success?: Function, error?: Function): T; + + query(): IResourceArray; + query(params: Object): IResourceArray; + query(success: Function, error?: Function): IResourceArray; + query(params: Object, success: Function, error?: Function): IResourceArray; + query(params: Object, data: Object, success?: Function, error?: Function): IResourceArray; + + save(): T; + save(data: Object): T; + save(success: Function, error?: Function): T; + save(data: Object, success: Function, error?: Function): T; + save(params: Object, data: Object, success?: Function, error?: Function): T; + + remove(): T; + remove(params: Object): T; + remove(success: Function, error?: Function): T; + remove(params: Object, success: Function, error?: Function): T; + remove(params: Object, data: Object, success?: Function, error?: Function): T; + + delete(): T; + delete(params: Object): T; + delete(success: Function, error?: Function): T; + delete(params: Object, success: Function, error?: Function): T; + delete(params: Object, data: Object, success?: Function, error?: Function): T; + } + + // Instance calls always return the the promise of the request which retrieved the object + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L546 + interface IResource { + $get(): ng.IPromise; + $get(params?: Object, success?: Function, error?: Function): ng.IPromise; + $get(success: Function, error?: Function): ng.IPromise; + + $query(): ng.IPromise>; + $query(params?: Object, success?: Function, error?: Function): ng.IPromise>; + $query(success: Function, error?: Function): ng.IPromise>; + + $save(): ng.IPromise; + $save(params?: Object, success?: Function, error?: Function): ng.IPromise; + $save(success: Function, error?: Function): ng.IPromise; + + $remove(): ng.IPromise; + $remove(params?: Object, success?: Function, error?: Function): ng.IPromise; + $remove(success: Function, error?: Function): ng.IPromise; + + $delete(): ng.IPromise; + $delete(params?: Object, success?: Function, error?: Function): ng.IPromise; + $delete(success: Function, error?: Function): ng.IPromise; + + /** the promise of the original server interaction that created this instance. **/ + $promise : ng.IPromise; + $resolved : boolean; + } + + /** + * Really just a regular Array object with $promise and $resolve attached to it + */ + interface IResourceArray extends Array { + /** the promise of the original server interaction that created this collection. **/ + $promise : ng.IPromise>; + $resolved : boolean; + } + + /** when creating a resource factory via IModule.factory */ + interface IResourceServiceFactoryFunction { + ($resource: ng.resource.IResourceService): IResourceClass; + >($resource: ng.resource.IResourceService): U; + } +} + +/** extensions to base ng based on using angular-resource */ +declare module ng { + + interface IModule { + /** creating a resource service factory */ + factory(name: string, resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction): IModule; + } +} + +interface Array +{ + /** the promise of the original server interaction that created this collection. **/ + $promise : ng.IPromise>; + $resolved : boolean; +} diff --git a/angularjs/legacy/angular-route-1.2-tests.ts b/angularjs/legacy/angular-route-1.2-tests.ts new file mode 100644 index 000000000..0b82110ef --- /dev/null +++ b/angularjs/legacy/angular-route-1.2-tests.ts @@ -0,0 +1,17 @@ +/// + +/** + * @license HTTP Auth Interceptor Module for AngularJS + * (c) 2013 Jonathan Park @ Daptiv Solutions Inc + * License: MIT + */ + +declare var $routeProvider: ng.route.IRouteProvider; +$routeProvider + .when('/projects/:projectId/dashboard',{ + controller: '', + templateUrl: '', + caseInsensitiveMatch: true, + reloadOnSearch: false + }) + .otherwise({redirectTo: '/'}); diff --git a/angularjs/legacy/angular-route-1.2.d.ts b/angularjs/legacy/angular-route-1.2.d.ts new file mode 100644 index 000000000..7afd4af5a --- /dev/null +++ b/angularjs/legacy/angular-route-1.2.d.ts @@ -0,0 +1,145 @@ +// Type definitions for Angular JS 1.2 (ngRoute module) +// Project: http://angularjs.org +// Definitions by: Jonathan Park +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + + +/////////////////////////////////////////////////////////////////////////////// +// ngRoute module (angular-route.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng.route { + + /////////////////////////////////////////////////////////////////////////// + // RouteParamsService + // see https://code.angularjs.org/1.2.26/docs/api/ngRoute/service/$routeParams + /////////////////////////////////////////////////////////////////////////// + interface IRouteParamsService { + [key: string]: any; + } + + /////////////////////////////////////////////////////////////////////////// + // RouteService + // see https://code.angularjs.org/1.2.26/docs/api/ngRoute/service/$route + // see https://code.angularjs.org/1.2.26/docs/api/ngRoute/provider/$routeProvider + /////////////////////////////////////////////////////////////////////////// + interface IRouteService { + /** + * Causes $route service to reload the current route even if $location hasn't changed. + * As a result of that, ngView creates new scope, reinstantiates the controller. + */ + reload(): void; + + /** + * Object with all route configuration Objects as its properties. + */ + routes: any; + + // May not always be available. For instance, current will not be available + // to a controller that was not initialized as a result of a route maching. + current?: ICurrentRoute; + } + + + /** + * see https://code.angularjs.org/1.2.26/docs/api/ngRoute/provider/$routeProvider#when for API documentation + */ + interface IRoute { + /** + * {(string|function()=} + * Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string. + */ + controller?: any; + /** + * A controller alias name. If present the controller will be published to scope under the controllerAs name. + */ + controllerAs?: string; + /** + * Undocumented? + */ + name?: string; + /** + * {string=|function()=} + * Html template as a string or a function that returns an html template as a string which should be used by ngView or ngInclude directives. This property takes precedence over templateUrl. + * + * If template is a function, it will be called with the following parameters: + * + * {Array.} - route parameters extracted from the current $location.path() by applying the current route + */ + template?: string; + /** + * {string=|function()=} + * Path or function that returns a path to an html template that should be used by ngView. + * + * If templateUrl is a function, it will be called with the following parameters: + * + * {Array.} - route parameters extracted from the current $location.path() by applying the current route + */ + templateUrl?: any; + /** + * {Object.=} - An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired. The map object is: + * + * - key - {string}: a name of a dependency to be injected into the controller. + * - factory - {string|function}: If string then it is an alias for a service. Otherwise if function, then it is injected and the return value is treated as the dependency. If the result is a promise, it is resolved before its value is injected into the controller. Be aware that ngRoute.$routeParams will still refer to the previous route within these resolve functions. Use $route.current.params to access the new route parameters, instead. + */ + resolve?: {[key: string]: any}; + /** + * {(string|function())=} + * Value to update $location path with and trigger route redirection. + * + * If redirectTo is a function, it will be called with the following parameters: + * + * - {Object.} - route parameters extracted from the current $location.path() by applying the current route templateUrl. + * - {string} - current $location.path() + * - {Object} - current $location.search() + * - The custom redirectTo function is expected to return a string which will be used to update $location.path() and $location.search(). + */ + redirectTo?: any; + /** + * Reload route when only $location.search() or $location.hash() changes. + * + * This option defaults to true. If the option is set to false and url in the browser changes, then $routeUpdate event is broadcasted on the root scope. + */ + reloadOnSearch?: boolean; + /** + * Match routes without being case sensitive + * + * This option defaults to false. If the option is set to true, then the particular route can be matched without being case sensitive + */ + caseInsensitiveMatch?: boolean; + } + + // see https://code.angularjs.org/1.2.26/docs/api/ngRoute/service/$route#current + interface ICurrentRoute extends IRoute { + locals: { + $scope: IScope; + $template: string; + }; + + params: any; + } + + interface IRouteProvider extends IServiceProvider { + /** + * Sets route definition that will be used on route change when no other route definition is matched. + * + * @params Mapping information to be assigned to $route.current. + */ + otherwise(params: IRoute): IRouteProvider; + /** + * Adds a new route definition to the $route service. + * + * @param path Route path (matched against $location.path). If $location.path contains redundant trailing slash or is missing one, the route will still match and the $location.path will be updated to add or drop the trailing slash to exactly match the route definition. + * + * - path can contain named groups starting with a colon: e.g. :name. All characters up to the next slash are matched and stored in $routeParams under the given name when the route matches. + * - path can contain named groups starting with a colon and ending with a star: e.g.:name*. All characters are eagerly stored in $routeParams under the given name when the route matches. + * - path can contain optional named groups with a question mark: e.g.:name?. + * + * For example, routes like /color/:color/largecode/:largecode*\/edit will match /color/brown/largecode/code/with/slashes/edit and extract: color: brown and largecode: code/with/slashes. + * + * @param route Mapping information to be assigned to $route.current on route match. + */ + when(path: string, route: IRoute): IRouteProvider; + } +} diff --git a/angularjs/legacy/angular-sanitize-1.2-tests.ts b/angularjs/legacy/angular-sanitize-1.2-tests.ts new file mode 100644 index 000000000..853bbf349 --- /dev/null +++ b/angularjs/legacy/angular-sanitize-1.2-tests.ts @@ -0,0 +1,10 @@ +/// + +var shouldBeString: string; + +declare var $sanitizeService: ng.sanitize.ISanitizeService; +shouldBeString = $sanitizeService(shouldBeString); + +declare var $linky: ng.sanitize.filter.ILinky; +shouldBeString = $linky(shouldBeString); +shouldBeString = $linky(shouldBeString, shouldBeString); diff --git a/angularjs/legacy/angular-sanitize-1.2.d.ts b/angularjs/legacy/angular-sanitize-1.2.d.ts new file mode 100644 index 000000000..4c6805c9a --- /dev/null +++ b/angularjs/legacy/angular-sanitize-1.2.d.ts @@ -0,0 +1,35 @@ +// Type definitions for Angular JS 1.2 (ngSanitize module) +// Project: http://angularjs.org +// Definitions by: Diego Vilar +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +/////////////////////////////////////////////////////////////////////////////// +// ngSanitize module (angular-sanitize.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng.sanitize { + + /////////////////////////////////////////////////////////////////////////// + // SanitizeService + // see https://code.angularjs.org/1.2.26/docs/api/ngSanitize/service/$sanitize + /////////////////////////////////////////////////////////////////////////// + interface ISanitizeService { + (html: string): string; + } + + /////////////////////////////////////////////////////////////////////////// + // Filters included with the ngSanitize + // see https://code.angularjs.org/1.2.26/docs/api/ngSanitize/filter + /////////////////////////////////////////////////////////////////////////// + export module filter { + + // Finds links in text input and turns them into html links. + // Supports http/https/ftp/mailto and plain email address links. + // see https://code.angularjs.org/1.2.26/docs/api/ngSanitize/filter/linky + interface ILinky { + (text: string, target?: string): string; + } + } +} diff --git a/angularjs/legacy/angular-scenario-1.0.d.ts b/angularjs/legacy/angular-scenario-1.0.d.ts index 8dd605f7d..a44b79096 100644 --- a/angularjs/legacy/angular-scenario-1.0.d.ts +++ b/angularjs/legacy/angular-scenario-1.0.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular Scenario Testing +// Type definitions for Angular Scenario Testing 1.0 (ngScenario module) // Project: [http://angularjs.org] // Definitions by: [RomanoLindano] // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/legacy/angular-scenario-1.2.d.ts b/angularjs/legacy/angular-scenario-1.2.d.ts new file mode 100644 index 000000000..9e72db895 --- /dev/null +++ b/angularjs/legacy/angular-scenario-1.2.d.ts @@ -0,0 +1,166 @@ +// Type definitions for Angular Scenario Testing 1.2 (ngScenario module) +// Project: http://angularjs.org +// Definitions by: RomanoLindano +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module ng { + export interface IAngularStatic { + scenario: any; + } +} + +declare module angularScenario { + + export interface RunFunction { + (functionToRun: any): any; + } + export interface RunFunctionWithDescription { + (description: string, functionToRun: any): any; + } + + export interface PauseFunction { + (): any; + } + + export interface SleepFunction { + (seconds: number): any; + } + + export interface Future { + } + + export interface testWindow { + href(): Future; + path(): Future; + search(): Future; + hash(): Future; + } + + export interface testLocation { + url(): Future; + path(): Future; + search(): Future; + hash(): Future; + } + + export interface Browser { + navigateTo(url: string): void; + navigateTo(urlDescription: string, urlFunction: () => string): void; + reload(): void; + window(): testWindow; + location(): testLocation; + } + + export interface Matchers { + toEqual(value: any): void; + toBe(value: any): void; + toBeDefined(): void; + toBeTruthy(): void; + toBeFalsy(): void; + toMatch(regularExpression: any): void; + toBeNull(): void; + toContain(value: any): void; + toBeLessThan(value: any): void; + toBeGreaterThan(value: any): void; + } + + export interface CustomMatchers extends Matchers { + } + + export interface Expect extends CustomMatchers { + not(): angularScenario.CustomMatchers; + } + + export interface UsingFunction { + (selector: string, selectorDescription?: string): void; + } + + export interface BindingFunction { + (bracketBindingExpression: string): Future; + } + + export interface Input { + enter(value: any): any; + check(): any; + select(radioButtonValue: any): any; + val(): Future; + } + + export interface Repeater { + count(): Future; + row(index: number): Future; + column(ngBindingExpression: string): Future; + } + + export interface Select { + option(value: any): any; + option(...listOfValues: any[]): any; + } + + export interface Element { + count(): Future; + click(): any; + dblclick(): any; + mouseover(): any; + mousedown(): any; + mouseup(): any; + query(callback: (selectedDOMElements: JQuery, callbackWhenDone: (objNull: any, futureValue: any) => any) => any): any; + val(): Future; + text(): Future; + html(): Future; + height(): Future; + innerHeight(): Future; + outerHeight(): Future; + width(): Future; + innerWidth(): Future; + outerWidth(): Future; + position(): Future; + scrollLeft(): Future; + scrollTop(): Future; + offset(): Future; + + val(value: any): void; + text(value: any): void; + html(value: any): void; + height(value: any): void; + innerHeight(value: any): void; + outerHeight(value: any): void; + width(value: any): void; + innerWidth(value: any): void; + outerWidth(value: any): void; + position(value: any): void; + scrollLeft(value: any): void; + scrollTop(value: any): void; + offset(value: any): void; + + attr(key: any): Future; + prop(key: any): Future; + css(key: any): Future; + + attr(key: any, value: any): void; + prop(key: any, value: any): void; + css(key: any, value: any): void; + } +} + +declare var describe: angularScenario.RunFunctionWithDescription; +declare var ddescribe: angularScenario.RunFunctionWithDescription; +declare var xdescribe: angularScenario.RunFunctionWithDescription; +declare var beforeEach: angularScenario.RunFunction; +declare var afterEach: angularScenario.RunFunction; +declare var it: angularScenario.RunFunctionWithDescription; +declare var iit: angularScenario.RunFunctionWithDescription; +declare var xit: angularScenario.RunFunctionWithDescription; +declare var pause: angularScenario.PauseFunction; +declare var sleep: angularScenario.SleepFunction; +declare function browser(): angularScenario.Browser; +declare function expect(expectation: angularScenario.Future): angularScenario.Expect; +declare var using: angularScenario.UsingFunction; +declare var binding: angularScenario.BindingFunction; +declare function input(ngModelBinding: string): angularScenario.Input; +declare function repeater(selector: string, repeaterDescription?: string): angularScenario.Repeater; +declare function select(ngModelBinding: string): angularScenario.Select; +declare function element(selector: string, elementDescription?: string): angularScenario.Element; +declare var angular: ng.IAngularStatic; From a012987c65e53119c57a76403d1797dbe3367e15 Mon Sep 17 00:00:00 2001 From: PROGRE Date: Fri, 7 Nov 2014 07:01:15 +0900 Subject: [PATCH 096/135] fix String to string --- socket.io/socket.io.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/socket.io/socket.io.d.ts b/socket.io/socket.io.d.ts index ddf7ff11b..b6aad3293 100644 --- a/socket.io/socket.io.d.ts +++ b/socket.io/socket.io.d.ts @@ -33,7 +33,7 @@ declare module SocketIO { listen(port: number, opts: any): Server; bind(srv: any): Server; onconnection(socket: any): Server; - of(nsp: String): Namespace; + of(nsp: string): Namespace; emit(name: string, ...args: any[]): Socket; use(fn: Function): Namespace; @@ -43,7 +43,7 @@ declare module SocketIO { } interface Namespace extends NodeJS.EventEmitter { - name: String; + name: string; connected: { [id: number]: Socket }; use(fn: Function): Namespace From 24bf981aba084453a946f3a4f588cd2c90a0d4c9 Mon Sep 17 00:00:00 2001 From: in-async Date: Fri, 7 Nov 2014 17:49:10 +0900 Subject: [PATCH 097/135] =?UTF-8?q?=E4=BD=9C=E6=A5=AD=E9=80=94=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- firebase/firebase-tests.ts | 142 +++++++++++++++++++++++++++++++++++++ firebase/firebase.d.ts | 96 ++++++++++++++++++++++++- 2 files changed, 235 insertions(+), 3 deletions(-) diff --git a/firebase/firebase-tests.ts b/firebase/firebase-tests.ts index eb6be8373..647ecb663 100644 --- a/firebase/firebase-tests.ts +++ b/firebase/firebase-tests.ts @@ -11,6 +11,94 @@ dataRef.auth(AUTH_TOKEN, function(error, result) { } }); +// Log me in +dataRef.authWithCustomToken(AUTH_TOKEN, function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); + +// Log me in +dataRef.authAnonymously(function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); + +// Log me in +dataRef.authWithPassword({ + "email" : "bobtony@firebase.com", + "password" : "correcthorsebatterystaple" +}, function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); + +// Log me in +dataRef.authWithOAuthPopup("twitter", function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); + +// Log me in +dataRef.authWithOAuthRedirect("twitter", function(error) { + if (error) { + console.log('Login Failed!', error); + } else { + // We'll never get here, as the page will redirect on success. + } +}); + +// Authenticate with Facebook using an existing OAuth 2.0 access token +dataRef.authWithOAuthToken("facebook", "", function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); +// Authenticate with Twitter using an existing OAuth 1.0a credential set +dataRef.authWithOAuthToken("twitter", { + "user_id" : "", + "oauth_token" : "", + "oauth_token_secret" : "", +}, function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); + +var authData = dataRef.getAuth(); +if (authData) { + console.log('Authenticated user with uid:', authData.uid); +} + +var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com'); +firebaseRef.onAuth(function(authData) { + if (authData) { + console.log('Client is authenticated with uid ' + authData.uid); + } else { + // Client is unauthenticated + } +}); + +var onAuthChange = function(authData) { /*...*/ }; +firebaseRef.onAuth(onAuthChange); +// Sometime later... +firebaseRef.offAuth(onAuthChange); + //Time to log out! dataRef.unauth(); @@ -32,10 +120,64 @@ var sampleChatRef2 :Firebase= fredRef2.root(); var x3:string = sampleChatRef2.toString(); // x is now 'https://SampleChat.firebaseIO-demo.com'. +var fredRef = new Firebase("https://samplechat.firebaseio-demo.com/users/fred"); +var key = fredRef.key(); // key === "fred" +key = fredRef.child("name/last").key(); // key === "last" +key = fredRef.root().key(); // key === null, since fredRef refers to the root of the Firebase. + var fredRef3:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred'); var x4:string = fredRef3.name(); // x is now 'fred'. +/* + * $set + */ +var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); +fredNameRef.child('first').set('Fred'); +fredNameRef.child('last').set('Flintstone'); +// We've written 'Fred' to the Firebase location storing fred's first name, +// and 'Flintstone' to the location storing his last name + +fredNameRef.set({ first: 'Fred', last: 'Flintstone' }); +// Exact same effect as the previous example, except we've written +// fred's first and last name simultaneously + +var onComplete = function(error) { + if (error) { + console.log('Synchronization failed'); + } else { + console.log('Synchronization succeeded'); + } +}; +fredNameRef.set({ first: 'Fred', last: 'Flintstone' }, onComplete); +// Same as the previous example, except we will also log a message +// when the data has finished synchronizing + + +/* + * $update + */ +var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); +// Modify the 'first' and 'last' children, but leave other data at fredNameRef unchanged +fredNameRef.update({ first: 'Fred', last: 'Flintstone' }); + +// Same as the previous example, except we will also display an alert +// message when the data has finished synchronizing. +var onComplete = function(error) { + if (error) { + console.log('Synchronization failed'); + } else { + console.log('Synchronization succeeded'); + } +}; +fredNameRef.update({ first: 'Wilma', last: 'Flintstone' }, onComplete); + +var fredRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred'); +//The following 2 function calls are equivalent +fredRef.update({ name: { first: 'Fred', last: 'Flintstone' }}); +fredRef.child('name').set({ first: 'Fred', last: 'Flintstone' }); + + // Increment Fred's rank by 1. var fredRankRef:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred/rank'); fredRankRef.transaction(function(currentRank: number) { diff --git a/firebase/firebase.d.ts b/firebase/firebase.d.ts index bac32fbc6..796d14d59 100644 --- a/firebase/firebase.d.ts +++ b/firebase/firebase.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Firebase API +// Type definitions for Firebase API 2.0.2 // Project: https://www.firebase.com/docs/javascript/firebase // Definitions by: Vincent Botone // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -43,16 +43,92 @@ interface IFirebaseQuery { } declare class Firebase implements IFirebaseQuery { + /** + * Constructs a new Firebase reference from a full Firebase URL. + */ constructor(firebaseURL: string); - auth(authToken: string, onComplete?: (error: any, result: IFirebaseAuthResult) => void, onCancel?:(error: any) => void): void; + /** + * @deprecated Use authWithCustomToken() instead. + * Authenticates a Firebase client using the provided authentication token or Firebase Secret. + */ + auth(authToken: string, onComplete?: (error: any, result: IFirebaseAuthResult) => void, onCancel?: (error: any) => void): void; + /** + * Authenticates a Firebase client using an authentication token or Firebase Secret. + */ + authWithCustomToken(autoToken: string, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?:Object): void; + /** + * Authenticates a Firebase client using a new, temporary guest account. + */ + authAnonymously(onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Authenticates a Firebase client using an email / password combination. + */ + authWithPassword(credentials: IFirebaseCredentials, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Authenticates a Firebase client using a popup-based OAuth flow. + */ + authWithOAuthPopup(provider: string, onComplete:(error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Authenticates a Firebase client using a redirect-based OAuth flow. + */ + authWithOAuthRedirect(provider: string, onComplete: (error: any) => void, options?: Object): void; + /** + * Authenticates a Firebase client using OAuth access tokens or credentials. + */ + authWithOAuthToken(provider: string, credentials: string, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + authWithOAuthToken(provider: string, credentials: Object, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Synchronously access the current authentication state of the client. + */ + getAuth(): IFirebaseAuthData; + /** + * Listen for changes to the client's authentication state. + */ + onAuth(onComplete: (authData: IFirebaseAuthData) => void, context?: Object): void; + /** + * Detaches a callback previously attached with onAuth(). + */ + offAuth(onComplete: (authData: IFirebaseAuthData) => void, context?: Object): void; + /** + * Unauthenticates a Firebase client. + */ unauth(): void; + /** + * Gets a Firebase reference for the location at the specified relative path. + */ child(childPath: string): Firebase; + /** + * Gets a Firebase reference to the parent location. + */ parent(): Firebase; + /** + * Gets a Firebase reference to the root of the Firebase. + */ root(): Firebase; + /** + * Returns the last token in a Firebase location. + */ + key(): string; + /** + * @deprecated Use key() instead. + * Returns the last token in a Firebase location. + */ name(): string; + /** + * Gets the absolute URL corresponding to this Firebase reference's location. + */ toString(): string; + /** + * Writes data to this Firebase location. + */ set(value: any, onComplete?: (error: any) => void): void; - update(value: any, onComplete?: (error: any) => void): void; + /** + * Writes the enumerated children to this Firebase location. + */ + update(value: Object, onComplete?: (error: any) => void): void; + /** + * + */ remove(onComplete?: (error: any) => void): void; push(value: any, onComplete?: (error: any) => void): Firebase; setWithPriority(value: any, priority: string, onComplete?: (error: any) => void): void; @@ -73,3 +149,17 @@ declare class Firebase implements IFirebaseQuery { goOffline(): void; goOnline(): void; } + +// Reference: https://www.firebase.com/docs/web/api/firebase/getauth.html +interface IFirebaseAuthData { + uid: string; + provider: string; + token: string; + expires: number; + auth: Object; +} + +interface IFirebaseCredentials { + email: string; + password: string; +} \ No newline at end of file From 154c40d628946ea6b6b15dc9fc341f47036ccf0b Mon Sep 17 00:00:00 2001 From: in-async Date: Fri, 7 Nov 2014 17:56:53 +0900 Subject: [PATCH 098/135] =?UTF-8?q?Revert=20"=E4=BD=9C=E6=A5=AD=E9=80=94?= =?UTF-8?q?=E4=B8=AD"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 24bf981aba084453a946f3a4f588cd2c90a0d4c9. --- firebase/firebase-tests.ts | 142 ------------------------------------- firebase/firebase.d.ts | 96 +------------------------ 2 files changed, 3 insertions(+), 235 deletions(-) diff --git a/firebase/firebase-tests.ts b/firebase/firebase-tests.ts index 647ecb663..eb6be8373 100644 --- a/firebase/firebase-tests.ts +++ b/firebase/firebase-tests.ts @@ -11,94 +11,6 @@ dataRef.auth(AUTH_TOKEN, function(error, result) { } }); -// Log me in -dataRef.authWithCustomToken(AUTH_TOKEN, function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); - -// Log me in -dataRef.authAnonymously(function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); - -// Log me in -dataRef.authWithPassword({ - "email" : "bobtony@firebase.com", - "password" : "correcthorsebatterystaple" -}, function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); - -// Log me in -dataRef.authWithOAuthPopup("twitter", function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); - -// Log me in -dataRef.authWithOAuthRedirect("twitter", function(error) { - if (error) { - console.log('Login Failed!', error); - } else { - // We'll never get here, as the page will redirect on success. - } -}); - -// Authenticate with Facebook using an existing OAuth 2.0 access token -dataRef.authWithOAuthToken("facebook", "", function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); -// Authenticate with Twitter using an existing OAuth 1.0a credential set -dataRef.authWithOAuthToken("twitter", { - "user_id" : "", - "oauth_token" : "", - "oauth_token_secret" : "", -}, function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); - -var authData = dataRef.getAuth(); -if (authData) { - console.log('Authenticated user with uid:', authData.uid); -} - -var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com'); -firebaseRef.onAuth(function(authData) { - if (authData) { - console.log('Client is authenticated with uid ' + authData.uid); - } else { - // Client is unauthenticated - } -}); - -var onAuthChange = function(authData) { /*...*/ }; -firebaseRef.onAuth(onAuthChange); -// Sometime later... -firebaseRef.offAuth(onAuthChange); - //Time to log out! dataRef.unauth(); @@ -120,64 +32,10 @@ var sampleChatRef2 :Firebase= fredRef2.root(); var x3:string = sampleChatRef2.toString(); // x is now 'https://SampleChat.firebaseIO-demo.com'. -var fredRef = new Firebase("https://samplechat.firebaseio-demo.com/users/fred"); -var key = fredRef.key(); // key === "fred" -key = fredRef.child("name/last").key(); // key === "last" -key = fredRef.root().key(); // key === null, since fredRef refers to the root of the Firebase. - var fredRef3:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred'); var x4:string = fredRef3.name(); // x is now 'fred'. -/* - * $set - */ -var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); -fredNameRef.child('first').set('Fred'); -fredNameRef.child('last').set('Flintstone'); -// We've written 'Fred' to the Firebase location storing fred's first name, -// and 'Flintstone' to the location storing his last name - -fredNameRef.set({ first: 'Fred', last: 'Flintstone' }); -// Exact same effect as the previous example, except we've written -// fred's first and last name simultaneously - -var onComplete = function(error) { - if (error) { - console.log('Synchronization failed'); - } else { - console.log('Synchronization succeeded'); - } -}; -fredNameRef.set({ first: 'Fred', last: 'Flintstone' }, onComplete); -// Same as the previous example, except we will also log a message -// when the data has finished synchronizing - - -/* - * $update - */ -var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); -// Modify the 'first' and 'last' children, but leave other data at fredNameRef unchanged -fredNameRef.update({ first: 'Fred', last: 'Flintstone' }); - -// Same as the previous example, except we will also display an alert -// message when the data has finished synchronizing. -var onComplete = function(error) { - if (error) { - console.log('Synchronization failed'); - } else { - console.log('Synchronization succeeded'); - } -}; -fredNameRef.update({ first: 'Wilma', last: 'Flintstone' }, onComplete); - -var fredRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred'); -//The following 2 function calls are equivalent -fredRef.update({ name: { first: 'Fred', last: 'Flintstone' }}); -fredRef.child('name').set({ first: 'Fred', last: 'Flintstone' }); - - // Increment Fred's rank by 1. var fredRankRef:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred/rank'); fredRankRef.transaction(function(currentRank: number) { diff --git a/firebase/firebase.d.ts b/firebase/firebase.d.ts index 796d14d59..bac32fbc6 100644 --- a/firebase/firebase.d.ts +++ b/firebase/firebase.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Firebase API 2.0.2 +// Type definitions for Firebase API // Project: https://www.firebase.com/docs/javascript/firebase // Definitions by: Vincent Botone // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -43,92 +43,16 @@ interface IFirebaseQuery { } declare class Firebase implements IFirebaseQuery { - /** - * Constructs a new Firebase reference from a full Firebase URL. - */ constructor(firebaseURL: string); - /** - * @deprecated Use authWithCustomToken() instead. - * Authenticates a Firebase client using the provided authentication token or Firebase Secret. - */ - auth(authToken: string, onComplete?: (error: any, result: IFirebaseAuthResult) => void, onCancel?: (error: any) => void): void; - /** - * Authenticates a Firebase client using an authentication token or Firebase Secret. - */ - authWithCustomToken(autoToken: string, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?:Object): void; - /** - * Authenticates a Firebase client using a new, temporary guest account. - */ - authAnonymously(onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; - /** - * Authenticates a Firebase client using an email / password combination. - */ - authWithPassword(credentials: IFirebaseCredentials, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; - /** - * Authenticates a Firebase client using a popup-based OAuth flow. - */ - authWithOAuthPopup(provider: string, onComplete:(error: any, authData: IFirebaseAuthData) => void, options?: Object): void; - /** - * Authenticates a Firebase client using a redirect-based OAuth flow. - */ - authWithOAuthRedirect(provider: string, onComplete: (error: any) => void, options?: Object): void; - /** - * Authenticates a Firebase client using OAuth access tokens or credentials. - */ - authWithOAuthToken(provider: string, credentials: string, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; - authWithOAuthToken(provider: string, credentials: Object, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; - /** - * Synchronously access the current authentication state of the client. - */ - getAuth(): IFirebaseAuthData; - /** - * Listen for changes to the client's authentication state. - */ - onAuth(onComplete: (authData: IFirebaseAuthData) => void, context?: Object): void; - /** - * Detaches a callback previously attached with onAuth(). - */ - offAuth(onComplete: (authData: IFirebaseAuthData) => void, context?: Object): void; - /** - * Unauthenticates a Firebase client. - */ + auth(authToken: string, onComplete?: (error: any, result: IFirebaseAuthResult) => void, onCancel?:(error: any) => void): void; unauth(): void; - /** - * Gets a Firebase reference for the location at the specified relative path. - */ child(childPath: string): Firebase; - /** - * Gets a Firebase reference to the parent location. - */ parent(): Firebase; - /** - * Gets a Firebase reference to the root of the Firebase. - */ root(): Firebase; - /** - * Returns the last token in a Firebase location. - */ - key(): string; - /** - * @deprecated Use key() instead. - * Returns the last token in a Firebase location. - */ name(): string; - /** - * Gets the absolute URL corresponding to this Firebase reference's location. - */ toString(): string; - /** - * Writes data to this Firebase location. - */ set(value: any, onComplete?: (error: any) => void): void; - /** - * Writes the enumerated children to this Firebase location. - */ - update(value: Object, onComplete?: (error: any) => void): void; - /** - * - */ + update(value: any, onComplete?: (error: any) => void): void; remove(onComplete?: (error: any) => void): void; push(value: any, onComplete?: (error: any) => void): Firebase; setWithPriority(value: any, priority: string, onComplete?: (error: any) => void): void; @@ -149,17 +73,3 @@ declare class Firebase implements IFirebaseQuery { goOffline(): void; goOnline(): void; } - -// Reference: https://www.firebase.com/docs/web/api/firebase/getauth.html -interface IFirebaseAuthData { - uid: string; - provider: string; - token: string; - expires: number; - auth: Object; -} - -interface IFirebaseCredentials { - email: string; - password: string; -} \ No newline at end of file From 6d9f08eda8b2f7e8560095801b3a3d88b5c11ca6 Mon Sep 17 00:00:00 2001 From: Shinya Ohira Date: Fri, 7 Nov 2014 23:31:02 +0900 Subject: [PATCH 099/135] Fix server.method --- hapi/hapi-tests.ts | 30 ++++++++++++++++++++++++++++++ hapi/hapi.d.ts | 4 ++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/hapi/hapi-tests.ts b/hapi/hapi-tests.ts index da28b97a3..586d3d29f 100644 --- a/hapi/hapi-tests.ts +++ b/hapi/hapi-tests.ts @@ -25,6 +25,36 @@ server.pack.register([plugin], (err: Object) => { if (err) { throw err; } }); +// Add server method +var add = function (a: number, b: number, next: (err: any, result?: any, ttl?: number) => void) { + next(null, a + b); +}; + +server.method('sum', add, { cache: { expiresIn: 2000 } }); + +server.methods.sum(4, 5, (err: any, result: any) => { + console.log(result); +}); + +var addArray = function (array: Array, next: (err: any, result?: any, ttl?: number) => void) { + var sum: number = 0; + array.forEach((item: number) => { + sum += item; + }); + next(null, sum); +}; + +server.method('sumObj', addArray, { + cache: { expiresIn: 2000 }, + generateKey: (array: Array) => { + return array.join(','); + } +}); + +server.methods.sumObj([5, 6], (err: any, result: any) => { + console.log(result); +}); + // Add the route server.route({ method: 'GET', diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index 09453737a..de65efcdc 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -279,7 +279,7 @@ declare module Hapi { export class Server { app: any; - methods: Array<() => void>; + methods: any; info: { port: number; host?: string; @@ -336,7 +336,7 @@ declare module Hapi { }; ext(event: any, method: string, options?: any): void; method(method: Array<{name: string; fn: () => void; options: any}>): void; - method(name: string, fn: () => void, options: any): void; + method(name: string, fn: Function, options: any): void; inject(options: any, callback: any): void; handler(name: string, method: (name: string, options: any) => void): void; } From fd5dbacc769bab316b82a052e1c58f7fd72bf88c Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Sat, 8 Nov 2014 03:42:15 +0900 Subject: [PATCH 100/135] Fix ajaxSettings --- zepto/zepto.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zepto/zepto.d.ts b/zepto/zepto.d.ts index aa497b03f..b01df9173 100644 --- a/zepto/zepto.d.ts +++ b/zepto/zepto.d.ts @@ -1580,13 +1580,20 @@ interface ZeptoAjaxSettings { data?: any; processData?: boolean; contentType?: string; + mimeType?: string; dataType?: string; + jsonp?: string; + jsonpCallback?: any; // string or Function timeout?: number; headers?: { [key: string]: string }; async?: boolean; global?: boolean; context?: any; traditional?: boolean; + cache?: boolean; + xhrFields?: { [key: string]: any }; + username?: string; + password?: string; beforeSend?: (xhr: XMLHttpRequest, settings: ZeptoAjaxSettings) => boolean; success?: (data: any, status: string, xhr: XMLHttpRequest) => void; error?: (xhr: XMLHttpRequest, errorType: string, error: Error) => void; From 17641114cc82526031fd20b966c8a2d73e9531f8 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Fri, 7 Nov 2014 17:01:09 -0500 Subject: [PATCH 101/135] Adding definition file for adm-zip. --- CONTRIBUTORS.md | 1 + adm-zip/adm-zip-tests.ts | 33 +++++ adm-zip/adm-zip.d.ts | 300 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 334 insertions(+) create mode 100644 adm-zip/adm-zip-tests.ts create mode 100644 adm-zip/adm-zip.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f4665695e..4dbaecc21 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -7,6 +7,7 @@ All definitions files include a header with the author and editors, so at some p * [accounting.js](http://josscrowcroft.github.io/accounting.js/) (by [Sergey Gerasimov](https://github.com/gerich-home)) * [Ace Cloud9 Editor](http://ace.ajax.org/) (by [Diullei Gomes](https://github.com/Diullei)) * [Add To Home Screen](http://cubiq.org/add-to-home-screen) (by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw)) +* [adm-zip](https://github.com/cthackers/adm-zip) (by [John Vilk](https://github.com/jvilk/)) * [AmCharts](http://www.amcharts.com/) (by [Covobonomo](https://github.com/covobonomo/)) * [AngularAgility](https://github.com/AngularAgility/AngularAgility) (by [Roland Zwaga](https://github.com/rolandzwaga)) * [AngularBootstrapLightbox](https://github.com/compact/angular-bootstrap-lightbox) (by [Roland Zwaga](https://github.com/rolandzwaga)) diff --git a/adm-zip/adm-zip-tests.ts b/adm-zip/adm-zip-tests.ts new file mode 100644 index 000000000..f8583ae61 --- /dev/null +++ b/adm-zip/adm-zip-tests.ts @@ -0,0 +1,33 @@ +/// +import AdmZip = require("adm-zip"); + + +// reading archives +var zip = new AdmZip("./my_file.zip"); +var zipEntries = zip.getEntries(); // an array of ZipEntry records + +zipEntries.forEach(function (zipEntry) { + console.log(zipEntry.toString()); // outputs zip entries information + if (zipEntry.entryName == "my_file.txt") { + console.log(zipEntry.getData().toString('utf8')); + } +}); +// outputs the content of some_folder/my_file.txt +console.log(zip.readAsText("some_folder/my_file.txt")); +// extracts the specified file to the specified location +zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/home/me/tempfolder", /*overwrite*/true) +// extracts everything +zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true); + + +// creating archives +var zip = new AdmZip(); + +// add file directly +zip.addFile("test.txt", new Buffer("inner content of the file"), "entry comment goes here"); +// add local file +zip.addLocalFile("/home/me/some_picture.png"); +// get everything as a buffer +var willSendthis = zip.toBuffer(); +// or write everything to disk +zip.writeZip(/*target file name*/"/home/me/files.zip"); diff --git a/adm-zip/adm-zip.d.ts b/adm-zip/adm-zip.d.ts new file mode 100644 index 000000000..9f2eb7dfd --- /dev/null +++ b/adm-zip/adm-zip.d.ts @@ -0,0 +1,300 @@ +// Type definitions for adm-zip v0.4.4 +// Project: https://github.com/cthackers/adm-zip +// Definitions by: John Vilk +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module AdmZip { + class ZipFile { + /** + * Create a new, empty archive. + */ + constructor(); + /** + * Read an existing archive. + */ + constructor(fileName: string); + /** + * Extracts the given entry from the archive and returns the content as a + * Buffer object. + * @param entry String with the full path of the entry + * @return Buffer or Null in case of error + */ + readFile(entry: string): Buffer; + /** + * Extracts the given entry from the archive and returns the content as a + * Buffer object. + * @param entry ZipEntry object + * @return Buffer or Null in case of error + */ + readFile(entry: IZipEntry): Buffer; + /** + * Asynchronous readFile + * @param entry String with the full path of the entry + * @param callback Called with a Buffer or Null in case of error + */ + readFileAsync(entry: string, callback: (data: Buffer, err: string) => any): void; + /** + * Asynchronous readFile + * @param entry ZipEntry object + * @param callback Called with a Buffer or Null in case of error + * @return Buffer or Null in case of error + */ + readFileAsync(entry: IZipEntry, callback: (data: Buffer, err: string) => any): void; + /** + * Extracts the given entry from the archive and returns the content as + * plain text in the given encoding + * @param entry String with the full path of the entry + * @param encoding Optional. If no encoding is specified utf8 is used + * @return String + */ + readAsText(fileName: string, encoding?: string): string; + /** + * Extracts the given entry from the archive and returns the content as + * plain text in the given encoding + * @param entry ZipEntry object + * @param encoding Optional. If no encoding is specified utf8 is used + * @return String + */ + readAsText(fileName: IZipEntry, encoding?: string): string; + /** + * Asynchronous readAsText + * @param entry String with the full path of the entry + * @param callback Called with the resulting string. + * @param encoding Optional. If no encoding is specified utf8 is used + */ + readAsTextAsync(fileName: string, callback: (data: string) => any, encoding?: string): void; + /** + * Asynchronous readAsText + * @param entry ZipEntry object + * @param callback Called with the resulting string. + * @param encoding Optional. If no encoding is specified utf8 is used + */ + readAsTextAsync(fileName: IZipEntry, callback: (data: string) => any, encoding?: string): void; + /** + * Remove the entry from the file or the entry and all its nested directories + * and files if the given entry is a directory + * @param entry String with the full path of the entry + */ + deleteFile(entry: string): void; + /** + * Remove the entry from the file or the entry and all its nested directories + * and files if the given entry is a directory + * @param entry A ZipEntry object. + */ + deleteFile(entry: IZipEntry): void; + /** + * Adds a comment to the zip. The zip must be rewritten after + * adding the comment. + * @param comment Content of the comment. + */ + addZipComment(comment: string): void; + /** + * Returns the zip comment + * @return The zip comment. + */ + getZipComment(): string; + /** + * Adds a comment to a specified zipEntry. The zip must be rewritten after + * adding the comment. + * The comment cannot exceed 65535 characters in length. + * @param entry String with the full path of the entry + * @param comment The comment to add to the entry. + */ + addZipEntryComment(entry: string, comment: string): void; + /** + * Adds a comment to a specified zipEntry. The zip must be rewritten after + * adding the comment. + * The comment cannot exceed 65535 characters in length. + * @param entry ZipEntry object. + * @param comment The comment to add to the entry. + */ + addZipEntryComment(entry: IZipEntry, comment: string): void; + /** + * Returns the comment of the specified entry. + * @param entry String with the full path of the entry. + * @return String The comment of the specified entry. + */ + getZipEntryComment(entry: string): string; + /** + * Returns the comment of the specified entry + * @param entry ZipEntry object. + * @return String The comment of the specified entry. + */ + getZipEntryComment(entry: IZipEntry): string; + /** + * Updates the content of an existing entry inside the archive. The zip + * must be rewritten after updating the content + * @param entry String with the full path of the entry. + * @param content The entry's new contents. + */ + updateFile(entry: string, content: Buffer): void; + /** + * Updates the content of an existing entry inside the archive. The zip + * must be rewritten after updating the content + * @param entry ZipEntry object. + * @param content The entry's new contents. + */ + updateFile(entry: IZipEntry, content: Buffer): void; + /** + * Adds a file from the disk to the archive. + * @param localPath Path to a file on disk. + * @param zipPath Path to a directory in the archive. Defaults to the empty + * string. + */ + addLocalFile(localPath: string, zipPath?: string): void; + /** + * Adds a local directory and all its nested files and directories to the + * archive. + * @param localPath Path to a folder on disk. + * @param zipPath Path to a folder in the archive. Defaults to an empty + * string. + */ + addLocalFolder(localPath: string, zipPath?: string): void; + /** + * Allows you to create a entry (file or directory) in the zip file. + * If you want to create a directory the entryName must end in / and a null + * buffer should be provided. + * @param entryName Entry path + * @param content Content to add to the entry; must be a 0-length buffer + * for a directory. + * @param comment Comment to add to the entry. + * @param attr Attribute to add to the entry. + */ + addFile(entryName: string, data: Buffer, comment?: string, attr?: number): void; + /** + * Returns an array of ZipEntry objects representing the files and folders + * inside the archive + */ + getEntries(): IZipEntry[]; + /** + * Returns a ZipEntry object representing the file or folder specified by + * ``name``. + * @param name Name of the file or folder to retrieve. + * @return ZipEntry The entry corresponding to the name. + */ + getEntry(name: string): IZipEntry; + /** + * Extracts the given entry to the given targetPath. + * If the entry is a directory inside the archive, the entire directory and + * its subdirectories will be extracted. + * @param entry String with the full path of the entry + * @param targetPath Target folder where to write the file + * @param maintainEntryPath If maintainEntryPath is true and the entry is + * inside a folder, the entry folder will be created in targetPath as + * well. Default is TRUE + * @param overwrite If the file already exists at the target path, the file + * will be overwriten if this is true. Default is FALSE + * + * @return Boolean + */ + extractEntryTo(entryPath: string, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean; + /** + * Extracts the given entry to the given targetPath. + * If the entry is a directory inside the archive, the entire directory and + * its subdirectories will be extracted. + * @param entry ZipEntry object + * @param targetPath Target folder where to write the file + * @param maintainEntryPath If maintainEntryPath is true and the entry is + * inside a folder, the entry folder will be created in targetPath as + * well. Default is TRUE + * @param overwrite If the file already exists at the target path, the file + * will be overwriten if this is true. Default is FALSE + * @return Boolean + */ + extractEntryTo(entryPath: IZipEntry, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean; + /** + * Extracts the entire archive to the given location + * @param targetPath Target location + * @param overwrite If the file already exists at the target path, the file + * will be overwriten if this is true. Default is FALSE + */ + extractAllTo(targetPath: string, overwrite?: boolean): void; + /** + * Writes the newly created zip file to disk at the specified location or + * if a zip was opened and no ``targetFileName`` is provided, it will + * overwrite the opened zip + * @param targetFileName + */ + writeZip(targetPath?: string): void; + /** + * Returns the content of the entire zip file as a Buffer object + * @return Buffer + */ + toBuffer(): Buffer; + } + + /** + * The ZipEntry is more than a structure representing the entry inside the + * zip file. Beside the normal attributes and headers a entry can have, the + * class contains a reference to the part of the file where the compressed + * data resides and decompresses it when requested. It also compresses the + * data and creates the headers required to write in the zip file. + */ + interface IZipEntry { + /** + * Represents the full name and path of the file + */ + entryName: string; + rawEntryName: Buffer; + /** + * Extra data associated with this entry. + */ + extra: Buffer; + /** + * Entry comment. + */ + comment: string; + name: string; + /** + * Read-Only property that indicates the type of the entry. + */ + isDirectory: boolean; + /** + * Get the header associated with this ZipEntry. + */ + header: Buffer; + /** + * Retrieve the compressed data for this entry. Note that this may trigger + * compression if any properties were modified. + */ + getCompressedData(): Buffer; + /** + * Asynchronously retrieve the compressed data for this entry. Note that + * this may trigger compression if any properties were modified. + */ + getCompressedDataAsync(callback: (data: Buffer) => void): void; + /** + * Set the (uncompressed) data to be associated with this entry. + */ + setData(value: string): void; + /** + * Set the (uncompressed) data to be associated with this entry. + */ + setData(value: Buffer): void; + /** + * Get the decompressed data associated with this entry. + */ + getData(): Buffer; + /** + * Asynchronously get the decompressed data associated with this entry. + */ + getDataAsync(callback: (data: Buffer) => void): void; + /** + * Returns the CEN Entry Header to be written to the output zip file, plus + * the extra data and the entry comment. + */ + packHeader(): Buffer; + /** + * Returns a nicely formatted string with the most important properties of + * the ZipEntry. + */ + toString(): string; + } +} + +declare module "adm-zip" { + import zipFile = AdmZip.ZipFile; + export = zipFile; +} From 20ebd41950f57573ade486620e32436def29d94e Mon Sep 17 00:00:00 2001 From: Niklas Mollenhauer Date: Sat, 8 Nov 2014 01:14:26 +0100 Subject: [PATCH 102/135] Fix bug in node-webkit when requiring "nw.gui" --- node-webkit/node-webkit.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-webkit/node-webkit.d.ts b/node-webkit/node-webkit.d.ts index 92afbff2d..78c9dd3f0 100644 --- a/node-webkit/node-webkit.d.ts +++ b/node-webkit/node-webkit.d.ts @@ -3,7 +3,7 @@ // Definitions by: Pedro Casaubon // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module nw.gui { +declare module "nw.gui" { interface IEventEmitter { addListener(event: string, listener: Function): EventEmitter; From a7114686aa0d922d6f6aec7e2083908dc912a6d8 Mon Sep 17 00:00:00 2001 From: Niklas Mollenhauer Date: Sat, 8 Nov 2014 01:15:15 +0100 Subject: [PATCH 103/135] Update tests to use require() --- node-webkit/node-webkit-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node-webkit/node-webkit-tests.ts b/node-webkit/node-webkit-tests.ts index da10f2901..fab532d36 100644 --- a/node-webkit/node-webkit-tests.ts +++ b/node-webkit/node-webkit-tests.ts @@ -1,7 +1,9 @@ /// /// + // Load native UI library -var gui: typeof nw.gui; +// See docs: https://github.com/rogerwang/node-webkit/wiki/Shell +import gui = require("nw.gui"); /* WINDOW */ From 0ffe89ddb428924e90f78818bd50f92c1f5109d7 Mon Sep 17 00:00:00 2001 From: Niklas Mollenhauer Date: Sat, 8 Nov 2014 01:52:05 +0100 Subject: [PATCH 104/135] Fix failed test --- node-webkit/node-webkit-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-webkit/node-webkit-tests.ts b/node-webkit/node-webkit-tests.ts index fab532d36..ba53c3fc4 100644 --- a/node-webkit/node-webkit-tests.ts +++ b/node-webkit/node-webkit-tests.ts @@ -111,7 +111,7 @@ import gui = require("nw.gui"); /* MENU ITEM */ - var itemc:nw.gui.MenuItem; + var itemc:gui.MenuItem; // Create a separator itemc = new gui.MenuItem({ type: 'separator' }); From 12af931fb003092a3dc5eb97dfbe210b40d5288b Mon Sep 17 00:00:00 2001 From: in-async Date: Sat, 8 Nov 2014 23:50:15 +0900 Subject: [PATCH 105/135] Fix along the guidelines. --- angularfire/angularfire-tests.ts | 6 +- angularfire/angularfire.d.ts | 98 ++++++++++++++++---------------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/angularfire/angularfire-tests.ts b/angularfire/angularfire-tests.ts index 231c0f992..7d39e4181 100644 --- a/angularfire/angularfire-tests.ts +++ b/angularfire/angularfire-tests.ts @@ -168,7 +168,7 @@ interface AngularFireAuthScope extends ng.IScope { } myapp.controller("MyAuthController", ["$scope", "$firebaseSimpleLogin", - function ($scope: AngularFireAuthScope, $firebaseSimpleLogin: AngularFireAuthService) { + function($scope: AngularFireAuthScope, $firebaseSimpleLogin: AngularFireAuthService) { var dataRef = new Firebase(url); $scope.loginObj = $firebaseSimpleLogin(dataRef); $scope.loginObj.$getCurrentUser().then(_ => { @@ -178,9 +178,9 @@ myapp.controller("MyAuthController", ["$scope", "$firebaseSimpleLogin", $scope.loginObj.$login('password', { email: email, password: password - }).then(function (user) { + }).then(function(user) { console.log('Logged in as: ', user.uid); - }, function (error) { + }, function(error) { console.error('Login failed: ', error); }); $scope.loginObj.$logout(); diff --git a/angularfire/angularfire.d.ts b/angularfire/angularfire.d.ts index b6a0d55d2..0bebb23c5 100644 --- a/angularfire/angularfire.d.ts +++ b/angularfire/angularfire.d.ts @@ -7,76 +7,76 @@ /// interface AngularFireService { - (firebase: Firebase, config?: any): AngularFire; + (firebase: Firebase, config?: any): AngularFire; } interface AngularFire { - $asArray(): AngularFireArray; - $asObject(): AngularFireObject; - $ref(): Firebase; - $push(data: any): ng.IPromise; - $set(key: string, data: any): ng.IPromise; - $set(data: any): ng.IPromise; - $remove(key?: string): ng.IPromise; - $update(key: string, data: Object): ng.IPromise; - $update(data: any): ng.IPromise; - $transaction(updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; - $transaction(key:string, updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; + $asArray(): AngularFireArray; + $asObject(): AngularFireObject; + $ref(): Firebase; + $push(data: any): ng.IPromise; + $set(key: string, data: any): ng.IPromise; + $set(data: any): ng.IPromise; + $remove(key?: string): ng.IPromise; + $update(key: string, data: Object): ng.IPromise; + $update(data: any): ng.IPromise; + $transaction(updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; + $transaction(key:string, updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; } interface AngularFireObject extends AngularFireSimpleObject { - $id: string; - $priority: number; - $value: any; - $save(): ng.IPromise; - $loaded(resolve?: (x: AngularFireObject) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; - $loaded(resolve?: (x: AngularFireObject) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; - $loaded(resolve?: (x: AngularFireObject) => void, reject?: (err: any) => any): ng.IPromise; - $inst(): AngularFire; - $bindTo(scope: ng.IScope, varName: string): ng.IPromise; - $watch(callback: Function, context?: any): Function; - $destroy(): void; + $id: string; + $priority: number; + $value: any; + $save(): ng.IPromise; + $loaded(resolve?: (x: AngularFireObject) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireObject) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireObject) => void, reject?: (err: any) => any): ng.IPromise; + $inst(): AngularFire; + $bindTo(scope: ng.IScope, varName: string): ng.IPromise; + $watch(callback: Function, context?: any): Function; + $destroy(): void; } interface AngularFireObjectService { - $extendFactory(ChildClass: Object, methods?: Object): Object; + $extendFactory(ChildClass: Object, methods?: Object): Object; } interface AngularFireArray extends Array { - $add(newData: any): ng.IPromise; - $save(recordOrIndex: any): ng.IPromise; - $remove(recordOrIndex: any): ng.IPromise; - $getRecord(key: string): AngularFireSimpleObject; - $keyAt(recordOrIndex: any): string; - $indexFor(key: string): number; - $loaded(resolve?: (x: AngularFireArray) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; - $loaded(resolve?: (x: AngularFireArray) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; - $loaded(resolve?: (x: AngularFireArray) => void, reject?: (err: any) => any): ng.IPromise; - $inst(): AngularFire; - $watch(cb: (event: string, key: string, prevChild: string) => void, context?: any): Function; - $destroy(): void; + $add(newData: any): ng.IPromise; + $save(recordOrIndex: any): ng.IPromise; + $remove(recordOrIndex: any): ng.IPromise; + $getRecord(key: string): AngularFireSimpleObject; + $keyAt(recordOrIndex: any): string; + $indexFor(key: string): number; + $loaded(resolve?: (x: AngularFireArray) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireArray) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireArray) => void, reject?: (err: any) => any): ng.IPromise; + $inst(): AngularFire; + $watch(cb: (event: string, key: string, prevChild: string) => void, context?: any): Function; + $destroy(): void; } interface AngularFireArrayService { - $extendFactory(ChildClass: Object, methods?: Object): Object; + $extendFactory(ChildClass: Object, methods?: Object): Object; } interface AngularFireSimpleObject { - $id: string; - $priority: number; - $value: any; - [key: string]: any; + $id: string; + $priority: number; + $value: any; + [key: string]: any; } interface AngularFireAuthService { - (firebase: Firebase): AngularFireAuth; + (firebase: Firebase): AngularFireAuth; } interface AngularFireAuth { - $getCurrentUser(): ng.IPromise; - $login(provider: string, options?: Object): ng.IPromise; - $logout(): void; - $createUser(email: string, password: string): ng.IPromise; - $changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise; - $removeUser(email: string, password: string): ng.IPromise; - $sendPasswordResetEmail(email: string): ng.IPromise; + $getCurrentUser(): ng.IPromise; + $login(provider: string, options?: Object): ng.IPromise; + $logout(): void; + $createUser(email: string, password: string): ng.IPromise; + $changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise; + $removeUser(email: string, password: string): ng.IPromise; + $sendPasswordResetEmail(email: string): ng.IPromise; } From 0607d042b41fd53aef05afca5a0679c0e211fbc9 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sun, 9 Nov 2014 00:14:20 +0900 Subject: [PATCH 106/135] mv mousetrap-global-bind/mousetrap-global-bind.d.ts -> mousetrap/mousetrap-global-bind.d.ts --- .../mousetrap-global-bind-tests.ts | 0 {mousetrap-global-bind => mousetrap}/mousetrap-global-bind.d.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {mousetrap-global-bind => mousetrap}/mousetrap-global-bind-tests.ts (100%) rename {mousetrap-global-bind => mousetrap}/mousetrap-global-bind.d.ts (88%) diff --git a/mousetrap-global-bind/mousetrap-global-bind-tests.ts b/mousetrap/mousetrap-global-bind-tests.ts similarity index 100% rename from mousetrap-global-bind/mousetrap-global-bind-tests.ts rename to mousetrap/mousetrap-global-bind-tests.ts diff --git a/mousetrap-global-bind/mousetrap-global-bind.d.ts b/mousetrap/mousetrap-global-bind.d.ts similarity index 88% rename from mousetrap-global-bind/mousetrap-global-bind.d.ts rename to mousetrap/mousetrap-global-bind.d.ts index b22d5e338..ecfdd2ff2 100644 --- a/mousetrap-global-bind/mousetrap-global-bind.d.ts +++ b/mousetrap/mousetrap-global-bind.d.ts @@ -3,7 +3,7 @@ // Definitions by: Andrew Bradley // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// interface MousetrapStatic { globalBind(keys: string, callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; From eae67433b791fa98ee59c33aa99f6219daeae956 Mon Sep 17 00:00:00 2001 From: jbblanchet Date: Sat, 8 Nov 2014 12:45:12 -0500 Subject: [PATCH 107/135] Declare variable so import works When declaring a module, it's necessary to declare a variable then export it, else the import keyword won't work properly when using modules. --- tv4/tv4.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tv4/tv4.d.ts b/tv4/tv4.d.ts index 702d3c3bc..02b7ebba2 100644 --- a/tv4/tv4.d.ts +++ b/tv4/tv4.d.ts @@ -43,5 +43,6 @@ interface TV4 { errorCodes:TV4ErrorCodes; } declare module "tv4" { -export = TV4; + var tv4: TV4 + export = tv4; } From e07da8a6fabb4c52295f09a65d39d86bd60fbf42 Mon Sep 17 00:00:00 2001 From: Maks3w Date: Sun, 9 Nov 2014 12:09:26 +0100 Subject: [PATCH 108/135] [jquery.validation][1.11.1] invalidElements and validElements methods --- jquery.validation/jquery.validation-tests.ts | 2 ++ jquery.validation/jquery.validation.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/jquery.validation/jquery.validation-tests.ts b/jquery.validation/jquery.validation-tests.ts index 64fe6ef94..fcc22d296 100644 --- a/jquery.validation/jquery.validation-tests.ts +++ b/jquery.validation/jquery.validation-tests.ts @@ -227,4 +227,6 @@ function test_methods() { maxlength: 5 } }); + var invalidElements: HTMLElement[] = validator.invalidElements(); + var validElements: HTMLElement[] = validator.validElements(); } diff --git a/jquery.validation/jquery.validation.d.ts b/jquery.validation/jquery.validation.d.ts index f66edadab..916ae1016 100644 --- a/jquery.validation/jquery.validation.d.ts +++ b/jquery.validation/jquery.validation.d.ts @@ -197,6 +197,7 @@ interface Validator * @param template The string to format. */ format(template: string, ...arguments: string[]): string; + invalidElements(): HTMLElement[]; /** * Returns the number of invalid fields. */ @@ -220,6 +221,7 @@ interface Validator showErrors(errors: any): void; hideErrors(): void; valid(): boolean; + validElements(): HTMLElement[]; size(): number; errorMap: ErrorDictionary; From 5f4765a1c903a82b35d96023f866bf381afbafa7 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Mon, 10 Nov 2014 16:15:58 +1100 Subject: [PATCH 109/135] Use the new beta build env on Travis https://github.com/travis-ci/docs-travis-ci-com/blob/ha-docker-documentation/user/container-based-infrastructure.md Seen on `Microsoft/TypeScript/pull/1085` by travis team --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index acfc5176f..0bad26ece 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,7 @@ language: node_js node_js: - "0.10" +sudo: false + notifications: email: false From 0008781fb2a165a68d10b7f579330dcb4f6a1cb6 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Mon, 10 Nov 2014 12:59:50 -0500 Subject: [PATCH 110/135] Fixing type definition for semver.satisfies to return a boolean. Cleaning up type definitions a bit, and lifting function comments into JSDoc so IDEs like Visual Studio will appropriately display the comment. --- semver/semver-tests.ts | 7 +- semver/semver.d.ts | 148 +++++++++++++++++++++++++++-------------- 2 files changed, 102 insertions(+), 53 deletions(-) diff --git a/semver/semver-tests.ts b/semver/semver-tests.ts index f339be75b..c3631cd72 100644 --- a/semver/semver-tests.ts +++ b/semver/semver-tests.ts @@ -20,10 +20,9 @@ var loose:boolean; str = mod.valid(str); str = mod.valid(str, loose); -//TODO maybe add an enum for release? str = mod.inc(str, str, loose); -//Comparison +// Comparison bool = mod.gt(v1, v2, loose); bool = mod.gte(v1, v2, loose); bool = mod.lt(v1, v2, loose); @@ -34,9 +33,9 @@ bool = mod.cmp(v1, x, v2, loose); num = mod.compare(v1, v2, loose); num = mod.rcompare(v1, v2, loose); -//Ranges +// Ranges str = mod.validRange(str, loose); -str = mod.satisfies(version, str, loose); +bool = mod.satisfies(version, str, loose); str = mod.maxSatisfying(versions, str, loose); bool = mod.gtr(version, str, loose); bool = mod.ltr(version, str, loose); diff --git a/semver/semver.d.ts b/semver/semver.d.ts index 12909d90e..cb8efa4f5 100644 --- a/semver/semver.d.ts +++ b/semver/semver.d.ts @@ -4,72 +4,122 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module SemVerModule { + /** + * Return the parsed version, or null if it's not valid. + */ + function valid(v: string, loose?: boolean): string; + /** + * Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid. + */ + function inc(v: string, release: string, loose?: boolean): string; - function valid(v:string, loose?:boolean):string; // Return the parsed version, or null if it's not valid. - //TODO maybe add an enum for release? - function inc(v:string, release:string, loose?:boolean):string; // Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid. + // Comparison + /** + * v1 > v2 + */ + function gt(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 >= v2 + */ + function gte(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 < v2 + */ + function lt(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 <= v2 + */ + function lte(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. + */ + function eq(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 != v2 The opposite of eq. + */ + function neq(v1: string, v2: string, loose?: boolean): boolean; + /** + * Pass in a comparison string, and it'll call the corresponding semver comparison function. "===" and "!==" do simple string comparison, but are included for completeness. Throws if an invalid comparison string is provided. + */ + function cmp(v1: string, comparator: any, v2: string, loose?: boolean): boolean; + /** + * Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort(). + */ + function compare(v1: string, v2: string, loose?: boolean): number; + /** + * The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort(). + */ + function rcompare(v1: string, v2: string, loose?: boolean): number; - //Comparison - function gt(v1:string, v2:string, loose?:boolean):boolean; // v1 > v2 - function gte(v1:string, v2:string, loose?:boolean):boolean; // v1 >= v2 - function lt(v1:string, v2:string, loose?:boolean):boolean; // v1 < v2 - function lte(v1:string, v2:string, loose?:boolean):boolean; // v1 <= v2 - function eq(v1:string, v2:string, loose?:boolean):boolean; // v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. - function neq(v1:string, v2:string, loose?:boolean):boolean; // v1 != v2 The opposite of eq. - function cmp(v1:string, comparator:any, v2:string, loose?:boolean):boolean; // Pass in a comparison string, and it'll call the corresponding function above. "===" and "!==" do simple string comparison, but are included for completeness. Throws if an invalid comparison string is provided. - function compare(v1:string, v2:string, loose?:boolean):number; // Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort(). - function rcompare(v1:string, v2:string, loose?:boolean):number; // The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort(). - - //Ranges - function validRange(range:string, loose?:boolean):string; // Return the valid range or null if it's not valid - function satisfies(version:string, range:string, loose?:boolean):string; // Return true if the version satisfies the range. - function maxSatisfying(versions:string[], range:string, loose?:boolean):string; // Return the highest version in the list that satisfies the range, or null if none of them do. - function gtr(version:string, range:string, loose?:boolean):boolean; // Return true if version is greater than all the versions possible in the range. - function ltr(version:string, range:string, loose?:boolean):boolean; // Return true if version is less than all the versions possible in the range. - function outside(version:string, range:string, hilo:string, loose?:boolean):boolean; // Return true if the version is outside the bounds of the range in either the high or low direction. The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.) + // Ranges + /** + * Return the valid range or null if it's not valid + */ + function validRange(range: string, loose?: boolean): string; + /** + * Return true if the version satisfies the range. + */ + function satisfies(version: string, range: string, loose?: boolean): boolean; + /** + * Return the highest version in the list that satisfies the range, or null if none of them do. + */ + function maxSatisfying(versions: string[], range: string, loose?: boolean): string; + /** + * Return true if version is greater than all the versions possible in the range. + */ + function gtr(version: string, range: string, loose?: boolean): boolean; + /** + * Return true if version is less than all the versions possible in the range. + */ + function ltr(version: string, range: string, loose?: boolean): boolean; + /** + * Return true if the version is outside the bounds of the range in either the high or low direction. The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.) + */ + function outside(version: string, range: string, hilo: string, loose?: boolean): boolean; class SemVerBase { - raw:string; - loose:boolean; - format():string; - inspect():string; - toString():string; + raw: string; + loose: boolean; + format(): string; + inspect(): string; + toString(): string; } - class SemVer extends SemVerBase { - constructor(version:string, loose?:boolean); + class SemVer extends SemVerBase { + constructor(version: string, loose?: boolean); - major:number; - minor:number; - patch:number; - version:string; - build:string[]; - prerelease:string[]; + major: number; + minor: number; + patch: number; + version: string; + build: string[]; + prerelease: string[]; - compare(other:SemVer):number; - compareMain(other:SemVer):number; - comparePre(other:SemVer):number; - inc(release:string):SemVer; + compare(other:SemVer): number; + compareMain(other:SemVer): number; + comparePre(other:SemVer): number; + inc(release: string): SemVer; } class Comparator extends SemVerBase { - constructor(comp:string, loose?:boolean); + constructor(comp: string, loose?: boolean); - semver:SemVer; - operator:string; - value:boolean; - parse(comp:string) :void; - test(version:SemVer):boolean; + semver: SemVer; + operator: string; + value: boolean; + parse(comp: string): void; + test(version:SemVer): boolean; } class Range extends SemVerBase { - constructor(range:string, loose?:boolean); + constructor(range: string, loose?: boolean); - set:Comparator[][]; - parseRange(range:string):Comparator[]; - test(version:SemVer):boolean; + set: Comparator[][]; + parseRange(range: string): Comparator[]; + test(version: SemVer): boolean; } } + declare module "semver" { -export = SemVerModule; + export = SemVerModule; } From 64d394d81a74bf817515f323bf22dfcc26426870 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Mon, 10 Nov 2014 13:16:30 -0500 Subject: [PATCH 111/135] Fixing tar.Pack to have an optional properties parameter. Adding in some JSDoc for the main methods, lifted directly from documentation, and adding a TODO for the future if someone decides to type the fstream library. --- tar/tar-tests.ts | 11 +++++++---- tar/tar.d.ts | 33 +++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/tar/tar-tests.ts b/tar/tar-tests.ts index 3a7783d52..b23ad7d06 100644 --- a/tar/tar-tests.ts +++ b/tar/tar-tests.ts @@ -1,8 +1,8 @@ /** -* Test suite created by Maxime LUCE -* -* Created by using code samples from https://github.com/npm/node-tar. -*/ + * Test suite created by Maxime LUCE + * + * Created by using code samples from https://github.com/npm/node-tar. + */ /// /// @@ -26,3 +26,6 @@ readStream.pipe(extract); extract.on("entry", (entry: any) => { }); + +var packStream: tar.PackStream = tar.Pack(); +packStream = tar.Pack({ path: 'test' }); diff --git a/tar/tar.d.ts b/tar/tar.d.ts index 6b25a02a7..3116b5cc9 100644 --- a/tar/tar.d.ts +++ b/tar/tar.d.ts @@ -2,13 +2,14 @@ // Project: https://github.com/npm/node-tar // Definitions by: Maxime LUCE // Definitions: https://github.com/borisyankov/DefinitelyTyped +// TODO: When/if typings for [fstream](https://github.com/npm/fstream) are written, refactor this typing to use it for the various streams. /// declare module "tar" { import stream = require("stream"); - //#region Interfaces + // #region Interfaces export interface HeaderProperties { path?: string; @@ -64,9 +65,9 @@ declare module "tar" { export interface ExtractStream extends ParseStream { } - //#endregion + // #endregion - //#region Enums + // #region Enums export var fields: { path: number; @@ -198,11 +199,31 @@ declare module "tar" { //#region Global Methods + /** + * Returns a writable stream. Write tar data to it and it will emit entry events for each entry parsed from the tarball. This is used by tar.Extract. + */ export function Parse(): ParseStream; - - export function Pack(props: HeaderProperties): PackStream; - + /** + * Returns a through stream. Use fstream to write files into the pack stream and you will receive tar archive data from the pack stream. + * This only works with directories, it does not work with individual files. + * The optional properties object are used to set properties in the tar 'Global Extended Header'. + */ + export function Pack(props?: HeaderProperties): PackStream; + /** + * Returns a through stream. Write tar data to the stream and the files in the tarball will be extracted onto the filesystem. + */ export function Extract(path: string): ExtractStream; + /** + * Returns a through stream. Write tar data to the stream and the files in the tarball will be extracted onto the filesystem. + * options can be: + * ``` + * { + * path: '/path/to/extract/tar/into', + * strip: 0, // how many path segments to strip from the root when extracting + * } + * ``` + * options also get passed to the fstream.Writer instance that tar uses internally. + */ export function Extract(opts: ExtractOptions): ExtractStream; //#endregion From 9cd13294ae6c8b16ea7595e2ca0ce12e04ece6bd Mon Sep 17 00:00:00 2001 From: Chris Martinez Date: Tue, 11 Nov 2014 12:24:13 -0500 Subject: [PATCH 112/135] Added lscache definition Added lscache definition --- CONTRIBUTORS.md | 3 ++- lscache/lscache-tests.ts | 13 +++++++++++++ lscache/lscache.d.ts | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 lscache/lscache-tests.ts create mode 100644 lscache/lscache.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a628bd481..e10ca14d4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,4 +1,4 @@ -# Contributors +# Contributors This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url. @@ -270,6 +270,7 @@ All definitions files include a header with the author and editors, so at some p * [Lodash](http://lodash.com/) (by [Brian Zengel](https://github.com/bczengel)) * [Logg](https://github.com/dpup/node-logg) (by [Bret Little](https://github.com/blittle)) * [Long.js](https://github.com/dcodeIO/Long.js) (by [Toshihide Hara](https://github.com/kerug)) +* [lscache](https://github.com/pamelafox/lscache) (by [Chris Martinez](https://github.com/Chris-Martinezz)) * [lz-string](https://github.com/pieroxy/lz-string) (by [Roman Nikitin](https://github.com/M0ns1gn0r)) * [Mapbox](https://github.com/mapbox/mapbox.js/) (by [Maxime Fabre](https://github.com/anahkiasen)) * [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr)) diff --git a/lscache/lscache-tests.ts b/lscache/lscache-tests.ts new file mode 100644 index 000000000..103cb6c8c --- /dev/null +++ b/lscache/lscache-tests.ts @@ -0,0 +1,13 @@ +/// + +// Copied examples directly from lscache github site with slight modifications + +lscache.set('greeting', 'Hello World!', 2); + +alert(lscache.get('greeting')); + +lscache.remove('greeting'); + +lscache.set('data', { 'name': 'Pamela', 'age': 26 }, 2); + +alert(lscache.get('data').name); \ No newline at end of file diff --git a/lscache/lscache.d.ts b/lscache/lscache.d.ts new file mode 100644 index 000000000..777c89421 --- /dev/null +++ b/lscache/lscache.d.ts @@ -0,0 +1,13 @@ +// Type definitions for lscache v1.0.2 +// Project: https://github.com/pamelafox/lscache +// Definitions by: Chris Martinez https://github.com/Chris-Martinezz +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface LSCache { + + set(key: string, value: any, time?: number): void; + get(key: string): any; + remove(key: string): void; +} + +declare var lscache: LSCache; \ No newline at end of file From 49e799b01b777784efd569212788e8baf2c40a58 Mon Sep 17 00:00:00 2001 From: Chris Martinez Date: Tue, 11 Nov 2014 12:33:12 -0500 Subject: [PATCH 113/135] Fix lscache header Fix lscache header so npm test passes. --- lscache/lscache.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lscache/lscache.d.ts b/lscache/lscache.d.ts index 777c89421..24c34bd8d 100644 --- a/lscache/lscache.d.ts +++ b/lscache/lscache.d.ts @@ -1,6 +1,6 @@ // Type definitions for lscache v1.0.2 // Project: https://github.com/pamelafox/lscache -// Definitions by: Chris Martinez https://github.com/Chris-Martinezz +// Definitions by: Chris Martinez // Definitions: https://github.com/borisyankov/DefinitelyTyped interface LSCache { From 792d0aa3c97d6367d5494bdc36f531c32bd8f296 Mon Sep 17 00:00:00 2001 From: "Yubing (Tom) Dong" Date: Tue, 11 Nov 2014 17:22:07 -0800 Subject: [PATCH 114/135] TrackballControls should extend EventDispatcher (threejs) Please see https://github.com/mrdoob/three.js/blob/master/examples/js/controls/Trac kballControls.js#L611 The prototype of THREE.TrackballControls is THREE.EventDispatcher.prototype. --- threejs/three-trackballcontrols.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threejs/three-trackballcontrols.d.ts b/threejs/three-trackballcontrols.d.ts index b4bda75ee..ad6ffa9c3 100644 --- a/threejs/three-trackballcontrols.d.ts +++ b/threejs/three-trackballcontrols.d.ts @@ -6,7 +6,7 @@ /// declare module THREE { - class TrackballControls { + class TrackballControls extends EventDispatcher { constructor(object:Camera, domElement?:HTMLElement); object:Camera; From eb3420c93c76638aadf8a5a6456f06611d4b061e Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Wed, 12 Nov 2014 01:57:38 -0200 Subject: [PATCH 115/135] update angular to released version 1.3+ --- .gitignore | 2 + angularjs/angular-cookies.d.ts | 4 +- angularjs/angular-tests.ts | 43 +++++++++- angularjs/angular.d.ts | 141 +++++++++++++++++++++++++-------- 4 files changed, 157 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index d4bc5dd91..bbbef0357 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ _infrastructure/tests/build !rx.js node_modules + +.sublimets diff --git a/angularjs/angular-cookies.d.ts b/angularjs/angular-cookies.d.ts index dc0c44908..0feffae83 100644 --- a/angularjs/angular-cookies.d.ts +++ b/angularjs/angular-cookies.d.ts @@ -15,7 +15,9 @@ declare module ng.cookies { // CookieService // see http://docs.angularjs.org/api/ngCookies.$cookies /////////////////////////////////////////////////////////////////////////// - interface ICookiesService {} + interface ICookiesService { + [index: string]: any; + } /////////////////////////////////////////////////////////////////////////// // CookieStoreService diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index 7adb0bab0..628b6d1d2 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -83,7 +83,7 @@ angular.module('http-auth-interceptor', []) } }]; - $httpProvider.responseInterceptors.push(interceptor); + $httpProvider.interceptors.push(interceptor); }]); @@ -326,6 +326,47 @@ class SampleDirective2 implements ng.IDirective { angular.module('SameplDirective', []).directive('sampleDirective', SampleDirective.instance).directive('sameplDirective2', SampleDirective2.instance); +angular.module('AnotherSampleDirective', []).directive('myDirective', ['$interpolate', '$q', ($interpolate: ng.IInterpolateService, $q: ng.IQService) => { + return { + restrict: 'A', + link: (scope: ng.IScope, el: ng.IAugmentedJQuery, attr: ng.IAttributes) => { + $interpolate(attr['test'])(scope); + $interpolate('', true)(scope); + $interpolate('', true, 'html')(scope); + $interpolate('', true, 'html', true)(scope); + var defer = $q.defer(); + defer.reject(); + defer.resolve(); + defer.promise.then(function(d) { + return d; + }).then(function(): any { + return null; + }, function(): any { + return null; + }) + .catch((): any => { + return null; + }) + .finally((): any => { + return null; + }); + var promise = new $q((resolve) => { + resolve(); + }); + + promise = new $q((resolve, reject) => { + reject(); + resolve(true); + }); + + promise = new $q((resolver, reject) => { + resolver(true); + reject(false); + }); + } + }; +}]); + // test from https://docs.angularjs.org/guide/directive angular.module('docsSimpleDirective', []) .controller('Controller', ['$scope', function($scope: any) { diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 4659da761..b5cc51daf 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -13,6 +13,11 @@ interface Function { $inject?: string[]; } +// Support AMD require +declare module 'angular' { + export = angular; +} + /////////////////////////////////////////////////////////////////////////////// // ng module (angular.js) /////////////////////////////////////////////////////////////////////////////// @@ -32,6 +37,10 @@ declare module ng { $get: any; } + interface IAngularBootstrapConfig { + strictDi?: boolean; + } + /////////////////////////////////////////////////////////////////////////// // AngularStatic // see http://docs.angularjs.org/api @@ -46,8 +55,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: string, modules?: string): auto.IInjectorService; + bootstrap(element: string, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -55,8 +66,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: string, modules?: Function): auto.IInjectorService; + bootstrap(element: string, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -64,8 +77,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: string, modules?: string[]): auto.IInjectorService; + bootstrap(element: string, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -73,8 +88,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: JQuery, modules?: string): auto.IInjectorService; + bootstrap(element: JQuery, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -82,8 +99,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: JQuery, modules?: Function): auto.IInjectorService; + bootstrap(element: JQuery, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -91,8 +110,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: JQuery, modules?: string[]): auto.IInjectorService; + bootstrap(element: JQuery, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -100,8 +121,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Element, modules?: string): auto.IInjectorService; + bootstrap(element: Element, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -109,8 +132,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Element, modules?: Function): auto.IInjectorService; + bootstrap(element: Element, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -118,8 +143,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Element, modules?: string[]): auto.IInjectorService; + bootstrap(element: Element, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -127,8 +154,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Document, modules?: string): auto.IInjectorService; + bootstrap(element: Document, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -136,8 +165,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Document, modules?: Function): auto.IInjectorService; + bootstrap(element: Document, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -145,8 +176,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Document, modules?: string[]): auto.IInjectorService; + bootstrap(element: Document, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Creates a deep copy of source, which should be an object or an array. @@ -230,6 +263,7 @@ declare module ng { configFn?: Function): IModule; noop(...args: any[]): void; + reloadWithDebugInfo(): void; toJson(obj: any, pretty?: boolean): string; uppercase(str: string): string; version: { @@ -412,6 +446,7 @@ declare module ng { $commitViewValue(): void; $rollbackViewValue(): void; $setSubmitted(): void; + $setUntouched(): void; } /////////////////////////////////////////////////////////////////////////// @@ -423,13 +458,13 @@ declare module ng { $setValidity(validationErrorKey: string, isValid: boolean): void; // Documentation states viewValue and modelValue to be a string but other // types do work and it's common to use them. - $setViewValue(value: any): void; + $setViewValue(value: any, trigger?: string): void; $setPristine(): void; $validate(): void; $setTouched(): void; $setUntouched(): void; $rollbackViewValue(): void; - $commitViewValue(revalidate?: boolean): void; + $commitViewValue(): void; $isEmpty(value: any): boolean; $viewValue: any; @@ -448,6 +483,7 @@ declare module ng { $validators: IModelValidators; $asyncValidators: IAsyncModelValidators; + $pending: any; $pristine: boolean; $dirty: boolean; $valid: boolean; @@ -479,10 +515,13 @@ declare module ng { * see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope */ interface IRootScopeService { + [index: string]: any; + $apply(): any; $apply(exp: string): any; $apply(exp: (scope: IScope) => any): any; - + + $applyAsync(): any; $applyAsync(exp: string): any; $applyAsync(exp: (scope: IScope) => any): any; @@ -491,14 +530,20 @@ declare module ng { $digest(): void; $emit(name: string, ...args: any[]): IAngularEvent; - $eval(expression?: string, args?: Object): any; - $eval(expression?: (scope: IScope) => any, args?: Object): any; + $eval(): any; + $eval(expression: string): any; + $eval(expression: string, locals: Object): any; + $eval(expression: (scope: IScope) => any): any; + $eval(expression: (scope: IScope) => any, locals: Object): any; - $evalAsync(expression?: string): void; - $evalAsync(expression?: (scope: IScope) => any): void; + $evalAsync(): void; + $evalAsync(expression: string): void; + $evalAsync(expression: (scope: IScope) => any): void; // Defaults to false by the implementation checking strategy - $new(isolate?: boolean): IScope; + $new(): IScope; + $new(isolate: boolean): IScope; + $new(isolate: boolean, parent: IScope): IScope; /** * Listens on events of a given type. See $emit for discussion of event life cycle. @@ -522,10 +567,7 @@ declare module ng { $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; $parent: IScope; - $root: IRootScopeService; - this: IRootScopeService; - $id: number; // Hidden members @@ -533,9 +575,7 @@ declare module ng { $$phase: any; } - interface IScope extends IRootScopeService { - [index: string]: any; - } + interface IScope extends IRootScopeService { } interface IAngularEvent { /** @@ -585,7 +625,9 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$timeout /////////////////////////////////////////////////////////////////////////// interface ITimeoutService { - (func: Function, delay?: number, invokeApply?: boolean): IPromise; + (func: Function): IPromise; + (func: Function, delay: number): IPromise; + (func: Function, delay: number, invokeApply: boolean): IPromise; cancel(promise: IPromise): boolean; } @@ -594,7 +636,9 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$interval /////////////////////////////////////////////////////////////////////////// interface IIntervalService { - (func: Function, delay: number, count?: number, invokeApply?: boolean): IPromise; + (func: Function, delay: number): IPromise; + (func: Function, delay: number, count: number): IPromise; + (func: Function, delay: number, count: number, invokeApply: boolean): IPromise; cancel(promise: IPromise): boolean; } @@ -812,6 +856,8 @@ declare module ng { */ search(search: string, paramValue: boolean): ILocationService; + state(): any; + state(state: any): ILocationService; url(): string; url(url: string): ILocationService; } @@ -847,12 +893,20 @@ declare module ng { /////////////////////////////////////////////////////////////////////////// interface IRootElementService extends JQuery {} + interface IQResolveReject { + (): void; + (value: T): void; + } /** * $q - service in module ng * A promise/deferred implementation inspired by Kris Kowal's Q. * See http://docs.angularjs.org/api/ng/service/$q */ interface IQService { + new (resolver: (resolve: IQResolveReject) => any): IPromise; + new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; + new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; + /** * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. * @@ -955,6 +1009,7 @@ declare module ng { /////////////////////////////////////////////////////////////////////////// interface IAnchorScrollService { (): void; + yOffset: any; } interface IAnchorScrollProvider extends IServiceProvider { @@ -1014,6 +1069,9 @@ declare module ng { imgSrcSanitizationWhitelist(): RegExp; imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider; + + debugInfoEnabled(): any; + debugInfoEnabled(enabled: boolean): any; } interface ICloneAttachFunction { @@ -1048,6 +1106,7 @@ declare module ng { interface IControllerProvider extends IServiceProvider { register(name: string, controllerConstructor: Function): void; register(name: string, dependencyAnnotatedConstructor: any[]): void; + allowGlobals(): void; } /** @@ -1227,10 +1286,22 @@ declare module ng { then(successCallback: (response: IHttpPromiseCallbackArg) => TResult, errorCallback?: (response: IHttpPromiseCallbackArg) => any): IPromise; } + interface IHttpProviderDefaults { + xsrfCookieName?: string; + xsrfHeaderName?: string; + headers?: { + common?: any; + post?: any; + put?: any; + patch?: any; + } + } + interface IHttpProvider extends IServiceProvider { - defaults: IRequestConfig; + defaults: IHttpProviderDefaults; interceptors: any[]; - responseInterceptors: any[]; + useApplyAsync(): boolean; + useApplyAsync(value: boolean): IHttpProvider; } /////////////////////////////////////////////////////////////////////////// @@ -1249,7 +1320,10 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$interpolateProvider /////////////////////////////////////////////////////////////////////////// interface IInterpolateService { - (text: string, mustHaveExpression?: boolean): IInterpolationFunction; + (text: string): IInterpolationFunction; + (text: string, mustHaveExpression: boolean): IInterpolationFunction; + (text: string, mustHaveExpression: boolean, trustedContext: string): IInterpolationFunction; + (text: string, mustHaveExpression: boolean, trustedContext: string, allOrNothing: boolean): IInterpolationFunction; endSymbol(): string; startSymbol(): string; } @@ -1345,6 +1419,11 @@ declare module ng { * @return A promise whose value is the template content. */ (tpl: string, ignoreRequestError?: boolean): IPromise; + /** + * total amount of pending template requests being downloaded. + * @type {number} + */ + totalPendingRequests: number; } /////////////////////////////////////////////////////////////////////////// From 91ea0ef4cec935d3777ff805f8beea695be98364 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Wed, 12 Nov 2014 06:04:00 -0200 Subject: [PATCH 116/135] squash! update angular to released version 1.3+ undo optionals --- angularjs/angular.d.ts | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index b5cc51daf..d28c40e21 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -531,19 +531,15 @@ declare module ng { $emit(name: string, ...args: any[]): IAngularEvent; $eval(): any; - $eval(expression: string): any; - $eval(expression: string, locals: Object): any; - $eval(expression: (scope: IScope) => any): any; - $eval(expression: (scope: IScope) => any, locals: Object): any; + $eval(expression: string, locals?: Object): any; + $eval(expression: (scope: IScope) => any, locals?: Object): any; $evalAsync(): void; $evalAsync(expression: string): void; $evalAsync(expression: (scope: IScope) => any): void; // Defaults to false by the implementation checking strategy - $new(): IScope; - $new(isolate: boolean): IScope; - $new(isolate: boolean, parent: IScope): IScope; + $new(isolate?: boolean, parent?: IScope): IScope; /** * Listens on events of a given type. See $emit for discussion of event life cycle. @@ -625,9 +621,7 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$timeout /////////////////////////////////////////////////////////////////////////// interface ITimeoutService { - (func: Function): IPromise; - (func: Function, delay: number): IPromise; - (func: Function, delay: number, invokeApply: boolean): IPromise; + (func: Function, delay?: number, invokeApply?: boolean): IPromise; cancel(promise: IPromise): boolean; } @@ -636,9 +630,7 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$interval /////////////////////////////////////////////////////////////////////////// interface IIntervalService { - (func: Function, delay: number): IPromise; - (func: Function, delay: number, count: number): IPromise; - (func: Function, delay: number, count: number, invokeApply: boolean): IPromise; + (func: Function, delay?: number, count?: number, invokeApply?: boolean): IPromise; cancel(promise: IPromise): boolean; } @@ -747,8 +739,8 @@ declare module ng { } interface ILogProvider { - debugEnabled(enabled: boolean): ILogProvider; debugEnabled(): boolean; + debugEnabled(enabled: boolean): ILogProvider; } // We define this as separete interface so we can reopen it later for @@ -1070,8 +1062,7 @@ declare module ng { imgSrcSanitizationWhitelist(): RegExp; imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider; - debugInfoEnabled(): any; - debugInfoEnabled(enabled: boolean): any; + debugInfoEnabled(enabled?: boolean): any; } interface ICloneAttachFunction { @@ -1320,10 +1311,7 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$interpolateProvider /////////////////////////////////////////////////////////////////////////// interface IInterpolateService { - (text: string): IInterpolationFunction; - (text: string, mustHaveExpression: boolean): IInterpolationFunction; - (text: string, mustHaveExpression: boolean, trustedContext: string): IInterpolationFunction; - (text: string, mustHaveExpression: boolean, trustedContext: string, allOrNothing: boolean): IInterpolationFunction; + (text: string, mustHaveExpression?: boolean, trustedContext?: string, allOrNothing?: boolean): IInterpolationFunction; endSymbol(): string; startSymbol(): string; } @@ -1443,7 +1431,7 @@ declare module ng { instanceAttributes: IAttributes, controller: any, transclude: ITranscludeFunction - ): void; + ): void; } interface IDirectivePrePost { @@ -1456,7 +1444,7 @@ declare module ng { templateElement: IAugmentedJQuery, templateAttributes: IAttributes, transclude: ITranscludeFunction - ): IDirectivePrePost; + ): IDirectivePrePost; } interface IDirective { From a3b4851dfce1ae035e0e57b18673f4cd65f25b1e Mon Sep 17 00:00:00 2001 From: Martin Poelstra Date: Wed, 12 Nov 2014 11:19:15 +0100 Subject: [PATCH 117/135] Update Bluebird typings to 2.x and fix some issues: - 'Old' typings moved to "-1.0" version - Not all v2 methods are added yet - Promise also implements Inspection - .finally() doesn't get the value in its callback - .done() returns void, not a Promise - Add .tap() and .setScheduler() - Add error types for use in e.g. catch()'ing specific errors - Inspection.error() renamed to .reason() --- bluebird/bluebird-1.0-tests.ts | 882 +++++++++++++++++++++++++++++++++ bluebird/bluebird-1.0.d.ts | 670 +++++++++++++++++++++++++ bluebird/bluebird-tests.ts | 73 +-- bluebird/bluebird.d.ts | 64 ++- 4 files changed, 1648 insertions(+), 41 deletions(-) create mode 100644 bluebird/bluebird-1.0-tests.ts create mode 100644 bluebird/bluebird-1.0.d.ts diff --git a/bluebird/bluebird-1.0-tests.ts b/bluebird/bluebird-1.0-tests.ts new file mode 100644 index 000000000..f04317f6a --- /dev/null +++ b/bluebird/bluebird-1.0-tests.ts @@ -0,0 +1,882 @@ +/// + +// Tests by: Bart van der Schoor + +// Note: replicate changes to all overloads in both definition and test file +// Note: keep both static and instance members inline (so similar) + +// Note: try to maintain the ordering and separators, and keep to the pattern + +var obj: Object; +var bool: boolean; +var num: number; +var str: string; +var err: Error; +var x: any; +var f: Function; +var func: Function; +var arr: any[]; +var exp: RegExp; +var anyArr: any[]; +var strArr: string[]; +var numArr: number[]; + +// - - - - - - - - - - - - - - - - - + +var value: any; +var reason: any; +var insanity: any; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +interface Foo { + foo(): string; +} +interface Bar { + bar(): string; +} + +// - - - - - - - - - - - - - - - - - + +interface StrFooMap { + [key:string]:Foo; +} + +interface StrBarMap { + [key:string]:Bar; +} + +// - - - - - - - - - - - - - - - - - + +interface StrFooArrMap { + [key:string]:Foo[]; +} + +interface StrBarArrMap { + [key:string]:Bar[]; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +var foo: Foo; +var bar: Bar; + +var fooArr: Foo[]; +var barArr: Bar[]; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +var numProm: Promise; +var strProm: Promise; +var anyProm: Promise; +var boolProm: Promise; +var objProm: Promise; +var voidProm: Promise; + +var fooProm: Promise; +var barProm: Promise; + +// - - - - - - - - - - - - - - - - - + +var numThen: Promise.Thenable; +var strThen: Promise.Thenable; +var anyThen: Promise.Thenable; +var boolThen: Promise.Thenable; +var objThen: Promise.Thenable; +var voidThen: Promise.Thenable; + +var fooThen: Promise.Thenable; +var barThen: Promise.Thenable; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +var numArrProm: Promise; +var strArrProm: Promise; +var anyArrProm: Promise; + +var fooArrProm: Promise; +var barArrProm: Promise; + +// - - - - - - - - - - - - - - - - - + +var numArrThen: Promise.Thenable; +var strArrThen: Promise.Thenable; +var anyArrThen: Promise.Thenable; + +var fooArrThen: Promise.Thenable; +var barArrThen: Promise.Thenable; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +var numPromArr: Promise[]; +var strPromArr: Promise[]; +var anyPromArr: Promise[]; + +var fooPromArr: Promise[]; +var barPromArr: Promise[]; + +// - - - - - - - - - - - - - - - - - + +var numThenArr: Promise.Thenable[]; +var strThenArr: Promise.Thenable[]; +var anyThenArr: Promise.Thenable[]; + +var fooThenArr: Promise.Thenable[]; +var barThenArr: Promise.Thenable[]; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// booya! +var fooThenArrThen: Promise.Thenable[]>; +var barThenArrThen: Promise.Thenable[]>; + +var fooResolver: Promise.Resolver; +var barResolver: Promise.Resolver; + +var fooInspection: Promise.Inspection; +var barInspection: Promise.Inspection; + +var fooInspectionArrProm: Promise[]>; +var barInspectionArrProm: Promise[]>; + +var BlueBird: typeof Promise; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooThen = fooProm; +barThen = barProm; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = new Promise((resolve: (value: Foo) => void, reject: (reason: any) => void) => { + if (bool) { + resolve(foo); + } + else { + reject(new Error(str)); + } +}); +fooProm = new Promise((resolve: (value: Foo) => void) => { + if (bool) { + resolve(foo); + } +}); + +// - - - - - - - - - - - - - - - - - - - - - - - + +// needs a hint when used untyped? +fooProm = new Promise((resolve, reject) => { + if (bool) { + resolve(fooThen); + } + else { + reject(new Error(str)); + } +}); +fooProm = new Promise((resolve) => { + resolve(fooThen); +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooResolver.resolve(foo); + +fooResolver.reject(err); + +fooResolver.progress(bar); + +fooResolver.callback = (err: any, value: Foo) => { + +}; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +bool = fooInspection.isFulfilled(); + +bool = fooInspection.isRejected(); + +bool = fooInspection.isPending(); + +foo = fooInspection.value(); + +x = fooInspection.error(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.then((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}, (note: any) => { + return bar; +}); +barProm = fooProm.then((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}); +barProm = fooProm.then((value: Foo) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.catch((reason: any) => { + return bar; +}); +barProm = fooProm.caught((reason: any) => { + return bar; +}); + +barProm = fooProm.catch((reason: any) => { + return bar; +}, (reason: any) => { + return bar; +}); +barProm = fooProm.caught((reason: any) => { + return bar; +}, (reason: any) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.catch(Error, (reason: any) => { + return bar; +}); +barProm = fooProm.caught(Error, (reason: any) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.error((reason: any) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.finally((value: Foo) => { + // return is ignored + return foo; +}); +fooProm = fooProm.finally((value: Foo) => { + // return is ignored + return fooThen; +}); +fooProm = fooProm.finally((value: Foo) => { + // return is ignored +}); +fooProm = fooProm.finally(() => { + // return is ignored +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.lastly((value: Foo) => { + // return is ignored + return foo; +}); +fooProm = fooProm.lastly((value: Foo) => { + // return is ignored + return fooThen; +}); +fooProm = fooProm.lastly((value: Foo) => { + // return is ignored +}); +fooProm = fooProm.lastly(() => { + // return is ignored +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.bind(obj); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.done((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}, (note: any) => { + +}); +barProm = fooProm.done((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}); +barProm = fooProm.done((value: Foo) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.done((value: Foo) => { + return barThen; +}, (reason: any) => { + return barThen; +}, (note: any) => { + +}); +barProm = fooProm.done((value: Foo) => { + return barThen; +}, (reason: any) => { + return barThen; +}); +barProm = fooProm.done((value: Foo) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.progressed((note: any) => { + return foo; +}); +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.delay(num); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.timeout(num); +fooProm = fooProm.timeout(num, str); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm.nodeify(); +fooProm = fooProm.nodeify((err: any) => { + +}); +fooProm = fooProm.nodeify((err: any, foo?: Foo) => { + +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.fork((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}, (note: any) => { + +}); +barProm = fooProm.fork((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}); +barProm = fooProm.fork((value: Foo) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.fork((value: Foo) => { + return barThen; +}, (reason: any) => { + return barThen; +}, (note: any) => { + +}); +barProm = fooProm.fork((value: Foo) => { + return barThen; +}, (reason: any) => { + return barThen; +}); +barProm = fooProm.fork((value: Foo) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.cancel(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.cancellable(); +fooProm = fooProm.uncancellable(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +bool = fooProm.isCancellable(); +bool = fooProm.isFulfilled(); +bool = fooProm.isRejected(); +bool = fooProm.isPending(); +bool = fooProm.isResolved(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooInspection = fooProm.inspect(); + +anyProm = fooProm.call(str); +anyProm = fooProm.call(str, 1, 2, 3); + +//TODO enable get() test when implemented +// barProm = fooProm.get(str); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.return(bar); +barProm = fooProm.thenReturn(bar); + +voidProm = fooProm.return(); +voidProm = fooProm.thenReturn(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooProm +fooProm = fooProm.throw(err); +fooProm = fooProm.thenThrow(err); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +str = fooProm.toString(); + +obj = fooProm.toJSON(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooArrProm.spread((one: Foo, two: Bar) => { + return bar; +}, (reason: any) => { + return bar; +}); +barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - + +barProm = fooArrProm.spread((one: Foo, two: Bar) => { + return barThen; +}, (reason: any) => { + return barThen; +}); +barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO fix collection inference + +barArrProm = fooProm.all(); + +objProm = fooProm.props(); + +barInspectionArrProm = fooProm.settle(); + +barProm = fooProm.any(); + +barArrProm = fooProm.some(num); + +barProm = fooProm.race(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO fix collection inference + +barArrProm = fooProm.map((item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = fooProm.map((item: Foo) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { + return memo; +}); +barProm = fooProm.reduce((memo: Bar, item: Foo) => { + return memo; +}, bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { + return bool; +}); +fooArrProm = fooArrProm.filter((item: Foo) => { + return bool; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +fooProm = Promise.try(() => { + return foo; +}); +fooProm = Promise.try(() => { + return foo; +}, arr); +fooProm = Promise.try(() => { + return foo; +}, arr, x); + +// - - - - - - - - - - - - - - - - - + +fooProm = Promise.try(() => { + return fooThen; +}); +fooProm = Promise.try(() => { + return fooThen; +}, arr); +fooProm = Promise.try(() => { + return fooThen; +}, arr, x); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = Promise.attempt(() => { + return foo; +}); +fooProm = Promise.attempt(() => { + return foo; +}, arr); +fooProm = Promise.attempt(() => { + return foo; +}, arr, x); + +// - - - - - - - - - - - - - - - - - + +fooProm = Promise.attempt(() => { + return fooThen; +}); +fooProm = Promise.attempt(() => { + return fooThen; +}, arr); +fooProm = Promise.attempt(() => { + return fooThen; +}, arr, x); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +func = Promise.method(function () { + +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = Promise.resolve(foo); +fooProm = Promise.resolve(fooThen); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +voidProm = Promise.reject(reason); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooResolver = Promise.defer(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = Promise.cast(foo); +fooProm = Promise.cast(fooThen); + +voidProm = Promise.bind(x); + +bool = Promise.is(value); + +Promise.longStackTraces(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO enable delay + +fooProm = Promise.delay(fooThen, num); +fooProm = Promise.delay(foo, num); +voidProm = Promise.delay(num); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +func = Promise.promisify(f); +func = Promise.promisify(f, obj); +; + +obj = Promise.promisifyAll(obj); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO enable generator +/* + func = Promise.coroutine(f); + + barProm = Promise.spawn(f); + */ +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +BlueBird = Promise.noConflict(); + +Promise.onPossiblyUnhandledRejection((reason: any) => { + +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO expand tests to overloads +fooArrProm = Promise.all(fooThenArrThen); +fooArrProm = Promise.all(fooArrProm); +fooArrProm = Promise.all(fooThenArr); +fooArrProm = Promise.all(fooArr); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +objProm = Promise.props(objProm); +objProm = Promise.props(obj); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO expand tests to overloads +fooInspectionArrProm = Promise.settle(fooThenArrThen); +fooInspectionArrProm = Promise.settle(fooArrProm); +fooInspectionArrProm = Promise.settle(fooThenArr); +fooInspectionArrProm = Promise.settle(fooArr); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO expand tests to overloads +fooProm = Promise.any(fooThenArrThen); +fooProm = Promise.any(fooArrProm); +fooProm = Promise.any(fooThenArr); +fooProm = Promise.any(fooArr); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO expand tests to overloads +fooProm = Promise.race(fooThenArrThen); +fooProm = Promise.race(fooArrProm); +fooProm = Promise.race(fooThenArr); +fooProm = Promise.race(fooArr); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO expand tests to overloads +fooArrProm = Promise.some(fooThenArrThen, num); +fooArrProm = Promise.some(fooArrThen, num); +fooArrProm = Promise.some(fooThenArr, num); +fooArrProm = Promise.some(fooArr, num); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooArrProm = Promise.join(foo, foo, foo); +fooArrProm = Promise.join(fooThen, fooThen, fooThen); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// map() + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArrThen + +barArrProm = Promise.map(fooThenArrThen, (item: Foo) => { + return bar; +}); +barArrProm = Promise.map(fooThenArrThen, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.map(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.map(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArrThen + +barArrProm = Promise.map(fooArrThen, (item: Foo) => { + return bar; +}); +barArrProm = Promise.map(fooArrThen, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.map(fooArrThen, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.map(fooArrThen, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArr + +barArrProm = Promise.map(fooThenArr, (item: Foo) => { + return bar; +}); +barArrProm = Promise.map(fooThenArr, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.map(fooThenArr, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.map(fooThenArr, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArr + +barArrProm = Promise.map(fooArr, (item: Foo) => { + return bar; +}); +barArrProm = Promise.map(fooArr, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.map(fooArr, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.map(fooArr, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// reduce() + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArrThen + +barProm = Promise.reduce(fooThenArrThen, (memo: Bar, item: Foo) => { + return memo; +}, bar); +barProm = Promise.reduce(fooThenArrThen, (memo: Bar, item: Foo) => { + return barThen; +}, bar); +barProm = Promise.reduce(fooThenArrThen, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return memo; +}, bar); +barProm = Promise.reduce(fooThenArrThen, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return barThen; +}, bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArrThen + +barProm = Promise.reduce(fooArrThen, (memo: Bar, item: Foo) => { + return memo; +}, bar); +barProm = Promise.reduce(fooArrThen, (memo: Bar, item: Foo) => { + return barThen; +}, bar); +barProm = Promise.reduce(fooArrThen, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return memo; +}, bar); +barProm = Promise.reduce(fooArrThen, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return barThen; +}, bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArr + +barProm = Promise.reduce(fooThenArr, (memo: Bar, item: Foo) => { + return memo; +}, bar); +barProm = Promise.reduce(fooThenArr, (memo: Bar, item: Foo) => { + return barThen; +}, bar); +barProm = Promise.reduce(fooThenArr, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return memo; +}, bar); +barProm = Promise.reduce(fooThenArr, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return barThen; +}, bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArr + +barProm = Promise.reduce(fooArr, (memo: Bar, item: Foo) => { + return memo; +}, bar); +barProm = Promise.reduce(fooArr, (memo: Bar, item: Foo) => { + return barThen; +}, bar); +barProm = Promise.reduce(fooArr, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return memo; +}, bar); +barProm = Promise.reduce(fooArr, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return barThen; +}, bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// filter() + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArrThen + +fooArrProm = Promise.filter(fooThenArrThen, (item: Foo) => { + return bool; +}); +fooArrProm = Promise.filter(fooThenArrThen, (item: Foo) => { + return boolThen; +}); +fooArrProm = Promise.filter(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => { + return bool; +}); +fooArrProm = Promise.filter(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => { + return boolThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArrThen + +fooArrProm = Promise.filter(fooArrThen, (item: Foo) => { + return bool; +}); +fooArrProm = Promise.filter(fooArrThen, (item: Foo) => { + return boolThen; +}); +fooArrProm = Promise.filter(fooArrThen, (item: Foo, index: number, arrayLength: number) => { + return bool; +}); +fooArrProm = Promise.filter(fooArrThen, (item: Foo, index: number, arrayLength: number) => { + return boolThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArr + +fooArrProm = Promise.filter(fooThenArr, (item: Foo) => { + return bool; +}); +fooArrProm = Promise.filter(fooThenArr, (item: Foo) => { + return boolThen; +}); +fooArrProm = Promise.filter(fooThenArr, (item: Foo, index: number, arrayLength: number) => { + return bool; +}); +fooArrProm = Promise.filter(fooThenArr, (item: Foo, index: number, arrayLength: number) => { + return boolThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArr + +fooArrProm = Promise.filter(fooArr, (item: Foo) => { + return bool; +}); +fooArrProm = Promise.filter(fooArr, (item: Foo) => { + return boolThen; +}); +fooArrProm = Promise.filter(fooArr, (item: Foo, index: number, arrayLength: number) => { + return bool; +}); +fooArrProm = Promise.filter(fooArr, (item: Foo, index: number, arrayLength: number) => { + return boolThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bluebird/bluebird-1.0.d.ts b/bluebird/bluebird-1.0.d.ts new file mode 100644 index 000000000..210032f86 --- /dev/null +++ b/bluebird/bluebird-1.0.d.ts @@ -0,0 +1,670 @@ +// Type definitions for bluebird 1.0.0 +// Project: https://github.com/petkaantonov/bluebird +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// ES6 model with generics overload was sourced and trans-multiplied from es6-promises.d.ts +// By: Campredon + +// Warning: recommended to use `tsc > v0.9.7` (critical bugs in earlier generic code): +// - https://github.com/borisyankov/DefinitelyTyped/issues/1563 + +// Note: replicate changes to all overloads in both definition and test file +// Note: keep both static and instance members inline (so similar) + +// TODO fix remaining TODO annotations in both definition and test + +// TODO verify support to have no return statement in handlers to get a Promise (more overloads?) + +declare class Promise implements Promise.Thenable { + /** + * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. + */ + constructor(callback: (resolve: (thenable: Promise.Thenable) => void, reject: (error: any) => void) => void); + constructor(callback: (resolve: (result: R) => void, reject: (error: any) => void) => void); + + /** + * Promises/A+ `.then()` with progress handler. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. + */ + then(onFulfill: (value: R) => Promise.Thenable, onReject: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + then(onFulfill: (value: R) => Promise.Thenable, onReject?: (error: any) => U, onProgress?: (note: any) => any): Promise; + then(onFulfill: (value: R) => U, onReject: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + then(onFulfill?: (value: R) => U, onReject?: (error: any) => U, onProgress?: (note: any) => any): Promise; + + /** + * This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler. + * + * Alias `.caught();` for compatibility with earlier ECMAScript version. + */ + catch(onReject?: (error: any) => Promise.Thenable): Promise; + caught(onReject?: (error: any) => Promise.Thenable): Promise; + + catch(onReject?: (error: any) => U): Promise; + caught(onReject?: (error: any) => U): Promise; + + /** + * This extends `.catch` to work more like catch-clauses in languages like Java or C#. Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler. The catch handler that is first met that has eligible constructors specified, is the one that will be called. + * + * This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. The return result of the predicate will be used determine whether the error handler should be called. + * + * Alias `.caught();` for compatibility with earlier ECMAScript version. + */ + catch(predicate: (error: any) => boolean, onReject: (error: any) => Promise.Thenable): Promise; + caught(predicate: (error: any) => boolean, onReject: (error: any) => Promise.Thenable): Promise; + + catch(predicate: (error: any) => boolean, onReject: (error: any) => U): Promise; + caught(predicate: (error: any) => boolean, onReject: (error: any) => U): Promise; + + catch(ErrorClass: Function, onReject: (error: any) => Promise.Thenable): Promise; + caught(ErrorClass: Function, onReject: (error: any) => Promise.Thenable): Promise; + + catch(ErrorClass: Function, onReject: (error: any) => U): Promise; + caught(ErrorClass: Function, onReject: (error: any) => U): Promise; + + /** + * Like `.catch` but instead of catching all types of exceptions, it only catches those that don't originate from thrown errors but rather from explicit rejections. + */ + error(onReject: (reason: any) => Promise.Thenable): Promise; + error(onReject: (reason: any) => U): Promise; + + /** + * Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. There are special semantics for `.finally()` in that the final value cannot be modified from the handler. + * + * Alias `.lastly();` for compatibility with earlier ECMAScript version. + */ + finally(handler: (value: R) => Promise.Thenable): Promise; + finally(handler: (value: R) => R): Promise; + finally(handler: (value: R) => void): Promise; + + lastly(handler: (value: R) => Promise.Thenable): Promise; + lastly(handler: (value: R) => R): Promise; + lastly(handler: (value: R) => void): Promise; + + /** + * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. + */ + bind(thisArg: any): Promise; + + /** + * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. + */ + done(onFulfilled: (value: R) => Promise.Thenable, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + done(onFulfilled: (value: R) => Promise.Thenable, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + done(onFulfilled: (value: R) => U, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + done(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + + /** + * Shorthand for `.then(null, null, handler);`. Attach a progress handler that will be called if this promise is progressed. Returns a new promise chained from this promise. + */ + progressed(handler: (note: any) => any): Promise; + + /** + * Same as calling `Promise.delay(this, ms)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + delay(ms: number): Promise; + + /** + * Returns a promise that will be fulfilled with this promise's fulfillment value or rejection reason. However, if this promise is not fulfilled or rejected within `ms` milliseconds, the returned promise is rejected with a `Promise.TimeoutError` instance. + * + * You may specify a custom error message with the `message` parameter. + */ + timeout(ms: number, message?: string): Promise; + + /** + * Register a node-style callback on this promise. When this promise is is either fulfilled or rejected, the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. The error argument will be `null` in case of success. + * Returns back this promise instead of creating a new one. If the `callback` argument is not a function, this method does not do anything. + */ + nodeify(callback: (err: any, value?: R) => void): Promise; + nodeify(...sink: any[]): void; + + /** + * Marks this promise as cancellable. Promises by default are not cancellable after v0.11 and must be marked as such for `.cancel()` to have any effect. Marking a promise as cancellable is infectious and you don't need to remark any descendant promise. + */ + cancellable(): Promise; + + /** + * Cancel this promise. The cancellation will propagate to farthest cancellable ancestor promise which is still pending. + * + * That ancestor will then be rejected with a `CancellationError` (get a reference from `Promise.CancellationError`) object as the rejection reason. + * + * In a promise rejection handler you may check for a cancellation by seeing if the reason object has `.name === "Cancel"`. + * + * Promises are by default not cancellable. Use `.cancellable()` to mark a promise as cancellable. + */ + // TODO what to do with this? + cancel(): Promise; + + /** + * Like `.then()`, but cancellation of the the returned promise or any of its descendant will not propagate cancellation to this promise or this promise's ancestors. + */ + fork(onFulfilled: (value: R) => Promise.Thenable, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + fork(onFulfilled: (value: R) => Promise.Thenable, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + fork(onFulfilled: (value: R) => U, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + fork(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + + /** + * Create an uncancellable promise based on this promise. + */ + uncancellable(): Promise; + + /** + * See if this promise can be cancelled. + */ + isCancellable(): boolean; + + /** + * See if this `promise` has been fulfilled. + */ + isFulfilled(): boolean; + + /** + * See if this `promise` has been rejected. + */ + isRejected(): boolean; + + /** + * See if this `promise` is still defer. + */ + isPending(): boolean; + + /** + * See if this `promise` is resolved -> either fulfilled or rejected. + */ + isResolved(): boolean; + + /** + * Synchronously inspect the state of this `promise`. The `PromiseInspection` will represent the state of the promise as snapshotted at the time of calling `.inspect()`. + */ + inspect(): Promise.Inspection; + + /** + * This is a convenience method for doing: + * + * + * promise.then(function(obj){ + * return obj[propertyName].call(obj, arg...); + * }); + * + */ + call(propertyName: string, ...args: any[]): Promise; + + /** + * This is a convenience method for doing: + * + * + * promise.then(function(obj){ + * return obj[propertyName]; + * }); + * + */ + // TODO find way to fix get() + // get(propertyName: string): Promise; + + /** + * Convenience method for: + * + * + * .then(function() { + * return value; + * }); + * + * + * in the case where `value` doesn't change its value. That means `value` is bound at the time of calling `.return()` + * + * Alias `.thenReturn();` for compatibility with earlier ECMAScript version. + */ + return(): Promise; + thenReturn(): Promise; + return(value: U): Promise; + thenReturn(value: U): Promise; + + /** + * Convenience method for: + * + * + * .then(function() { + * throw reason; + * }); + * + * Same limitations apply as with `.return()`. + * + * Alias `.thenThrow();` for compatibility with earlier ECMAScript version. + */ + throw(reason: Error): Promise; + thenThrow(reason: Error): Promise; + + /** + * Convert to String. + */ + toString(): string; + + /** + * This is implicitly called by `JSON.stringify` when serializing the object. Returns a serialized representation of the `Promise`. + */ + toJSON(): Object; + + /** + * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. + */ + // TODO how to model instance.spread()? like Q? + spread(onFulfill: Function, onReject?: (reason: any) => Promise.Thenable): Promise; + spread(onFulfill: Function, onReject?: (reason: any) => U): Promise; + /* + // TODO or something like this? + spread(onFulfill: (...values: W[]) => Promise.Thenable, onReject?: (reason: any) => Promise.Thenable): Promise; + spread(onFulfill: (...values: W[]) => Promise.Thenable, onReject?: (reason: any) => U): Promise; + spread(onFulfill: (...values: W[]) => U, onReject?: (reason: any) => Promise.Thenable): Promise; + spread(onFulfill: (...values: W[]) => U, onReject?: (reason: any) => U): Promise; + */ + /** + * Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + all(): Promise; + + /** + * Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO how to model instance.props()? + props(): Promise; + + /** + * Same as calling `Promise.settle(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + settle(): Promise[]>; + + /** + * Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + any(): Promise; + + /** + * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + some(count: number): Promise; + + /** + * Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + race(): Promise; + + /** + * Same as calling `Promise.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + map(mapper: (item: Q, index: number, arrayLength: number) => Promise.Thenable): Promise; + map(mapper: (item: Q, index: number, arrayLength: number) => U): Promise; + + /** + * Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; + reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U, initialValue?: U): Promise; + + /** + * Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + filter(filterer: (item: U, index: number, arrayLength: number) => Promise.Thenable): Promise; + filter(filterer: (item: U, index: number, arrayLength: number) => boolean): Promise; + + /** + * Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise. + * + * Note about second argument: if it's specifically a true array, its values become respective arguments for the function call. Otherwise it is passed as is as the first argument for the function call. + * + * Alias for `attempt();` for compatibility with earlier ECMAScript version. + */ + static try(fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; + static try(fn: () => R, args?: any[], ctx?: any): Promise; + + static attempt(fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; + static attempt(fn: () => R, args?: any[], ctx?: any): Promise; + + /** + * Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. + * This method is convenient when a function can sometimes return synchronously or throw synchronously. + */ + static method(fn: Function): Function; + + /** + * Create a promise that is resolved with the given `value`. If `value` is a thenable or promise, the returned promise will assume its state. + */ + static resolve(): Promise; + static resolve(value: Promise.Thenable): Promise; + static resolve(value: R): Promise; + + /** + * Create a promise that is rejected with the given `reason`. + */ + static reject(reason: any): Promise; + static reject(reason: any): Promise; + + /** + * Create a promise with undecided fate and return a `PromiseResolver` to control it. See resolution?: Promise(#promise-resolution). + */ + static defer(): Promise.Resolver; + + /** + * Cast the given `value` to a trusted promise. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. + */ + static cast(value: Promise.Thenable): Promise; + static cast(value: R): Promise; + + /** + * Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`. + */ + static bind(thisArg: any): Promise; + + /** + * See if `value` is a trusted Promise. + */ + static is(value: any): boolean; + + /** + * Call this right after the library is loaded to enabled long stack traces. Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have alread been created. Long stack traces imply a substantial performance penalty, around 4-5x for throughput and 0.5x for latency. + */ + static longStackTraces(): void; + + /** + * Returns a promise that will be fulfilled with `value` (or `undefined`) after given `ms` milliseconds. If `value` is a promise, the delay will start counting down when it is fulfilled and the returned promise will be fulfilled with the fulfillment value of the `value` promise. + */ + // TODO enable more overloads + static delay(value: Promise.Thenable, ms: number): Promise; + static delay(value: R, ms: number): Promise; + static delay(ms: number): Promise; + + /** + * Returns a function that will wrap the given `nodeFunction`. Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. The node function should conform to node.js convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument. + * + * If the `nodeFunction` calls its callback with multiple success values, the fulfillment value will be an array of them. + * + * If you pass a `receiver`, the `nodeFunction` will be called as a method on the `receiver`. + */ + // TODO how to model promisify? + static promisify(nodeFunction: Function, receiver?: any): Function; + + /** + * Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain. The promisified method name will be the original method name postfixed with `Async`. Returns the input object. + * + * Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method. + */ + // TODO how to model promisifyAll? + static promisifyAll(target: Object): Object; + + /** + * Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. + */ + // TODO fix coroutine GeneratorFunction + static coroutine(generatorFunction: Function): Function; + + /** + * Spawn a coroutine which may yield promises to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. + */ + // TODO fix spawn GeneratorFunction + static spawn(generatorFunction: Function): Promise; + + /** + * This is relevant to browser environments with no module loader. + * + * Release control of the `Promise` namespace to whatever it was before this library was loaded. Returns a reference to the library namespace so you can attach it to something else. + */ + static noConflict(): typeof Promise; + + /** + * Add `handler` as the handler to call when there is a possibly unhandled rejection. The default handler logs the error stack to stderr or `console.error` in browsers. + * + * Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections. + */ + static onPossiblyUnhandledRejection(handler: (reason: any) => any): void; + + /** + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled. The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. If any promise in the array rejects, the returned promise is rejected with the rejection reason. + */ + // TODO enable more overloads + // promise of array with promises of value + static all(values: Promise.Thenable[]>): Promise; + // promise of array with values + static all(values: Promise.Thenable): Promise; + // array with promises of value + static all(values: Promise.Thenable[]): Promise; + // array with values + static all(values: R[]): Promise; + + /** + * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. If any promise in the object rejects, the returned promise is rejected with the rejection reason. + * + * If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties. All other objects are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties. + * + * *The original object is not modified.* + */ + // TODO verify this is correct + // trusted promise for object + static props(object: Promise): Promise; + // object + static props(object: Object): Promise; + + /** + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are either fulfilled or rejected. The fulfillment value is an array of ``PromiseInspection`` instances at respective positions in relation to the input array. + * + * *original: The array is not modified. The input array sparsity is retained in the resulting array.* + */ + // promise of array with promises of value + static settle(values: Promise.Thenable[]>): Promise[]>; + // promise of array with values + static settle(values: Promise.Thenable): Promise[]>; + // array with promises of value + static settle(values: Promise.Thenable[]): Promise[]>; + // array with values + static settle(values: R[]): Promise[]>; + + /** + * Like `Promise.some()`, with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly. + */ + // promise of array with promises of value + static any(values: Promise.Thenable[]>): Promise; + // promise of array with values + static any(values: Promise.Thenable): Promise; + // array with promises of value + static any(values: Promise.Thenable[]): Promise; + // array with values + static any(values: R[]): Promise; + + /** + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. + * + * **Note** If you pass empty array or a sparse array with no values, or a promise/thenable for such, it will be forever pending. + */ + // promise of array with promises of value + static race(values: Promise.Thenable[]>): Promise; + // promise of array with values + static race(values: Promise.Thenable): Promise; + // array with promises of value + static race(values: Promise.Thenable[]): Promise; + // array with values + static race(values: R[]): Promise; + + /** + * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. + * + * If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in. + * + * *The original array is not modified.* + */ + // promise of array with promises of value + static some(values: Promise.Thenable[]>, count: number): Promise; + // promise of array with values + static some(values: Promise.Thenable, count: number): Promise; + // array with promises of value + static some(values: Promise.Thenable[], count: number): Promise; + // array with values + static some(values: R[], count: number): Promise; + + /** + * Like `Promise.all()` but instead of having to pass an array, the array is generated from the passed variadic arguments. + */ + // variadic array with promises of value + static join(...values: Promise.Thenable[]): Promise; + // variadic array with values + static join(...values: R[]): Promise; + + /** + * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * + * If the `mapper` function returns promises or thenables, the returned promise will wait for all the mapped results to be resolved as well. + * + * *The original array is not modified.* + */ + // promise of array with promises of value + static map(values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static map(values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; + + // promise of array with values + static map(values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static map(values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; + + // array with promises of value + static map(values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static map(values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; + + // array with values + static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; + + /** + * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * + * If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. + * + * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* + */ + // promise of array with promises of value + static reduce(values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; + static reduce(values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + + // promise of array with values + static reduce(values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; + static reduce(values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + + // array with promises of value + static reduce(values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; + static reduce(values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + + // array with values + static reduce(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; + static reduce(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + + /** + * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * + * The return values from the filtered functions are coerced to booleans, with the exception of promises and thenables which are awaited for their eventual result. + * + * *The original array is not modified. + */ + // promise of array with promises of value + static filter(values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static filter(values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; + + // promise of array with values + static filter(values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static filter(values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; + + // array with promises of value + static filter(values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static filter(values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; + + // array with values + static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; +} + +declare module Promise { + export interface RangeError extends Error { + } + export interface CancellationError extends Error { + } + export interface TimeoutError extends Error { + } + export interface TypeError extends Error { + } + export interface RejectionError extends Error { + } + + export interface Thenable { + then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; + then(onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; + then(onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Thenable; + then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; + } + + export interface Resolver { + /** + * Returns a reference to the controlled promise that can be passed to clients. + */ + promise: Promise; + + /** + * Resolve the underlying promise with `value` as the resolution value. If `value` is a thenable or a promise, the underlying promise will assume its state. + */ + resolve(value: R): void; + resolve(): void; + + /** + * Reject the underlying promise with `reason` as the rejection reason. + */ + reject(reason: any): void; + + /** + * Progress the underlying promise with `value` as the progression value. + */ + progress(value: any): void; + + /** + * Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. + * + * If the the callback is called with multiple success values, the resolver fullfills its promise with an array of the values. + */ + // TODO specify resolver callback + callback: (err: any, value: R, ...values: R[]) => void; + } + + export interface Inspection { + /** + * See if the underlying promise was fulfilled at the creation time of this inspection object. + */ + isFulfilled(): boolean; + + /** + * See if the underlying promise was rejected at the creation time of this inspection object. + */ + isRejected(): boolean; + + /** + * See if the underlying promise was defer at the creation time of this inspection object. + */ + isPending(): boolean; + + /** + * Get the fulfillment value of the underlying promise. Throws if the promise wasn't fulfilled at the creation time of this inspection object. + * + * throws `TypeError` + */ + value(): R; + + /** + * Get the rejection reason for the underlying promise. Throws if the promise wasn't rejected at the creation time of this inspection object. + * + * throws `TypeError` + */ + error(): any; + } +} + +declare module 'bluebird' { + export = Promise; +} diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index 6eb154e83..65d9a0055 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -20,6 +20,7 @@ var exp: RegExp; var anyArr: any[]; var strArr: string[]; var numArr: number[]; +var voidVar: void; // - - - - - - - - - - - - - - - - - @@ -199,7 +200,7 @@ bool = fooInspection.isPending(); foo = fooInspection.value(); -x = fooInspection.error(); +x = fooInspection.reason(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -244,9 +245,15 @@ barProm = fooProm.caught((reason: any) => { barProm = fooProm.catch(Error, (reason: any) => { return bar; }); +barProm = fooProm.catch(Promise.CancellationError, (reason: any) => { + return bar; +}); barProm = fooProm.caught(Error, (reason: any) => { return bar; }); +barProm = fooProm.caught(Promise.CancellationError, (reason: any) => { + return bar; +}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -256,36 +263,28 @@ barProm = fooProm.error((reason: any) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooProm = fooProm.finally((value: Foo) => { - // return is ignored - return foo; -}); -fooProm = fooProm.finally((value: Foo) => { - // return is ignored - return fooThen; -}); -fooProm = fooProm.finally((value: Foo) => { - // return is ignored +fooProm = fooProm.finally(() => { + // non-Thenable return is ignored + return "foo"; }); fooProm = fooProm.finally(() => { - // return is ignored + return fooThen; +}); +fooProm = fooProm.finally(() => { + // non-Thenable return is ignored }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooProm = fooProm.lastly((value: Foo) => { - // return is ignored - return foo; -}); -fooProm = fooProm.lastly((value: Foo) => { - // return is ignored - return fooThen; -}); -fooProm = fooProm.lastly((value: Foo) => { - // return is ignored +fooProm = fooProm.lastly(() => { + // non-Thenable return is ignored + return "foo"; }); fooProm = fooProm.lastly(() => { - // return is ignored + return fooThen; +}); +fooProm = fooProm.lastly(() => { + // non-Thenable return is ignored }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -294,40 +293,56 @@ fooProm = fooProm.bind(obj); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return bar; }, (reason: any) => { return bar; }, (note: any) => { }); -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return bar; }, (reason: any) => { return bar; }); -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return bar; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return barThen; }, (reason: any) => { return barThen; }, (note: any) => { }); -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return barThen; }, (reason: any) => { return barThen; }); -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return barThen; }); +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.tap((value: Foo) => { + // non-Thenable return is ignored + return "foo"; +}); +fooProm = fooProm.tap((value: Foo) => { + return fooThen; +}); +fooProm = fooProm.tap((value: Foo) => { + return voidThen; +}); +fooProm = fooProm.tap(() => { + // non-Thenable return is ignored +}); + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fooProm = fooProm.progressed((note: any) => { diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index 210032f86..f9f081c96 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -16,7 +16,7 @@ // TODO verify support to have no return statement in handlers to get a Promise (more overloads?) -declare class Promise implements Promise.Thenable { +declare class Promise implements Promise.Thenable, Promise.Inspection { /** * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. */ @@ -72,13 +72,11 @@ declare class Promise implements Promise.Thenable { * * Alias `.lastly();` for compatibility with earlier ECMAScript version. */ - finally(handler: (value: R) => Promise.Thenable): Promise; - finally(handler: (value: R) => R): Promise; - finally(handler: (value: R) => void): Promise; + finally(handler: () => Promise.Thenable): Promise; + finally(handler: () => U): Promise; - lastly(handler: (value: R) => Promise.Thenable): Promise; - lastly(handler: (value: R) => R): Promise; - lastly(handler: (value: R) => void): Promise; + lastly(handler: () => Promise.Thenable): Promise; + lastly(handler: () => U): Promise; /** * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. @@ -88,10 +86,16 @@ declare class Promise implements Promise.Thenable { /** * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. */ - done(onFulfilled: (value: R) => Promise.Thenable, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - done(onFulfilled: (value: R) => Promise.Thenable, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; - done(onFulfilled: (value: R) => U, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - done(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + done(onFulfilled: (value: R) => Promise.Thenable, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): void; + done(onFulfilled: (value: R) => Promise.Thenable, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void; + done(onFulfilled: (value: R) => U, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): void; + done(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void; + + /** + * Like `.finally()`, but not called for rejections. + */ + tap(onFulFill: (value: R) => Promise.Thenable): Promise; + tap(onFulfill: (value: R) => U): Promise; /** * Shorthand for `.then(null, null, handler);`. Attach a progress handler that will be called if this promise is progressed. Returns a new promise chained from this promise. @@ -172,6 +176,20 @@ declare class Promise implements Promise.Thenable { */ isResolved(): boolean; + /** + * Get the fulfillment value of the underlying promise. Throws if the promise isn't fulfilled yet. + * + * throws `TypeError` + */ + value(): R; + + /** + * Get the rejection reason for the underlying promise. Throws if the promise isn't rejected yet. + * + * throws `TypeError` + */ + reason(): any; + /** * Synchronously inspect the state of this `promise`. The `PromiseInspection` will represent the state of the promise as snapshotted at the time of calling `.inspect()`. */ @@ -594,6 +612,20 @@ declare module Promise { } export interface RejectionError extends Error { } + export interface OperationalError extends Error { + } + + // Ideally, we'd define e.g. "export class RangeError extends Error {}", + // but as Error is defined as an interface (not a class), TypeScript doesn't + // allow extending Error, only implementing it. + // However, if we want to catch() only a specific error type, we need to pass + // a constructor function to it. So, as a workaround, we define them here as such. + export function RangeError(): RangeError; + export function CancellationError(): CancellationError; + export function TimeoutError(): TimeoutError; + export function TypeError(): TypeError; + export function RejectionError(): RejectionError; + export function OperationalError(): OperationalError; export interface Thenable { then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; @@ -661,8 +693,16 @@ declare module Promise { * * throws `TypeError` */ - error(): any; + reason(): any; } + + /** + * Changes how bluebird schedules calls a-synchronously. + * + * @param scheduler Should be a function that asynchronously schedules + * the calling of the passed in function + */ + export function setScheduler(scheduler: (callback: (...args: any[]) => void) => void): void; } declare module 'bluebird' { From 5ab1bd484034f61fbf688e14eecc28638c36f7ea Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Wed, 12 Nov 2014 08:30:07 -0200 Subject: [PATCH 118/135] squash! squash! update angular to released version 1.3+ interval delay isnt optional --- angularjs/angular.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index d28c40e21..64a9d0652 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -630,7 +630,7 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$interval /////////////////////////////////////////////////////////////////////////// interface IIntervalService { - (func: Function, delay?: number, count?: number, invokeApply?: boolean): IPromise; + (func: Function, delay: number, count?: number, invokeApply?: boolean): IPromise; cancel(promise: IPromise): boolean; } From f5f114f1e65756500789c0b39dd5d99981bcd8a7 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Wed, 12 Nov 2014 13:07:51 -0500 Subject: [PATCH 119/135] Adding fs.(Read|Write)Stream.close(). It's undocumented, but it is present in the source code and programs rely on it. --- node/node-tests.ts | 1 + node/node.d.ts | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/node/node-tests.ts b/node/node-tests.ts index a8c13f8b0..7f59ab985 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -91,6 +91,7 @@ function stream_readable_pipe_test() { var z = zlib.createGzip(); var w = fs.createWriteStream('file.txt.gz'); r.pipe(z).pipe(w); + r.close(); } //////////////////////////////////////////////////// diff --git a/node/node.d.ts b/node/node.d.ts index 7edbdfd60..2405b4408 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -721,8 +721,8 @@ declare module "net" { setKeepAlive(enable?: boolean, initialDelay?: number): void; address(): { port: number; family: string; address: string; }; unref(): void; - ref(): void; - + ref(): void; + remoteAddress: string; remotePort: number; bytesRead: number; @@ -770,13 +770,13 @@ declare module "dgram" { port: number; size: number; } - + interface AddressInfo { - address: string; - family: string; - port: number; + address: string; + family: string; + port: number; } - + export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; interface Socket extends events.EventEmitter { @@ -823,8 +823,12 @@ declare module "fs" { close(): void; } - export interface ReadStream extends stream.Readable {} - export interface WriteStream extends stream.Writable {} + export interface ReadStream extends stream.Readable { + close(): void; + } + export interface WriteStream extends stream.Writable { + close(): void; + } export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; export function renameSync(oldPath: string, newPath: string): void; From 161a175f8584bb9fb242fde066fcd02afac0c8b4 Mon Sep 17 00:00:00 2001 From: Guido Zuidhof Date: Wed, 12 Nov 2014 20:53:16 +0100 Subject: [PATCH 120/135] Add minilog typings --- CONTRIBUTORS.md | 3 +- minilog/minilog-tests.ts | 63 ++++++++++++++++++++++++++ minilog/minilog.d.ts | 98 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 minilog/minilog-tests.ts create mode 100644 minilog/minilog.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e10ca14d4..c45542a9f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,4 +1,4 @@ -# Contributors +# Contributors This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url. @@ -280,6 +280,7 @@ All definitions files include a header with the author and editors, so at some p * [md5.js](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) (by [MIZUNE Pine](https://github.com/pine613)) * [Microsoft Ajax](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) (by [Patrick Magee](https://github.com/pjmagee)) * [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk)) +* [minilog](http://mixu.net/minilog/index.html) (by [Guido Zuidhof](https://github.com/Rahazan)) * [Minimatch](https://github.com/isaacs/minimatch) (by [vvakame](https://github.com/vvakame)) * [minimist](https://github.com/substack/minimist) (by [Bart van der Schoor](https://github.com/Bartvds)) * [Mithril](http://lhorie.github.io/mithril) (by [Leo Horie](https://github.com/lhorie) and [Chris Bowdon](https://github.com/cbowdon)) diff --git a/minilog/minilog-tests.ts b/minilog/minilog-tests.ts new file mode 100644 index 000000000..3a9bb0f4d --- /dev/null +++ b/minilog/minilog-tests.ts @@ -0,0 +1,63 @@ +// Type definitions for minilog v2 +// Project: https://github.com/mixu/minilog +// Definitions by: Guido +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + + +//Following are example snippets from mixu.net/minilog + +var log = Minilog('app'); +Minilog.enable(); + +log + .debug('debug message') + .info('info message') + .warn('warning') + .error('this is an error message'); + +Minilog.pipe(Minilog.backends.console.formatWithStack) + .pipe(Minilog.backends.console); + + +Minilog +// formatter + .pipe(Minilog.backends.console.formatClean) +// backend + .pipe(Minilog.backends.console); + + +Minilog.pipe(Minilog.suggest) // filter + .pipe(Minilog.defaultFormatter) // formatter + .pipe(Minilog.defaultBackend); // backend - e.g. the console + +Minilog.suggest.deny(/mymodule\/.*/, 'warn'); + +Minilog + .suggest + .clear() + .deny('foo', 'warn'); +Minilog.enable(); + +Minilog.suggest.defaultResult = false; +Minilog + .suggest + .clear() + .allow('bar', 'info'); +Minilog.enable(); + + +var myFilter = new Minilog.Filter(); +// allow any logs from the namespace/module "foo", level >= 'info +myFilter.allow('foo', 'debug'); +// deny any logs where the module name matches "bar.*", level < 'warn' +// e.g. only let through "warn" and "error" +myFilter.deny(new RegExp('bar.*', 'warn')); + +// now, create a custom pipe +Minilog.pipe(myFilter) + .pipe(Minilog.defaultFormatter) + .pipe(Minilog.defaultBackend); + + diff --git a/minilog/minilog.d.ts b/minilog/minilog.d.ts new file mode 100644 index 000000000..d9d1695bf --- /dev/null +++ b/minilog/minilog.d.ts @@ -0,0 +1,98 @@ +// Type definitions for minilog v2 +// Project: https://github.com/mixu/minilog +// Definitions by: Guido +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +//These type definitions are not complete, although basic usage should be typed. +interface Minilog { + debug(msg: any): Minilog; + info(msg: any): Minilog; + log(msg: any): Minilog; + warn(msg: any): Minilog; + error(msg: any): Minilog; +} + +declare function Minilog(namespace: string): Minilog; + +declare module Minilog { + export function enable(): Minilog; + export function disable() : Minilog; + export function pipe(dest: any): Transform; + + export var suggest: Filter; + export var backends: Minilog.MinilogBackends; + + export var defaultBackend: any; + export var defaultFormatter: string; + + + export class Filter extends Transform{ + + /** + * Adds an entry to the whitelist + * Returns this filter + */ + allow(name: any, level?: any): Filter; + /** + * Adds an entry to the blacklist + * Returns this filter + */ + deny(name: any, level?: any): Filter; + /** + * Empties the whitelist and blacklist + * Returns this filter + */ + clear(): Filter; + + test(name:any, level:any): boolean; + + /** + * specifies the behavior when a log line doesn't match either the whitelist or the blacklist. + The default is true (= "allow by default") - lines that do not match the whitelist or the blacklist are not filtered (e.g. ). + If you want to flip the default so that lines are filtered unless they are on the whitelist, set this to false (= "deny by default"). + */ + defaultResult: boolean; + + /** + * controls whether the filter is enabled. Default: true + */ + enabled: boolean; + } + + + export interface MinilogBackends { + array: any; + browser: any; + console: Console; + localstorage: any; + jQuery: any; + } + + export class Console extends Transform{ + + /** + * List of available formatters + */ + formatters: string[]; + + //Only available on client + color: Transform; + minilog: Transform; + + //Only available on backend + formatClean: Transform; + formatColor: Transform; + formatNpm: Transform; + formatLearnboost: Transform; + formatMinilog: Transform; + formatWithStack: Transform; + } + + export class Transform { + write(name: any, level: any, args: any): void; + pipe(dest: any): any; + unpipe(from: any): Transform; + mixin(dest: any): void; + } + +} \ No newline at end of file From 5e5b95afa3a32cf7e9a40cc5d4bbe2f0b8a5674c Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Thu, 13 Nov 2014 06:36:43 +0900 Subject: [PATCH 121/135] Add content-type --- content-type/content-type-test.ts | 47 +++++++++++++++++++++++++++++++ content-type/content-type.d.ts | 32 +++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 content-type/content-type-test.ts create mode 100644 content-type/content-type.d.ts diff --git a/content-type/content-type-test.ts b/content-type/content-type-test.ts new file mode 100644 index 000000000..4bf63e2ab --- /dev/null +++ b/content-type/content-type-test.ts @@ -0,0 +1,47 @@ +/// + +import MediaType = require('content-type'); + +// https://github.com/deoxxa/content-type/blob/master/README.md +function new_test(): void { + var p = new MediaType('text/html;level=1;q=0.5'); + p.q === 0.5; + p.params.level === "1"; + + var q = new MediaType('application/json', { profile: 'http://example.com/schema.json' }); + q.type === "application/json"; + q.params.profile === "http://example.com/schema.json"; + + q.q = 1; + q.toString() === 'application/json;q=1;profile="http://example.com/schema.json"'; +} + +function mediaCmp_test(): void { + MediaType.mediaCmp(MediaType.parseMedia('text/html'), MediaType.parseMedia('text/html')) === 0; + MediaType.mediaCmp(MediaType.parseMedia('*/*'), MediaType.parseMedia('text/html')) === 1; + MediaType.mediaCmp(MediaType.parseMedia('text/html;level=1'), MediaType.parseMedia('text/html')) === -1; + MediaType.mediaCmp(MediaType.parseMedia('application/json;profile="v1.json"'), MediaType.parseMedia('application/json;profile="v2.json"')) === null; +} + +// https://github.com/deoxxa/content-type/blob/master/example.js +function example(): void { + var representations = [ + 'application/json', + 'text/html', + 'application/json;profile="schema.json"', + 'application/json;profile="different.json"', + ]; + + var accept = [ + 'text/html;q=0.50', + '*/*;q=0.01', + 'application/json;profile=different.json', + 'application/json;profile="a,b;c.json?d=1;f=2";q=0.2', + ]; + + console.log('Formats:\n\t' + representations.map(MediaType.parseMedia).join('\n\t')); + + console.log('Accept:\n\t' + accept.map(MediaType.parseMedia).join('\n\t')); + + console.log('Selected:', (MediaType.select(representations.map(MediaType.parseMedia), accept.map(MediaType.parseMedia)) || 'None').toString()); +} \ No newline at end of file diff --git a/content-type/content-type.d.ts b/content-type/content-type.d.ts new file mode 100644 index 000000000..fbca9c96b --- /dev/null +++ b/content-type/content-type.d.ts @@ -0,0 +1,32 @@ +// Type definitions for content-type v0.0.1 +// Project: https://github.com/deoxxa/content-type +// Definitions by: Pine Mizune +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module ContentType { + interface MediaType { + type: string; + q?: number; + params: any; + toString(): string; + } + + interface SelectOptions { + sortAvailable?: boolean; + sortAccepted?: boolean; + } + + interface MediaTypeStatic { + new (s: string, p?: any): MediaType; + parseMedia(type: string): MediaType; + splitQuotedString(str: string, delimiter?: string, quote?: string): string[]; + splitContentTypes(str: string): string[]; + select(availableTypes: MediaType[], acceptedTypes: MediaType[], options?: SelectOptions): string; + mediaCmp(a: MediaType, b: MediaType): number; + } +} + +declare module "content-type" { + var x: ContentType.MediaTypeStatic; + export = x; +} \ No newline at end of file From 31b873c6b58a8176aa10e9304c33b542b0b3cc12 Mon Sep 17 00:00:00 2001 From: tgfjt Date: Thu, 13 Nov 2014 11:47:03 +0900 Subject: [PATCH 122/135] added validator/validator.d.ts for chriso/validator.js @3.22.1 --- CONTRIBUTORS.md | 1 + validator/validator-tests.ts | 106 +++++++++++++++++++ validator/validator.d.ts | 190 +++++++++++++++++++++++++++++++++++ 3 files changed, 297 insertions(+) create mode 100644 validator/validator-tests.ts create mode 100644 validator/validator.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e10ca14d4..1ab702c85 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -423,6 +423,7 @@ All definitions files include a header with the author and editors, so at some p * [urlrouter](https://github.com/fengmk2/urlrouter) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) * [UUID.js](https://github.com/LiosK/UUID.js) (by [Jason Jarrett](https://github.com/staxmanade)) * [Valerie](https://github.com/davewatts/valerie) (by [Howard Richards](https://github.com/conficient)) +* [validator](https://github.com/chriso/validator.js) (by [tgfjt](https://github.com/tgfjt)) * [Velocity](http://velocityjs.org/) (by [Greg Smith](https://github.com/smrq)) * [Viewporter](https://github.com/zynga/viewporter) (by [Boris Yankov](https://github.com/borisyankov)) * [Vimeo](http://developer.vimeo.com/player/js-api) (by [Daz Wilkin](https://github.com/DazWilkin/)) diff --git a/validator/validator-tests.ts b/validator/validator-tests.ts new file mode 100644 index 000000000..b7f45d427 --- /dev/null +++ b/validator/validator-tests.ts @@ -0,0 +1,106 @@ +/// + +import validator = require("validator"); + + +validator.extend("isTest", function(str) { + return !str; +}); + +validator.equals("abc", "Abc"); + +validator.contains("foo", "foobar"); + +validator.matches("foobar", "foo/i"); + +validator.isEmail("sample"); + +validator.isURL("sample"); + +validator.isFQDN("sample"); + +validator.isIP("sample"); + +validator.isAlpha("sample"); + +validator.isNumeric("sample"); + +validator.isAlphanumeric("sample"); + +validator.isBase64("sample"); + +validator.isHexadecimal("sample"); + +validator.isHexColor("sample"); + +validator.isLowercase("sample"); + +validator.isUppercase("sample"); + +validator.isInt("sample"); + +validator.isFloat("sample"); + +validator.isDivisibleBy("sample", 2); + +validator.isNull("sample"); + +validator.isLength("sample", 3, 5); + +validator.isByteLength("sample", 3); + +validator.isUUID("sample"); + +validator.isDate("sample"); + +validator.isAfter("sample"); + +validator.isBefore("sample"); + +validator.isIn("sample", []); + +validator.isCreditCard("sample"); + +validator.isISBN("sample"); + +validator.isJSON("sample"); + +validator.isMultibyte("sample"); + +validator.isAscii("sample"); + +validator.isFullWidth("sample"); + +validator.isHalfWidth("sample"); + +validator.isVariableWidth("sample"); + +validator.isSurrogatePair("sample"); + +validator.isMongoId("sample"); + +validator.toString(123); + +validator.toDate(1225); + +validator.toFloat('011'); + +validator.toInt('aa'); + +validator.toBoolean('yes!'); + +validator.trim(' triming '); + +validator.ltrim(' triming '); + +validator.rtrim(' triming '); + +validator.escape('