From 332c0f8d5625c34893eba64f9080800221392ee5 Mon Sep 17 00:00:00 2001 From: Uros Smolnik Date: Tue, 4 Nov 2014 21:22:07 +0100 Subject: [PATCH 001/243] express 4.x middleware - response-time - serve-favicon - serve-static --- response-time/response-time.d.ts | 38 +++++++++++++++ serve-favicon/serve-favicon.d.ts | 29 ++++++++++++ serve-static/serve-static.d.ts | 79 ++++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 response-time/response-time.d.ts create mode 100644 serve-favicon/serve-favicon.d.ts create mode 100644 serve-static/serve-static.d.ts diff --git a/response-time/response-time.d.ts b/response-time/response-time.d.ts new file mode 100644 index 000000000..0a7c25465 --- /dev/null +++ b/response-time/response-time.d.ts @@ -0,0 +1,38 @@ +// Type definitions for response-time 2.2.0 +// Project: https://github.com/expressjs/response-time +// Definitions by: Uros Smolnik +// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped + +/* =================== USAGE =================== + + import responseTime = require('response-time'); + app.use(responseTime()); + + =============================================== */ + +/// + +declare module "response-time" { + import express = require('express'); + + /** + * Response time header for node.js + * Returns middleware that adds a X-Response-Time header to responses. + */ + function responseTime(options?: { + /** + * The fixed number of digits to include in the output, which is always in milliseconds, defaults to 3 (ex: 2.300ms). + */ + digits?: number; + /** + * The name of the header to set, defaults to X-Response-Time. + */ + header?: string; + /** + * Boolean to indicate if units of measurement suffix should be added to the output, defaults to true (ex: 2.300ms vs 2.300). + */ + suffix?: boolean; + }): express.RequestHandler; + + export = responseTime; +} \ No newline at end of file diff --git a/serve-favicon/serve-favicon.d.ts b/serve-favicon/serve-favicon.d.ts new file mode 100644 index 000000000..80faf5921 --- /dev/null +++ b/serve-favicon/serve-favicon.d.ts @@ -0,0 +1,29 @@ +// Type definitions for serve-favicon 2.1.6 +// Project: https://github.com/expressjs/serve-favicon +// Definitions by: Uros Smolnik +// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped + +/* =================== USAGE =================== + + import serveFavicon = require('serve-favicon'); + app.use(serveFavicon(__dirname + '/public/favicon.ico')); + + =============================================== */ + +/// + +declare module "serve-favicon" { + import express = require('express'); + + /** + * Node.js middleware for serving a favicon. + */ + function serveFavicon(path: string, options?: { + /** + * The cache-control max-age directive in ms, defaulting to 1 day. This can also be a string accepted by the ms module. + */ + maxAge?: number; + }): express.RequestHandler; + + export = serveFavicon; +} \ No newline at end of file diff --git a/serve-static/serve-static.d.ts b/serve-static/serve-static.d.ts new file mode 100644 index 000000000..9bb57e6d3 --- /dev/null +++ b/serve-static/serve-static.d.ts @@ -0,0 +1,79 @@ +// Type definitions for serve-static 1.7.1 +// Project: https://github.com/expressjs/serve-static +// Definitions by: Uros Smolnik +// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped + +/* =================== USAGE =================== + + import serveStatic = require('serve-static'); + app.use(serveStatic('public/ftp', {'index': ['default.html', 'default.htm']})) + + =============================================== */ + +/// + +declare module "serve-static" { + import express = require('express'); + + /** + * Create a new middleware function to serve files from within a given root directory. + * The file to serve will be determined by combining req.url with the provided root directory. + * When a file is not found, instead of sending a 404 response, this module will instead call next() to move on to the next middleware, allowing for stacking and fall-backs. + */ + function serveStatic(root: string, options?: { + /** + * Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot ("."). + * Note this check is done on the path itself without checking if the path actually exists on the disk. + * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny"). + * The default value is 'ignore'. + * 'allow' No special treatment for dotfiles + * 'deny' Send a 403 for any request for a dotfile + * 'ignore' Pretend like the dotfile does not exist and call next() + */ + dotfiles?: string; + + /** + * Enable or disable etag generation, defaults to true. + */ + etag?: boolean; + + /** + * Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for. + * The first that exists will be served. Example: ['html', 'htm']. + * The default value is false. + */ + extensions?: boolean; + + /** + * By default this module will send "index.html" files in response to a request on a directory. + * To disable this set false or to supply a new index pass a string or an array in preferred order. + */ + index?: boolean; + + /** + * Enable or disable Last-Modified header, defaults to true. Uses the file system's last modified value. + */ + lastModified?: boolean; + + /** + * Provide a max-age in milliseconds for http caching, defaults to 0. This can also be a string accepted by the ms module. + */ + maxAge?: number; + + /** + * Redirect to trailing "/" when the pathname is a dir. Defaults to true. + */ + redirect?: number; + + /** + * Function to set custom headers on response. Alterations to the headers need to occur synchronously. + * The function is called as fn(res, path, stat), where the arguments are: + * res the response object + * path the file path that is being sent + * stat the stat object of the file that is being sent + */ + setHeaders?: (res, path, stat) => any; + }): express.Handler; + + export = serveStatic; +} \ No newline at end of file From 4db25cf3f11edeea2aa18bc1a7cc5613acf755b6 Mon Sep 17 00:00:00 2001 From: HowardRichards Date: Mon, 2 Mar 2015 12:21:01 +0000 Subject: [PATCH 002/243] Refactored knockout components Previous Knockout component registration code was complicate since union types did not exist in TypeScript. The knockout.d.ts file has already had changes for union types added, so I have refactored my original changes to component.register to use this. Revert "Refactored knockout.register for union types" This reverts commit 920b8d64621f249331f2a17123148c446c212d32. Refactored knockout.register for union types Removed number of interfaces for ko.register methods and simplified using union types for clarity. Refactored component types into a namespace to reduce namespace pollution --- knockout/knockout.d.ts | 158 +++++++++++++++---------------- knockout/tests/knockout-tests.ts | 52 +++++----- 2 files changed, 102 insertions(+), 108 deletions(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 28d7b94cc..f4838c411 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Knockout v3.2.0-beta +// Type definitions for Knockout v3.2.0 // Project: http://knockoutjs.com // Definitions by: Boris Yankov , Igor Oleinikov , Clément Bourgeois // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -559,92 +559,88 @@ interface KnockoutBindingProvider { getBindingAccessors?(node: Node, bindingContext: KnockoutBindingContext): { [key: string]: string; }; } -interface KnockoutComponents { - // overloads for register method: - register(componentName: string, config: KnockoutComponentRegister): void; - register(componentName: string, config: KnockoutComponentRegisterStringTemplate): void; - register(componentName: string, config: KnockoutComponentRegisterFnViewModel): void; - register(componentName: string, config: KnockoutComponentRegisterStringTemplateFnViewModel): void; - register(componentName: string, config: KnockoutComponentRegisterAMD): void; - register(componentName: string, config: {}): void; - - isRegistered(componentName: string): boolean; - unregister(componentName: string): void; - get(componentName: string, callback: (definition: KnockoutComponentDefinition) => void): void; - clearCachedDefinition(componentName: string): void - defaultLoader: KnockoutComponentLoader; - loaders: KnockoutComponentLoader[]; - getComponentNameForNode(node: Node): string; -} - -/* interfaces for register overloads*/ - -interface KnockoutComponentRegister { - template: KnockoutComponentTemplate; - viewModel?: KnockoutComponentConfigViewModel; -} - -interface KnockoutComponentRegisterAMD { - // load self-describing module using AMD module name - require: string; -} - -interface KnockoutComponentRegisterFnViewModel { - template: KnockoutComponentTemplate; - viewModel?: (params: any) => any; -} - -interface KnockoutComponentRegisterStringTemplate { - template: string; - viewModel?: KnockoutComponentConfigViewModel; -} - -interface KnockoutComponentRegisterStringTemplateFnViewModel { - template: string; - viewModel?: (params: any) => any; -} - -interface KnockoutComponentConfigViewModel { - instance?: any; - createViewModel? (params?: any, componentInfo?: KnockoutComponentInfo): any; - require?: string; -} - -interface KnockoutComponentTemplate { - // specify element id (string) or a node - element?: any; - // AMD module load - require?: string; -} - -interface KnockoutComponentInfo { - element: Node; -} -/* end register overloads */ -interface KnockoutComponentDefinition { - template: Node[]; - createViewModel?(params: any, options: { element: Node; }): any; -} - -interface KnockoutComponentLoader { - getConfig? (componentName: string, callback: (result: KnockoutComponentConfig) => void): void; - loadComponent? (componentName: string, config: KnockoutComponentConfig, callback: (result: KnockoutComponentDefinition) => void): void; - loadTemplate? (componentName: string, templateConfig: any, callback: (result: Node[]) => void): void; - loadViewModel? (componentName: string, viewModelConfig: any, callback: (result: any) => void): void; - suppressLoaderExceptions?: boolean; -} - -interface KnockoutComponentConfig { - template: any; - createViewModel?: any; -} - interface KnockoutComputedContext { getDependenciesCount(): number; isInitial: () => boolean; isSleeping: boolean; } +// +// refactored types into a namespace to reduce global pollution +// and used Union Types to simplify overloads (requires TypeScript 1.4) +// +declare module KnockoutComponentTypes { + + interface Config { + viewModel: ViewModelFunction | ViewModelSharedInstance | ViewModelFactoryFunction | AMDModule; + template: string | Node[]| DocumentFragment | TemplateElement | AMDModule; + } + + interface ComponentConfig { + template: any; + createViewModel?: any; + } + + interface EmptyConfig { + } + + // common AMD type + interface AMDModule { + require: string; + } + + // viewmodel types + interface ViewModelFunction { + (params?: any): any; + } + + interface ViewModelSharedInstance { + instance: any; + } + + interface ViewModelFactoryFunction { + createViewModel: (params?: any, componentInfo?: ComponentInfo) => any; + } + + interface ComponentInfo { + element: any; + } + + interface TemplateElement { + element: string | Node; + } + + interface Loader { + getConfig? (componentName: string, callback: (result: ComponentConfig) => void): void; + loadComponent? (componentName: string, config: ComponentConfig, callback: (result: Definition) => void): void; + loadTemplate? (componentName: string, templateConfig: any, callback: (result: Node[]) => void): void; + loadViewModel? (componentName: string, viewModelConfig: any, callback: (result: any) => void): void; + suppressLoaderExceptions?: boolean; + } + + interface Definition { + template: Node[]; + createViewModel? (params: any, options: { element: Node; }): any; + } +} + +interface KnockoutComponents { + // overloads for register method: + register(componentName: string, config: KnockoutComponentTypes.Config | KnockoutComponentTypes.EmptyConfig): void; + + isRegistered(componentName: string): boolean; + unregister(componentName: string): void; + get(componentName: string, callback: (definition: KnockoutComponentTypes.Definition) => void): void; + clearCachedDefinition(componentName: string): void + defaultLoader: KnockoutComponentTypes.Loader; + loaders: KnockoutComponentTypes.Loader[]; + getComponentNameForNode(node: Node): string; +} + + + + + declare module "knockout" { export = ko; } diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts index 78d464f07..b14ce073c 100644 --- a/knockout/tests/knockout-tests.ts +++ b/knockout/tests/knockout-tests.ts @@ -604,52 +604,50 @@ function test_allBindingsAccessor() { }; } + function test_Components() { + // test all possible ko.components.register() overloads function test_Register() { - // test all possible ko.components.register() overloads + // reused parameters var nodeArray = [new Node, new Node]; var singleNode = new Node; + var viewModelFn = function (params: any) { return null; } - // ------- string-templates with different viewmodel overloads: + // ------- viewmodel overloads: - // string template and inline function (commonly used in examples) - ko.components.register("name", { template: "string-template", viewModel: function (params) { return null; } }); + // viewModel as inline function (commonly used in examples) + ko.components.register("name", { template: "string-template", viewModel: viewModelFn }); - // string template and instance vm + // viewModel from shared instance ko.components.register("name", { template: "string-template", viewModel: { instance: null } }); - // string template and createViewModel factory method - ko.components.register("name", { template: "string-template", viewModel: { createViewModel: function (params: any, componentInfo: KnockoutComponentInfo) { return null; } } }); + // viewModel from createViewModel factory method + ko.components.register("name", { template: "string-template", viewModel: { createViewModel: function (params: any, componentInfo: KnockoutComponentTypes.ComponentInfo) { return null; } } }); - // string template and require module vm + // viewModel from an AMD module ko.components.register("name", { template: "string-template", viewModel: { require: "module" } }); - // ------- non-string templates + // ------- template overloads - // viewmodel as function and four types of template - ko.components.register("name", { template: { element: "elementID" }, viewModel: function (params) { return null; } }); - // Node template for element and inline function (commonly used in examples) - ko.components.register("name", { template: { element: singleNode }, viewModel: function (params) { return null; } }); - // object template for element and inline function (commonly used in examples) - ko.components.register("name", { template: nodeArray, viewModel: function (params) { return null; } }); - // object template for element and inline function (commonly used in examples) - ko.components.register("name", { template: { require: "module" }, viewModel: function (params) { return null; } }); - - // viewmodel as object, and four types of non-string tempalte - ko.components.register("name", { template: { element: "elementID" }, viewModel: { instance: null } }); - // Node template for element and inline function (commonly used in examples) - ko.components.register("name", { template: { element: singleNode }, viewModel: { instance: null } }); - // object template for element and inline function (commonly used in examples) - ko.components.register("name", { template: nodeArray, viewModel: { instance: null } }); - // object template for element and inline function (commonly used in examples) - ko.components.register("name", { template: { require: "module" }, viewModel: { instance: null } }); + // template from named element + ko.components.register("name", { template: { element: "elementID" }, viewModel: viewModelFn }); + + // template using single Node + ko.components.register("name", { template: { element: singleNode }, viewModel: viewModelFn }); + + // template using Node array + ko.components.register("name", { template: nodeArray, viewModel: viewModelFn }); + + // template using an AMD module + ko.components.register("name", { template: { require: "text!module" }, viewModel: viewModelFn }); // Empty config for registering custom elements that are handled by name convention - ko.components.register('name', { /* No config needed */ }); + ko.components.register('name', { /* No config needed */ }); } } + function testUnwrapUnion() { var possibleObs: KnockoutObservable | number; From 7238786d4dc6ff44dc3b4d6c5dda414578a833a9 Mon Sep 17 00:00:00 2001 From: Dani H Date: Mon, 2 Mar 2015 23:04:29 +0100 Subject: [PATCH 003/243] Made all of the GraphNode values optional When passing data to a d3 structure the data can be very flexible. The current interface of the GraphNode requires many data attributes to be present, most of which aren't required to draw the visualization. In fact, d3 calculates some of them itself, so passing them to the GraphNode would be redundant. In this example http://bl.ocks.org/mbostock/4063269#flare.json, Mike Bostock uses the attribute className to identify name and packageName to identify color in the GraphNode. This means that he doesn't only ignore all of the attributes DefintelyTyped provides, but comes up with his own attributes. This means that the data passed in could in fact be a hashmap/js object type with arbitrary attributes. It's only when the data is used with d3 methods to identify what attribute represents size/color etc... that the type becomes relevant. So either the GraphNode should be less restrictive (or in fact an arbitrary hashmap) or I've misunderstood some core concept. You don't have to necessarily merge this pull request, if I'm right some parts will have to be rewritten (GraphNodes seem to be used everywhere), but hopefully it might spark some discussion. --- d3/d3.d.ts | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 6cc372f7f..d66407055 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -1236,24 +1236,24 @@ declare module D3 { } export interface GraphNode { - id: number; - index: number; - name: string; - px: number; - py: number; - size: number; - weight: number; - x: number; - y: number; - subindex: number; - startAngle: number; - endAngle: number; - value: number; - fixed: boolean; - children: GraphNode[]; - _children: GraphNode[]; - parent: GraphNode; - depth: number; + id?: number; + index?: number; + name?: string; + px?: number; + py?: number; + size?: number; + weight?: number; + x?: number; + y?: number; + subindex?: number; + startAngle?: number; + endAngle?: number; + value?: number; + fixed?: boolean; + children?: GraphNode[]; + _children?: GraphNode[]; + parent?: GraphNode; + depth?: number; } export interface GraphLink { From 164c9dd0a5cc1c520dc0273fbfe1dff7821d2f2f Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Mon, 9 Mar 2015 10:00:24 +0100 Subject: [PATCH 004/243] Add typings for csv-stringify. --- CONTRIBUTORS.md | 1 + csv-stringify/csv-stringify-tests.ts | 22 ++++++++ csv-stringify/csv-stringify.d.ts | 83 ++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 csv-stringify/csv-stringify-tests.ts create mode 100644 csv-stringify/csv-stringify.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 88905c88a..e20e92d9d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -133,6 +133,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](csurf/csurf.d.ts) [csurf](https://www.npmjs.org/package/csurf) by [Hiroki Horiuchi](https://github.com/horiuchi) +* [:link:](csv-stringify/csv-stringify.d.ts) [csv-stringify](https://github.com/wdavidw/node-csv-stringify) by [rogierschouten](https://github.com/rogierschouten) * [: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:](d3.cloud.layout/d3.cloud.layout.d.ts) [d3JS cloud layout plugin by Jason Davies](https://github.com/jasondavies/d3-cloud) by [hans windhoff](https://github.com/hansrwindhoff) diff --git a/csv-stringify/csv-stringify-tests.ts b/csv-stringify/csv-stringify-tests.ts new file mode 100644 index 000000000..e28ddb8f8 --- /dev/null +++ b/csv-stringify/csv-stringify-tests.ts @@ -0,0 +1,22 @@ +/// + +import stringify = require("csv-stringify"); + + +stringify([["1", "2", "3"], ["4", "5", "6"]], (error: Error, output: string): void => { + // nothing +}); + +stringify([["1", "2", "3"], ["4", "5", "6"]], { + delimiter: "," +}, (error: Error, output: string): void => { + // nothing +}); + + +var s = stringify({ delimiter: "," }); +s.write(["1", "2", "3"]); + + + + diff --git a/csv-stringify/csv-stringify.d.ts b/csv-stringify/csv-stringify.d.ts new file mode 100644 index 000000000..7f46d53f6 --- /dev/null +++ b/csv-stringify/csv-stringify.d.ts @@ -0,0 +1,83 @@ +// Type definitions for csv-stringify 0.0.6 +// Project: https://github.com/wdavidw/node-csv-stringify +// Definitions by: Rogier Schouten +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "csv-stringify" { + + module stringify { + interface StringifyOpts { + /** + * List of fields, applied when transform returns an object, order matters, read the transformer documentation for additionnal information, columns are auto discovered when the user write object, see the "header" option on how to print columns names on the first line. + */ + columns?: string[]; + /** + * Set the field delimiter, one character only, defaults to a comma. + */ + delimiter?: string; + /** + * Add the value of "options.rowDelimiter" on the last line, default to true. + */ + eof?: boolean; + /** + * Defaults to the escape read option. + */ + escape?: boolean; + /** + * Display the column names on the first line if the columns option is provided or discovered. + */ + header?: boolean; + /** + * String used to delimit record rows or a special value; special values are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified). + */ + lineBreaks?: string; + /** + * Defaults to the quote read option. + */ + quote?: string; + /** + * Boolean, default to false, quote all the non-empty fields even if not required. + */ + quoted?: boolean; + /** + * Boolean, no default, quote empty fields? If specified, overrides quotedString for empty strings. + */ + quotedEmpty?: boolean; + /** + * Boolean, default to false, quote all fields of type string even if not required. + */ + quotedString?: boolean; + /** + * String used to delimit record rows or a special value; special values are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified). + */ + rowDelimiter?: string; + + } + + interface Stringifier extends NodeJS.ReadWriteStream { + + // Stringifier stream takes array of strings + write(line: string[]): boolean; + + // repeat declarations from NodeJS.WritableStream to avoid compile error + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + } + } + + /** + * Callback version: string in --> callback with string out + */ + function stringify(input: any[][], opts: stringify.StringifyOpts, callback: (error: Error, output: string) => void): void; + function stringify(input: any[][], callback: (error: Error, output: string) => void): void; + + /** + * Streaming stringifier + */ + function stringify(opts: stringify.StringifyOpts): stringify.Stringifier; + + export = stringify; +} From e71995b4fd8d7c0258a2dc815908ef212dfd0f87 Mon Sep 17 00:00:00 2001 From: Hongweng Date: Mon, 9 Mar 2015 18:04:10 +0900 Subject: [PATCH 005/243] fragmentPrefix(string) returns URI --- urijs/URI.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/urijs/URI.d.ts b/urijs/URI.d.ts index 818c24a56..448365762 100644 --- a/urijs/URI.d.ts +++ b/urijs/URI.d.ts @@ -95,7 +95,7 @@ declare class URI { removeQuery(qry: Object): URI; addFragment(fragment: string): URI; //fragmentPrefix: string; - fragmentPrefix(prefix: string); + fragmentPrefix(prefix: string): URI; normalize(): URI; normalizeProtocol(): URI; normalizeHostname(): URI; From 6f09cc3515cf3e4fb0bb5b6c3d45e0a81b72b7fb Mon Sep 17 00:00:00 2001 From: Matt Traynham Date: Mon, 9 Mar 2015 11:13:30 -0400 Subject: [PATCH 006/243] Angular Material type definitions --- angular-material/angular-material-tests.ts | 96 ++++++++++ angular-material/angular-material.d.ts | 195 +++++++++++++++++++++ 2 files changed, 291 insertions(+) create mode 100644 angular-material/angular-material-tests.ts create mode 100644 angular-material/angular-material.d.ts diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts new file mode 100644 index 000000000..5518c985d --- /dev/null +++ b/angular-material/angular-material-tests.ts @@ -0,0 +1,96 @@ +/// + +var myApp = angular.module('testModule', ['ngMaterial']); + +myApp.config(( + $mdThemingProvider: ng.material.MDThemingProvider, + $mdIconProvider: ng.material.MDIconProvider) => { + + $mdThemingProvider.alwaysWatchTheme(true); + var neonRedMap: ng.material.MDPalette = $mdThemingProvider.extendPalette('red', { + '500': 'ff0000' + }); + // Register the new color palette map with the name neonRed + $mdThemingProvider.definePalette('neonRed', neonRedMap); + // Use that theme for the primary intentions + $mdThemingProvider.theme('default') + .primaryPalette('neonRed') + .accentPalette('blue') + .backgroundPalette('grey') + .warnPalette('red') + .dark(true); + + $mdIconProvider + .defaultIconSet('my/app/icons.svg') // Register a default set of SVG icons + .iconSet('social', 'my/app/social.svg') // Register a named icon set of SVGs + .icon('android', 'my/app/android.svg') // Register a specific icon (by name) + .icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set +}); + +app.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.MDBottomSheetService) => { + $scope['openBottomSheet'] = () => { + $mdBottomSheet.show({ + template: 'Hello!' + }); + }; + $scope['hideBottomSheet'] = $mdBottomSheet.hide.bind($mdBottomSheet, 'hide'); + $scope['cancelBottomSheet'] = $mdBottomSheet.cancel.bind($mdBottomSheet, 'cancel'); +}); + +app.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.MDDialogService) => { + $scope['openDialog'] = () => { + $mdDialog.show({ + template: 'Hello!' + }); + }; + $scope['alertDialog'] = () => { + $mdDialog.show($mdDialog.alert().content('Alert!')); + }; + $scope['confirmDialog'] = () => { + $mdDialog.show($mdDialog.confirm().content('Confirm!')); + }; + $scope['hideDialog'] = $mdDialog.hide.bind($mdDialog, 'hide'); + $scope['cancelDialog'] = $mdDialog.cancel.bind($mdDialog, 'cancel'); +}); + +class IconDirective implements ng.IDirective { + + private $mdIcon: ng.material.MDIcon; + constructor($mdIcon: ng.material.MDIcon) { + this.$mdIcon = $mdIcon; + } + + public link($scope: ng.IScope, $elm: ng.IAugmentedJQuery) { + this.$mdIcon('android').then((iconEl: Element) => $elm.append(iconEl)); + this.$mdIcon('work:chair').then((iconEl: Element) => $elm.append(iconEl)); + // Load and cache the external SVG using a URL + this.$mdIcon('img/icons/android.svg').then((iconEl: Element) => { + $elm.append(iconEl); + }); + } +} +myApp.directive('icon-directive', ($mdIcon: ng.material.MDIcon) => new IconDirective($mdIcon)); + +app.controller('MediaController', ($scope: ng.IScope, $mdMedia: ng.material.MDMedia) => { + $scope.$watch(() => $mdMedia('lg'), (big: boolean) => { + $scope['bigScreen'] = big; + }); + $scope['screenIsSmall'] = $mdMedia('sm'); + $scope['customQuery'] = $mdMedia('(min-width: 1234px)'); + $scope['anotherCustom'] = $mdMedia('max-width: 300px'); +}); + +app.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.material.MDSidenavService) => { + var componentId = 'left'; + $scope['toggle'] = () => $mdSidenav(componentId).toggle(); + $scope['open'] = () => $mdSidenav(componentId).open(); + $scope['close'] = () => $mdSidenav(componentId).close(); + $scope['isOpen'] = $mdSidenav(componentId).isOpen(); + $scope['isLockedOpen'] = $mdSidenav(componentId).isLockedOpen(); +}); + +app.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.MDToastService) => { + $scope['openToast'] = function($event) { + $mdToast.show($mdToast.simple().content('Hello!')); + }; +}); \ No newline at end of file diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts new file mode 100644 index 000000000..c764f939b --- /dev/null +++ b/angular-material/angular-material.d.ts @@ -0,0 +1,195 @@ +// Type definitions for Angular Material 0.8.3+ (ng.material module) +// Project: https://github.com/angular/material +// Definitions by: Matt Traynham +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +declare module ng.material { + + interface MDBottomSheetOptions { + templateUrl?: string; + template?: string; + controller?: any; + locals?: {[index: string]: any}; + targetEvent?: any; + resolve?: {[index: string]: ng.IPromise} + controllerAs?: string; + parent?: Element; + disableParentScroll?: boolean; + } + + interface MDBottomSheetService { + show(options: MDBottomSheetOptions): ng.IPromise; + hide(response?: any): void; + cancel(response?: any): void; + } + + interface MDPresetDialog { + title(title: string): T; + content(content: string): T; + ok(content: string): T; + theme(theme: string): T; + } + + interface MDAlertDialog extends MDPresetDialog { + } + + interface MDConfirmDialog extends MDPresetDialog { + cancel(reason?: string): MDConfirmDialog; + } + + interface MDDialogOptions { + templateUrl?: string; + template?: string; + domClickEvent?: any; + disableParentScroll?: boolean; + clickOutsideToClose?: boolean; + hasBackdrop?: boolean; + escapeToClose?: boolean; + controller?: any; + locals?: {[index: string]: any}; + bindToController?: boolean; + resolve?: {[index: string]: ng.IPromise} + controllerAs?: string; + parent?: Element; + onComplete?: Function; + } + + interface MDDialogService { + show(dialog: MDDialogOptions|MDPresetDialog): ng.IPromise; + confirm(): MDConfirmDialog; + alert(): MDAlertDialog; + hide(response?: any): void; + cancel(response?: any): void; + } + + interface MDIcon { + (path: string): ng.IPromise; + } + + interface MDIconProvider { + icon(id: string, url: string, iconSize?: string): MDIconProvider; + iconSet(id: string, url: string, iconSize?: string): MDIconProvider; + defaultIconSet(url: string, iconSize?: string): MDIconProvider; + defaultIconSize(iconSize: string): MDIconProvider; + } + + interface MDMedia { + (media: string): boolean; + } + + interface MDSidenavObject { + toggle(): void; + open(): void; + close(): void; + isOpen(): boolean; + isLockedOpen(): boolean; + } + + interface MDSidenavService { + (component: string): MDSidenavObject; + } + + interface MDToastPreset { + content(content: string): T; + action(action: string): T; + highlightAction(highlightAction: boolean): T; + capsule(capsule: boolean): T; + theme(theme: string): T; + hideDelay(delay: number): T; + } + + interface MDSimpleToastPreset extends MDToastPreset { + } + + interface MDToastOptions { + templateUrl?: string; + template?: string; + hideDelay?: number; + position?: string; + controller?: any; + locals?: {[index: string]: any}; + bindToController?: boolean; + resolve?: {[index: string]: ng.IPromise} + controllerAs?: string; + parent?: Element; + } + + interface MDToastService { + show(optionsOrPreset: MDToastOptions|MDToastPreset): ng.IPromise; + showSimple(): ng.IPromise; + simple(): MDSimpleToastPreset; + build(): MDToastPreset; + updateContent(): void; + hide(response?: any): void; + cancel(response?: any): void; + } + + interface MDPalette { + 0?: string; + 50?: string; + 100?: string; + 200?: string; + 300?: string; + 400?: string; + 500?: string; + 600?: string; + 700?: string; + 800?: string; + 900?: string; + A100?: string; + A200?: string; + A400?: string; + A700?: string; + contrastDefaultColor?: string; + contrastDarkColors?: string; + contrastStrongLightColors?: string; + } + + interface MDThemeHues { + default?: string; + 'hue-1'?: string; + 'hue-2'?: string; + 'hue-3'?: string; + } + + interface MDThemePalette { + name: string; + hues: MDThemeHues; + } + + interface MDThemeColors { + accent: MDThemePalette; + background: MDThemePalette; + primary: MDThemePalette; + warn: MDThemePalette; + } + + interface MDThemeGrayScalePalette { + 1: string; + 2: string; + 3: string; + 4: string; + name: string; + } + + interface MDTheme { + name: string; + colors: MDThemeColors; + foregroundPalette: MDThemeGrayScalePalette; + foregroundShadow: string; + accentPalette(name: string, hues?: MDThemeHues): MDTheme; + primaryPalette(name: string, hues?: MDThemeHues): MDTheme; + warnPalette(name: string, hues?: MDThemeHues): MDTheme; + backgroundPalette(name: string, hues?: MDThemeHues): MDTheme; + dark(isDark?: boolean): MDTheme; + } + + interface MDThemingProvider { + theme(name: string, inheritFrom?: string): MDTheme; + definePalette(name: string, palette: MDPalette): MDThemingProvider; + extendPalette(name: string, palette: MDPalette): MDPalette; + setDefaultTheme(theme: string): void; + alwaysWatchTheme(alwaysWatch: boolean): void; + } +} From 255bed88ec2e7fe3fe72c9c391640e730c070cd6 Mon Sep 17 00:00:00 2001 From: Matt Traynham Date: Mon, 9 Mar 2015 11:16:19 -0400 Subject: [PATCH 007/243] Fixes variable name in tests --- angular-material/angular-material-tests.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts index 5518c985d..ae091c805 100644 --- a/angular-material/angular-material-tests.ts +++ b/angular-material/angular-material-tests.ts @@ -27,7 +27,7 @@ myApp.config(( .icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set }); -app.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.MDBottomSheetService) => { +myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.MDBottomSheetService) => { $scope['openBottomSheet'] = () => { $mdBottomSheet.show({ template: 'Hello!' @@ -37,7 +37,7 @@ app.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.m $scope['cancelBottomSheet'] = $mdBottomSheet.cancel.bind($mdBottomSheet, 'cancel'); }); -app.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.MDDialogService) => { +myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.MDDialogService) => { $scope['openDialog'] = () => { $mdDialog.show({ template: 'Hello!' @@ -71,7 +71,7 @@ class IconDirective implements ng.IDirective { } myApp.directive('icon-directive', ($mdIcon: ng.material.MDIcon) => new IconDirective($mdIcon)); -app.controller('MediaController', ($scope: ng.IScope, $mdMedia: ng.material.MDMedia) => { +myApp.controller('MediaController', ($scope: ng.IScope, $mdMedia: ng.material.MDMedia) => { $scope.$watch(() => $mdMedia('lg'), (big: boolean) => { $scope['bigScreen'] = big; }); @@ -80,7 +80,7 @@ app.controller('MediaController', ($scope: ng.IScope, $mdMedia: ng.material.MDMe $scope['anotherCustom'] = $mdMedia('max-width: 300px'); }); -app.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.material.MDSidenavService) => { +myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.material.MDSidenavService) => { var componentId = 'left'; $scope['toggle'] = () => $mdSidenav(componentId).toggle(); $scope['open'] = () => $mdSidenav(componentId).open(); @@ -89,8 +89,6 @@ app.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.material. $scope['isLockedOpen'] = $mdSidenav(componentId).isLockedOpen(); }); -app.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.MDToastService) => { - $scope['openToast'] = function($event) { - $mdToast.show($mdToast.simple().content('Hello!')); - }; +myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.MDToastService) => { + $scope['openToast'] = () => $mdToast.show($mdToast.simple().content('Hello!')); }); \ No newline at end of file From fb26a9485bcd1103747110c375705a9b0303e565 Mon Sep 17 00:00:00 2001 From: Gildor Date: Tue, 10 Mar 2015 16:42:49 +0800 Subject: [PATCH 008/243] Fix signature of D3.ForceLayout.size() --- d3/d3.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 3ab8a9b88..2bb239250 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -1279,10 +1279,8 @@ declare module D3 { export interface ForceLayout { (): ForceLayout; size: { - (): number; + (): number[]; (mysize: number[]): ForceLayout; - (accessor: (d: any, index: number) => {}): ForceLayout; - }; linkDistance: { (): number; From 29ebb788d04c3acbb521ac1e69754a4bad9c5885 Mon Sep 17 00:00:00 2001 From: Simon Krajewski Date: Tue, 10 Mar 2015 10:04:00 +0100 Subject: [PATCH 009/243] replace nbsp by normal spaces --- express/express.d.ts | 12 ++++++------ handlebars/handlebars.d.ts | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/express/express.d.ts b/express/express.d.ts index 043c1e49c..e31332077 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -424,22 +424,22 @@ declare module "express" { * @param code */ status(code: number): Response; - + /** * Set the response HTTP status code to `statusCode` and send its string representation as the response body. * @link http://expressjs.com/4x/api.html#res.sendStatus - * + * * Examples: - * + * * res.sendStatus(200); // equivalent to res.status(200).send('OK') * res.sendStatus(403); // equivalent to res.status(403).send('Forbidden') * res.sendStatus(404); // equivalent to res.status(404).send('Not Found') * res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error') - * + * * @param code */ sendStatus(code: number): Response; - + /** * Set Link header field with the given `links`. * @@ -796,7 +796,7 @@ declare module "express" { (req: Request, res: Response, next: Function): any; } - interface Handler extends RequestHandler {} + interface Handler extends RequestHandler {} interface RequestParamHandler { (req: Request, res: Response, next: Function, param: any): any; diff --git a/handlebars/handlebars.d.ts b/handlebars/handlebars.d.ts index 076381571..c118760c5 100644 --- a/handlebars/handlebars.d.ts +++ b/handlebars/handlebars.d.ts @@ -38,13 +38,13 @@ interface HandlebarsStatic extends HandlebarsCommon { compile(input: any, options?: any): HandlebarsTemplateDelegate; } -interface HandlebarsTemplates { - [index: string]: HandlebarsTemplateDelegate; +interface HandlebarsTemplates { + [index: string]: HandlebarsTemplateDelegate; } -interface HandlebarsRuntimeStatic extends HandlebarsCommon { +interface HandlebarsRuntimeStatic extends HandlebarsCommon { // Handlebars.templates is the default template namespace in precompiler. - templates: HandlebarsTemplates; + templates: HandlebarsTemplates; } declare module hbs { From 11c517fec4290d9b3218a58f20190f7697261b2e Mon Sep 17 00:00:00 2001 From: NN Date: Tue, 10 Mar 2015 17:03:06 +0200 Subject: [PATCH 010/243] Update chrome.d.ts According to documentation https://developer.chrome.com/extensions/webRequest#type-UploadData array of UploadData (optional) raw any (optional) bytes : An ArrayBuffer with a copy of the data. --- chrome/chrome.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index bc0d52227..f67cb3949 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -2251,7 +2251,7 @@ declare module chrome.webRequest { } interface UploadData { - bytes?: any[]; + bytes?: ArrayBuffer; file?: string; } @@ -2329,7 +2329,7 @@ declare module chrome.webRequest { } interface RequestBody { - raw?: UploadData; + raw?: UploadData[]; error?: string; formData?: FormData; } From af699e147cfeceb93c77e3876016f89531488e85 Mon Sep 17 00:00:00 2001 From: Vasya Aksyonov Date: Tue, 10 Mar 2015 21:13:39 +0500 Subject: [PATCH 011/243] Numeral commonjs modules support and tests --- numeraljs/numeraljs-commonjs-tests.ts | 44 +++++++++++++++++++++++++++ numeraljs/numeraljs-tests.ts | 3 +- numeraljs/numeraljs.d.ts | 8 ++++- 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 numeraljs/numeraljs-commonjs-tests.ts diff --git a/numeraljs/numeraljs-commonjs-tests.ts b/numeraljs/numeraljs-commonjs-tests.ts new file mode 100644 index 000000000..5e9af5388 --- /dev/null +++ b/numeraljs/numeraljs-commonjs-tests.ts @@ -0,0 +1,44 @@ +/// +import numeral = require("numeral"); + +var valueFormat: string = numeral(1000).format('0,0'); +// '1,000' + +var valueUnformat: number = numeral().unformat('($10,000.00)'); +// '-10000' + +var value3: Numeral = numeral(1000); +var added: Numeral = value3.add(10); +// 1010 + +var value4: Numeral = numeral(1000); +var formatValue4a: string = value4.format('0,0'); +// '1,000' +var formatValue4b: number = value4.value(); +// 1000 + +var value5: Numeral = numeral(); +value5.set(1000); +var value5Num: number = value5.value(); +// 1000 + +var value6: Numeral = numeral(1000); +var value: number = 100; +var difference = value6.difference(value); +// 900 + +var value7: Numeral = numeral(0); +numeral.zeroFormat('N/A'); +var zeroString: string = value7.format('0.0'); +// 'N/A' + +var a: Numeral = numeral(1000); +var b: Numeral = numeral(a); +var c: Numeral = a.clone(); + +var aVal: number = a.set(2000).value(); +// 2000 +var bVal: number = b.value(); +// 1000 +var cVal: number = c.add(10).value(); +// 1010 diff --git a/numeraljs/numeraljs-tests.ts b/numeraljs/numeraljs-tests.ts index 4dadb0c0b..0b1bcff67 100644 --- a/numeraljs/numeraljs-tests.ts +++ b/numeraljs/numeraljs-tests.ts @@ -1,4 +1,5 @@ /// + var valueFormat: string = numeral(1000).format('0,0'); // '1,000' @@ -27,7 +28,7 @@ var difference = value6.difference(value); var value7: Numeral = numeral(0); numeral.zeroFormat('N/A'); -var zeroString: string = value7.format('0.0') +var zeroString: string = value7.format('0.0'); // 'N/A' var a: Numeral = numeral(1000); diff --git a/numeraljs/numeraljs.d.ts b/numeraljs/numeraljs.d.ts index e680806d1..1e600b91c 100644 --- a/numeraljs/numeraljs.d.ts +++ b/numeraljs/numeraljs.d.ts @@ -39,4 +39,10 @@ interface Numeral { difference(value: any): number; } -declare var numeral: Numeral; \ No newline at end of file +declare var numeral: Numeral; + +declare module "numeral" { + + export = Numeral; + +} \ No newline at end of file From 3256244dbaf99104c2738e67641da33a3af09a41 Mon Sep 17 00:00:00 2001 From: Vasya Aksyonov Date: Tue, 10 Mar 2015 21:41:53 +0500 Subject: [PATCH 012/243] Export fix --- numeraljs/numeraljs.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numeraljs/numeraljs.d.ts b/numeraljs/numeraljs.d.ts index 1e600b91c..779823056 100644 --- a/numeraljs/numeraljs.d.ts +++ b/numeraljs/numeraljs.d.ts @@ -43,6 +43,6 @@ declare var numeral: Numeral; declare module "numeral" { - export = Numeral; + export = numeral; -} \ No newline at end of file +} From ec9b82e6462ecde1fa43dc849eebca364728d7f3 Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Fri, 6 Mar 2015 00:08:08 -0800 Subject: [PATCH 013/243] Update React v0.13.0 definitions for RC2 + `React.cloneElement` + `React.addons.createFragment` + `setState(f: (prevState: S, props: P) => S, callback?: () => any)` + `ref: (component: T) => any` --- react/future/react-0.13.0-tests.ts | 34 ++++++------- react/future/react-0.13.0.d.ts | 48 +++++++++++++----- react/future/react-addons-0.13.0-tests.ts | 44 +++++++++-------- react/future/react-addons-0.13.0.d.ts | 52 +++++++++++++++----- react/future/react-addons-global-0.13.0.d.ts | 6 ++- react/future/react-global-0.13.0.d.ts | 48 +++++++++++++----- 6 files changed, 156 insertions(+), 76 deletions(-) diff --git a/react/future/react-0.13.0-tests.ts b/react/future/react-0.13.0-tests.ts index b32356119..d54fb45d6 100644 --- a/react/future/react-0.13.0-tests.ts +++ b/react/future/react-0.13.0-tests.ts @@ -3,7 +3,7 @@ // TODO: import "react" once 0.13.0 is released import React = require("react/addons"); -interface Props extends React.Props { +interface Props extends React.Props { hello: string; world?: string; foo: number; @@ -36,7 +36,6 @@ var props: Props = { }; var container: Element; -var INPUT_REF: string = "input"; // // Top-Level API @@ -64,7 +63,7 @@ var ClassicComponent: React.ClassicComponentClass = render: () => { return React.DOM.div(null, React.DOM.input({ - ref: INPUT_REF, + ref: input => this._input = input, value: this.state.inputValue })); } @@ -72,14 +71,6 @@ var ClassicComponent: React.ClassicComponentClass = class ModernComponent extends React.Component implements React.ChildContextProvider { - - constructor(props: Props, context: Context) { - super(props, context); - this.state = { - inputValue: context.someValue, - seconds: props.foo - }; - } static propTypes: React.ValidationMap = { foo: React.PropTypes.number @@ -110,11 +101,13 @@ class ModernComponent extends React.Component seconds: this.props.foo }); } + + private _input: React.HTMLComponent; render() { return React.DOM.div(null, React.DOM.input({ - ref: INPUT_REF, + ref: input => this._input = input, value: this.state.inputValue })); } @@ -144,6 +137,14 @@ var classicElement: React.ReactClassicElement = var domElement: React.ReactHTMLElement = React.createElement("div"); +// React.cloneElement +var clonedElement: React.ReactElement = + React.cloneElement(element, props); +var clonedClassicElement: React.ReactClassicElement = + React.cloneElement(classicElement, props); +var clonedDOMElement: React.ReactHTMLElement = + React.cloneElement(domElement); + // React.render var component: React.Component = React.render(element, container); @@ -169,7 +170,6 @@ domNode = React.findDOMNode(domNode); var type = element.type; var elementProps: Props = element.props; var key = element.key; -var ref: string = element.ref; // // React Components @@ -196,10 +196,6 @@ classicComponent.setProps(elementProps); classicComponent.replaceProps(props); classicComponent.replaceState({ inputValue: "???", seconds: 60 }); -var inputRef: React.HTMLComponent = - component.refs[INPUT_REF]; -var value: string = inputRef.getDOMNode().value; - var myComponent = component; myComponent.reset(); @@ -335,7 +331,9 @@ class Timer extends React.Component<{}, TimerState> { } private _interval: number; tick() { - this.setState({ secondsElapsed: this.state.secondsElapsed + 1 }); + this.setState((prevState, props) => ({ + secondsElapsed: prevState.secondsElapsed + 1 + })); } componentDidMount() { var me = this; diff --git a/react/future/react-0.13.0.d.ts b/react/future/react-0.13.0.d.ts index fd4b27e98..80ce5ce88 100644 --- a/react/future/react-0.13.0.d.ts +++ b/react/future/react-0.13.0.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React v0.13.0 (external module) +// Type definitions for React v0.13.0 RC2 (external module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -9,20 +9,26 @@ declare module "react" { // ---------------------------------------------------------------------- interface ReactElementBase { - type: T; + type: string | ComponentClassBase

; props: P; - key: number | string; - ref: string; + key: string | number; + ref: string | ((component: T) => any); } interface ReactElement

- extends ReactElementBase, P> {} + extends ReactElementBase, P> { + type: ComponentClass; + } interface ReactClassicElement

- extends ReactElementBase | string, P> {} + extends ReactElementBase, P> { + type: string | ClassicComponentClass; + } interface ReactDOMElement

// subtype of ReactClassicElement - extends ReactElementBase {} + extends ReactElementBase, P> { + type: string; + } type ReactHTMLElement = ReactDOMElement; type ReactSVGElement = ReactDOMElement; @@ -55,7 +61,7 @@ declare module "react" { type ReactChild = ReactElementBase | ReactText; // Should be Array but type aliases cannot be recursive - type ReactFragment = Array; + type ReactFragment = {} | Array; type ReactNode = ReactChild | ReactFragment | boolean; // @@ -85,6 +91,19 @@ declare module "react" { props?: P, ...children: ReactNode[]): ReactElement

; + function cloneElement

( + element: ReactDOMElement

, + props: P, + ...children: ReactNode[]): ReactDOMElement

; + function cloneElement

( + element: ReactClassicElement

, + props: P, + ...children: ReactNode[]): ReactClassicElement

; + function cloneElement

( + element: ReactElement

, + props: P, + ...children: ReactNode[]): ReactElement

; + function render

( element: ReactDOMElement

, container: Element, @@ -120,6 +139,7 @@ declare module "react" { // Base component for plain JS classes class Component implements ComponentLifecycle { constructor(props: P, context: any); + setState(f: (prevState: S, props: P) => S, callback?: () => any): void; setState(state: S, callback?: () => any): void; forceUpdate(): void; props: P; @@ -311,13 +331,13 @@ declare module "react" { // Props / DOM Attributes // ---------------------------------------------------------------------- - interface Props { + interface Props { children?: ReactNode; - key?: number | string; - ref?: string; + key?: string | number; + ref?: string | ((component: T) => any); } - interface DOMAttributes extends Props { + interface DOMAttributes extends Props> { onCopy?: ClipboardEventHandler; onCut?: ClipboardEventHandler; onPaste?: ClipboardEventHandler; @@ -379,6 +399,8 @@ declare module "react" { } interface HTMLAttributes extends DOMAttributes { + ref?: string | ((component: HTMLComponent) => void); + accept?: string; acceptCharset?: string; accessKey?: string; @@ -487,6 +509,8 @@ declare module "react" { } interface SVGAttributes extends DOMAttributes { + ref?: string | ((component: SVGComponent) => void); + cx?: SVGLength | SVGAnimatedLength; cy?: any; d?: string; diff --git a/react/future/react-addons-0.13.0-tests.ts b/react/future/react-addons-0.13.0-tests.ts index d76097cd6..13419f12f 100644 --- a/react/future/react-addons-0.13.0-tests.ts +++ b/react/future/react-addons-0.13.0-tests.ts @@ -1,7 +1,7 @@ /// import React = require("react/addons"); -interface Props extends React.Props { +interface Props extends React.Props { hello: string; world?: string; foo: number; @@ -34,7 +34,6 @@ var props: Props = { }; var container: Element; -var INPUT_REF: string = "input"; // // Top-Level API @@ -62,7 +61,7 @@ var ClassicComponent: React.ClassicComponentClass = render: () => { return React.DOM.div(null, React.DOM.input({ - ref: INPUT_REF, + ref: input => this._input = input, value: this.state.inputValue })); } @@ -70,14 +69,6 @@ var ClassicComponent: React.ClassicComponentClass = class ModernComponent extends React.Component implements React.ChildContextProvider { - - constructor(props: Props, context: Context) { - super(props, context); - this.state = { - inputValue: context.someValue, - seconds: props.foo - }; - } static propTypes: React.ValidationMap = { foo: React.PropTypes.number @@ -108,11 +99,13 @@ class ModernComponent extends React.Component seconds: this.props.foo }); } + + private _input: React.HTMLComponent; render() { return React.DOM.div(null, React.DOM.input({ - ref: INPUT_REF, + ref: input => this._input = input, value: this.state.inputValue })); } @@ -142,6 +135,14 @@ var classicElement: React.ReactClassicElement = var domElement: React.ReactHTMLElement = React.createElement("div"); +// React.cloneElement +var clonedElement: React.ReactElement = + React.cloneElement(element, props); +var clonedClassicElement: React.ReactClassicElement = + React.cloneElement(classicElement, props); +var clonedDOMElement: React.ReactHTMLElement = + React.cloneElement(domElement); + // React.render var component: React.Component = React.render(element, container); @@ -167,7 +168,6 @@ domNode = React.findDOMNode(domNode); var type = element.type; var elementProps: Props = element.props; var key = element.key; -var ref: string = element.ref; // // React Components @@ -194,10 +194,6 @@ classicComponent.setProps(elementProps); classicComponent.replaceProps(props); classicComponent.replaceState({ inputValue: "???", seconds: 60 }); -var inputRef: React.HTMLComponent = - component.refs[INPUT_REF]; -var value: string = inputRef.getDOMNode().value; - var myComponent = component; myComponent.reset(); @@ -327,17 +323,18 @@ var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); interface TimerState { secondsElapsed: number; } -class Timer extends React.Component<{}, TimerState> { +class Timer extends React.Component, TimerState> { static state = { secondsElapsed: 0 } private _interval: number; tick() { - this.setState({ secondsElapsed: this.state.secondsElapsed + 1 }); + this.setState((prevState, props) => ({ + secondsElapsed: prevState.secondsElapsed + 1 + })); } componentDidMount() { - var me = this; - this._interval = setInterval(() => me.tick(), 1000); + this._interval = setInterval(() => this.tick(), 1000); } componentWillUnmount() { clearInterval(this._interval); @@ -360,6 +357,11 @@ var cx = React.addons.classSet; var className: string = cx({ a: true, b: false, c: true }); className = cx("a", null, "b"); +React.addons.createFragment({ + a: React.DOM.div(), + b: ["a", false, React.createElement("span")] +}); + // // React.addons (Transitions) // -------------------------------------------------------------------------- diff --git a/react/future/react-addons-0.13.0.d.ts b/react/future/react-addons-0.13.0.d.ts index bb4af1d1e..d755bf964 100644 --- a/react/future/react-addons-0.13.0.d.ts +++ b/react/future/react-addons-0.13.0.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ReactWithAddons v0.13.0 (external module) +// Type definitions for ReactWithAddons v0.13.0 RC2 (external module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -9,20 +9,26 @@ declare module "react/addons" { // ---------------------------------------------------------------------- interface ReactElementBase { - type: T; + type: string | ComponentClassBase

; props: P; - key: number | string; - ref: string; + key: string | number; + ref: string | ((component: T) => any); } interface ReactElement

- extends ReactElementBase, P> {} + extends ReactElementBase, P> { + type: ComponentClass; + } interface ReactClassicElement

- extends ReactElementBase | string, P> {} + extends ReactElementBase, P> { + type: string | ClassicComponentClass; + } interface ReactDOMElement

// subtype of ReactClassicElement - extends ReactElementBase {} + extends ReactElementBase, P> { + type: string; + } type ReactHTMLElement = ReactDOMElement; type ReactSVGElement = ReactDOMElement; @@ -85,6 +91,19 @@ declare module "react/addons" { props?: P, ...children: ReactNode[]): ReactElement

; + function cloneElement

( + element: ReactDOMElement

, + props?: P, + ...children: ReactNode[]): ReactDOMElement

; + function cloneElement

( + element: ReactClassicElement

, + props?: P, + ...children: ReactNode[]): ReactClassicElement

; + function cloneElement

( + element: ReactElement

, + props?: P, + ...children: ReactNode[]): ReactElement

; + function render

( element: ReactDOMElement

, container: Element, @@ -120,6 +139,7 @@ declare module "react/addons" { // Base component for plain JS classes class Component implements ComponentLifecycle { constructor(props: P, context: any); + setState(f: (prevState: S, props: P) => S, callback?: () => any): void; setState(state: S, callback?: () => any): void; forceUpdate(): void; props: P; @@ -144,7 +164,7 @@ declare module "react/addons" { tagName: string; } - type HTMLComponent = DOMComponent; + export type HTMLComponent = DOMComponent; type SVGComponent = DOMComponent; interface ChildContextProvider { @@ -311,13 +331,13 @@ declare module "react/addons" { // Props / DOM Attributes // ---------------------------------------------------------------------- - interface Props { + interface Props { children?: ReactNode; - key?: number | string; - ref?: string; + key?: string | number; + ref?: string | ((component: T) => any); } - interface DOMAttributes extends Props { + interface DOMAttributes extends Props> { onCopy?: ClipboardEventHandler; onCut?: ClipboardEventHandler; onPaste?: ClipboardEventHandler; @@ -379,6 +399,8 @@ declare module "react/addons" { } interface HTMLAttributes extends DOMAttributes { + ref?: string | ((component: HTMLComponent) => void); + accept?: string; acceptCharset?: string; accessKey?: string; @@ -487,6 +509,8 @@ declare module "react/addons" { } interface SVGAttributes extends DOMAttributes { + ref?: string | ((component: SVGComponent) => void); + cx?: SVGLength | SVGAnimatedLength; cy?: any; d?: string; @@ -734,8 +758,12 @@ declare module "react/addons" { classSet(cx: { [key: string]: boolean }): string; classSet(...classList: string[]): string; + cloneWithProps

(element: ReactDOMElement

, props: P): ReactDOMElement

; + cloneWithProps

(element: ReactClassicElement

, props: P): ReactClassicElement

; cloneWithProps

(element: ReactElement

, props: P): ReactElement

; + createFragment(object: { [key: string]: ReactNode }): ReactFragment; + update(value: any[], spec: UpdateArraySpec): any[]; update(value: {}, spec: UpdateSpec): any; diff --git a/react/future/react-addons-global-0.13.0.d.ts b/react/future/react-addons-global-0.13.0.d.ts index d11a4ae03..c5db4f6d2 100644 --- a/react/future/react-addons-global-0.13.0.d.ts +++ b/react/future/react-addons-global-0.13.0.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ReactWithAddons v0.13.0 (internal module) +// Type definitions for ReactWithAddons v0.13.0 RC2 (internal module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -23,8 +23,12 @@ declare module React { classSet(cx: { [key: string]: boolean }): string; classSet(...classList: string[]): string; + cloneWithProps

(element: ReactDOMElement

, props: P): ReactDOMElement

; + cloneWithProps

(element: ReactClassicElement

, props: P): ReactClassicElement

; cloneWithProps

(element: ReactElement

, props: P): ReactElement

; + createFragment(object: { [key: string]: ReactNode }): ReactFragment; + update(value: any[], spec: UpdateArraySpec): any[]; update(value: {}, spec: UpdateSpec): any; diff --git a/react/future/react-global-0.13.0.d.ts b/react/future/react-global-0.13.0.d.ts index 60675aec9..b7be8993f 100644 --- a/react/future/react-global-0.13.0.d.ts +++ b/react/future/react-global-0.13.0.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React v0.13.0 (internal module) +// Type definitions for React v0.13.0 RC2 (internal module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -9,20 +9,26 @@ declare module React { // ---------------------------------------------------------------------- interface ReactElementBase { - type: T; + type: string | ComponentClassBase

; props: P; - key: number | string; - ref: string; + key: string | number; + ref: string | ((component: T) => any); } interface ReactElement

- extends ReactElementBase, P> {} + extends ReactElementBase, P> { + type: ComponentClass; + } interface ReactClassicElement

- extends ReactElementBase | string, P> {} + extends ReactElementBase, P> { + type: string | ClassicComponentClass; + } interface ReactDOMElement

// subtype of ReactClassicElement - extends ReactElementBase {} + extends ReactElementBase, P> { + type: string; + } type ReactHTMLElement = ReactDOMElement; type ReactSVGElement = ReactDOMElement; @@ -55,7 +61,7 @@ declare module React { type ReactChild = ReactElementBase | ReactText; // Should be Array but type aliases cannot be recursive - type ReactFragment = Array; + type ReactFragment = {} | Array; type ReactNode = ReactChild | ReactFragment | boolean; // @@ -85,6 +91,19 @@ declare module React { props?: P, ...children: ReactNode[]): ReactElement

; + function cloneElement

( + element: ReactDOMElement

, + props: P, + ...children: ReactNode[]): ReactDOMElement

; + function cloneElement

( + element: ReactClassicElement

, + props: P, + ...children: ReactNode[]): ReactClassicElement

; + function cloneElement

( + element: ReactElement

, + props: P, + ...children: ReactNode[]): ReactElement

; + function render

( element: ReactDOMElement

, container: Element, @@ -120,6 +139,7 @@ declare module React { // Base component for plain JS classes class Component implements ComponentLifecycle { constructor(props: P, context: any); + setState(f: (prevState: S, props: P) => S, callback?: () => any): void; setState(state: S, callback?: () => any): void; forceUpdate(): void; props: P; @@ -311,13 +331,13 @@ declare module React { // Props / DOM Attributes // ---------------------------------------------------------------------- - interface Props { + interface Props { children?: ReactNode; - key?: number | string; - ref?: string; + key?: string | number; + ref?: string | ((component: T) => any); } - interface DOMAttributes extends Props { + interface DOMAttributes extends Props> { onCopy?: ClipboardEventHandler; onCut?: ClipboardEventHandler; onPaste?: ClipboardEventHandler; @@ -379,6 +399,8 @@ declare module React { } interface HTMLAttributes extends DOMAttributes { + ref?: string | ((component: HTMLComponent) => void); + accept?: string; acceptCharset?: string; accessKey?: string; @@ -487,6 +509,8 @@ declare module React { } interface SVGAttributes extends DOMAttributes { + ref?: string | ((component: SVGComponent) => void); + cx?: SVGLength | SVGAnimatedLength; cy?: any; d?: string; From 69a3c976552155ad7b5c7aa15413d3f8d9c8e392 Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Fri, 6 Mar 2015 00:49:22 -0800 Subject: [PATCH 014/243] Rename React.XXXBase types to React.XXX to simplify general typing --- react/future/react-0.13.0-tests.ts | 4 +- react/future/react-0.13.0.d.ts | 72 ++++++++------- react/future/react-addons-0.13.0-tests.ts | 4 +- react/future/react-addons-0.13.0.d.ts | 93 +++++++++++--------- react/future/react-addons-global-0.13.0.d.ts | 23 +++-- react/future/react-global-0.13.0.d.ts | 72 ++++++++------- 6 files changed, 143 insertions(+), 125 deletions(-) diff --git a/react/future/react-0.13.0-tests.ts b/react/future/react-0.13.0-tests.ts index d54fb45d6..cf216503e 100644 --- a/react/future/react-0.13.0-tests.ts +++ b/react/future/react-0.13.0-tests.ts @@ -130,7 +130,7 @@ var domFactoryElement: React.ReactDOMElement = domFactory(); // React.createElement -var element: React.ReactElement = +var element: React.ReactModernElement = React.createElement(ModernComponent, props); var classicElement: React.ReactClassicElement = React.createElement(ClassicComponent, props); @@ -138,7 +138,7 @@ var domElement: React.ReactHTMLElement = React.createElement("div"); // React.cloneElement -var clonedElement: React.ReactElement = +var clonedElement: React.ReactModernElement = React.cloneElement(element, props); var clonedClassicElement: React.ReactClassicElement = React.cloneElement(classicElement, props); diff --git a/react/future/react-0.13.0.d.ts b/react/future/react-0.13.0.d.ts index 80ce5ce88..f87bdc721 100644 --- a/react/future/react-0.13.0.d.ts +++ b/react/future/react-0.13.0.d.ts @@ -8,26 +8,29 @@ declare module "react" { // React Elements // ---------------------------------------------------------------------- - interface ReactElementBase { - type: string | ComponentClassBase

; + type ReactType = ComponentClass | string; + + interface ReactElement

{ + type: string | ComponentClass

; props: P; key: string | number; - ref: string | ((component: T) => any); + ref: string | ((component: Component) => any); } - interface ReactElement

- extends ReactElementBase, P> { - type: ComponentClass; + interface ReactModernElement

extends ReactElement

{ + type: ModernComponentClass; + ref: string | ((component: Component) => any); } - interface ReactClassicElement

- extends ReactElementBase, P> { + interface ReactClassicElement

extends ReactElement

{ type: string | ClassicComponentClass; + ref: string | ((component: ClassicComponent) => any); } - interface ReactDOMElement

// subtype of ReactClassicElement - extends ReactElementBase, P> { + // subtype of ReactClassicElement + interface ReactDOMElement

extends ReactElement

{ type: string; + ref: string | ((component: DOMComponent

) => any); } type ReactHTMLElement = ReactDOMElement; @@ -41,11 +44,15 @@ declare module "react" { (props?: P, ...children: ReactNode[]): ReactElement

; } - interface ClassicFactory

{ + interface ModernFactory

extends Factory

{ + (props?: P, ...children: ReactNode[]): ReactModernElement

; + } + + interface ClassicFactory

extends Factory

{ (props?: P, ...children: ReactNode[]): ReactClassicElement

; } - interface DOMFactory

{ + interface DOMFactory

extends Factory

{ (props?: P, ...children: ReactNode[]): ReactDOMElement

; } @@ -58,7 +65,7 @@ declare module "react" { // ---------------------------------------------------------------------- type ReactText = string | number; - type ReactChild = ReactElementBase | ReactText; + type ReactChild = ReactElement | ReactText; // Should be Array but type aliases cannot be recursive type ReactFragment = {} | Array; @@ -68,15 +75,12 @@ declare module "react" { // Top Level API // ---------------------------------------------------------------------- - function createClass( - spec: ComponentSpec): ClassicComponentClass; + function createClass(spec: ComponentSpec): ClassicComponentClass; - function createFactory

( - type: string): DOMFactory

; - function createFactory

( - type: ClassicComponentClass | string): ClassicFactory

; - function createFactory

( - type: ComponentClass): Factory

; + function createFactory

(type: string): DOMFactory

; + function createFactory

(type: ClassicComponentClass | string): ClassicFactory

; + function createFactory

(type: ModernComponentClass): ModernFactory

; + function createFactory

(type: ComponentClass

): Factory

; function createElement

( type: string, @@ -87,21 +91,25 @@ declare module "react" { props?: P, ...children: ReactNode[]): ReactClassicElement

; function createElement

( - type: ComponentClass, + type: ModernComponentClass, props?: P, - ...children: ReactNode[]): ReactElement

; + ...children: ReactNode[]): ReactModernElement

; function cloneElement

( element: ReactDOMElement

, - props: P, + props?: P, ...children: ReactNode[]): ReactDOMElement

; function cloneElement

( element: ReactClassicElement

, - props: P, + props?: P, ...children: ReactNode[]): ReactClassicElement

; + function cloneElement

( + element: ReactModernElement

, + props?: P, + ...children: ReactNode[]): ReactModernElement

; function cloneElement

( element: ReactElement

, - props: P, + props?: P, ...children: ReactNode[]): ReactElement

; function render

( @@ -118,8 +126,8 @@ declare module "react" { callback?: () => any): Component; function unmountComponentAtNode(container: Element): boolean; - function renderToString(element: ReactElementBase): string; - function renderToStaticMarkup(element: ReactElementBase): string; + function renderToString(element: ReactElement): string; + function renderToStaticMarkup(element: ReactElement): string; function isValidElement(object: {}): boolean; function initializeTouchEvents(shouldUseTouch: boolean): void; @@ -175,18 +183,18 @@ declare module "react" { // Class Interfaces // ---------------------------------------------------------------------- - interface ComponentClassBase

{ + interface ComponentClass

{ propTypes?: ValidationMap

; contextTypes?: ValidationMap; childContextTypes?: ValidationMap; } - interface ComponentClass extends ComponentClassBase

{ + interface ModernComponentClass extends ComponentClass

{ new(props?: P, context?: any): Component; defaultProps?: P; } - interface ClassicComponentClass extends ComponentClassBase

{ + interface ClassicComponentClass extends ComponentClass

{ new(props?: P, context?: any): ClassicComponent; getDefaultProps?(): P; displayName?: string; @@ -222,7 +230,7 @@ declare module "react" { } interface ComponentSpec extends Mixin { - render(): ReactElementBase; + render(): ReactElement; } // diff --git a/react/future/react-addons-0.13.0-tests.ts b/react/future/react-addons-0.13.0-tests.ts index 13419f12f..ff6889ec0 100644 --- a/react/future/react-addons-0.13.0-tests.ts +++ b/react/future/react-addons-0.13.0-tests.ts @@ -128,7 +128,7 @@ var domFactoryElement: React.ReactDOMElement = domFactory(); // React.createElement -var element: React.ReactElement = +var element: React.ReactModernElement = React.createElement(ModernComponent, props); var classicElement: React.ReactClassicElement = React.createElement(ClassicComponent, props); @@ -136,7 +136,7 @@ var domElement: React.ReactHTMLElement = React.createElement("div"); // React.cloneElement -var clonedElement: React.ReactElement = +var clonedElement: React.ReactModernElement = React.cloneElement(element, props); var clonedClassicElement: React.ReactClassicElement = React.cloneElement(classicElement, props); diff --git a/react/future/react-addons-0.13.0.d.ts b/react/future/react-addons-0.13.0.d.ts index d755bf964..5148be3c6 100644 --- a/react/future/react-addons-0.13.0.d.ts +++ b/react/future/react-addons-0.13.0.d.ts @@ -8,26 +8,29 @@ declare module "react/addons" { // React Elements // ---------------------------------------------------------------------- - interface ReactElementBase { - type: string | ComponentClassBase

; + type ReactType = ComponentClass | string; + + interface ReactElement

{ + type: string | ComponentClass

; props: P; key: string | number; - ref: string | ((component: T) => any); + ref: string | ((component: Component) => any); } - interface ReactElement

- extends ReactElementBase, P> { - type: ComponentClass; + interface ReactModernElement

extends ReactElement

{ + type: ModernComponentClass; + ref: string | ((component: Component) => any); } - interface ReactClassicElement

- extends ReactElementBase, P> { + interface ReactClassicElement

extends ReactElement

{ type: string | ClassicComponentClass; + ref: string | ((component: ClassicComponent) => any); } - interface ReactDOMElement

// subtype of ReactClassicElement - extends ReactElementBase, P> { + // subtype of ReactClassicElement + interface ReactDOMElement

extends ReactElement

{ type: string; + ref: string | ((component: DOMComponent

) => any); } type ReactHTMLElement = ReactDOMElement; @@ -41,11 +44,15 @@ declare module "react/addons" { (props?: P, ...children: ReactNode[]): ReactElement

; } - interface ClassicFactory

{ + interface ModernFactory

extends Factory

{ + (props?: P, ...children: ReactNode[]): ReactModernElement

; + } + + interface ClassicFactory

extends Factory

{ (props?: P, ...children: ReactNode[]): ReactClassicElement

; } - interface DOMFactory

{ + interface DOMFactory

extends Factory

{ (props?: P, ...children: ReactNode[]): ReactDOMElement

; } @@ -58,25 +65,22 @@ declare module "react/addons" { // ---------------------------------------------------------------------- type ReactText = string | number; - type ReactChild = ReactElementBase | ReactText; + type ReactChild = ReactElement | ReactText; // Should be Array but type aliases cannot be recursive - type ReactFragment = Array; + type ReactFragment = {} | Array; type ReactNode = ReactChild | ReactFragment | boolean; // // Top Level API // ---------------------------------------------------------------------- - function createClass( - spec: ComponentSpec): ClassicComponentClass; + function createClass(spec: ComponentSpec): ClassicComponentClass; - function createFactory

( - type: string): DOMFactory

; - function createFactory

( - type: ClassicComponentClass | string): ClassicFactory

; - function createFactory

( - type: ComponentClass): Factory

; + function createFactory

(type: string): DOMFactory

; + function createFactory

(type: ClassicComponentClass | string): ClassicFactory

; + function createFactory

(type: ModernComponentClass): ModernFactory

; + function createFactory

(type: ComponentClass

): Factory

; function createElement

( type: string, @@ -87,9 +91,9 @@ declare module "react/addons" { props?: P, ...children: ReactNode[]): ReactClassicElement

; function createElement

( - type: ComponentClass, + type: ModernComponentClass, props?: P, - ...children: ReactNode[]): ReactElement

; + ...children: ReactNode[]): ReactModernElement

; function cloneElement

( element: ReactDOMElement

, @@ -99,6 +103,10 @@ declare module "react/addons" { element: ReactClassicElement

, props?: P, ...children: ReactNode[]): ReactClassicElement

; + function cloneElement

( + element: ReactModernElement

, + props?: P, + ...children: ReactNode[]): ReactModernElement

; function cloneElement

( element: ReactElement

, props?: P, @@ -118,8 +126,8 @@ declare module "react/addons" { callback?: () => any): Component; function unmountComponentAtNode(container: Element): boolean; - function renderToString(element: ReactElementBase): string; - function renderToStaticMarkup(element: ReactElementBase): string; + function renderToString(element: ReactElement): string; + function renderToStaticMarkup(element: ReactElement): string; function isValidElement(object: {}): boolean; function initializeTouchEvents(shouldUseTouch: boolean): void; @@ -164,7 +172,7 @@ declare module "react/addons" { tagName: string; } - export type HTMLComponent = DOMComponent; + type HTMLComponent = DOMComponent; type SVGComponent = DOMComponent; interface ChildContextProvider { @@ -175,18 +183,18 @@ declare module "react/addons" { // Class Interfaces // ---------------------------------------------------------------------- - interface ComponentClassBase

{ + interface ComponentClass

{ propTypes?: ValidationMap

; contextTypes?: ValidationMap; childContextTypes?: ValidationMap; } - interface ComponentClass extends ComponentClassBase

{ + interface ModernComponentClass extends ComponentClass

{ new(props?: P, context?: any): Component; defaultProps?: P; } - interface ClassicComponentClass extends ComponentClassBase

{ + interface ClassicComponentClass extends ComponentClass

{ new(props?: P, context?: any): ClassicComponent; getDefaultProps?(): P; displayName?: string; @@ -222,7 +230,7 @@ declare module "react/addons" { } interface ComponentSpec extends Mixin { - render(): ReactElementBase; + render(): ReactElement; } // @@ -760,6 +768,7 @@ declare module "react/addons" { cloneWithProps

(element: ReactDOMElement

, props: P): ReactDOMElement

; cloneWithProps

(element: ReactClassicElement

, props: P): ReactClassicElement

; + cloneWithProps

(element: ReactModernElement

, props: P): ReactModernElement

; cloneWithProps

(element: ReactElement

, props: P): ReactElement

; createFragment(object: { [key: string]: ReactNode }): ReactFragment; @@ -776,8 +785,6 @@ declare module "react/addons" { // React.addons (Transitions) // ---------------------------------------------------------------------- - type ReactType = ComponentClass | string; - interface TransitionGroupProps { component?: ReactType; childFactory?: (child: ReactElement) => ReactElement; @@ -790,10 +797,8 @@ declare module "react/addons" { transitionLeave?: boolean; } - type CSSTransitionGroup = - ComponentClass; - type TransitionGroup = - ComponentClass; + type CSSTransitionGroup = ComponentClass; + type TransitionGroup = ComponentClass; // // React.addons (Mixins) @@ -885,7 +890,7 @@ declare module "react/addons" { isCompositeComponent(instance: Component): boolean; isCompositeComponentWithType( instance: Component, - type: ComponentClass): boolean; + type: ComponentClass): boolean; findAllInRenderedTree( tree: Component, @@ -905,19 +910,19 @@ declare module "react/addons" { tree: Component, tagName: string): DOMComponent; - scryRenderedComponentsWithType( + scryRenderedComponentsWithType

( tree: Component, - type: ComponentClass): Component[]; + type: ComponentClass

): Component[]; scryRenderedComponentsWithType>( tree: Component, - type: ComponentClass): C[]; + type: ComponentClass): C[]; - findRenderedComponentWithType( + findRenderedComponentWithType

( tree: Component, - type: ComponentClass): Component; + type: ComponentClass

): Component; findRenderedComponentWithType>( tree: Component, - type: ComponentClass): C; + type: ComponentClass): C; } interface SyntheticEventData { diff --git a/react/future/react-addons-global-0.13.0.d.ts b/react/future/react-addons-global-0.13.0.d.ts index c5db4f6d2..94f2844c0 100644 --- a/react/future/react-addons-global-0.13.0.d.ts +++ b/react/future/react-addons-global-0.13.0.d.ts @@ -25,6 +25,7 @@ declare module React { cloneWithProps

(element: ReactDOMElement

, props: P): ReactDOMElement

; cloneWithProps

(element: ReactClassicElement

, props: P): ReactClassicElement

; + cloneWithProps

(element: ReactModernElement

, props: P): ReactModernElement

; cloneWithProps

(element: ReactElement

, props: P): ReactElement

; createFragment(object: { [key: string]: ReactNode }): ReactFragment; @@ -41,8 +42,6 @@ declare module React { // React.addons (Transitions) // ---------------------------------------------------------------------- - type ReactType = ComponentClass | string; - interface TransitionGroupProps { component?: ReactType; childFactory?: (child: ReactElement) => ReactElement; @@ -55,10 +54,8 @@ declare module React { transitionLeave?: boolean; } - type CSSTransitionGroup = - ComponentClass; - type TransitionGroup = - ComponentClass; + type CSSTransitionGroup = ComponentClass; + type TransitionGroup = ComponentClass; // // React.addons (Mixins) @@ -150,7 +147,7 @@ declare module React { isCompositeComponent(instance: Component): boolean; isCompositeComponentWithType( instance: Component, - type: ComponentClass): boolean; + type: ComponentClass): boolean; findAllInRenderedTree( tree: Component, @@ -170,19 +167,19 @@ declare module React { tree: Component, tagName: string): DOMComponent; - scryRenderedComponentsWithType( + scryRenderedComponentsWithType

( tree: Component, - type: ComponentClass): Component[]; + type: ComponentClass

): Component[]; scryRenderedComponentsWithType>( tree: Component, - type: ComponentClass): C[]; + type: ComponentClass): C[]; - findRenderedComponentWithType( + findRenderedComponentWithType

( tree: Component, - type: ComponentClass): Component; + type: ComponentClass

): Component; findRenderedComponentWithType>( tree: Component, - type: ComponentClass): C; + type: ComponentClass): C; } interface SyntheticEventData { diff --git a/react/future/react-global-0.13.0.d.ts b/react/future/react-global-0.13.0.d.ts index b7be8993f..9cd5b69fe 100644 --- a/react/future/react-global-0.13.0.d.ts +++ b/react/future/react-global-0.13.0.d.ts @@ -8,26 +8,29 @@ declare module React { // React Elements // ---------------------------------------------------------------------- - interface ReactElementBase { - type: string | ComponentClassBase

; + type ReactType = ComponentClass | string; + + interface ReactElement

{ + type: string | ComponentClass

; props: P; key: string | number; - ref: string | ((component: T) => any); + ref: string | ((component: Component) => any); } - interface ReactElement

- extends ReactElementBase, P> { - type: ComponentClass; + interface ReactModernElement

extends ReactElement

{ + type: ModernComponentClass; + ref: string | ((component: Component) => any); } - interface ReactClassicElement

- extends ReactElementBase, P> { + interface ReactClassicElement

extends ReactElement

{ type: string | ClassicComponentClass; + ref: string | ((component: ClassicComponent) => any); } - interface ReactDOMElement

// subtype of ReactClassicElement - extends ReactElementBase, P> { + // subtype of ReactClassicElement + interface ReactDOMElement

extends ReactElement

{ type: string; + ref: string | ((component: DOMComponent

) => any); } type ReactHTMLElement = ReactDOMElement; @@ -41,11 +44,15 @@ declare module React { (props?: P, ...children: ReactNode[]): ReactElement

; } - interface ClassicFactory

{ + interface ModernFactory

extends Factory

{ + (props?: P, ...children: ReactNode[]): ReactModernElement

; + } + + interface ClassicFactory

extends Factory

{ (props?: P, ...children: ReactNode[]): ReactClassicElement

; } - interface DOMFactory

{ + interface DOMFactory

extends Factory

{ (props?: P, ...children: ReactNode[]): ReactDOMElement

; } @@ -58,7 +65,7 @@ declare module React { // ---------------------------------------------------------------------- type ReactText = string | number; - type ReactChild = ReactElementBase | ReactText; + type ReactChild = ReactElement | ReactText; // Should be Array but type aliases cannot be recursive type ReactFragment = {} | Array; @@ -68,15 +75,12 @@ declare module React { // Top Level API // ---------------------------------------------------------------------- - function createClass( - spec: ComponentSpec): ClassicComponentClass; + function createClass(spec: ComponentSpec): ClassicComponentClass; - function createFactory

( - type: string): DOMFactory

; - function createFactory

( - type: ClassicComponentClass | string): ClassicFactory

; - function createFactory

( - type: ComponentClass): Factory

; + function createFactory

(type: string): DOMFactory

; + function createFactory

(type: ClassicComponentClass | string): ClassicFactory

; + function createFactory

(type: ModernComponentClass): ModernFactory

; + function createFactory

(type: ComponentClass

): Factory

; function createElement

( type: string, @@ -87,21 +91,25 @@ declare module React { props?: P, ...children: ReactNode[]): ReactClassicElement

; function createElement

( - type: ComponentClass, + type: ModernComponentClass, props?: P, - ...children: ReactNode[]): ReactElement

; + ...children: ReactNode[]): ReactModernElement

; function cloneElement

( element: ReactDOMElement

, - props: P, + props?: P, ...children: ReactNode[]): ReactDOMElement

; function cloneElement

( element: ReactClassicElement

, - props: P, + props?: P, ...children: ReactNode[]): ReactClassicElement

; + function cloneElement

( + element: ReactModernElement

, + props?: P, + ...children: ReactNode[]): ReactModernElement

; function cloneElement

( element: ReactElement

, - props: P, + props?: P, ...children: ReactNode[]): ReactElement

; function render

( @@ -118,8 +126,8 @@ declare module React { callback?: () => any): Component; function unmountComponentAtNode(container: Element): boolean; - function renderToString(element: ReactElementBase): string; - function renderToStaticMarkup(element: ReactElementBase): string; + function renderToString(element: ReactElement): string; + function renderToStaticMarkup(element: ReactElement): string; function isValidElement(object: {}): boolean; function initializeTouchEvents(shouldUseTouch: boolean): void; @@ -175,18 +183,18 @@ declare module React { // Class Interfaces // ---------------------------------------------------------------------- - interface ComponentClassBase

{ + interface ComponentClass

{ propTypes?: ValidationMap

; contextTypes?: ValidationMap; childContextTypes?: ValidationMap; } - interface ComponentClass extends ComponentClassBase

{ + interface ModernComponentClass extends ComponentClass

{ new(props?: P, context?: any): Component; defaultProps?: P; } - interface ClassicComponentClass extends ComponentClassBase

{ + interface ClassicComponentClass extends ComponentClass

{ new(props?: P, context?: any): ClassicComponent; getDefaultProps?(): P; displayName?: string; @@ -222,7 +230,7 @@ declare module React { } interface ComponentSpec extends Mixin { - render(): ReactElementBase; + render(): ReactElement; } // From 4cc6ae4122a6f397e6e77c50ab6c0882ff0ed35f Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Fri, 6 Mar 2015 01:02:02 -0800 Subject: [PATCH 015/243] Remove React prefix from Modern/Classic/DOM Elements --- react/future/react-0.13.0-tests.ts | 20 ++++----- react/future/react-0.13.0.d.ts | 40 ++++++++--------- react/future/react-addons-0.13.0-tests.ts | 20 ++++----- react/future/react-addons-0.13.0.d.ts | 46 ++++++++++---------- react/future/react-addons-global-0.13.0.d.ts | 6 +-- react/future/react-global-0.13.0.d.ts | 40 ++++++++--------- 6 files changed, 86 insertions(+), 86 deletions(-) diff --git a/react/future/react-0.13.0-tests.ts b/react/future/react-0.13.0-tests.ts index cf216503e..fefa644b8 100644 --- a/react/future/react-0.13.0-tests.ts +++ b/react/future/react-0.13.0-tests.ts @@ -121,28 +121,28 @@ var factoryElement: React.ReactElement = var classicFactory: React.ClassicFactory = React.createFactory(ClassicComponent); -var classicFactoryElement: React.ReactClassicElement = +var classicFactoryElement: React.ClassicElement = classicFactory(props); var domFactory: React.DOMFactory = React.createFactory("foo"); -var domFactoryElement: React.ReactDOMElement = +var domFactoryElement: React.DOMElement = domFactory(); // React.createElement -var element: React.ReactModernElement = +var element: React.ModernElement = React.createElement(ModernComponent, props); -var classicElement: React.ReactClassicElement = +var classicElement: React.ClassicElement = React.createElement(ClassicComponent, props); -var domElement: React.ReactHTMLElement = +var domElement: React.HTMLElement = React.createElement("div"); // React.cloneElement -var clonedElement: React.ReactModernElement = +var clonedElement: React.ModernElement = React.cloneElement(element, props); -var clonedClassicElement: React.ReactClassicElement = +var clonedClassicElement: React.ClassicElement = React.cloneElement(classicElement, props); -var clonedDOMElement: React.ReactHTMLElement = +var clonedDOMElement: React.HTMLElement = React.cloneElement(domElement); // React.render @@ -262,7 +262,7 @@ var PropTypesSpecification: React.ComponentSpec = { return null; } }, - render: (): React.ReactHTMLElement => { + render: (): React.ReactElement => { return null; } }; @@ -303,7 +303,7 @@ var ContextTypesSpecification: React.ComponentSpec = { return null; } }, - render: (): React.ReactHTMLElement => { + render: (): React.ReactElement => { return null; } }; diff --git a/react/future/react-0.13.0.d.ts b/react/future/react-0.13.0.d.ts index f87bdc721..a0fbb5214 100644 --- a/react/future/react-0.13.0.d.ts +++ b/react/future/react-0.13.0.d.ts @@ -17,24 +17,24 @@ declare module "react" { ref: string | ((component: Component) => any); } - interface ReactModernElement

extends ReactElement

{ + interface ModernElement

extends ReactElement

{ type: ModernComponentClass; ref: string | ((component: Component) => any); } - interface ReactClassicElement

extends ReactElement

{ + interface ClassicElement

extends ReactElement

{ type: string | ClassicComponentClass; ref: string | ((component: ClassicComponent) => any); } - // subtype of ReactClassicElement - interface ReactDOMElement

extends ReactElement

{ + // subtype of ClassicElement + interface DOMElement

extends ReactElement

{ type: string; ref: string | ((component: DOMComponent

) => any); } - type ReactHTMLElement = ReactDOMElement; - type ReactSVGElement = ReactDOMElement; + type HTMLElement = DOMElement; + type SVGElement = DOMElement; // // Factories @@ -45,15 +45,15 @@ declare module "react" { } interface ModernFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ReactModernElement

; + (props?: P, ...children: ReactNode[]): ModernElement

; } interface ClassicFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ReactClassicElement

; + (props?: P, ...children: ReactNode[]): ClassicElement

; } interface DOMFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ReactDOMElement

; + (props?: P, ...children: ReactNode[]): DOMElement

; } type HTMLFactory = DOMFactory; @@ -85,39 +85,39 @@ declare module "react" { function createElement

( type: string, props?: P, - ...children: ReactNode[]): ReactDOMElement

; + ...children: ReactNode[]): DOMElement

; function createElement

( type: ClassicComponentClass | string, props?: P, - ...children: ReactNode[]): ReactClassicElement

; + ...children: ReactNode[]): ClassicElement

; function createElement

( type: ModernComponentClass, props?: P, - ...children: ReactNode[]): ReactModernElement

; + ...children: ReactNode[]): ModernElement

; function cloneElement

( - element: ReactDOMElement

, + element: DOMElement

, props?: P, - ...children: ReactNode[]): ReactDOMElement

; + ...children: ReactNode[]): DOMElement

; function cloneElement

( - element: ReactClassicElement

, + element: ClassicElement

, props?: P, - ...children: ReactNode[]): ReactClassicElement

; + ...children: ReactNode[]): ClassicElement

; function cloneElement

( - element: ReactModernElement

, + element: ModernElement

, props?: P, - ...children: ReactNode[]): ReactModernElement

; + ...children: ReactNode[]): ModernElement

; function cloneElement

( element: ReactElement

, props?: P, ...children: ReactNode[]): ReactElement

; function render

( - element: ReactDOMElement

, + element: DOMElement

, container: Element, callback?: () => any): DOMComponent

; function render( - element: ReactClassicElement

, + element: ClassicElement

, container: Element, callback?: () => any): ClassicComponent; function render( diff --git a/react/future/react-addons-0.13.0-tests.ts b/react/future/react-addons-0.13.0-tests.ts index ff6889ec0..8ad3a03e9 100644 --- a/react/future/react-addons-0.13.0-tests.ts +++ b/react/future/react-addons-0.13.0-tests.ts @@ -119,28 +119,28 @@ var factoryElement: React.ReactElement = var classicFactory: React.ClassicFactory = React.createFactory(ClassicComponent); -var classicFactoryElement: React.ReactClassicElement = +var classicFactoryElement: React.ClassicElement = classicFactory(props); var domFactory: React.DOMFactory = React.createFactory("foo"); -var domFactoryElement: React.ReactDOMElement = +var domFactoryElement: React.DOMElement = domFactory(); // React.createElement -var element: React.ReactModernElement = +var element: React.ModernElement = React.createElement(ModernComponent, props); -var classicElement: React.ReactClassicElement = +var classicElement: React.ClassicElement = React.createElement(ClassicComponent, props); -var domElement: React.ReactHTMLElement = +var domElement: React.HTMLElement = React.createElement("div"); // React.cloneElement -var clonedElement: React.ReactModernElement = +var clonedElement: React.ModernElement = React.cloneElement(element, props); -var clonedClassicElement: React.ReactClassicElement = +var clonedClassicElement: React.ClassicElement = React.cloneElement(classicElement, props); -var clonedDOMElement: React.ReactHTMLElement = +var clonedDOMElement: React.HTMLElement = React.cloneElement(domElement); // React.render @@ -260,7 +260,7 @@ var PropTypesSpecification: React.ComponentSpec = { return null; } }, - render: (): React.ReactHTMLElement => { + render: (): React.ReactElement => { return null; } }; @@ -301,7 +301,7 @@ var ContextTypesSpecification: React.ComponentSpec = { return null; } }, - render: (): React.ReactHTMLElement => { + render: (): React.ReactElement => { return null; } }; diff --git a/react/future/react-addons-0.13.0.d.ts b/react/future/react-addons-0.13.0.d.ts index 5148be3c6..42f18190f 100644 --- a/react/future/react-addons-0.13.0.d.ts +++ b/react/future/react-addons-0.13.0.d.ts @@ -17,24 +17,24 @@ declare module "react/addons" { ref: string | ((component: Component) => any); } - interface ReactModernElement

extends ReactElement

{ + interface ModernElement

extends ReactElement

{ type: ModernComponentClass; ref: string | ((component: Component) => any); } - interface ReactClassicElement

extends ReactElement

{ + interface ClassicElement

extends ReactElement

{ type: string | ClassicComponentClass; ref: string | ((component: ClassicComponent) => any); } - // subtype of ReactClassicElement - interface ReactDOMElement

extends ReactElement

{ + // subtype of ClassicElement + interface DOMElement

extends ReactElement

{ type: string; ref: string | ((component: DOMComponent

) => any); } - type ReactHTMLElement = ReactDOMElement; - type ReactSVGElement = ReactDOMElement; + type HTMLElement = DOMElement; + type SVGElement = DOMElement; // // Factories @@ -45,15 +45,15 @@ declare module "react/addons" { } interface ModernFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ReactModernElement

; + (props?: P, ...children: ReactNode[]): ModernElement

; } interface ClassicFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ReactClassicElement

; + (props?: P, ...children: ReactNode[]): ClassicElement

; } interface DOMFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ReactDOMElement

; + (props?: P, ...children: ReactNode[]): DOMElement

; } type HTMLFactory = DOMFactory; @@ -85,39 +85,39 @@ declare module "react/addons" { function createElement

( type: string, props?: P, - ...children: ReactNode[]): ReactDOMElement

; + ...children: ReactNode[]): DOMElement

; function createElement

( type: ClassicComponentClass | string, props?: P, - ...children: ReactNode[]): ReactClassicElement

; + ...children: ReactNode[]): ClassicElement

; function createElement

( type: ModernComponentClass, props?: P, - ...children: ReactNode[]): ReactModernElement

; + ...children: ReactNode[]): ModernElement

; function cloneElement

( - element: ReactDOMElement

, + element: DOMElement

, props?: P, - ...children: ReactNode[]): ReactDOMElement

; + ...children: ReactNode[]): DOMElement

; function cloneElement

( - element: ReactClassicElement

, + element: ClassicElement

, props?: P, - ...children: ReactNode[]): ReactClassicElement

; + ...children: ReactNode[]): ClassicElement

; function cloneElement

( - element: ReactModernElement

, + element: ModernElement

, props?: P, - ...children: ReactNode[]): ReactModernElement

; + ...children: ReactNode[]): ModernElement

; function cloneElement

( element: ReactElement

, props?: P, ...children: ReactNode[]): ReactElement

; function render

( - element: ReactDOMElement

, + element: DOMElement

, container: Element, callback?: () => any): DOMComponent

; function render( - element: ReactClassicElement

, + element: ClassicElement

, container: Element, callback?: () => any): ClassicComponent; function render( @@ -766,9 +766,9 @@ declare module "react/addons" { classSet(cx: { [key: string]: boolean }): string; classSet(...classList: string[]): string; - cloneWithProps

(element: ReactDOMElement

, props: P): ReactDOMElement

; - cloneWithProps

(element: ReactClassicElement

, props: P): ReactClassicElement

; - cloneWithProps

(element: ReactModernElement

, props: P): ReactModernElement

; + cloneWithProps

(element: DOMElement

, props: P): DOMElement

; + cloneWithProps

(element: ClassicElement

, props: P): ClassicElement

; + cloneWithProps

(element: ModernElement

, props: P): ModernElement

; cloneWithProps

(element: ReactElement

, props: P): ReactElement

; createFragment(object: { [key: string]: ReactNode }): ReactFragment; diff --git a/react/future/react-addons-global-0.13.0.d.ts b/react/future/react-addons-global-0.13.0.d.ts index 94f2844c0..aa83abe34 100644 --- a/react/future/react-addons-global-0.13.0.d.ts +++ b/react/future/react-addons-global-0.13.0.d.ts @@ -23,9 +23,9 @@ declare module React { classSet(cx: { [key: string]: boolean }): string; classSet(...classList: string[]): string; - cloneWithProps

(element: ReactDOMElement

, props: P): ReactDOMElement

; - cloneWithProps

(element: ReactClassicElement

, props: P): ReactClassicElement

; - cloneWithProps

(element: ReactModernElement

, props: P): ReactModernElement

; + cloneWithProps

(element: DOMElement

, props: P): DOMElement

; + cloneWithProps

(element: ClassicElement

, props: P): ClassicElement

; + cloneWithProps

(element: ModernElement

, props: P): ModernElement

; cloneWithProps

(element: ReactElement

, props: P): ReactElement

; createFragment(object: { [key: string]: ReactNode }): ReactFragment; diff --git a/react/future/react-global-0.13.0.d.ts b/react/future/react-global-0.13.0.d.ts index 9cd5b69fe..9e9b33640 100644 --- a/react/future/react-global-0.13.0.d.ts +++ b/react/future/react-global-0.13.0.d.ts @@ -17,24 +17,24 @@ declare module React { ref: string | ((component: Component) => any); } - interface ReactModernElement

extends ReactElement

{ + interface ModernElement

extends ReactElement

{ type: ModernComponentClass; ref: string | ((component: Component) => any); } - interface ReactClassicElement

extends ReactElement

{ + interface ClassicElement

extends ReactElement

{ type: string | ClassicComponentClass; ref: string | ((component: ClassicComponent) => any); } - // subtype of ReactClassicElement - interface ReactDOMElement

extends ReactElement

{ + // subtype of ClassicElement + interface DOMElement

extends ReactElement

{ type: string; ref: string | ((component: DOMComponent

) => any); } - type ReactHTMLElement = ReactDOMElement; - type ReactSVGElement = ReactDOMElement; + type HTMLElement = DOMElement; + type SVGElement = DOMElement; // // Factories @@ -45,15 +45,15 @@ declare module React { } interface ModernFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ReactModernElement

; + (props?: P, ...children: ReactNode[]): ModernElement

; } interface ClassicFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ReactClassicElement

; + (props?: P, ...children: ReactNode[]): ClassicElement

; } interface DOMFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ReactDOMElement

; + (props?: P, ...children: ReactNode[]): DOMElement

; } type HTMLFactory = DOMFactory; @@ -85,39 +85,39 @@ declare module React { function createElement

( type: string, props?: P, - ...children: ReactNode[]): ReactDOMElement

; + ...children: ReactNode[]): DOMElement

; function createElement

( type: ClassicComponentClass | string, props?: P, - ...children: ReactNode[]): ReactClassicElement

; + ...children: ReactNode[]): ClassicElement

; function createElement

( type: ModernComponentClass, props?: P, - ...children: ReactNode[]): ReactModernElement

; + ...children: ReactNode[]): ModernElement

; function cloneElement

( - element: ReactDOMElement

, + element: DOMElement

, props?: P, - ...children: ReactNode[]): ReactDOMElement

; + ...children: ReactNode[]): DOMElement

; function cloneElement

( - element: ReactClassicElement

, + element: ClassicElement

, props?: P, - ...children: ReactNode[]): ReactClassicElement

; + ...children: ReactNode[]): ClassicElement

; function cloneElement

( - element: ReactModernElement

, + element: ModernElement

, props?: P, - ...children: ReactNode[]): ReactModernElement

; + ...children: ReactNode[]): ModernElement

; function cloneElement

( element: ReactElement

, props?: P, ...children: ReactNode[]): ReactElement

; function render

( - element: ReactDOMElement

, + element: DOMElement

, container: Element, callback?: () => any): DOMComponent

; function render( - element: ReactClassicElement

, + element: ClassicElement

, container: Element, callback?: () => any): ClassicComponent; function render( From cbe9f0b94abe050b1c868a93a38065b3d48ea4ba Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Mon, 9 Mar 2015 11:28:02 -0700 Subject: [PATCH 016/243] Remove React.ModernXX interfaces React.ModernElement -> React.ReactElement React.ModernFactory -> React.Factory React.ModernComponentClass -> React.ComponentClass --- react/future/react-0.13.0-tests.ts | 6 +-- react/future/react-0.13.0.d.ts | 42 ++++++------------- react/future/react-addons-0.13.0-tests.ts | 6 +-- react/future/react-addons-0.13.0.d.ts | 43 ++++++-------------- react/future/react-addons-global-0.13.0.d.ts | 1 - react/future/react-global-0.13.0.d.ts | 42 ++++++------------- 6 files changed, 42 insertions(+), 98 deletions(-) diff --git a/react/future/react-0.13.0-tests.ts b/react/future/react-0.13.0-tests.ts index fefa644b8..358359dcf 100644 --- a/react/future/react-0.13.0-tests.ts +++ b/react/future/react-0.13.0-tests.ts @@ -41,7 +41,7 @@ var container: Element; // Top-Level API // -------------------------------------------------------------------------- -var ClassicComponent: React.ClassicComponentClass = +var ClassicComponent: React.ClassicComponentClass = React.createClass({ getDefaultProps: () => { return { @@ -130,7 +130,7 @@ var domFactoryElement: React.DOMElement = domFactory(); // React.createElement -var element: React.ModernElement = +var element: React.ReactElement = React.createElement(ModernComponent, props); var classicElement: React.ClassicElement = React.createElement(ClassicComponent, props); @@ -138,7 +138,7 @@ var domElement: React.HTMLElement = React.createElement("div"); // React.cloneElement -var clonedElement: React.ModernElement = +var clonedElement: React.ReactElement = React.cloneElement(element, props); var clonedClassicElement: React.ClassicElement = React.cloneElement(classicElement, props); diff --git a/react/future/react-0.13.0.d.ts b/react/future/react-0.13.0.d.ts index a0fbb5214..b91847adf 100644 --- a/react/future/react-0.13.0.d.ts +++ b/react/future/react-0.13.0.d.ts @@ -17,18 +17,12 @@ declare module "react" { ref: string | ((component: Component) => any); } - interface ModernElement

extends ReactElement

{ - type: ModernComponentClass; - ref: string | ((component: Component) => any); - } - interface ClassicElement

extends ReactElement

{ - type: string | ClassicComponentClass; + type: string | ClassicComponentClass

; ref: string | ((component: ClassicComponent) => any); } - // subtype of ClassicElement - interface DOMElement

extends ReactElement

{ + interface DOMElement

extends ClassicElement

{ type: string; ref: string | ((component: DOMComponent

) => any); } @@ -44,15 +38,11 @@ declare module "react" { (props?: P, ...children: ReactNode[]): ReactElement

; } - interface ModernFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ModernElement

; - } - interface ClassicFactory

extends Factory

{ (props?: P, ...children: ReactNode[]): ClassicElement

; } - interface DOMFactory

extends Factory

{ + interface DOMFactory

extends ClassicFactory

{ (props?: P, ...children: ReactNode[]): DOMElement

; } @@ -75,11 +65,10 @@ declare module "react" { // Top Level API // ---------------------------------------------------------------------- - function createClass(spec: ComponentSpec): ClassicComponentClass; + function createClass

(spec: ComponentSpec): ClassicComponentClass

; function createFactory

(type: string): DOMFactory

; - function createFactory

(type: ClassicComponentClass | string): ClassicFactory

; - function createFactory

(type: ModernComponentClass): ModernFactory

; + function createFactory

(type: ClassicComponentClass

| string): ClassicFactory

; function createFactory

(type: ComponentClass

): Factory

; function createElement

( @@ -87,13 +76,13 @@ declare module "react" { props?: P, ...children: ReactNode[]): DOMElement

; function createElement

( - type: ClassicComponentClass | string, + type: ClassicComponentClass

| string, props?: P, ...children: ReactNode[]): ClassicElement

; function createElement

( - type: ModernComponentClass, + type: ComponentClass

, props?: P, - ...children: ReactNode[]): ModernElement

; + ...children: ReactNode[]): ReactElement

; function cloneElement

( element: DOMElement

, @@ -103,10 +92,6 @@ declare module "react" { element: ClassicElement

, props?: P, ...children: ReactNode[]): ClassicElement

; - function cloneElement

( - element: ModernElement

, - props?: P, - ...children: ReactNode[]): ModernElement

; function cloneElement

( element: ReactElement

, props?: P, @@ -184,18 +169,15 @@ declare module "react" { // ---------------------------------------------------------------------- interface ComponentClass

{ + new(props?: P, context?: any): Component; propTypes?: ValidationMap

; contextTypes?: ValidationMap; childContextTypes?: ValidationMap; - } - - interface ModernComponentClass extends ComponentClass

{ - new(props?: P, context?: any): Component; defaultProps?: P; } - interface ClassicComponentClass extends ComponentClass

{ - new(props?: P, context?: any): ClassicComponent; + interface ClassicComponentClass

extends ComponentClass

{ + new(props?: P, context?: any): ClassicComponent; getDefaultProps?(): P; displayName?: string; } @@ -225,8 +207,8 @@ declare module "react" { contextTypes?: ValidationMap; childContextTypes?: ValidationMap - getInitialState?(): S; getDefaultProps?(): P; + getInitialState?(): S; } interface ComponentSpec extends Mixin { diff --git a/react/future/react-addons-0.13.0-tests.ts b/react/future/react-addons-0.13.0-tests.ts index 8ad3a03e9..bea751b70 100644 --- a/react/future/react-addons-0.13.0-tests.ts +++ b/react/future/react-addons-0.13.0-tests.ts @@ -39,7 +39,7 @@ var container: Element; // Top-Level API // -------------------------------------------------------------------------- -var ClassicComponent: React.ClassicComponentClass = +var ClassicComponent: React.ClassicComponentClass = React.createClass({ getDefaultProps: () => { return { @@ -128,7 +128,7 @@ var domFactoryElement: React.DOMElement = domFactory(); // React.createElement -var element: React.ModernElement = +var element: React.ReactElement = React.createElement(ModernComponent, props); var classicElement: React.ClassicElement = React.createElement(ClassicComponent, props); @@ -136,7 +136,7 @@ var domElement: React.HTMLElement = React.createElement("div"); // React.cloneElement -var clonedElement: React.ModernElement = +var clonedElement: React.ReactElement = React.cloneElement(element, props); var clonedClassicElement: React.ClassicElement = React.cloneElement(classicElement, props); diff --git a/react/future/react-addons-0.13.0.d.ts b/react/future/react-addons-0.13.0.d.ts index 42f18190f..19cf44ed2 100644 --- a/react/future/react-addons-0.13.0.d.ts +++ b/react/future/react-addons-0.13.0.d.ts @@ -17,18 +17,12 @@ declare module "react/addons" { ref: string | ((component: Component) => any); } - interface ModernElement

extends ReactElement

{ - type: ModernComponentClass; - ref: string | ((component: Component) => any); - } - interface ClassicElement

extends ReactElement

{ - type: string | ClassicComponentClass; + type: string | ClassicComponentClass

; ref: string | ((component: ClassicComponent) => any); } - // subtype of ClassicElement - interface DOMElement

extends ReactElement

{ + interface DOMElement

extends ClassicElement

{ type: string; ref: string | ((component: DOMComponent

) => any); } @@ -44,15 +38,11 @@ declare module "react/addons" { (props?: P, ...children: ReactNode[]): ReactElement

; } - interface ModernFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ModernElement

; - } - interface ClassicFactory

extends Factory

{ (props?: P, ...children: ReactNode[]): ClassicElement

; } - interface DOMFactory

extends Factory

{ + interface DOMFactory

extends ClassicFactory

{ (props?: P, ...children: ReactNode[]): DOMElement

; } @@ -75,11 +65,10 @@ declare module "react/addons" { // Top Level API // ---------------------------------------------------------------------- - function createClass(spec: ComponentSpec): ClassicComponentClass; + function createClass(spec: ComponentSpec): ClassicComponentClass

; function createFactory

(type: string): DOMFactory

; - function createFactory

(type: ClassicComponentClass | string): ClassicFactory

; - function createFactory

(type: ModernComponentClass): ModernFactory

; + function createFactory

(type: ClassicComponentClass

| string): ClassicFactory

; function createFactory

(type: ComponentClass

): Factory

; function createElement

( @@ -87,13 +76,13 @@ declare module "react/addons" { props?: P, ...children: ReactNode[]): DOMElement

; function createElement

( - type: ClassicComponentClass | string, + type: ClassicComponentClass

| string, props?: P, ...children: ReactNode[]): ClassicElement

; function createElement

( - type: ModernComponentClass, + type: ComponentClass

, props?: P, - ...children: ReactNode[]): ModernElement

; + ...children: ReactNode[]): ReactElement

; function cloneElement

( element: DOMElement

, @@ -103,10 +92,6 @@ declare module "react/addons" { element: ClassicElement

, props?: P, ...children: ReactNode[]): ClassicElement

; - function cloneElement

( - element: ModernElement

, - props?: P, - ...children: ReactNode[]): ModernElement

; function cloneElement

( element: ReactElement

, props?: P, @@ -184,18 +169,15 @@ declare module "react/addons" { // ---------------------------------------------------------------------- interface ComponentClass

{ + new(props?: P, context?: any): Component; propTypes?: ValidationMap

; contextTypes?: ValidationMap; childContextTypes?: ValidationMap; - } - - interface ModernComponentClass extends ComponentClass

{ - new(props?: P, context?: any): Component; defaultProps?: P; } - interface ClassicComponentClass extends ComponentClass

{ - new(props?: P, context?: any): ClassicComponent; + interface ClassicComponentClass

extends ComponentClass

{ + new(props?: P, context?: any): ClassicComponent; getDefaultProps?(): P; displayName?: string; } @@ -225,8 +207,8 @@ declare module "react/addons" { contextTypes?: ValidationMap; childContextTypes?: ValidationMap - getInitialState?(): S; getDefaultProps?(): P; + getInitialState?(): S; } interface ComponentSpec extends Mixin { @@ -768,7 +750,6 @@ declare module "react/addons" { cloneWithProps

(element: DOMElement

, props: P): DOMElement

; cloneWithProps

(element: ClassicElement

, props: P): ClassicElement

; - cloneWithProps

(element: ModernElement

, props: P): ModernElement

; cloneWithProps

(element: ReactElement

, props: P): ReactElement

; createFragment(object: { [key: string]: ReactNode }): ReactFragment; diff --git a/react/future/react-addons-global-0.13.0.d.ts b/react/future/react-addons-global-0.13.0.d.ts index aa83abe34..343590f98 100644 --- a/react/future/react-addons-global-0.13.0.d.ts +++ b/react/future/react-addons-global-0.13.0.d.ts @@ -25,7 +25,6 @@ declare module React { cloneWithProps

(element: DOMElement

, props: P): DOMElement

; cloneWithProps

(element: ClassicElement

, props: P): ClassicElement

; - cloneWithProps

(element: ModernElement

, props: P): ModernElement

; cloneWithProps

(element: ReactElement

, props: P): ReactElement

; createFragment(object: { [key: string]: ReactNode }): ReactFragment; diff --git a/react/future/react-global-0.13.0.d.ts b/react/future/react-global-0.13.0.d.ts index 9e9b33640..268d4bf86 100644 --- a/react/future/react-global-0.13.0.d.ts +++ b/react/future/react-global-0.13.0.d.ts @@ -17,18 +17,12 @@ declare module React { ref: string | ((component: Component) => any); } - interface ModernElement

extends ReactElement

{ - type: ModernComponentClass; - ref: string | ((component: Component) => any); - } - interface ClassicElement

extends ReactElement

{ - type: string | ClassicComponentClass; + type: string | ClassicComponentClass

; ref: string | ((component: ClassicComponent) => any); } - // subtype of ClassicElement - interface DOMElement

extends ReactElement

{ + interface DOMElement

extends ClassicElement

{ type: string; ref: string | ((component: DOMComponent

) => any); } @@ -44,15 +38,11 @@ declare module React { (props?: P, ...children: ReactNode[]): ReactElement

; } - interface ModernFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ModernElement

; - } - interface ClassicFactory

extends Factory

{ (props?: P, ...children: ReactNode[]): ClassicElement

; } - interface DOMFactory

extends Factory

{ + interface DOMFactory

extends ClassicFactory

{ (props?: P, ...children: ReactNode[]): DOMElement

; } @@ -75,11 +65,10 @@ declare module React { // Top Level API // ---------------------------------------------------------------------- - function createClass(spec: ComponentSpec): ClassicComponentClass; + function createClass(spec: ComponentSpec): ClassicComponentClass

; function createFactory

(type: string): DOMFactory

; - function createFactory

(type: ClassicComponentClass | string): ClassicFactory

; - function createFactory

(type: ModernComponentClass): ModernFactory

; + function createFactory

(type: ClassicComponentClass

| string): ClassicFactory

; function createFactory

(type: ComponentClass

): Factory

; function createElement

( @@ -87,13 +76,13 @@ declare module React { props?: P, ...children: ReactNode[]): DOMElement

; function createElement

( - type: ClassicComponentClass | string, + type: ClassicComponentClass

| string, props?: P, ...children: ReactNode[]): ClassicElement

; function createElement

( - type: ModernComponentClass, + type: ComponentClass

, props?: P, - ...children: ReactNode[]): ModernElement

; + ...children: ReactNode[]): ReactElement

; function cloneElement

( element: DOMElement

, @@ -103,10 +92,6 @@ declare module React { element: ClassicElement

, props?: P, ...children: ReactNode[]): ClassicElement

; - function cloneElement

( - element: ModernElement

, - props?: P, - ...children: ReactNode[]): ModernElement

; function cloneElement

( element: ReactElement

, props?: P, @@ -184,18 +169,15 @@ declare module React { // ---------------------------------------------------------------------- interface ComponentClass

{ + new(props?: P, context?: any): Component; propTypes?: ValidationMap

; contextTypes?: ValidationMap; childContextTypes?: ValidationMap; - } - - interface ModernComponentClass extends ComponentClass

{ - new(props?: P, context?: any): Component; defaultProps?: P; } - interface ClassicComponentClass extends ComponentClass

{ - new(props?: P, context?: any): ClassicComponent; + interface ClassicComponentClass

extends ComponentClass

{ + new(props?: P, context?: any): ClassicComponent; getDefaultProps?(): P; displayName?: string; } @@ -225,8 +207,8 @@ declare module React { contextTypes?: ValidationMap; childContextTypes?: ValidationMap - getInitialState?(): S; getDefaultProps?(): P; + getInitialState?(): S; } interface ComponentSpec extends Mixin { From 57340eca1e3aac68d59cc981b441da834ca38235 Mon Sep 17 00:00:00 2001 From: Phips Peter Date: Tue, 10 Mar 2015 18:55:18 -0700 Subject: [PATCH 017/243] Moving React 0.13 to be the default React 0.13 is now released so it should be the default type definition. http://facebook.github.io/react/blog/2015/03/10/react-v0.13.html --- fluxxor/fluxxor.d.ts | 2 +- jsnox/jsnox.d.ts | 2 +- react-router/react-router.d.ts | 2 +- react/{future => }/README.md | 0 react/future/react-0.13.0-tests.ts | 354 ------------ react/future/react-addons-0.13.0-tests.ts | 389 -------------- react/legacy/react-0.12-tests.ts | 235 ++++++++ .../react-0.12.d.ts} | 507 ++++++++++++------ react/legacy/react-addons-0.12-tests.ts | 68 +++ ...l-0.13.0.d.ts => react-addons-global.d.ts} | 2 +- react/react-addons-tests.ts | 401 ++++++++++++-- ...t-addons-0.13.0.d.ts => react-addons.d.ts} | 0 ...t-global-0.13.0.d.ts => react-global.d.ts} | 0 react/react-tests.ts | 281 +++++++--- react/react.d.ts | 507 ++++++------------ 15 files changed, 1374 insertions(+), 1376 deletions(-) rename react/{future => }/README.md (100%) delete mode 100644 react/future/react-0.13.0-tests.ts delete mode 100644 react/future/react-addons-0.13.0-tests.ts create mode 100644 react/legacy/react-0.12-tests.ts rename react/{future/react-0.13.0.d.ts => legacy/react-0.12.d.ts} (61%) create mode 100644 react/legacy/react-addons-0.12-tests.ts rename react/{future/react-addons-global-0.13.0.d.ts => react-addons-global.d.ts} (99%) rename react/{future/react-addons-0.13.0.d.ts => react-addons.d.ts} (100%) rename react/{future/react-global-0.13.0.d.ts => react-global.d.ts} (100%) diff --git a/fluxxor/fluxxor.d.ts b/fluxxor/fluxxor.d.ts index e857a6b15..e8b89a66d 100644 --- a/fluxxor/fluxxor.d.ts +++ b/fluxxor/fluxxor.d.ts @@ -3,7 +3,7 @@ // Definitions by: Yuichi Murata // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// /// declare module Fluxxor { diff --git a/jsnox/jsnox.d.ts b/jsnox/jsnox.d.ts index b3e4460c0..72584563b 100644 --- a/jsnox/jsnox.d.ts +++ b/jsnox/jsnox.d.ts @@ -3,7 +3,7 @@ // Definitions by: Steve Baker // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// declare module 'jsnox' { diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index 13c573b4b..8f63f2d69 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -3,7 +3,7 @@ // Definitions by: Yuichi Murata // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// declare module ReactRouter { // diff --git a/react/future/README.md b/react/README.md similarity index 100% rename from react/future/README.md rename to react/README.md diff --git a/react/future/react-0.13.0-tests.ts b/react/future/react-0.13.0-tests.ts deleted file mode 100644 index 358359dcf..000000000 --- a/react/future/react-0.13.0-tests.ts +++ /dev/null @@ -1,354 +0,0 @@ -/// -// requiring react/addons instead of react so react.d.ts doesn't get picked up -// TODO: import "react" once 0.13.0 is released -import React = require("react/addons"); - -interface Props extends React.Props { - hello: string; - world?: string; - foo: number; - bar: boolean; -} - -interface State { - inputValue?: string; - seconds?: number; -} - -interface Context { - someValue?: string; -} - -interface ChildContext { - someOtherValue: string; -} - -interface MyComponent extends React.Component { - reset(): void; -} - -var props: Props = { - key: 42, - ref: "myComponent42", - hello: "world", - foo: 42, - bar: true -}; - -var container: Element; - -// -// Top-Level API -// -------------------------------------------------------------------------- - -var ClassicComponent: React.ClassicComponentClass = - React.createClass({ - getDefaultProps: () => { - return { - hello: undefined, - world: "peace", - foo: undefined, - bar: undefined - }; - }, - getInitialState: () => { - return { - inputValue: this.context.someValue, - seconds: this.props.foo - }; - }, - reset: () => { - this.replaceState(this.getInitialState()); - }, - render: () => { - return React.DOM.div(null, - React.DOM.input({ - ref: input => this._input = input, - value: this.state.inputValue - })); - } - }); - -class ModernComponent extends React.Component - implements React.ChildContextProvider { - - static propTypes: React.ValidationMap = { - foo: React.PropTypes.number - } - - static contextTypes: React.ValidationMap = { - someValue: React.PropTypes.string - } - - static childContextTypes: React.ValidationMap = { - someOtherValue: React.PropTypes.string - } - - getChildContext() { - return { - someOtherValue: 'foo' - } - } - - state = { - inputValue: this.context.someValue, - seconds: this.props.foo - } - - reset() { - this.setState({ - inputValue: this.context.someValue, - seconds: this.props.foo - }); - } - - private _input: React.HTMLComponent; - - render() { - return React.DOM.div(null, - React.DOM.input({ - ref: input => this._input = input, - value: this.state.inputValue - })); - } -} - -// React.createFactory -var factory: React.Factory = - React.createFactory(ModernComponent); -var factoryElement: React.ReactElement = - factory(props); - -var classicFactory: React.ClassicFactory = - React.createFactory(ClassicComponent); -var classicFactoryElement: React.ClassicElement = - classicFactory(props); - -var domFactory: React.DOMFactory = - React.createFactory("foo"); -var domFactoryElement: React.DOMElement = - domFactory(); - -// React.createElement -var element: React.ReactElement = - React.createElement(ModernComponent, props); -var classicElement: React.ClassicElement = - React.createElement(ClassicComponent, props); -var domElement: React.HTMLElement = - React.createElement("div"); - -// React.cloneElement -var clonedElement: React.ReactElement = - React.cloneElement(element, props); -var clonedClassicElement: React.ClassicElement = - React.cloneElement(classicElement, props); -var clonedDOMElement: React.HTMLElement = - React.cloneElement(domElement); - -// React.render -var component: React.Component = - React.render(element, container); -var classicComponent: React.ClassicComponent = - React.render(classicElement, container); -var domComponent: React.DOMComponent = - React.render(domElement, container); - -// Other Top-Level API -var unmounted: boolean = React.unmountComponentAtNode(container); -var str: string = React.renderToString(element); -var markup: string = React.renderToStaticMarkup(element); -var notValid: boolean = React.isValidElement(props); // false -var isValid = React.isValidElement(element); // true -React.initializeTouchEvents(true); -var domNode: Element = React.findDOMNode(component); -domNode = React.findDOMNode(domNode); - -// -// React Elements -// -------------------------------------------------------------------------- - -var type = element.type; -var elementProps: Props = element.props; -var key = element.key; - -// -// React Components -// -------------------------------------------------------------------------- - -var displayName: string = ClassicComponent.displayName; -var defaultProps: Props = ClassicComponent.getDefaultProps(); -var propTypes: React.ValidationMap = ClassicComponent.propTypes; - -// -// Component API -// -------------------------------------------------------------------------- - -// modern -var componentState: State = component.state; -component.setState({ inputValue: "!!!" }); -component.forceUpdate(); - -// classic -var htmlElement: Element = classicComponent.getDOMNode(); -var divElement: HTMLDivElement = classicComponent.getDOMNode(); -var isMounted: boolean = classicComponent.isMounted(); -classicComponent.setProps(elementProps); -classicComponent.replaceProps(props); -classicComponent.replaceState({ inputValue: "???", seconds: 60 }); - -var myComponent = component; -myComponent.reset(); - -// -// Attributes -// -------------------------------------------------------------------------- - -var children = ["Hello world", [null], React.DOM.span(null)]; -var divStyle = { // CSSProperties - flex: "1 1 main-size", - backgroundImage: "url('hello.png')" -}; -var htmlAttr: React.HTMLAttributes = { - key: 36, - ref: "htmlComponent", - children: children, - className: "test-attr", - style: divStyle, - onClick: (event: React.MouseEvent) => { - event.preventDefault(); - event.stopPropagation(); - }, - dangerouslySetInnerHTML: { - __html: "STRONG" - } -}; -React.DOM.div(htmlAttr); -React.DOM.span(htmlAttr); -React.DOM.input(htmlAttr); - -// -// React.PropTypes -// -------------------------------------------------------------------------- - -var PropTypesSpecification: React.ComponentSpec = { - propTypes: { - optionalArray: React.PropTypes.array, - optionalBool: React.PropTypes.bool, - optionalFunc: React.PropTypes.func, - optionalNumber: React.PropTypes.number, - optionalObject: React.PropTypes.object, - optionalString: React.PropTypes.string, - optionalNode: React.PropTypes.node, - optionalElement: React.PropTypes.element, - optionalMessage: React.PropTypes.instanceOf(Date), - optionalEnum: React.PropTypes.oneOf(["News", "Photos"]), - optionalUnion: React.PropTypes.oneOfType([ - React.PropTypes.string, - React.PropTypes.number, - React.PropTypes.instanceOf(Date) - ]), - optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number), - optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number), - optionalObjectWithShape: React.PropTypes.shape({ - color: React.PropTypes.string, - fontSize: React.PropTypes.number - }), - requiredFunc: React.PropTypes.func.isRequired, - requiredAny: React.PropTypes.any.isRequired, - customProp: function(props: any, propName: string, componentName: string) { - if (!/matchme/.test(props[propName])) { - return new Error("Validation failed!"); - } - return null; - } - }, - render: (): React.ReactElement => { - return null; - } -}; - -// -// ContextTypes -// -------------------------------------------------------------------------- - -var ContextTypesSpecification: React.ComponentSpec = { - contextTypes: { - optionalArray: React.PropTypes.array, - optionalBool: React.PropTypes.bool, - optionalFunc: React.PropTypes.func, - optionalNumber: React.PropTypes.number, - optionalObject: React.PropTypes.object, - optionalString: React.PropTypes.string, - optionalNode: React.PropTypes.node, - optionalElement: React.PropTypes.element, - optionalMessage: React.PropTypes.instanceOf(Date), - optionalEnum: React.PropTypes.oneOf(["News", "Photos"]), - optionalUnion: React.PropTypes.oneOfType([ - React.PropTypes.string, - React.PropTypes.number, - React.PropTypes.instanceOf(Date) - ]), - optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number), - optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number), - optionalObjectWithShape: React.PropTypes.shape({ - color: React.PropTypes.string, - fontSize: React.PropTypes.number - }), - requiredFunc: React.PropTypes.func.isRequired, - requiredAny: React.PropTypes.any.isRequired, - customProp: function(props: any, propName: string, componentName: string) { - if (!/matchme/.test(props[propName])) { - return new Error("Validation failed!"); - } - return null; - } - }, - render: (): React.ReactElement => { - return null; - } -}; - -// -// React.Children -// -------------------------------------------------------------------------- - -var childMap: { [key: string]: number } = - React.Children.map(children, (child) => { return 42; }); -React.Children.forEach(children, (child) => {}); -var nChildren: number = React.Children.count(children); -var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); - -// -// Example from http://facebook.github.io/react/ -// -------------------------------------------------------------------------- - -interface TimerState { - secondsElapsed: number; -} -class Timer extends React.Component<{}, TimerState> { - static state = { - secondsElapsed: 0 - } - private _interval: number; - tick() { - this.setState((prevState, props) => ({ - secondsElapsed: prevState.secondsElapsed + 1 - })); - } - componentDidMount() { - var me = this; - this._interval = setInterval(() => me.tick(), 1000); - } - componentWillUnmount() { - clearInterval(this._interval); - } - render() { - return React.DOM.div( - null, - "Seconds Elapsed: ", - this.state.secondsElapsed - ); - } -} -React.render(React.createElement(Timer), container); - diff --git a/react/future/react-addons-0.13.0-tests.ts b/react/future/react-addons-0.13.0-tests.ts deleted file mode 100644 index bea751b70..000000000 --- a/react/future/react-addons-0.13.0-tests.ts +++ /dev/null @@ -1,389 +0,0 @@ -/// -import React = require("react/addons"); - -interface Props extends React.Props { - hello: string; - world?: string; - foo: number; - bar: boolean; -} - -interface State { - inputValue?: string; - seconds?: number; -} - -interface Context { - someValue?: string; -} - -interface ChildContext { - someOtherValue: string; -} - -interface MyComponent extends React.Component { - reset(): void; -} - -var props: Props = { - key: 42, - ref: "myComponent42", - hello: "world", - foo: 42, - bar: true -}; - -var container: Element; - -// -// Top-Level API -// -------------------------------------------------------------------------- - -var ClassicComponent: React.ClassicComponentClass = - React.createClass({ - getDefaultProps: () => { - return { - hello: undefined, - world: "peace", - foo: undefined, - bar: undefined - }; - }, - getInitialState: () => { - return { - inputValue: this.context.someValue, - seconds: this.props.foo - }; - }, - reset: () => { - this.replaceState(this.getInitialState()); - }, - render: () => { - return React.DOM.div(null, - React.DOM.input({ - ref: input => this._input = input, - value: this.state.inputValue - })); - } - }); - -class ModernComponent extends React.Component - implements React.ChildContextProvider { - - static propTypes: React.ValidationMap = { - foo: React.PropTypes.number - } - - static contextTypes: React.ValidationMap = { - someValue: React.PropTypes.string - } - - static childContextTypes: React.ValidationMap = { - someOtherValue: React.PropTypes.string - } - - getChildContext() { - return { - someOtherValue: 'foo' - } - } - - state = { - inputValue: this.context.someValue, - seconds: this.props.foo - } - - reset() { - this.setState({ - inputValue: this.context.someValue, - seconds: this.props.foo - }); - } - - private _input: React.HTMLComponent; - - render() { - return React.DOM.div(null, - React.DOM.input({ - ref: input => this._input = input, - value: this.state.inputValue - })); - } -} - -// React.createFactory -var factory: React.Factory = - React.createFactory(ModernComponent); -var factoryElement: React.ReactElement = - factory(props); - -var classicFactory: React.ClassicFactory = - React.createFactory(ClassicComponent); -var classicFactoryElement: React.ClassicElement = - classicFactory(props); - -var domFactory: React.DOMFactory = - React.createFactory("foo"); -var domFactoryElement: React.DOMElement = - domFactory(); - -// React.createElement -var element: React.ReactElement = - React.createElement(ModernComponent, props); -var classicElement: React.ClassicElement = - React.createElement(ClassicComponent, props); -var domElement: React.HTMLElement = - React.createElement("div"); - -// React.cloneElement -var clonedElement: React.ReactElement = - React.cloneElement(element, props); -var clonedClassicElement: React.ClassicElement = - React.cloneElement(classicElement, props); -var clonedDOMElement: React.HTMLElement = - React.cloneElement(domElement); - -// React.render -var component: React.Component = - React.render(element, container); -var classicComponent: React.ClassicComponent = - React.render(classicElement, container); -var domComponent: React.DOMComponent = - React.render(domElement, container); - -// Other Top-Level API -var unmounted: boolean = React.unmountComponentAtNode(container); -var str: string = React.renderToString(element); -var markup: string = React.renderToStaticMarkup(element); -var notValid: boolean = React.isValidElement(props); // false -var isValid = React.isValidElement(element); // true -React.initializeTouchEvents(true); -var domNode: Element = React.findDOMNode(component); -domNode = React.findDOMNode(domNode); - -// -// React Elements -// -------------------------------------------------------------------------- - -var type = element.type; -var elementProps: Props = element.props; -var key = element.key; - -// -// React Components -// -------------------------------------------------------------------------- - -var displayName: string = ClassicComponent.displayName; -var defaultProps: Props = ClassicComponent.getDefaultProps(); -var propTypes: React.ValidationMap = ClassicComponent.propTypes; - -// -// Component API -// -------------------------------------------------------------------------- - -// modern -var componentState: State = component.state; -component.setState({ inputValue: "!!!" }); -component.forceUpdate(); - -// classic -var htmlElement: Element = classicComponent.getDOMNode(); -var divElement: HTMLDivElement = classicComponent.getDOMNode(); -var isMounted: boolean = classicComponent.isMounted(); -classicComponent.setProps(elementProps); -classicComponent.replaceProps(props); -classicComponent.replaceState({ inputValue: "???", seconds: 60 }); - -var myComponent = component; -myComponent.reset(); - -// -// Attributes -// -------------------------------------------------------------------------- - -var children = ["Hello world", [null], React.DOM.span(null)]; -var divStyle = { // CSSProperties - flex: "1 1 main-size", - backgroundImage: "url('hello.png')" -}; -var htmlAttr: React.HTMLAttributes = { - key: 36, - ref: "htmlComponent", - children: children, - className: "test-attr", - style: divStyle, - onClick: (event: React.MouseEvent) => { - event.preventDefault(); - event.stopPropagation(); - }, - dangerouslySetInnerHTML: { - __html: "STRONG" - } -}; -React.DOM.div(htmlAttr); -React.DOM.span(htmlAttr); -React.DOM.input(htmlAttr); - -// -// React.PropTypes -// -------------------------------------------------------------------------- - -var PropTypesSpecification: React.ComponentSpec = { - propTypes: { - optionalArray: React.PropTypes.array, - optionalBool: React.PropTypes.bool, - optionalFunc: React.PropTypes.func, - optionalNumber: React.PropTypes.number, - optionalObject: React.PropTypes.object, - optionalString: React.PropTypes.string, - optionalNode: React.PropTypes.node, - optionalElement: React.PropTypes.element, - optionalMessage: React.PropTypes.instanceOf(Date), - optionalEnum: React.PropTypes.oneOf(["News", "Photos"]), - optionalUnion: React.PropTypes.oneOfType([ - React.PropTypes.string, - React.PropTypes.number, - React.PropTypes.instanceOf(Date) - ]), - optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number), - optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number), - optionalObjectWithShape: React.PropTypes.shape({ - color: React.PropTypes.string, - fontSize: React.PropTypes.number - }), - requiredFunc: React.PropTypes.func.isRequired, - requiredAny: React.PropTypes.any.isRequired, - customProp: function(props: any, propName: string, componentName: string) { - if (!/matchme/.test(props[propName])) { - return new Error("Validation failed!"); - } - return null; - } - }, - render: (): React.ReactElement => { - return null; - } -}; - -// -// ContextTypes -// -------------------------------------------------------------------------- - -var ContextTypesSpecification: React.ComponentSpec = { - contextTypes: { - optionalArray: React.PropTypes.array, - optionalBool: React.PropTypes.bool, - optionalFunc: React.PropTypes.func, - optionalNumber: React.PropTypes.number, - optionalObject: React.PropTypes.object, - optionalString: React.PropTypes.string, - optionalNode: React.PropTypes.node, - optionalElement: React.PropTypes.element, - optionalMessage: React.PropTypes.instanceOf(Date), - optionalEnum: React.PropTypes.oneOf(["News", "Photos"]), - optionalUnion: React.PropTypes.oneOfType([ - React.PropTypes.string, - React.PropTypes.number, - React.PropTypes.instanceOf(Date) - ]), - optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number), - optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number), - optionalObjectWithShape: React.PropTypes.shape({ - color: React.PropTypes.string, - fontSize: React.PropTypes.number - }), - requiredFunc: React.PropTypes.func.isRequired, - requiredAny: React.PropTypes.any.isRequired, - customProp: function(props: any, propName: string, componentName: string) { - if (!/matchme/.test(props[propName])) { - return new Error("Validation failed!"); - } - return null; - } - }, - render: (): React.ReactElement => { - return null; - } -}; - -// -// React.Children -// -------------------------------------------------------------------------- - -var childMap: { [key: string]: number } = - React.Children.map(children, (child) => { return 42; }); -React.Children.forEach(children, (child) => {}); -var nChildren: number = React.Children.count(children); -var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); - -// -// Example from http://facebook.github.io/react/ -// -------------------------------------------------------------------------- - -interface TimerState { - secondsElapsed: number; -} -class Timer extends React.Component, TimerState> { - static state = { - secondsElapsed: 0 - } - private _interval: number; - tick() { - this.setState((prevState, props) => ({ - secondsElapsed: prevState.secondsElapsed + 1 - })); - } - componentDidMount() { - this._interval = setInterval(() => this.tick(), 1000); - } - componentWillUnmount() { - clearInterval(this._interval); - } - render() { - return React.DOM.div( - null, - "Seconds Elapsed: ", - this.state.secondsElapsed - ); - } -} -React.render(React.createElement(Timer), container); - -// -// React.addons -// -------------------------------------------------------------------------- - -var cx = React.addons.classSet; -var className: string = cx({ a: true, b: false, c: true }); -className = cx("a", null, "b"); - -React.addons.createFragment({ - a: React.DOM.div(), - b: ["a", false, React.createElement("span")] -}); - -// -// React.addons (Transitions) -// -------------------------------------------------------------------------- - -React.createFactory(React.addons.TransitionGroup)({ component: "div" }); -React.createFactory(React.addons.CSSTransitionGroup)({ - component: React.createClass({ - render: (): React.ReactElement => null - }), - childFactory: (c) => c, - transitionName: "transition", - transitionAppear: false, - transitionEnter: true, - transitionLeave: true -}); - -// -// React.addons.TestUtils -// -------------------------------------------------------------------------- - -var node: Element; -React.addons.TestUtils.Simulate.click(node); -React.addons.TestUtils.Simulate.change(node); -React.addons.TestUtils.Simulate.keyDown(node, { key: "Enter" }); - diff --git a/react/legacy/react-0.12-tests.ts b/react/legacy/react-0.12-tests.ts new file mode 100644 index 000000000..27eae4c64 --- /dev/null +++ b/react/legacy/react-0.12-tests.ts @@ -0,0 +1,235 @@ +/// +import React = require("react"); + +interface Props { + hello: string; + world?: string; + foo: number; + bar: boolean; +} + +interface State { + inputValue?: string; + seconds?: number; +} + +interface MyComponent extends React.CompositeComponent { + reset(): void; +} + +var props: Props = { + key: 42, + ref: "myComponent42", + hello: "world", + foo: 42, + bar: true +}; + +var container: Element; +var INPUT_REF: string = "input"; + +// +// Top-Level API +// -------------------------------------------------------------------------- + +var reactClass: React.ComponentClass = React.createClass({ + getDefaultProps: () => { + return { + hello: undefined, + world: "peace", + foo: undefined, + bar: undefined + }; + }, + getInitialState: () => { + return { + inputValue: "React.js", + seconds: 0 + }; + }, + reset: () => { + this.replaceState(this.getInitialState()); + }, + render: () => { + return React.DOM.div(null, + React.DOM.input({ + ref: INPUT_REF, + value: this.state.inputValue + })); + } +}); + +var reactElement: React.ReactElement = + React.createElement(reactClass, props); + +var reactFactory: React.ComponentFactory = + React.createFactory(reactClass); + +var component: React.Component = + React.render(reactElement, container); + +var unmounted: boolean = React.unmountComponentAtNode(container); +var str: string = React.renderToString(reactElement); +var markup: string = React.renderToStaticMarkup(reactElement); +var notValid: boolean = React.isValidElement(props); // false +var isValid = React.isValidElement(reactElement); // true +React.initializeTouchEvents(true); + +// +// React Elements +// -------------------------------------------------------------------------- + +var type = reactElement.type; +var elementProps: Props = reactElement.props; +var key = reactElement.key; +var ref: string = reactElement.ref; +var factoryElement: React.ReactElement = reactFactory(elementProps); + +// +// React Components +// -------------------------------------------------------------------------- + +var displayName: string = reactClass.displayName; +var defaultProps: Props = reactClass.getDefaultProps(); +var propTypes: React.ValidationMap = reactClass.propTypes; + +// +// Component API +// -------------------------------------------------------------------------- + +var htmlElement: Element = component.getDOMNode(); +var divElement: HTMLDivElement = component.getDOMNode(); +var isMounted: boolean = component.isMounted(); +component.setProps(elementProps); +component.replaceProps(props); + +var compComponent: React.CompositeComponent = + >component; +var initialState: State = compComponent.state; +compComponent.setState({ inputValue: "!!!" }); +compComponent.replaceState({ inputValue: "???", seconds: 60 }); +compComponent.forceUpdate(); + +var inputRef: React.HTMLComponent = + compComponent.refs[INPUT_REF]; +var value: string = inputRef.getDOMNode().value; + +var myComponent = compComponent; +myComponent.reset(); + +// +// Attributes +// -------------------------------------------------------------------------- + +var children = ["Hello world", [null], React.DOM.span(null)]; +var divStyle = { // CSSProperties + flex: "1 1 main-size", + backgroundImage: "url('hello.png')" +}; +var htmlAttr: React.HTMLAttributes = { + key: 36, + ref: "htmlComponent", + children: children, + className: "test-attr", + style: divStyle, + onClick: (event: React.MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); + }, + dangerouslySetInnerHTML: { + __html: "STRONG" + } +}; +React.DOM.div(htmlAttr); +React.DOM.span(htmlAttr); +React.DOM.input(htmlAttr); + +// +// React.PropTypes +// -------------------------------------------------------------------------- + +var PropTypesSpecification: React.ComponentSpec = { + propTypes: { + optionalArray: React.PropTypes.array, + optionalBool: React.PropTypes.bool, + optionalFunc: React.PropTypes.func, + optionalNumber: React.PropTypes.number, + optionalObject: React.PropTypes.object, + optionalString: React.PropTypes.string, + optionalNode: React.PropTypes.node, + optionalElement: React.PropTypes.element, + optionalMessage: React.PropTypes.instanceOf(Date), + optionalEnum: React.PropTypes.oneOf(["News", "Photos"]), + optionalUnion: React.PropTypes.oneOfType([ + React.PropTypes.string, + React.PropTypes.number, + React.PropTypes.instanceOf(Date) + ]), + optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number), + optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number), + optionalObjectWithShape: React.PropTypes.shape({ + color: React.PropTypes.string, + fontSize: React.PropTypes.number + }), + requiredFunc: React.PropTypes.func.isRequired, + requiredAny: React.PropTypes.any.isRequired, + customProp: function(props: any, propName: string, componentName: string) { + if (!/matchme/.test(props[propName])) { + return new Error("Validation failed!"); + } + return null; + } + }, + render: (): React.ReactHTMLElement => { + return null; + } +}; + +// +// React.Children +// -------------------------------------------------------------------------- + +var childMap: { [key: string]: number } = + React.Children.map(children, (child) => { return 42; }); +React.Children.forEach(children, (child) => {}); +var nChildren: number = React.Children.count(children); +var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); + +// +// Example from http://facebook.github.io/react/ +// -------------------------------------------------------------------------- + +interface TimerState { + secondsElapsed: number; +} +interface Timer extends React.CompositeComponent<{}, TimerState> { +} +var Timer = React.createClass({ + displayName: "Timer", + getInitialState: () => { + return { secondsElapsed: 0 }; + }, + tick: () => { + var me = this; + me.setState({ + secondsElapsed: me.state.secondsElapsed + 1 + }); + }, + componentDidMount: () => { + this.interval = setInterval(this.tick, 1000); + }, + componentWillUnmount: () => { + clearInterval(this.interval); + }, + render: () => { + var me = this; + return React.DOM.div( + null, + "Seconds Elapsed: ", + me.state.secondsElapsed + ); + } +}); +var mountNode: Element; +React.render(React.createElement(Timer, null), mountNode); + diff --git a/react/future/react-0.13.0.d.ts b/react/legacy/react-0.12.d.ts similarity index 61% rename from react/future/react-0.13.0.d.ts rename to react/legacy/react-0.12.d.ts index b91847adf..f2786cbc8 100644 --- a/react/future/react-0.13.0.d.ts +++ b/react/legacy/react-0.12.d.ts @@ -1,56 +1,27 @@ -// Type definitions for React v0.13.0 RC2 (external module) +// Type definitions for React 0.12.1 // Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign +// Definitions by: Asana // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module "react" { +declare module React { // - // React Elements + // React Elements // ---------------------------------------------------------------------- type ReactType = ComponentClass | string; interface ReactElement

{ - type: string | ComponentClass

; + type: ComponentClass

| string; props: P; - key: string | number; - ref: string | ((component: Component) => any); + key: number | string; + ref: string; } - interface ClassicElement

extends ReactElement

{ - type: string | ClassicComponentClass

; - ref: string | ((component: ClassicComponent) => any); - } - - interface DOMElement

extends ClassicElement

{ - type: string; - ref: string | ((component: DOMComponent

) => any); - } - - type HTMLElement = DOMElement; - type SVGElement = DOMElement; + interface ReactHTMLElement extends ReactElement {} + interface ReactSVGElement extends ReactElement {} // - // Factories - // ---------------------------------------------------------------------- - - interface Factory

{ - (props?: P, ...children: ReactNode[]): ReactElement

; - } - - interface ClassicFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ClassicElement

; - } - - interface DOMFactory

extends ClassicFactory

{ - (props?: P, ...children: ReactNode[]): DOMElement

; - } - - type HTMLFactory = DOMFactory; - type SVGFactory = DOMFactory; - - // - // React Nodes + // React Nodes // http://facebook.github.io/react/docs/glossary.html // ---------------------------------------------------------------------- @@ -58,157 +29,106 @@ declare module "react" { type ReactChild = ReactElement | ReactText; // Should be Array but type aliases cannot be recursive - type ReactFragment = {} | Array; + type ReactFragment = Array; type ReactNode = ReactChild | ReactFragment | boolean; // - // Top Level API + // React Components // ---------------------------------------------------------------------- - function createClass

(spec: ComponentSpec): ClassicComponentClass

; + interface ComponentStatics

{ + displayName?: string; + getDefaultProps?(): P; + propTypes?: ValidationMap

; + } - function createFactory

(type: string): DOMFactory

; - function createFactory

(type: ClassicComponentClass

| string): ClassicFactory

; - function createFactory

(type: ComponentClass

): Factory

; + interface ComponentClass

extends ComponentStatics

{ + // Deprecated in 0.12. See http://fb.me/react-legacyfactory + // new(props: P): ReactElement

; + // (props: P): ReactElement

; + } - function createElement

( - type: string, - props?: P, - ...children: ReactNode[]): DOMElement

; - function createElement

( - type: ClassicComponentClass

| string, - props?: P, - ...children: ReactNode[]): ClassicElement

; - function createElement

( - type: ComponentClass

, - props?: P, - ...children: ReactNode[]): ReactElement

; + // + // ReactElement Factories + // ---------------------------------------------------------------------- - function cloneElement

( - element: DOMElement

, - props?: P, - ...children: ReactNode[]): DOMElement

; - function cloneElement

( - element: ClassicElement

, - props?: P, - ...children: ReactNode[]): ClassicElement

; - function cloneElement

( - element: ReactElement

, - props?: P, - ...children: ReactNode[]): ReactElement

; + interface ComponentFactory

{ + (props?: P, ...children: ReactNode[]): ReactElement

; + } + + interface HTMLFactory extends ComponentFactory {} + interface SVGFactory extends ComponentFactory {} - function render

( - element: DOMElement

, - container: Element, - callback?: () => any): DOMComponent

; - function render( - element: ClassicElement

, - container: Element, - callback?: () => any): ClassicComponent; - function render( - element: ReactElement

, - container: Element, - callback?: () => any): Component; + // + // Top-Level API + // ---------------------------------------------------------------------- - function unmountComponentAtNode(container: Element): boolean; - function renderToString(element: ReactElement): string; - function renderToStaticMarkup(element: ReactElement): string; - function isValidElement(object: {}): boolean; - function initializeTouchEvents(shouldUseTouch: boolean): void; - - function findDOMNode( - componentOrElement: Component | Element): TElement; - function findDOMNode( - componentOrElement: Component | Element): Element; - - var DOM: ReactDOM; - var PropTypes: ReactPropTypes; - var Children: ReactChildren; + interface TopLevelAPI { + createClass

(spec: ComponentSpec): ComponentClass

; + createElement

(type: ComponentClass

| string, props: P, ...children: ReactNode[]): ReactElement

; + createFactory

(componentClass: ComponentClass

): ComponentFactory

; + render

(element: ReactElement

, container: Element, callback?: () => any): Component

; + unmountComponentAtNode(container: Element): boolean; + renderToString(element: ReactElement): string; + renderToStaticMarkup(element: ReactElement): string; + isValidElement(object: {}): boolean; + initializeTouchEvents(shouldUseTouch: boolean): void; + } // // Component API // ---------------------------------------------------------------------- - // Base component for plain JS classes - class Component implements ComponentLifecycle { - constructor(props: P, context: any); - setState(f: (prevState: S, props: P) => S, callback?: () => any): void; - setState(state: S, callback?: () => any): void; - forceUpdate(): void; - props: P; - state: S; - context: any; - refs: { - [key: string]: Component - }; - } - - interface ClassicComponent extends Component { - replaceState(nextState: S, callback?: () => any): void; + interface Component

{ + // Use this overload to cast the returned element to a more specific type. + // Eg: var name = this.refs['name'].getDOMNode().value; getDOMNode(): TElement; getDOMNode(): Element; isMounted(): boolean; - getInitialState?(): S; + + props: P; setProps(nextProps: P, callback?: () => any): void; replaceProps(nextProps: P, callback?: () => any): void; } - interface DOMComponent

extends ClassicComponent { + interface DOMComponent

extends Component

{ tagName: string; } - type HTMLComponent = DOMComponent; - type SVGComponent = DOMComponent; - - interface ChildContextProvider { - getChildContext(): CC; - } - - // - // Class Interfaces - // ---------------------------------------------------------------------- - - interface ComponentClass

{ - new(props?: P, context?: any): Component; - propTypes?: ValidationMap

; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap; - defaultProps?: P; - } - - interface ClassicComponentClass

extends ComponentClass

{ - new(props?: P, context?: any): ClassicComponent; - getDefaultProps?(): P; - displayName?: string; + interface HTMLComponent extends DOMComponent {} + interface SVGComponent extends DOMComponent {} + + interface CompositeComponent extends Component

, ComponentSpec { + state: S; + setState(nextState: S, callback?: () => any): void; + replaceState(nextState: S, callback?: () => any): void; + forceUpdate(callback?: () => any): void; + refs: { + [key: string]: Component + }; } // // Component Specs and Lifecycle // ---------------------------------------------------------------------- - interface ComponentLifecycle { - componentWillMount?(): void; - componentDidMount?(): void; - componentWillReceiveProps?(nextProps: P, nextContext: any): void; - shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; - componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; - componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; - componentWillUnmount?(): void; - } - - interface Mixin extends ComponentLifecycle { + interface Mixin extends ComponentStatics

{ mixins?: Mixin; statics?: { [key: string]: any; }; - displayName?: string; - propTypes?: ValidationMap; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap - - getDefaultProps?(): P; + // Definition methods getInitialState?(): S; + + // Delegate methods + componentWillMount?(): void; + componentDidMount?(): void; + componentWillReceiveProps?(nextProps: P): void; + shouldComponentUpdate?(nextProps: P, nextState: S): boolean; + componentWillUpdate?(nextProps: P, nextState: S): void; + componentDidUpdate?(prevProps: P, prevState: S): void; + componentWillUnmount?(): void; } interface ComponentSpec extends Mixin { @@ -318,16 +238,15 @@ declare module "react" { interface WheelEventHandler extends EventHandler {} // - // Props / DOM Attributes + // Attributes // ---------------------------------------------------------------------- - interface Props { + export interface ReactAttributes { children?: ReactNode; - key?: string | number; - ref?: string | ((component: T) => any); - } + key?: number | string; + ref?: string; - interface DOMAttributes extends Props> { + // Event Attributes onCopy?: ClipboardEventHandler; onCut?: ClipboardEventHandler; onPaste?: ClipboardEventHandler; @@ -388,9 +307,7 @@ declare module "react" { strokeOpacity?: number; } - interface HTMLAttributes extends DOMAttributes { - ref?: string | ((component: HTMLComponent) => void); - + interface HTMLAttributes extends ReactAttributes { accept?: string; acceptCharset?: string; accessKey?: string; @@ -498,11 +415,9 @@ declare module "react" { itemType?: string; } - interface SVGAttributes extends DOMAttributes { - ref?: string | ((component: SVGComponent) => void); - + interface SVGAttributes extends ReactAttributes { cx?: SVGLength | SVGAnimatedLength; - cy?: any; + cy?: any; d?: string; dx?: SVGLength | SVGAnimatedLength; dy?: SVGLength | SVGAnimatedLength; @@ -547,7 +462,7 @@ declare module "react" { } // - // React.DOM + // React.DOM // ---------------------------------------------------------------------- interface ReactDOM { @@ -730,6 +645,254 @@ declare module "react" { only(children: ReactNode): ReactChild; } + // + // React.addons + // ---------------------------------------------------------------------- + + interface ClassSet { + [key: string]: boolean; + } + + // + // React.addons (Transitions) + // ---------------------------------------------------------------------- + + interface TransitionGroupProps { + component?: ReactType; + childFactory?: (child: ReactElement) => ReactElement; + } + + interface CSSTransitionGroupProps extends TransitionGroupProps { + transitionName: string; + transitionAppear?: boolean; + transitionEnter?: boolean; + transitionLeave?: boolean; + } + + interface CSSTransitionGroup extends ComponentClass {} + interface TransitionGroup extends ComponentClass {} + + // + // React.addons (Mixins) + // ---------------------------------------------------------------------- + + interface ReactLink { + value: T; + requestChange(newValue: T): void; + } + + interface LinkedStateMixin extends Mixin { + linkState(key: string): ReactLink; + } + + interface PureRenderMixin extends Mixin { + } + + // + // Reat.addons.update + // ---------------------------------------------------------------------- + + interface UpdateSpec { + $set: any; + $merge: {}; + $apply(value: any): any; + // [key: string]: UpdateSpec; + } + + interface UpdateArraySpec extends UpdateSpec { + $push?: any[]; + $unshift?: any[]; + $splice?: any[][]; + } + + // + // React.addons.Perf + // ---------------------------------------------------------------------- + + interface ComponentPerfContext { + current: string; + owner: string; + } + + interface NumericPerfContext { + [key: string]: number; + } + + interface Measurements { + exclusive: NumericPerfContext; + inclusive: NumericPerfContext; + render: NumericPerfContext; + counts: NumericPerfContext; + writes: NumericPerfContext; + displayNames: { + [key: string]: ComponentPerfContext; + }; + totalTime: number; + } + + interface ReactPerf { + start(): void; + stop(): void; + printInclusive(measurements: Measurements[]): void; + printExclusive(measurements: Measurements[]): void; + printWasted(measurements: Measurements[]): void; + printDOM(measurements: Measurements[]): void; + getLastMeasurements(): Measurements[]; + } + + // + // React.addons.TestUtils + // ---------------------------------------------------------------------- + + interface MockedComponentClass { + new(): any; + } + + interface ReactTestUtils { + Simulate: Simulate; + + renderIntoDocument

(element: ReactElement

): Component

; + renderIntoDocument>(element: ReactElement): C; + + mockComponent(mocked: MockedComponentClass, mockTagName?: string): ReactTestUtils; + + isElementOfType(element: ReactElement, type: ReactType): boolean; + isDOMComponent(instance: Component): boolean; + isCompositeComponent(instance: Component): boolean; + isCompositeComponentWithType(instance: Component, type: ComponentClass): boolean; + isTextComponent(instance: Component): boolean; + + findAllInRenderedTree(tree: Component, fn: (i: Component) => boolean): Component; + + scryRenderedDOMComponentsWithClass(tree: Component, className: string): DOMComponent[]; + findRenderedDOMComponentWithClass(tree: Component, className: string): DOMComponent; + + scryRenderedDOMComponentsWithTag(tree: Component, tagName: string): DOMComponent[]; + findRenderedDOMComponentWithTag(tree: Component, tagName: string): DOMComponent; + + scryRenderedComponentsWithType( + tree: Component, type: ComponentClass

): CompositeComponent[]; + scryRenderedComponentsWithType>( + tree: Component, type: ComponentClass): C[]; + + findRenderedComponentWithType( + tree: Component, type: ComponentClass

): CompositeComponent; + findRenderedComponentWithType>( + tree: Component, type: ComponentClass): C; + } + + interface SyntheticEventData { + altKey?: boolean; + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + changedTouches?: TouchList; + charCode?: boolean; + clipboardData?: DataTransfer; + ctrlKey?: boolean; + deltaMode?: number; + deltaX?: number; + deltaY?: number; + deltaZ?: number; + detail?: number; + getModifierState?(key: string): boolean; + key?: string; + keyCode?: number; + locale?: string; + location?: number; + metaKey?: boolean; + pageX?: number; + pageY?: number; + relatedTarget?: EventTarget; + repeat?: boolean; + screenX?: number; + screenY?: number; + shiftKey?: boolean; + targetTouches?: TouchList; + touches?: TouchList; + view?: AbstractView; + which?: number; + } + + interface EventSimulator { + (element: Element, eventData?: SyntheticEventData): void; + (descriptor: Component, eventData?: SyntheticEventData): void; + } + + interface Simulate { + blur: EventSimulator; + change: EventSimulator; + click: EventSimulator; + cut: EventSimulator; + doubleClick: EventSimulator; + drag: EventSimulator; + dragEnd: EventSimulator; + dragEnter: EventSimulator; + dragExit: EventSimulator; + dragLeave: EventSimulator; + dragOver: EventSimulator; + dragStart: EventSimulator; + drop: EventSimulator; + focus: EventSimulator; + input: EventSimulator; + keyDown: EventSimulator; + keyPress: EventSimulator; + keyUp: EventSimulator; + mouseDown: EventSimulator; + mouseEnter: EventSimulator; + mouseLeave: EventSimulator; + mouseMove: EventSimulator; + mouseOut: EventSimulator; + mouseOver: EventSimulator; + mouseUp: EventSimulator; + paste: EventSimulator; + scroll: EventSimulator; + submit: EventSimulator; + touchCancel: EventSimulator; + touchEnd: EventSimulator; + touchMove: EventSimulator; + touchStart: EventSimulator; + wheel: EventSimulator; + } + + // + // react Exports + // ---------------------------------------------------------------------- + + interface Exports extends TopLevelAPI { + DOM: ReactDOM; + PropTypes: ReactPropTypes; + Children: ReactChildren; + } + + // + // react/addons Exports + // ---------------------------------------------------------------------- + + interface AddonsExports extends Exports { + addons: { + CSSTransitionGroup: CSSTransitionGroup; + LinkedStateMixin: LinkedStateMixin; + PureRenderMixin: PureRenderMixin; + TransitionGroup: TransitionGroup; + + batchedUpdates(callback: (a: A, b: B) => any, a: A, b: B): void; + batchedUpdates(callback: (a: A) => any, a: A): void; + batchedUpdates(callback: () => any): void; + + classSet(cx: ClassSet): string; + cloneWithProps

(element: ReactElement

, props: P): ReactElement

; + + update(value: any[], spec: UpdateArraySpec): any[]; + update(value: {}, spec: UpdateSpec): any; + + // Development tools + Perf: ReactPerf; + TestUtils: ReactTestUtils; + }; + } + // // Browser Interfaces // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts @@ -759,3 +922,13 @@ declare module "react" { } } +declare module "react" { + var exports: React.Exports; + export = exports; +} + +declare module "react/addons" { + var exports: React.AddonsExports; + export = exports; +} + diff --git a/react/legacy/react-addons-0.12-tests.ts b/react/legacy/react-addons-0.12-tests.ts new file mode 100644 index 000000000..ca05c00ca --- /dev/null +++ b/react/legacy/react-addons-0.12-tests.ts @@ -0,0 +1,68 @@ +/// +import React = require("react/addons"); + +var isImportant: boolean; +var isRead: boolean; +var classSet: React.ClassSet = { + "message": true, + "message-important": isImportant, + "message-read": isRead +}; +var cx = React.addons.classSet; +var classes: string = cx(classSet); + +// +// React.addons (Transitions) +// -------------------------------------------------------------------------- + +React.createFactory(React.addons.TransitionGroup)({ component: "div" }); +React.createFactory(React.addons.CSSTransitionGroup)({ + component: React.createClass({ + render: (): React.ReactElement => null + }), + childFactory: (c) => c, + transitionName: "transition", + transitionAppear: false, + transitionEnter: true, + transitionLeave: true +}); + +// +// React.addons.TestUtils +// -------------------------------------------------------------------------- + +var that: React.CompositeComponent; +var node = that.refs["input"].getDOMNode(); +React.addons.TestUtils.Simulate.click(node); +React.addons.TestUtils.Simulate.change(node); +React.addons.TestUtils.Simulate.keyDown(node, {key: "Enter"}); + +interface GreetingProps { + name: string; +} +interface GreetingState { + morning: boolean; +} +interface Greeting extends React.CompositeComponent { +} +var Greeting = React.createClass({ + displayName: "Greeting", + getInitialState: function() { + return {morning: true}; + }, + render: function() { + var me = this; + return React.DOM.div( + null, + me.state.morning ? "Hello " : "Goodbye ", + me.props.name); + } +}); + +var root = React.addons.TestUtils.renderIntoDocument( + React.createElement(Greeting, {name: "John"})); +var greeting = React.addons.TestUtils + .findRenderedComponentWithType(root, Greeting); +greeting.setState({ + morning: false +}); diff --git a/react/future/react-addons-global-0.13.0.d.ts b/react/react-addons-global.d.ts similarity index 99% rename from react/future/react-addons-global-0.13.0.d.ts rename to react/react-addons-global.d.ts index 343590f98..c50ecdc21 100644 --- a/react/future/react-addons-global-0.13.0.d.ts +++ b/react/react-addons-global.d.ts @@ -2,7 +2,7 @@ // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// declare module React { // diff --git a/react/react-addons-tests.ts b/react/react-addons-tests.ts index 7ce0fa23f..9bd3d5505 100644 --- a/react/react-addons-tests.ts +++ b/react/react-addons-tests.ts @@ -1,15 +1,366 @@ -/// +/// import React = require("react/addons"); -var isImportant: boolean; -var isRead: boolean; -var classSet: React.ClassSet = { - "message": true, - "message-important": isImportant, - "message-read": isRead +interface Props extends React.Props { + hello: string; + world?: string; + foo: number; + bar: boolean; +} + +interface State { + inputValue?: string; + seconds?: number; +} + +interface Context { + someValue?: string; +} + +interface ChildContext { + someOtherValue: string; +} + +interface MyComponent extends React.Component { + reset(): void; +} + +var props: Props = { + key: 42, + ref: "myComponent42", + hello: "world", + foo: 42, + bar: true }; + +var container: Element; + +// +// Top-Level API +// -------------------------------------------------------------------------- + +var ClassicComponent: React.ClassicComponentClass = + React.createClass({ + getDefaultProps: () => { + return { + hello: undefined, + world: "peace", + foo: undefined, + bar: undefined + }; + }, + getInitialState: () => { + return { + inputValue: this.context.someValue, + seconds: this.props.foo + }; + }, + reset: () => { + this.replaceState(this.getInitialState()); + }, + render: () => { + return React.DOM.div(null, + React.DOM.input({ + ref: input => this._input = input, + value: this.state.inputValue + })); + } + }); + +class ModernComponent extends React.Component + implements React.ChildContextProvider { + + static propTypes: React.ValidationMap = { + foo: React.PropTypes.number + } + + static contextTypes: React.ValidationMap = { + someValue: React.PropTypes.string + } + + static childContextTypes: React.ValidationMap = { + someOtherValue: React.PropTypes.string + } + + getChildContext() { + return { + someOtherValue: 'foo' + } + } + + state = { + inputValue: this.context.someValue, + seconds: this.props.foo + } + + reset() { + this.setState({ + inputValue: this.context.someValue, + seconds: this.props.foo + }); + } + + private _input: React.HTMLComponent; + + render() { + return React.DOM.div(null, + React.DOM.input({ + ref: input => this._input = input, + value: this.state.inputValue + })); + } +} + +// React.createFactory +var factory: React.Factory = + React.createFactory(ModernComponent); +var factoryElement: React.ReactElement = + factory(props); + +var classicFactory: React.ClassicFactory = + React.createFactory(ClassicComponent); +var classicFactoryElement: React.ClassicElement = + classicFactory(props); + +var domFactory: React.DOMFactory = + React.createFactory("foo"); +var domFactoryElement: React.DOMElement = + domFactory(); + +// React.createElement +var element: React.ReactElement = + React.createElement(ModernComponent, props); +var classicElement: React.ClassicElement = + React.createElement(ClassicComponent, props); +var domElement: React.HTMLElement = + React.createElement("div"); + +// React.cloneElement +var clonedElement: React.ReactElement = + React.cloneElement(element, props); +var clonedClassicElement: React.ClassicElement = + React.cloneElement(classicElement, props); +var clonedDOMElement: React.HTMLElement = + React.cloneElement(domElement); + +// React.render +var component: React.Component = + React.render(element, container); +var classicComponent: React.ClassicComponent = + React.render(classicElement, container); +var domComponent: React.DOMComponent = + React.render(domElement, container); + +// Other Top-Level API +var unmounted: boolean = React.unmountComponentAtNode(container); +var str: string = React.renderToString(element); +var markup: string = React.renderToStaticMarkup(element); +var notValid: boolean = React.isValidElement(props); // false +var isValid = React.isValidElement(element); // true +React.initializeTouchEvents(true); +var domNode: Element = React.findDOMNode(component); +domNode = React.findDOMNode(domNode); + +// +// React Elements +// -------------------------------------------------------------------------- + +var type = element.type; +var elementProps: Props = element.props; +var key = element.key; + +// +// React Components +// -------------------------------------------------------------------------- + +var displayName: string = ClassicComponent.displayName; +var defaultProps: Props = ClassicComponent.getDefaultProps(); +var propTypes: React.ValidationMap = ClassicComponent.propTypes; + +// +// Component API +// -------------------------------------------------------------------------- + +// modern +var componentState: State = component.state; +component.setState({ inputValue: "!!!" }); +component.forceUpdate(); + +// classic +var htmlElement: Element = classicComponent.getDOMNode(); +var divElement: HTMLDivElement = classicComponent.getDOMNode(); +var isMounted: boolean = classicComponent.isMounted(); +classicComponent.setProps(elementProps); +classicComponent.replaceProps(props); +classicComponent.replaceState({ inputValue: "???", seconds: 60 }); + +var myComponent = component; +myComponent.reset(); + +// +// Attributes +// -------------------------------------------------------------------------- + +var children = ["Hello world", [null], React.DOM.span(null)]; +var divStyle = { // CSSProperties + flex: "1 1 main-size", + backgroundImage: "url('hello.png')" +}; +var htmlAttr: React.HTMLAttributes = { + key: 36, + ref: "htmlComponent", + children: children, + className: "test-attr", + style: divStyle, + onClick: (event: React.MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); + }, + dangerouslySetInnerHTML: { + __html: "STRONG" + } +}; +React.DOM.div(htmlAttr); +React.DOM.span(htmlAttr); +React.DOM.input(htmlAttr); + +// +// React.PropTypes +// -------------------------------------------------------------------------- + +var PropTypesSpecification: React.ComponentSpec = { + propTypes: { + optionalArray: React.PropTypes.array, + optionalBool: React.PropTypes.bool, + optionalFunc: React.PropTypes.func, + optionalNumber: React.PropTypes.number, + optionalObject: React.PropTypes.object, + optionalString: React.PropTypes.string, + optionalNode: React.PropTypes.node, + optionalElement: React.PropTypes.element, + optionalMessage: React.PropTypes.instanceOf(Date), + optionalEnum: React.PropTypes.oneOf(["News", "Photos"]), + optionalUnion: React.PropTypes.oneOfType([ + React.PropTypes.string, + React.PropTypes.number, + React.PropTypes.instanceOf(Date) + ]), + optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number), + optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number), + optionalObjectWithShape: React.PropTypes.shape({ + color: React.PropTypes.string, + fontSize: React.PropTypes.number + }), + requiredFunc: React.PropTypes.func.isRequired, + requiredAny: React.PropTypes.any.isRequired, + customProp: function(props: any, propName: string, componentName: string) { + if (!/matchme/.test(props[propName])) { + return new Error("Validation failed!"); + } + return null; + } + }, + render: (): React.ReactElement => { + return null; + } +}; + +// +// ContextTypes +// -------------------------------------------------------------------------- + +var ContextTypesSpecification: React.ComponentSpec = { + contextTypes: { + optionalArray: React.PropTypes.array, + optionalBool: React.PropTypes.bool, + optionalFunc: React.PropTypes.func, + optionalNumber: React.PropTypes.number, + optionalObject: React.PropTypes.object, + optionalString: React.PropTypes.string, + optionalNode: React.PropTypes.node, + optionalElement: React.PropTypes.element, + optionalMessage: React.PropTypes.instanceOf(Date), + optionalEnum: React.PropTypes.oneOf(["News", "Photos"]), + optionalUnion: React.PropTypes.oneOfType([ + React.PropTypes.string, + React.PropTypes.number, + React.PropTypes.instanceOf(Date) + ]), + optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number), + optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number), + optionalObjectWithShape: React.PropTypes.shape({ + color: React.PropTypes.string, + fontSize: React.PropTypes.number + }), + requiredFunc: React.PropTypes.func.isRequired, + requiredAny: React.PropTypes.any.isRequired, + customProp: function(props: any, propName: string, componentName: string) { + if (!/matchme/.test(props[propName])) { + return new Error("Validation failed!"); + } + return null; + } + }, + render: (): React.ReactElement => { + return null; + } +}; + +// +// React.Children +// -------------------------------------------------------------------------- + +var childMap: { [key: string]: number } = + React.Children.map(children, (child) => { return 42; }); +React.Children.forEach(children, (child) => {}); +var nChildren: number = React.Children.count(children); +var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); + +// +// Example from http://facebook.github.io/react/ +// -------------------------------------------------------------------------- + +interface TimerState { + secondsElapsed: number; +} +class Timer extends React.Component, TimerState> { + static state = { + secondsElapsed: 0 + } + private _interval: number; + tick() { + this.setState((prevState, props) => ({ + secondsElapsed: prevState.secondsElapsed + 1 + })); + } + componentDidMount() { + this._interval = setInterval(() => this.tick(), 1000); + } + componentWillUnmount() { + clearInterval(this._interval); + } + render() { + return React.DOM.div( + null, + "Seconds Elapsed: ", + this.state.secondsElapsed + ); + } +} +React.render(React.createElement(Timer), container); + +// +// React.addons +// -------------------------------------------------------------------------- + var cx = React.addons.classSet; -var classes: string = cx(classSet); +var className: string = cx({ a: true, b: false, c: true }); +className = cx("a", null, "b"); + +React.addons.createFragment({ + a: React.DOM.div(), + b: ["a", false, React.createElement("span")] +}); // // React.addons (Transitions) @@ -31,38 +382,8 @@ React.createFactory(React.addons.CSSTransitionGroup)({ // React.addons.TestUtils // -------------------------------------------------------------------------- -var that: React.CompositeComponent; -var node = that.refs["input"].getDOMNode(); +var node: Element; React.addons.TestUtils.Simulate.click(node); React.addons.TestUtils.Simulate.change(node); -React.addons.TestUtils.Simulate.keyDown(node, {key: "Enter"}); +React.addons.TestUtils.Simulate.keyDown(node, { key: "Enter" }); -interface GreetingProps { - name: string; -} -interface GreetingState { - morning: boolean; -} -interface Greeting extends React.CompositeComponent { -} -var Greeting = React.createClass({ - displayName: "Greeting", - getInitialState: function() { - return {morning: true}; - }, - render: function() { - var me = this; - return React.DOM.div( - null, - me.state.morning ? "Hello " : "Goodbye ", - me.props.name); - } -}); - -var root = React.addons.TestUtils.renderIntoDocument( - React.createElement(Greeting, {name: "John"})); -var greeting = React.addons.TestUtils - .findRenderedComponentWithType(root, Greeting); -greeting.setState({ - morning: false -}); diff --git a/react/future/react-addons-0.13.0.d.ts b/react/react-addons.d.ts similarity index 100% rename from react/future/react-addons-0.13.0.d.ts rename to react/react-addons.d.ts diff --git a/react/future/react-global-0.13.0.d.ts b/react/react-global.d.ts similarity index 100% rename from react/future/react-global-0.13.0.d.ts rename to react/react-global.d.ts diff --git a/react/react-tests.ts b/react/react-tests.ts index 07c8a89d4..a9b693cab 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -1,7 +1,7 @@ /// import React = require("react"); -interface Props { +interface Props extends React.Props { hello: string; world?: string; foo: number; @@ -13,7 +13,15 @@ interface State { seconds?: number; } -interface MyComponent extends React.CompositeComponent { +interface Context { + someValue?: string; +} + +interface ChildContext { + someOtherValue: string; +} + +interface MyComponent extends React.Component { reset(): void; } @@ -26,95 +34,167 @@ var props: Props = { }; var container: Element; -var INPUT_REF: string = "input"; // // Top-Level API // -------------------------------------------------------------------------- -var reactClass: React.ComponentClass = React.createClass({ - getDefaultProps: () => { - return { - hello: undefined, - world: "peace", - foo: undefined, - bar: undefined - }; - }, - getInitialState: () => { +var ClassicComponent: React.ClassicComponentClass = + React.createClass({ + getDefaultProps: () => { + return { + hello: undefined, + world: "peace", + foo: undefined, + bar: undefined + }; + }, + getInitialState: () => { + return { + inputValue: this.context.someValue, + seconds: this.props.foo + }; + }, + reset: () => { + this.replaceState(this.getInitialState()); + }, + render: () => { + return React.DOM.div(null, + React.DOM.input({ + ref: input => this._input = input, + value: this.state.inputValue + })); + } + }); + +class ModernComponent extends React.Component + implements React.ChildContextProvider { + + static propTypes: React.ValidationMap = { + foo: React.PropTypes.number + } + + static contextTypes: React.ValidationMap = { + someValue: React.PropTypes.string + } + + static childContextTypes: React.ValidationMap = { + someOtherValue: React.PropTypes.string + } + + getChildContext() { return { - inputValue: "React.js", - seconds: 0 - }; - }, - reset: () => { - this.replaceState(this.getInitialState()); - }, - render: () => { + someOtherValue: 'foo' + } + } + + state = { + inputValue: this.context.someValue, + seconds: this.props.foo + } + + reset() { + this.setState({ + inputValue: this.context.someValue, + seconds: this.props.foo + }); + } + + private _input: React.HTMLComponent; + + render() { return React.DOM.div(null, React.DOM.input({ - ref: INPUT_REF, + ref: input => this._input = input, value: this.state.inputValue })); } -}); +} -var reactElement: React.ReactElement = - React.createElement(reactClass, props); +// React.createFactory +var factory: React.Factory = + React.createFactory(ModernComponent); +var factoryElement: React.ReactElement = + factory(props); -var reactFactory: React.ComponentFactory = - React.createFactory(reactClass); +var classicFactory: React.ClassicFactory = + React.createFactory(ClassicComponent); +var classicFactoryElement: React.ClassicElement = + classicFactory(props); -var component: React.Component = - React.render(reactElement, container); +var domFactory: React.DOMFactory = + React.createFactory("foo"); +var domFactoryElement: React.DOMElement = + domFactory(); +// React.createElement +var element: React.ReactElement = + React.createElement(ModernComponent, props); +var classicElement: React.ClassicElement = + React.createElement(ClassicComponent, props); +var domElement: React.HTMLElement = + React.createElement("div"); + +// React.cloneElement +var clonedElement: React.ReactElement = + React.cloneElement(element, props); +var clonedClassicElement: React.ClassicElement = + React.cloneElement(classicElement, props); +var clonedDOMElement: React.HTMLElement = + React.cloneElement(domElement); + +// React.render +var component: React.Component = + React.render(element, container); +var classicComponent: React.ClassicComponent = + React.render(classicElement, container); +var domComponent: React.DOMComponent = + React.render(domElement, container); + +// Other Top-Level API var unmounted: boolean = React.unmountComponentAtNode(container); -var str: string = React.renderToString(reactElement); -var markup: string = React.renderToStaticMarkup(reactElement); +var str: string = React.renderToString(element); +var markup: string = React.renderToStaticMarkup(element); var notValid: boolean = React.isValidElement(props); // false -var isValid = React.isValidElement(reactElement); // true +var isValid = React.isValidElement(element); // true React.initializeTouchEvents(true); +var domNode: Element = React.findDOMNode(component); +domNode = React.findDOMNode(domNode); // // React Elements // -------------------------------------------------------------------------- -var type = reactElement.type; -var elementProps: Props = reactElement.props; -var key = reactElement.key; -var ref: string = reactElement.ref; -var factoryElement: React.ReactElement = reactFactory(elementProps); +var type = element.type; +var elementProps: Props = element.props; +var key = element.key; // // React Components // -------------------------------------------------------------------------- -var displayName: string = reactClass.displayName; -var defaultProps: Props = reactClass.getDefaultProps(); -var propTypes: React.ValidationMap = reactClass.propTypes; +var displayName: string = ClassicComponent.displayName; +var defaultProps: Props = ClassicComponent.getDefaultProps(); +var propTypes: React.ValidationMap = ClassicComponent.propTypes; // // Component API // -------------------------------------------------------------------------- -var htmlElement: Element = component.getDOMNode(); -var divElement: HTMLDivElement = component.getDOMNode(); -var isMounted: boolean = component.isMounted(); -component.setProps(elementProps); -component.replaceProps(props); +// modern +var componentState: State = component.state; +component.setState({ inputValue: "!!!" }); +component.forceUpdate(); -var compComponent: React.CompositeComponent = - >component; -var initialState: State = compComponent.state; -compComponent.setState({ inputValue: "!!!" }); -compComponent.replaceState({ inputValue: "???", seconds: 60 }); -compComponent.forceUpdate(); +// classic +var htmlElement: Element = classicComponent.getDOMNode(); +var divElement: HTMLDivElement = classicComponent.getDOMNode(); +var isMounted: boolean = classicComponent.isMounted(); +classicComponent.setProps(elementProps); +classicComponent.replaceProps(props); +classicComponent.replaceState({ inputValue: "???", seconds: 60 }); -var inputRef: React.HTMLComponent = - compComponent.refs[INPUT_REF]; -var value: string = inputRef.getDOMNode().value; - -var myComponent = compComponent; +var myComponent = component; myComponent.reset(); // @@ -180,7 +260,48 @@ var PropTypesSpecification: React.ComponentSpec = { return null; } }, - render: (): React.ReactHTMLElement => { + render: (): React.ReactElement => { + return null; + } +}; + +// +// ContextTypes +// -------------------------------------------------------------------------- + +var ContextTypesSpecification: React.ComponentSpec = { + contextTypes: { + optionalArray: React.PropTypes.array, + optionalBool: React.PropTypes.bool, + optionalFunc: React.PropTypes.func, + optionalNumber: React.PropTypes.number, + optionalObject: React.PropTypes.object, + optionalString: React.PropTypes.string, + optionalNode: React.PropTypes.node, + optionalElement: React.PropTypes.element, + optionalMessage: React.PropTypes.instanceOf(Date), + optionalEnum: React.PropTypes.oneOf(["News", "Photos"]), + optionalUnion: React.PropTypes.oneOfType([ + React.PropTypes.string, + React.PropTypes.number, + React.PropTypes.instanceOf(Date) + ]), + optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number), + optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number), + optionalObjectWithShape: React.PropTypes.shape({ + color: React.PropTypes.string, + fontSize: React.PropTypes.number + }), + requiredFunc: React.PropTypes.func.isRequired, + requiredAny: React.PropTypes.any.isRequired, + customProp: function(props: any, propName: string, componentName: string) { + if (!/matchme/.test(props[propName])) { + return new Error("Validation failed!"); + } + return null; + } + }, + render: (): React.ReactElement => { return null; } }; @@ -202,34 +323,30 @@ var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); interface TimerState { secondsElapsed: number; } -interface Timer extends React.CompositeComponent<{}, TimerState> { -} -var Timer = React.createClass({ - displayName: "Timer", - getInitialState: () => { - return { secondsElapsed: 0 }; - }, - tick: () => { - var me = this; - me.setState({ - secondsElapsed: me.state.secondsElapsed + 1 - }); - }, - componentDidMount: () => { - this.interval = setInterval(this.tick, 1000); - }, - componentWillUnmount: () => { - clearInterval(this.interval); - }, - render: () => { - var me = this; +class Timer extends React.Component<{}, TimerState> { + static state = { + secondsElapsed: 0 + } + private _interval: number; + tick() { + this.setState((prevState, props) => ({ + secondsElapsed: prevState.secondsElapsed + 1 + })); + } + componentDidMount() { + var me = this; + this._interval = setInterval(() => me.tick(), 1000); + } + componentWillUnmount() { + clearInterval(this._interval); + } + render() { return React.DOM.div( null, "Seconds Elapsed: ", - me.state.secondsElapsed + this.state.secondsElapsed ); } -}); -var mountNode: Element; -React.render(React.createElement(Timer, null), mountNode); +} +React.render(React.createElement(Timer), container); diff --git a/react/react.d.ts b/react/react.d.ts index f2786cbc8..114938808 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -1,27 +1,56 @@ -// Type definitions for React 0.12.1 +// Type definitions for React v0.13.0 RC2 (external module) // Project: http://facebook.github.io/react/ -// Definitions by: Asana +// Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module React { +declare module "react" { // - // React Elements + // React Elements // ---------------------------------------------------------------------- type ReactType = ComponentClass | string; interface ReactElement

{ - type: ComponentClass

| string; + type: string | ComponentClass

; props: P; - key: number | string; - ref: string; + key: string | number; + ref: string | ((component: Component) => any); } - interface ReactHTMLElement extends ReactElement {} - interface ReactSVGElement extends ReactElement {} + interface ClassicElement

extends ReactElement

{ + type: string | ClassicComponentClass

; + ref: string | ((component: ClassicComponent) => any); + } + + interface DOMElement

extends ClassicElement

{ + type: string; + ref: string | ((component: DOMComponent

) => any); + } + + type HTMLElement = DOMElement; + type SVGElement = DOMElement; // - // React Nodes + // Factories + // ---------------------------------------------------------------------- + + interface Factory

{ + (props?: P, ...children: ReactNode[]): ReactElement

; + } + + interface ClassicFactory

extends Factory

{ + (props?: P, ...children: ReactNode[]): ClassicElement

; + } + + interface DOMFactory

extends ClassicFactory

{ + (props?: P, ...children: ReactNode[]): DOMElement

; + } + + type HTMLFactory = DOMFactory; + type SVGFactory = DOMFactory; + + // + // React Nodes // http://facebook.github.io/react/docs/glossary.html // ---------------------------------------------------------------------- @@ -29,106 +58,157 @@ declare module React { type ReactChild = ReactElement | ReactText; // Should be Array but type aliases cannot be recursive - type ReactFragment = Array; + type ReactFragment = {} | Array; type ReactNode = ReactChild | ReactFragment | boolean; // - // React Components + // Top Level API // ---------------------------------------------------------------------- - interface ComponentStatics

{ - displayName?: string; - getDefaultProps?(): P; - propTypes?: ValidationMap

; - } + function createClass(spec: ComponentSpec): ClassicComponentClass

; - interface ComponentClass

extends ComponentStatics

{ - // Deprecated in 0.12. See http://fb.me/react-legacyfactory - // new(props: P): ReactElement

; - // (props: P): ReactElement

; - } + function createFactory

(type: string): DOMFactory

; + function createFactory

(type: ClassicComponentClass

| string): ClassicFactory

; + function createFactory

(type: ComponentClass

): Factory

; - // - // ReactElement Factories - // ---------------------------------------------------------------------- + function createElement

( + type: string, + props?: P, + ...children: ReactNode[]): DOMElement

; + function createElement

( + type: ClassicComponentClass

| string, + props?: P, + ...children: ReactNode[]): ClassicElement

; + function createElement

( + type: ComponentClass

, + props?: P, + ...children: ReactNode[]): ReactElement

; - interface ComponentFactory

{ - (props?: P, ...children: ReactNode[]): ReactElement

; - } - - interface HTMLFactory extends ComponentFactory {} - interface SVGFactory extends ComponentFactory {} + function cloneElement

( + element: DOMElement

, + props?: P, + ...children: ReactNode[]): DOMElement

; + function cloneElement

( + element: ClassicElement

, + props?: P, + ...children: ReactNode[]): ClassicElement

; + function cloneElement

( + element: ReactElement

, + props?: P, + ...children: ReactNode[]): ReactElement

; - // - // Top-Level API - // ---------------------------------------------------------------------- + function render

( + element: DOMElement

, + container: Element, + callback?: () => any): DOMComponent

; + function render( + element: ClassicElement

, + container: Element, + callback?: () => any): ClassicComponent; + function render( + element: ReactElement

, + container: Element, + callback?: () => any): Component; - interface TopLevelAPI { - createClass

(spec: ComponentSpec): ComponentClass

; - createElement

(type: ComponentClass

| string, props: P, ...children: ReactNode[]): ReactElement

; - createFactory

(componentClass: ComponentClass

): ComponentFactory

; - render

(element: ReactElement

, container: Element, callback?: () => any): Component

; - unmountComponentAtNode(container: Element): boolean; - renderToString(element: ReactElement): string; - renderToStaticMarkup(element: ReactElement): string; - isValidElement(object: {}): boolean; - initializeTouchEvents(shouldUseTouch: boolean): void; - } + function unmountComponentAtNode(container: Element): boolean; + function renderToString(element: ReactElement): string; + function renderToStaticMarkup(element: ReactElement): string; + function isValidElement(object: {}): boolean; + function initializeTouchEvents(shouldUseTouch: boolean): void; + + function findDOMNode( + componentOrElement: Component | Element): TElement; + function findDOMNode( + componentOrElement: Component | Element): Element; + + var DOM: ReactDOM; + var PropTypes: ReactPropTypes; + var Children: ReactChildren; // // Component API // ---------------------------------------------------------------------- - interface Component

{ - // Use this overload to cast the returned element to a more specific type. - // Eg: var name = this.refs['name'].getDOMNode().value; + // Base component for plain JS classes + class Component implements ComponentLifecycle { + constructor(props: P, context: any); + setState(f: (prevState: S, props: P) => S, callback?: () => any): void; + setState(state: S, callback?: () => any): void; + forceUpdate(): void; + props: P; + state: S; + context: any; + refs: { + [key: string]: Component + }; + } + + interface ClassicComponent extends Component { + replaceState(nextState: S, callback?: () => any): void; getDOMNode(): TElement; getDOMNode(): Element; isMounted(): boolean; - - props: P; + getInitialState?(): S; setProps(nextProps: P, callback?: () => any): void; replaceProps(nextProps: P, callback?: () => any): void; } - interface DOMComponent

extends Component

{ + interface DOMComponent

extends ClassicComponent { tagName: string; } - interface HTMLComponent extends DOMComponent {} - interface SVGComponent extends DOMComponent {} - - interface CompositeComponent extends Component

, ComponentSpec { - state: S; - setState(nextState: S, callback?: () => any): void; - replaceState(nextState: S, callback?: () => any): void; - forceUpdate(callback?: () => any): void; - refs: { - [key: string]: Component - }; + type HTMLComponent = DOMComponent; + type SVGComponent = DOMComponent; + + interface ChildContextProvider { + getChildContext(): CC; + } + + // + // Class Interfaces + // ---------------------------------------------------------------------- + + interface ComponentClass

{ + new(props?: P, context?: any): Component; + propTypes?: ValidationMap

; + contextTypes?: ValidationMap; + childContextTypes?: ValidationMap; + defaultProps?: P; + } + + interface ClassicComponentClass

extends ComponentClass

{ + new(props?: P, context?: any): ClassicComponent; + getDefaultProps?(): P; + displayName?: string; } // // Component Specs and Lifecycle // ---------------------------------------------------------------------- - interface Mixin extends ComponentStatics

{ + interface ComponentLifecycle { + componentWillMount?(): void; + componentDidMount?(): void; + componentWillReceiveProps?(nextProps: P, nextContext: any): void; + shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; + componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; + componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; + componentWillUnmount?(): void; + } + + interface Mixin extends ComponentLifecycle { mixins?: Mixin; statics?: { [key: string]: any; }; - // Definition methods - getInitialState?(): S; + displayName?: string; + propTypes?: ValidationMap; + contextTypes?: ValidationMap; + childContextTypes?: ValidationMap - // Delegate methods - componentWillMount?(): void; - componentDidMount?(): void; - componentWillReceiveProps?(nextProps: P): void; - shouldComponentUpdate?(nextProps: P, nextState: S): boolean; - componentWillUpdate?(nextProps: P, nextState: S): void; - componentDidUpdate?(prevProps: P, prevState: S): void; - componentWillUnmount?(): void; + getDefaultProps?(): P; + getInitialState?(): S; } interface ComponentSpec extends Mixin { @@ -238,15 +318,16 @@ declare module React { interface WheelEventHandler extends EventHandler {} // - // Attributes + // Props / DOM Attributes // ---------------------------------------------------------------------- - export interface ReactAttributes { + interface Props { children?: ReactNode; - key?: number | string; - ref?: string; + key?: string | number; + ref?: string | ((component: T) => any); + } - // Event Attributes + interface DOMAttributes extends Props> { onCopy?: ClipboardEventHandler; onCut?: ClipboardEventHandler; onPaste?: ClipboardEventHandler; @@ -307,7 +388,9 @@ declare module React { strokeOpacity?: number; } - interface HTMLAttributes extends ReactAttributes { + interface HTMLAttributes extends DOMAttributes { + ref?: string | ((component: HTMLComponent) => void); + accept?: string; acceptCharset?: string; accessKey?: string; @@ -415,9 +498,11 @@ declare module React { itemType?: string; } - interface SVGAttributes extends ReactAttributes { + interface SVGAttributes extends DOMAttributes { + ref?: string | ((component: SVGComponent) => void); + cx?: SVGLength | SVGAnimatedLength; - cy?: any; + cy?: any; d?: string; dx?: SVGLength | SVGAnimatedLength; dy?: SVGLength | SVGAnimatedLength; @@ -462,7 +547,7 @@ declare module React { } // - // React.DOM + // React.DOM // ---------------------------------------------------------------------- interface ReactDOM { @@ -645,254 +730,6 @@ declare module React { only(children: ReactNode): ReactChild; } - // - // React.addons - // ---------------------------------------------------------------------- - - interface ClassSet { - [key: string]: boolean; - } - - // - // React.addons (Transitions) - // ---------------------------------------------------------------------- - - interface TransitionGroupProps { - component?: ReactType; - childFactory?: (child: ReactElement) => ReactElement; - } - - interface CSSTransitionGroupProps extends TransitionGroupProps { - transitionName: string; - transitionAppear?: boolean; - transitionEnter?: boolean; - transitionLeave?: boolean; - } - - interface CSSTransitionGroup extends ComponentClass {} - interface TransitionGroup extends ComponentClass {} - - // - // React.addons (Mixins) - // ---------------------------------------------------------------------- - - interface ReactLink { - value: T; - requestChange(newValue: T): void; - } - - interface LinkedStateMixin extends Mixin { - linkState(key: string): ReactLink; - } - - interface PureRenderMixin extends Mixin { - } - - // - // Reat.addons.update - // ---------------------------------------------------------------------- - - interface UpdateSpec { - $set: any; - $merge: {}; - $apply(value: any): any; - // [key: string]: UpdateSpec; - } - - interface UpdateArraySpec extends UpdateSpec { - $push?: any[]; - $unshift?: any[]; - $splice?: any[][]; - } - - // - // React.addons.Perf - // ---------------------------------------------------------------------- - - interface ComponentPerfContext { - current: string; - owner: string; - } - - interface NumericPerfContext { - [key: string]: number; - } - - interface Measurements { - exclusive: NumericPerfContext; - inclusive: NumericPerfContext; - render: NumericPerfContext; - counts: NumericPerfContext; - writes: NumericPerfContext; - displayNames: { - [key: string]: ComponentPerfContext; - }; - totalTime: number; - } - - interface ReactPerf { - start(): void; - stop(): void; - printInclusive(measurements: Measurements[]): void; - printExclusive(measurements: Measurements[]): void; - printWasted(measurements: Measurements[]): void; - printDOM(measurements: Measurements[]): void; - getLastMeasurements(): Measurements[]; - } - - // - // React.addons.TestUtils - // ---------------------------------------------------------------------- - - interface MockedComponentClass { - new(): any; - } - - interface ReactTestUtils { - Simulate: Simulate; - - renderIntoDocument

(element: ReactElement

): Component

; - renderIntoDocument>(element: ReactElement): C; - - mockComponent(mocked: MockedComponentClass, mockTagName?: string): ReactTestUtils; - - isElementOfType(element: ReactElement, type: ReactType): boolean; - isDOMComponent(instance: Component): boolean; - isCompositeComponent(instance: Component): boolean; - isCompositeComponentWithType(instance: Component, type: ComponentClass): boolean; - isTextComponent(instance: Component): boolean; - - findAllInRenderedTree(tree: Component, fn: (i: Component) => boolean): Component; - - scryRenderedDOMComponentsWithClass(tree: Component, className: string): DOMComponent[]; - findRenderedDOMComponentWithClass(tree: Component, className: string): DOMComponent; - - scryRenderedDOMComponentsWithTag(tree: Component, tagName: string): DOMComponent[]; - findRenderedDOMComponentWithTag(tree: Component, tagName: string): DOMComponent; - - scryRenderedComponentsWithType( - tree: Component, type: ComponentClass

): CompositeComponent[]; - scryRenderedComponentsWithType>( - tree: Component, type: ComponentClass): C[]; - - findRenderedComponentWithType( - tree: Component, type: ComponentClass

): CompositeComponent; - findRenderedComponentWithType>( - tree: Component, type: ComponentClass): C; - } - - interface SyntheticEventData { - altKey?: boolean; - button?: number; - buttons?: number; - clientX?: number; - clientY?: number; - changedTouches?: TouchList; - charCode?: boolean; - clipboardData?: DataTransfer; - ctrlKey?: boolean; - deltaMode?: number; - deltaX?: number; - deltaY?: number; - deltaZ?: number; - detail?: number; - getModifierState?(key: string): boolean; - key?: string; - keyCode?: number; - locale?: string; - location?: number; - metaKey?: boolean; - pageX?: number; - pageY?: number; - relatedTarget?: EventTarget; - repeat?: boolean; - screenX?: number; - screenY?: number; - shiftKey?: boolean; - targetTouches?: TouchList; - touches?: TouchList; - view?: AbstractView; - which?: number; - } - - interface EventSimulator { - (element: Element, eventData?: SyntheticEventData): void; - (descriptor: Component, eventData?: SyntheticEventData): void; - } - - interface Simulate { - blur: EventSimulator; - change: EventSimulator; - click: EventSimulator; - cut: EventSimulator; - doubleClick: EventSimulator; - drag: EventSimulator; - dragEnd: EventSimulator; - dragEnter: EventSimulator; - dragExit: EventSimulator; - dragLeave: EventSimulator; - dragOver: EventSimulator; - dragStart: EventSimulator; - drop: EventSimulator; - focus: EventSimulator; - input: EventSimulator; - keyDown: EventSimulator; - keyPress: EventSimulator; - keyUp: EventSimulator; - mouseDown: EventSimulator; - mouseEnter: EventSimulator; - mouseLeave: EventSimulator; - mouseMove: EventSimulator; - mouseOut: EventSimulator; - mouseOver: EventSimulator; - mouseUp: EventSimulator; - paste: EventSimulator; - scroll: EventSimulator; - submit: EventSimulator; - touchCancel: EventSimulator; - touchEnd: EventSimulator; - touchMove: EventSimulator; - touchStart: EventSimulator; - wheel: EventSimulator; - } - - // - // react Exports - // ---------------------------------------------------------------------- - - interface Exports extends TopLevelAPI { - DOM: ReactDOM; - PropTypes: ReactPropTypes; - Children: ReactChildren; - } - - // - // react/addons Exports - // ---------------------------------------------------------------------- - - interface AddonsExports extends Exports { - addons: { - CSSTransitionGroup: CSSTransitionGroup; - LinkedStateMixin: LinkedStateMixin; - PureRenderMixin: PureRenderMixin; - TransitionGroup: TransitionGroup; - - batchedUpdates(callback: (a: A, b: B) => any, a: A, b: B): void; - batchedUpdates(callback: (a: A) => any, a: A): void; - batchedUpdates(callback: () => any): void; - - classSet(cx: ClassSet): string; - cloneWithProps

(element: ReactElement

, props: P): ReactElement

; - - update(value: any[], spec: UpdateArraySpec): any[]; - update(value: {}, spec: UpdateSpec): any; - - // Development tools - Perf: ReactPerf; - TestUtils: ReactTestUtils; - }; - } - // // Browser Interfaces // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts @@ -922,13 +759,3 @@ declare module React { } } -declare module "react" { - var exports: React.Exports; - export = exports; -} - -declare module "react/addons" { - var exports: React.AddonsExports; - export = exports; -} - From 045dfbdfd924dc914032183e4508cd00a1ed3915 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Feb 2015 10:57:41 +0100 Subject: [PATCH 018/243] [xml2js] missing the Parser constructor on module --- xml2js/xml2js-tests.ts | 2 ++ xml2js/xml2js.d.ts | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/xml2js/xml2js-tests.ts b/xml2js/xml2js-tests.ts index f2d9dc41e..45472c0aa 100644 --- a/xml2js/xml2js-tests.ts +++ b/xml2js/xml2js-tests.ts @@ -15,3 +15,5 @@ var builder = new xml2js.Builder({ var outString = builder.buildObject({ 'hello': 'xml2js!' }); + +var parser = new xml2js.Parser(); diff --git a/xml2js/xml2js.d.ts b/xml2js/xml2js.d.ts index f734e4ba0..33ad64978 100644 --- a/xml2js/xml2js.d.ts +++ b/xml2js/xml2js.d.ts @@ -16,6 +16,14 @@ declare module 'xml2js' { buildObject(rootObj: any): string; } + class Parser { + constructor(options?: Options); + processAsync(): any; + assignOrPush(obj: any, key: string, newValue: any): any; + reset(): any; + parseString(str: string , cb?: Function): void; + } + interface RenderOptions { indent?: string; newline?: string; From 83ad8f1d9af12f7af13c6b0f6cba15a1aca7ddd1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Mar 2015 10:22:53 +0100 Subject: [PATCH 019/243] addded polymer definition files --- polymer/polymer-tests.ts | 79 ++++++++++++++++++++++++++ polymer/polymer.app-router.d.ts | 8 +++ polymer/polymer.core-drawer-panel.d.ts | 70 +++++++++++++++++++++++ polymer/polymer.d.ts | 42 ++++++++++++++ polymer/polymer.paper-toast.d.ts | 61 ++++++++++++++++++++ 5 files changed, 260 insertions(+) create mode 100644 polymer/polymer-tests.ts create mode 100644 polymer/polymer.app-router.d.ts create mode 100644 polymer/polymer.core-drawer-panel.d.ts create mode 100644 polymer/polymer.d.ts create mode 100644 polymer/polymer.paper-toast.d.ts diff --git a/polymer/polymer-tests.ts b/polymer/polymer-tests.ts new file mode 100644 index 000000000..e24445aca --- /dev/null +++ b/polymer/polymer-tests.ts @@ -0,0 +1,79 @@ +/// + +class AbstractPolymerElement implements PolymerElement { + $: { [id: string]: HTMLElement }; //polymer object for elements that have an ID + + // inargs is the [args] for the callback.. need to update function def + async(inMethod: () => void, inArgs?: Array, inTimeout?: number): void { } + job(jobName: string, inMethod: () => void, inTimeout?: number): void { } + fire(eventName: string, details?: any, targetNode?: any, bubbles?: boolean, cancelable?: boolean): void { } + asyncFire(eventName: string, details?: any, targetNode?: any, bubbles?: boolean, cancelable?: boolean): void { } + + cancelUnbindAll(): void { } + + // these are mix in API's.. hacky way to deal with them at the moment. + resizableAttachedHandler; + resizableDetachedHandler; +} + +class AbstractWebComponent extends AbstractPolymerElement { + + public name: string; + + constructor(name: string) { + super(); + this.name = name; + } + + protected get(): HTMLElement { + return this; + } +} + +function registerWebComponent(webComponentClass: Function, ...mixins): void { + + // we need a flat object, without prototype in order to polymer to work on our components + var flattenedComponent = {}; + var poly_func = ["async", "job", "fire", "asyncFire", "cancelUnbindAll"]; + if (mixins) { + // apply mixins + mixins.forEach(mixin => { + for (var i in mixin) { + if (mixin.hasOwnProperty(i)) { + webComponentClass.prototype[i] = mixin[i]; + } + } + }); + } + var webComponent: AbstractWebComponent = new (webComponentClass)(); + for (var i in webComponent) { + if (!_.contains(poly_func, i)) { + flattenedComponent[i] = webComponent[i]; + } + } + + console.debug('registering web component', webComponent, flattenedComponent); + Polymer(webComponent.name, flattenedComponent); +} + +class Spinner extends AbstractWebComponent { + private pendingRequestsCount: number; + + constructor() { + super('test-spinner'); + } + + public ready(): void { + this.pendingRequestsCount = 0; + this.updateUI(); + } + + private updateUI(): void { + var spinnerHidden: boolean = this.pendingRequestsCount == 0; + if (spinnerHidden) { + this.get().setAttribute('hidden', 'true'); + } else { + this.get().removeAttribute('hidden'); + } + } +} \ No newline at end of file diff --git a/polymer/polymer.app-router.d.ts b/polymer/polymer.app-router.d.ts new file mode 100644 index 000000000..1643c58a6 --- /dev/null +++ b/polymer/polymer.app-router.d.ts @@ -0,0 +1,8 @@ +declare module PolymerComponents { + module App { + export interface Router extends HTMLElement { + init(): void; + go(path: string, options?: { replace?: boolean }): void; + } + } +} \ No newline at end of file diff --git a/polymer/polymer.core-drawer-panel.d.ts b/polymer/polymer.core-drawer-panel.d.ts new file mode 100644 index 000000000..2bad7b633 --- /dev/null +++ b/polymer/polymer.core-drawer-panel.d.ts @@ -0,0 +1,70 @@ +// Type definitions for polymer's paper-toast +// Project: https://github.com/Polymer/core-drawer-panel +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module PolymerComponents { + export module Core { + export interface DrawerPanel extends HTMLElement { + /** + * Width of the drawer panel. default: '256px' + */ + drawerWidth: string; + + /** + * Max-width when the panel changes to narrow layout. default: '640px' + */ + responsiveWidth: string; + + /** + * The panel that is being selected. drawer for the drawer panel and main for the main panel. default: null + */ + selected: string; + + /** + * The panel to be selected when core-drawer-panel changes to narrow layout. default: 'main' + */ + defaultSelected: string; + + /** + * Returns true if the panel is in narrow layout. This is useful if you need to show/hide elements based on the layout. default: false + */ + narrow: boolean; + + /** + * If true, position the drawer to the right. default: false + */ + rightDrawer: boolean; + + /** + * If true, swipe to open/close the drawer is disabled. default: false + */ + disableSwipe: boolean; + + /** + * If true, ignore responsiveWidth setting and force the narrow layout. default: false + */ + forceNarrow: boolean; + + /** + * If true, swipe from the edge is disabled. default: false + */ + disableEdgeSwipe: boolean; + + /** + * Toggles the panel open and closed. + */ + togglePanel(): void; + + /** + * Opens the drawer. + */ + openDrawer(): void; + + /** + * Closes the drawer. + */ + closeDrawer(): void; + } + } +} \ No newline at end of file diff --git a/polymer/polymer.d.ts b/polymer/polymer.d.ts new file mode 100644 index 000000000..f501d8655 --- /dev/null +++ b/polymer/polymer.d.ts @@ -0,0 +1,42 @@ +// Type definitions for polymer +// Project: https://github.com/polymer +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface PolymerElement { + + // definition + publish?: Object; + computed?: Object; + // object mapping variable names to functions name + observe?: Object; + + // life time API + created? (): void; + ready? (): void; + attached? (): void; + domReady? (): void; + detached? (): void; + attributeChanged? (attrName: string, oldVal: any, newVal: any): void; +} + +interface Polymer { + + importElements(node: Node, callback: Function); + import(url: string, callback?: () => void): void; + + mixin(target: any, ...obj1): any; + waitingFor(): Array; + // should be an "integer" for milliseconds + forceReady(timeout: number): void; + + (tag_name: string, prototype: PolymerElement): void; + (tag_name: string, prototype: any): void; + (prototype: PolymerElement): void; + (): void; + // hacks for mixins + CoreResizer: any; + CoreResizable: any; +} + +declare var Polymer: Polymer; diff --git a/polymer/polymer.paper-toast.d.ts b/polymer/polymer.paper-toast.d.ts new file mode 100644 index 000000000..fbf8cd7a6 --- /dev/null +++ b/polymer/polymer.paper-toast.d.ts @@ -0,0 +1,61 @@ +// Type definitions for polymer's paper-toast +// Project: https://github.com/Polymer/paper-toast +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module PolymerComponents { + export module Paper { + export interface Toast extends HTMLElement { + /** + * The text shows in a toast. + * default: '' + */ + text: string; + + /** + * The duration in milliseconds to show the toast. + * default: 3000 + */ + duration: number; + + /** + * Set opened to true to show the toast and to false to hide it. + * default: false + */ + opened: boolean; + + /** + * Min-width when the toast changes to narrow layout. In narrow layout, the toast fits at the bottom of the screen when opened. + * default: '480px' + */ + responsiveWidth: string; + + /** + * If true, the toast can't be swiped. + * default: false + */ + swipeDisabled: boolean; + + /** + * By default, the toast will close automatically if the user taps outside it or presses the escape key. Disable this behavior by setting the autoCloseDisabled property to true. + * default: false + */ + autoCloseDisabled: boolean; + + /** + * Show the toast for the specified duration + */ + show(): void; + + /** + * Dismiss the toast and hide it. + */ + dismiss(): void; + + /** + * Toggle the opened state of the toast. + */ + toggle(): void; + } + } +} \ No newline at end of file From 063a6ccc292bedc15c6210e8fdc0bcfbaa6211b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Mar 2015 10:44:54 +0100 Subject: [PATCH 020/243] fixed definition files for polymer (description on app router and any types) --- polymer/polymer-tests.ts | 12 ++++-------- polymer/polymer.app-router.d.ts | 5 +++++ polymer/polymer.d.ts | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/polymer/polymer-tests.ts b/polymer/polymer-tests.ts index e24445aca..80227cab6 100644 --- a/polymer/polymer-tests.ts +++ b/polymer/polymer-tests.ts @@ -10,10 +10,6 @@ class AbstractPolymerElement implements PolymerElement { asyncFire(eventName: string, details?: any, targetNode?: any, bubbles?: boolean, cancelable?: boolean): void { } cancelUnbindAll(): void { } - - // these are mix in API's.. hacky way to deal with them at the moment. - resizableAttachedHandler; - resizableDetachedHandler; } class AbstractWebComponent extends AbstractPolymerElement { @@ -30,11 +26,10 @@ class AbstractWebComponent extends AbstractPolymerElement { } } -function registerWebComponent(webComponentClass: Function, ...mixins): void { +function registerWebComponent(webComponentClass: Function, ...mixins: any[]): void { // we need a flat object, without prototype in order to polymer to work on our components - var flattenedComponent = {}; - var poly_func = ["async", "job", "fire", "asyncFire", "cancelUnbindAll"]; + var flattenedComponent: any = {}; if (mixins) { // apply mixins mixins.forEach(mixin => { @@ -47,7 +42,8 @@ function registerWebComponent(webComponentClass: Function, ...mixins): void { } var webComponent: AbstractWebComponent = new (webComponentClass)(); for (var i in webComponent) { - if (!_.contains(poly_func, i)) { + // do not include polymer functions + if (i != "async" && i != "job" && i != "fire" && i != "asyncFire" && i != "cancelUnbindAll") { flattenedComponent[i] = webComponent[i]; } } diff --git a/polymer/polymer.app-router.d.ts b/polymer/polymer.app-router.d.ts index 1643c58a6..633479ba2 100644 --- a/polymer/polymer.app-router.d.ts +++ b/polymer/polymer.app-router.d.ts @@ -1,3 +1,8 @@ +// Type definitions for app-router +// Project: https://github.com/erikringsmuth/app-router +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + declare module PolymerComponents { module App { export interface Router extends HTMLElement { diff --git a/polymer/polymer.d.ts b/polymer/polymer.d.ts index f501d8655..dfb812f8c 100644 --- a/polymer/polymer.d.ts +++ b/polymer/polymer.d.ts @@ -22,16 +22,16 @@ interface PolymerElement { interface Polymer { - importElements(node: Node, callback: Function); + importElements(node: Node, callback: Function): void; import(url: string, callback?: () => void): void; - mixin(target: any, ...obj1): any; + mixin(target: any, ...mixins: any[]): any; waitingFor(): Array; // should be an "integer" for milliseconds forceReady(timeout: number): void; - (tag_name: string, prototype: PolymerElement): void; - (tag_name: string, prototype: any): void; + (tagName: string, prototype: PolymerElement): void; + (tagName: string, prototype: any): void; (prototype: PolymerElement): void; (): void; // hacks for mixins From d2ff5898b80582dcf671448775ef96555eb5f138 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Mar 2015 10:48:18 +0100 Subject: [PATCH 021/243] fixed any index --- polymer/polymer-tests.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polymer/polymer-tests.ts b/polymer/polymer-tests.ts index 80227cab6..70c5bce0a 100644 --- a/polymer/polymer-tests.ts +++ b/polymer/polymer-tests.ts @@ -44,7 +44,8 @@ function registerWebComponent(webComponentClass: Function, ...mixins: any[]): vo for (var i in webComponent) { // do not include polymer functions if (i != "async" && i != "job" && i != "fire" && i != "asyncFire" && i != "cancelUnbindAll") { - flattenedComponent[i] = webComponent[i]; + var attribute: any = webComponent[i]; + flattenedComponent[i] = attribute; } } From 502c7582f72ddfc6ad16762b24483a8cad3f3d82 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Mar 2015 10:51:55 +0100 Subject: [PATCH 022/243] more implied any --- polymer/polymer-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polymer/polymer-tests.ts b/polymer/polymer-tests.ts index 70c5bce0a..a606692fd 100644 --- a/polymer/polymer-tests.ts +++ b/polymer/polymer-tests.ts @@ -44,7 +44,7 @@ function registerWebComponent(webComponentClass: Function, ...mixins: any[]): vo for (var i in webComponent) { // do not include polymer functions if (i != "async" && i != "job" && i != "fire" && i != "asyncFire" && i != "cancelUnbindAll") { - var attribute: any = webComponent[i]; + var attribute: any = (webComponent)[i]; flattenedComponent[i] = attribute; } } From 13d8727de01b768591781ec4f438dc1d85bc8e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Werlang?= Date: Wed, 11 Mar 2015 08:43:49 -0300 Subject: [PATCH 023/243] Define patch() on $http --- angularjs/angular.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index c907bbfe9..e5f6f779e 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1152,6 +1152,15 @@ declare module ng { */ put(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise; + /** + * Shortcut method to perform PATCH request. + * + * @param url Relative or absolute URL specifying the destination of the request + * @param data Request content + * @param config Optional configuration object + */ + patch(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise; + /** * Runtime equivalent of the $httpProvider.defaults property. Allows configuration of default headers, withCredentials as well as request and response transformations. */ From aaa8820f2654bea1ac929a42c7ab90dea16dab4c Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Wed, 11 Mar 2015 15:21:37 +0100 Subject: [PATCH 024/243] Improved typings for http.ClientRequest, http.ClientResponse, http.request() and http.get(). --- node/node-0.10.d.ts | 80 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/node/node-0.10.d.ts b/node/node-0.10.d.ts index 28f0a3bc5..73f962782 100644 --- a/node/node-0.10.d.ts +++ b/node/node-0.10.d.ts @@ -319,32 +319,26 @@ declare module "http" { end(str: string, encoding?: string, cb?: Function): void; end(data?: any, encoding?: string): void; } - export interface ClientRequest extends events.EventEmitter, stream.Writable { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - write(chunk: any, encoding?: string): void; + /** + * Object returned by http.request() + */ + export interface ClientRequest extends events.EventEmitter, NodeJS.WritableStream { abort(): void; setTimeout(timeout: number, callback?: Function): void; setNoDelay(noDelay?: boolean): void; setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; } - export interface ClientResponse extends events.EventEmitter, stream.Readable { + + /** + * The client version of http.IncomingMessage + */ + export interface ClientResponse extends events.EventEmitter, NodeJS.ReadableStream { statusCode: number; httpVersion: string; headers: any; trailers: any; + socket: net.Socket; setEncoding(encoding?: string): void; pause(): void; resume(): void; @@ -386,17 +380,65 @@ declare module "http" { destroy(): void; } + /** + * Options for http.request() + */ + export interface RequestOptions { + /** + * A domain name or IP address of the server to issue the request to. Defaults to 'localhost'. + */ + host?: string; + /** + * To support url.parse() hostname is preferred over host + */ + hostname?: string; + /** + * Port of remote server. Defaults to 80. + */ + port?: number; + /** + * Local interface to bind for network connections. + */ + localAddress?: string; + /** + * Unix Domain Socket (use one of host:port or socketPath) + */ + socketPath?: string; + /** + * A string specifying the HTTP request method. Defaults to 'GET'. + */ + method?: string; + /** + * Request path. Defaults to '/'. Should include query string if any. E.G. '/index.html?page=12' + */ + path?: string; + /** + * An object containing request headers. + */ + headers?: { [index: string]: string }; + /** + * Basic authentication i.e. 'user:password' to compute an Authorization header. + */ + auth?: string; + /** + * Controls Agent behavior. When an Agent is used request will default to Connection: keep-alive. Possible values: + * - undefined (default): use global Agent for this host and port. + * - Agent object: explicitly use the passed in Agent. + * - false: opts out of connection pooling with an Agent, defaults request to Connection: close. + */ + agent?: Agent|boolean; + } + export var STATUS_CODES: { [errorCode: number]: string; [errorCode: string]: string; }; export function createServer(requestListener?: (request: ServerRequest, response: ServerResponse) =>void ): Server; export function createClient(port?: number, host?: string): any; - export function request(options: any, callback?: Function): ClientRequest; - export function get(options: any, callback?: Function): ClientRequest; + export function request(options: RequestOptions, callback?: (response: ClientResponse) => void): ClientRequest; + export function get(options: RequestOptions, callback?: (response: ClientResponse) => void): ClientRequest; export var globalAgent: Agent; } - declare module "cluster" { import child = require("child_process"); import events = require("events"); From 6f8c162bf5e43442e0520f8f2fbc55d7cacc349d Mon Sep 17 00:00:00 2001 From: ray Date: Wed, 11 Mar 2015 11:51:52 -0400 Subject: [PATCH 025/243] defs for blueimp-md5 --- blueimp-md5/blueimp-md5-tests.ts | 7 +++++++ blueimp-md5/blueimp-md5-tests.ts.tscparams | 1 + blueimp-md5/blueimp-md5.d.ts | 7 +++++++ 3 files changed, 15 insertions(+) create mode 100644 blueimp-md5/blueimp-md5-tests.ts create mode 100644 blueimp-md5/blueimp-md5-tests.ts.tscparams create mode 100644 blueimp-md5/blueimp-md5.d.ts diff --git a/blueimp-md5/blueimp-md5-tests.ts b/blueimp-md5/blueimp-md5-tests.ts new file mode 100644 index 000000000..5e3808309 --- /dev/null +++ b/blueimp-md5/blueimp-md5-tests.ts @@ -0,0 +1,7 @@ +/// + +import blueimp = require('blueimp-md5'); + +function hash(): boolean { + return blueimp.md5('hello world') === '5eb63bbbe01eeed093cb22bb8f5acdc3'; +} diff --git a/blueimp-md5/blueimp-md5-tests.ts.tscparams b/blueimp-md5/blueimp-md5-tests.ts.tscparams new file mode 100644 index 000000000..85542607d --- /dev/null +++ b/blueimp-md5/blueimp-md5-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs diff --git a/blueimp-md5/blueimp-md5.d.ts b/blueimp-md5/blueimp-md5.d.ts new file mode 100644 index 000000000..37c3f3c00 --- /dev/null +++ b/blueimp-md5/blueimp-md5.d.ts @@ -0,0 +1,7 @@ +// Type definitions for blueimp-md5 v1.1.0 +// Project: https://github.com/blueimp/JavaScript-MD5 +// Definitions by: Ray Martone +// Definitions: https://github.com/borisyankov/DefinitelyTyped +declare module 'blueimp-md5' { + export function md5(value: string, key?: string, raw?: boolean): string; +} From b66b42f5d4a7e8f1eba2e5a182d6930ba52f90c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elis=C3=A9e?= Date: Wed, 11 Mar 2015 19:59:40 +0100 Subject: [PATCH 026/243] Declare Socket.conn as any SocketIO.Socket.conn is an EngineIO.Socket, not a SocketIO.Socket so use any rather declaring as the wrong type. --- socket.io/socket.io.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socket.io/socket.io.d.ts b/socket.io/socket.io.d.ts index 677d4fcc2..258b573d5 100644 --- a/socket.io/socket.io.d.ts +++ b/socket.io/socket.io.d.ts @@ -55,7 +55,7 @@ declare module SocketIO { interface Socket { rooms: string[]; client: Client; - conn: Socket; + conn: any; request: any; id: string; emit(name: string, ...args: any[]): Socket; From c4a937becd4a6e1d2eba59de8afaedd957c712e4 Mon Sep 17 00:00:00 2001 From: Corey Jepperson Date: Wed, 11 Mar 2015 15:57:48 -0500 Subject: [PATCH 027/243] add wnumb and jquery.nouislider definitions --- jquery.nouislider/jquery.nouislider-tests.ts | 75 ++++++++++ jquery.nouislider/jquery.nouislider.d.ts | 150 +++++++++++++++++++ wnumb/wnumb-tests.ts | 42 ++++++ wnumb/wnumb.d.ts | 86 +++++++++++ 4 files changed, 353 insertions(+) create mode 100644 jquery.nouislider/jquery.nouislider-tests.ts create mode 100644 jquery.nouislider/jquery.nouislider.d.ts create mode 100644 wnumb/wnumb-tests.ts create mode 100644 wnumb/wnumb.d.ts diff --git a/jquery.nouislider/jquery.nouislider-tests.ts b/jquery.nouislider/jquery.nouislider-tests.ts new file mode 100644 index 000000000..fe143f6af --- /dev/null +++ b/jquery.nouislider/jquery.nouislider-tests.ts @@ -0,0 +1,75 @@ +/// +/// + +//basic +var basicSlider = $("

").noUiSlider({ + start: 80, + range: { + 'min': 0, + 'max': 10000 + } +}); + +//all options +var allOptions = $("
").noUiSlider({ + start: [ 20, 80 ], + step: 10, + margin: 20, + connect: true, + direction: 'rtl', + orientation: 'vertical', + + // Configure tapping, or make the selected range dragable. + behaviour: 'tap-drag', + + // Full number format support. + format: wNumb({ + mark: ',', + decimals: 1 + }), + + // Support for non-linear ranges by adding intervals. + range: { + 'min': 0, + 'max': 100 + } +}); + + +//PIPS +allOptions.noUiSlider_pips({ + mode: 'steps', + density: 3, + filter: function(){return 1}, + format: wNumb({ + decimals: 2, + prefix: '$' + }) +}); + + +basicSlider.noUiSlider_pips({ + mode: 'values', + values: [50, 552, 4651, 4952, 5000, 7080, 9000], + density: 4, + stepped: true +}); + +//functions + +allOptions.val(); + +// Set one value +basicSlider.val(10); +basicSlider.val([150]); + +// Set the upper handle, +// don't change the lower one. +allOptions.val([null, 14]); + +// Set both slider handles +allOptions.val([13.2, 15.7]); + + +//link +allOptions.Link('lower').to($('')); diff --git a/jquery.nouislider/jquery.nouislider.d.ts b/jquery.nouislider/jquery.nouislider.d.ts new file mode 100644 index 000000000..5b1700b23 --- /dev/null +++ b/jquery.nouislider/jquery.nouislider.d.ts @@ -0,0 +1,150 @@ +// Type definitions for nouislider v7.0.10 +// Project: https://github.com/leongersen/noUiSlider +// Definitions by: Corey Jepperson +// Definitions: https://github.com/borisyankov/DefinitelyTyped +/// +/// + + +interface noUiSliderInstance extends JQuery{ + /** + * For one-handle sliders, calling .val() will return the value. + * For two-handle sliders, an array[value, value] will be returned. + */ + val(): number | number[]; + /** + * noUiSlider will keep your values within the slider range, which saves you a bunch of validation. + * If you have set the slider to use one handle, simply set it on the slider using the .val() method. + * If you have two handles, pass an array. One-handled sliders will also accept arrays. + * Within an array, you can set a position to null if you want to leave a handle unchanged. + */ + val(value: any): JQuery; //can't enforce number as it breaks extend + /** + * noUiSlider has full support for libLink, which will let you write values to input elements very easily. + * libLink will update the slider if you change an input as well! + */ + Link(target: string, method?: any, format?:any): any; +} + + + +interface noUiSliderOptions { + /** + * The start option sets the number of handles and their start positions, relative to range. + */ + start: number | number[] | number[][]; + /** + * The connect setting can be used to control the bar between the handles, + * or the edges of the slider. Use "lower" to connect to the lower side, + * or "upper" to connect to the upper side. Setting true sets the bar between the handles. + */ + range: Object; + /** + * noUiSlider offers several ways to handle user interaction. + * The range can be set to drag, and handles can move to taps. + * All these effects are optional, and can be enable by adding their keyword to the behaviour option. + * This option accepts a "-" separated list of "drag", "tap", "fixed", "snap" or "none". + */ + connect?: string | boolean; + /** + * When using two handles, the minimum distance between the handles can be set using the margin option. + * The margin value is relative to the value set in 'range'. + * This option is only available on standard linear sliders. + */ + margin?: number; + /** + * The limit option is the oposite of the margin option, + * limiting the maximum distance between two handles. + * As with the margin option, the limit option can only be used on linear sliders. + */ + limit?: number; + /** + * By default, the slider slides fluently. + * In order to make the handles jump between intervals, you can use this option. + * The step option is relative to the values provided to range. + */ + step?: number; + /** + * The orientation setting can be used to set the slider to "vertical" or "horizontal". + * Set dimensions! Vertical sliders don't assume a default height, so you'll need to set one. + * You can use any unit you want, including % or px. + */ + orientation?: string; + /** + * By default the sliders are top-to-bottom and left-to-right, + * but you can change this using the direction option, + * which decides where the upper side of the slider is. + */ + direction?: string; + /** + * Set the animate option to false to prevent the slider from animating to a new value with when calling .val(). + */ + animate?: boolean; + /** + * All values on the slider are part of a range. The range has a minimum and maximum value. + * + behaviour?: string; + /** + * To format the slider output, noUiSlider offers a format option. + * Simply specify to and from functions to encode and decode the values. + * See manual formatting to the right for usage information. + * By default, noUiSlider will format output with 2 decimals. + * Manual formatting can be very tedious, so noUiSlider has support for the wNumb formatting library. + * wNumb offers a wide range of options and provides number validation. + */ + format?: Object | ((...args:any[]) => any); + +} + +interface noUiSliderPipsOptions { + /** + * The range mode uses the slider range to determine where the pips should be. A pip is generated for every percentage specified. + * + * Like range, the steps mode uses the slider range. In steps mode, a pip is generated for every step. + * The filter option can be used to filter the generated pips. + * The filter function must return 0 (no value), 1 (large value) or 2 (small value). + * + * In positions mode, pips are generated at percentage-based positions on the slider. Optionally, the stepped option can be set to true to match the pips to the slider steps. + * + * The count mode can be used to generate a fixed number of pips. As with positions mode, the stepped option can be used. + * + * The values mode is similar to positions, but it accepts values instead of percentages. The stepped option can be used for this mode. + * + */ + mode: string; + /** + * Range Mode: percentage for range mode + * Step Mode: step number for steps + * Positions Mode: percentage-based positions on the slider + * Count Mode: positions between pips + */ + density?: number; + /** + * Step Mode: The filter option can be used to filter the generated pips. + * The filter function must return 0 (no value), 1 (large value) or 2 (small value). + */ + filter?: (...args:any[]) => number; + /** + * format for step mode + * see noUiSlider format + */ + format?: Object; + /** + * + * values for positions and values mode + * number pips for count mode + */ + values?: number | number[]; + /** + * stepped option for positions, values and count mode + */ + stepped?: boolean; + + +} + + +interface JQuery { + noUiSlider(options?: noUiSliderOptions): noUiSliderInstance; + noUiSlider_pips(options?: noUiSliderPipsOptions): noUiSliderInstance; +} \ No newline at end of file diff --git a/wnumb/wnumb-tests.ts b/wnumb/wnumb-tests.ts new file mode 100644 index 000000000..d8b3b5269 --- /dev/null +++ b/wnumb/wnumb-tests.ts @@ -0,0 +1,42 @@ +/// + + +var moneyFormat = wNumb({ + mark: '.', + thousand: ',', + prefix: '$ ', + postfix: ' p.p.' +}); + +moneyFormat.to( 301980.62 ); + +moneyFormat.from( '$ 301,980.62 p.p.' ); + +var Format = wNumb({ + prefix: '$ ', + decimals: 3, + thousand: ',' +}); + +Format = wNumb({ + thousand: '.', + encoder: function( a ){ + return a * 1E7; + }, + decoder: function( a ){ + return a / 1E7; + } +}); + +Format = wNumb({ + prefix: '$', + postfix: ',-', + thousand: ',' +}); + + +Format = wNumb({ + prefix: '$', + negativeBefore: '[NEGATIVE] ' +}); + diff --git a/wnumb/wnumb.d.ts b/wnumb/wnumb.d.ts new file mode 100644 index 000000000..d3645768c --- /dev/null +++ b/wnumb/wnumb.d.ts @@ -0,0 +1,86 @@ +// Type definitions for nouislider v1.0.0 +// Project: https://github.com/leongersen/wnumb +// Definitions by: Corey Jepperson +// Definitions: https://github.com/borisyankov/DefinitelyTyped +declare var wNumb: wNumb; + +interface wNumbOptions { + /** + * decimals The number of decimals to include in the result. Limited to 7. + */ + decimals?: number; + /** + * The decimal separator. + * Defaults to '.' if thousand isn't already set to '.'. + */ + mark?: string; + /** + * Separator for large numbers. For example: ' ' would result in a formatted number of 1 000 000. + */ + thousand?: string; + /** + * A string to prepend to the number. Use cases include prefixing with money symbols such as '$' or '€'. + */ + prefix?: string; + /** + * A number to append to a number. For example: ',-'. + */ + postfix?: string; + /** + * The prefix for negative values. Defaults to '-' if negativeBefore isn't set. + */ + negative?: string; + /** + * The prefix for a negative number. Inserted before prefix. + */ + negativeBefore?: string; + /**This is a powerful option to manually modify the slider output. + * + *For example, to show a number in another currency: + * function( value ){ + * return value * 1.32; + * } + */ + encoder?: (value: number) => number; + /** + * Reverse the operations set in encoder. + * Use this option to undo modifications made while encoding the value. + * function( value ){ + * return value / 1.32; + * } + */ + decoder?: (value: number) => number; + /** + * Similar to encoder, but applied after all other formatting options are applied. + */ + edit?: (value: number) => number; + /** + * Similar to decoder and the reverse for edit. + * Applied before all other formatting options are applied. + */ + undo?: (value: number) => number; +} + + +interface wNumb { + /** + * Create a wNumb + * + * @param options - the options + */ + (options?: wNumbOptions): wNumbInstance; +} + +interface wNumbInstance { + + + + /** + * format to string + */ + to(val: number): string; + /** + * get number from formatted string + */ + from(val: string): number; +} \ No newline at end of file From 39674bfb36b062b53c27540ceeab429480d5be25 Mon Sep 17 00:00:00 2001 From: Ken Sheedlo Date: Wed, 11 Mar 2015 14:55:52 -0700 Subject: [PATCH 028/243] flot: fix unhighlight typo The method is "unhighlight", but the type definition declared a version of it as "unhightlight". --- flot/jquery.flot.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flot/jquery.flot.d.ts b/flot/jquery.flot.d.ts index c179d2f03..bb0eaaa28 100644 --- a/flot/jquery.flot.d.ts +++ b/flot/jquery.flot.d.ts @@ -200,7 +200,7 @@ declare module jquery.flot { interface plot { highlight(series: dataSeries, datapoint: item): void; - unhightlight(): void; + unhighlight(): void; unhighlight(series: dataSeries, datapoint: item): void; setData(data: any): void; setupGrid(): void; From 26f370917d08a7f272bb5bfb08aacd8855f36ebd Mon Sep 17 00:00:00 2001 From: Ken Sheedlo Date: Wed, 11 Mar 2015 15:04:10 -0700 Subject: [PATCH 029/243] flot: add support for flot plugins --- flot/jquery.flot.d.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/flot/jquery.flot.d.ts b/flot/jquery.flot.d.ts index c179d2f03..70d90b962 100644 --- a/flot/jquery.flot.d.ts +++ b/flot/jquery.flot.d.ts @@ -198,6 +198,13 @@ declare module jquery.flot { c2p(canvasPoint: canvasPoint):point; } + interface plugin { + init(options: plotOptions): any; + options?: any; + name?: string; + version?: string; + } + interface plot { highlight(series: dataSeries, datapoint: item): void; unhightlight(): void; @@ -221,9 +228,14 @@ declare module jquery.flot { getPlotOffset(): canvasPoint; getOptions(): plotOptions; } + + interface plotStatic { + (placeholder: JQuery, data: dataSeries[], options?: plotOptions): plot; + (placeholder: JQuery, data: any[], options?: plotOptions): plot; + plugins: plugin[]; + } } interface JQueryStatic { - plot(placeholder: JQuery, data: jquery.flot.dataSeries[], options?: jquery.flot.plotOptions): jquery.flot.plot; - plot(placeholder: JQuery, data: any[], options?: jquery.flot.plotOptions): jquery.flot.plot; + plot: jquery.flot.plotStatic; } From 150c23b4c739d1a2560f9d94045d85e0689a8167 Mon Sep 17 00:00:00 2001 From: Ken Sheedlo Date: Wed, 11 Mar 2015 15:39:50 -0700 Subject: [PATCH 030/243] flot: fix interaction typo jquery.flot.plotOptions declares a field called "interfaction" that should actually be "interaction". --- flot/jquery.flot.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flot/jquery.flot.d.ts b/flot/jquery.flot.d.ts index c179d2f03..223e76141 100644 --- a/flot/jquery.flot.d.ts +++ b/flot/jquery.flot.d.ts @@ -16,7 +16,7 @@ declare module jquery.flot { xaxes?: axisOptions[]; yaxes?: axisOptions[]; grid?: gridOptions; - interfaction?: interaction; + interaction?: interaction; hooks?: hooks; } From d13c42ba67b6d6620005f4d944ca05260253fe7c Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 10:47:32 +1100 Subject: [PATCH 031/243] angular: import should bring in the type information as well closes https://github.com/borisyankov/DefinitelyTyped/issues/3670 closes https://github.com/borisyankov/DefinitelyTyped/pull/3714 --- angularjs/angular.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index e5f6f779e..6ead21da5 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -13,6 +13,9 @@ interface Function { $inject?: string[]; } +// Collapse ng into angular +import angular = ng; + // Support AMD require declare module 'angular' { export = angular; From 779fcd5d7737e473bfd96f2c6446d8da64bb8243 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:10:14 +1100 Subject: [PATCH 032/243] angular: deprecate ng --- angularjs/angular.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 6ead21da5..b2d9a403e 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -14,7 +14,8 @@ interface Function { } // Collapse ng into angular -import angular = ng; +// NOTE: this is going to be deprecated +import ng = angular; // Support AMD require declare module 'angular' { @@ -22,9 +23,9 @@ declare module 'angular' { } /////////////////////////////////////////////////////////////////////////////// -// ng module (angular.js) +// angular module (angular.js) /////////////////////////////////////////////////////////////////////////////// -declare module ng { +declare module angular { // not directly implemented, but ensures that constructed class implements $get interface IServiceProviderClass { From adf8ebbcce4183fcc15efad957b14288286b34c7 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:16:23 +1100 Subject: [PATCH 033/243] angular: another attempt for 1.4 --- angularjs/angular.d.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index b2d9a403e..bc7fa9de0 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -6,24 +6,22 @@ /// -declare var angular: ng.IAngularStatic; +declare var angular: angular.IAngularStatic; // Support for painless dependency injection interface Function { $inject?: string[]; } -// Collapse ng into angular -// NOTE: this is going to be deprecated +// Collapse angular into ng import ng = angular; - // Support AMD require declare module 'angular' { export = angular; } /////////////////////////////////////////////////////////////////////////////// -// angular module (angular.js) +// ng module (angular.js) /////////////////////////////////////////////////////////////////////////////// declare module angular { From bd48b4a98209b9d64dc6823206e27c33c278fb46 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:30:38 +1100 Subject: [PATCH 034/243] Update angular-hotkeys.d.ts --- angular-hotkeys/angular-hotkeys.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-hotkeys/angular-hotkeys.d.ts b/angular-hotkeys/angular-hotkeys.d.ts index 0c0b9109a..3340f9ff3 100644 --- a/angular-hotkeys/angular-hotkeys.d.ts +++ b/angular-hotkeys/angular-hotkeys.d.ts @@ -5,7 +5,7 @@ /// -declare module ng.hotkeys { +declare module angular.hotkeys { interface HotkeysProvider { template: string; From a53519a22abdb52bf396162f741d326122bfc04e Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:34:06 +1100 Subject: [PATCH 035/243] Update angularLocalStorage.d.ts --- angularLocalStorage/angularLocalStorage.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularLocalStorage/angularLocalStorage.d.ts b/angularLocalStorage/angularLocalStorage.d.ts index f83ae3306..08b5d473b 100644 --- a/angularLocalStorage/angularLocalStorage.d.ts +++ b/angularLocalStorage/angularLocalStorage.d.ts @@ -5,7 +5,7 @@ /// -declare module ng.localStorage { +declare module angular.localStorage { interface ILocalStorageService { set(key: string, value: any): any; get(key: string): any; From db4caad025159da5a747a0117f162e8bc9849860 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:35:49 +1100 Subject: [PATCH 036/243] Update angular-material.d.ts --- angular-material/angular-material.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index c764f939b..cf7a20d79 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// -declare module ng.material { +declare module angular.material { interface MDBottomSheetOptions { templateUrl?: string; From 60cc15229a9732657eff6439746d0c72cde3acd5 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:36:11 +1100 Subject: [PATCH 037/243] Update angular-translate.d.ts --- angular-translate/angular-translate.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts index 135ac75ad..c972c927d 100644 --- a/angular-translate/angular-translate.d.ts +++ b/angular-translate/angular-translate.d.ts @@ -5,7 +5,7 @@ /// -declare module ng.translate { +declare module angular.translate { interface ITranslatePartialLoaderService { addPart(name: string): ITranslatePartialLoaderService; From f3221653d352e577f93e19af235ca6ade2892184 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:36:33 +1100 Subject: [PATCH 038/243] Update angular-notify.d.ts --- angular-notify/angular-notify.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angular-notify/angular-notify.d.ts b/angular-notify/angular-notify.d.ts index bbb7c1e6b..7e55dc654 100644 --- a/angular-notify/angular-notify.d.ts +++ b/angular-notify/angular-notify.d.ts @@ -5,7 +5,7 @@ /// -declare module ng.cgNotify { +declare module angular.cgNotify { interface INotifyService { @@ -113,4 +113,4 @@ declare module ng.cgNotify { */ close():void; } -} \ No newline at end of file +} From 9580f9471445a9e3532ce5e20a638d2b80dcabee Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:36:53 +1100 Subject: [PATCH 039/243] Update angular-http-auth.d.ts --- angular-http-auth/angular-http-auth.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-http-auth/angular-http-auth.d.ts b/angular-http-auth/angular-http-auth.d.ts index 297761c47..4a08272cd 100644 --- a/angular-http-auth/angular-http-auth.d.ts +++ b/angular-http-auth/angular-http-auth.d.ts @@ -5,7 +5,7 @@ /// -declare module ng.httpAuth { +declare module angular.httpAuth { interface IAuthService { loginConfirmed(data?:any, configUpdater?:Function):void; loginCancelled(data?:any, reason?:any):void; From dca28d7057aeb0d251bf27c435329bb5f9a34dbe Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:37:12 +1100 Subject: [PATCH 040/243] Update angular-file-upload.d.ts --- angular-file-upload/angular-file-upload.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-file-upload/angular-file-upload.d.ts b/angular-file-upload/angular-file-upload.d.ts index f2a6bd042..2eb0e72b5 100644 --- a/angular-file-upload/angular-file-upload.d.ts +++ b/angular-file-upload/angular-file-upload.d.ts @@ -5,7 +5,7 @@ /// -declare module ng.angularFileUpload { +declare module angular.angularFileUpload { interface IUploadService { From 2225216464749d78797f2ca70fedc25014be05dd Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:37:30 +1100 Subject: [PATCH 041/243] Update angular-idle.d.ts --- angular-idle/angular-idle.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angular-idle/angular-idle.d.ts b/angular-idle/angular-idle.d.ts index 57ef2380b..4e1e98fb5 100644 --- a/angular-idle/angular-idle.d.ts +++ b/angular-idle/angular-idle.d.ts @@ -5,7 +5,7 @@ /// -declare module ng.idle { +declare module angular.idle { /** * Used to configure the $keepalive service. @@ -131,4 +131,4 @@ declare module ng.idle { */ unwatch(): void; } -} \ No newline at end of file +} From 71a138ec5e76a6d114cf038724c09afdfbfc9337 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:40:36 +1100 Subject: [PATCH 042/243] Update angular-route.d.ts --- angularjs/angular-route.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index 936b42589..7d9d282fe 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////////// // ngRoute module (angular-route.js) /////////////////////////////////////////////////////////////////////////////// -declare module ng.route { +declare module angular.route { /////////////////////////////////////////////////////////////////////////// // RouteParamsService From 1571e6b394cd305596a60f9d35dfcff2dd55a4aa Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:40:58 +1100 Subject: [PATCH 043/243] Update angular-animate.d.ts --- angularjs/angular-animate.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-animate.d.ts b/angularjs/angular-animate.d.ts index f649d65f7..833252177 100644 --- a/angularjs/angular-animate.d.ts +++ b/angularjs/angular-animate.d.ts @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////////// // ngAnimate module (angular-animate.js) /////////////////////////////////////////////////////////////////////////////// -declare module ng.animate { +declare module angular.animate { /////////////////////////////////////////////////////////////////////////// // AnimateService From 92ee9817d0718ed3307fbd57795b55d87413b02a Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:41:19 +1100 Subject: [PATCH 044/243] Update angular-sanitize.d.ts --- angularjs/angular-sanitize.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-sanitize.d.ts b/angularjs/angular-sanitize.d.ts index 6fde0baef..4be812cdd 100644 --- a/angularjs/angular-sanitize.d.ts +++ b/angularjs/angular-sanitize.d.ts @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////////// // ngSanitize module (angular-sanitize.js) /////////////////////////////////////////////////////////////////////////////// -declare module ng.sanitize { +declare module angular.sanitize { /////////////////////////////////////////////////////////////////////////// // SanitizeService From 91987d84adfeae46f93237cd8b4390a5a00517f0 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:41:36 +1100 Subject: [PATCH 045/243] Update angular-resource.d.ts --- angularjs/angular-resource.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index ed08c77dd..a1649ac54 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////////// // ngResource module (angular-resource.js) /////////////////////////////////////////////////////////////////////////////// -declare module ng.resource { +declare module angular.resource { /** * Currently supported options for the $resource factory options argument. From b7b20944a68d86ea8704675506e7ed839f889c79 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:41:54 +1100 Subject: [PATCH 046/243] Update angular-cookies.d.ts --- angularjs/angular-cookies.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-cookies.d.ts b/angularjs/angular-cookies.d.ts index 0feffae83..12208ae10 100644 --- a/angularjs/angular-cookies.d.ts +++ b/angularjs/angular-cookies.d.ts @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////////// // ngCookies module (angular-cookies.js) /////////////////////////////////////////////////////////////////////////////// -declare module ng.cookies { +declare module angular.cookies { /////////////////////////////////////////////////////////////////////////// // CookieService From f2891454db7c98d1f4eae26ed76c1cb25a158f89 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:42:20 +1100 Subject: [PATCH 047/243] Update angular-local-storage.d.ts --- angular-local-storage/angular-local-storage.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-local-storage/angular-local-storage.d.ts b/angular-local-storage/angular-local-storage.d.ts index 07c7157e1..d40630a2a 100644 --- a/angular-local-storage/angular-local-storage.d.ts +++ b/angular-local-storage/angular-local-storage.d.ts @@ -5,7 +5,7 @@ /// -declare module ng.local.storage { +declare module angular.local.storage { interface ILocalStorageServiceProvider extends IServiceProvider { /** * Setter for the prefix From 8b10d4fbb06f53c8074613b026d2cf10e6539cab Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:43:05 +1100 Subject: [PATCH 048/243] Update angular-mocks.d.ts --- angularjs/angular-mocks.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-mocks.d.ts b/angularjs/angular-mocks.d.ts index 877071127..4b5408c15 100644 --- a/angularjs/angular-mocks.d.ts +++ b/angularjs/angular-mocks.d.ts @@ -14,7 +14,7 @@ declare var inject: (...fns: Function[]) => any; /////////////////////////////////////////////////////////////////////////////// // ngMock module (angular-mocks.js) /////////////////////////////////////////////////////////////////////////////// -declare module ng { +declare module angular { /////////////////////////////////////////////////////////////////////////// // AngularStatic From b03bef04daf512e8c32bf73f7a841404a844e3da Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:43:23 +1100 Subject: [PATCH 049/243] Update angular-ui-sortable.d.ts --- angular-ui/angular-ui-sortable.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-ui/angular-ui-sortable.d.ts b/angular-ui/angular-ui-sortable.d.ts index a0c99f34f..48b96f2d3 100644 --- a/angular-ui/angular-ui-sortable.d.ts +++ b/angular-ui/angular-ui-sortable.d.ts @@ -5,7 +5,7 @@ /// -declare module ng.ui { +declare module angular.ui { interface UISortableOptions extends SortableOptions { 'ui-floating'?: string|boolean; From 2d374478cfd3a099308b27d4698eb04f977dd4b7 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:43:42 +1100 Subject: [PATCH 050/243] Update angular-ui-router.d.ts --- angular-ui/angular-ui-router.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-ui/angular-ui-router.d.ts b/angular-ui/angular-ui-router.d.ts index 53761552f..51082cdee 100644 --- a/angular-ui/angular-ui-router.d.ts +++ b/angular-ui/angular-ui-router.d.ts @@ -5,7 +5,7 @@ /// -declare module ng.ui { +declare module angular.ui { interface IState { name?: string; From 33a36ed51d7c86e2b48fe024c896c9a3d39ba220 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:43:59 +1100 Subject: [PATCH 051/243] Update angular-ui-bootstrap.d.ts --- angular-ui-bootstrap/angular-ui-bootstrap.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts index ad90dc9db..c9bf91c01 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts @@ -5,7 +5,7 @@ /// -declare module ng.ui.bootstrap { +declare module angular.ui.bootstrap { interface IAccordionConfig { /** @@ -630,4 +630,4 @@ declare module ng.ui.bootstrap { animation?: boolean; } -} \ No newline at end of file +} From 9920af6cbdb3fa82e083de778eb8de9c742e7f38 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:44:15 +1100 Subject: [PATCH 052/243] Update ngprogress-lite.d.ts --- ngprogress-lite/ngprogress-lite.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ngprogress-lite/ngprogress-lite.d.ts b/ngprogress-lite/ngprogress-lite.d.ts index bdee71673..20f0c6c0c 100644 --- a/ngprogress-lite/ngprogress-lite.d.ts +++ b/ngprogress-lite/ngprogress-lite.d.ts @@ -3,7 +3,7 @@ // Definitions by: Luke Forder // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module ng.progressLite { +declare module angular.progressLite { export interface INgProgressLite { set(num: number): INgProgressLite; @@ -25,4 +25,4 @@ declare module ng.progressLite { export interface INgProgressLiteProvider { settings: IConfigurationOptions; } -} \ No newline at end of file +} From eb66c47bd21a533a1a2341d8d459103a667ff719 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:49:21 +1100 Subject: [PATCH 053/243] Update angular-resource.d.ts --- angularjs/angular-resource.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index a1649ac54..4f03a341c 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -146,7 +146,7 @@ declare module angular.resource { } /** extensions to base ng based on using angular-resource */ -declare module ng { +declare module angular { interface IModule { /** creating a resource service factory */ From c66de5824d8470feb18b58b829d9501e4c235120 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:50:15 +1100 Subject: [PATCH 054/243] Update angular-local-storage-tests.ts --- angular-local-storage/angular-local-storage-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-local-storage/angular-local-storage-tests.ts b/angular-local-storage/angular-local-storage-tests.ts index fde523af5..9836537ac 100644 --- a/angular-local-storage/angular-local-storage-tests.ts +++ b/angular-local-storage/angular-local-storage-tests.ts @@ -12,7 +12,7 @@ interface TestScope extends ng.IScope { property: string; } -module ng.local.storage.tests { +module angular.local.storage.tests { export class TestController { constructor($scope: TestScope, localStorageService: ng.local.storage.ILocalStorageService) { // isSupported From e4accde9048f3cebe0a1e047a9e9d1f614f38171 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:50:36 +1100 Subject: [PATCH 055/243] Update angularLocalStorage-tests.ts --- angularLocalStorage/angularLocalStorage-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularLocalStorage/angularLocalStorage-tests.ts b/angularLocalStorage/angularLocalStorage-tests.ts index 7ae0d9066..32f0b119b 100644 --- a/angularLocalStorage/angularLocalStorage-tests.ts +++ b/angularLocalStorage/angularLocalStorage-tests.ts @@ -5,7 +5,7 @@ interface TestScope extends ng.IScope { viewType: string; } -module ng.LocalStorageTests { +module angular.LocalStorageTests { export class TestController { constructor(private $scope: TestScope, private storage: ng.localStorage.ILocalStorageService) { storage.bind($scope, 'varName'); From 36e55ab5f7f7e288f1ef56a6652b8dc56da8f3b3 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:57:23 +1100 Subject: [PATCH 056/243] Update angularLocalStorage-tests.ts --- .../angularLocalStorage-tests.ts | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/angularLocalStorage/angularLocalStorage-tests.ts b/angularLocalStorage/angularLocalStorage-tests.ts index 32f0b119b..7e3253913 100644 --- a/angularLocalStorage/angularLocalStorage-tests.ts +++ b/angularLocalStorage/angularLocalStorage-tests.ts @@ -5,20 +5,18 @@ interface TestScope extends ng.IScope { viewType: string; } -module angular.LocalStorageTests { - export class TestController { - constructor(private $scope: TestScope, private storage: ng.localStorage.ILocalStorageService) { - storage.bind($scope, 'varName'); - storage.bind($scope,'varName', { defaultValue: 'randomValue123', storeName: 'customStoreKey' }); - $scope.viewType = 'ANYTHING'; - storage.unbind($scope, 'viewType'); +export class TestController { + constructor(private $scope: TestScope, private storage: ng.localStorage.ILocalStorageService) { + storage.bind($scope, 'varName'); + storage.bind($scope,'varName', { defaultValue: 'randomValue123', storeName: 'customStoreKey' }); + $scope.viewType = 'ANYTHING'; + storage.unbind($scope, 'viewType'); - storage.set('key', 'value'); - storage.get('key'); - storage.remove('key'); + storage.set('key', 'value'); + storage.get('key'); + storage.remove('key'); - storage.clearAll(); - } + storage.clearAll(); } } From f0e0cd0f62618f5cc1ea2050da7ed4283209bafe Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 11:57:43 +1100 Subject: [PATCH 057/243] Update angular-local-storage-tests.ts --- .../angular-local-storage-tests.ts | 94 +++++++++---------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/angular-local-storage/angular-local-storage-tests.ts b/angular-local-storage/angular-local-storage-tests.ts index 9836537ac..2a18b2785 100644 --- a/angular-local-storage/angular-local-storage-tests.ts +++ b/angular-local-storage/angular-local-storage-tests.ts @@ -12,55 +12,53 @@ interface TestScope extends ng.IScope { property: string; } -module angular.local.storage.tests { - export class TestController { - constructor($scope: TestScope, localStorageService: ng.local.storage.ILocalStorageService) { - // isSupported - if (localStorageService.isSupported) { - // do something - } - - // getStorageType - var storageType: string = localStorageService.getStorageType(); - - // set - $scope.submit = (key, value) => { - return localStorageService.set(key, value); - }; - - // get - $scope.getItem = (key) => { - return localStorageService.get(key); - }; - - // remove - $scope.removeItem = (key) => { - return localStorageService.remove(key); - }; - - // clearAll(regexp) - $scope.clearNumbers = () => { - return localStorageService.clearAll(/^\d+$/); - }; - - // clearAll - $scope.clearAll = () => { - return localStorageService.clearAll(); - }; - - // keys - var lsKeys = localStorageService.keys(); - - // bind - localStorageService.set('property', 'oldValue'); - $scope.unbind = localStorageService.bind($scope, 'property'); - - // deriveKey - console.log(localStorageService.deriveKey('property')); // ls.property - - // length - var lsLength: number = localStorageService.length(); +export class TestController { + constructor($scope: TestScope, localStorageService: ng.local.storage.ILocalStorageService) { + // isSupported + if (localStorageService.isSupported) { + // do something } + + // getStorageType + var storageType: string = localStorageService.getStorageType(); + + // set + $scope.submit = (key, value) => { + return localStorageService.set(key, value); + }; + + // get + $scope.getItem = (key) => { + return localStorageService.get(key); + }; + + // remove + $scope.removeItem = (key) => { + return localStorageService.remove(key); + }; + + // clearAll(regexp) + $scope.clearNumbers = () => { + return localStorageService.clearAll(/^\d+$/); + }; + + // clearAll + $scope.clearAll = () => { + return localStorageService.clearAll(); + }; + + // keys + var lsKeys = localStorageService.keys(); + + // bind + localStorageService.set('property', 'oldValue'); + $scope.unbind = localStorageService.bind($scope, 'property'); + + // deriveKey + console.log(localStorageService.deriveKey('property')); // ls.property + + // length + var lsLength: number = localStorageService.length(); } } From 6e861919791064926aed897acf6fc0132b23a26a Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 12:05:50 +1100 Subject: [PATCH 058/243] Update angularLocalStorage-tests.ts --- angularLocalStorage/angularLocalStorage-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularLocalStorage/angularLocalStorage-tests.ts b/angularLocalStorage/angularLocalStorage-tests.ts index 7e3253913..366ab6e44 100644 --- a/angularLocalStorage/angularLocalStorage-tests.ts +++ b/angularLocalStorage/angularLocalStorage-tests.ts @@ -21,5 +21,5 @@ export class TestController { } var app = angular.module('angularLocalStorageTests', ['angularLocalStorage']); -app.controller('testCtrl', ['$scope', 'storage', ($scope: TestScope, storage: ng.localStorage.ILocalStorageService) => new ng.LocalStorageTests.TestController($scope, storage)]); +app.controller('testCtrl', ['$scope', 'storage', ($scope: TestScope, storage: ng.localStorage.ILocalStorageService) => new TestController($scope, storage)]); From 5da61408d09499e7e01f13d0d0923b0bd4c817a2 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 12:06:22 +1100 Subject: [PATCH 059/243] Update angular-local-storage-tests.ts --- angular-local-storage/angular-local-storage-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-local-storage/angular-local-storage-tests.ts b/angular-local-storage/angular-local-storage-tests.ts index 2a18b2785..cf61d20c9 100644 --- a/angular-local-storage/angular-local-storage-tests.ts +++ b/angular-local-storage/angular-local-storage-tests.ts @@ -70,4 +70,4 @@ app.config(function (localStorageServiceProvider: ng.local.storage.ILocalStorage .setNotify(true, true); }); -app.controller('TestController', ng.local.storage.tests.TestController); +app.controller('TestController', TestController); From f76832c80d681c7c9e9dca62428c3cd8a5326bb9 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 12 Mar 2015 14:35:30 +1100 Subject: [PATCH 060/243] Create angular-amd-tests.ts --- angularjs/angular-amd-tests.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 angularjs/angular-amd-tests.ts diff --git a/angularjs/angular-amd-tests.ts b/angularjs/angular-amd-tests.ts new file mode 100644 index 000000000..2ce75cc22 --- /dev/null +++ b/angularjs/angular-amd-tests.ts @@ -0,0 +1,7 @@ +/// + +import localName = require('angular'); +var mod: localName.IModule = localName.module('mod', []); + +// Remain compatible with the ambient version +var mod2: angular.IModule = mod; From 309691d455f8f97fbbe8b3db7d81020bca91b469 Mon Sep 17 00:00:00 2001 From: Gildor Date: Thu, 12 Mar 2015 13:59:37 +0800 Subject: [PATCH 061/243] Fix the signature of D3.Transition.each --- d3/d3.d.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 2bb239250..8569ab3f8 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -963,7 +963,29 @@ declare module D3 { */ (elements: EventTarget[]): Transition; } - each: (type?: string, eachFunction?: (data: any, index: number) => any) => Transition; + each: { + /** + * Immediately invokes the specified function for each element in the current + * transition, passing in the current datum and index, with the this context + * of the current DOM element. Similar to D3.Selection.each. + * + * @param eachFunction The function to be invoked for each element in the + * current transition, passing in the current datum and index, with the this + * context of the current DOM element. + */ + (eachFunction: (data: any, index: number) => any): Transition; + /** + * Adds a listener for transition events, supporting "start", "end" and + * "interrupt" events. The listener will be invoked for each individual + * element in the transition. + * + * @param type Type of transition event. Supported values are "start", "end" + * and "interrupt". + * @param listener The listener to be invoked for each individual element in + * the transition. + */ + (type: string, listener: (data: any, index: number) => any): Transition; + } transition: () => Transition; ease: (value: string, ...arrs: any[]) => Transition; attrTween(name: string, tween: (d: any, i: number, a: any) => BaseInterpolate): Transition; From b6667dea4c93324b6fa912ee1f5c1d15d2fcf2a8 Mon Sep 17 00:00:00 2001 From: A12893 Date: Fri, 13 Mar 2015 01:24:42 +0900 Subject: [PATCH 062/243] Add acl --- acl/acl-mongoDBBackend.d.ts | 22 ++++++ acl/acl-mongodbBackend-tests.ts | 16 +++++ acl/acl-redisBackend-test.ts | 16 +++++ acl/acl-redisBackend.d.ts | 21 ++++++ acl/acl-tests.ts | 65 ++++++++++++++++++ acl/acl.d.ts | 117 ++++++++++++++++++++++++++++++++ 6 files changed, 257 insertions(+) create mode 100644 acl/acl-mongoDBBackend.d.ts create mode 100644 acl/acl-mongodbBackend-tests.ts create mode 100644 acl/acl-redisBackend-test.ts create mode 100644 acl/acl-redisBackend.d.ts create mode 100644 acl/acl-tests.ts create mode 100644 acl/acl.d.ts diff --git a/acl/acl-mongoDBBackend.d.ts b/acl/acl-mongoDBBackend.d.ts new file mode 100644 index 000000000..48fe6f135 --- /dev/null +++ b/acl/acl-mongoDBBackend.d.ts @@ -0,0 +1,22 @@ +// Type definitions for node_acl 0.4.7 +// Project: https://github.com/optimalbits/node_acl +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "acl" { + import mongo = require('mongodb'); + + interface AclStatic { + mongodbBackend: MongodbBackendStatic; + } + + interface MongodbBackend extends Backend { } + interface MongodbBackendStatic { + new(db: mongo.Db, prefix: string, useSingle: boolean): MongodbBackend; + new(db: mongo.Db, prefix: string): MongodbBackend; + new(db: mongo.Db): MongodbBackend; + } +} diff --git a/acl/acl-mongodbBackend-tests.ts b/acl/acl-mongodbBackend-tests.ts new file mode 100644 index 000000000..ee3957de8 --- /dev/null +++ b/acl/acl-mongodbBackend-tests.ts @@ -0,0 +1,16 @@ +/// + +// https://github.com/OptimalBits/node_acl/blob/master/Readme.md +import Acl = require('acl'); +import mongodb = require('mongodb'); + +var db: mongodb.Db; + +// Using the memory backend +var acl = new Acl(new Acl.mongodbBackend(db, 'acl_', true)); + +// guest is allowed to view blogs +acl.allow('guest', 'blogs', 'view'); + +// allow function accepts arrays as any parameter +acl.allow('member', 'blogs', ['edit','view', 'delete']); diff --git a/acl/acl-redisBackend-test.ts b/acl/acl-redisBackend-test.ts new file mode 100644 index 000000000..4d1552b04 --- /dev/null +++ b/acl/acl-redisBackend-test.ts @@ -0,0 +1,16 @@ +/// + +// https://github.com/OptimalBits/node_acl/blob/master/Readme.md +import Acl = require('acl'); +import redis = require('redis'); + +var client: redis.RedisClient; + +// Using the memory backend +var acl = new Acl(new Acl.redisBackend(client, 'acl_')); + +// guest is allowed to view blogs +acl.allow('guest', 'blogs', 'view'); + +// allow function accepts arrays as any parameter +acl.allow('member', 'blogs', ['edit','view', 'delete']); diff --git a/acl/acl-redisBackend.d.ts b/acl/acl-redisBackend.d.ts new file mode 100644 index 000000000..e199f8b81 --- /dev/null +++ b/acl/acl-redisBackend.d.ts @@ -0,0 +1,21 @@ +// Type definitions for node_acl 0.4.7 +// Project: https://github.com/optimalbits/node_acl +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "acl" { + import redis = require('redis'); + + interface AclStatic { + redisBackend: RedisBackendStatic; + } + + interface RedisBackend extends Backend { } + interface RedisBackendStatic { + new(redis: redis.RedisClient, prefix: string): RedisBackend; + new(redis: redis.RedisClient): RedisBackend; + } +} diff --git a/acl/acl-tests.ts b/acl/acl-tests.ts new file mode 100644 index 000000000..551ad9c1c --- /dev/null +++ b/acl/acl-tests.ts @@ -0,0 +1,65 @@ +/// + +// Sample code from +// https://github.com/OptimalBits/node_acl/blob/master/Readme.md +import Acl = require('acl'); + +var report = (err: Error, value: T) => { + if (err) { + console.error(err); + } + console.info(value); +}; + +// Using the memory backend +var acl = new Acl(new Acl.memoryBackend()); + +// guest is allowed to view blogs +acl.allow('guest', 'blogs', 'view'); + +// allow function accepts arrays as any parameter +acl.allow('member', 'blogs', ['edit','view', 'delete']); + +acl.addUserRoles('joed', 'guest'); + +acl.addRoleParents('baz', ['foo','bar']); + +acl.allow('foo', ['blogs','forums','news'], ['view', 'delete']); + +acl.allow('admin', ['blogs','forums'], '*'); + +acl.allow([ + { + roles:['guest','special-member'], + allows:[ + {resources:'blogs', permissions:'get'}, + {resources:['forums','news'], permissions:['get','put','delete']} + ] + }, + { + roles:['gold','silver'], + allows:[ + {resources:'cash', permissions:['sell','exchange']}, + {resources:['account','deposit'], permissions:['put','delete']} + ] + } +]); + +acl.isAllowed('joed', 'blogs', 'view', (err, res) => { + if (res) { + console.log("User joed is allowed to view blogs"); + } +}); + +acl.isAllowed('jsmith', 'blogs', ['edit','view','delete']) +.then((result) => { + console.dir('jsmith is allowed blogs ' + result); + acl.addUserRoles('jsmith', 'member'); +}).then(() => + acl.isAllowed('jsmith', 'blogs', ['edit','view','delete']) +).then((result) => + console.dir('jsmith is allowed blogs ' + result) +).then(() => { + acl.allowedPermissions('james', ['blogs','forums'], report); + acl.allowedPermissions('jsmith', ['blogs','forums'], report); +}); diff --git a/acl/acl.d.ts b/acl/acl.d.ts new file mode 100644 index 000000000..f98bcb1ae --- /dev/null +++ b/acl/acl.d.ts @@ -0,0 +1,117 @@ +// Type definitions for node_acl 0.4.7 +// Project: https://github.com/optimalbits/node_acl +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "acl" { + import http = require('http'); + import Promise = require("bluebird"); + + type Func = ()=>any; + type Value = string|number; + type Values = Value|Value[]; + type strings = string|string[]; + type ErrCallback = (err: Error) => any; + type AnyCallback = (err: Error, obj: any) => any; + type AllowedCallback = (err: Error, allowed: boolean) => any; + type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => any; + + interface AclStatic { + new (backend: Backend, logger: Logger, options: Option): Acl; + new (backend: Backend, logger: Logger): Acl; + new (backend: Backend): Acl; + memoryBackend: MemoryBackendStatic; + } + + interface Logger { + debug: (msg: string)=>any; + } + + interface Acl { + addUserRoles: (userId: Value, roles: strings, cb?: ErrCallback) => Promise; + removeUserRoles: (userId: Value, roles: strings, cb?: ErrCallback) => Promise; + userRoles: (userId: Value, cb?: (err: Error, roles: string[])=>any) => Promise; + roleUsers: (role: Value, cb?: (err: Error, users: Values)=>any) => Promise; + hasRole: (userId: Value, role: string, cb?: (err: Error, isInRole: boolean)=>any) => Promise; + addRoleParents: (role: string, parents: Values, cb?: ErrCallback) => Promise; + removeRole: (role: string, cb?: ErrCallback) => Promise; + removeResource: (resource: string, cb?: ErrCallback) => Promise; + allow: { + (roles: Values, resources: strings, permissions: strings, cb?: ErrCallback): Promise; + (aclSets: AclSet|AclSet[]): Promise; + } + removeAllow: (role: string, resources: strings, permissions: strings, cb?: ErrCallback) => Promise; + removePermissions: (role: string, resources: strings, permissions: strings, cb?: Function) => Promise; + allowedPermissions: (userId: Value, resources: strings, cb?: AnyCallback) => Promise; + isAllowed: (userId: Value, resources: strings, permissions: strings, cb?: AllowedCallback) => Promise; + areAnyRolesAllowed: (roles: strings, resource: strings, permissions: strings, cb?: AllowedCallback) => Promise; + whatResources: (roles: strings, permissions: strings, cb?: AnyCallback) => Promise; + permittedResources: (roles: strings, permissions: strings, cb?: Function) => Promise; + middleware: (numPathComponents: number, userId: Value|GetUserId, actions: strings) => Promise; + } + + interface Option { + buckets?: BucketsOption; + } + + interface BucketsOption { + meta?: string; + parents?: string; + permissions?: string; + resources?: string; + roles?: string; + users?: string; + } + + interface AclSet { + roles: strings; + allows: AclAllow[]; + } + + interface AclAllow { + resources: strings; + permissions: strings; + } + + interface Backend { + begin: () => T; + end: (transaction: T, cb?: Func) => void; + clean: (cb?: Func) => void; + get: (bucket: string, key: Value, cb?: Func) => void; + union: (bucket: string, keys: Value[], cb?: Func) => void; + add: (transaction: T, bucket: string, key: Value, values: Value|Value[]) => void; + del: (transaction: T, bucket: string, keys: Value[]) => void; + remove: (transaction: T, bucket: string, key: Value, values: Value|Value[]) => void; + + endAsync: Function; //TODO: Give more specific function signature + getAsync: Function; + cleanAsync: Function; + unionAsync: Function; + } + + interface MemoryBackend extends Backend { } + interface MemoryBackendStatic { + new(): MemoryBackend; + } + + interface Contract { + (args: IArguments): Contract|NoOp; + debug: boolean; + fulfilled: boolean; + args: any[]; + checkedParams: string[]; + params: (...types: string[]) => Contract|NoOp; + end: () => void; + } + + interface NoOp { + params: (...types: string[]) => NoOp; + end: () => void; + } + + var _: AclStatic; + export = _; +} From f3682e195f6762a7589bbb02652f983c3888d4c3 Mon Sep 17 00:00:00 2001 From: A12893 Date: Fri, 13 Mar 2015 02:02:19 +0900 Subject: [PATCH 063/243] Fix comment --- acl/acl-mongodbBackend-tests.ts | 2 +- acl/{acl-mongoDBBackend.d.ts => acl-mongodbBackend.d.ts} | 0 acl/acl-redisBackend-test.ts | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename acl/{acl-mongoDBBackend.d.ts => acl-mongodbBackend.d.ts} (100%) diff --git a/acl/acl-mongodbBackend-tests.ts b/acl/acl-mongodbBackend-tests.ts index ee3957de8..080bfbf42 100644 --- a/acl/acl-mongodbBackend-tests.ts +++ b/acl/acl-mongodbBackend-tests.ts @@ -6,7 +6,7 @@ import mongodb = require('mongodb'); var db: mongodb.Db; -// Using the memory backend +// Using the mongo db backend var acl = new Acl(new Acl.mongodbBackend(db, 'acl_', true)); // guest is allowed to view blogs diff --git a/acl/acl-mongoDBBackend.d.ts b/acl/acl-mongodbBackend.d.ts similarity index 100% rename from acl/acl-mongoDBBackend.d.ts rename to acl/acl-mongodbBackend.d.ts diff --git a/acl/acl-redisBackend-test.ts b/acl/acl-redisBackend-test.ts index 4d1552b04..ce1036528 100644 --- a/acl/acl-redisBackend-test.ts +++ b/acl/acl-redisBackend-test.ts @@ -6,7 +6,7 @@ import redis = require('redis'); var client: redis.RedisClient; -// Using the memory backend +// Using the redis backend var acl = new Acl(new Acl.redisBackend(client, 'acl_')); // guest is allowed to view blogs From 985397ab73833ed0ba3638c4a473bf1fab62224a Mon Sep 17 00:00:00 2001 From: A12893 Date: Fri, 13 Mar 2015 03:18:04 +0900 Subject: [PATCH 064/243] Rename things --- acl/acl-mongodbBackend-tests.ts | 1 + acl/acl-mongodbBackend.d.ts | 2 +- acl/acl-redisBackend-test.ts | 2 +- acl/acl.d.ts | 47 ++++++++++++++++++--------------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/acl/acl-mongodbBackend-tests.ts b/acl/acl-mongodbBackend-tests.ts index 080bfbf42..31411b65c 100644 --- a/acl/acl-mongodbBackend-tests.ts +++ b/acl/acl-mongodbBackend-tests.ts @@ -14,3 +14,4 @@ acl.allow('guest', 'blogs', 'view'); // allow function accepts arrays as any parameter acl.allow('member', 'blogs', ['edit','view', 'delete']); + diff --git a/acl/acl-mongodbBackend.d.ts b/acl/acl-mongodbBackend.d.ts index 48fe6f135..8dbfb7e90 100644 --- a/acl/acl-mongodbBackend.d.ts +++ b/acl/acl-mongodbBackend.d.ts @@ -13,7 +13,7 @@ declare module "acl" { mongodbBackend: MongodbBackendStatic; } - interface MongodbBackend extends Backend { } + interface MongodbBackend extends Backend { } interface MongodbBackendStatic { new(db: mongo.Db, prefix: string, useSingle: boolean): MongodbBackend; new(db: mongo.Db, prefix: string): MongodbBackend; diff --git a/acl/acl-redisBackend-test.ts b/acl/acl-redisBackend-test.ts index ce1036528..e1bf29af4 100644 --- a/acl/acl-redisBackend-test.ts +++ b/acl/acl-redisBackend-test.ts @@ -1,4 +1,4 @@ -/// +/// // https://github.com/OptimalBits/node_acl/blob/master/Readme.md import Acl = require('acl'); diff --git a/acl/acl.d.ts b/acl/acl.d.ts index f98bcb1ae..5d0498fed 100644 --- a/acl/acl.d.ts +++ b/acl/acl.d.ts @@ -10,14 +10,14 @@ declare module "acl" { import http = require('http'); import Promise = require("bluebird"); - type Func = ()=>any; + type strings = string|string[]; type Value = string|number; type Values = Value|Value[]; - type strings = string|string[]; - type ErrCallback = (err: Error) => any; + type Action = () => any; + type Callback = (err: Error) => any; type AnyCallback = (err: Error, obj: any) => any; type AllowedCallback = (err: Error, allowed: boolean) => any; - type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => any; + type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => Value; interface AclStatic { new (backend: Backend, logger: Logger, options: Option): Acl; @@ -31,19 +31,19 @@ declare module "acl" { } interface Acl { - addUserRoles: (userId: Value, roles: strings, cb?: ErrCallback) => Promise; - removeUserRoles: (userId: Value, roles: strings, cb?: ErrCallback) => Promise; + addUserRoles: (userId: Value, roles: strings, cb?: Callback) => Promise; + removeUserRoles: (userId: Value, roles: strings, cb?: Callback) => Promise; userRoles: (userId: Value, cb?: (err: Error, roles: string[])=>any) => Promise; roleUsers: (role: Value, cb?: (err: Error, users: Values)=>any) => Promise; hasRole: (userId: Value, role: string, cb?: (err: Error, isInRole: boolean)=>any) => Promise; - addRoleParents: (role: string, parents: Values, cb?: ErrCallback) => Promise; - removeRole: (role: string, cb?: ErrCallback) => Promise; - removeResource: (resource: string, cb?: ErrCallback) => Promise; + addRoleParents: (role: string, parents: Values, cb?: Callback) => Promise; + removeRole: (role: string, cb?: Callback) => Promise; + removeResource: (resource: string, cb?: Callback) => Promise; allow: { - (roles: Values, resources: strings, permissions: strings, cb?: ErrCallback): Promise; + (roles: Values, resources: strings, permissions: strings, cb?: Callback): Promise; (aclSets: AclSet|AclSet[]): Promise; } - removeAllow: (role: string, resources: strings, permissions: strings, cb?: ErrCallback) => Promise; + removeAllow: (role: string, resources: strings, permissions: strings, cb?: Callback) => Promise; removePermissions: (role: string, resources: strings, permissions: strings, cb?: Function) => Promise; allowedPermissions: (userId: Value, resources: strings, cb?: AnyCallback) => Promise; isAllowed: (userId: Value, resources: strings, permissions: strings, cb?: AllowedCallback) => Promise; @@ -76,15 +76,23 @@ declare module "acl" { permissions: strings; } + interface MemoryBackend extends Backend { } + interface MemoryBackendStatic { + new(): MemoryBackend; + } + + // + // For internal use + // interface Backend { begin: () => T; - end: (transaction: T, cb?: Func) => void; - clean: (cb?: Func) => void; - get: (bucket: string, key: Value, cb?: Func) => void; - union: (bucket: string, keys: Value[], cb?: Func) => void; - add: (transaction: T, bucket: string, key: Value, values: Value|Value[]) => void; + end: (transaction: T, cb?: Action) => void; + clean: (cb?: Action) => void; + get: (bucket: string, key: Value, cb?: Action) => void; + union: (bucket: string, keys: Value[], cb?: Action) => void; + add: (transaction: T, bucket: string, key: Value, values: Values) => void; del: (transaction: T, bucket: string, keys: Value[]) => void; - remove: (transaction: T, bucket: string, key: Value, values: Value|Value[]) => void; + remove: (transaction: T, bucket: string, key: Value, values: Values) => void; endAsync: Function; //TODO: Give more specific function signature getAsync: Function; @@ -92,11 +100,6 @@ declare module "acl" { unionAsync: Function; } - interface MemoryBackend extends Backend { } - interface MemoryBackendStatic { - new(): MemoryBackend; - } - interface Contract { (args: IArguments): Contract|NoOp; debug: boolean; From 1de4b68f69a5c6a38c25a9abb06b50837f22ed64 Mon Sep 17 00:00:00 2001 From: Daniel Imrie-Situnayake Date: Thu, 12 Mar 2015 12:04:46 -0700 Subject: [PATCH 065/243] Added definitions for kafka-node library --- kafka-node/kafka-node-test.ts | 157 ++++++++++++++++++++++++++++++++++ kafka-node/kafka-node.d.ts | 123 ++++++++++++++++++++++++++ 2 files changed, 280 insertions(+) create mode 100644 kafka-node/kafka-node-test.ts create mode 100644 kafka-node/kafka-node.d.ts diff --git a/kafka-node/kafka-node-test.ts b/kafka-node/kafka-node-test.ts new file mode 100644 index 000000000..607ad5c19 --- /dev/null +++ b/kafka-node/kafka-node-test.ts @@ -0,0 +1,157 @@ +/// + +import kafka = require('kafka-node'); + +var basicClient = new kafka.Client('localhost:2181/', 'sendMessage'); + +var optionsClient = new kafka.Client('localhost:2181/', 'sendMessage', { + sessionTimeout: 30000, + spinDelay: 1000, + retries: 0 +}); +optionsClient.close(); +optionsClient.close(function(){}); + +var producer = new kafka.Producer(basicClient); +producer.on('error', function(error: Error){}); +producer.on('ready', function(){ + + var messages = [{ + topic: 'topicName', + messages: ['message body'], + partition: 0, + attributes: 2 + }, { + topic: 'topicName', + messages: ['message body'], + partition: 0 + }, { + topic: 'topicName', + messages: ['message body'], + attributes: 0 + }, { + topic: 'topicName', + messages: ['message body'] + }, { + topic: 'topicName', + messages: [new kafka.KeyedMessage('key', 'message')] + }]; + + producer.send(messages, function(err: Error){}); + producer.send(messages, function(err: Error, data: Object){}); + + producer.createTopics(['t'], true, function (err: Error, data: Object) {}); + producer.createTopics(['t'], false, function (err, data) {}); + // producer.createTopics(['t'], function (err: Error, data: Object) {}); // Omitting middle argument is not possible in TS + +}); + +var highLevelProducer = new kafka.HighLevelProducer(basicClient); +highLevelProducer.on('error', function(error: Error){}); +highLevelProducer.on('ready', function(){ + + var messages = [{ + topic: 'topicName', + messages: ['message body'], + attributes: 2 + }, { + topic: 'topicName', + messages: ['message body'], + partition: 0 + }, { + topic: 'topicName', + messages: ['message body'], + attributes: 0 + }, { + topic: 'topicName', + messages: ['message body'] + }, { + topic: 'topicName', + messages: [new kafka.KeyedMessage('key', 'message')] + }]; + + producer.send(messages, function(err: Error){}); + producer.send(messages, function(err: Error, data: Object){}); + + producer.createTopics(['t'], true, function (err: Error, data: Object) {}); + producer.createTopics(['t'], false, function (err, data) {}); + // producer.createTopics(['t'], function (err: Error, data: Object) {}); // Omitting middle argument is not possible in TS + +}); + +var fetchRequests = [{ topic: 'awesome' }]; +var consumer = new kafka.Consumer(basicClient, fetchRequests, { + groupId: 'abcde', + autoCommit: true +}); +consumer.on('error', function(error: Error){}); +consumer.on('message', function(message){}); + +consumer.addTopics(['t1', 't2'], function (err, added) {}); +consumer.addTopics([{ topic: 't1', offset: 10 }], function (err, added) {}, true); + +consumer.removeTopics(['t1', 't2'], function (err, removed) {}); + +consumer.commit(function (err, data) {}); + +consumer.setOffset('topic', 0, 0); + +consumer.pause(); +consumer.resume(); +consumer.pauseTopics([ + 'topic1', + { topic: 'topic2', partition: 0 } +]); +consumer.resumeTopics([ + 'topic1', + { topic: 'topic2', partition: 0 } +]); + +consumer.close(true, function () {}); + +var fetchRequests = [{ topic: 'awesome' }]; +var hlConsumer = new kafka.HighLevelConsumer(basicClient, fetchRequests, { + groupId: 'abcde', + autoCommit: true +}); + +hlConsumer.on('error', function(error: Error){}); +hlConsumer.on('message', function(message){}); +hlConsumer.addTopics(['t1', 't2'], function (err, added) {}); +hlConsumer.addTopics([{ topic: 't1', offset: 10 }], function (err, added) {}, true); + +hlConsumer.removeTopics(['t1', 't2'], function (err, removed) {}); + +hlConsumer.commit(function (err, data) {}); + +hlConsumer.setOffset('topic', 0, 0); + +hlConsumer.pause(); +hlConsumer.resume(); +hlConsumer.pauseTopics([ + 'topic1', + { topic: 'topic2', partition: 0 } +]); +hlConsumer.resumeTopics([ + 'topic1', + { topic: 'topic2', partition: 0 } +]); + +hlConsumer.close(true, function () {}); + +var offset = new kafka.Offset(basicClient); + +offset.on('ready', function(){}); + +offset.fetch([ + { topic: 't', partition: 0, time: Date.now(), maxNum: 1 }, + { topic: 't' } +], function (err, data) { }); + +offset.commit('groupId', [ + { topic: 't', partition: 0, offset: 10 } +], function (err, data) { }); + +offset.fetchCommits('groupId', [ + { topic: 't', partition: 0 } +], function (err, data) {}); diff --git a/kafka-node/kafka-node.d.ts b/kafka-node/kafka-node.d.ts new file mode 100644 index 000000000..b90a42a75 --- /dev/null +++ b/kafka-node/kafka-node.d.ts @@ -0,0 +1,123 @@ +// Type definitions for kafka-node 0.2.22 +// Project: https://github.com/SOHU-Co/kafka-node/ +// Definitions by: Daniel Imrie-Situnayake +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'kafka-node' { + + // # Classes + export class Client { + constructor(connectionString: string, clientId: string, options?: ZKOptions); + close(callback?: Function): void; + } + + export class Producer { + constructor(client: Client); + on(eventName: string, cb: () => any): void; + on(eventName: string, cb: (error: any) => any): void; + send(payloads: Array, cb: (error: any, data: any) => any): void; + createTopics(topics: Array, async: boolean, cb?: (error: any, data: any) => any): void; + } + + export class HighLevelProducer { + constructor(client: Client); + on(eventName: string, cb: () => any): void; + on(eventName: string, cb: (error: any) => any): void; + send(payloads: Array, cb: (error: any, data: any) => any): void; + createTopics(topics: Array, async: boolean, cb?: (error: any, data: any) => any): void; + } + + export class Consumer { + constructor(client: Client, fetchRequests: Array, options: ConsumerOptions); + on(eventName: string, cb: (message: string) => any): void; + on(eventName: string, cb: (error: any) => any): void; + addTopics(topics: Array, cb: (error: any, added: boolean) => any): void; + addTopics(topics: Array, cb: (error: any, added: boolean) => any, fromOffset: boolean): void; + removeTopics(topics: Array, cb: (error: any, removed: boolean) => any): void; + commit(cb: (error: any, data: any) => any): void; + setOffset(topic: string, partition: number, offset: number): void; + pause(): void; + resume(): void; + pauseTopics(topics: Array /* Array */): void; + resumeTopics(topics: Array /* Array */): void; + close(force: boolean, cb: () => any): void; + } + + export class HighLevelConsumer { + constructor(client: Client, payloads: Array, options: ConsumerOptions); + on(eventName: string, cb: (message: string) => any): void; + on(eventName: string, cb: (error: any) => any): void; + addTopics(topics: Array, cb: (error: any, added: boolean) => any): void; + addTopics(topics: Array, cb: (error: any, added: boolean) => any, fromOffset: boolean): void; + removeTopics(topics: Array, cb: (error: any, removed: boolean) => any): void; + commit(cb: (error: any, data: any) => any): void; + setOffset(topic: string, partition: number, offset: number): void; + pause(): void; + resume(): void; + pauseTopics(topics: Array /* Array */): void; + resumeTopics(topics: Array /* Array */): void; + close(force: boolean, cb: () => any): void; + } + + export class Offset { + constructor(client: Client); + on(eventName: string, cb: () => any): void; + fetch(payloads: Array, cb: (error: any, data: any) => any): void; + commit(groupId: string, payloads: Array, cb: (error: any, data: any) => any): void; + fetchCommits(groupId: string, payloads: Array, cb: (error: any, data: any) => any): void; + } + + export class KeyedMessage { + constructor(key: string, message: string); + } + + // # Interfaces + export interface ZKOptions { + sessionTimeout?: number; + spinDelay?: number; + retries?: number; + } + + export interface ProduceRequest { + topic: string; + messages: any; // Array | Array | string | KeyedMessage + partition?: number; + attributes?: number; + } + + export interface ConsumerOptions { + groupId: string; + autoCommit: boolean; + autoCommitIntervalMs?: number; + fetchMaxWaitMs?: number; + fetchMinBytes?: number; + fetchMaxBytes?: number; + fromOffset?: boolean; + encoding?: string; + } + + export interface Topic { + topic: string; + offset?: number; + } + + export interface OffsetRequest { + topic: string; + partition?: number; + time?: number; + maxNum?: number; + } + + export interface OffsetCommitRequest { + topic: string; + partition?: number; + offset: number; + metadata?: string; + } + + export interface OffsetFetchRequest { + topic: string; + partition?: number; + } + +} From c3a4cd26a4060fdb4f05c57ed1c5fedc42d582c3 Mon Sep 17 00:00:00 2001 From: Daniel Imrie-Situnayake Date: Thu, 12 Mar 2015 13:03:45 -0700 Subject: [PATCH 066/243] Optional properties --- kafka-node/kafka-node.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kafka-node/kafka-node.d.ts b/kafka-node/kafka-node.d.ts index b90a42a75..03105805a 100644 --- a/kafka-node/kafka-node.d.ts +++ b/kafka-node/kafka-node.d.ts @@ -86,8 +86,8 @@ declare module 'kafka-node' { } export interface ConsumerOptions { - groupId: string; - autoCommit: boolean; + groupId?: string; + autoCommit?: boolean; autoCommitIntervalMs?: number; fetchMaxWaitMs?: number; fetchMinBytes?: number; From d02ffa17b34cb4ebbd7bc073fe7a711db0d5e0e6 Mon Sep 17 00:00:00 2001 From: Arnaud Rebts Date: Fri, 13 Mar 2015 12:54:54 +0100 Subject: [PATCH 067/243] Added all methods from Boom library --- boom/boom.d.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/boom/boom.d.ts b/boom/boom.d.ts index 3a3f18fa2..d0f05065c 100644 --- a/boom/boom.d.ts +++ b/boom/boom.d.ts @@ -24,7 +24,33 @@ declare module Boom { export function wrap(error: Error, statusCode?: number, message?: string): BoomError; export function create(statusCode: number, message?: string, data?: any): BoomError; + // 4xx export function badRequest(message?: string, data?: any): BoomError; + export function unauthorized(message?: string, scheme?: any, attributes?: any): BoomError; + export function forbidden(message?: string, data?: any): BoomError; + export function notFound(message?: string, data?: any): BoomError; + export function methodNotAllowed(message?: string, data?: any): BoomError; + export function notAcceptable(message?: string, data?: any): BoomError; + export function proxyAuthRequired(message?: string, data?: any): BoomError; + export function clientTimeout(message?: string, data?: any): BoomError; + export function conflict(message?: string, data?: any): BoomError; + export function resourceGone(message?: string, data?: any): BoomError; + export function lengthRequired(message?: string, data?: any): BoomError; + export function preconditionFailed(message?: string, data?: any): BoomError; + export function entityTooLarge(message?: string, data?: any): BoomError; + export function uriTooLong(message?: string, data?: any): BoomError; + export function unsupportedMediaType(message?: string, data?: any): BoomError; + export function rangeNotSatisfiable(message?: string, data?: any): BoomError; + export function expectationFailed(message?: string, data?: any): BoomError; + export function badData(message?: string, data?: any): BoomError; + export function tooManyRequests(message?: string, data?: any): BoomError; + + // 5xx + export function notImplemented(message?: string, data?: any): BoomError; + export function badGateway(message?: string, data?: any): BoomError; + export function serverTimeout(message?: string, data?: any): BoomError; + export function gatewayTimeout(message?: string, data?: any): BoomError; + export function badImplementation(message?: string, data?: any): BoomError; } declare module "boom" { From 2a5047b298176cf931da0111bd0af12d6df3c00a Mon Sep 17 00:00:00 2001 From: Eric Lu Date: Fri, 13 Mar 2015 10:22:56 -0700 Subject: [PATCH 068/243] Expose execFileSync in node typing --- node/node.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 0ca514e9e..999ca9a0a 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -697,6 +697,18 @@ declare module "child_process" { killSignal?: string; encoding?: string; }): ChildProcess; + export function execFileSync(command: string, args?: string[], options?: { + cwd?: string; + input?: string|Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + encoding?: string; + }): ChildProcess; } declare module "url" { From d2056f5068ef8ea4b7e1c96ac6a987d5b97f93a8 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Sat, 14 Mar 2015 10:26:34 +1100 Subject: [PATCH 069/243] crossroads : support amd/commonjs --- crossroads/crossroads.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crossroads/crossroads.d.ts b/crossroads/crossroads.d.ts index e86e3154d..1ef15aba7 100644 --- a/crossroads/crossroads.d.ts +++ b/crossroads/crossroads.d.ts @@ -153,3 +153,7 @@ declare module CrossroadsJs { } declare var crossroads: CrossroadsJs.CrossRoadsStatic; + +declare module 'crossroads'{ + export = crossroads; +} From 8e4444c7402782227cbe2e4b643607c0d50b1bb0 Mon Sep 17 00:00:00 2001 From: progre Date: Sat, 14 Mar 2015 12:01:00 +0900 Subject: [PATCH 070/243] add Reporter definition --- gulp-typescript/gulp-typescript-tests.ts | 7 ++++++- gulp-typescript/gulp-typescript.d.ts | 12 +++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gulp-typescript/gulp-typescript-tests.ts b/gulp-typescript/gulp-typescript-tests.ts index 29baf2ad2..1dd2fbb37 100644 --- a/gulp-typescript/gulp-typescript-tests.ts +++ b/gulp-typescript/gulp-typescript-tests.ts @@ -37,4 +37,9 @@ gulp.task('scripts', function() { }); gulp.task('watch', ['scripts'], function() { gulp.watch('lib/*.ts', ['scripts']); -}); \ No newline at end of file +}); + +gulp.task('scripts', function () { + return gulp.src('lib/*.ts') + .pipe(typescript(tsProject, undefined, typescript.reporter.fullReporter())); +}); diff --git a/gulp-typescript/gulp-typescript.d.ts b/gulp-typescript/gulp-typescript.d.ts index bffc6acfe..2eb3c3282 100644 --- a/gulp-typescript/gulp-typescript.d.ts +++ b/gulp-typescript/gulp-typescript.d.ts @@ -6,7 +6,7 @@ /// declare module "gulp-typescript" { - function GulpTypescript(params: GulpTypescript.Params, filters?: GulpTypescript.FilterSettings): GulpTypescript.CompilationStream; + function GulpTypescript(params: GulpTypescript.Params, filters?: GulpTypescript.FilterSettings, reporter?: GulpTypescript.Reporter): GulpTypescript.CompilationStream; module GulpTypescript { export function createProject(params: Params): Params; @@ -28,10 +28,20 @@ declare module "gulp-typescript" { referencedFrom?: string[]; } + interface Reporter { + error(error: any): void; + } + interface CompilationStream extends NodeJS.ReadWriteStream { dts: NodeJS.ReadWriteStream; js: NodeJS.ReadWriteStream; } + + module reporter { + function nullReporter(): Reporter; + function defaultReporter(): Reporter; + function fullReporter(showFullFilename?: boolean): Reporter; + } } export = GulpTypescript; From 39fbc1e313bee6bfd01b13873fca7492a335e731 Mon Sep 17 00:00:00 2001 From: progre Date: Sat, 14 Mar 2015 13:11:57 +0900 Subject: [PATCH 071/243] enable options with custom reporter --- gulp-tslint/gulp-tslint-tests.ts | 6 ++++++ gulp-tslint/gulp-tslint.d.ts | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gulp-tslint/gulp-tslint-tests.ts b/gulp-tslint/gulp-tslint-tests.ts index 2f12ace8f..fd4b1fe88 100644 --- a/gulp-tslint/gulp-tslint-tests.ts +++ b/gulp-tslint/gulp-tslint-tests.ts @@ -33,6 +33,12 @@ gulp.task('invalid-custom', function(){ .pipe(tslint.report(testReporter)); }); +gulp.task('invalid-custom', function () { + gulp.src('invalid.ts') + .pipe(tslint()) + .pipe(tslint.report(testReporter, { emitError: false })); +}); + gulp.task('tslint-json', function(){ gulp.src('invalid.ts') .pipe(tslint({ diff --git a/gulp-tslint/gulp-tslint.d.ts b/gulp-tslint/gulp-tslint.d.ts index 4ef5f0f8f..99b990277 100644 --- a/gulp-tslint/gulp-tslint.d.ts +++ b/gulp-tslint/gulp-tslint.d.ts @@ -32,10 +32,9 @@ declare module "gulp-tslint" { ruleName: string; } - export function report(reporter?: string): NodeJS.ReadWriteStream; - export function report(reporter: string, options?: Options): NodeJS.ReadWriteStream; + type Reporter = string|((output: Output[], file: vinyl, options: Options) => any); + export function report(reporter?: Reporter, options?: Options): NodeJS.ReadWriteStream; export function report(options?: Options): NodeJS.ReadWriteStream; - export function report(reporter?: (output: Output[], file: vinyl, options: Options) => any): NodeJS.ReadWriteStream; } From 9facd2c541c5e2faf5760e5fa0b5c55a45bc831c Mon Sep 17 00:00:00 2001 From: Ethan Lozano Date: Fri, 13 Mar 2015 23:15:10 -0700 Subject: [PATCH 072/243] Added more overloaded d3.map constructors (issue 3869) --- d3/d3.d.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 2bb239250..d1e69c54c 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -549,10 +549,17 @@ declare module D3 { functor(value: (p : R) => T): (p : R) => T; functor(value: T): (p : any) => T; - map(): Map; - set(): Set; - map(object: {[key: string]: T; }): Map; - set(array: T[]): Set; + map: { + (): Map; + (object: {[key: string]: T; }): Map; + (map: Map): Map; + (array: T[]): Map; + (array: T[], keyFn: (object: T, index?: number) => string): Map; + }; + set: { + (): Set; + (array: T[]): Set; + }; dispatch(...types: string[]): Dispatch; rebind(target: any, source: any, ...names: any[]): any; requote(str: string): string; From 10dffb326a363d46346558420f7956f32587e4d3 Mon Sep 17 00:00:00 2001 From: Ethan Lozano Date: Sat, 14 Mar 2015 00:13:50 -0700 Subject: [PATCH 073/243] Added d3.map tests --- d3/d3-tests.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/d3/d3-tests.ts b/d3/d3-tests.ts index 1a2b5f1c5..51c51f608 100644 --- a/d3/d3-tests.ts +++ b/d3/d3-tests.ts @@ -47,6 +47,37 @@ function testPieChart() { }); } +function testMapConstructor() { + //No arg constructor + var emptyMap: D3.Map = d3.map(); + + //Object constructor + var object:{[key: string]: number } = {a: 1, b: 2, c: 3}; + var objectMap: D3.Map = d3.map(object); + + //Array constructor + var numberArray: number[] = [1, 2, 3] + var numberArrayMap: D3.Map = d3.map(numberArray); + + //Array with keyFn constructor + var objectArray: {key: string}[] = [{key: "v1"}, {key: "v2"}, {key: "v3"}]; + var indexes: number[] = []; + //keyFn with index + var objectArrayMap1: D3.Map<{key: string}> + = d3.map<{key: string}>(objectArray, (o: {key: string}, index: number) => { + indexes.push(index); + return o.key; + }); + //keyFn without index + var objectArrayMap2: D3.Map<{key: string}> + = d3.map<{key: string}>(objectArray, (o: {key: string}) => { + return o.key; + }); + + //Map constructor + var duplicateMap: D3.Map = d3.map(numberArrayMap); +} + //Example from http://bl.ocks.org/3887051 interface GroupedData { State: string; From c281cd0dc41cb98f3c822bfbe2e668a858289ae1 Mon Sep 17 00:00:00 2001 From: AdvancedREI Date: Sat, 14 Mar 2015 09:05:52 -0700 Subject: [PATCH 074/243] Knockout: KnockoutStatic var fix Move KnockoutStatic variable declaration to fix TS1.4 + Resharper 9.1 EAP 6 --- knockout/knockout.d.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 60c81d281..db8ab16ab 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Knockout v3.2.0 +// Type definitions for Knockout v3.2.0 // Project: http://knockoutjs.com // Definitions by: Boris Yankov , Igor Oleinikov , Clément Bourgeois // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -637,12 +637,8 @@ interface KnockoutComponents { getComponentNameForNode(node: Node): string; } - - - +declare var ko: KnockoutStatic; declare module "knockout" { export = ko; -} - -declare var ko: KnockoutStatic; +} \ No newline at end of file From ffedf917dfd05d37b45a07ccaf2eea4488e629c7 Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Sat, 14 Mar 2015 15:27:46 -0700 Subject: [PATCH 075/243] Remove beta and RC2 references from React defs --- react/README.md | 2 +- react/react-addons-global.d.ts | 2 +- react/react-addons.d.ts | 2 +- react/react-global.d.ts | 2 +- react/react.d.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/react/README.md b/react/README.md index 07a203920..0c773fd38 100644 --- a/react/README.md +++ b/react/README.md @@ -1,4 +1,4 @@ -# React v0.13.0-beta Type Definitions +# React v0.13.0 Type Definitions This folder contains the following `.d.ts` files: * `react-0.13.0.d.ts` declares the external module `"react"` diff --git a/react/react-addons-global.d.ts b/react/react-addons-global.d.ts index c50ecdc21..bb0013276 100644 --- a/react/react-addons-global.d.ts +++ b/react/react-addons-global.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ReactWithAddons v0.13.0 RC2 (internal module) +// Type definitions for ReactWithAddons v0.13.0 (internal module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/react/react-addons.d.ts b/react/react-addons.d.ts index 19cf44ed2..be6f1cff0 100644 --- a/react/react-addons.d.ts +++ b/react/react-addons.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ReactWithAddons v0.13.0 RC2 (external module) +// Type definitions for ReactWithAddons v0.13.0 (external module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/react/react-global.d.ts b/react/react-global.d.ts index 268d4bf86..c74e2364a 100644 --- a/react/react-global.d.ts +++ b/react/react-global.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React v0.13.0 RC2 (internal module) +// Type definitions for React v0.13.0 (internal module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/react/react.d.ts b/react/react.d.ts index 114938808..232d75c70 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React v0.13.0 RC2 (external module) +// Type definitions for React v0.13.0 (external module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped From 0213f7c10e966718f4690d2408aeca6753247f09 Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Sat, 14 Mar 2015 15:28:48 -0700 Subject: [PATCH 076/243] Fix state initializers in react-tests.ts (Fixes #3855) --- react/react-addons-tests.ts | 2 +- react/react-tests.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/react/react-addons-tests.ts b/react/react-addons-tests.ts index 9bd3d5505..725edd056 100644 --- a/react/react-addons-tests.ts +++ b/react/react-addons-tests.ts @@ -324,7 +324,7 @@ interface TimerState { secondsElapsed: number; } class Timer extends React.Component, TimerState> { - static state = { + state = { secondsElapsed: 0 } private _interval: number; diff --git a/react/react-tests.ts b/react/react-tests.ts index a9b693cab..c6f186e8b 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -324,7 +324,7 @@ interface TimerState { secondsElapsed: number; } class Timer extends React.Component<{}, TimerState> { - static state = { + state = { secondsElapsed: 0 } private _interval: number; @@ -334,8 +334,7 @@ class Timer extends React.Component<{}, TimerState> { })); } componentDidMount() { - var me = this; - this._interval = setInterval(() => me.tick(), 1000); + this._interval = setInterval(() => this.tick(), 1000); } componentWillUnmount() { clearInterval(this._interval); From d3584fa71661cfb0b320646af621c74db5706f81 Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Sat, 14 Mar 2015 15:29:37 -0700 Subject: [PATCH 077/243] Add ReactShallowRenderer types See http://facebook.github.io/react/docs/test-utils.html#shallow-rendering --- react/react-addons-global.d.ts | 8 ++++++++ react/react-addons-tests.ts | 5 +++++ react/react-addons.d.ts | 8 ++++++++ 3 files changed, 21 insertions(+) diff --git a/react/react-addons-global.d.ts b/react/react-addons-global.d.ts index bb0013276..5a6608dbb 100644 --- a/react/react-addons-global.d.ts +++ b/react/react-addons-global.d.ts @@ -179,6 +179,8 @@ declare module React { findRenderedComponentWithType>( tree: Component, type: ComponentClass): C; + + createRenderer(): ShallowRenderer; } interface SyntheticEventData { @@ -255,5 +257,11 @@ declare module React { touchStart: EventSimulator; wheel: EventSimulator; } + + class ShallowRenderer { + getRenderOutput>(): C; + render(element: ReactElement, context?: any): void; + unmount(): void; + } } diff --git a/react/react-addons-tests.ts b/react/react-addons-tests.ts index 725edd056..d53086d69 100644 --- a/react/react-addons-tests.ts +++ b/react/react-addons-tests.ts @@ -387,3 +387,8 @@ React.addons.TestUtils.Simulate.click(node); React.addons.TestUtils.Simulate.change(node); React.addons.TestUtils.Simulate.keyDown(node, { key: "Enter" }); +var renderer: React.ShallowRenderer = + React.addons.TestUtils.createRenderer(); +renderer.render(React.createElement(Timer)); +var output: Timer = renderer.getRenderOutput(); + diff --git a/react/react-addons.d.ts b/react/react-addons.d.ts index be6f1cff0..95bb5ecf5 100644 --- a/react/react-addons.d.ts +++ b/react/react-addons.d.ts @@ -904,6 +904,8 @@ declare module "react/addons" { findRenderedComponentWithType>( tree: Component, type: ComponentClass): C; + + createRenderer(): ShallowRenderer; } interface SyntheticEventData { @@ -981,6 +983,12 @@ declare module "react/addons" { wheel: EventSimulator; } + class ShallowRenderer { + getRenderOutput>(): C; + render(element: ReactElement, context?: any): void; + unmount(): void; + } + // // Browser Interfaces // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts From 424bb99eacf566a103c66e73aeb94aff43a80c1b Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Sat, 14 Mar 2015 16:15:59 -0700 Subject: [PATCH 078/243] Don't use DOM API interfaces for React.SVGAttributes --- react/react-addons-tests.ts | 14 ++++++++++ react/react-addons.d.ts | 51 ++++++++++++++++++++----------------- react/react-global.d.ts | 51 ++++++++++++++++++++----------------- react/react-tests.ts | 15 +++++++++++ react/react.d.ts | 51 ++++++++++++++++++++----------------- 5 files changed, 113 insertions(+), 69 deletions(-) diff --git a/react/react-addons-tests.ts b/react/react-addons-tests.ts index d53086d69..72d6db486 100644 --- a/react/react-addons-tests.ts +++ b/react/react-addons-tests.ts @@ -224,6 +224,20 @@ React.DOM.div(htmlAttr); React.DOM.span(htmlAttr); React.DOM.input(htmlAttr); +React.DOM.svg({ viewBox: "0 0 48 48" }, + React.DOM.rect({ + x: 22, + y: 10, + width: 4, + height: 28 + }), + React.DOM.rect({ + x: 10, + y: 22, + width: 28, + height: 4 + })); + // // React.PropTypes // -------------------------------------------------------------------------- diff --git a/react/react-addons.d.ts b/react/react-addons.d.ts index 95bb5ecf5..c09f5f641 100644 --- a/react/react-addons.d.ts +++ b/react/react-addons.d.ts @@ -368,14 +368,18 @@ declare module "react/addons" { }; } + // This interface is not complete. Only properties accepting + // unitless numbers are listed here (see CSSProperty.js in React) interface CSSProperties { + boxFlex?: number; + boxFlexGroup?: number; columnCount?: number; flex?: number | string; flexGrow?: number; flexShrink?: number; - fontWeight?: number; + fontWeight?: number | string; lineClamp?: number; - lineHeight?: number; + lineHeight?: number | string; opacity?: number; order?: number; orphans?: number; @@ -386,6 +390,7 @@ declare module "react/addons" { // SVG-related properties fillOpacity?: number; strokeOpacity?: number; + strokeWidth?: number; } interface HTMLAttributes extends DOMAttributes { @@ -501,18 +506,18 @@ declare module "react/addons" { interface SVGAttributes extends DOMAttributes { ref?: string | ((component: SVGComponent) => void); - cx?: SVGLength | SVGAnimatedLength; - cy?: any; + cx?: number | string; + cy?: number | string; d?: string; - dx?: SVGLength | SVGAnimatedLength; - dy?: SVGLength | SVGAnimatedLength; - fill?: any; // SVGPaint | string + dx?: number | string; + dy?: number | string; + fill?: string; fillOpacity?: number | string; fontFamily?: string; fontSize?: number | string; - fx?: SVGLength | SVGAnimatedLength; - fy?: SVGLength | SVGAnimatedLength; - gradientTransform?: SVGTransformList | SVGAnimatedTransformList; + fx?: number | string; + fy?: number | string; + gradientTransform?: string; gradientUnits?: string; markerEnd?: string; markerMid?: string; @@ -523,27 +528,27 @@ declare module "react/addons" { patternUnits?: string; points?: string; preserveAspectRatio?: string; - r?: SVGLength | SVGAnimatedLength; - rx?: SVGLength | SVGAnimatedLength; - ry?: SVGLength | SVGAnimatedLength; + r?: number | string; + rx?: number | string; + ry?: number | string; spreadMethod?: string; - stopColor?: any; // SVGColor | string + stopColor?: string; stopOpacity?: number | string; - stroke?: any; // SVGPaint + stroke?: string; strokeDasharray?: string; strokeLinecap?: string; strokeOpacity?: number | string; - strokeWidth?: SVGLength | SVGAnimatedLength; + strokeWidth?: number | string; textAnchor?: string; - transform?: SVGTransformList | SVGAnimatedTransformList; + transform?: string; version?: string; viewBox?: string; - x1?: SVGLength | SVGAnimatedLength; - x2?: SVGLength | SVGAnimatedLength; - x?: SVGLength | SVGAnimatedLength; - y1?: SVGLength | SVGAnimatedLength; - y2?: SVGLength | SVGAnimatedLength - y?: SVGLength | SVGAnimatedLength; + x1?: number | string; + x2?: number | string; + x?: number | string; + y1?: number | string; + y2?: number | string + y?: number | string; } // diff --git a/react/react-global.d.ts b/react/react-global.d.ts index c74e2364a..2b3a58523 100644 --- a/react/react-global.d.ts +++ b/react/react-global.d.ts @@ -368,14 +368,18 @@ declare module React { }; } + // This interface is not complete. Only properties accepting + // unitless numbers are listed here (see CSSProperty.js in React) interface CSSProperties { + boxFlex?: number; + boxFlexGroup?: number; columnCount?: number; flex?: number | string; flexGrow?: number; flexShrink?: number; - fontWeight?: number; + fontWeight?: number | string; lineClamp?: number; - lineHeight?: number; + lineHeight?: number | string; opacity?: number; order?: number; orphans?: number; @@ -386,6 +390,7 @@ declare module React { // SVG-related properties fillOpacity?: number; strokeOpacity?: number; + strokeWidth?: number; } interface HTMLAttributes extends DOMAttributes { @@ -501,18 +506,18 @@ declare module React { interface SVGAttributes extends DOMAttributes { ref?: string | ((component: SVGComponent) => void); - cx?: SVGLength | SVGAnimatedLength; - cy?: any; + cx?: number | string; + cy?: number | string; d?: string; - dx?: SVGLength | SVGAnimatedLength; - dy?: SVGLength | SVGAnimatedLength; - fill?: any; // SVGPaint | string + dx?: number | string; + dy?: number | string; + fill?: string; fillOpacity?: number | string; fontFamily?: string; fontSize?: number | string; - fx?: SVGLength | SVGAnimatedLength; - fy?: SVGLength | SVGAnimatedLength; - gradientTransform?: SVGTransformList | SVGAnimatedTransformList; + fx?: number | string; + fy?: number | string; + gradientTransform?: string; gradientUnits?: string; markerEnd?: string; markerMid?: string; @@ -523,27 +528,27 @@ declare module React { patternUnits?: string; points?: string; preserveAspectRatio?: string; - r?: SVGLength | SVGAnimatedLength; - rx?: SVGLength | SVGAnimatedLength; - ry?: SVGLength | SVGAnimatedLength; + r?: number | string; + rx?: number | string; + ry?: number | string; spreadMethod?: string; - stopColor?: any; // SVGColor | string + stopColor?: string; stopOpacity?: number | string; - stroke?: any; // SVGPaint + stroke?: string; strokeDasharray?: string; strokeLinecap?: string; strokeOpacity?: number | string; - strokeWidth?: SVGLength | SVGAnimatedLength; + strokeWidth?: number | string; textAnchor?: string; - transform?: SVGTransformList | SVGAnimatedTransformList; + transform?: string; version?: string; viewBox?: string; - x1?: SVGLength | SVGAnimatedLength; - x2?: SVGLength | SVGAnimatedLength; - x?: SVGLength | SVGAnimatedLength; - y1?: SVGLength | SVGAnimatedLength; - y2?: SVGLength | SVGAnimatedLength - y?: SVGLength | SVGAnimatedLength; + x1?: number | string; + x2?: number | string; + x?: number | string; + y1?: number | string; + y2?: number | string + y?: number | string; } // diff --git a/react/react-tests.ts b/react/react-tests.ts index c6f186e8b..2802a34cd 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -224,6 +224,21 @@ React.DOM.div(htmlAttr); React.DOM.span(htmlAttr); React.DOM.input(htmlAttr); +React.DOM.svg({ viewBox: "0 0 48 48" }, + React.DOM.rect({ + x: 22, + y: 10, + width: 4, + height: 28 + }), + React.DOM.rect({ + x: 10, + y: 22, + width: 28, + height: 4 + })); + + // // React.PropTypes // -------------------------------------------------------------------------- diff --git a/react/react.d.ts b/react/react.d.ts index 232d75c70..c0d065167 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -368,14 +368,18 @@ declare module "react" { }; } + // This interface is not complete. Only properties accepting + // unitless numbers are listed here (see CSSProperty.js in React) interface CSSProperties { + boxFlex?: number; + boxFlexGroup?: number; columnCount?: number; flex?: number | string; flexGrow?: number; flexShrink?: number; - fontWeight?: number; + fontWeight?: number | string; lineClamp?: number; - lineHeight?: number; + lineHeight?: number | string; opacity?: number; order?: number; orphans?: number; @@ -386,6 +390,7 @@ declare module "react" { // SVG-related properties fillOpacity?: number; strokeOpacity?: number; + strokeWidth?: number; } interface HTMLAttributes extends DOMAttributes { @@ -501,18 +506,18 @@ declare module "react" { interface SVGAttributes extends DOMAttributes { ref?: string | ((component: SVGComponent) => void); - cx?: SVGLength | SVGAnimatedLength; - cy?: any; + cx?: number | string; + cy?: number | string; d?: string; - dx?: SVGLength | SVGAnimatedLength; - dy?: SVGLength | SVGAnimatedLength; - fill?: any; // SVGPaint | string + dx?: number | string; + dy?: number | string; + fill?: string; fillOpacity?: number | string; fontFamily?: string; fontSize?: number | string; - fx?: SVGLength | SVGAnimatedLength; - fy?: SVGLength | SVGAnimatedLength; - gradientTransform?: SVGTransformList | SVGAnimatedTransformList; + fx?: number | string; + fy?: number | string; + gradientTransform?: string; gradientUnits?: string; markerEnd?: string; markerMid?: string; @@ -523,27 +528,27 @@ declare module "react" { patternUnits?: string; points?: string; preserveAspectRatio?: string; - r?: SVGLength | SVGAnimatedLength; - rx?: SVGLength | SVGAnimatedLength; - ry?: SVGLength | SVGAnimatedLength; + r?: number | string; + rx?: number | string; + ry?: number | string; spreadMethod?: string; - stopColor?: any; // SVGColor | string + stopColor?: string; stopOpacity?: number | string; - stroke?: any; // SVGPaint + stroke?: string; strokeDasharray?: string; strokeLinecap?: string; strokeOpacity?: number | string; - strokeWidth?: SVGLength | SVGAnimatedLength; + strokeWidth?: number | string; textAnchor?: string; - transform?: SVGTransformList | SVGAnimatedTransformList; + transform?: string; version?: string; viewBox?: string; - x1?: SVGLength | SVGAnimatedLength; - x2?: SVGLength | SVGAnimatedLength; - x?: SVGLength | SVGAnimatedLength; - y1?: SVGLength | SVGAnimatedLength; - y2?: SVGLength | SVGAnimatedLength - y?: SVGLength | SVGAnimatedLength; + x1?: number | string; + x2?: number | string; + x?: number | string; + y1?: number | string; + y2?: number | string + y?: number | string; } // From c55b94137bd0822aa2d7df0b05290a37371b5d56 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sun, 15 Mar 2015 23:20:17 +0900 Subject: [PATCH 079/243] update CONTRIBUTORS.md --- CONTRIBUTORS.md | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e20e92d9d..0db9eae38 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -13,13 +13,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](amqp-rpc/amqp-rpc.d.ts) [amqp-rpc](https://github.com/demchenkoe/node-amqp-rpc) by [Wonshik Kim](https://github.com/wokim) * [: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-animate.d.ts) [Angular JS (ngAnimate module)](http://angularjs.org) by [Michel Salib](https://github.com/michelsalib), [Adi Dahiya](https://github.com/adidahiya), [Raphael Schweizer](https://github.com/rasch) * [: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-material/angular-material.d.ts) [Angular Material (ng.material module)](https://github.com/angular/material) by [Matt Traynham](https://github.com/mtraynham) * [:link:](angular-protractor/angular-protractor.d.ts) [Angular Protractor](https://github.com/angular/protractor) by [Bill Armstrong](https://github.com/BillArmstrong) * [:link:](angular-scenario/angular-scenario.d.ts) [Angular Scenario Testing (ngScenario module)](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) @@ -31,6 +32,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped) * [:link:](angular-scroll/angular-scroll.d.ts) [angular-scroll](https://github.com/oblador/angular-scroll) by [Sam Herrmann](https://github.com/samherrmann) * [: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-ui/angular-ui-sortable.d.ts) [angular.ui.sortable module](https://github.com/angular-ui/ui-sortable) by [Thodoris Greasidis](https://github.com/thgreasi) * [: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) @@ -39,8 +41,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](polymer/polymer.app-router.d.ts) [app-router](https://github.com/erikringsmuth/app-router) by [Louis Grignon](https://github.com/lgrignon) * [: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:](arcgis-js-api/arcgis-js-api.d.ts) [ArcGIS API for JavaScript](http://js.arcgis.com) by [Esri](http://www.esri.com) * [:link:](archy/archy.d.ts) [archy](https://github.com/substack/node-archy) by [vvakame](https://github.com/vvakame) * [:link:](asciify/asciify.d.ts) [asciify](https://www.npmjs.org/package/asciify) by [Alan Norbauer](http://alan.norbauer.com) * [:link:](aspnet-identity-pw/aspnet-identity-pw.d.ts) [aspnet-identity-pw](https://github.com/Syncbak-Git/aspnet-identity-pw) by [jt000](https://github.com/jt000) @@ -68,6 +72,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bigscreen/bigscreen.d.ts) [BigScreen](http://brad.is/coding/BigScreen) by [Douglas Eichelberger](https://github.com/dduugg) * [:link:](bitwise-xor/bitwise-xor.d.ts) [bitwise-xor](https://github.com/czzarr/node-bitwise-xor) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](bluebird/bluebird.d.ts) [bluebird](https://github.com/petkaantonov/bluebird) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](blueimp-md5/blueimp-md5.d.ts) [blueimp-md5](https://github.com/blueimp/JavaScript-MD5) by [Ray Martone](https://github.com/rmartone) * [: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:](boom/boom.d.ts) [boom](http://github.com/hapijs/boom) by [Igor Rogatty](http://github.com/rogatty) * [:link:](bootbox/bootbox.d.ts) [Bootbox](https://github.com/makeusabrew/bootbox) by [Vincent Bortone](https://github.com/vbortone), [Kon Pik](https://github.com/konpikwastaken) @@ -133,7 +138,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](csurf/csurf.d.ts) [csurf](https://www.npmjs.org/package/csurf) by [Hiroki Horiuchi](https://github.com/horiuchi) -* [:link:](csv-stringify/csv-stringify.d.ts) [csv-stringify](https://github.com/wdavidw/node-csv-stringify) by [rogierschouten](https://github.com/rogierschouten) +* [:link:](csv-stringify/csv-stringify.d.ts) [csv-stringify](https://github.com/wdavidw/node-csv-stringify) by [Rogier Schouten](https://github.com/rogierschouten) * [: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:](d3.cloud.layout/d3.cloud.layout.d.ts) [d3JS cloud layout plugin by Jason Davies](https://github.com/jasondavies/d3-cloud) by [hans windhoff](https://github.com/hansrwindhoff) @@ -196,6 +201,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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-unless/express-unless.d.ts) [express-unless](https://www.npmjs.org/package/express-unless) by [Wonshik Kim](https://github.com/wokim) * [: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:](extend/extend.d.ts) [extend](https://www.npmjs.com/package/extend) by [Stefan Steinhart](https://github.com/reppners) * [: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) @@ -244,8 +250,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:](google.picker/google.picker.d.ts) [Google Picker API](https://developers.google.com/picker) by [grapswiz](https://github.com/grapswiz) * [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73) @@ -258,9 +264,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gsap/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) -* [:link:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com) * [:link:](gulp-autoprefixer/gulp-autoprefixer.d.ts) [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer) by [Asana](https://asana.com) * [:link:](gulp-concat/gulp-concat.d.ts) [gulp-concat](http://github.com/wearefractal/gulp-concat) by [Keita Kagurazaka](https://github.com/k-kagurazaka) @@ -283,7 +289,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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://hammerjs.github.io) by [Philip Bulley](https://github.com/milkisevil), [Han Lin Yap](https://github.com/codler) * [: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:](hapi/hapi.d.ts) [hapi](http://github.com/spumko/hapi) by [Jason Swearingen](http://github.com/jasonswearingen) * [:link:](hashmap/hashmap.d.ts) [HashMap](https://github.com/flesler/hashmap) by [Rafał Wrzeszcz](http://wrzasq.pl) * [:link:](Headroom/headroom.d.ts) [headroom.js](http://wicky.nillia.ms/headroom.js) by [Jakub Olek](https://github.com/hakubo) * [:link:](heatmap.js/heatmap.d.ts) [heatmap.js](https://github.com/pa7/heatmap.js) by [Yang Guan](https://github.com/lookuptable) @@ -306,6 +312,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](imap/imap.d.ts) [imap](https://www.npmjs.com/package/imap) by [Peter Snider](https://github.com/psnider) * [: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:](ini/ini.d.ts) [ini](https://github.com/isaacs/ini) by [Marcin Porębski](https://github.com/marcinporebski) * [: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) @@ -420,11 +427,13 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](jssha/jssha.d.ts) [jsSHA](https://github.com/Caligatio/jsSHA) by [David Li](https://github.com/randombk) * [: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:](jwt-simple/jwt-simple.d.ts) [jwt-simple](https://github.com/hokaccha/node-jwt-simple) by [Ken Fukuyama](https://github.com/kenfdev) +* [:link:](kafka-node/kafka-node.d.ts) [kafka-node](https://github.com/SOHU-Co/kafka-node) by [Daniel Imrie-Situnayake](https://github.com/dansitu) * [: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) @@ -562,6 +571,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](acl/acl-mongodbBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo) +* [:link:](acl/acl.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo) +* [:link:](acl/acl-redisBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo) * [:link:](mdns/mdns.d.ts) [node_mdns](https://github.com/agnat/node_mdns) by [Stefan Steinhart](https://github.com/reppners) * [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov) * [:link:](each/each.d.ts) [NodeEach](http://www.adaltas.com/projects/node-each) by [Michael Zabka](https://github.com/misak113) @@ -606,8 +618,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](platform/platform.d.ts) [Platform](https://github.com/bestiejs/platform.js) by [Jake Hickman](https://github.com/JakeH) * [:link:](playerframework/playerFramework.d.ts) [Player Framework (MMPPF)](https://playerframework.codeplex.com) by [Ricardo Sabino](https://github.com/ricardosabino) * [:link:](pleasejs/please.d.ts) [PleaseJS](http://www.checkman.io/please) by [Toshiya Nakakura](https://github.com/nakakura) +* [:link:](png-async/png-async.d.ts) [png-async](https://github.com/kanreisa/node-png-async) by [Yuki KAN](https://github.com/kanreisa) * [:link:](podcast/podcast.d.ts) [podcast](http://github.com/maxnowack/node-podcast) by [Niklas Mollenhauer](https://github.com/nikeee) * [:link:](poly2tri/poly2tri.d.ts) [poly2tri](http://github.com/r3mi/poly2tri.js) by [Elemar Junior](https://github.com/elemarjr) +* [:link:](polymer/polymer.d.ts) [polymer](https://github.com/polymer) by [Louis Grignon](https://github.com/lgrignon) +* [:link:](polymer/polymer.core-drawer-panel.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-drawer-panel) by [Louis Grignon](https://github.com/lgrignon) +* [:link:](polymer/polymer.paper-toast.d.ts) [polymer's paper-toast](https://github.com/Polymer/paper-toast) by [Louis Grignon](https://github.com/lgrignon) * [: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:](power-assert/power-assert.d.ts) [power-assert](https://github.com/twada/power-assert) by [vvakame](https://github.com/vvakame) @@ -632,8 +648,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall) * [:link:](rappid/rappid.d.ts) [Rappid](http://jointjs.com/about-rappid) by [Ewout Van Gossum](https://github.com/DenEwout) * [: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](http://facebook.github.io/react) by [Asana](https://asana.com) * [:link:](react-router/react-router.d.ts) [React Router](https://github.com/rackt/react-router) by [Yuichi Murata](https://github.com/mrk21) +* [:link:](react/react.d.ts) [React v0.13.0 RC2 (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) +* [:link:](react/react-global.d.ts) [React v0.13.0 RC2 (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) +* [:link:](react/react-addons.d.ts) [ReactWithAddons v0.13.0 RC2 (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) +* [:link:](react/react-addons-global.d.ts) [ReactWithAddons v0.13.0 RC2 (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.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) From 95d860879fb90c405aeb13eea7b8564f9c0df2bf Mon Sep 17 00:00:00 2001 From: vvakame Date: Sun, 15 Mar 2015 23:36:05 +0900 Subject: [PATCH 080/243] remove unused .tscparams --- FileSaver/FileSaver-tests.ts.tscparams | 1 - arcgis-js-api/arcgis-js-api-tests.ts.tscparams | 1 - async/async-explicit-tests.ts.tscparams | 1 - blueimp-md5/blueimp-md5-tests.ts.tscparams | 1 - deployJava/deployJava-tests.ts.tscparams | 1 - ember/ember-tests.ts.tscparams | 1 - ember/ember.d.ts.tscparams | 1 - flot/jquery.flot.d.ts.tscparams | 1 - java-applet/java-applet-tests.ts.tscparams | 1 - jointjs/jointjs.d.ts.tscparams | 1 - jqgrid/jqgrid.d.ts.tscparams | 1 - js-signals/js-signals.d.ts.tscparams | 1 - maskedinput/maskedinput.d.ts.tscparams | 1 - page/page-tests.ts.tscparams | 1 - urijs/URI.d.ts.tscparams | 1 - 15 files changed, 15 deletions(-) delete mode 100644 FileSaver/FileSaver-tests.ts.tscparams delete mode 100644 arcgis-js-api/arcgis-js-api-tests.ts.tscparams delete mode 100644 async/async-explicit-tests.ts.tscparams delete mode 100644 blueimp-md5/blueimp-md5-tests.ts.tscparams delete mode 100644 deployJava/deployJava-tests.ts.tscparams delete mode 100644 ember/ember-tests.ts.tscparams delete mode 100644 ember/ember.d.ts.tscparams delete mode 100644 flot/jquery.flot.d.ts.tscparams delete mode 100644 java-applet/java-applet-tests.ts.tscparams delete mode 100644 jointjs/jointjs.d.ts.tscparams delete mode 100644 jqgrid/jqgrid.d.ts.tscparams delete mode 100644 js-signals/js-signals.d.ts.tscparams delete mode 100644 maskedinput/maskedinput.d.ts.tscparams delete mode 100644 page/page-tests.ts.tscparams delete mode 100644 urijs/URI.d.ts.tscparams diff --git a/FileSaver/FileSaver-tests.ts.tscparams b/FileSaver/FileSaver-tests.ts.tscparams deleted file mode 100644 index 934bc29ef..000000000 --- a/FileSaver/FileSaver-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ ---noImplicitAny \ No newline at end of file diff --git a/arcgis-js-api/arcgis-js-api-tests.ts.tscparams b/arcgis-js-api/arcgis-js-api-tests.ts.tscparams deleted file mode 100644 index 51cd5f144..000000000 --- a/arcgis-js-api/arcgis-js-api-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ ---noImplicitAny --module amd \ No newline at end of file diff --git a/async/async-explicit-tests.ts.tscparams b/async/async-explicit-tests.ts.tscparams deleted file mode 100644 index 3195c46cd..000000000 --- a/async/async-explicit-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ ---noImplicitAny diff --git a/blueimp-md5/blueimp-md5-tests.ts.tscparams b/blueimp-md5/blueimp-md5-tests.ts.tscparams deleted file mode 100644 index 85542607d..000000000 --- a/blueimp-md5/blueimp-md5-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ ---noImplicitAny --module commonjs diff --git a/deployJava/deployJava-tests.ts.tscparams b/deployJava/deployJava-tests.ts.tscparams deleted file mode 100644 index 934bc29ef..000000000 --- a/deployJava/deployJava-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ ---noImplicitAny \ No newline at end of file diff --git a/ember/ember-tests.ts.tscparams b/ember/ember-tests.ts.tscparams deleted file mode 100644 index d3f5a12fa..000000000 --- a/ember/ember-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ember/ember.d.ts.tscparams b/ember/ember.d.ts.tscparams deleted file mode 100644 index d3f5a12fa..000000000 --- a/ember/ember.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/flot/jquery.flot.d.ts.tscparams b/flot/jquery.flot.d.ts.tscparams deleted file mode 100644 index d3f5a12fa..000000000 --- a/flot/jquery.flot.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/java-applet/java-applet-tests.ts.tscparams b/java-applet/java-applet-tests.ts.tscparams deleted file mode 100644 index 934bc29ef..000000000 --- a/java-applet/java-applet-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ ---noImplicitAny \ No newline at end of file diff --git a/jointjs/jointjs.d.ts.tscparams b/jointjs/jointjs.d.ts.tscparams deleted file mode 100644 index d3f5a12fa..000000000 --- a/jointjs/jointjs.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/jqgrid/jqgrid.d.ts.tscparams b/jqgrid/jqgrid.d.ts.tscparams deleted file mode 100644 index ce89a9e7d..000000000 --- a/jqgrid/jqgrid.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ ---noImplicitAny --module commonjs --target es5 \ No newline at end of file diff --git a/js-signals/js-signals.d.ts.tscparams b/js-signals/js-signals.d.ts.tscparams deleted file mode 100644 index d3f5a12fa..000000000 --- a/js-signals/js-signals.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/maskedinput/maskedinput.d.ts.tscparams b/maskedinput/maskedinput.d.ts.tscparams deleted file mode 100644 index ce89a9e7d..000000000 --- a/maskedinput/maskedinput.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ ---noImplicitAny --module commonjs --target es5 \ No newline at end of file diff --git a/page/page-tests.ts.tscparams b/page/page-tests.ts.tscparams deleted file mode 100644 index 2988d8fd6..000000000 --- a/page/page-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ ---noImplicitAny --module commonjs \ No newline at end of file diff --git a/urijs/URI.d.ts.tscparams b/urijs/URI.d.ts.tscparams deleted file mode 100644 index d3f5a12fa..000000000 --- a/urijs/URI.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - From 84a60d89c53a71efeda77af742fd5de1ddaaaa09 Mon Sep 17 00:00:00 2001 From: kiri Date: Mon, 16 Mar 2015 03:26:24 +0900 Subject: [PATCH 081/243] add path-to-regexp definition. --- path-to-regexp/path-to-regexp-tests.ts | 16 ++++++++++++++++ path-to-regexp/path-to-regexp.d.ts | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 path-to-regexp/path-to-regexp-tests.ts create mode 100644 path-to-regexp/path-to-regexp.d.ts diff --git a/path-to-regexp/path-to-regexp-tests.ts b/path-to-regexp/path-to-regexp-tests.ts new file mode 100644 index 000000000..ef622c602 --- /dev/null +++ b/path-to-regexp/path-to-regexp-tests.ts @@ -0,0 +1,16 @@ +/// + +import pathToRegexp = require('path-to-regexp'); + +var keys: string[] = []; +var re = pathToRegexp('/foo/:bar', keys); + +re = pathToRegexp('/foo/:bar', keys, { + sensitive: true, + strict: false, + end: true +}); + +re = pathToRegexp('/foo/:bar', keys, { + sensitive: true +}); \ No newline at end of file diff --git a/path-to-regexp/path-to-regexp.d.ts b/path-to-regexp/path-to-regexp.d.ts new file mode 100644 index 000000000..1cea46d85 --- /dev/null +++ b/path-to-regexp/path-to-regexp.d.ts @@ -0,0 +1,20 @@ +// Type definitions for path-to-regexp v1.0.3 +// Project: https://github.com/pillarjs/path-to-regexp +// Definitions by: xica +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "path-to-regexp" { + + function pathToRegexp(path: string, keys: string[], options?: pathToRegexp.Options): RegExp; + + module pathToRegexp { + + interface Options { + sensitive?: boolean; + strict?: boolean; + end?: boolean; + } + } + + export = pathToRegexp; +} From 2e724ff7b6e760212a85cea883c7c58480dd3596 Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Mon, 16 Mar 2015 10:15:20 +1300 Subject: [PATCH 082/243] Add type definitions for lolex --- lolex/lolex-tests.ts | 116 +++++++++++++++++++++++++++++++++++++++++++ lolex/lolex.d.ts | 24 +++++++++ 2 files changed, 140 insertions(+) create mode 100644 lolex/lolex-tests.ts create mode 100644 lolex/lolex.d.ts diff --git a/lolex/lolex-tests.ts b/lolex/lolex-tests.ts new file mode 100644 index 000000000..10500211c --- /dev/null +++ b/lolex/lolex-tests.ts @@ -0,0 +1,116 @@ +/// + +import lolex = require("lolex"); + +function a() { + var clock = lolex.createClock(); + + clock.setTimeout(function () { + console.log("The poblano is a mild chili pepper originating in the state of Puebla, Mexico."); + }, 15); + + // ... + + clock.tick(15); +} + +function b() { + var clock = lolex.install(window); + + window.setTimeout(() => {}, 15); // Schedules with clock.setTimeout + + clock.uninstall(); + + // window.setTimeout is restored to the native implementation +} + +function c() { + var clock = lolex.install(); + + // Equivalent to + // var clock = lolex.install(typeof global !== "undefined" ? global : window); +} + +var clock: lolex.Clock; + +/** + * var clock = lolex.createClock([now]) + */ + +clock = lolex.createClock(); +clock = lolex.createClock(Date.now()); + + +/** + * var clock = lolex.install([context[, now[, toFake]]]) + */ + +clock = lolex.install(); +clock = lolex.install(window); +clock = lolex.install(window, Date.now()); +clock = lolex.install(window, Date.now(), ['setTimeout', 'clearTimeout']); + + +/** + * var clock = lolex.install([now[, toFake]]) + */ + +clock = lolex.install(Date.now()); +clock = lolex.install(Date.now(), ['setTimeout', 'clearTimeout']); + + +var id: number; +/** + * var id = clock.setTimeout(callback, timeout) + */ + +id = clock.setTimeout(() => {}, 1000); + + +/** + * clock.clearTimeout(id) + */ + +clock.clearTimeout(id); + + +/** + * var id = clock.setInterval(callback, timeout) + */ + +id = clock.setInterval(() => {}, 1000); + + +/** + * clock.clearInterval(id) + */ + +clock.clearInterval(id); + + +/** + * var id = clock.setImmediate(callback) + */ + +id = clock.setImmediate(() => {}); + + +/** + * clock.clearImmediate(id) + */ + +clock.clearImmediate(id); + + +/** + * clock.tick(time) + */ + +clock.tick(1000); + + +/** + * clock.uninstall() + */ + +clock.uninstall(); diff --git a/lolex/lolex.d.ts b/lolex/lolex.d.ts new file mode 100644 index 000000000..bc0f0c81c --- /dev/null +++ b/lolex/lolex.d.ts @@ -0,0 +1,24 @@ +// Type definitions for lolex 1.2.1 +// Project: https://github.com/sinonjs/lolex +// Definitions by: Wim Looman +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'lolex' { + export interface Clock { + setTimeout(callback: () => any, timeout: number): number; + setInterval(callback: () => any, timeout: number): number; + setImmediate(callback: () => any): number; + + clearTimeout(id: number): void; + clearInterval(id: number): void; + clearImmediate(id: number): void; + + tick(ms: number): void; + uninstall(): void; + } + + export function createClock(now?: number): Clock; + + export function install(now?: number, toFake?: string[]): Clock; + export function install(context?: any, now?: number, toFake?: string[]): Clock; +} From 57c7b20c6bad56d06e707e305fe814e6745c6ccc Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 16 Mar 2015 10:22:46 +1300 Subject: [PATCH 083/243] Add `which` chainable keyword. See https://github.com/chaijs/chai/releases/tag/v2.0.0 and chaijs/chai#347. --- chai/chai.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chai/chai.d.ts b/chai/chai.d.ts index ff5526189..4b9d313dd 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -1,4 +1,4 @@ -// Type definitions for chai 1.7.2 +// Type definitions for chai 2.0.0 // Project: http://chaijs.com/ // Definitions by: Jed Hunsaker , Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -92,6 +92,7 @@ declare module chai { been: Expect; is: Expect; that: Expect; + which: Expect; and: Expect; have: Expect; has: Expect; From 190b451f85e9834ad46a062e71909503ea091c8b Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Mon, 16 Mar 2015 10:54:18 +1300 Subject: [PATCH 084/243] Add type definitions for mock-fs --- mock-fs/mock-fs-tests.ts | 79 ++++++++++++++++++++++++++++++++++++++++ mock-fs/mock-fs.d.ts | 51 ++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 mock-fs/mock-fs-tests.ts create mode 100644 mock-fs/mock-fs.d.ts diff --git a/mock-fs/mock-fs-tests.ts b/mock-fs/mock-fs-tests.ts new file mode 100644 index 000000000..3dd9f0121 --- /dev/null +++ b/mock-fs/mock-fs-tests.ts @@ -0,0 +1,79 @@ +/// + +var mock = require('mock-fs'); + +function a() { + mock({ + 'path/to/fake/dir': { + 'some-file.txt': 'file content here', + 'empty-dir': {/** empty directory */} + }, + 'path/to/some.png': new Buffer([8, 6, 7, 5, 3, 0, 9]), + 'some/other/path': {/** another empty directory */} + }); + + // after a test runs + mock.restore(); +} + +function b() { + mock({ + 'path/to/file.txt': 'file content here' + }); +} + +function c() { + mock({ + foo: mock.file({ + content: 'file content here', + ctime: new Date(1), + mtime: new Date(1) + }) + }); +} + +function d() { + // note that this could also be written as + // mock({'path/to/dir': { /** config */ }}) + mock({ + path: { + to: { + dir: { + file1: 'text content', + file2: new Buffer([1, 2, 3, 4]) + } + } + } + }); +} + +function e() { + mock({ + 'some/dir': mock.directory({ + mode: 0755, + items: { + file1: 'file one content', + file2: new Buffer([8, 6, 7, 5, 3, 0, 9]) + } + }) + }); +} + +function f() { + mock({ + 'some/dir': { + 'regular-file': 'file contents', + 'a-symlink': mock.symlink({ + path: 'regular-file' + }) + } + }); +} + +var mockedFS = mock.fs({ + '/file': 'blah' +}); + +if (mockedFS.readFileSync('/file', { encoding: 'utf8' }) === 'blah') { + console.log('woo'); +} diff --git a/mock-fs/mock-fs.d.ts b/mock-fs/mock-fs.d.ts new file mode 100644 index 000000000..539e74e86 --- /dev/null +++ b/mock-fs/mock-fs.d.ts @@ -0,0 +1,51 @@ +// Type definitions for mock-fs 2.5.0 +// Project: https://github.com/tschaub/mock-fs +// Definitions by: Wim Looman +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "mock-fs" { + import fs = require("fs"); + + function mock(config?: mock.Config): void; + + module mock { + function file(config: FileConfig): File; + function directory(config: DirectoryConfig): Directory; + function symlink(config: SymlinkConfig): Symlink; + + function restore(): void; + + function fs(config?: Config): typeof fs; + + interface Config { + [path: string]: string | Buffer | File | Directory | Symlink | Config; + } + + interface CommonConfig { + mode?: number; + uid?: number; + git?: number; + atime?: Date; + ctime?: Date; + mtime?: Date; + } + + interface FileConfig extends CommonConfig { + content: string | Buffer; + } + interface DirectoryConfig extends CommonConfig { + items: Config; + } + interface SymlinkConfig extends CommonConfig { + path: string; + } + + class File { private _file: any; } + class Directory { private _directory: any; } + class Symlink { private _symlink: any; } + } + + export = mock; +} From f8276d5a600b7f0eea8abfaa863c1ea7ae4b7405 Mon Sep 17 00:00:00 2001 From: "Michael J. Bennett" Date: Sun, 15 Mar 2015 21:31:24 -0400 Subject: [PATCH 085/243] Definitions for node module mariasql added https://github.com/mscdex/node-mariasql On branch mariasql new file: mariasql/mariasql-tests.ts new file: mariasql/mariasql.d.ts --- mariasql/mariasql-tests.ts | 198 +++++++++++++++++++++++++++++++++++++ mariasql/mariasql.d.ts | 97 ++++++++++++++++++ 2 files changed, 295 insertions(+) create mode 100644 mariasql/mariasql-tests.ts create mode 100644 mariasql/mariasql.d.ts diff --git a/mariasql/mariasql-tests.ts b/mariasql/mariasql-tests.ts new file mode 100644 index 000000000..554d3d4a7 --- /dev/null +++ b/mariasql/mariasql-tests.ts @@ -0,0 +1,198 @@ +// These are the examples from the node-mariasql README transposed to TypeScript +// https://github.com/mscdex/node-mariasql + +/// + +// Example 1 - SHOW DATABASES +import util = require('util'); +import Client = require('mariasql'); + +var c:Client = new Client(), + inspect = util.inspect; + +c.connect({ + host: '127.0.0.1', + user: 'foo', + password: 'bar' +}); + +c.on('connect', function () { + console.log('Client connected'); +}) + .on('error', function (err) { + console.log('Client error: ' + err); + }) + .on('close', function (hadError) { + console.log('Client closed'); + }); + +c.query('SHOW DATABASES') + .on('result', function (res) { + res.on('row', function (row) { + console.log('Result row: ' + inspect(row)); + }) + .on('error', function (err) { + console.log('Result error: ' + inspect(err)); + }) + .on('end', function (info) { + console.log('Result finished successfully'); + }); + }) + .on('end', function () { + console.log('Done with all results'); + }); + +c.end(); + + +// Example 2 - Query Placeholders +var c = new Client(); + +c.connect({ + host: '127.0.0.1', + user: 'foo', + password: 'bar', + db: 'mydb' +}); + +c.on('connect', function () { + console.log('Client connected'); +}) + .on('error', function (err) { + console.log('Client error: ' + err); + }) + .on('close', function (hadError) { + console.log('Client closed'); + }); + +c.query('SELECT * FROM users WHERE id = :id AND name = :name', + {id: 1337, name: 'Frylock'}) + .on('result', function (res) { + res.on('row', function (row) { + console.log('Result row: ' + inspect(row)); + }) + .on('error', function (err) { + console.log('Result error: ' + inspect(err)); + }) + .on('end', function (info) { + console.log('Result finished successfully'); + }); + }) + .on('end', function () { + console.log('Done with all results'); + }); + +c.query('SELECT * FROM users WHERE id = ? AND name = ?', + [1337, 'Frylock']) + .on('result', function (res) { + res.on('row', function (row) { + console.log('Result row: ' + inspect(row)); + }) + .on('error', function (err) { + console.log('Result error: ' + inspect(err)); + }) + .on('end', function (info) { + console.log('Result finished successfully'); + }); + }) + .on('end', function () { + console.log('Done with all results'); + }); + +c.end(); + + +// Example 3 prepared query +c = new Client(); + +c.connect({ + host: '127.0.0.1', + user: 'foo', + password: 'bar', + db: 'mydb' +}); + +c.on('connect', function () { + console.log('Client connected'); +}) + .on('error', function (err) { + console.log('Client error: ' + err); + }) + .on('close', function (hadError) { + console.log('Client closed'); + }); + +var pq = c.prepare('SELECT * FROM users WHERE id = :id AND name = :name'); + +c.query(pq({id: 1337, name: 'Frylock'})) + .on('result', function (res) { + res.on('row', function (row) { + console.log('Result row: ' + inspect(row)); + }) + .on('error', function (err) { + console.log('Result error: ' + inspect(err)); + }) + .on('end', function (info) { + console.log('Result finished successfully'); + }); + }) + .on('end', function () { + console.log('Done with all results'); + }); + +c.end(); + + +// Example 4 - Abort Query +c = new Client() +var qcnt:number = 0; + +c.connect({ + host: '127.0.0.1', + user: 'foo', + password: 'bar', + multiStatements: true +}); + +c.on('connect', function () { + console.log('Client connected'); +}) + .on('error', function (err) { + console.log('Client error: ' + err); + }) + .on('close', function (hadError) { + console.log('Client closed'); + }); + +c.query('SELECT "first query"; SELECT "second query"; SELECT "third query"', true) + .on('result', function (res) { + if (++qcnt === 2) + res.abort(); + res.on('row', function (row) { + console.log('Query #' + (qcnt) + ' row: ' + inspect(row)); + }) + .on('error', function (err) { + console.log('Query #' + (qcnt) + ' error: ' + inspect(err)); + }) + .on('abort', function () { + console.log('Query #' + (qcnt) + ' was aborted'); + }) + .on('end', function (info) { + console.log('Query #' + (qcnt) + ' finished successfully'); + }); + }) + .on('end', function () { + console.log('Done with all queries'); + }); + +c.end(); +/* output: + Client connected + Query #1 row: [ 'first query' ] + Query #1 finished successfully + Query #2 was aborted + Query #3 row: [ 'third query' ] + Query #3 finished successfully + Done with all queries + Client closed + */ \ No newline at end of file diff --git a/mariasql/mariasql.d.ts b/mariasql/mariasql.d.ts new file mode 100644 index 000000000..2c375a173 --- /dev/null +++ b/mariasql/mariasql.d.ts @@ -0,0 +1,97 @@ +// Type definitions for mariasql v0.1.22 +// Project: https://github.com/mscdex/node-mariasql +// Definitions by: MichaelBennett +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/** + */ +interface MariaCallBackError { + (error:Error):void +} + +interface MariaCallBackResult { + (result:MariaResult):void +} + +interface MariaCallBackRow { + (result:Array):void +} + +interface MariaCallBackBoolean { + (result:boolean):void +} + +interface MariaCallBackObject { + (result:Object):void +} + +interface MariaCallBackVoid { + ():void +} + +interface Dictionary { + [index: string]: any; +} + +interface MariaPreparedQuery { + (values:Dictionary):string; + (values:Array):string; +} + +interface ClientConfig { + host: string; + user: string; + password: string; + db?: string; + port?: number; + unixSocket?: string; + keepQueries?: boolean; + multiStatements?: boolean; + connTimeout?: number; + pingInterval?: number; + secureAuth?: boolean; + compress?: boolean; + ssl?:any; + local_infile?: boolean; + read_default_group?: string; + charset?: string; +} + +declare class MariaResult { + on(signal:string, cb:MariaCallBackObject):MariaResult; // signal 'end' + on(signal:string, cb:MariaCallBackError):MariaResult; // signal 'error' + on(signal:string, cb:MariaCallBackRow):MariaResult; // signal 'row' + on(signal:string, cb:MariaCallBackVoid):MariaResult; // signal 'abort' + abort():void; +} + +declare class MariaQuery { + on(signal:string, cb:MariaCallBackResult):MariaQuery; // signal 'result' + on(signal:string, cb:MariaCallBackVoid):MariaQuery; // signal 'end' + on(signal:string, cb:MariaCallBackVoid):MariaQuery; // signal 'abort' + on(signal:string, cb:MariaCallBackError):MariaQuery; // signal 'error' + abort():void; +} + +declare class MariaClient { + connect(config:ClientConfig):void; + end():void; + destroy():void; + escape(query:string):string; + query(q:string, placeHolders?:Dictionary, useArray?:boolean):MariaQuery; + query(q:string, placeHolders?:Array, useArray?:boolean):MariaQuery; + query(q:string, useArray?:boolean):MariaQuery; + prepare(query:string): MariaPreparedQuery; + isMariaDB():boolean; + on(signal:string, cb:MariaCallBackError): MariaClient; // signal 'error' + on(signal:string, cb:MariaCallBackObject): MariaClient; // signal 'close' + on(signal:string, cb:MariaCallBackVoid): MariaClient; // signal 'connect' + connected: boolean; + threadId: string; +} + +declare module 'mariasql' { + export = MariaClient; +} + From d856ac8576b1c700d59e015f79caefcaeb8da45c Mon Sep 17 00:00:00 2001 From: Corey Jepperson Date: Mon, 16 Mar 2015 09:27:24 -0500 Subject: [PATCH 086/243] renamed jquery.nouislider/jquery.nouislider.d.ts to nouislider/nouislider.d.ts --- .../nouislider-tests.ts | 2 +- .../jquery.nouislider.d.ts => nouislider/nouislider.d.ts | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename jquery.nouislider/jquery.nouislider-tests.ts => nouislider/nouislider-tests.ts (96%) rename jquery.nouislider/jquery.nouislider.d.ts => nouislider/nouislider.d.ts (100%) diff --git a/jquery.nouislider/jquery.nouislider-tests.ts b/nouislider/nouislider-tests.ts similarity index 96% rename from jquery.nouislider/jquery.nouislider-tests.ts rename to nouislider/nouislider-tests.ts index fe143f6af..3a0da493a 100644 --- a/jquery.nouislider/jquery.nouislider-tests.ts +++ b/nouislider/nouislider-tests.ts @@ -1,4 +1,4 @@ -/// +/// /// //basic diff --git a/jquery.nouislider/jquery.nouislider.d.ts b/nouislider/nouislider.d.ts similarity index 100% rename from jquery.nouislider/jquery.nouislider.d.ts rename to nouislider/nouislider.d.ts From 2282e8103676a33c8471a655b6b6beca74d3b9f8 Mon Sep 17 00:00:00 2001 From: flyfishMT Date: Mon, 16 Mar 2015 11:57:05 -0600 Subject: [PATCH 087/243] Adding Hasher.js --- hasher/hasher-tests.ts | 14 +++++ hasher/hasher.d.ts | 115 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 hasher/hasher-tests.ts create mode 100644 hasher/hasher.d.ts diff --git a/hasher/hasher-tests.ts b/hasher/hasher-tests.ts new file mode 100644 index 000000000..5c43af9b0 --- /dev/null +++ b/hasher/hasher-tests.ts @@ -0,0 +1,14 @@ +/// + +//handle hash changes +function handleChanges(newHash: any, oldHash: any) { + console.log(newHash); +} + +hasher.changed.add(handleChanges); //add hash change listener +hasher.initialized.add(handleChanges); //add initialized listener (to grab initial value in case it is already set) +hasher.init(); //initialize hasher (start listening for history changes) + +hasher.setHash('foo'); //change hash value (generates new history record) + +hasher.prependHash = '!'; //default value is "/" diff --git a/hasher/hasher.d.ts b/hasher/hasher.d.ts new file mode 100644 index 000000000..8abd33637 --- /dev/null +++ b/hasher/hasher.d.ts @@ -0,0 +1,115 @@ +// Type definitions for Hasher.js +// Project: https:// github.com/millermedeiros/hasher/ +// Definitions by: flyfishMT +// Definitions: https:// github.com/borisyankov/DefinitelyTyped + +/// + +declare module HasherJs { + + export interface HasherStatic { + + // {string} hasher.appendHash + // String that should always be added to the end of Hash value. + appendHash(): string; + + // default value: ''; + // will be automatically removed from `hasher.getHash()` + // avoid conflicts with elements that contain ID equal to hash value; + // {signals.Signal} hasher.changed + // Signal dispatched when hash value changes. - pass current hash as 1st parameter to listeners and previous hash value as 2nd parameter. + changed: Signal; + + // {signals.Signal} hasher.initialized + // Signal dispatched when hasher is initialized. - pass current hash as first parameter to listeners. + initialized: Signal; + + // {string} hasher.prependHash + // String that should always be added to the beginning of Hash value. + prependHash: string; + + // default value: '/'; + // will be automatically removed from `hasher.getHash()` + // avoid conflicts with elements that contain ID equal to hash value; + // {string} hasher.separator + // String used to split hash paths; used by hasher.getHashAsArray() to split paths. + separator: string; + + // default value: '/'; + // {signals.Signal} hasher.stopped + // Signal dispatched when hasher is stopped. - pass current hash as first parameter to listeners + stopped: Signal; + + // {string} hasher.VERSION + // hasher Version Number + VERSION: string; + + // Method Detail + // hasher.dispose() + // Removes all event listeners, stops hasher and destroy hasher object. - IMPORTANT: hasher won't work after calling this method, hasher Object will be deleted. + dispose(): void; + + // {string} hasher.getBaseURL() + // Returns: + // {string} Retrieve URL without query string and hash. + getBaseURL(): string; + + // {string} hasher.getHash() + // Returns: + // {string} Hash value without '#', `hasher.appendHash` and `hasher.prependHash`. + getHash(): string; + + // {Array.} hasher.getHashAsArray() + // Returns: + // {Array.} Hash value split into an Array. + getHashAsArray(): string[]; + + // {string} hasher.getURL() + // Returns: + // {string} Full URL. + getURL(): string; + + // hasher.init() + // Start listening/dispatching changes in the hash/history. + init(): void; + + // hasher won't dispatch CHANGE events by manually typing a new value or pressing the back/forward buttons before calling this method. + // {boolean} hasher.isActive() + // Returns: + // {boolean} If hasher is listening to changes on the browser history and/or hash value. + isActive(): boolean; + + // hasher.replaceHash(path) + // Set Hash value without keeping previous hash on the history record. Similar to calling window.location.replace("#/hash") but will also work on IE6-7. + // hasher.replaceHash('lorem', 'ipsum', 'dolor') -> '#/lorem/ipsum/dolor' + // Parameters: + // {...string} path + // Hash value without '#'. Hasher will join path segments using `hasher.separator` and prepend/append hash value with `hasher.appendHash` and `hasher.prependHash` + replaceHash(...path: string[]): void; + + // hasher.setHash(path) + // Set Hash value, generating a new history record. + // hasher.setHash('lorem', 'ipsum', 'dolor') -> '#/lorem/ipsum/dolor' + // Parameters: + // {...string} path + // Hash value without '#'. Hasher will join path segments using `hasher.separator` and prepend/append hash value with `hasher.appendHash` and `hasher.prependHash` + setHash(...path: string[]): void; + + // hasher.stop() + // Stop listening/dispatching changes in the hash/history. + // hasher won't dispatch CHANGE events by manually typing a new value or pressing the back/forward buttons after calling this method, unless you call hasher.init() again. + // hasher will still dispatch changes made programatically by calling hasher.setHash(); + stop(): void; + + // {string} hasher.toString() + // Returns: + // {string} A string representation of the object. + toString(): string; + } +} + +declare var hasher: HasherJs.HasherStatic; + +declare module 'hasher'{ + export = hasher; +} From a6fc064b32bf004b6af69c831593a325d12fb2af Mon Sep 17 00:00:00 2001 From: flyfishMT Date: Mon, 16 Mar 2015 12:13:26 -0600 Subject: [PATCH 088/243] formatting --- hasher/hasher.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/hasher/hasher.d.ts b/hasher/hasher.d.ts index 8abd33637..782acf9c1 100644 --- a/hasher/hasher.d.ts +++ b/hasher/hasher.d.ts @@ -110,6 +110,7 @@ declare module HasherJs { declare var hasher: HasherJs.HasherStatic; +// AMD declare module 'hasher'{ export = hasher; } From c3db40671d29c75a1f1a976d81ad5106d7669d2b Mon Sep 17 00:00:00 2001 From: flyfishMT Date: Mon, 16 Mar 2015 12:23:14 -0600 Subject: [PATCH 089/243] formatting travis ci build error --- hasher/hasher.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hasher/hasher.d.ts b/hasher/hasher.d.ts index 782acf9c1..8bfb1e674 100644 --- a/hasher/hasher.d.ts +++ b/hasher/hasher.d.ts @@ -1,7 +1,7 @@ -// Type definitions for Hasher.js -// Project: https:// github.com/millermedeiros/hasher/ -// Definitions by: flyfishMT -// Definitions: https:// github.com/borisyankov/DefinitelyTyped +// Type definitions for Hasher.js +// Project: https:// github.com/millermedeiros/hasher/ +// Definitions by: flyfishMT +// Definitions: https:// github.com/borisyankov/DefinitelyTyped /// From f1155c1e0626e8807a2c756c11d9b3dfcd5f4f35 Mon Sep 17 00:00:00 2001 From: flyfishMT Date: Mon, 16 Mar 2015 12:27:03 -0600 Subject: [PATCH 090/243] more formatting travis ci build error --- hasher/hasher.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hasher/hasher.d.ts b/hasher/hasher.d.ts index 8bfb1e674..587bf4a39 100644 --- a/hasher/hasher.d.ts +++ b/hasher/hasher.d.ts @@ -1,7 +1,7 @@ // Type definitions for Hasher.js -// Project: https:// github.com/millermedeiros/hasher/ +// Project: https://github.com/millermedeiros/hasher/ // Definitions by: flyfishMT -// Definitions: https:// github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// From e294be52255e83f28376b2d8c88023971566805a Mon Sep 17 00:00:00 2001 From: flyfishMT Date: Mon, 16 Mar 2015 12:31:54 -0600 Subject: [PATCH 091/243] formatting travis ci build error --- hasher/hasher.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hasher/hasher.d.ts b/hasher/hasher.d.ts index 587bf4a39..dfed50bd4 100644 --- a/hasher/hasher.d.ts +++ b/hasher/hasher.d.ts @@ -1,6 +1,6 @@ // Type definitions for Hasher.js // Project: https://github.com/millermedeiros/hasher/ -// Definitions by: flyfishMT +// Definitions by: flyfishMT // Definitions: https://github.com/borisyankov/DefinitelyTyped /// From f2a71fe271747c3a484d971da43e82bc384a73d3 Mon Sep 17 00:00:00 2001 From: progre Date: Tue, 17 Mar 2015 10:54:48 +0900 Subject: [PATCH 092/243] fix readablestream#read type --- node/node.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node.d.ts b/node/node.d.ts index 0ca514e9e..3a260b053 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -98,7 +98,7 @@ declare module NodeJS { export interface ReadableStream extends EventEmitter { readable: boolean; - read(size?: number): any; + read(size?: number): string|Buffer; setEncoding(encoding: string): void; pause(): void; resume(): void; From e9ebd641564631a26c1ccf0717d0ffe133023e50 Mon Sep 17 00:00:00 2001 From: hamza zia Date: Tue, 17 Mar 2015 10:15:54 +0800 Subject: [PATCH 093/243] Added PDFViewer constructor --- pdf/pdf.d.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pdf/pdf.d.ts b/pdf/pdf.d.ts index 8496a6c40..802c0e601 100644 --- a/pdf/pdf.d.ts +++ b/pdf/pdf.d.ts @@ -200,6 +200,11 @@ interface PDFRenderParams { continueCallback?: (_continue: () => void) => void; } +interface PDFViewerParams { + container: HTMLElement; + viewer?: HTMLElement; +} + /** * RenderTask is basically a promise but adds a cancel function to termiate it. **/ @@ -295,12 +300,12 @@ interface PDFObjects { } interface PDFJSStatic { - + /** * The maximum allowed image size in total pixels e.g. width * height. Images above this value will not be drawn. Use -1 for no limit. **/ maxImageSize: number; - + /** * By default fonts are converted to OpenType fonts and loaded via font face rules. If disabled, the font will be rendered using a built in font renderer that constructs the glyphs with primitive path commands. **/ @@ -337,6 +342,8 @@ interface PDFJSStatic { passwordCallback?: (fn: (password: string) => void, reason: string) => string, progressCallback?: (progressData: PDFProgressData) => void) : PDFPromise; + + PDFViewer(params: PDFViewerParams): void; } declare var PDFJS: PDFJSStatic; From 3890e183a89df956461f134a34e226a9e81a630d Mon Sep 17 00:00:00 2001 From: Gildor Date: Tue, 17 Mar 2015 14:38:24 +0800 Subject: [PATCH 094/243] Make D3.Selection.datum generic so that return values have type --- d3/d3.d.ts | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index be4032921..1985a309f 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -779,9 +779,34 @@ declare module D3 { }; datum: { + /** + * Sets the element's bound data to the return value of the specified function evaluated + * for each selected element. + * Unlike the D3.Selection.data method, this method does not compute a join (and thus + * does not compute enter and exit selections). + * @param values The function to be evaluated for each selected element, being passed the + * previous datum d and the current index i, with the this context as the current DOM + * element. The function is then used to set each element's data. A null value will + * delete the bound data. This operator has no effect on the index. + */ (values: (data: any, index: number) => any): UpdateSelection; + /** + * Sets the element's bound data to the specified value on all selected elements. + * Unlike the D3.Selection.data method, this method does not compute a join (and thus + * does not compute enter and exit selections). + * @param values The same data to be given to all elements. + */ (values: any): UpdateSelection; - () : any; + /** + * Returns the bound datum for the first non-null element in the selection. + * This is generally useful only if you know the selection contains exactly one element. + */ + (): any; + /** + * Returns the bound datum for the first non-null element in the selection. + * This is generally useful only if you know the selection contains exactly one element. + */ + (): T; }; filter: { From 47a28ab7798ff7097e22fd492065939e39b18b2d Mon Sep 17 00:00:00 2001 From: progre Date: Tue, 17 Mar 2015 16:27:38 +0900 Subject: [PATCH 095/243] fix readable#read type --- node/node.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node.d.ts b/node/node.d.ts index 3a260b053..f37bafe94 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1210,7 +1210,7 @@ declare module "stream" { readable: boolean; constructor(opts?: ReadableOptions); _read(size: number): void; - read(size?: number): any; + read(size?: number): string|Buffer; setEncoding(encoding: string): void; pause(): void; resume(): void; From 90d3b932836c23f70ca28178756682d00b095fb9 Mon Sep 17 00:00:00 2001 From: falsandtru Date: Tue, 10 Mar 2015 00:42:30 +0900 Subject: [PATCH 096/243] Revert JQueryGenericPromise to have only then method --- jquery/jquery.d.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index a2ab74ebd..2452ec377 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -277,14 +277,6 @@ interface JQueryGenericPromise { * @param failFilter An optional function that is called when the Deferred is rejected. */ then(doneFilter: (value: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => U|JQueryPromise, progressFilter?: (...progression: any[]) => any): JQueryPromise; - - /** - * Determine the current state of a Deferred object. - */ - state(): string; - - // Deprecated - given no typings - pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; } /** @@ -302,6 +294,10 @@ interface JQueryPromiseOperator { * Interface for the JQuery promise, part of callbacks */ interface JQueryPromise extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + */ + state(): string; /** * Add handlers to be called when the Deferred object is either resolved or rejected. * @@ -329,12 +325,19 @@ interface JQueryPromise extends JQueryGenericPromise { * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. */ progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; } /** * Interface for the JQuery deferred, part of callbacks */ interface JQueryDeferred extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + */ + state(): string; /** * Add handlers to be called when the Deferred object is either resolved or rejected. * @@ -414,6 +417,9 @@ interface JQueryDeferred extends JQueryGenericPromise { * @param target Object onto which the promise methods have to be attached */ promise(target?: any): JQueryPromise; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; } /** From 32b31deb182b380fbff298ff861bdb590c2af2dc Mon Sep 17 00:00:00 2001 From: Ivan Akulov Date: Tue, 17 Mar 2015 13:17:14 +0300 Subject: [PATCH 097/243] =?UTF-8?q?Mark=20"highlight"=C2=A0and=20"label"?= =?UTF-8?q?=20properties=20of=20CircularChartData=20as=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "highlight" and "label" properties of CircularChartData are actually optional: highlight defaults to color (https://github.com/nnnick/Chart.js/blob/master/src/Chart.Doughnut.js#L98), and label is only rendered when present (https://github.com/nnnick/Chart.js/blob/master/src/Chart.Doughnut.js#L35). --- chartjs/chart.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chartjs/chart.d.ts b/chartjs/chart.d.ts index 7364c6525..a73ecc94e 100644 --- a/chartjs/chart.d.ts +++ b/chartjs/chart.d.ts @@ -28,8 +28,8 @@ interface LinearChartData { interface CircularChartData { value: number; color: string; - highlight: string; - label: string; + highlight?: string; + label?: string; } interface ChartSettings { From 64628c14ec4d063e39e40da4c7f10065675cf84e Mon Sep 17 00:00:00 2001 From: ryan-codingintrigue Date: Tue, 17 Mar 2015 10:19:14 +0000 Subject: [PATCH 098/243] Add support for GitHub's Fetch API polyfill --- fetch/fetch-tests.ts | 24 ++++++++++++ fetch/fetch.d.ts | 89 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 fetch/fetch-tests.ts create mode 100644 fetch/fetch.d.ts diff --git a/fetch/fetch-tests.ts b/fetch/fetch-tests.ts new file mode 100644 index 000000000..3d9f71e76 --- /dev/null +++ b/fetch/fetch-tests.ts @@ -0,0 +1,24 @@ +/// +/// + +function test_fetchUrlWithOptions() { + var headers = new Headers(); + headers.append("Content-Type", "application/json"); + var requestOptions: RequestInit = { + method: "POST", + headers: headers + }; + handlePromise(window.fetch("http://www.andlabs.net/html5/uCOR.php", requestOptions)); +} + +function test_fetchUrl() { + handlePromise(window.fetch("http://www.andlabs.net/html5/uCOR.php")); +} + +function handlePromise(promise: Promise) { + promise.then((response) => { + return response.text(); + }).then((text) => { + console.log(text); + }); +} \ No newline at end of file diff --git a/fetch/fetch.d.ts b/fetch/fetch.d.ts new file mode 100644 index 000000000..5d39d2a56 --- /dev/null +++ b/fetch/fetch.d.ts @@ -0,0 +1,89 @@ +// Type definitions for fetch API +// Project: https://github.com/github/fetch +// Definitions by: Ryan Graham +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare class Request { + constructor(input: string|Request, init?:RequestInit); + method: string; + url: string; + headers: Headers; + context: RequestContext; + referrer: string; + mode: RequestMode; + credentials: RequestCredentials; + cache: RequestCache; +} + +interface RequestInit { + method?: string; + headers?: HeaderInit; + body?: BodyInit; + mode?: RequestMode; + credentials?: RequestCredentials; + cache?: RequestCache; +} + +declare enum RequestContext { + "audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon", "fetch", + "font", "form", "frame", "hyperlink", "iframe", "image", "imageset", "import", + "internal", "location", "manifest", "object", "ping", "plugin", "prefetch", "script", + "serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker", + "xmlhttprequest", "xslt" +} +declare enum RequestMode { "same-origin", "no-cors", "cors" } +declare enum RequestCredentials { "omit", "same-origin", "include" } +declare enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" } + +declare class Headers implements TypeScript.Iterator { + append(name: string, value: string): void; + delete(name: string):void; + get(name: string): string; + getAll(name: string): Array; + has(name: string): boolean; + set(name: string, value: string): void; + + moveNext(): boolean; + + current(): string; +} + +declare class Body { + bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + formData(): Promise; + json(): Promise; + text(): Promise; +} +declare class Response extends Body { + constructor(body?: BodyInit, init?: ResponseInit); + error(): Response; + redirect(url: string, status: number): Response; + type: ResponseType; + url: string; + status: number; + ok: boolean; + statusText: string; + headers: Headers; + clone(): Response; +} + +declare enum ResponseType { "basic", "cors", "default", "error", "opaque" } + +declare class ResponseInit { + status: number; + statusText: string; + headers: HeaderInit; +} + +declare type HeaderInit = Headers|Array; +declare type BodyInit = Blob|FormData|string; +declare type RequestInfo = Request|string; + +interface Window { + fetch(url: string, init?: RequestInit): Promise; +} \ No newline at end of file From 2612cba592102f921f2bdeadfe345d588880241b Mon Sep 17 00:00:00 2001 From: progre Date: Tue, 17 Mar 2015 19:48:39 +0900 Subject: [PATCH 099/243] add filename argument --- log4js/log4js.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/log4js/log4js.d.ts b/log4js/log4js.d.ts index 4e1cfc43b..28d821377 100644 --- a/log4js/log4js.d.ts +++ b/log4js/log4js.d.ts @@ -64,6 +64,7 @@ declare module "log4js" { export function shutdown(cb: Function): void; export function configure(config: IConfig, options?: any): void; + export function configure(filename: string, options?: any): void; export function setGlobalLogLevel(level: string): void; export function setGlobalLogLevel(level: Level): void; From eb099245aa54821864533d71088873a40ae8dbc5 Mon Sep 17 00:00:00 2001 From: progre Date: Tue, 17 Mar 2015 19:49:54 +0900 Subject: [PATCH 100/243] add missing property --- node/node.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 999ca9a0a..f20fdeb26 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -787,7 +787,10 @@ declare module "net" { ref(): void; remoteAddress: string; + remoteFamily: string; remotePort: number; + localAddress: string; + localPort: number; bytesRead: number; bytesWritten: number; From 13a44f823d85be646e895b2f3d970ba4dcb6e543 Mon Sep 17 00:00:00 2001 From: progre Date: Tue, 17 Mar 2015 19:54:04 +0900 Subject: [PATCH 101/243] add sample code --- log4js/log4js-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/log4js/log4js-tests.ts b/log4js/log4js-tests.ts index 10b6f9bbc..4fefc1caa 100644 --- a/log4js/log4js-tests.ts +++ b/log4js/log4js-tests.ts @@ -71,3 +71,4 @@ log4js.configure({ } }); +log4js.configure('file.json', { reloadSecs: 300 }); From 32194eaa6f9fd91364a8a18bc5591055e61f4bc5 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 17 Mar 2015 22:24:15 +0900 Subject: [PATCH 102/243] add commonjs module declarations to angular --- angularjs/angular-animate.d.ts | 6 +++++- angularjs/angular-cookies.d.ts | 5 +++++ angularjs/angular-mocks.d.ts | 12 ++++++++++- angularjs/angular-route.d.ts | 36 ++++++++++++++++++--------------- angularjs/angular-sanitize.d.ts | 7 ++++++- 5 files changed, 47 insertions(+), 19 deletions(-) diff --git a/angularjs/angular-animate.d.ts b/angularjs/angular-animate.d.ts index 833252177..2af591b7a 100644 --- a/angularjs/angular-animate.d.ts +++ b/angularjs/angular-animate.d.ts @@ -5,6 +5,10 @@ /// +declare module "angular-animate" { + var _: string; + export = _; +} /////////////////////////////////////////////////////////////////////////////// // ngAnimate module (angular-animate.js) @@ -27,7 +31,7 @@ declare module angular.animate { /** * Performs an inline animation on the element. - * + * * @param element the element that will be the focus of the animation * @param from a collection of CSS styles that will be applied to the element at the start of the animation * @param to a collection of CSS styles that the element will animate towards diff --git a/angularjs/angular-cookies.d.ts b/angularjs/angular-cookies.d.ts index 12208ae10..89a747f82 100644 --- a/angularjs/angular-cookies.d.ts +++ b/angularjs/angular-cookies.d.ts @@ -6,6 +6,11 @@ /// +declare module "angular-cookies" { + var _: string; + export = _; +} + /////////////////////////////////////////////////////////////////////////////// // ngCookies module (angular-cookies.js) /////////////////////////////////////////////////////////////////////////////// diff --git a/angularjs/angular-mocks.d.ts b/angularjs/angular-mocks.d.ts index 4b5408c15..db551ee3d 100644 --- a/angularjs/angular-mocks.d.ts +++ b/angularjs/angular-mocks.d.ts @@ -5,6 +5,16 @@ /// +declare module "angular-mocks/ngMock" { + var _: string; + export = _; +} + +declare module "angular-mocks/ngAnimateMock" { + var _: string; + export = _; +} + /////////////////////////////////////////////////////////////////////////////// // functions attached to global object (window) /////////////////////////////////////////////////////////////////////////////// @@ -59,7 +69,7 @@ declare module angular { flushNext(expectedDelay?: number): void; verifyNoPendingTasks(): void; } - + /////////////////////////////////////////////////////////////////////////// // IntervalService // see http://docs.angularjs.org/api/ngMock.$interval diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index 7d9d282fe..b791942a4 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -5,6 +5,10 @@ /// +declare module "angular-route" { + var _: string; + export = _; +} /////////////////////////////////////////////////////////////////////////////// // ngRoute module (angular-route.js) @@ -32,8 +36,8 @@ declare module angular.route { // to a controller that was not initialized as a result of a route maching. current?: ICurrentRoute; } - - + + /** * see http://docs.angularjs.org/api/ngRoute/provider/$routeProvider#when for API documentation */ @@ -54,24 +58,24 @@ declare module angular.route { /** * {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|{($routeParams?: ng.route.IRouteParamsService) : 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?: string|{ ($routeParams?: ng.route.IRouteParamsService): string; } /** * {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. */ @@ -79,9 +83,9 @@ declare module angular.route { /** * {(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() @@ -89,14 +93,14 @@ declare module angular.route { */ redirectTo?: string|{($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) : string}; /** - * Reload route when only $location.search() or $location.hash() changes. - * + * 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; @@ -115,21 +119,21 @@ declare module angular.route { 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/angular-sanitize.d.ts b/angularjs/angular-sanitize.d.ts index 4be812cdd..c8ab8e266 100644 --- a/angularjs/angular-sanitize.d.ts +++ b/angularjs/angular-sanitize.d.ts @@ -6,6 +6,11 @@ /// +declare module "angular-sanitize" { + var _: string; + export = _; +} + /////////////////////////////////////////////////////////////////////////////// // ngSanitize module (angular-sanitize.js) /////////////////////////////////////////////////////////////////////////////// @@ -25,7 +30,7 @@ declare module angular.sanitize { /////////////////////////////////////////////////////////////////////////// export module filter { - // Finds links in text input and turns them into html links. + // Finds links in text input and turns them into html links. // Supports http/https/ftp/mailto and plain email address links. // see http://code.angularjs.org/1.2.0/docs/api/ngSanitize.filter:linky interface ILinky { From cf087ab37c2389e5d6e8c21917cb4d8e3fee5e2c Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Tue, 17 Mar 2015 15:17:43 +0100 Subject: [PATCH 103/243] Add typings for timezonecomplete-1.15.0 --- timezonecomplete/timezonecomplete-tests.ts | 10 + timezonecomplete/timezonecomplete.d.ts | 2465 +++++++++++--------- 2 files changed, 1345 insertions(+), 1130 deletions(-) diff --git a/timezonecomplete/timezonecomplete-tests.ts b/timezonecomplete/timezonecomplete-tests.ts index 653aecd78..cb1c69282 100644 --- a/timezonecomplete/timezonecomplete-tests.ts +++ b/timezonecomplete/timezonecomplete-tests.ts @@ -19,6 +19,9 @@ n = tc.weekDayOnOrBefore(2014, 1, 14, tc.WeekDay.Monday); n = tc.secondOfDay(13, 59, 59); n = tc.weekOfMonth(2014, 1, 1); +s = tc.timeUnitToString(tc.TimeUnit.Second); +var tu: tc.TimeUnit = tc.stringToTimeUnit("bla"); + // DURATION var d: tc.Duration; @@ -54,6 +57,10 @@ d = d7.add(d6); d = d7.sub(d6); s = d7.toString(); +b = d7.equals(d6); +b = d7.equalsExact(d6); +b = d7.identical(d6); + // TIMEZONE var t: tc.TimeZone; @@ -148,6 +155,7 @@ 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.addLocal(tc.minutes(2)); dt = dt.sub(tc.Duration.seconds(2)); dt = dt.sub(2, tc.TimeUnit.Year); dt = dt.sub(2, tc.TimeUnit.Month); @@ -157,6 +165,7 @@ 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); +dt = dt.subLocal(tc.minutes(2)); 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())); @@ -181,6 +190,7 @@ s = tc.periodDstToString(tc.PeriodDst.RegularLocalTime); var p: tc.Period; p = new tc.Period(tc.DateTime.nowLocal(), 1, tc.TimeUnit.Hour, tc.PeriodDst.RegularLocalTime); +p = new tc.Period(tc.DateTime.nowLocal(), tc.hours(1), tc.PeriodDst.RegularLocalTime); dt = p.start(); n = p.amount(); var tu: tc.TimeUnit = p.unit(); diff --git a/timezonecomplete/timezonecomplete.d.ts b/timezonecomplete/timezonecomplete.d.ts index b2a76f70e..7a605a555 100644 --- a/timezonecomplete/timezonecomplete.d.ts +++ b/timezonecomplete/timezonecomplete.d.ts @@ -1,8 +1,7 @@ -// Type definitions for timezonecomplete 1.13.0 +// Type definitions for timezonecomplete 1.15.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' { import basics = require("__timezonecomplete/basics"); @@ -20,6 +19,8 @@ declare module 'timezonecomplete' { export import weekOfMonth = basics.weekOfMonth; export import dayOfYear = basics.dayOfYear; export import secondOfDay = basics.secondOfDay; + export import timeUnitToString = basics.timeUnitToString; + export import stringToTimeUnit = basics.stringToTimeUnit; import datetime = require("__timezonecomplete/datetime"); export import DateTime = datetime.DateTime; export import now = datetime.now; @@ -27,6 +28,9 @@ declare module 'timezonecomplete' { export import nowUtc = datetime.nowUtc; import duration = require("__timezonecomplete/duration"); export import Duration = duration.Duration; + export import years = duration.years; + export import months = duration.months; + export import days = duration.days; export import hours = duration.hours; export import minutes = duration.minutes; export import seconds = duration.seconds; @@ -54,1262 +58,1463 @@ declare module 'timezonecomplete' { declare module '__timezonecomplete/basics' { import javascript = require("__timezonecomplete/javascript"); + import DateFunctions = javascript.DateFunctions; /** - * Day-of-week. Note the enum values correspond to JavaScript day-of-week: - * Sunday = 0, Monday = 1 etc - */ + * 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, + Sunday = 0, + Monday = 1, + Tuesday = 2, + Wednesday = 3, + Thursday = 4, + Friday = 5, + Saturday = 6, } /** - * Time units - */ + * Time units + */ export enum TimeUnit { - Second = 0, - Minute = 1, - Hour = 2, - Day = 3, - Week = 4, - Month = 5, - Year = 6, + Millisecond = 0, + Second = 1, + Minute = 2, + Hour = 3, + Day = 4, + Week = 5, + Month = 6, + Year = 7, + /** + * End-of-enum marker, do not use + */ + MAX = 8, } /** - * 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. - */ + * 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 360 days (because 12 months of 30 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. - */ + * Time unit to lowercase string. If amount is specified, then the string is put in plural form + * if necessary. + * @param unit The unit + * @param amount If this is unequal to -1 and 1, then the result is pluralized + */ + export function timeUnitToString(unit: TimeUnit, amount?: number): string; + export function stringToTimeUnit(s: string): TimeUnit; + /** + * @return True iff the given year is a leap year. + */ export function isLeapYear(year: number): boolean; /** - * The days in a given year - */ + * 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 - */ + * @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 - */ + * 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 - */ + * 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 - */ + * 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. - */ + * 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. - */ + * 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] - */ + * 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 - */ + * 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. - */ + * 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 - */ + * 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. - */ + * 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. - */ + * 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 - */ + * 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 - */ + * 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; + /** + * 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: 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 WeekDay = basics.WeekDay; + import TimeUnit = basics.TimeUnit; import duration = require("__timezonecomplete/duration"); - import timesource = require("__timezonecomplete/timesource"); + import Duration = duration.Duration; import javascript = require("__timezonecomplete/javascript"); + import DateFunctions = javascript.DateFunctions; + import timesource = require("__timezonecomplete/timesource"); + import TimeSource = timesource.TimeSource; import timezone = require("__timezonecomplete/timezone"); + import TimeZone = timezone.TimeZone; /** - * Current date+time in local time - */ + * Current date+time in local time + */ export function nowLocal(): DateTime; /** - * Current date+time in UTC time - */ + * Current date+time in UTC time + */ export function nowUtc(): DateTime; /** - * Current date+time in the given time zone - * @param timeZone The desired time zone (optional, defaults to UTC). - */ - export function now(timeZone?: timezone.TimeZone): DateTime; + * Current date+time in the given time zone + * @param timeZone The desired time zone (optional, defaults to UTC). + */ + export function now(timeZone?: TimeZone): DateTime; /** - * DateTime class which is time zone-aware - * and which can be mocked for testing purposes. - */ + * 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 - */ - static nowLocal(): DateTime; - /** - * Current date+time in UTC time - */ - static nowUtc(): DateTime; - /** - * Current date+time in the given time zone - * @param timeZone The desired time zone (optional, defaults to UTC). - */ - static now(timeZone?: timezone.TimeZone): DateTime; - /** - * Create a DateTime from a Lotus 123 / Microsoft Excel date-time value - * i.e. a double representing days since 1-1-1900 where 1900 is incorrectly seen as leap year - */ - static fromExcel(n: number, 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; - /** - * Chops off the time part, yields the same date at 00:00:00.000 - * @return a new DateTime - */ - startOfDay(): DateTime; - /** - * @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 moment in time in UTC - */ - equals(other: DateTime): boolean; - /** - * @return True iff this and other represent the same time and 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; + /** + * 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; + /** + * Current date+time in local time + */ + static nowLocal(): DateTime; + /** + * Current date+time in UTC time + */ + static nowUtc(): DateTime; + /** + * Current date+time in the given time zone + * @param timeZone The desired time zone (optional, defaults to UTC). + */ + static now(timeZone?: TimeZone): DateTime; + /** + * Create a DateTime from a Lotus 123 / Microsoft Excel date-time value + * i.e. a double representing days since 1-1-1900 where 1900 is incorrectly seen as leap year + */ + static fromExcel(n: number, 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); + /** + * 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: DateFunctions, 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); + /** + * 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); + /** + * @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; + /** + * 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(): 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(): 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): 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): 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. + * @return this + duration + */ + add(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: 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(duration: Duration): DateTime; + addLocal(amount: number, unit: TimeUnit): DateTime; + /** + * Same as add(-1*duration); + */ + sub(duration: Duration): DateTime; + /** + * Same as add(-1*amount, unit); + */ + sub(amount: number, unit: TimeUnit): DateTime; + /** + * Same as addLocal(-1*amount, unit); + */ + subLocal(duration: Duration): DateTime; + subLocal(amount: number, unit: TimeUnit): DateTime; + /** + * Time difference between two DateTimes + * @return this - other + */ + diff(other: DateTime): Duration; + /** + * Chops off the time part, yields the same date at 00:00:00.000 + * @return a new DateTime + */ + startOfDay(): DateTime; + /** + * @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 moment in time in UTC + */ + equals(other: DateTime): boolean; + /** + * @return True iff this and other represent the same time and 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' { import basics = require("__timezonecomplete/basics"); + import TimeUnit = basics.TimeUnit; /** - * Construct a time duration - * @param n Number of hours (may be fractional or negative) - * @return A duration of n hours - */ + * Construct a time duration + * @param n Number of years (may be fractional or negative) + * @return A duration of n years + */ + export function years(n: number): Duration; + /** + * Construct a time duration + * @param n Number of months (may be fractional or negative) + * @return A duration of n months + */ + export function months(n: number): Duration; + /** + * Construct a time duration + * @param n Number of days (may be fractional or negative) + * @return A duration of n days + */ + export function days(n: number): Duration; + /** + * Construct a time duration + * @param n Number of hours (may be fractional or negative) + * @return A duration of n hours + */ export function hours(n: number): Duration; /** - * Construct a time duration - * @param n Number of minutes (may be fractional or negative) - * @return A duration of n minutes - */ + * Construct a time duration + * @param n Number of minutes (may be fractional or negative) + * @return A duration of n minutes + */ export function minutes(n: number): Duration; /** - * Construct a time duration - * @param n Number of seconds (may be fractional or negative) - * @return A duration of n seconds - */ + * Construct a time duration + * @param n Number of seconds (may be fractional or negative) + * @return A duration of n seconds + */ export function seconds(n: number): Duration; /** - * Construct a time duration - * @param n Number of milliseconds (may be fractional or negative) - * @return A duration of n milliseconds - */ + * Construct a time duration + * @param n Number of milliseconds (may be fractional or negative) + * @return A duration of n milliseconds + */ export function milliseconds(n: number): 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. - */ + * Time duration which is represented as an amount and a unit e.g. + * '1 Month' or '166 Seconds'. The unit is preserved through calculations. + * + * It has two sets of getter functions: + * - second(), minute(), hour() etc, singular form: these can be used to create string representations. + * These return a part of your string representation. E.g. for 2500 milliseconds, the millisecond() part would be 500 + * - seconds(), minutes(), hours() etc, plural form: these return the total amount represented in the corresponding unit. + */ export class Duration { - /** - * Construct a time duration - * @param n Number of hours (may be fractional or negative) - * @return A duration of n hours - */ - static hours(n: number): Duration; - /** - * Construct a time duration - * @param n Number of minutes (may be fractional or negative) - * @return A duration of n minutes - */ - static minutes(n: number): Duration; - /** - * Construct a time duration - * @param n Number of seconds (may be fractional or negative) - * @return A duration of n seconds - */ - static seconds(n: number): Duration; - /** - * Construct a time duration - * @param n Number of milliseconds (may be fractional or negative) - * @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); - /** - * 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. - */ - 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; + /** + * Construct a time duration + * @param n Number of years (may be fractional or negative) + * @return A duration of n years + */ + static years(n: number): Duration; + /** + * Construct a time duration + * @param n Number of months (may be fractional or negative) + * @return A duration of n months + */ + static months(n: number): Duration; + /** + * Construct a time duration + * @param n Number of days (may be fractional or negative) + * @return A duration of n days + */ + static days(n: number): Duration; + /** + * Construct a time duration + * @param n Number of hours (may be fractional or negative) + * @return A duration of n hours + */ + static hours(n: number): Duration; + /** + * Construct a time duration + * @param n Number of minutes (may be fractional or negative) + * @return A duration of n minutes + */ + static minutes(n: number): Duration; + /** + * Construct a time duration + * @param n Number of seconds (may be fractional or negative) + * @return A duration of n seconds + */ + static seconds(n: number): Duration; + /** + * Construct a time duration + * @param n Number of milliseconds (may be fractional or negative) + * @return A duration of n milliseconds + */ + static milliseconds(n: number): Duration; + /** + * Construct a time duration of 0 + */ + constructor(); + /** + * Construct a time duration from a string in one of two formats: + * 1) [-]hhhh[:mm[:ss[.nnn]]] e.g. '-01:00:30.501' + * 2) amount and unit e.g. '-1 days' or '1 year'. The unit may be in singular or plural form and is case-insensitive + */ + 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. Default Millisecond. + */ + constructor(amount: number, unit?: TimeUnit); + /** + * @return another instance of Duration with the same value. + */ + clone(): Duration; + /** + * Returns this duration expressed in different unit (positive or negative, fractional). + * This is precise for Year <-> Month and for time-to-time conversion (i.e. Hour-or-less to Hour-or-less). + * It is approximate for any other conversion + */ + as(unit: TimeUnit): number; + /** + * Convert this duration to a Duration in another unit. You always get a clone even if you specify + * the same unit. + * This is precise for Year <-> Month and for time-to-time conversion (i.e. Hour-or-less to Hour-or-less). + * It is approximate for any other conversion + */ + convert(unit: TimeUnit): Duration; + /** + * The entire duration in milliseconds (negative or positive) + * For Day/Month/Year durations, this is approximate! + */ + milliseconds(): number; + /** + * The millisecond part of the duration (always positive) + * For Day/Month/Year durations, this is approximate! + * @return e.g. 400 for a -01:02:03.400 duration + */ + millisecond(): number; + /** + * The entire duration in seconds (negative or positive, fractional) + * For Day/Month/Year durations, this is approximate! + * @return e.g. 1.5 for a 1500 milliseconds duration + */ + seconds(): number; + /** + * The second part of the duration (always positive) + * For Day/Month/Year durations, this is approximate! + * @return e.g. 3 for a -01:02:03.400 duration + */ + second(): number; + /** + * The entire duration in minutes (negative or positive, fractional) + * For Day/Month/Year durations, this is approximate! + * @return e.g. 1.5 for a 90000 milliseconds duration + */ + minutes(): number; + /** + * The minute part of the duration (always positive) + * For Day/Month/Year durations, this is approximate! + * @return e.g. 2 for a -01:02:03.400 duration + */ + minute(): number; + /** + * The entire duration in hours (negative or positive, fractional) + * For Day/Month/Year durations, this is approximate! + * @return e.g. 1.5 for a 5400000 milliseconds duration + */ + hours(): number; + /** + * The hour part of a duration. This assumes that a day has 24 hours (which is not the case + * during DST changes). + */ + hour(): number; + /** + * DEPRECATED + * 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 + * For Day/Month/Year durations, this is approximate! + * @return e.g. 25 for a -25:02:03.400 duration + */ + wholeHours(): number; + /** + * The entire duration in days (negative or positive, fractional) + * This is approximate if this duration is not in days! + */ + days(): number; + /** + * The day part of a duration. This assumes that a month has 30 days. + */ + day(): number; + /** + * The entire duration in days (negative or positive, fractional) + * This is approximate if this duration is not in Months or Years! + */ + months(): number; + /** + * The month part of a duration. + */ + month(): number; + /** + * The entire duration in years (negative or positive, fractional) + * This is approximate if this duration is not in Months or Years! + */ + years(): number; + /** + * Non-fractional positive years + */ + wholeYears(): number; + /** + * Amount of units (positive or negative, fractional) + */ + amount(): number; + /** + * The unit this duration was created with + */ + unit(): TimeUnit; + /** + * Sign + * @return "-" if the duration is negative + */ + sign(): string; + /** + * Approximate if the durations have units that cannot be converted + * @return True iff (this < other) + */ + lessThan(other: Duration): boolean; + /** + * Approximate if the durations have units that cannot be converted + * @return True iff (this <= other) + */ + lessEqual(other: Duration): boolean; + /** + * Similar but not identical + * Approximate if the durations have units that cannot be converted + * @return True iff this and other represent the same time duration + */ + equals(other: Duration): boolean; + /** + * Similar but not identical + * Returns false if we cannot determine whether they are equal in all time zones + * so e.g. 60 minutes equals 1 hour, but 24 hours do NOT equal 1 day + * + * @return True iff this and other represent the same time duration + */ + equalsExact(other: Duration): boolean; + /** + * Same unit and same amount + */ + identical(other: Duration): boolean; + /** + * Approximate if the durations have units that cannot be converted + * @return True iff this > other + */ + greaterThan(other: Duration): boolean; + /** + * Approximate if the durations have units that cannot be converted + * @return True iff this >= other + */ + greaterEqual(other: Duration): boolean; + /** + * Approximate if the durations have units that cannot be converted + * @return The minimum (most negative) of this and other + */ + min(other: Duration): Duration; + /** + * Approximate if the durations have units that cannot be converted + * @return The maximum (most positive) of this and other + */ + max(other: Duration): Duration; + /** + * Approximate if the durations have units that cannot be converted + * Multiply with a fixed number. + * @return a new Duration of (this * value) + */ + multiply(value: number): Duration; + /** + * Approximate if the durations have units that cannot be converted + * 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) with the unit of this duration + */ + add(value: Duration): Duration; + /** + * Subtract a duration. + * @return a new Duration of (this - value) with the unit of this duration + */ + sub(value: Duration): Duration; + /** + * Return the absolute value of the duration i.e. remove the sign. + */ + abs(): Duration; + /** + * DEPRECATED + * String in [-]hhhh:mm:ss.nnn notation. All fields are + * always present except the sign. + */ + toFullString(): string; + /** + * String in [-]hhhh:mm[:ss[.nnn]] notation. + * @param full If true, then all fields are always present except the sign. Otherwise, seconds and milliseconds + * are chopped off if zero + */ + toHmsString(full?: boolean): string; + /** + * String in ISO 8601 notation e.g. 'P1M' for one month or 'PT1M' for one minute + */ + toIsoString(): string; + /** + * String representation with amount and unit e.g. '1.5 years' or '-1 day' + */ + 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. - */ + * 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, + /** + * 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 TimeUnit = basics.TimeUnit; + import duration = require("__timezonecomplete/duration"); + import Duration = duration.Duration; import datetime = require("__timezonecomplete/datetime"); + import DateTime = datetime.DateTime; /** - * Specifies how the period should repeat across the day - * during DST changes. - */ + * 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, + /** + * 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, + /** + * End-of-enum marker + */ + MAX = 2, } /** - * Convert a PeriodDst to a string: "regular intervals" or "regular local time" - */ + * 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. - */ + * 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. - * Defaults to RegularLocalTime. - */ - 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 true iff this period has the same effect as the given one. - * i.e. a period of 24 hours is equal to one of 1 day if they have the same UTC start moment - * and same dst. - */ - equals(other: Period): boolean; - /** - * Returns true iff this period was constructed with identical arguments to the other one. - */ - identical(other: Period): 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; + /** + * 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 interval The interval of the period + * @param dst Specifies how to handle Daylight Saving Time. Not relevant + * if the time zone of the start datetime does not have DST. + * Defaults to RegularLocalTime. + */ + constructor(start: DateTime, interval: Duration, dst?: PeriodDst); + /** + * 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. + * Defaults to RegularLocalTime. + */ + constructor(start: DateTime, amount: number, unit: TimeUnit, dst?: PeriodDst); + /** + * The start date + */ + start(): DateTime; + /** + * The interval + */ + interval(): Duration; + /** + * DEPRECATED + * The amount of units of the interval + */ + amount(): number; + /** + * DEPRECATED + * The unit of the interval + */ + unit(): 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; + /** + * 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, count?: number): DateTime; + /** + * Checks whether the given date is on a period boundary + * (expensive!) + */ + isBoundary(occurrence: DateTime): boolean; + /** + * Returns true iff this period has the same effect as the given one. + * i.e. a period of 24 hours is equal to one of 1 day if they have the same UTC start moment + * and same dst. + */ + equals(other: Period): boolean; + /** + * Returns true iff this period was constructed with identical arguments to the other one. + */ + identical(other: Period): 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. - */ + * 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; + /** + * Return the current date+time as a javascript Date object + */ + now(): Date; } /** - * Default time source, returns actual time - */ + * Default time source, returns actual time + */ export class RealTimeSource implements TimeSource { - now(): Date; + now(): Date; } } declare module '__timezonecomplete/timezone' { import javascript = require("__timezonecomplete/javascript"); + import DateFunctions = javascript.DateFunctions; /** - * The local time zone for a given date as per OS settings. Note that time zones are cached - * so you don't necessarily get a new object each time. - */ + * The local time zone for a given date as per OS settings. Note that time zones are cached + * so you don't necessarily get a new object each time. + */ export function local(): TimeZone; /** - * Coordinated Universal Time zone. Note that time zones are cached - * so you don't necessarily get a new object each time. - */ + * Coordinated Universal Time zone. Note that time zones are cached + * so you don't necessarily get a new object each time. + */ export function utc(): TimeZone; /** - * @param offset offset w.r.t. UTC in minutes, e.g. 90 for +01:30. Note that time zones are cached - * so you don't necessarily get a new object each time. - * @returns a time zone with the given fixed offset - */ + * @param offset offset w.r.t. UTC in minutes, e.g. 90 for +01:30. Note that time zones are cached + * so you don't necessarily get a new object each time. + * @returns a time zone with the given fixed offset + */ export function zone(offset: number): TimeZone; /** - * Time zone for an offset string or an IANA time zone string. Note that time zones are cached - * so you don't necessarily get a new object each time. - * @param s Empty string for no time zone (null is returned), - * "localtime" 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 - * @param dst Optional, default true: adhere to Daylight Saving Time if applicable. Note for - * "localtime", timezonecomplete will adhere to the computer settings, the DST flag - * does not have any effect. - */ + * Time zone for an offset string or an IANA time zone string. Note that time zones are cached + * so you don't necessarily get a new object each time. + * @param s Empty string for no time zone (null is returned), + * "localtime" 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 + * @param dst Optional, default true: adhere to Daylight Saving Time if applicable. Note for + * "localtime", timezonecomplete will adhere to the computer settings, the DST flag + * does not have any effect. + */ export function zone(name: string, dst?: boolean): TimeZone; /** - * The type of time zone - */ + * 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, + /** + * 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() - */ + * 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, + /** + * 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. - */ + * 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; - /** - * Time zone with a fixed offset - * @param offset offset w.r.t. UTC in minutes, e.g. 90 for +01:30 - */ - static zone(offset: number): TimeZone; - /** - * Time zone for an offset string or an IANA time zone string. Note that time zones are cached - * so you don't necessarily get a new object each time. - * @param s Empty string for no time zone (null is returned), - * "localtime" 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 - * @param dst Optional, default true: adhere to Daylight Saving Time if applicable. Note for - * "localtime", timezonecomplete will adhere to the computer settings, the DST flag - * does not have any effect. - */ - static zone(s: string, dst?: boolean): TimeZone; - /** - * Do not use this constructor, use the static - * TimeZone.zone() method instead. - * @param name NORMALIZED name, assumed to be correct - * @param dst Adhere to Daylight Saving Time if applicable, ignored for local time and fixed offsets - */ - constructor(name: string, dst?: boolean); - /** - * 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; - dst(): boolean; - /** - * 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; - /** - * Returns true iff the constructor arguments were identical, so UTC !== GMT - */ - identical(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; + /** + * 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; + /** + * Time zone with a fixed offset + * @param offset offset w.r.t. UTC in minutes, e.g. 90 for +01:30 + */ + static zone(offset: number): TimeZone; + /** + * Time zone for an offset string or an IANA time zone string. Note that time zones are cached + * so you don't necessarily get a new object each time. + * @param s Empty string for no time zone (null is returned), + * "localtime" 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 + * TZ database zone name may be suffixed with " without DST" to indicate no DST should be applied. + * In that case, the dst parameter is ignored. + * @param dst Optional, default true: adhere to Daylight Saving Time if applicable. Note for + * "localtime", timezonecomplete will adhere to the computer settings, the DST flag + * does not have any effect. + */ + static zone(s: string, dst?: boolean): TimeZone; + /** + * Do not use this constructor, use the static + * TimeZone.zone() method instead. + * @param name NORMALIZED name, assumed to be correct + * @param dst Adhere to Daylight Saving Time if applicable, ignored for local time and fixed offsets + */ + constructor(name: string, dst?: boolean); + /** + * 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; + dst(): boolean; + /** + * 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; + /** + * Returns true iff the constructor arguments were identical, so UTC !== GMT + */ + identical(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: 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: 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 DateTime = datetime.DateTime; import duration = require("__timezonecomplete/duration"); + import Duration = duration.Duration; /** - * Returns the minimum of two DateTimes - */ - export function min(d1: datetime.DateTime, d2: datetime.DateTime): datetime.DateTime; + * Returns the minimum of two DateTimes + */ + export function min(d1: DateTime, d2: DateTime): DateTime; /** - * Returns the minimum of two Durations - */ - export function min(d1: duration.Duration, d2: duration.Duration): duration.Duration; + * Returns the minimum of two Durations + */ + export function min(d1: Duration, d2: Duration): Duration; /** - * Returns the maximum of two DateTimes - */ - export function max(d1: datetime.DateTime, d2: datetime.DateTime): datetime.DateTime; + * Returns the maximum of two DateTimes + */ + export function max(d1: DateTime, d2: DateTime): DateTime; /** - * Returns the maximum of two Durations - */ - export function max(d1: duration.Duration, d2: duration.Duration): duration.Duration; + * Returns the maximum of two Durations + */ + export function max(d1: Duration, d2: Duration): Duration; + /** + * Returns the absolute value of a Duration + */ + export function abs(d: Duration): Duration; } From 7a3cda0271384cbff8ce7f3d804c865c72622037 Mon Sep 17 00:00:00 2001 From: ryan-codingintrigue Date: Tue, 17 Mar 2015 18:38:47 +0000 Subject: [PATCH 104/243] Fixed casing on typescriptServices import --- fetch/fetch.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch/fetch.d.ts b/fetch/fetch.d.ts index 5d39d2a56..18340110a 100644 --- a/fetch/fetch.d.ts +++ b/fetch/fetch.d.ts @@ -3,7 +3,7 @@ // Definitions by: Ryan Graham // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// /// declare class Request { From 3fe4c86588e4e396f5a0b1976634f9adf66007b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Castre?= Date: Wed, 18 Mar 2015 14:23:56 +0100 Subject: [PATCH 105/243] Add missing optional index parameter --- d3/d3.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index be4032921..099b6e72b 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -1817,7 +1817,7 @@ declare module D3 { (): number; (value: number): Axis; } - tickFormat(formatter: (value: any) => string): Axis; + tickFormat(formatter: (value: any, index?: number) => string): Axis; nice(count?: number): Axis; } From fa765633b5cfb318c9e0cab1dae87c52a6ac93f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Castre?= Date: Wed, 18 Mar 2015 14:26:13 +0100 Subject: [PATCH 106/243] Add missing methods and properties --- jquery.validation/jquery.validation.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jquery.validation/jquery.validation.d.ts b/jquery.validation/jquery.validation.d.ts index 118b19ef6..cb4d2f042 100644 --- a/jquery.validation/jquery.validation.d.ts +++ b/jquery.validation/jquery.validation.d.ts @@ -180,7 +180,7 @@ interface Validator * @param name The name of the method used to identify it and referencing it; this must be a valid JavaScript identifier * @param method The actual method implementation, returning true if an element is valid. First argument: Current value. Second argument: Validated element. Third argument: Parameters. */ - addMethod(name: string, method: (value: any, element: HTMLElement, params: any) => any, message?: any): void; + addMethod(name: string, method: (value: any, element: HTMLElement, params: any) => boolean, message?: string): void; /** * Validates a single element, returns true if it is valid, false otherwise. * @@ -223,9 +223,12 @@ interface Validator valid(): boolean; validElements(): HTMLElement[]; size(): number; + focusInvalid(): void; + messages: { [index: string]: string }; - errorMap: ErrorDictionary; + errorMap: ErrorDictionary; errorList: ErrorListItem[]; + methods: { [index: string]: Function }; } interface JQuery From 0519a10af3694704adbf32e86eeffbe8faa681bf Mon Sep 17 00:00:00 2001 From: trystanclarke Date: Wed, 18 Mar 2015 16:06:34 +0000 Subject: [PATCH 107/243] added fitToContent method to Paper in jointjs.d.ts --- jointjs/jointjs.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/jointjs/jointjs.d.ts b/jointjs/jointjs.d.ts index 19e239445..403cb5c79 100644 --- a/jointjs/jointjs.d.ts +++ b/jointjs/jointjs.d.ts @@ -78,6 +78,7 @@ declare module joint { findViewByModel(modelOrId:any):CellView; findViewsFromPoint(p:{ x: number; y: number; }):CellView[]; findViewsInArea(r:{ x: number; y: number; width: number; height: number; }):CellView[]; + fitToContent(): void; } class ElementView extends CellView { From d15416da9d5489861d4b2488fcac97a52916f304 Mon Sep 17 00:00:00 2001 From: trystanclarke Date: Wed, 18 Mar 2015 16:11:16 +0000 Subject: [PATCH 108/243] fitToContent takes optional parameter 'opt' --- jointjs/jointjs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jointjs/jointjs.d.ts b/jointjs/jointjs.d.ts index 403cb5c79..eb03edbc7 100644 --- a/jointjs/jointjs.d.ts +++ b/jointjs/jointjs.d.ts @@ -78,7 +78,7 @@ declare module joint { findViewByModel(modelOrId:any):CellView; findViewsFromPoint(p:{ x: number; y: number; }):CellView[]; findViewsInArea(r:{ x: number; y: number; width: number; height: number; }):CellView[]; - fitToContent(): void; + fitToContent(opt?:any): void; } class ElementView extends CellView { From b35ac04569bc1fefa0bed0886c553c91afb6bf7f Mon Sep 17 00:00:00 2001 From: Vincent Siao Date: Wed, 18 Mar 2015 09:46:36 -0700 Subject: [PATCH 109/243] React 0.13.0->0.13.1 and make arguments to Component constructor optional --- react/react-addons-global.d.ts | 2 +- react/react-addons.d.ts | 4 ++-- react/react-global.d.ts | 4 ++-- react/react.d.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/react/react-addons-global.d.ts b/react/react-addons-global.d.ts index 5a6608dbb..891e0d101 100644 --- a/react/react-addons-global.d.ts +++ b/react/react-addons-global.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ReactWithAddons v0.13.0 (internal module) +// Type definitions for ReactWithAddons v0.13.1 (internal module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/react/react-addons.d.ts b/react/react-addons.d.ts index c09f5f641..54fce3ada 100644 --- a/react/react-addons.d.ts +++ b/react/react-addons.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ReactWithAddons v0.13.0 (external module) +// Type definitions for ReactWithAddons v0.13.1 (external module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -131,7 +131,7 @@ declare module "react/addons" { // Base component for plain JS classes class Component implements ComponentLifecycle { - constructor(props: P, context: any); + constructor(props?: P, context?: any); setState(f: (prevState: S, props: P) => S, callback?: () => any): void; setState(state: S, callback?: () => any): void; forceUpdate(): void; diff --git a/react/react-global.d.ts b/react/react-global.d.ts index 2b3a58523..f7b7859d4 100644 --- a/react/react-global.d.ts +++ b/react/react-global.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React v0.13.0 (internal module) +// Type definitions for React v0.13.1 (internal module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -131,7 +131,7 @@ declare module React { // Base component for plain JS classes class Component implements ComponentLifecycle { - constructor(props: P, context: any); + constructor(props?: P, context?: any); setState(f: (prevState: S, props: P) => S, callback?: () => any): void; setState(state: S, callback?: () => any): void; forceUpdate(): void; diff --git a/react/react.d.ts b/react/react.d.ts index c0d065167..64796ddf4 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React v0.13.0 (external module) +// Type definitions for React v0.13.1 (external module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -131,7 +131,7 @@ declare module "react" { // Base component for plain JS classes class Component implements ComponentLifecycle { - constructor(props: P, context: any); + constructor(props?: P, context?: any); setState(f: (prevState: S, props: P) => S, callback?: () => any): void; setState(state: S, callback?: () => any): void; forceUpdate(): void; From 73325dbcab4e32c1c5b607564373aaf25cdbfcb3 Mon Sep 17 00:00:00 2001 From: Tim Bureck Date: Wed, 18 Mar 2015 21:39:14 +0100 Subject: [PATCH 110/243] jBinary * Added static methods of jBinary class --- jbinary/jbinary-tests.ts | 6 ++++++ jbinary/jbinary.d.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/jbinary/jbinary-tests.ts b/jbinary/jbinary-tests.ts index c1e286fce..f5f2abcbb 100644 --- a/jbinary/jbinary-tests.ts +++ b/jbinary/jbinary-tests.ts @@ -1,5 +1,8 @@ /// +jBinary.loadData([0x05, 0x03, 0x7F, 0x1E]); +jBinary.load([0x05, 0x03, 0x7F, 0x1E]); + var originalData = [0x05, 0x03, 0x7F, 0x1E]; var b1 = new jBinary(originalData); console.log(b1.readAll()); @@ -14,3 +17,6 @@ b1.write('int8', 0x9A, 2); b1.writeAll(originalData); console.log(b1.slice(0, 2)); + +jBinary.saveAs('myfile.pdf', 'application/pdf'); +jBinary.toURI(); diff --git a/jbinary/jbinary.d.ts b/jbinary/jbinary.d.ts index f9a2f2aaa..062a6bbb8 100644 --- a/jbinary/jbinary.d.ts +++ b/jbinary/jbinary.d.ts @@ -13,6 +13,12 @@ declare class jBinary { + static loadData(source:any, callback?: (error:string, data:any) => any):any; + static load(source:any, typeSet?:any, callback?: (error:string, data:any) => any):any; + + static saveAs(destination:any, mimeType?:string, callback?: (error:string, data:any) => any):any; + static toURI(mimeType?:string):any; + constructor(data:Array); constructor(data:jDataView, typeSet:Object); constructor(bufferSize:number, typeSet:Object); From 66a3ac01bd1493f438a134c77e8e2f33951500c5 Mon Sep 17 00:00:00 2001 From: William Fortin Date: Wed, 18 Mar 2015 16:51:22 -0400 Subject: [PATCH 111/243] Update underscore.string.ts to support new 3.0.0 api The prebuild library now exports a `s` instead of beign embedded in `_.str` See changelog : https://github.com/epeli/underscore.string/blob/master/CHANGELOG.markdown#300 I've kept the interface UnderscoreStatic to support 2.x --- underscore.string/underscore.string.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/underscore.string/underscore.string.d.ts b/underscore.string/underscore.string.d.ts index 38271f3de..1b08dcf85 100644 --- a/underscore.string/underscore.string.d.ts +++ b/underscore.string/underscore.string.d.ts @@ -10,6 +10,8 @@ interface UnderscoreStatic { string: UnderscoreStringStatic; } +declare var s : UnderscoreStringStatic; + interface UnderscoreStringStatic extends UnderscoreStringStaticExports { /** * Tests if string contains a substring. From e31c166f30deef651988d4a3a1e1b62f009ba5c0 Mon Sep 17 00:00:00 2001 From: Chris Seufert Date: Thu, 19 Mar 2015 12:15:45 +1100 Subject: [PATCH 112/243] Intercom.JS - Added off method --- intercomjs/intercom-tests.ts | 2 ++ intercomjs/intercom.d.ts | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/intercomjs/intercom-tests.ts b/intercomjs/intercom-tests.ts index be25ba7db..89729ca28 100644 --- a/intercomjs/intercom-tests.ts +++ b/intercomjs/intercom-tests.ts @@ -17,4 +17,6 @@ function test_intercom_static() { console.log(onceListenerInvokedTimes === 1); instance.emit("eventWithoutAMessage"); + + instance.off("test", detect); } diff --git a/intercomjs/intercom.d.ts b/intercomjs/intercom.d.ts index c149c827d..888f587a5 100644 --- a/intercomjs/intercom.d.ts +++ b/intercomjs/intercom.d.ts @@ -17,6 +17,12 @@ declare module intercom { * @param fn The listener method to invoke. */ on(name: string, fn: Function): void; + /** + * Remove a registered event listener + * @param name The string event listener name. + * @param fn The listener method to remove. + */ + off(name: string, fn: Function): void; /** * Given a unique key to represent the function, fn will be invoked in only one window. The ttl argument represents the number of seconds before the function can be called again. * @param key The unique function identifier key From 20a7a9419ac98fd782e2ad6abb763f6ac6ba0aa9 Mon Sep 17 00:00:00 2001 From: ColsaCorp Date: Wed, 18 Mar 2015 22:56:48 -0500 Subject: [PATCH 113/243] Create mssql.d.ts Initial creation of MSSQL database connector for Node.js defintion --- mssql/mssql.d.ts | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 mssql/mssql.d.ts diff --git a/mssql/mssql.d.ts b/mssql/mssql.d.ts new file mode 100644 index 000000000..dcdd0f700 --- /dev/null +++ b/mssql/mssql.d.ts @@ -0,0 +1,96 @@ +// Type definitions for mssql +// Project: https://www.npmjs.com/package/mssql +// Definitions by: COLSA Corporation +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "mssql" { + + export var DateTime: any; + export var NVarChar: any; + export var Int: any; + export var Bit: any; + export var VarBinary: any; + export var TVP: any; + + export interface options { + encrypt: boolean; + } + + export interface pool { + min: number; + max: number; + idleTimeoutMillis: number; + } + + export interface config { + driver?: string; + user?: string; + password?: string; + server: string; + port?: number; + domain?: string; + database: string; + connectionTimeout?: number; + requestTimeout?: number; + stream?: boolean; + options?: options; + pool?: pool; + + } + + export class Connection { + + public constructor(config: config, callback?: (err?: any) => void); + + public connect(callback?: (err?: any) => void); + + public close(); + } + + class columns { + public add(name: string, type: any, options: any); + } + + class rows { + public add(any); + } + + export class Table { + public create: boolean; + public columns: columns; + public rows: rows; + public constructor(tableName: string); + + } + + export class Request { + public constructor(connection?: Connection); + public execute(procedure: string, callback?: (err?: any, recordsets?: any, returnValue?: any) => void); + public input(name: string, value: any); + public input(name: string, type: any, value: any); + public output(name: string, type: any, value?: any); + public pipe(stream: any); + public query(command: string, callback?: (err?: any, recordset?: any) => void); + public batch(batch: string, callback?: (err?: any, recordset?: any) => void); + public bulk(table: Table, callback?: (err?: any, rowCount?: any) => void); + public cancel(); + public parameters: any; + } + + export class Transaction { + public constructor(connection?: Connection); + public begin(isolationLevel?: any, callback?: (err?: any) => void); + public begin(callback?: (err?: any) => void); + public commit(callback?: (err?: any) => void); + public rollback(callback?: (err?: any) => void); + } + + export class PreparedStatement { + public constructor(connection?: Connection); + public input(name: string, type: any); + public output(name: string, type: any); + public prepare(statement: string, callback?: (err?: any) => void); + public execute(values: any, callback?: (err?: any) => void); + public unprepare(callback?: (err?: any) => void); + } +} From d0087d3ab84b49c80cc4770117526774403b889c Mon Sep 17 00:00:00 2001 From: ColsaCorp Date: Wed, 18 Mar 2015 22:57:36 -0500 Subject: [PATCH 114/243] Create mssql-tests.ts Tests for MSSQL database connector for Node.js --- mssql/mssql-tests.ts | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 mssql/mssql-tests.ts diff --git a/mssql/mssql-tests.ts b/mssql/mssql-tests.ts new file mode 100644 index 000000000..5a7e3e305 --- /dev/null +++ b/mssql/mssql-tests.ts @@ -0,0 +1,70 @@ +/// +/// + +import sql = require('mssql'); + +var config: sql.config = { + user: 'user', + password: 'password', + server: 'ip', + database: 'database', + connectionTimeout: 10000, + options: { + encrypt: true + } +} + +var connection: sql.Connection = new sql.Connection(config, function (err: any) { + if (err != null) { + console.warn("Issue with connecting to SQL Server!"); + } + else { + var requestQuery = new sql.Request(connection); + + var getArticlesQuery = "SELECT * FROM TABLE"; + + requestQuery.query(getArticlesQuery, function (err, recordSet) { + if (err) { + console.error('Error happened calling Query: ' + err.name + " " + err.message); + + } + // checking to see if the articles returned as at least one. + else if (recordSet.length > 0) { + } + }); + + var requestStoredProcedure = new sql.Request(connection); + var testId: number = 0; + var testString: string = 'test'; + + requestStoredProcedure.input('pId', testId); + requestStoredProcedure.input('pString', testString); + + + requestStoredProcedure.execute('StoredProcedureName', function (err, recordsets, returnValue) { + if (err != null) { + console.error('Error happened calling Query: ' + err.name + " " + err.message); + } + else { + console.info(returnValue); + } + }); + + var requestStoredProcedureWithOutput = new sql.Request(connection); + var testId: number = 0; + var testString: string = 'test'; + + requestStoredProcedure.input('pId', testId); + requestStoredProcedure.input('pString', testString); + requestStoredProcedure.output('output', sql.Int); + + requestStoredProcedure.execute('StoredProcedureName', function (err, recordsets, returnValue) { + if (err != null) { + console.error('Error happened calling Query: ' + err.name + " " + err.message); + } + else { + console.info(requestStoredProcedureWithOutput.parameters.output.value); + } + }); + } +}); From 1276cc4c1b6fee7ca3b11e960c5eccaff9f0d424 Mon Sep 17 00:00:00 2001 From: ColsaCorp Date: Wed, 18 Mar 2015 22:59:17 -0500 Subject: [PATCH 115/243] Create s3-uploader.d.ts Very simple definition of s3-uploader. --- s3-uploader.d.ts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 s3-uploader.d.ts diff --git a/s3-uploader.d.ts b/s3-uploader.d.ts new file mode 100644 index 000000000..215cb7df6 --- /dev/null +++ b/s3-uploader.d.ts @@ -0,0 +1,39 @@ +// Type definitions for s3-uploader +// Project: https://www.npmjs.com/package/s3-uploader +// Definitions by: COLSA Corporation +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +//NOTE: Does require GM (https://github.com/aheckmann/gm) thus requires GraphicsMagick (http://www.graphicsmagick.org/) or ImageMagick (http://www.imagemagick.org/) + +declare module "s3-uploader" { + export = Upload; +} +interface S3UploaderVersion { + original?: boolean; + suffix?: string; + quality?: number; + maxWidth?: number; + maxHeight?: number; +} + +interface S3UploaderOptions { + awsAccessKeyId?: string; + awsSecretAccessKey?: string; + awsBucketRegion?: string; + awsBucketPath?: string; + awsBucketAcl?: string; + awsMaxRetries?: number; + awsHttpTimeout?: number; + resizeQuality?: number; + returnExif?: boolean; + tmpDir?: string; + workers?: number; + url?: string; + versions?: S3UploaderVersion; +} + +declare class Upload { + public constructor(awsBucketName: string, opts: S3UploaderOptions); + + public upload(src: string, opts?: S3UploaderOptions, cb?: (err, images, meta) => void); +} From 69f007ab58e73567b00a7062a57a404d1dac94f7 Mon Sep 17 00:00:00 2001 From: ColsaCorp Date: Wed, 18 Mar 2015 22:59:53 -0500 Subject: [PATCH 116/243] Create s3-uploader-tests.ts Tests for s3-uploader --- s3-uploader/s3-uploader-tests.ts | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 s3-uploader/s3-uploader-tests.ts diff --git a/s3-uploader/s3-uploader-tests.ts b/s3-uploader/s3-uploader-tests.ts new file mode 100644 index 000000000..6fa065866 --- /dev/null +++ b/s3-uploader/s3-uploader-tests.ts @@ -0,0 +1,44 @@ +/// +/// + +//NOTE: Does require GM (https://github.com/aheckmann/gm) thus requires GraphicsMagick (http://www.graphicsmagick.org/) or ImageMagick (http://www.imagemagick.org/) + +import Upload = require('s3-uploader'); + +var s3VersionOriginal: S3UploaderVersion = { + original: true +}; + +var s3VersionHeader: S3UploaderVersion = { + suffix: '-header', + quality: 100, + maxHeight: 300, + maxWidth: 600 +} + +var s3Config: S3UploaderOptions = { + awsAccessKeyId: 'awsKeyId', + awsSecretAccessKey: 'awsSecretAccessKey', + awsBucketPath: '', + awsBucketRegion: 'us-east-1' /*Whatever region s3 is located*/, + awsBucketAcl: 'public-read', + awsHttpTimeout: 60000, + versions: [s3VersionOriginal, s3VersionHeader] +} + +var client = new Upload('bucketName', s3Config); + +client.upload('/images/File.png', s3Config, function (err, images, meta) { + var returnVal: boolean = false; + if (err) { + console.log(err); + } + else { + if (images.length >= 2) { + var originalImageUrl = images[0].url; + var headerImageUrl = images[1].url; + + console.log('Original: ' + originalImageUrl + ' headerImageUrl: ' + headerImageUrl); + } + } +}); From d16d2710ca617aecfbd63a93ef38e2457c291be1 Mon Sep 17 00:00:00 2001 From: Toshiya Nakakura Date: Thu, 19 Mar 2015 15:07:06 +0900 Subject: [PATCH 117/243] add johnny-five/johnny-five.d.ts --- johnny-five/johnny-five-tests.ts | 255 ++++++++++++++ johnny-five/johnny-five.d.ts | 588 +++++++++++++++++++++++++++++++ 2 files changed, 843 insertions(+) create mode 100644 johnny-five/johnny-five-tests.ts create mode 100644 johnny-five/johnny-five.d.ts diff --git a/johnny-five/johnny-five-tests.ts b/johnny-five/johnny-five-tests.ts new file mode 100644 index 000000000..930a67ea8 --- /dev/null +++ b/johnny-five/johnny-five-tests.ts @@ -0,0 +1,255 @@ +/// + +import five = require('johnny-five'); +var board = new five.Board(); + +board.on('connect', function(){ +}); + +board.on('ready', function(){ + var accelerometer = new five.Accelerometer({ + controller: "MPU6050", + sensitivity: 16384 // optional + }); + + var servo = new five.Servo(9); + var animation = new five.Animation(servo); + + // Create an animation segment object + animation.enqueue({ + duration: 2000, + cuePoints: [0, 0.25, 0.5, 0.75, 1.0], + keyFrames: [ {degrees: 0}, {degrees: 135}, {degrees: 45}, {degrees: 180}, {degrees: 0}] + }); + + // Create a new `button` hardware instance. + var button = new five.Button(8); + + button.on("hold", function() { + console.log( "Button held" ); + }); + + button.on("press", function() { + console.log( "Button pressed" ); + }); + + button.on("release", function() { + console.log( "Button released" ); + }); + + + var compass = new five.Compass({ + controller: "HMC6352" + }); + + compass.on("headingchange", function() { + console.log("headingchange"); + console.log(" heading : ", Math.floor(this.heading)); + console.log(" bearing : ", this.bearing.name); + console.log("--------------------------------------"); + }); + + compass.on("data", function() { + console.log(" heading : ", Math.floor(this.heading)); + console.log(" bearing : ", this.bearing.name); + console.log("--------------------------------------"); + }); + + var esc = new five.ESC(11); + + // Set to top speed. (this can be physically dangerous, you've been warned.) + esc.max(); + + + var gyro = new five.Gyro({ + pins: ["A0", "A1"], + sensitivity: 0.67, // optional + resolution: 4.88 // optional + }); + + var accel = new five.IMU({ + controller: "MPU6050", + address: 0x68, // optional + freq: 100 // optional + }); + + var motion = new five.IR.Motion(7); + +// Options object with pin property + var motion = new five.IR.Motion({ + pin: 7 + }); + + var proximity = new five.IR.Proximity({ + controller: "GP2Y0A21YK", + pin: "A0" + }); + + var eyes = new five.IR.Reflect.Array({ + emitter: 13, + pins: ["A0", "A1", "A2"], // any number of pins + freq: 25 + }); + + eyes.on('data', function() { + console.log( "Raw Values: ", this.raw ); + }); + + eyes.on('line', function() { + console.log( "Line Position: ", this.line); + }); + + eyes.enable(); + + var joystick = new five.Joystick({ + pins: ["A0", "A1"] + }); + joystick.on("data", (value)=>{ + console.log(value); + }); + + joystick.on("axismove", (err, value)=>{ + console.log("change"); + + console.log(joystick.axis); + console.log(joystick.raw); + console.log(err); + console.log(value); + }); + + var lcd = new five.LCD({ + pins: [8, 9, 4, 5, 6, 7], + backlight: 13, + rows: 2, + cols: 16 + }); + + var led = new five.Led(13); + led.blink(); + + var digits = new five.Led.Digits({ + pins: { + data: 2, + clock: 3, + cs: 4 + } + }); + + var matrix = new five.Led.Matrix({ + controller: "HT16K33", + dims: "8x16", // or "16x8" + rotation: 2 + }); + + // With Options object & pins array + var rgb = new five.Led.RGB({ + pins: [9, 10, 11] + }); + + var motor = new five.Motor({ + pins: { + pwm:9, + dir:8, + brake: 11 + } + }); + + var piezo = new five.Piezo(3); + + // Plays a song + piezo.play({ + // song is composed by an array of pairs of notes and beats + // The first argument is the note (null means "no note") + // The second argument is the length of time (beat) of the note (or non-note) + song: [ + ["C4", 1 / 4], + ["D4", 1 / 4], + ["F4", 1 / 4], + ["D4", 1 / 4], + ["A4", 1 / 4], + [null, 1 / 4], + ["A4", 1], + ["G4", 1], + [null, 1 / 2], + ["C4", 1 / 4], + ["D4", 1 / 4], + ["F4", 1 / 4], + ["D4", 1 / 4], + ["G4", 1 / 4], + [null, 1 / 4], + ["G4", 1], + ["F4", 1], + [null, 1 / 2] + ], + tempo: 100 + }); + + var digital = new five.Pin({ + pin: 13 + }); + + var analog = new five.Pin({ + pin: "A0" + }); + + var analogAsDigital = new five.Pin({ + pin: 14, + type: "digital" + }); + + var ping = new five.Ping(7); + + var ping = new five.Ping({ + pin: 7 + }); + + var relay = new five.Relay(10); + +// Options object with pin property + var relay = new five.Relay({ + pin: 10 + }); + + var sensor = new five.Sensor("A0"); + + sensor.scale([ 0, 10 ]).on("data", function() { + console.log( this.value ); + }); + + var servo = new five.Servo({ + pin: 10, + range: [45, 135] + }); + + var register = new five.ShiftRegister({ + pins: { + data: 2, + clock: 3, + latch: 4 + } + }); + + var sonar = new five.Sonar("A0"); + + sonar.on("data", function() { + console.log("inches : " + this.in); + console.log("centimeters: " + this.cm); + console.log("-----------------------"); + }); + + var stepper = new five.Stepper({ + type: five.Stepper.TYPE.DRIVER, + stepsPerRev: 200, + pins: { + step: 11, + dir: 12 + } + }); + + var temperature = new five.Temperature({ + pin: "A0", + toCelsius: function(raw) { // optional + return (raw / 100) + 10; + } + }); +}); diff --git a/johnny-five/johnny-five.d.ts b/johnny-five/johnny-five.d.ts new file mode 100644 index 000000000..9dd1477eb --- /dev/null +++ b/johnny-five/johnny-five.d.ts @@ -0,0 +1,588 @@ +// Type definitions for johnny-five +// Project: https://github.com/rwaldron/johnny-five +// Definitions by: Toshiya Nakakura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "johnny-five" { + export interface AccelerometerOption{ + controller: string; + } + + export interface AccelerometerGeneralOption{ + controller?: string; + } + + export interface AccelerometerAnalogOption extends AccelerometerGeneralOption{ + pins: Array; + sensitivity?: number; + aref?: number; + zeroV?: number | Array; + autoCalibrate?: boolean; + } + + export interface AccelerometerMPU6050Option extends AccelerometerGeneralOption{ + sensitivity?: number; + } + + export interface AccelerometerMMA7361Option extends AccelerometerGeneralOption{ + sleepPin?: number | string; + } + + export class Accelerometer{ + constructor(option: AccelerometerGeneralOption | AccelerometerAnalogOption | AccelerometerMPU6050Option | AccelerometerMMA7361Option); + on(event: string, cb: ()=>void): void; + on(event: "change", cb: ()=>void): void; + on(event: "data", cb: (freq: any)=>void): void; + hasAxis(name: string): void; + enable(): void; + disable(): void; + } + + export class Animation{ + constructor(option: Servo | Array); + enqueue(segment: any): void; + play(): void; + pause(): void; + stop(): void; + next(): void; + speed(speed: Array): void; + + target: number; + duration: number; + cuePoints: Array; + keyFrames: number; + easing: string; + loop: boolean; + loopback: number; + metronomic: boolean; + progress: number; + currentSpeed: number; + fps: number; + } + + export interface ButtonOptions{ + pin: number | string; + invert?: boolean; + isPullup?: boolean; + holdtime?: number; + } + + export class Button{ + constructor(pin: number | string | ButtonOptions); + on(event: string, cb: ()=>void): void; + on(event: "hold", cb: (holdTime: number)=>void): void; + on(event: "down", cb: ()=>void): void; + on(event: "press", cb: ()=>void): void; + on(event: "up", cb: ()=>void): void; + on(event: "release", cb: ()=>void): void; + } + + export interface BoardOptions{ + id?: number | string; + port?: string | any; + repl?: boolean; + } + + export interface Repl{ + inject(object: any): void; + } + + export class Board{ + constructor(option?: BoardOptions); + on(event: string, cb: ()=>void): void; + on(event: "ready", cb: ()=>void): void; + on(event: "connect", cb: ()=>void): void; + pinMode(pin: number, mode: number): void; + analogWrite(pin: number, value: number): void; + analogRead(pin: number, cb: (item: number)=>void): void; + digitalWrite(pin: number, value: number): void; + digitalRead(pin: number, cb: (item: number)=>void): void; + shiftOut(dataPin: Pin, clockPin: Pin, isBigEndian: boolean, value: number): void; + wait(ms: number, cb: ()=>void): void; + loop(ms: number, cb: ()=>void): void; + + isReady: boolean; + io: any; + id: string; + pins: Array; + port: string; + inject: Repl; + } + + export interface CompassOptions{ + controller: string; + gauss?: number; + } + + export class Compass{ + constructor(option: CompassOptions); + on(event: string, cb: ()=>void): void; + on(event: "change", cb: ()=>void): void; + on(event: "data", cb: (data: any)=>void): void; + } + + export interface ESCOption{ + pin: number | string; + range?: Array; + startAt?: number; + } + + export class ESC{ + constructor(option: number | string | ESCOption); + speed(value: number): void; + min(): void; + max(): void; + stop(): void; + } + + export interface GyroGeneralOption{ + controller?: string; + } + + export interface GyroAnalogOption extends GyroGeneralOption{ + pins: Array; + sensitivity: number; + resolution?: number; + } + + export interface GyroMPU6050Option extends GyroGeneralOption{ + sensitivity: number; + } + + export class Gyro{ + constructor(option: GyroGeneralOption | GyroAnalogOption | GyroMPU6050Option); + on(event: string, cb: ()=>void): void; + on(event: "change", cb: ()=>void): void; + on(event: "data", cb: (data: any)=>void): void; + recalibrate(): void; + } + + export interface IMUGeneralOption{ + controller?: string; + freq?: number; + } + + export interface IMUMPU6050Option extends IMUGeneralOption{ + address: number; + } + + export class IMU{ + constructor(option: IMUGeneralOption | IMUMPU6050Option); + on(event: string, cb: ()=>void): void; + on(event: "change", cb: ()=>void): void; + on(event: "data", cb: (data: any)=>void): void; + } + + export module IR{ + export interface MotionOption{ + pin: number | string; + } + + export class Motion{ + constructor(option: number | MotionOption); + on(event: string, cb: ()=>void): void; + on(event: "data", cb: (data: any)=>void): void; + on(event: "motionstart", cb: ()=>void): void; + on(event: "motionend", cb: ()=>void): void; + on(event: "calibrated", cb: ()=>void): void; + } + + export interface PloximityOption{ + pin: number | string; + controller: string; + } + + export class Proximity{ + constructor(option: number | PloximityOption); + on(event: string, cb: ()=>void): void; + on(event: "data", cb: (data: any)=>void): void; + on(event: "change", cb: ()=>void): void; + } + + export interface ArrayOption{ + pins: Array | Array; + emitter: number | string; + freq?: number; + } + + export interface LoadCalibrationOption{ + min: Array; + max: Array; + } + + export module Reflect{ + export class Array{ + constructor(option: ArrayOption); + enable(): void; + disable(): void; + calibrate(): void; + calibrateUntil(predicate: ()=>void): void; + loadCalibration(option: LoadCalibrationOption): void; + on(event: string, cb: ()=>void): void; + on(event: "data", cb: (data: any)=>void): void; + on(event: "calibratedData", cb: (data: any)=>void): void; + on(event: "line", cb: (data: any)=>void): void; + } + } + } + + export interface JoystickOption{ + pins: Array; + } + + export class Joystick{ + constructor(option: JoystickOption); + on(event: string, cb: ()=>void): void; + on(event: "data", cb: (data: any)=>void): void; + on(event: "change", cb: ()=>void): void; + on(event: "axismove", cb: (error: Error, date: Date)=>void): void; + + axis: Array; + raw: Array; + } + + + export interface LCDGeneralOption{ + rows?: number; + cols?: number; + } + + export interface LCDI2COption extends LCDGeneralOption{ + controller: string; + } + + export interface LCDParallelOption extends LCDGeneralOption{ + pins: Array; + } + + export class LCD{ + constructor(option: LCDGeneralOption | LCDI2COption | LCDParallelOption); + print(message: string): void; + useChar(char: string): void; + clear(): void; + cursor(row: number, col: number): void; + home(): void; + display(): void; + noDisplay(): void; + blink(): void; + noBlink(): void; + autoscroll(): void; + noAutoscroll(): void; + } + + export interface LedOption{ + pin: number; + type?: string; + controller?: string; + address?: number; + isAnode?: boolean; + } + + export class Led{ + constructor(option: number | LedOption); + on(): void; + off(): void; + toggle(): void; + strobe(ms: number): void; + blink(): void; + blink(ms: number): void; + brightness(val: number): void; + fade(brightness: number, ms: number): void; + fadeIn(ms: number): void; + fadeOut(ms: number): void; + pulse(ms: number): void; + stop(ms: number): void; + } + + export module Led{ + export interface DigitsOption{ + pins: any; + devices?: number; + } + + export class Digits{ + constructor(option: DigitsOption); + on(): void; + on(index: number): void; + off(): void; + off(index: number): void; + clear(): void; + clear(index: number): void; + brightness(value: number): void; + brightness(index: number, value: number): void; + draw(position: number, character: number): void; + draw(index: number, position: number, character: number): void; + } + + export interface MatrixOption{ + pins: any; + devices?: number; + } + + export interface MatrixIC2Option{ + controller: string; + addresses?: Array; + isBicolor?: boolean; + dims? :any; + rotation?: number; + } + + export class Matrix{ + constructor(option: MatrixOption | MatrixIC2Option); + on(): void; + on(index: number): void; + off(): void; + off(index: number): void; + clear(): void; + clear(index: number): void; + brightness(value: number): void; + brightness(index: number, value: number): void; + led(row: number, col: number, state: any): void; + led(index: number, row: number, col: number, state: any): void; + row(row: number, val: number): void; + row(index: number, row: number, val: number): void; + column(row: number, val: number): void; + column(index: number, row: number, val: number): void; + draw(position: number, character: number): void; + draw(index: number, position: number, character: number): void; + } + + export interface RGBOption{ + pins: Array; + isAnode?: boolean; + controller?: string; + } + + export class RGB{ + constructor(option: RGBOption); + on(): void; + off(): void; + color(value: number): void; + toggle(): void; + strobe(ms: number): void; + brightness(value: number): void; + fadeIn(ms: number): void; + fadeOut(ms: number): void; + pulse(ms: number): void; + stop(ms: number): void; + } + } + + export interface MotorOption{ + pins: any; + current?: any; + invertPWM?: boolean; + address?: number; + controller?: string; + register?: any; + bits?: any; + } + + export class Motor{ + constructor(option: Array | MotorOption); + forward(speed: number): void; + fwd(speed: number): void; + reverse(speed: number): void; + rev(speed: number): void; + start(): void; + start(speed: number): void; + stop(): void; + brake(): void; + release(): void; + } + + export interface PiezoOption{ + pin: number; + } + + export class Piezo{ + constructor(option: number | PiezoOption); + frequency(frequency: number, duration: number): void; + play(tune: any, cb?: ()=>void): void; + tone(frequency: number, duration: number): void; + noTone(): void; + off(): void; + } + + export interface PinOption{ + id?: number | string; + pin: number | string; + type?: string; + } + + export interface PinState{ + supportedModes: Array; + mode: number; + value: number; + report: number; + analogChannel: number; + } + + export class Pin{ + constructor(option: number | string | PinOption); + query(cb: (pin: PinState)=>void): void; + high(): void; + low(): void; + write(value: number): void; + read(cb: (value: number)=>void): void; + static write(pin: number, value: number): void; + static read(pin: number, cb: (data: number)=>void): void; + } + + export interface PingOption{ + pin: number | string; + freq?: number; + pulse?: number; + } + + export class Ping{ + constructor(option: number | PingOption); + } + + export interface RelayOption{ + pin: number | string; + type?: string; + } + + export class Relay{ + constructor(option: number | RelayOption); + open(): void; + close(): void; + toggle(): void; + } + + export interface SensorOption{ + pin: number | string; + freq?: boolean; + threshold?: number; + } + + export class Sensor{ + constructor(option: number | string | SensorOption); + scale(low: number, high: number): Sensor; + scale(range: number[]): Sensor; + scale(): Sensor; + booleanAt(barrier: number): boolean; + within(range: Array, cb: ()=>void): void; + on(event: string, cb: ()=>void): void; + on(event: "data", cb: (data: any)=>void): void; + on(event: "change", cb: ()=>void): void; + } + + export interface ServoGeneralOption{ + pin: number | string; + range?: Array; + type?: string; + startAt?: number; + isInverted?: boolean; + center?: boolean; + controller?: string; + } + + export interface ServoPCA9685Option extends ServoGeneralOption{ + address?: number; + } + + export interface ServoSweepOpts{ + range: Array; + interval?: number; + step?: number; + } + + export class Servo{ + constructor(option: number | string | ServoGeneralOption); + to(degrees: number, ms?: number, rage?: number): void; + min(): void; + max(): void; + center(): void; + sweep(): void; + sweep(range: Array): void; + sweep(opt: ServoSweepOpts): void; + stop(): void; + cw(speed: number): void; + ccw(speed: number): void; + on(event: string, cb: ()=>void): void; + on(event: "move:complete", cb: ()=>void): void; + } + + export interface ShiftRegisterOption{ + pins: any; + } + + export class ShiftRegister{ + constructor(option: ShiftRegisterOption); + send(...value: number[]): void; + } + + export interface SonarOption{ + pin: number | string; + device: string; + freq?: number; + threshold?: number; + } + + export class Sonar{ + constructor(option: number | string | SonarOption); + within(range: Array, cb: ()=>void): void; + within(range: Array, unit: string, cb: ()=>void): void; + on(event: string, cb: ()=>void): void; + on(event: "data", cb: (data: any)=>void): void; + on(event: "change", cb: ()=>void): void; + } + + export interface StepperOption{ + pins: any; + stepsPerRev: number; + type: number; + rpm?: number; + direction?: number; + } + + export module Stepper{ + export class TYPE{ + static DRIVER: number; + static TWO_WIRE: number; + static FOUR_WIRE: number; + } + } + + export class Stepper{ + constructor(option: number | string | StepperOption); + step(stepsOrOpts: any, cb: ()=>void): void; + rpm(): Stepper; + rpm(value: number): Stepper; + speed(): Stepper; + speed(value: number): Stepper; + direction(): Stepper; + direction(value: number): Stepper; + accel(): Stepper; + accel(value: number): Stepper; + decel(): Stepper; + decel(value: number): Stepper; + cw(): Stepper; + ccw(): Stepper; + + within(range: Array, cb: ()=>void): void; + within(range: Array, unit: string, cb: ()=>void): void; + on(event: string, cb: ()=>void): void; + on(event: "data", cb: (data: any)=>void): void; + on(event: "change", cb: ()=>void): void; + } + + export interface TemperatureOption{ + controller?: string; + pin: string | number; + toCelsius?: (val: number)=>number; + freq?: number; + } + + export class Temperature{ + constructor(option: TemperatureOption); + on(event: string, cb: ()=>void): void; + on(event: "data", cb: (data: any)=>void): void; + on(event: "change", cb: ()=>void): void; + } +} + From 473f43fcba380564446bf2bc18caa62e6954548f Mon Sep 17 00:00:00 2001 From: impinball Date: Thu, 19 Mar 2015 03:07:02 -0400 Subject: [PATCH 118/243] Add ErrnoException See https://github.com/joyent/node/blob/v0.8.8-release/src/node.cc#L769-L806 --- node/node-0.8.8.d.ts | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/node/node-0.8.8.d.ts b/node/node-0.8.8.d.ts index 274a580d8..cf61184a4 100644 --- a/node/node-0.8.8.d.ts +++ b/node/node-0.8.8.d.ts @@ -68,6 +68,12 @@ declare var Buffer: { * INTERFACES * * * ************************************************/ +interface ErrnoException extends Error { + errno?: number; + code?: string; + path?: string; + syscall?: string; +} interface EventEmitter { addListener(event: string, listener: Function); @@ -730,9 +736,9 @@ declare module "fs" { export function fchmodSync(fd: string, mode: string): void; export function lchmod(path: string, mode: string, callback?: Function): void; export function lchmodSync(path: string, mode: string): void; - export function stat(path: string, callback?: (err: Error, stats: Stats) =>any): Stats; - export function lstat(path: string, callback?: (err: Error, stats: Stats) =>any): Stats; - export function fstat(fd: string, callback?: (err: Error, stats: Stats) =>any): Stats; + export function stat(path: string, callback?: (err: ErrnoException, stats: Stats) =>any): Stats; + export function lstat(path: string, callback?: (err: ErrnoException, stats: Stats) =>any): Stats; + export function fstat(fd: string, callback?: (err: ErrnoException, stats: Stats) =>any): Stats; export function statSync(path: string): Stats; export function lstatSync(path: string): Stats; export function fstatSync(fd: string): Stats; @@ -740,9 +746,9 @@ declare module "fs" { export function linkSync(srcpath: string, dstpath: string): void; export function symlink(srcpath: string, dstpath: string, type?: string, callback?: Function): void; export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; - export function readlink(path: string, callback?: (err: Error, linkString: string) =>any): void; - export function realpath(path: string, callback?: (err: Error, resolvedPath: string) =>any): void; - export function realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) =>any): void; + export function readlink(path: string, callback?: (err: ErrnoException, linkString: string) =>any): void; + export function realpath(path: string, callback?: (err: ErrnoException, resolvedPath: string) =>any): void; + export function realpath(path: string, cache: string, callback: (err: ErrnoException, resolvedPath: string) =>any): void; export function realpathSync(path: string, cache?: string): void; export function unlink(path: string, callback?: Function): void; export function unlinkSync(path: string): void; @@ -750,11 +756,11 @@ declare module "fs" { export function rmdirSync(path: string): void; export function mkdir(path: string, mode?: string, callback?: Function): void; export function mkdirSync(path: string, mode?: string): void; - export function readdir(path: string, callback?: (err: Error, files: string[]) => void): void; + export function readdir(path: string, callback?: (err: ErrnoException, files: string[]) => void): void; export function readdirSync(path: string): string[]; export function close(fd: string, callback?: Function): void; export function closeSync(fd: string): void; - export function open(path: string, flags: string, mode?: string, callback?: (err: Error, fd: string) =>any): void; + export function open(path: string, flags: string, mode?: string, callback?: (err: ErrnoException, fd: string) =>any): void; export function openSync(path: string, flags: string, mode?: string): void; export function utimes(path: string, atime: number, mtime: number, callback?: Function): void; export function utimesSync(path: string, atime: number, mtime: number): void; @@ -766,8 +772,8 @@ declare module "fs" { export function writeSync(fd: string, buffer: Buffer, offset: number, length: number, position: number): void; export function read(fd: string, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: Buffer) => void): void; export function readSync(fd: string, buffer: Buffer, offset: number, length: number, position: number): any[]; - export function readFile(filename: string, encoding: string, callback: (err: Error, data: string) => void ): void; - export function readFile(filename: string, callback: (err: Error, data: Buffer) => void ): void; + export function readFile(filename: string, encoding: string, callback: (err: ErrnoException, data: string) => void ): void; + export function readFile(filename: string, callback: (err: ErrnoException, data: Buffer) => void ): void; export function readFileSync(filename: string): Buffer; export function readFileSync(filename: string, encoding: string): string; export function writeFile(filename: string, data: any, callback?: (err) => void): void; From 901808304ddc8d1bbebbd6e531fafb7e645d41d8 Mon Sep 17 00:00:00 2001 From: impinball Date: Thu, 19 Mar 2015 03:08:38 -0400 Subject: [PATCH 119/243] Fix ErrnoException See https://github.com/joyent/node/blob/v0.10.1-release/src/node.cc#L750 --- node/node-0.10.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node-0.10.d.ts b/node/node-0.10.d.ts index 73f962782..74e6cd3ea 100644 --- a/node/node-0.10.d.ts +++ b/node/node-0.10.d.ts @@ -79,7 +79,7 @@ declare var Buffer: { ************************************************/ declare module NodeJS { export interface ErrnoException extends Error { - errno?: any; + errno?: number; code?: string; path?: string; syscall?: string; From f7a0bc8ee18c88ad773786eb2c9bb379de05b38b Mon Sep 17 00:00:00 2001 From: impinball Date: Thu, 19 Mar 2015 03:11:03 -0400 Subject: [PATCH 120/243] Fix ErrnoException See https://github.com/joyent/node/blob/v0.11.13-release/src/node.cc#L752 --- node/node-0.11.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node-0.11.d.ts b/node/node-0.11.d.ts index 302ba12a9..ec22b92a8 100644 --- a/node/node-0.11.d.ts +++ b/node/node-0.11.d.ts @@ -79,7 +79,7 @@ declare var Buffer: { ************************************************/ declare module NodeJS { export interface ErrnoException extends Error { - errno?: any; + errno?: number; code?: string; path?: string; syscall?: string; From 6dfc9b47d2f66cb4ec75f52a7c98f5c27ffbbc05 Mon Sep 17 00:00:00 2001 From: impinball Date: Thu, 19 Mar 2015 03:12:46 -0400 Subject: [PATCH 121/243] Fix ErrnoException See https://github.com/joyent/node/blob/v0.12.0-release/src/node.cc#L762 --- node/node.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node.d.ts b/node/node.d.ts index f20fdeb26..7207d04fd 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -79,7 +79,7 @@ declare var Buffer: { ************************************************/ declare module NodeJS { export interface ErrnoException extends Error { - errno?: any; + errno?: number; code?: string; path?: string; syscall?: string; From 66a74b699d206f6abe38766781b220352eaf942a Mon Sep 17 00:00:00 2001 From: impinball Date: Thu, 19 Mar 2015 03:27:37 -0400 Subject: [PATCH 122/243] Test for fixed ErrnoException property --- node/node-tests.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/node/node-tests.ts b/node/node-tests.ts index deb5f24ee..8c381bc0e 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -61,6 +61,13 @@ class Networker extends events.EventEmitter { } } +var errno: number; +fs.readFile('testfile', (err, data) => { + if (err && err.errno) { + errno = err.errno; + } +}); + //////////////////////////////////////////////////// /// Url tests : http://nodejs.org/api/url.html //////////////////////////////////////////////////// From 05681c698dfd44c06741d7b93bbd7d10626dd9af Mon Sep 17 00:00:00 2001 From: impinball Date: Thu, 19 Mar 2015 03:32:47 -0400 Subject: [PATCH 123/243] Test for fixed ErrnoException property --- node/node-0.11-tests.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/node/node-0.11-tests.ts b/node/node-0.11-tests.ts index 5a0c294d4..38bae0d57 100644 --- a/node/node-0.11-tests.ts +++ b/node/node-0.11-tests.ts @@ -60,6 +60,13 @@ class Networker extends events.EventEmitter { } } +var errno: number; +fs.readFile('testfile', (err, data) => { + if (err && err.errno) { + errno = err.errno; + } +}); + url.format(url.parse('http://www.example.com/xyz')); // https://google.com/search?q=you're%20a%20lizard%2C%20gary From 048feee7490233d846f6c6fb6f6d3ad235fae8fb Mon Sep 17 00:00:00 2001 From: ColsaCorp Date: Thu, 19 Mar 2015 08:37:02 -0500 Subject: [PATCH 124/243] Create s3-uploader --- s3-uploader/s3-uploader | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 s3-uploader/s3-uploader diff --git a/s3-uploader/s3-uploader b/s3-uploader/s3-uploader new file mode 100644 index 000000000..215cb7df6 --- /dev/null +++ b/s3-uploader/s3-uploader @@ -0,0 +1,39 @@ +// Type definitions for s3-uploader +// Project: https://www.npmjs.com/package/s3-uploader +// Definitions by: COLSA Corporation +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +//NOTE: Does require GM (https://github.com/aheckmann/gm) thus requires GraphicsMagick (http://www.graphicsmagick.org/) or ImageMagick (http://www.imagemagick.org/) + +declare module "s3-uploader" { + export = Upload; +} +interface S3UploaderVersion { + original?: boolean; + suffix?: string; + quality?: number; + maxWidth?: number; + maxHeight?: number; +} + +interface S3UploaderOptions { + awsAccessKeyId?: string; + awsSecretAccessKey?: string; + awsBucketRegion?: string; + awsBucketPath?: string; + awsBucketAcl?: string; + awsMaxRetries?: number; + awsHttpTimeout?: number; + resizeQuality?: number; + returnExif?: boolean; + tmpDir?: string; + workers?: number; + url?: string; + versions?: S3UploaderVersion; +} + +declare class Upload { + public constructor(awsBucketName: string, opts: S3UploaderOptions); + + public upload(src: string, opts?: S3UploaderOptions, cb?: (err, images, meta) => void); +} From 0df80e23991a9891239f4c7b6e6879cbc7241e91 Mon Sep 17 00:00:00 2001 From: ColsaCorp Date: Thu, 19 Mar 2015 08:37:59 -0500 Subject: [PATCH 125/243] Rename s3-uploader to s3-uploader.d.ts --- s3-uploader/{s3-uploader => s3-uploader.d.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename s3-uploader/{s3-uploader => s3-uploader.d.ts} (100%) diff --git a/s3-uploader/s3-uploader b/s3-uploader/s3-uploader.d.ts similarity index 100% rename from s3-uploader/s3-uploader rename to s3-uploader/s3-uploader.d.ts From 197dfc26d4c2ed50884ef895a5478b06a43be797 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 19 Mar 2015 15:00:10 +0000 Subject: [PATCH 126/243] Split out angular-ui-router and angular-ui-sortable --- {angular-ui => angular-ui-router}/angular-ui-router-tests.ts | 0 {angular-ui => angular-ui-router}/angular-ui-router.d.ts | 0 {angular-ui => angular-ui-sortable}/angular-ui-sortable-tests.ts | 0 {angular-ui => angular-ui-sortable}/angular-ui-sortable.d.ts | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {angular-ui => angular-ui-router}/angular-ui-router-tests.ts (100%) rename {angular-ui => angular-ui-router}/angular-ui-router.d.ts (100%) rename {angular-ui => angular-ui-sortable}/angular-ui-sortable-tests.ts (100%) rename {angular-ui => angular-ui-sortable}/angular-ui-sortable.d.ts (100%) diff --git a/angular-ui/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts similarity index 100% rename from angular-ui/angular-ui-router-tests.ts rename to angular-ui-router/angular-ui-router-tests.ts diff --git a/angular-ui/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts similarity index 100% rename from angular-ui/angular-ui-router.d.ts rename to angular-ui-router/angular-ui-router.d.ts diff --git a/angular-ui/angular-ui-sortable-tests.ts b/angular-ui-sortable/angular-ui-sortable-tests.ts similarity index 100% rename from angular-ui/angular-ui-sortable-tests.ts rename to angular-ui-sortable/angular-ui-sortable-tests.ts diff --git a/angular-ui/angular-ui-sortable.d.ts b/angular-ui-sortable/angular-ui-sortable.d.ts similarity index 100% rename from angular-ui/angular-ui-sortable.d.ts rename to angular-ui-sortable/angular-ui-sortable.d.ts From 85ea8ee338a435335c17f8022656b3b534b9431c Mon Sep 17 00:00:00 2001 From: Florian Holzapfel Date: Thu, 19 Mar 2015 16:35:16 +0100 Subject: [PATCH 127/243] fix types --- serve-static/serve-static.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/serve-static/serve-static.d.ts b/serve-static/serve-static.d.ts index 9bb57e6d3..c07303d00 100644 --- a/serve-static/serve-static.d.ts +++ b/serve-static/serve-static.d.ts @@ -38,14 +38,14 @@ declare module "serve-static" { etag?: boolean; /** - * Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for. + * Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for. * The first that exists will be served. Example: ['html', 'htm']. * The default value is false. */ - extensions?: boolean; + extensions?: string[]; /** - * By default this module will send "index.html" files in response to a request on a directory. + * By default this module will send "index.html" files in response to a request on a directory. * To disable this set false or to supply a new index pass a string or an array in preferred order. */ index?: boolean; @@ -63,17 +63,17 @@ declare module "serve-static" { /** * Redirect to trailing "/" when the pathname is a dir. Defaults to true. */ - redirect?: number; + redirect?: boolean; /** - * Function to set custom headers on response. Alterations to the headers need to occur synchronously. + * Function to set custom headers on response. Alterations to the headers need to occur synchronously. * The function is called as fn(res, path, stat), where the arguments are: * res the response object * path the file path that is being sent * stat the stat object of the file that is being sent */ - setHeaders?: (res, path, stat) => any; + setHeaders?: (res: express.Response, path: string, stat: any) => any; }): express.Handler; - + export = serveStatic; -} \ No newline at end of file +} From fbf1fa432769ca85585b3f44f33644bd8e24cf8f Mon Sep 17 00:00:00 2001 From: Florian Holzapfel Date: Thu, 19 Mar 2015 16:35:26 +0100 Subject: [PATCH 128/243] add tests --- serve-static/serve-static-tests.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 serve-static/serve-static-tests.ts diff --git a/serve-static/serve-static-tests.ts b/serve-static/serve-static-tests.ts new file mode 100644 index 000000000..6b16e842b --- /dev/null +++ b/serve-static/serve-static-tests.ts @@ -0,0 +1,20 @@ +/// + +import express = require('express'); +import serveStatic = require('serve-static'); +var app = express(); + +app.use(serveStatic('/1')); +app.use(serveStatic('/2', { })); +app.use(serveStatic('/3', { + dotfiles: 'ignore', + etag: true, + extensions: ['html'], + index: true, + lastModified: true, + maxAge: 0, + redirect: true, + setHeaders: function(res: express.Response, path: string, stat: any) { + res.setHeader('Server', 'server-static middleware'); + } +})); From 9e6f089f686d0c3eb6fc7d154fffbc9a715f195d Mon Sep 17 00:00:00 2001 From: Florian Holzapfel Date: Thu, 19 Mar 2015 16:39:40 +0100 Subject: [PATCH 129/243] add tests for response-time --- response-time/response-time-tests.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 response-time/response-time-tests.ts diff --git a/response-time/response-time-tests.ts b/response-time/response-time-tests.ts new file mode 100644 index 000000000..b65b8fd19 --- /dev/null +++ b/response-time/response-time-tests.ts @@ -0,0 +1,12 @@ +/// + +import express = require('express'); +import responseTime = require('response-time'); +var app = express(); + +app.use(responseTime()); +app.use(responseTime({ + digits: 3, + header: 'X-Response-Time', + suffix: true +})); From 546d3c9f31bdc592f654630a8407e637f8b2c69f Mon Sep 17 00:00:00 2001 From: Florian Holzapfel Date: Thu, 19 Mar 2015 16:46:42 +0100 Subject: [PATCH 130/243] add test for serve-favicon --- serve-favicon/serve-favicon-tests.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 serve-favicon/serve-favicon-tests.ts diff --git a/serve-favicon/serve-favicon-tests.ts b/serve-favicon/serve-favicon-tests.ts new file mode 100644 index 000000000..0f99a56fc --- /dev/null +++ b/serve-favicon/serve-favicon-tests.ts @@ -0,0 +1,9 @@ +/// + +import express = require('express'); +import favicon = require('serve-favicon'); +var app = express(); + +app.use(favicon(__dirname + '/public/favicon.ico', { + maxAge: 86400000 +})); From 160c1b15334271122a505b07e1e305877f9fcc66 Mon Sep 17 00:00:00 2001 From: AbdulFattah Popoola Date: Thu, 19 Mar 2015 08:51:06 -0700 Subject: [PATCH 131/243] Removal of obsolete parameter in Spy Interface The callCount parameter does not exist in Jasmine versions > 2.0 but did exist in 1.3 --- jasmine/jasmine.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index 17658120d..efa0a62ae 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -369,7 +369,6 @@ declare module jasmine { mostRecentCall: { args: any[]; }; argsForCall: any[]; wasCalled: boolean; - callCount: number; } interface SpyAnd { From 6c3794e396d33481fbbb35e75accd15f3e61df0d Mon Sep 17 00:00:00 2001 From: Florian Holzapfel Date: Thu, 19 Mar 2015 16:59:53 +0100 Subject: [PATCH 132/243] fix header --- response-time/response-time.d.ts | 4 ++-- serve-favicon/serve-favicon.d.ts | 4 ++-- serve-static/serve-static.d.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/response-time/response-time.d.ts b/response-time/response-time.d.ts index 0a7c25465..ce9d41f5f 100644 --- a/response-time/response-time.d.ts +++ b/response-time/response-time.d.ts @@ -1,9 +1,9 @@ // Type definitions for response-time 2.2.0 // Project: https://github.com/expressjs/response-time // Definitions by: Uros Smolnik -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped -/* =================== USAGE =================== +/* =================== USAGE =================== import responseTime = require('response-time'); app.use(responseTime()); diff --git a/serve-favicon/serve-favicon.d.ts b/serve-favicon/serve-favicon.d.ts index 80faf5921..bb19c2f69 100644 --- a/serve-favicon/serve-favicon.d.ts +++ b/serve-favicon/serve-favicon.d.ts @@ -1,9 +1,9 @@ // Type definitions for serve-favicon 2.1.6 // Project: https://github.com/expressjs/serve-favicon // Definitions by: Uros Smolnik -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped -/* =================== USAGE =================== +/* =================== USAGE =================== import serveFavicon = require('serve-favicon'); app.use(serveFavicon(__dirname + '/public/favicon.ico')); diff --git a/serve-static/serve-static.d.ts b/serve-static/serve-static.d.ts index c07303d00..b116d4384 100644 --- a/serve-static/serve-static.d.ts +++ b/serve-static/serve-static.d.ts @@ -1,9 +1,9 @@ // Type definitions for serve-static 1.7.1 // Project: https://github.com/expressjs/serve-static // Definitions by: Uros Smolnik -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped -/* =================== USAGE =================== +/* =================== USAGE =================== import serveStatic = require('serve-static'); app.use(serveStatic('public/ftp', {'index': ['default.html', 'default.htm']})) From 4e553f5ea39035b8e1cb43ed31835bb9a6059f91 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 19 Mar 2015 16:07:15 +0000 Subject: [PATCH 133/243] Some JSDoc for good measure --- angular-ui-router/angular-ui-router.d.ts | 82 +++++++++++++++++++++--- 1 file changed, 74 insertions(+), 8 deletions(-) diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 51082cdee..0cf796832 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -9,20 +9,56 @@ declare module angular.ui { interface IState { name?: string; - template?: any; - templateUrl?: any; - templateProvider?: any; - controller?: any; + /** + * String HTML content, or function that returns an HTML string + */ + template?: string | {(): string}; + /** + * String URL path to template file OR Function, returns URL path string + */ + templateUrl?: string | {(): string}; + /** + * Function, returns HTML content string + */ + templateProvider?: Function; + /** + * A controller paired to the state. Function OR name as String + */ + controller?: Function | string; controllerAs?: string; - controllerProvider?: any; + /** + * Function (injectable), returns the actual controller function or string. + */ + controllerProvider?: Function; resolve?: {}; + /** + * A url with optional parameters. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed. + */ url?: string; + /** + * A map which optionally configures parameters declared in the url, or defines additional non-url parameters. Only use this within a state if you are not using url. Otherwise you can specify your parameters within the url. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed. + */ params?: any; + /** + * Use the views property to set up multiple views. If you don't need multiple views within a single state this property is not needed. Tip: remember that often nested views are more useful and powerful than multiple sibling views. + */ views?: {}; abstract?: boolean; - onEnter?: any; - onExit?: any; + /** + * Callback functions for when a state is entered and exited. Good way to trigger an action or dispatch an event, such as opening a dialog. + */ + onEnter?: Function; + /** + * Callback functions for when a state is entered and exited. Good way to trigger an action or dispatch an event, such as opening a dialog. + */ + onExit?: Function; + /** + * Arbitrary data object, useful for custom configuration. + */ data?: any; + /** + * Boolean (default true). If false will not retrigger the same state just because a search/query parameter has changed. Useful for when you'd like to modify $location.search() without triggering a reload. + */ reloadOnSearch?: boolean; } @@ -63,10 +99,26 @@ declare module angular.ui { } interface IStateOptions { - location?: any; + /** + * {boolean=true|string=} - If true will update the url in the location bar, if false will not. If string, must be "replace", which will update url and also replace last history record. + */ + location?: boolean | string; + /** + * {boolean=true}, If true will inherit url parameters from current url. + */ inherit?: boolean; + /** + * {object=$state.$current}, When transitioning with relative path (e.g '^'), defines which state to be relative from. + */ relative?: IState; + /** + * {boolean=true}, If true will broadcast $stateChangeStart and $stateChangeSuccess events. + */ notify?: boolean; + /** + * {boolean=false}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params. + */ + reload?: boolean; } interface IHrefOptions { @@ -77,6 +129,20 @@ declare module angular.ui { } interface IStateService { + /** + * Convenience method for transitioning to a new state. $state.go calls $state.transitionTo internally but automatically sets options to { location: true, inherit: true, relative: $state.$current, notify: true }. This allows you to easily use an absolute or relative to path and specify only the parameters you'd like to update (while letting unspecified parameters inherit from the currently active ancestor states). + * + * @param to Absolute state name or relative state path. Some examples: + * + * $state.go('contact.detail') - will go to the contact.detail state + * $state.go('^') - will go to a parent state + * $state.go('^.sibling') - will go to a sibling state + * $state.go('.child.grandchild') - will go to grandchild state + * + * @param params A map of the parameters that will be sent to the state, will populate $stateParams. Any parameters that are not specified will be inherited from currently defined parameters. This allows, for example, going to a sibling state that shares parameters specified in a parent state. Parameter inheritance only works between common ancestor states, I.e. transitioning to a sibling will get you the parameters for all parents, transitioning to a child will get you all current parameters, etc. + * + * @param options Options object. + */ go(to: string, params?: {}, options?: IStateOptions): IPromise; transitionTo(state: string, params?: {}, updateLocation?: boolean): void; transitionTo(state: string, params?: {}, options?: IStateOptions): void; From 04b7d945101f0f9db4098a6ebc1af0ae27c4d0fb Mon Sep 17 00:00:00 2001 From: ray Date: Thu, 19 Mar 2015 12:27:12 -0400 Subject: [PATCH 134/243] defs for passport-facebook-token --- .../passport-facebook-token-tests.ts | 28 ++++++++++++++ ...passport-facebook-token-tests.ts.tscparams | 1 + .../passport-facebook-token.d.ts | 38 +++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 passport-facebook-token/passport-facebook-token-tests.ts create mode 100644 passport-facebook-token/passport-facebook-token-tests.ts.tscparams create mode 100644 passport-facebook-token/passport-facebook-token.d.ts diff --git a/passport-facebook-token/passport-facebook-token-tests.ts b/passport-facebook-token/passport-facebook-token-tests.ts new file mode 100644 index 000000000..531b7bdce --- /dev/null +++ b/passport-facebook-token/passport-facebook-token-tests.ts @@ -0,0 +1,28 @@ +/// +import passport = require('passport'); +import facebook = require('passport-facebook-token'); + +var User = { + findOrCreate(id: string, provider: string, callback: (err: any, user: any) => void): void { + callback(null, {username: 'ray'}); + } +} + +var options: facebook.StrategyOptions = { + clientID: process.env.PASSPORT_FACEBOOK_CLIENT_ID, + clientSecret: process.env.PASSPORT_FACEBOOK_CLIENT_SECRET +}; + +function verify(accessToken: string, + refreshToken: string, + profile: facebook.Profile, + done: (err: any, user?: any) => void) { + User.findOrCreate(profile.id, profile.provider, function (err, user) { + if (err) { + return done(err); + } + done(null, user); + }); +} + +passport.use(new facebook.Strategy(options, verify)); diff --git a/passport-facebook-token/passport-facebook-token-tests.ts.tscparams b/passport-facebook-token/passport-facebook-token-tests.ts.tscparams new file mode 100644 index 000000000..5f84b9777 --- /dev/null +++ b/passport-facebook-token/passport-facebook-token-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs --target es5 diff --git a/passport-facebook-token/passport-facebook-token.d.ts b/passport-facebook-token/passport-facebook-token.d.ts new file mode 100644 index 000000000..a5aa11596 --- /dev/null +++ b/passport-facebook-token/passport-facebook-token.d.ts @@ -0,0 +1,38 @@ +// Type definitions for passport-facebook-token 0.4.0 +// Project: https://github.com/drudge/passport-facebook-token +// Definitions by: Ray Martone +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'passport-facebook-token' { + + import passport = require('passport'); + import express = require('express'); + + interface Profile extends passport.Profile { + gender: string; + profileUrl: string; + } + + interface StrategyOptions { + clientID: string; + clientSecret: string; + authorizationURL?: string; + tokenURL?: string; + scopeSeparator?: string; + passReqToCallback?: Function; + enableProof?: boolean; + profileFields?: any[]; + } + + class Strategy implements passport.Strategy { + constructor(options: StrategyOptions, + verify: (accessToken: string, + refreshToken: string, + profile: Profile, + done: (err: any, user?: any) => void) => void); + name: string; + authenticate: (req: express.Request, options?: any) => void; + } +} From 161225da51f1b7622da7db061774f85e2167e786 Mon Sep 17 00:00:00 2001 From: Seulgi Kim Date: Fri, 20 Mar 2015 02:38:04 +0900 Subject: [PATCH 135/243] IPool of mysql has end function like IConnection or IPoolCluster. User should call end function to close all connection in a pool. See https://github.com/felixge/node-mysql/#closing-all-the-connections-in-a-pool for more information. --- mysql/mysql.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql/mysql.d.ts b/mysql/mysql.d.ts index 4c701b931..9b6ed7998 100644 --- a/mysql/mysql.d.ts +++ b/mysql/mysql.d.ts @@ -83,6 +83,9 @@ declare module "mysql" { query: IQueryFunction; + end(): void; + end(callback: (err: IError, ...args: any[]) => void): void; + on(ev: string, callback: (...args: any[]) => void): IPool; on(ev: 'connection', callback: (connection: IConnection) => void): IPool; on(ev: 'error', callback: (err: IError) => void): IPool; From d6c94a66f7a26fadd2adcd5ecdd261ad3695badf Mon Sep 17 00:00:00 2001 From: Joseph Livecchi Date: Thu, 19 Mar 2015 13:38:46 -0400 Subject: [PATCH 136/243] Added Missing functions to the fabric.util class Found some missing properties from the fabric.util namespace when converting this example to TypeScript. http://fabricjs.com/animated-sprite/ Added in the missing functions from the the latest fabric master. --- fabricjs/fabricjs.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fabricjs/fabricjs.d.ts b/fabricjs/fabricjs.d.ts index fb73fecb3..f764d4768 100644 --- a/fabricjs/fabricjs.d.ts +++ b/fabricjs/fabricjs.d.ts @@ -881,5 +881,19 @@ declare module fabric { toArray(arrayLike): any[]; toFixed(number, fractionDigits); wrapElement(element: HTMLElement, wrapper, attributes); + rotatePoint(point: IPoint, origin: IPoint, radians: number); + transformPoint(p: IPoint, t: any[], ignoreOffset: boolean); + invertTransform(t: any[]); + parseUnit(value: number|string, fontSize?: number); + getKlass(type: string, namespace: string); + resolveNamespace(namespace: string); + enlivenObjects(objects: any[], callback: Function, namespace: string, reviver: Function); + drawDashedLine(ctx: CanvasRenderingContext2D, x: number, y: number, x2: number, y2: number, da: any[]); + createCanvasElement(canvasEl?: HTMLElement); + createImage(); + createAccessors(klass: Object); + clipContext(receiver: IObject, ctx: CanvasRenderingContext2D); + isTransparent(ctx: CanvasRenderingContext2D, x: number, y: number, tolerance: number); + } } From d3a49ecfbf6d80de2774d8152fb301315e8954ff Mon Sep 17 00:00:00 2001 From: mbuesing Date: Thu, 19 Mar 2015 21:33:44 +0100 Subject: [PATCH 137/243] Add definitions for axios --- axios/axios-tests.ts | 23 ++++++ axios/axios.d.ts | 163 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 186 insertions(+) create mode 100644 axios/axios-tests.ts create mode 100644 axios/axios.d.ts diff --git a/axios/axios-tests.ts b/axios/axios-tests.ts new file mode 100644 index 000000000..a11421e19 --- /dev/null +++ b/axios/axios-tests.ts @@ -0,0 +1,23 @@ +/// + +interface InputBody { + random: number; +} + +interface Repository { + id: number; + name: string; +} + +function convenientGet () { + axios.get("https://api.github.com/repos/mzabriskie/axios") + .then(r => console.log(r.config.data.random)); +} + +function get() { + axios({ + url: "https://api.github.com/repos/mzabriskie/axios", + method: Axios.HTTPMethod.GET, + headers: {}, + }).then(r => console.log("ID:" + r.data.id + " Name: " + r.data.name)); +} \ No newline at end of file diff --git a/axios/axios.d.ts b/axios/axios.d.ts new file mode 100644 index 000000000..5455ba167 --- /dev/null +++ b/axios/axios.d.ts @@ -0,0 +1,163 @@ +// Type definitions for axios 0.5.2 +// Project: https://github.com/mzabriskie/axios +// Definitions by: Marcel Buesing +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Axios { + export enum HTTPMethod { GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH } + export enum ResponseType { arraybuffer, blob, document, json, text } + + /** + * - request body data type + */ + interface AxiosXHRConfigBase { + + /** + * Change the request data before it is sent to the server. + * This is only applicable for request methods 'PUT', 'POST', and 'PATCH' + * The last function in the array must return a string or an ArrayBuffer + */ + transformRequest?: (data:T) => U; + + /** + * change the response data to be made before it is passed to then/catch + */ + transformResponse?: (data:T) => U; + + /** + * custom headers to be sent + */ + headers?: Object; + + /** + * URL parameters to be sent with the request + */ + params?: Object; + + /** + * indicates whether or not cross-site Access-Control requests + * should be made using credentials + */ + withCredentials?: boolean; + + /** + * indicates the type of data that the server will respond with + * options are 'arraybuffer', 'blob', 'document', 'json', 'text' + */ + responseType?: Axios.ResponseType; + + /** + * name of the cookie to use as a value for xsrf token + */ + xsrfCookieName?: string; + + /** + * name of the http header that carries the xsrf token value + */ + xsrfHeaderName?: string; + + } + + /** + * - request body data type + */ + interface AxiosXHRConfig extends AxiosXHRConfigBase { + /** + * server URL that will be used for the request + */ + url: string; + + /** + * request method to be used when making the request + */ + method?: Axios.HTTPMethod; + + /** + * data to be sent as the request body + * Only applicable for request methods 'PUT', 'POST', and 'PATCH' + * When no `transformRequest` is set, must be a string, an ArrayBuffer or a hash + */ + data?: T; + } + + /** + * - expected response type, + * - request body data type + */ + interface AxiosXHR { + /** + * Response that was provided by the server + */ + data: T; + + /** + * HTTP status code from the server response + */ + status: number; + + /** + * HTTP status message from the server response + */ + statusText: string; + + /** + * headers that the server responded with + */ + headers: Object; + + /** + * config that was provided to `axios` for the request + */ + config: AxiosXHRConfig; + } + + /** + * - expected response type, + * - request body data type + */ + interface AxiosStatic { + + (config: AxiosXHRConfig): Promise>; + + new (config: AxiosXHRConfig): Promise>; + + /** + * convenience alias, method = GET + */ + get(url: string, config?: AxiosXHRConfigBase): Promise>; + + + /** + * convenience alias, method = DELETE + */ + delete(url: string, config?: AxiosXHRConfigBase): Promise>; + + /** + * convenience alias, method = HEAD + */ + head(url: string, config?: AxiosXHRConfigBase): Promise>; + + /** + * convenience alias, method = POST + */ + post(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + + /** + * convenience alias, method = PUT + */ + put(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + + /** + * convenience alias, method = PATCH + */ + patch(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + } +} + +declare var axios: Axios.AxiosStatic; + +declare module "axios" { + export = axios; +} From 8f8c018e24000f582570e8d61cdd0b26d9a670ec Mon Sep 17 00:00:00 2001 From: ColsaCorp Date: Thu, 19 Mar 2015 22:07:38 -0500 Subject: [PATCH 138/243] Delete s3-uploader.d.ts --- s3-uploader.d.ts | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 s3-uploader.d.ts diff --git a/s3-uploader.d.ts b/s3-uploader.d.ts deleted file mode 100644 index 215cb7df6..000000000 --- a/s3-uploader.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Type definitions for s3-uploader -// Project: https://www.npmjs.com/package/s3-uploader -// Definitions by: COLSA Corporation -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -//NOTE: Does require GM (https://github.com/aheckmann/gm) thus requires GraphicsMagick (http://www.graphicsmagick.org/) or ImageMagick (http://www.imagemagick.org/) - -declare module "s3-uploader" { - export = Upload; -} -interface S3UploaderVersion { - original?: boolean; - suffix?: string; - quality?: number; - maxWidth?: number; - maxHeight?: number; -} - -interface S3UploaderOptions { - awsAccessKeyId?: string; - awsSecretAccessKey?: string; - awsBucketRegion?: string; - awsBucketPath?: string; - awsBucketAcl?: string; - awsMaxRetries?: number; - awsHttpTimeout?: number; - resizeQuality?: number; - returnExif?: boolean; - tmpDir?: string; - workers?: number; - url?: string; - versions?: S3UploaderVersion; -} - -declare class Upload { - public constructor(awsBucketName: string, opts: S3UploaderOptions); - - public upload(src: string, opts?: S3UploaderOptions, cb?: (err, images, meta) => void); -} From effae55ed2b63302299898daad807abaad54d162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Morch=C3=B3n=20Poveda?= Date: Fri, 20 Mar 2015 13:19:28 +0100 Subject: [PATCH 139/243] Knockout 3.3 - Components Added $component and $componentTemplateNodes binding context properties (see http://knockoutjs.com/documentation/binding-context.html). Added ComponentInfo.templateNodes. --- knockout/knockout.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index db8ab16ab..eaae8bee1 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -121,6 +121,8 @@ interface KnockoutBindingContext { $rawData: any | KnockoutObservable; $index?: KnockoutObservable; $parentContext?: KnockoutBindingContext; + $component: any; + $componentTemplateNodes: Node[]; extend(properties: any): any; createChildContext(dataItemOrAccessor: any, dataItemAlias?: any, extendCallback?: Function): any; @@ -603,7 +605,8 @@ declare module KnockoutComponentTypes { } interface ComponentInfo { - element: any; + element: Node; + templateNodes: Node[]; } interface TemplateElement { @@ -641,4 +644,4 @@ declare var ko: KnockoutStatic; declare module "knockout" { export = ko; -} \ No newline at end of file +} From 8252b3e6a648e51c5184e4c7211971f325d8d4dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Morch=C3=B3n=20Poveda?= Date: Fri, 20 Mar 2015 13:24:34 +0100 Subject: [PATCH 140/243] Update KnockoutBindingHandler ``` init ``` & ``` update ``` with optional arguments. This makes sense if you want to call a binding from your code without passing all the parameters, when it is really optional. --- knockout/knockout.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index db8ab16ab..26c282168 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -133,8 +133,8 @@ interface KnockoutAllBindingsAccessor { } interface KnockoutBindingHandler { - init?: (element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => void | { controlsDescendantBindings: boolean; }; - update?: (element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => void; + init?: (element: any, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext) => void | { controlsDescendantBindings: boolean; }; + update?: (element: any, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext) => void; options?: any; preprocess?: (value: string, name: string, addBindingCallback?: (name: string, value: string) => void) => string; } @@ -641,4 +641,4 @@ declare var ko: KnockoutStatic; declare module "knockout" { export = ko; -} \ No newline at end of file +} From 96b97cf4626f116eb14fcc09aaab3ca41a6e2792 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 21 Mar 2015 01:24:23 +0900 Subject: [PATCH 141/243] add html5mode definitions on ILocationProvider --- angularjs/angular.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index bc7fa9de0..9f7efea89 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -586,13 +586,13 @@ declare module angular { } interface IScope extends IRootScopeService { } - + /** * $scope for ngRepeat directive. * see https://docs.angularjs.org/api/ng/directive/ngRepeat */ interface IRepeatScope extends IScope { - + /** * iterator offset of the repeated element (0..length-1). */ @@ -622,7 +622,7 @@ declare module angular { * true if the iterator position $index is odd (otherwise false). */ $odd: boolean; - + } interface IAngularEvent { @@ -891,6 +891,7 @@ declare module angular { // implementation tests it as boolean, which makes more sense // since this is a toggler html5Mode(active: boolean): ILocationProvider; + html5Mode(mode: { enabled?: boolean; requireBase?: boolean; rewriteLinks?: boolean; }): ILocationProvider; } /////////////////////////////////////////////////////////////////////////// From 9acb366bae4dc646c0c3b35e5529c5a780b6a393 Mon Sep 17 00:00:00 2001 From: Mark Wong Siang Kai Date: Fri, 20 Mar 2015 13:26:15 -0700 Subject: [PATCH 142/243] Updated dagre.d.ts to support fluent-chaining --- dagre/dagre-tests.ts | 11 ++++------- dagre/dagre.d.ts | 10 +++++----- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dagre/dagre-tests.ts b/dagre/dagre-tests.ts index ab790e502..621727944 100644 --- a/dagre/dagre-tests.ts +++ b/dagre/dagre-tests.ts @@ -1,13 +1,10 @@ /// module DagreTests { var gDagre = new dagre.graphlib.Graph(); - gDagre.setGraph({}); - gDagre.setDefaultEdgeLabel(function(){ - return ; - }); - - gDagre.setNode("a", {}); - gDagre.setEdge("b", "c"); + gDagre.setGraph({}) + .setDefaultEdgeLabel(function(){ return ; }) + .setNode("a", {}) + .setEdge("b", "c"); dagre.layout(gDagre); } diff --git a/dagre/dagre.d.ts b/dagre/dagre.d.ts index a9d452826..ce389f2d7 100644 --- a/dagre/dagre.d.ts +++ b/dagre/dagre.d.ts @@ -14,14 +14,14 @@ declare module Dagre{ edge(id: string): any; nodes(): string[]; node(id: string): any; - setDefaultEdgeLabel(callback: () => void): void; - setEdge(sourceId: string, targetId: string): void; - setGraph(options: { [key: string]: any }): void; - setNode(id: string, node: { [key: string]: any }): void; + setDefaultEdgeLabel(callback: () => void): Graph; + setEdge(sourceId: string, targetId: string): Graph; + setGraph(options: { [key: string]: any }): Graph; + setNode(id: string, node: { [key: string]: any }): Graph; } interface GraphLib { - Graph: Graph + Graph: Graph; } } From 819ea00877f5484746f9efb6d3eba69e467d3bef Mon Sep 17 00:00:00 2001 From: Mark Wong Siang Kai Date: Fri, 20 Mar 2015 14:14:38 -0700 Subject: [PATCH 143/243] Added type definitions for dagre-d3 --- dagre-d3/dagre-d3-tests.ts | 19 +++++++++++++++++++ dagre-d3/dagre-d3.d.ts | 31 +++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 dagre-d3/dagre-d3-tests.ts create mode 100644 dagre-d3/dagre-d3.d.ts diff --git a/dagre-d3/dagre-d3-tests.ts b/dagre-d3/dagre-d3-tests.ts new file mode 100644 index 000000000..e3e068816 --- /dev/null +++ b/dagre-d3/dagre-d3-tests.ts @@ -0,0 +1,19 @@ +/// +module DagreD3Tests { + var gDagre = new dagreD3.graphlib.Graph(); + var graph = gDagre.graph(); + + // has graph methods from dagre.d.ts + graph.setNode("a", {}); + var num: number = 251 + graph.height + graph.width; + var predecessors: { [vertex:string]: string[] } = {}; + var successors: { [vertex:string]: string[] } = {}; + + predecessors["a"] = graph.predecessors("a"); + successors["a"] = graph.successors("a"); + + var render = new dagreD3.render(); + var svg = d3.select("svg"); + render(svg, graph); +} + diff --git a/dagre-d3/dagre-d3.d.ts b/dagre-d3/dagre-d3.d.ts new file mode 100644 index 000000000..d088d1d82 --- /dev/null +++ b/dagre-d3/dagre-d3.d.ts @@ -0,0 +1,31 @@ +// Type definitions for dagre-d3.core.js +// Project: https://github.com/cpettitt/dagre-d3 +// Definitions by: Mark Wong Siang Kai +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module Dagre { + + interface DagreD3Factory extends Dagre.DagreFactory { + render: Render; + } + + // coupled with dagre.d.ts' Graph + // a lot of these methods come from graphlib.core.js + interface Graph { + graph(): Graph; + height: number; + predecessors(id: string): string[]; + successors(id: string): string[]; + width: number; + } + + interface Render { + new (): Render; + (selection: D3.Selection, g: Dagre.Graph): void; + } +} + +declare var dagreD3: Dagre.DagreD3Factory; From 4acd5f8775c27137d54bf925c19c009c79c16472 Mon Sep 17 00:00:00 2001 From: Andrew Audibert Date: Fri, 20 Mar 2015 14:20:19 -0700 Subject: [PATCH 144/243] Add typings for dealing with modes in codemirror --- codemirror/codemirror.d.ts | 87 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index a187d8ec1..65692cf1c 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -919,4 +919,91 @@ declare module CodeMirror { */ current(): string; } + + /** + * A Mode is, in the simplest case, a lexer (tokenizer) for your language — a function that takes a character stream as input, + * advances it past a token, and returns a style for that token. More advanced modes can also handle indentation for the language. + */ + interface Mode { + /** + * This function should read one token from the stream it is given as an argument, optionally update its state, + * and return a style string, or null for tokens that do not have to be styled. Multiple styles can be returned, separated by spaces. + */ + token(stream: StringStream, state: T): string; + + /** + * A function that produces a state object to be used at the start of a document. + */ + startState?: () => T; + /** + * For languages that have significant blank lines, you can define a blankLine(state) method on your mode that will get called + * whenever a blank line is passed over, so that it can update the parser state. + */ + blankLine?: (state: T) => void; + /** + * Given a state returns a safe copy of that state. + */ + copyState?: (state: T) => T; + + /** + * The indentation method should inspect the given state object, and optionally the textAfter string, which contains the text on + * the line that is being indented, and return an integer, the amount of spaces to indent. + */ + indent?: (state: T, textAfter: string) => number; + + /** The four below strings are used for working with the commenting addon. */ + /** + * String that starts a line comment. + */ + lineComment?: string; + /** + * String that starts a block comment. + */ + blockCommentStart?: string; + /** + * String that ends a block comment. + */ + blockCommentEnd?: string; + /** + * String to put at the start of continued lines in a block comment. + */ + blockCommentLead?: string; + + /** + * Trigger a reindent whenever one of the characters in the string is typed. + */ + electricChars?: string + /** + * Trigger a reindent whenever the regex matches the part of the line before the cursor. + */ + electricinput?: RegExp + } + + /** + * A function that, given a CodeMirror configuration object and an optional mode configuration object, returns a mode object. + */ + interface ModeFactory { + (config: CodeMirror.EditorConfiguration, modeOptions?: any): Mode + } + + /** + * id will be the id for the defined mode. Typically, you should use this second argument to defineMode as your module scope function + * (modes should not leak anything into the global scope!), i.e. write your whole mode inside this function. + */ + function defineMode(id: string, modefactory: ModeFactory): void; + + /** + * The first argument is a configuration object as passed to the mode constructor function, and the second argument + * is a mode specification as in the EditorConfiguration mode option. + */ + function getMode(config: CodeMirror.EditorConfiguration, mode: any): Mode; + + /** + * Utility function from the overlay.js addon that allows modes to be combined. The mode given as the base argument takes care of + * most of the normal mode functionality, but a second (typically simple) mode is used, which can override the style of text. + * Both modes get to parse all of the text, but when both assign a non-null style to a piece of code, the overlay wins, unless + * the combine argument was true and not overridden, or state.overlay.combineTokens was true, in which case the styles are combined. + */ + function overlayMode(base: Mode, overlay: Mode, combine?: boolean): Mode + } From 8d66f01141702972e93f8bd64e0db00ec3135d5f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 20 Mar 2015 17:49:11 -0700 Subject: [PATCH 145/243] Use function expressions when referring to 'arguments'. --- node-git/node-git-tests.ts | 2 +- should/should-tests.ts | 2 +- simple-cw-node/simple-cw-node-tests.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/node-git/node-git-tests.ts b/node-git/node-git-tests.ts index f1e5e969b..0924bedb9 100644 --- a/node-git/node-git-tests.ts +++ b/node-git/node-git-tests.ts @@ -3,7 +3,7 @@ import base = require("git"); var git = new base.Git("../.git"); -git.call_git("", "clone", "", {}, ["https://github.com/borisyankov/DefinitelyTyped.git", "d.ts"], (err, data) => { +git.call_git("", "clone", "", {}, ["https://github.com/borisyankov/DefinitelyTyped.git", "d.ts"], function (err, data) { console.log(arguments); }); diff --git a/should/should-tests.ts b/should/should-tests.ts index fafb1d7c7..c940f7c13 100644 --- a/should/should-tests.ts +++ b/should/should-tests.ts @@ -75,7 +75,7 @@ false false.should.be.false; (0).should.not.be.false; -var args = (a: string, b: string, c: string) => { return arguments; }; +var args = function (a: string, b: string, c: string) { return arguments; }; args.should.be.arguments; ['a'].should.not.be.arguments; diff --git a/simple-cw-node/simple-cw-node-tests.ts b/simple-cw-node/simple-cw-node-tests.ts index a46eb42c9..d25cc0399 100644 --- a/simple-cw-node/simple-cw-node-tests.ts +++ b/simple-cw-node/simple-cw-node-tests.ts @@ -10,7 +10,7 @@ var Deferred:any = client.Deferred; client.init({ token: 'YOUR_TOKEN' }); // get your info. -client.get('me', (err, res) => { +client.get('me', function (err, res) { console.log(arguments); }); From 4f5dfe0845471dc121a490e3fb13478871e79e05 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 20 Mar 2015 17:50:15 -0700 Subject: [PATCH 146/243] Target ES5 for the backgrid tests. --- backgrid/backgrid.d.ts.tscparams | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backgrid/backgrid.d.ts.tscparams b/backgrid/backgrid.d.ts.tscparams index d3f5a12fa..aa5e71c8a 100644 --- a/backgrid/backgrid.d.ts.tscparams +++ b/backgrid/backgrid.d.ts.tscparams @@ -1 +1 @@ - +--target es5 From 45979048d52f62f1f54195b33b36b01d759c20b1 Mon Sep 17 00:00:00 2001 From: ryan-codingintrigue Date: Sat, 21 Mar 2015 06:56:38 +0000 Subject: [PATCH 147/243] Renamed to whatwg-fetch --- fetch/fetch-tests.ts => whatwg-fetch/whatwg-fetch-tests.ts | 2 +- fetch/fetch.d.ts => whatwg-fetch/whatwg-fetch.d.ts | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename fetch/fetch-tests.ts => whatwg-fetch/whatwg-fetch-tests.ts (92%) rename fetch/fetch.d.ts => whatwg-fetch/whatwg-fetch.d.ts (100%) diff --git a/fetch/fetch-tests.ts b/whatwg-fetch/whatwg-fetch-tests.ts similarity index 92% rename from fetch/fetch-tests.ts rename to whatwg-fetch/whatwg-fetch-tests.ts index 3d9f71e76..cc3e6320a 100644 --- a/fetch/fetch-tests.ts +++ b/whatwg-fetch/whatwg-fetch-tests.ts @@ -1,4 +1,4 @@ -/// +/// /// function test_fetchUrlWithOptions() { diff --git a/fetch/fetch.d.ts b/whatwg-fetch/whatwg-fetch.d.ts similarity index 100% rename from fetch/fetch.d.ts rename to whatwg-fetch/whatwg-fetch.d.ts From 1644f6244bac3f8a30267c551c23b3241fdae24f Mon Sep 17 00:00:00 2001 From: Han Lin Yap Date: Sat, 21 Mar 2015 16:18:45 +0100 Subject: [PATCH 148/243] Update Ractive definition --- ractive/ractive-tests.ts | 8 ++- ractive/ractive.d.ts | 152 ++++++++++++++++++++++++++++----------- 2 files changed, 117 insertions(+), 43 deletions(-) diff --git a/ractive/ractive-tests.ts b/ractive/ractive-tests.ts index e206d2e26..df97190c9 100644 --- a/ractive/ractive-tests.ts +++ b/ractive/ractive-tests.ts @@ -8,13 +8,19 @@ function test_transition() { Ractive.transitions['myTransition'] = plugin; } +var adaptor: Ractive.AdaptorPlugin; + + Ractive.defaults = { template: '', - debug: true } var options: Ractive.NewOptions = { + adapt: ['myAdaptor', adaptor], template: '', + data: { + someThing: 'value', + } }; var r: Ractive.Ractive = new Ractive(options); diff --git a/ractive/ractive.d.ts b/ractive/ractive.d.ts index 97ceda993..4c2b1ef14 100644 --- a/ractive/ractive.d.ts +++ b/ractive/ractive.d.ts @@ -1,8 +1,10 @@ -// Type definitions for Ractive 0.7.0 edge f22ab8ad0a640591b1c263f57e21d1565cb26bf5 +// Type definitions for Ractive 0.7.1 // Project: http://ractivejs.org // Definitions by: Han Lin Yap // Definitions: https://github.com/codler/Ractive-TypeScript-Definition -// Version: 0.7.0-1+2015-02-05 +// Version: 0.7.1-1+2015-03-21 + +declare type _RactiveEvent = Event; declare module Ractive { export interface Node extends HTMLElement { @@ -64,13 +66,22 @@ declare module Ractive { export interface Event { context: any; - // TODO: unclear in documantation - index: Object; + component?: Ractive; + index: { [key: string]: number }; keypath: string; + // Since 0.6.0 + name: string; node: HTMLElement; - original: Event; + original: _RactiveEvent; } + // Since 0.7.1 + export interface NodeInfo { + ractive: Ractive; + keypath: string; + index: { [key: string]: number }; + } + // Return value in ractive.observe and ractive.on export interface Observe { cancel(): void; @@ -113,13 +124,17 @@ declare module Ractive { complate?: (t: number, value: number) => void; // TODO: void? } - export interface ObserveOptions { + export interface ObserveOptions extends ObserveOnceOptions { + // Default true + init?: boolean; + } + + // Since 0.7.1 + export interface ObserveOnceOptions { // Default Ractive context?: any; // Default false defer?: boolean; - // Default true - init?: boolean; } // Used in Ractive.parse options @@ -139,7 +154,7 @@ declare module Ractive { /* * @type List of mixed string or Adaptor */ - adapt?: any[]; + adapt?: (string | AdaptorPlugin)[]; adaptors?: AdaptorPlugins; @@ -147,22 +162,20 @@ declare module Ractive { * Default false * @type boolean or any type that option `el` accepts (HTMLElement or String or jQuery-like collection) */ - append?: any; + append?: boolean | any; complete?: Function; components?: ComponentPlugins; computed?: Object; // Since 0.5.5 - // TODO: unclear in documantation + // TODO: unclear in documantation, should this be in ExtendOptions instead? css?: string; /** - * TODO: Question - When is data Array or String? - * - * @type Object, Array, String or Function + * @type Object or Function */ // TODO: undocumented type Function - data?: any; + data?: Object | Function; decorators?: DecoratorPlugins; /** @@ -170,27 +183,53 @@ declare module Ractive { */ delimiters?: string[]; + // TODO: unsure easing?: string | Function; /** * @type HTMLElement or String or jQuery-like collection */ - el?: any; + el?: string | HTMLElement | any; // TODO: undocumented in Initialisation options page events?: EventPlugins; - - // TODO: In next release - // TODO: undocumented GH-429 - // interpolate - + // Since 0.5.5 // TODO: unclear in documantation interpolators?: { [key: string]: any; }; // Since 0.6.0 - onconstruct?: (options: NewOptions) => void; // TODO: void? - // Since 0.6.0 + // TODO: undocumented arguments onchange?: (options: NewOptions) => void; // TODO: void? + // Since 0.6.0 + // TODO: undocumented arguments + oncomplete?: () => void; // TODO: void? + // Since 0.6.0 + // TODO: undocumented arguments + onconfig?: () => void; // TODO: void? + // Since 0.6.0 + // TODO: undocumented arguments + onconstruct?: (options: NewOptions) => void; // TODO: void? + // Since 0.6.0 + // TODO: undocumented arguments + ondetach?: () => void; // TODO: void? + // Since 0.6.0 + // TODO: undocumented arguments + oninit?: () => void; // TODO: void? + // Since 0.6.0 + // TODO: undocumented arguments + oninsert?: () => void; // TODO: void? + // Since 0.6.0 + // TODO: undocumented arguments + onrender?: () => void; // TODO: void? + // Since 0.6.0 + // TODO: undocumented arguments + onunrender?: () => void; // TODO: void? + // Since 0.6.0 + // TODO: undocumented arguments + onupdate?: () => void; // TODO: void? + // Since 0.6.0 + // TODO: undocumented arguments + onteardown?: () => void; // TODO: void? /** * any is same type as template @@ -198,9 +237,8 @@ declare module Ractive { partials?: { [key: string]: any; }; /** * Default false - * @type Boolean or RactiveSanitizeOptions */ - sanitize?: any; + sanitize?: boolean | SanitizeOptions; /** * Default ['[[', ']]'] * @type [open, close] @@ -238,6 +276,9 @@ declare module Ractive { // Since 0.5.5 // Default true stripComments?: boolean; + // Since 0.7.1 + // Default true + transitionsEnabled?: boolean; // Default true twoway?: boolean; @@ -252,17 +293,16 @@ declare module Ractive { * @deprecated */ init?: (options: ExtendOptions) => void; - - // TODO: undocumented arguments - onconstruct?: (options: ExtendOptions) => void; // TODO: void? - onrender?: () => void; // TODO: void? + // Default false, inherit from Ractive.defaults isolated?: boolean; } // See ractive change log "All configuration options, except plugin registries, can be specified on Ractive.defaults and Component.defaults" export interface DefaultsOptions extends ExtendOptions { - // TODO: not correctly documented + /** + * @deprecated since 0.7.1 + */ // Default false debug?: boolean; } @@ -275,6 +315,9 @@ declare module Ractive { extend(options: ExtendOptions): Static; + // Since 0.7.1 + getNodeInfo(node: HTMLElement): NodeInfo; + parse(template: string, options?: ParseOptions): any; // TODO: undocumented @@ -283,6 +326,9 @@ declare module Ractive { // TODO: undocumented components: ComponentPlugins; + // Since 0.7.1 + DEBUG: boolean; + defaults: DefaultsOptions; // TODO: undocumented @@ -327,13 +373,19 @@ declare module Ractive { findComponent(name?: string): Ractive; + // Since 0.7.1 + findContainer(name: string): Ractive; // TODO: Ractive? + + // Since 0.7.1 + findParent(name: string): Ractive; // TODO: Ractive? + fire(eventName: string, ...args: any[]): void; // TODO: void? get(keypath: string): any; - get(): Object; // TODO: undocumented. or do it return function if ractive.data defined as function? + get(): Object; // TODO: Object? - // TODO: target - Node or String or jQuery (see Valid selectors) - // TODO: anchor - Node or String or jQuery + // target - Node or String or jQuery (see Valid selectors) + // anchor - Node or String or jQuery insert(target: any, anchor?: any): void; // TODO: void? merge(keypath: string, value: any[], options?: { compare: boolean | string | Function }): Promise; @@ -342,13 +394,15 @@ declare module Ractive { observe(keypath: string, callback: (newValue: any, oldValue: any, keypath: string) => void, options?: ObserveOptions): Observe; observe(map: Object, options?: ObserveOptions): Observe; - // TODO: check handler type - off(eventName?: string, handler?: () => void): Ractive; - + // Since 0.7.1 + observeOnce(keypath: string, callback: (newValue: any, oldValue: any, keypath: string) => void, options?: ObserveOnceOptions): Observe; + // handler context Ractive - on(eventName: string, handler: (event?: Event, ...args: any[]) => void): Observe; - // TODO: undocumented - on(map: { [eventName: string]: (event?: Event, ...args: any[]) => void }): Observe; + off(eventName?: string, handler?: (event?: Ractive.Event | any, ...args: any[]) => any): Ractive; + on(eventName: string, handler: (event?: Ractive.Event | any, ...args: any[]) => any): Observe; + on(map: { [eventName: string]: (event?: Ractive.Event | any, ...args: any[]) => any }): Observe; + // Since 0.7.1 + once(eventName: string, handler: (event?: Ractive.Event | any, ...args: any[]) => any): Observe; // Since 0.5.5 pop(keypath: string): Promise; @@ -356,13 +410,18 @@ declare module Ractive { // Since 0.5.5 push(keypath: string, value: any): Promise; - // TODO: target - Node or String or jQuery (see Valid selectors) + // target - Node or String or jQuery (see Valid selectors) render(target: any): void; // TODO: void? + // Default {} reset(data?: Object): Promise; + // Since 0.7.1 + resetPartial(name: string, partial: any): Promise; + // Since 0.5.5 // TODO: undocumented, mentioned in ractive change log + // https://github.com/ractivejs/docs.ractivejs.org/issues/188 resetTemplate(): void; // TODO: void? set(keypath: string, value: any): Promise; @@ -382,6 +441,9 @@ declare module Ractive { toHTML(): string; + // Since 0.6.0 + unrender(): void; // TODO: void? + // Since 0.5.5 unshift(keypath: string, value: any): Promise; @@ -395,13 +457,19 @@ declare module Ractive { updateModel(keypath?: string, cascade?: boolean): Promise; // Properties - + // Since 0.7.1 + container: Ractive; // TODO: Ractive? nodes: Object; partials: Object; - transitions: Object; + // Since 0.7.1 + parent: Ractive; // TODO: Ractive? + // Since 0.7.1 + root: Ractive; // TODO: Ractive? + transitions: Object; } } +// used for require() declare module "ractive" { export = Ractive; } From 3db71ab302b03add98a80767e8b61f58759fd56c Mon Sep 17 00:00:00 2001 From: Nyamazing Date: Tue, 17 Mar 2015 16:24:12 +0900 Subject: [PATCH 149/243] add backbone.paginator.d.ts fix methods fix interface fix module output writing test include test in module change test name --- .../backbone.paginator-tests.ts | 305 ++++++++++++++++++ backbone.paginator/backbone.paginator.d.ts | 120 +++++++ 2 files changed, 425 insertions(+) create mode 100644 backbone.paginator/backbone.paginator-tests.ts create mode 100644 backbone.paginator/backbone.paginator.d.ts diff --git a/backbone.paginator/backbone.paginator-tests.ts b/backbone.paginator/backbone.paginator-tests.ts new file mode 100644 index 000000000..413c4c373 --- /dev/null +++ b/backbone.paginator/backbone.paginator-tests.ts @@ -0,0 +1,305 @@ +/// +/// +/// + +module BackbonePaginatorTests { + + class TestModel extends Backbone.Model{}; + + var makeFetchOptions = >() => { + return { + reset: true, + url: 'example.com', + beforeSend: (jqxhr: JQueryXHR) => {}, + success: (model: TestModel, response: any, options: any) => {}, + error: (collection: TCol, jqxhr: JQueryXHR, options: any) => {}, + parse: '', + }; + }; + + + module InitializingWithNoOption { + + class TestCollection extends Backbone.PageableCollection { + constructor(){ + super(); + } + } + + var testCollection = new TestCollection(); + + } + + + + module InitializingWithOptions { + + class TestCollection extends Backbone.PageableCollection { + + constructor(models?: TestModel[], + options?: Backbone.PageableInitialOptions){ + super(); + } + + } + + var testCollection1 = new TestCollection(); + + var testCollection2 = new TestCollection([ + new TestModel(), + new TestModel() + ]); + + var testCollection3 = new TestCollection([], {}); + + var testCollection4 = new TestCollection([],{ + comparator: ()=>1, + full: true, + state: {}, + queryParam: {}, + }); + + var testCollection5 = new TestCollection([],{ + state: { + firstPage: 0, + lastPage: 0, + currentPage: 0, + pageSize: 1, + totalPages: 1, + totalRecords: 1, + sortKey: 'id', + order: 1, + }, + queryParam: { + currentPage: 'current_page', + pageSize: 'page_size', + totalPages: 'total_pages', + totalRecords: 'total_records', + sortKey: 'sort_key', + order: 'order', + directions: '', + }, + }); + + var testCollection6 = new TestCollection([ + {}, + {}, + ]); + + } + + + + module Fetching { + + class TestCollection extends Backbone.PageableCollection { + constructor(models?: TestModel[], + options?: Backbone.PageableInitialOptions){ + super(); + } + } + + + var testCollection = new TestCollection(); + + var result:JQueryXHR = testCollection.fetch(); + + testCollection.fetch({}); + + testCollection.fetch(makeFetchOptions()); + + } + + + + module Paging { + + class TestCollection extends Backbone.PageableCollection { + constructor(models?: TestModel[], + options?: Backbone.PageableInitialOptions){ + super(); + } + } + + var options = makeFetchOptions(); + + var testCollection = new TestCollection(); + + + var result:JQueryXHR|TestCollection = testCollection.getFirstPage(); + + testCollection.getFirstPage(options); + + // 'silent's type is boolean. (structural subtyping) + testCollection.getFirstPage({silent: 'aa'}); + // 'url's type is string. (structural subtyping) + testCollection.getFirstPage({url: true}); + + + result = testCollection.getLastPage(); + + testCollection.getLastPage(options); + + // 'silent's type is boolean. (structural subtyping) + testCollection.getLastPage({silent: 'aa'}); + // 'url's type is string. (structural subtyping) + testCollection.getLastPage({url: true}); + + + result = testCollection.getNextPage(); + + testCollection.getNextPage(options); + + // 'silent's type is boolean. (structural subtyping) + testCollection.getNextPage({silent: 'aa'}); + // 'url's type is string. (structural subtyping) + testCollection.getNextPage({url: true}); + + + result = testCollection.getPage(1); + + testCollection.getPage("1", options); + + // 'silent's type is boolean. (structural subtyping) + testCollection.getPage(1, {silent: 'aa'}); + // 'url's type is string. (structural subtyping) + testCollection.getPage(1, {url: true}); + + + result = testCollection.getPageByOffset(1); + + testCollection.getPageByOffset(1, options); + + // 'silent's type is boolean. (structural subtyping) + testCollection.getPageByOffset(1, {silent: 'aa'}); + // 'url's type is string. (structural subtyping) + testCollection.getPageByOffset(1, {url: true}); + + + result = testCollection.getPreviousPage(); + + testCollection.getPreviousPage(options); + + // 'silent's type is boolean. (structural subtyping) + testCollection.getPreviousPage({silent: 'aa'}); + // 'url's type is string. (structural subtyping) + testCollection.getPreviousPage({url: true}); + + + var hasPage:boolean = testCollection.hasNextPage(); + + hasPage = testCollection.hasPreviousPage(); + + } + + + + + module Parse { + + class TestCollection extends Backbone.PageableCollection { + constructor(models?: TestModel[], + options?: Backbone.PageableInitialOptions){ + super(); + } + } + + var testCollection = new TestCollection(); + + var result:any[] = testCollection.parse({}, {}); + + + var resultLinks:any = testCollection.parseLinks({}, {}); + + resultLinks = testCollection.parseLinks({}, { xhr: $.ajax({}) } ); + + + result = testCollection.parseRecords({}, {}); + + + var resultState: Backbone.PageableState = testCollection.parseState( + {}, + { + currentPage: 'current_page', + pageSize: 'page_size', + totalPages: 'total_pages', + totalRecords: 'total_records', + sortKey: 'sort_key', + order: 'order', + directions: '', + }, + { + firstPage: 0, + lastPage: 0, + currentPage: 0, + pageSize: 1, + totalPages: 1, + totalRecords: 1, + sortKey: 'id', + order: 1, + }, + {}); + + } + + + + module Setting { + + class TestCollection extends Backbone.PageableCollection { + constructor(models?: TestModel[], + options?: Backbone.PageableInitialOptions){ + super(); + } + } + + var testCollection = new TestCollection(); + + var options = makeFetchOptions(); + + + var result1:JQueryXHR|TestCollection + = testCollection.setPageSize(1, options); + + + var result2:TestCollection + = testCollection.setSorting('id', 1, options); + + + result1 = testCollection.switchMode( + 'server', + {fetch: true, resetState: true} + ); + + } + + + + module Syncing { + + class TestCollection extends Backbone.PageableCollection { + constructor(models?: TestModel[], + options?: Backbone.PageableInitialOptions){ + super(); + } + } + + var testCollection = new TestCollection(); + + + var result:JQueryXHR = testCollection.sync('server', new TestModel(), {}); + + result = testCollection.sync('server', testCollection, {}); + + } + + + + module Confllict { + + var result:typeof Backbone.PageableCollection + = Backbone.PageableCollection.noConflict(); + + } + +} diff --git a/backbone.paginator/backbone.paginator.d.ts b/backbone.paginator/backbone.paginator.d.ts new file mode 100644 index 000000000..3a1e00d51 --- /dev/null +++ b/backbone.paginator/backbone.paginator.d.ts @@ -0,0 +1,120 @@ +// Type definitions for backbone.paginator 2.0.2 +// Project: https://github.com/backbone-paginator/backbone.paginator +// Definitions by: Nyamazing +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Backbone { + + interface PageableState { + firstPage?: number; + lastPage?: number; + currentPage?: number; + pageSize?: number; + totalPages?: number; + totalRecords?: number; + sortKey?: string; + order?: number; + } + + interface PageableQueryParams { + currentPage?: string; + pageSize?: string; + totalPages?: string; + totalRecords?: string; + sortKey?: string; + order?: string; + directions?: any; + } + + interface PageableInitialOptions { + comparator?: (...options: any[]) => number; + full?: boolean; + state?: PageableState; + queryParam?: PageableQueryParams; + } + + interface PageableParseLinksOptions { + xhr?: JQueryXHR; + } + + interface PageableSetSortingOptions { + side?: string; + full?: boolean; + sortValue?: (model: TModel, sortKey: string) => any | string; + } + + interface PageableSwitchModeOptions { + fetch?: boolean; + resetState?: boolean; + } + + type PageableGetPageOptions = CollectionFetchOptions|Silenceable; + + class PageableCollection extends Collection{ + + fullCollection: Collection; + mode: string; + queryParams: PageableQueryParams; + state: PageableState; + + constructor(models?: TModel[], options?: PageableInitialOptions); + + fetch(options?: CollectionFetchOptions): JQueryXHR; + + getFirstPage(options?: PageableGetPageOptions): + JQueryXHR|PageableCollection; + + getLastPage(options?: PageableGetPageOptions): + JQueryXHR|PageableCollection; + + getNextPage(options?: PageableGetPageOptions): + JQueryXHR|PageableCollection; + + getPage(index: number|string, options?: PageableGetPageOptions): + JQueryXHR|PageableCollection; + + getPageByOffset(offset: number, options?: PageableGetPageOptions): + JQueryXHR|PageableCollection; + + getPreviousPage(options?: PageableGetPageOptions): + JQueryXHR|PageableCollection; + + hasNextPage(): boolean; + + hasPreviousPage(): boolean; + + parse(resp: any, options?: any): any[]; + + parseLinks(resp: any, options?: PageableParseLinksOptions): any; + + parseRecords(resp: any, options?: any): any[]; + + parseState(resp: any, queryParams: PageableQueryParams, + state: PageableState, options?: any): PageableState; + + setPageSize(pageSize: number, + options?: CollectionFetchOptions): + JQueryXHR|PageableCollection; + + setSorting(sortKey: string, order?: number, + options?: PageableSetSortingOptions): + PageableCollection; + + switchMode(mode?: string, options?: PageableSwitchModeOptions): + JQueryXHR|PageableCollection; + + sync(method: string, + model: TModel|Collection, + options?: any): JQueryXHR; + + static noConflict(): typeof PageableCollection; + + } +} + +declare module 'backbone.marionette' { + import Backbone = require('backbone'); +} + From 9d8c71db987f1ed82fe7bccdcc4bf2fe8cb884ee Mon Sep 17 00:00:00 2001 From: Nyamazing Date: Sun, 22 Mar 2015 18:53:07 +0900 Subject: [PATCH 150/243] remove needless lines --- backbone.paginator/backbone.paginator.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/backbone.paginator/backbone.paginator.d.ts b/backbone.paginator/backbone.paginator.d.ts index 3a1e00d51..6eb560cc8 100644 --- a/backbone.paginator/backbone.paginator.d.ts +++ b/backbone.paginator/backbone.paginator.d.ts @@ -114,7 +114,3 @@ declare module Backbone { } } -declare module 'backbone.marionette' { - import Backbone = require('backbone'); -} - From 09e19b77493a4742eb3e29966cddfe3d59264329 Mon Sep 17 00:00:00 2001 From: Jake Aitchison Date: Sun, 22 Mar 2015 13:23:49 +0000 Subject: [PATCH 151/243] Add support for jasmine 2.2 Asynch timeout syntax --- jasmine/jasmine-tests.ts | 17 +++++++++++++++++ jasmine/jasmine.d.ts | 28 ++++++++++++++-------------- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index cbac45d16..ef0572303 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -712,6 +712,23 @@ describe("Asynchronous specs", function () { expect(value).toBeGreaterThan(0); done(); }); + + describe("long asynchronous specs", function() { + beforeEach(function(done) { + done(); + }, 1000); + + it("takes a long time", function(done) { + setTimeout(function() { + done(); + }, 9000); + }, 10000); + + afterEach(function(done) { + done(); + }, 1000); + }); + }); describe("Fail", function () { diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index efa0a62ae..3727f8839 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -10,25 +10,25 @@ declare function describe(description: string, specDefinitions: () => void): voi declare function fdescribe(description: string, specDefinitions: () => void): void; declare function xdescribe(description: string, specDefinitions: () => void): void; -declare function it(expectation: string, assertion?: () => void): void; -declare function it(expectation: string, assertion?: (done: () => void) => void): void; -declare function fit(expectation: string, assertion?: () => void): void; -declare function fit(expectation: string, assertion?: (done: () => void) => void): void; -declare function xit(expectation: string, assertion?: () => void): void; -declare function xit(expectation: string, assertion?: (done: () => void) => void): void; +declare function it(expectation: string, assertion?: () => void, timeout?: number): void; +declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function fit(expectation: string, assertion?: () => void, timeout?: number): void; +declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function xit(expectation: string, assertion?: () => void, timeout?: number): void; +declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; /** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */ declare function pending(): void; -declare function beforeEach(action: () => void): void; -declare function beforeEach(action: (done: () => void) => void): void; -declare function afterEach(action: () => void): void; -declare function afterEach(action: (done: () => void) => void): void; +declare function beforeEach(action: () => void, timeout?: number): void; +declare function beforeEach(action: (done: () => void) => void, timeout?: number): void; +declare function afterEach(action: () => void, timeout?: number): void; +declare function afterEach(action: (done: () => void) => void, timeout?: number): void; -declare function beforeAll(action: () => void): void; -declare function beforeAll(action: (done: () => void) => void): void; -declare function afterAll(action: () => void): void; -declare function afterAll(action: (done: () => void) => void): void; +declare function beforeAll(action: () => void, timeout?: number): void; +declare function beforeAll(action: (done: () => void) => void, timeout?: number): void; +declare function afterAll(action: () => void, timeout?: number): void; +declare function afterAll(action: (done: () => void) => void, timeout?: number): void; declare function expect(spy: Function): jasmine.Matchers; declare function expect(actual: any): jasmine.Matchers; From aee42d3e873a332bda7ff2a77d0c5973a11cd2d3 Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 23 Mar 2015 01:32:25 +0900 Subject: [PATCH 152/243] update pathwatcher --- pathwatcher/pathwatcher.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pathwatcher/pathwatcher.d.ts b/pathwatcher/pathwatcher.d.ts index a4570e1cb..4ca5f590d 100644 --- a/pathwatcher/pathwatcher.d.ts +++ b/pathwatcher/pathwatcher.d.ts @@ -26,7 +26,8 @@ declare module PathWatcher { write(text:string):void; readSync(flushCache:boolean):string; read(flushCache?:boolean):Q.Promise; - exists():boolean; + // exists():boolean; + existsSync():boolean; setDigest(contents:string):void; getDigest():string; writeFileWithPrivilegeEscalationSync (filePath:string, text:string):void; From f0c934f8c40459756ba9c96e3ec1163064975304 Mon Sep 17 00:00:00 2001 From: Michael Zabka Date: Sun, 22 Mar 2015 18:09:35 +0100 Subject: [PATCH 153/243] Add npm library fs-finder --- fs-finder/fs-finder-tests.ts | 87 ++++++++++++++++++++++++++++++++++++ fs-finder/fs-finder.d.ts | 55 +++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 fs-finder/fs-finder-tests.ts create mode 100644 fs-finder/fs-finder.d.ts diff --git a/fs-finder/fs-finder-tests.ts b/fs-finder/fs-finder-tests.ts new file mode 100644 index 000000000..3f6a82d6c --- /dev/null +++ b/fs-finder/fs-finder-tests.ts @@ -0,0 +1,87 @@ +/// + +import finder = require('fs-finder'); + + +// static +var a: FsFinder.Finder = finder.in('./*'); + +var b: FsFinder.Finder = finder.from('./*'); + +var c: FsFinder.Finder = finder.find('./*'); +finder.find('./*', (paths: string[]) => {}); + +var d: FsFinder.Finder = finder.findFiles('./*'); +finder.findFiles('./*', (paths: string[]) => {}); + +var e: FsFinder.Finder = finder.findDirectories('./*'); +finder.findDirectories('./*', (paths: string[]) => {}); + +var f: FsFinder.Finder = finder.findFile('./*'); +finder.findFile('./*', (paths: string[]) => {}); + +var g: FsFinder.Finder = finder.findDirectory('./*'); +finder.findDirectory('./*', (paths: string[]) => {}); + + +// instance +var instance = finder.in('./any*'); + +var j: string[] = instance.find('./*'); +instance.find('./*', (paths: string[]) => {}); + +var k: string[] = instance.findFiles('./*'); +instance.findFiles('./*', (paths: string[]) => {}); + +var l: string[] = instance.findDirectories('./*'); +instance.findDirectories('./*', (paths: string[]) => {}); + +var m: string[] = instance.findFile('./*'); +instance.findFile('./*', (paths: string[]) => {}); + +var n: string[] = instance.findDirectory('./*'); +instance.findDirectory('./*', (paths: string[]) => {}); + +var paths: string[]; +paths = instance.find(); +paths = instance.findFiles(); +paths = instance.findDirectories(); +paths = instance.findFile(); +paths = instance.findDirectory(); + + +// Base +instance = instance.recursively(); +instance = instance.recursively(false); +instance = instance.exclude('b'); +instance = instance.exclude(['b']); +instance = instance.exclude('a', true); +instance = instance.showSystemFiles(); +instance = instance.showSystemFiles(false); +instance = instance.lookUp(); +instance = instance.lookUp(false); +instance = instance.findFirst(); +instance = instance.findFirst(true); +instance = instance.filter((path: string) => { + return false; +}); + +paths = instance.getPathsSync('all', './*', './dir'); +instance.getPathsAsync((paths: string[]) => {}, 'all', './*', './dir'); +paths = instance.getPathsSync('directories', './*', './dir'); +instance.getPathsAsync((paths: string[]) => {}, 'directories', './*', './dir'); +paths = instance.getPathsSync('files', './*', './dir'); +instance.getPathsAsync((paths: string[]) => {}, 'files', './*', './dir'); + +var is: boolean; +is = instance.checkExcludes('a'); +is = instance.checkSystemFiles('b'); +is = instance.checkFilters('c', {}); + +var numeric: number; +numeric = instance.checkFile('d', {}, './*.ts', 'all'); +numeric = instance.checkFile('d', {}, './*.ts', 'directories'); +numeric = instance.checkFile('d', {}, './*.ts', 'files'); + +paths = instance.getPathsFromParentsSync('a', 'all'); +instance.getPathsFromParentsAsync((paths: string[]) => {}, '*.ts', 'all'); diff --git a/fs-finder/fs-finder.d.ts b/fs-finder/fs-finder.d.ts new file mode 100644 index 000000000..a04ed8799 --- /dev/null +++ b/fs-finder/fs-finder.d.ts @@ -0,0 +1,55 @@ +// Type definitions for fs-finder v1.8.0 +// Project: https://github.com/sakren/node-fs-finder +// Definitions by: Michael Zabka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module FsFinder { + + type AsyncFunction = (paths: string|string[]) => void; + type Type = string; // 'all'|'directories'|'files' + type Mask = string; + type Directory = string; + + export class Finder extends Base { + static TIME_FORMAT: string; + static in(path: string): Finder; + static from(path: string): Finder; + static find(path: string, fn?: AsyncFunction, type?: Type): Finder; + static findFiles(path?: string, fn?: AsyncFunction): Finder; + static findDirectories(path?: string, fn?: AsyncFunction): Finder; + static findFile(path?: string, fn?: AsyncFunction): Finder; + static findDirectory(path?: string, fn?: AsyncFunction): Finder; + find(mask?: Mask, fn?: AsyncFunction, type?: Type): string[]; + findFiles(mask?: Mask, fn?: AsyncFunction): string[]; + findDirectories(mask?: Mask, fn?: AsyncFunction): string[]; + findFile(mask?: Mask, fn?: AsyncFunction): string[]; + findDirectory(mask?: Mask, fn?: AsyncFunction): string[]; + size(operation?: any, value?: any): Finder; + date(operation?: any, value?: any): Finder; + } + + export class Base { + recursively(recursive?: boolean): Finder; + exclude(excludes: string|string[], exactly?: boolean): Finder; + showSystemFiles(systemFiles?: boolean): Finder; + lookUp(up?: boolean): Finder; + findFirst(findFirst?: boolean): Finder; + filter(fn: Function): Finder; + + getPathsSync(type?: Type, mask?: Mask, dir?: Directory): string[]; + getPathsAsync(fn: AsyncFunction, type?: Type, mask?: Mask, dir?: Directory): void; + + checkExcludes(path: string): boolean; + checkSystemFiles(path: string): boolean; + checkFilters(path: string, stats: any): boolean; + checkFile(path: string, stats: any, mask: Mask, type: Type): number; + + getPathsFromParentsSync(mask?: Mask, type?: Type): string[]; + getPathsFromParentsAsync(fn: AsyncFunction, mask?: Mask, type?: Type): void; + } +} + +declare module "fs-finder" { + import Finder = FsFinder.Finder; + export = Finder; +} From 0fe94d00f62c380037c686c828a9fad15c87ee46 Mon Sep 17 00:00:00 2001 From: Matt Brennan Date: Sun, 22 Mar 2015 17:22:37 +0000 Subject: [PATCH 154/243] eventemitter2: listener arg to offAny is optional --- eventemitter2/eventemitter2.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventemitter2/eventemitter2.d.ts b/eventemitter2/eventemitter2.d.ts index abaa0756e..dc9bb260b 100644 --- a/eventemitter2/eventemitter2.d.ts +++ b/eventemitter2/eventemitter2.d.ts @@ -55,7 +55,7 @@ declare class EventEmitter2 { * Removes the listener that will be fired when any event is emitted. * @param listener */ - offAny(listener: Function): EventEmitter2; + offAny(listener?: Function): EventEmitter2; /** * Adds a one time listener for the event. From 4d64698eff1569cd199831301cb694eccc55b87e Mon Sep 17 00:00:00 2001 From: Michael Zabka Date: Sun, 22 Mar 2015 18:58:43 +0100 Subject: [PATCH 155/243] Add npm library object-hash --- object-hash/object-hash-tests.ts | 48 +++++++++++++++++++++++++++++ object-hash/object-hash.d.ts | 52 ++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 object-hash/object-hash-tests.ts create mode 100644 object-hash/object-hash.d.ts diff --git a/object-hash/object-hash-tests.ts b/object-hash/object-hash-tests.ts new file mode 100644 index 000000000..e72c9e489 --- /dev/null +++ b/object-hash/object-hash-tests.ts @@ -0,0 +1,48 @@ +/// + +import hash = require('object-hash'); + +var hashed: string; + +var obj = { any: true }; + +// hash object +hashed = hash(obj); + +hashed = hash.sha1(obj); +hashed = hash.keys(obj); +hashed = hash.MD5(obj); +hashed = hash.keysMD5(obj); + +var options = { + algorithm: 'md5', + encoding: 'utf8', + excludeValues: true +}; + +hashed = hash(obj, options); + +// HashTable +var table: ObjectHash.HashTable; +table = hash.HashTable(); +table = hash.HashTable(options); + +table = table.add(obj); +table = table.add(obj, obj); +table = table.remove(obj); +table = table.remove(obj, obj); + +var has: boolean = table.hasKey('whatEver'); +var value: any = table.getValue('whatEver'); +var count: number = table.getCount('whatEver'); + +var tableObject = table.table(); +tableObject['whatEver'].value; +tableObject['whatEver'].count; + +var tableArray = table.toArray(); +tableArray.shift().value; +tableArray.pop().count; +tableArray[2].hash; + +table = table.reset(); diff --git a/object-hash/object-hash.d.ts b/object-hash/object-hash.d.ts new file mode 100644 index 000000000..8faf058da --- /dev/null +++ b/object-hash/object-hash.d.ts @@ -0,0 +1,52 @@ +// Type definitions for object-hash v0.5.0 +// Project: https://github.com/puleos/object-hash +// Definitions by: Michael Zabka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module ObjectHash { + export interface IOptions { + algorithm?: string; + encoding?: string; + excludeValues?: boolean; + } + + interface HashTableItem { + value: any; + count: number; + } + + interface HashTableItemWithKey extends HashTableItem { + hash: string; + } + + export interface HashTable { + add(...values: any[]): HashTable; + remove(...values: any[]): HashTable; + hasKey(key: string): boolean; + getValue(key: string): any; + getCount(key: string): number; + table(): { [key: string]: HashTableItem }; + toArray(): HashTableItemWithKey[]; + reset(): HashTable; + } + + export interface HashTableStatic { + (options?: IOptions): HashTable; + } + + export interface Hash { + (object: any, options?: IOptions): string; + sha1(object: any): string; + keys(object: any): string; + MD5(object: any): string; + keysMD5(object: any): string; + HashTable: HashTableStatic; + } + + export var HashStatic: Hash; +} + +declare module 'object-hash' { + import HashStatic = ObjectHash.HashStatic; + export = HashStatic; +} From 2d74d784bda137f653415444b549bdb7a4827994 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Sun, 22 Mar 2015 20:37:17 +0000 Subject: [PATCH 156/243] auth_pass is a string (password), not a boolean. --- redis/redis.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/redis.d.ts b/redis/redis.d.ts index a3bd49e91..902cb770d 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -42,7 +42,7 @@ declare module "redis" { retry_max_delay?: number; connect_timeout?: number; max_attempts?: number; - auth_pass?: boolean; + auth_pass?: string; } interface RedisClient extends NodeJS.EventEmitter { From 6e9cfe92bbf78f28dc9ea01102415a431fc21a5f Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Sun, 22 Mar 2015 20:39:45 +0000 Subject: [PATCH 157/243] make parser optional --- redis/redis.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/redis.d.ts b/redis/redis.d.ts index 902cb770d..8e9c97856 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -33,7 +33,7 @@ declare module "redis" { } interface ClientOpts { - parser: string; + parser?: string; return_buffers?: boolean; detect_buffers?: boolean; socket_nodelay?: boolean; From c62ba500455c0b76ad6c6edc4e39ec59ef126dfe Mon Sep 17 00:00:00 2001 From: David Li Date: Sun, 22 Mar 2015 16:52:07 -0400 Subject: [PATCH 158/243] threejs: Add missing methods in trackballcontrols Signed-off-by: David Li --- threejs/three-trackballcontrols.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/threejs/three-trackballcontrols.d.ts b/threejs/three-trackballcontrols.d.ts index 21d096812..e969bcb5e 100644 --- a/threejs/three-trackballcontrols.d.ts +++ b/threejs/three-trackballcontrols.d.ts @@ -29,5 +29,13 @@ declare module THREE { keys:number[]; update():void; + reset():void; + checkDistances():void; + zoomCamera():void; + panCamera():void; + rotateCamera():void; + + handleResize():void; + handleEvent(event: any):void; } -} \ No newline at end of file +} From dc067ac82c686e0cd11bdcf5190510ef14bf97b2 Mon Sep 17 00:00:00 2001 From: Bobdina Date: Mon, 23 Mar 2015 11:15:22 +0100 Subject: [PATCH 159/243] Update jquery.d.ts - deferred.fail() always returns the deferred object, ergo the failfilter can return anything - taking in the value parameter for a donefilter is optional - if a donefilter does not return anything, then the 'then' function continues with a void promise --- jquery/jquery.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 2452ec377..61fd62442 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -276,7 +276,15 @@ interface JQueryGenericPromise { * @param doneFilter A function that is called when the Deferred is resolved. * @param failFilter An optional function that is called when the Deferred is rejected. */ - then(doneFilter: (value: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => U|JQueryPromise, progressFilter?: (...progression: any[]) => any): JQueryPromise; + then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; } /** From d2d2a6586b2e9b8515287955f09c3a7f6e924bd7 Mon Sep 17 00:00:00 2001 From: Chris Barr Date: Mon, 23 Mar 2015 12:30:51 -0400 Subject: [PATCH 160/243] Adding params for Angular JS animation options According to [The ngAnimate Documentation](https://docs.angularjs.org/api/ngAnimate/#applying-directive-specific-styles-to-an-animation it), it's possible to optionally specify animation `to` and `from` prameters in an object that can optionally be passed in to `animate` `enter` `leave` `addClass` `removeClass` and `setClass` --- angularjs/angular-animate.d.ts | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/angularjs/angular-animate.d.ts b/angularjs/angular-animate.d.ts index 2af591b7a..e78b85c3e 100644 --- a/angularjs/angular-animate.d.ts +++ b/angularjs/angular-animate.d.ts @@ -36,9 +36,10 @@ declare module angular.animate { * @param from a collection of CSS styles that will be applied to the element at the start of the animation * @param to a collection of CSS styles that the element will animate towards * @param className an optional CSS class that will be added to the element for the duration of the animation (the default class is 'ng-inline-animate') + * @param options an optional collection of styles that will be picked up by the CSS transition/animation * @returns the animation callback promise */ - animate(element: JQuery, from: any, to: any, className?: string): ng.IPromise; + animate(element: JQuery, from: any, to: any, className?: string, options?: IAnimationOptions): ng.IPromise; /** * Appends the element to the parentElement element that resides in the document and then runs the enter animation. @@ -46,17 +47,19 @@ declare module angular.animate { * @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 options an optional collection of styles that will be picked up by the CSS transition/animation * @returns the animation callback promise */ - enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery): ng.IPromise; + enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery, options?: IAnimationOptions): ng.IPromise; /** * 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 options an optional collection of styles that will be picked up by the CSS transition/animation * @returns the animation callback promise */ - leave(element: JQuery): ng.IPromise; + leave(element: JQuery, options?: IAnimationOptions): ng.IPromise; /** * Fires the move DOM operation. Just before the animation starts, the animate service will either append @@ -76,9 +79,10 @@ declare module angular.animate { * * @param element the element that will be animated * @param className the CSS class that will be added to the element and then animated + * @param options an optional collection of styles that will be picked up by the CSS transition/animation * @returns the animation callback promise */ - addClass(element: JQuery, className: string): ng.IPromise; + addClass(element: JQuery, className: string, options?: IAnimationOptions): ng.IPromise; /** * Triggers a custom animation event based off the className variable and then removes the CSS class @@ -86,9 +90,10 @@ declare module angular.animate { * * @param element the element that will be animated * @param className the CSS class that will be animated and then removed from the element + * @param options an optional collection of styles that will be picked up by the CSS transition/animation * @returns the animation callback promise */ - removeClass(element: JQuery, className: string): ng.IPromise; + removeClass(element: JQuery, className: string, options?: IAnimationOptions): ng.IPromise; /** * Adds and/or removes the given CSS classes to and from the element. Once complete, the done() callback @@ -97,9 +102,10 @@ declare module angular.animate { * @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 options an optional collection of styles that will be picked up by the CSS transition/animation * @returns the animation callback promise */ - setClass(element: JQuery, add: string, remove: string): ng.IPromise; + setClass(element: JQuery, add: string, remove: string, options?: IAnimationOptions): ng.IPromise; /** * Cancels the provided animation. @@ -128,4 +134,13 @@ declare module angular.animate { */ classNameFilter(expression?: RegExp): RegExp; } + + /////////////////////////////////////////////////////////////////////////// + // Angular Animation Options + // see https://docs.angularjs.org/api/ngAnimate/#applying-directive-specific-styles-to-an-animation + /////////////////////////////////////////////////////////////////////////// + interface IAnimationOptions { + to?: Object; + from?: Object; + } } From f78ab44b56060b36f7a3a0efbe9a8f4b30ea4066 Mon Sep 17 00:00:00 2001 From: cuziacmihai Date: Mon, 23 Mar 2015 18:36:19 +0200 Subject: [PATCH 161/243] Update jquery.fancytree.d.ts Added Fancytree.rootNode & FancyTree.$div --- jquery.fancytree/jquery.fancytree.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jquery.fancytree/jquery.fancytree.d.ts b/jquery.fancytree/jquery.fancytree.d.ts index feb5135b8..34a9f1422 100644 --- a/jquery.fancytree/jquery.fancytree.d.ts +++ b/jquery.fancytree/jquery.fancytree.d.ts @@ -20,6 +20,10 @@ interface JQuery { declare module Fancytree { interface Fancytree { + $div: JQuery; + + rootNode: FancytreeNode; + /** Activate node with a given key and fire focus and * activate events. A prevously activated node will be * deactivated. If activeVisible option is set, all parents From c6ec8b91dd2131c835d5d9ca71d411d217d19ba6 Mon Sep 17 00:00:00 2001 From: Maksim Kozhukh Date: Mon, 23 Mar 2015 19:55:35 +0300 Subject: [PATCH 162/243] Webix UI 2.3.0 --- webix/webix-tests.ts | 66 + webix/webix.d.ts | 7533 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 7599 insertions(+) create mode 100644 webix/webix-tests.ts create mode 100644 webix/webix.d.ts diff --git a/webix/webix-tests.ts b/webix/webix-tests.ts new file mode 100644 index 000000000..128bc666c --- /dev/null +++ b/webix/webix-tests.ts @@ -0,0 +1,66 @@ +/// + +//ajax operations +webix.ready(function(){ + webix.ajax().get("te").then(function(){ + webix.message( webix.env.isFF ? "FireFox" : "Other" ); + }); +}); + +//webix helpers +webix.html.addCss(document.body, "text"); +webix.storage.local.get("mydata"); + +var proxy = webix.proxy("meteor", "books"); + +//webix ui helpers +webix.ui.zIndexBase = 101; +webix.ui.zIndex(); +webix.ui.resize(); + +//webix ui constructor +//basic view +var ui = webix.ui({ + view:"list", id:"l1" +}); +ui.adjust(); +$$("l1").adjust(); + +var l1 = {}; +var l2 = {}; + +//specific view types +var ui2 = webix.ui({ + view:"list", id:"21" +}); +ui2.add({ value:"100" }); + +//specific types by id +var list = $$("l1"); +list.add({ value:"100" }); +list.config.height = 100; + + + + +//config typing +var table:webix.ui.datatableConfig = {}; +table.columns = []; +table.autowidth = true; + +webix.ui({ rows:[ table ] }); + +//events +list.attachEvent("onItemClick", function(id:string, e:Event){ + var item = (this).getItem(id); + var self = webix.$$(e); + return true; +}); + +//data collections +var data = new webix.DataCollection(); +data.config["test"]= 123; + +//mixins +var t = webix.DataDriver.json; + diff --git a/webix/webix.d.ts b/webix/webix.d.ts new file mode 100644 index 000000000..a1761c63b --- /dev/null +++ b/webix/webix.d.ts @@ -0,0 +1,7533 @@ +// Type definitions for Webix UI v2.3.0 +// Project: http://webix.com +// Definitions by: Maksim Kozhukh +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module webix { + +type WebixTemplate = (...args: any[])=>string; +type WebixCallback = (...args: any[])=>any; +interface PromisedData { + then(handler:(data:any)=>any):PromisedData; +} + +function ajax():webix._ajax; +function $$(id: string|Event|HTMLElement):webix.ui.view; + + +interface _ajax{ + bind(master:any):webix._ajax; + del(url:string, params?:any, callback?:WebixCallback):PromisedData; + get(url:string, params?:any, callback?:WebixCallback):PromisedData; + getXHR():any; + headers(values:any):webix._ajax; + post(url:string, params?:any, callback?:WebixCallback):PromisedData; + put(url:string, params?:any, callback?:WebixCallback):PromisedData; + response(type:string):void; + stringify():void; + sync():webix._ajax; + master: any; +} +interface clipbuffer{ + destructor():void; + focus():void; + init():void; + set(text:string):void; +} +interface color{ + hexToDec(hex:string):number; + hsvToRgb(h:number, s:number, v:number):any[]; + rgbToHsv(r:number, g:number, b:number):any[]; + toHex(number:number, length?:number):string; + toRgb(rgb:string):any[]; +} +interface csv{ + parse(text:string, delimiter?:any):any[]; + stringify(data:any[], delimiter?:any):string; + delimiter: any; + escape: boolean; +} +interface editors{ + $popup: any; + checkbox: string; + color: string; + combo: string; + date: string; + "inline-checkbox": any; + "inline-text": any; + multiselect: string; + password: string; + popup: string; + richselect: string; + select: string; + text: string; +} +interface env{ + cssPrefix: string; + isFF: boolean; + isIE: boolean; + isSafari: boolean; + isWebKit: boolean; + jsPrefix: string; + mouse: any; + strict: boolean; + svg: boolean; + transform: boolean; + transition: boolean; + transitionDuration: string; + transitionEnd: string; + translate: string; +} +interface history{ + push(view:string, url:string, value:any):void; + track(view:string, url:string):void; +} +interface html{ + addCss(node:HTMLElement, name:string):void; + addMeta(name:string, value:string):void; + addStyle(css:string):void; + allowSelect():void; + create(name:string, attrs:any, html?:string):HTMLElement; + createCss(data:any):string; + denySelect():void; + getValue(node:HTMLElement):string; + index(node:HTMLElement):number; + insertBefore(node:HTMLElement, before:HTMLElement, rescue?:HTMLElement):void; + locate(ev:Event|HTMLElement, name:string):string; + offset(node:HTMLElement):any; + pos(ev:Event):any; + posRelative(ev:Event):any; + preventEvent(ev:Event):boolean; + remove(node:HTMLElement|HTMLElement[]):void; + removeCss(node:HTMLElement, name:string):void; + stopEvent(ev:Event):boolean; +} +interface i18n{ + dateFormatDate(date:string):any; + dateFormatStr(date:any):string; + fullDateFormatDate(date:string):any; + fullDateFormatStr(date:Date):string; + intFormat(num:number):string; + longDateFormatDate(date:string):any; + longDateFormatStr(date:any):string; + numberFormat(number:number):string; + parseFormatDate(date:string):any; + parseFormatStr(date:any):string; + parseTimeFormatDate(date:string):void; + parseTimeFormatStr(date:any):void; + priceFormat(number:number):string; + setLocale(name:string):void; + timeFormatDate(time:string):any; + timeFormatStr(date:any):string; + calendar: any; + controls: any; + dateFormat: string; + decimalDelimiter: string; + decimalSize: number; + fileSize: any[]; + fullDateFormat: string; + groupDelimiter: string; + groupSize: number; + locales: any; + longDateFormat: string; + parseFormat: string; + parseTimeFormat: string; + price: string; + priceSettings: any; + timeFormat: string; +} +interface locale{ + pager: any; +} +interface markup{ + init(node:string, target:string):webix.ui.baseview; + parse(data:any, datatype:string):void; + attribute: any; + dataTag: any; + namespace: any; +} +interface promise{ + all(promise:PromisedData, morepromises?:PromisedData):void; + defer():PromisedData; + fcall():PromisedData; + nfcall():PromisedData; +} +interface rules{ + isEmail():void; + isNotEmpty():void; + isNumber():void; +} +interface cookie{ + clear():void; + get(name:string):any; + put(name:string, value:any):void; + remove(name:string):void; +} +interface local{ + clear():void; + get(name:string):any; + put(name:string, value:any):void; + remove(name:string):void; +} +interface session{ + clear():void; + get(name:string):any; + put(name:string, value:any):void; + remove(name:string):void; +} +interface storage{ + cookie:webix.cookie; + local:webix.local; + session:webix.session; +} + +function alert(text:string, callback:WebixCallback):HTMLElement; +function animate(html_element:HTMLElement, animation:any):void; +function attachEvent(type:string, functor:WebixCallback, id?:string):string; +function bind(code:WebixCallback, master:any):WebixCallback; +function blockEvent():void; +function callEvent(name:string, params:any[]):boolean; +function clone(source:any):any; +function confirm(text:string, callback:WebixCallback):HTMLElement; +function copy(source:any):any; +function delay(code:WebixCallback, owner?:any, params?:any[], delay?:number):number; +function detachEvent(id:string):void; +function dp(name:string):any; +function editStop():void; +function event(node:HTMLElement, event:string, handler:WebixCallback, master?:any):string; +function eventRemove(id:string):void; +function exec(code:string):void; +function extend(target:any, source:any, overwrite:boolean):any; +function hasEvent(name:string):boolean; +function isArray(check:any):boolean; +function isDate(check:any):boolean; +function isUndefined(check:any):boolean; +function jsonp(url:string, params?:any, callback?:WebixCallback, master?:any):void; +function mapEvent(map:any):void; +function message(text:string):void; +function modalbox(text:string, callback:WebixCallback):HTMLElement; +function once(code:WebixCallback):void; +function proto(target:any, mixin1?:any, mixinN?:any):any; +function protoUI(target:any, view:any, mixin1?:any, mixinN?:any):any; +function proxy(type:string, source:string):any; +function ready(code:WebixCallback):void; +function remote():void; +function require(url:string):void; +function send(url:string, values:any, method:string, target:string):void; +function single(source:WebixCallback):WebixCallback; +function template(template:string):WebixCallback; +function toArray(array:any[]):any[]; +function toFunctor(name:string):WebixCallback; +function toNode(id:string):HTMLElement; +function type(config:any):void; +function ui(config:any, parent?:any, replacement?:any):webix.ui.baseview; +function uid():string; +function unblockEvent():void; +function wrap(target:WebixCallback, source:WebixCallback):WebixCallback; +var codebase: string; +var name: string; +var version: string; +var clipbuffer:webix.clipbuffer; +var color:webix.color; +var csv:webix.csv; +var editors:webix.editors; +var env:webix.env; +var history:webix.history; +var html:webix.html; +var i18n:webix.i18n; +var locale:webix.locale; +var markup:webix.markup; +var promise:webix.promise; +var rules:webix.rules; +var storage:webix.storage; + +interface ActiveContent{ + } +var ActiveContent:ActiveContent; + +interface AtomDataLoader{ + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + parse(data:any, type:string):void; +} +var AtomDataLoader:AtomDataLoader; + +interface AtomRender{ + render(id:string, data:any, type:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; +} +var AtomRender:AtomRender; + +interface AutoTooltip{ + } +var AutoTooltip:AutoTooltip; + +interface BaseBind{ + bind(target:any, rule?:WebixCallback, format?:string):void; + unbind():void; +} +var BaseBind:BaseBind; + +interface BindSource{ + addBind(source:any, rule:string, format:string):void; + getBindData(key:string, update:boolean):void; + removeBind(source:any):void; + saveBatch(func:WebixCallback):void; + setBindData(data:any, key:string):void; +} +var BindSource:BindSource; + +interface Canvas{ + clearCanvas():void; + getCanvas(context:string):any; + hideCanvas():void; + renderText(x:number, y:number, text:string, css:string, w:number):void; + renderTextAt(valign:string, align:string, x:number, y:number, t:string, c:string, w:number):void; + showCanvas():void; + toggleCanvas():void; +} +var Canvas:Canvas; + +interface CollectionBind{ + getCursor():number; + refreshCursor():void; + setCursor(cursor:string):void; +} +var CollectionBind:CollectionBind; + +interface ContextHelper{ + attachTo(view:any):void; + getContext():any; +} +var ContextHelper:ContextHelper; + +interface CopyPaste{ + } +var CopyPaste:CopyPaste; + +interface CustomScroll{ + enable(html_node:HTMLElement|webix.ui.baseview):void; + init():void; + scrollStep: number; +} +var CustomScroll:CustomScroll; + +interface DataCollection{ + add(obj:any, index?:number):string; + addBind(source:any, rule:string, format:string):void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearValidation():void; + count():number; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getBindData(key:string, update:boolean):void; + getCursor():number; + getFirstId():string; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getLastId():string; + getNextId(id:string, step:number):string; + getPrevId(id:string, step:number):string; + hasEvent(name:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + mapEvent(map:any):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + refreshCursor():void; + remove(id:string):void; + removeBind(source:any):void; + saveBatch(func:WebixCallback):void; + serialize():any; + setBindData(data:any, key:string):void; + setCursor(cursor:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + config: { [key: string]: any; }; + name: string; +} +interface DataCollectionFactory{ + new():DataCollection; +} +var DataCollection:DataCollectionFactory; + +interface DataDriver{ + csv: any; + html: any; + htmltable: any; + jsarray: any; + json: any; + xml: any; +} +var DataDriver:DataDriver; + +interface DataLoader{ + add(obj:any, index?:number):string; + clearAll():void; + count():number; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getFirstId():string; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getLastId():string; + getNextId(id:string, step:number):string; + getPrevId(id:string, step:number):string; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + serialize():any; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + updateItem(id:string, data:any):void; +} +var DataLoader:DataLoader; + +interface DataMarks{ + addCss(id:string|number, css:string, silent?:boolean):void; + clearCss(css:string, silent?:boolean):void; + hasCss(id:string, css:string):boolean; + removeCss(id:string|number, css:string, silent?:boolean):void; +} +var DataMarks:DataMarks; + +interface DataMove{ + copy(sid:string, tindex:number, tobj?:any, details?:any):void; + move(sid:string, tindex:number, tobj?:any, details?:any):string; + moveBottom(id:string):void; + moveDown(id:string, step:number):void; + moveTop(id:string):void; + moveUp(id:string, step:number):void; +} +var DataMove:DataMove; + +interface DataProcessor{ + attachEvent(type:string, functor:WebixCallback, id?:string):string; + attachProgress(start:WebixCallback, end:WebixCallback, error:WebixCallback):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearValidation():void; + define(property:string, value:any):void; + detachEvent(id:string):void; + escape(value:string):string; + getItemState(itemId:string):any; + getState():string|boolean; + hasEvent(name:string):boolean; + ignore(code:WebixCallback, master:any):void; + mapEvent(map:any):void; + off():void; + on():void; + processResult(data:any):void; + reset():void; + save(id:string, operation:string):void; + send():void; + setItemState(itemId:string, state:boolean):void; + unblockEvent():void; + validate():boolean; + config: { [key: string]: any; }; + name: string; +} +var DataProcessor:DataProcessor; + +interface DataRecord{ + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + detachEvent(id:string):void; + getValues():any; + hasEvent(name:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + mapEvent(map:any):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + setValues(values:any, update?:boolean):void; + unbind():void; + unblockEvent():void; + config: { [key: string]: any; }; + name: string; +} +var DataRecord:DataRecord; + +interface DataState{ + getState():any; + setState(state:any):void; +} +var DataState:DataState; + +interface DataStore{ + add(obj:any, index?:number):string; + addMark(id:string, name:string, css?:boolean, value?:any):any; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + changeId(old:string, newid:string):void; + clearAll():void; + clearMark(name:string):void; + count():number; + destructor():void; + detachEvent(id:string):void; + each(method:WebixCallback, master?:any, all?:boolean):void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getFirstId():string; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getIndexRange(from:string, to:string):any[]; + getItem(id:string):any; + getLastId():string; + getMark(id:string, mark_name:string):any; + getNextId(id:string, step:number):string; + getPrevId(id:string, step:number):string; + getRange(from:string, to:string):any[]; + hasEvent(name:string):boolean; + id(item:any):string; + importData(source:webix.ui.baseview):void; + mapEvent(map:any):void; + move(sid:string, tindex:number, tobj?:any, details?:any):string; + provideApi(target:any, eventable:boolean):void; + refresh(id?:string):void; + remove(id:string):void; + removeMark(id:string, name:string, css:boolean):void; + scheme(config:any):void; + serialize():any; + setDriver(type:string):void; + silent(code:WebixCallback):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unblockEvent():void; + unsync():void; + updateItem(id:string, data:any):void; + driver: any; + name: string; + order: any[]; + pull: any; +} +var DataStore:DataStore; + +interface DataValue{ + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + detachEvent(id:string):void; + getValue():string; + hasEvent(name:string):boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + setValue(value:string):void; + unbind():void; + unblockEvent():void; + name: string; +} +var DataValue:DataValue; + +interface Date{ + add(date:any, inc:number, mode:string):any; + copy(date:any):any; + datePart(date:any):any; + dateToStr(format:string, utc:boolean):WebixCallback; + dayStart(date:any):any; + equal(datea:any, dateb:any):boolean; + getISOWeek(date:any):number; + getUTCISOWeek(data:any):number; + isHoliday(date:any):boolean; + monthStart(date:any):any; + strToDate(format:string, utc:boolean):WebixCallback; + timePart(date:any):number; + toFixed(num:number):number; + weekStart(date:any):any; + yearStart(date:any):any; + startOnMonday: boolean; +} +var Date:Date; + +interface Destruction{ + destructor():void; +} +var Destruction:Destruction; + +interface DragControl{ + addDrag(node:string|HTMLElement, ctrl:any):void; + addDrop(node:string|HTMLElement, ctrl:any, master_mode:boolean):void; + createDrag(event:Event):void; + destroyDrag():void; + getContext():any; + getMaster(target:any):any; + getNode():HTMLElement; + sendSignal(signal:string):void; + $drag(s:any, e:Event):HTMLElement; + $dragIn(s:any, t:any, e:Event):void; + $dragOut(s:any, t:any, n:any, e:Event):void; + $dragPos: WebixCallback; + $drop(s:any, t:any, d:any, e:Event):void; + left: number; + top: number; +} +var DragControl:DragControl; + +interface DragItem{ + $drag(source:HTMLElement, ev:Event):string; + $dragHTML: WebixCallback; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragMark(context:any, ev:Event):boolean; + $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; + $dropAllow: WebixCallback; +} +var DragItem:DragItem; + +interface DragOrder{ + $drag(source:HTMLElement, ev:Event):string; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragPos: WebixCallback; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; +} +var DragOrder:DragOrder; + +interface EditAbility{ + edit(id:any):void; + editCancel():void; + editNext():boolean; + editStop():void; + focusEditor():void; + getEditState():any; + getEditor(id?:string):any; + getEditorValue():string; + validateEditor(id?:string):boolean; +} +var EditAbility:EditAbility; + +interface EventSystem{ + attachEvent(type:string, functor:WebixCallback, id?:string):string; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + detachEvent(id:string):void; + hasEvent(name:string):boolean; + mapEvent(map:any):void; + unblockEvent():void; +} +var EventSystem:EventSystem; + +interface Group{ + group(config:any, mode:boolean):void; + ungroup(mode:boolean):void; +} +var Group:Group; + +interface GroupMethods{ + any(property:string, data:any):void; + count(property:string, data:any):void; + max(property:string, data:any):void; + min(property:string, data:any):void; + string(property:string, data:any):void; + sum(property:string, data:any):void; +} +var GroupMethods:GroupMethods; + +interface GroupStore{ + group(stats:any):void; + ungroup():void; +} +var GroupStore:GroupStore; + +interface HtmlMap{ + addPoly(id:string, points:any[]):void; + addRect(id:string, points:any[], userdata?:string):void; + addSector(id:string, aplha0:number, aplha1:number, x:number, y:number, R:number, ky:number):void; + render(html:HTMLElement):void; +} +var HtmlMap:HtmlMap; + +interface IdSpace{ + innerId(id:string):string; + ui(view:any):webix.ui.baseview; + $$: any; +} +var IdSpace:IdSpace; + +interface KeysNavigation{ + moveSelection(direction:string):void; +} +var KeysNavigation:KeysNavigation; + +interface MapCollection{ + } +var MapCollection:MapCollection; + +interface Modality{ + } +var Modality:Modality; + +interface MouseEvents{ + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; +} +var MouseEvents:MouseEvents; + +interface Movable{ + } +var Movable:Movable; + +interface NavigationButtons{ + } +var NavigationButtons:NavigationButtons; + +interface Number{ + format(value:number, config:any):string; + numToStr(config:any):WebixCallback; +} +var Number:Number; + +interface OverlayBox{ + hideOverlay():void; + showOverlay():void; +} +var OverlayBox:OverlayBox; + +interface PagingAbility{ + getPage():number; + getPager():any; + setPage(page:number):void; +} +var PagingAbility:PagingAbility; + +interface PowerArray{ + each(functor:WebixCallback, master:any):void; + filter(functor:WebixCallback, master:any):any[]; + find(data:any):number; + insertAt(data:any, pos:number):void; + map(functor:WebixCallback, master:any):any[]; + remove(value:any):void; + removeAt(pos:number, len:number):void; +} +var PowerArray:PowerArray; + +interface ProgressBar{ + hideProgress():void; + showProgress(config?:any):void; +} +var ProgressBar:ProgressBar; + +interface RecordBind{ + } +var RecordBind:RecordBind; + +interface RenderStack{ + customize(obj:any):void; + getItemNode(id:string):void; + locate(e:Event):string; + render(id:string, data:any, type:string):void; + showItem(id:string):void; + type: { [key: string]: any; }; + types: { [key: string]: any; }; +} +var RenderStack:RenderStack; + +interface Scrollable{ + getScrollState():any; + scrollTo(x:number, y:number):void; +} +var Scrollable:Scrollable; + +interface SelectionModel{ + getSelectedId(as_array:boolean):string|any[]; + getSelectedItem(as_array?:boolean):any; + isSelected(id:string):boolean; + select(id:string|any[], preserve:boolean):void; + selectAll(from?:string, to?:string):void; + unselect(id?:string):void; + unselectAll():void; +} +var SelectionModel:SelectionModel; + +interface Settings{ + define(property:string, value:any):void; + config: { [key: string]: any; }; + name: string; +} +var Settings:Settings; + +interface SingleRender{ + customize(obj:any):void; + render(id:string, data:any, type:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + type: { [key: string]: any; }; +} +var SingleRender:SingleRender; + +interface TablePaste{ + } +var TablePaste:TablePaste; + +interface Touch{ + disable():void; + enable():void; + limit(mode:boolean):void; + scrollTo(node:HTMLElement, x:number, y:number, speed:string):void; + config: any; +} +var Touch:Touch; + +interface TreeAPI{ + close(id:string):void; + closeAll():void; + getOpenItems():any[]; + getState():any; + isBranchOpen(id:string):boolean; + open(id:string):void; + openAll():void; + setState(state:any):void; +} +var TreeAPI:TreeAPI; + +interface TreeClick{ + webix_tree_checkbox(obj:any, common:{ [key: string]: any; }):string; + webix_tree_close(obj:any, common:{ [key: string]: any; }):string; + webix_tree_open(obj:any, common:{ [key: string]: any; }):string; +} +var TreeClick:TreeClick; + +interface TreeCollection{ + add(obj:any, index?:number):string; + addBind(source:any, rule:string, format:string):void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearValidation():void; + count():number; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getBindData(key:string, update:boolean):void; + getBranchIndex(id:string, parent?:string):number; + getCursor():number; + getFirstChildId(id:string):string; + getFirstId():string; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getLastId():string; + getNextId(id:string, step:number):string; + getNextSiblingId(id:any):string; + getParentId(id:string):string; + getPrevId(id:string, step:number):string; + getPrevSiblingId(id:any):string; + hasEvent(name:string):boolean; + isBranch(id:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadBranch(id:string, callback:WebixCallback, url:string):void; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + mapEvent(map:any):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + refreshCursor():void; + remove(id:string):void; + removeBind(source:any):void; + saveBatch(func:WebixCallback):void; + serialize():any; + setBindData(data:any, key:string):void; + setCursor(cursor:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + config: { [key: string]: any; }; + name: string; +} +var TreeCollection:TreeCollection; + +interface TreeDataLoader{ + loadBranch(id:string, callback:WebixCallback, url:string):void; +} +var TreeDataLoader:TreeDataLoader; + +interface TreeDataMove{ + copy(sid:string, tindex:number, tobj?:webix.ui.baseview, details?:any):string; + move(sid:string, tindex:number, tobj?:webix.ui.baseview, details?:any):string; + $dropAllow: WebixCallback; +} +var TreeDataMove:TreeDataMove; + +interface TreeRenderStack{ + getItemNode(id:string):void; + getItemNode(id:string):HTMLElement; +} +var TreeRenderStack:TreeRenderStack; + +interface TreeStateCheckbox{ + checkAll(id?:string):void; + checkItem(id:string):void; + getChecked():any[]; + isChecked(id:string):boolean; + uncheckAll(id?:string):void; + uncheckItem(id:string):void; +} +var TreeStateCheckbox:TreeStateCheckbox; + +interface TreeStore{ + add(obj:any, index:number, pid:string):string; + changeId(old:string, newid:string):void; + clearAll():void; + count():number; + each(code:WebixCallback, master:any, all:boolean, pid:string):void; + eachChild(pid:string, code:WebixCallback, master?:any, all?:boolean):void; + eachOpen(code:WebixCallback, master?:any, pid?:string):void; + eachSubItem(pid:string, code:WebixCallback):void; + getBranch(id:string):any[]; + getBranchIndex(id:string, parent?:string):number; + getFirstChildId(id:string):string; + getNextSiblingId(id:any):string; + getParentId(id:string):string; + getPrevSiblingId(id:any):string; + getTopRange():any[]; + isBranch(id:string):boolean; + provideApi(target:any, eventable:boolean):void; + remove(id:string):void; + serialize():any; + name: string; +} +var TreeStore:TreeStore; + +interface TreeTableClick{ + } +var TreeTableClick:TreeTableClick; + +interface TreeTablePaste{ + insert(data:any[]):void; +} +var TreeTablePaste:TreeTablePaste; + +interface TreeType{ + checkbox(obj:any, common:any):string; + folder(obj:any, common:any):string; + icon(obj:any, common:any):string; + space(obj:any, common:any):string; +} +var TreeType:TreeType; + +interface UIExtension{ + } +var UIExtension:UIExtension; + +interface UIManager{ + addHotKey(key:string, handler:WebixCallback, obj?:any):void; + canFocus(id:string):boolean; + destructor():void; + getFocus():webix.ui.baseview; + getNext(view:any):any; + getPrev(view:any):any; + getState(id:string, childs:boolean):any; + getTop(id:string):any; + hasFocus(id:string):boolean; + removeHotKey(key:string, handler?:WebixCallback, obj?:any):void; + setFocus(id:string):void; + setState(state:any):void; +} +var UIManager:UIManager; + +interface UploadDriver{ + flash: any; + html5: any; +} +var UploadDriver:UploadDriver; + +interface ValidateCollection{ + clearValidation():void; + validate(id?:string):boolean; +} +var ValidateCollection:ValidateCollection; + +interface ValidateData{ + clearValidation():void; + validate():boolean; +} +var ValidateData:ValidateData; + +interface ValueBind{ + } +var ValueBind:ValueBind; + +interface Values{ + clear():void; + focus(item:string):void; + getCleanValues():any; + getDirtyValues():any; + getValues(details?:any):any[]; + isDirty():boolean; + setDirty(mark?:boolean):void; + setValues(values:any, update?:boolean):void; +} +var Values:Values; + +interface VirtualRenderStack{ + getItemNode(id:string):void; + render(id:string, data:any, type:string):void; + showItem(id:string):void; +} +var VirtualRenderStack:VirtualRenderStack; + + +module ui { + + + +function delay(config:any):void; +function fullScreen():void; +function hasMethod(name:string, method_name:string):boolean; +function resize():void; +function zIndex():number; +var scrollSize: number; +var zIndexBase: number; + +interface baselayoutConfig{ + animate?: any; + borderless?: boolean; + cols?: any[]; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + on?: any; + responsive?: string; + rows?: any[]; + visibleBatch?: string; + width?: number; +} +interface baselayout extends webix.ui.baseview{ + addView(view:any, index?:number):webix.ui.baseview; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + index(obj:any):number; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + reconstruct():void; + removeView(id:string):void; + resize():void; + resizeChildren():void; + show(force?:boolean, animation?:boolean):void; + showBatch(name:string):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: baselayoutConfig; + name: string; +} +interface baseviewConfig{ + animate?: any; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + width?: number; +} +interface baseview{ + adjust():void; + bind(target:any, rule?:WebixCallback, format?:string):void; + define(property:string, value:any):void; + destructor():void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hide():void; + isEnabled():boolean; + isVisible():boolean; + resize():void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + $getSize():any[]; + $height: number; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: baseviewConfig; + name: string; +} +interface protoConfig{ + animate?: any; + borderless?: boolean; + click?: string|WebixCallback; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datathrottle?: number; + datatype?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + on?: any; + pager?: any; + ready?: WebixCallback; + removeMissed?: boolean; + rules?: any; + save?: string; + scheme?: any; + template?: string|WebixCallback; + tooltip?: any; + type?: any; + url?: string; + width?: number; +} +interface proto extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCss(id:string|number, css:string, silent?:boolean):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + clearValidation():void; + count():number; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getChildViews():any[]; + getFirstId():string; + getFormView():webix.ui.baseview; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getNextId(id:string, step:number):string; + getNode():any; + getPage():number; + getPager():any; + getParentView():any; + getPrevId(id:string, step:number):string; + getTopParentView():webix.ui.baseview; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(e:Event):string; + mapEvent(map:any):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + render(id:string, data:any, type:string):void; + resize():void; + serialize():any; + setPage(page:number):void; + show(force?:boolean, animation?:boolean):void; + showItem(id:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: protoConfig; + name: string; + type: { [key: string]: any; }; + types: { [key: string]: any; }; +} +interface resizeareaConfig{ + border?: boolean; + container?: string|HTMLElement; + cursor?: string; + dir?: string; + eventPos?: number; + height?: number; + id?: string; + on?: any; + start?: number; + width?: number; +} +interface resizearea{ + attachEvent(type:string, functor:WebixCallback, id?:string):string; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + detachEvent(id:string):void; + hasEvent(name:string):boolean; + mapEvent(map:any):void; + unblockEvent():void; + config: resizeareaConfig; + name: string; +} +interface viewConfig{ + animate?: any; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + width?: number; +} +interface view extends webix.ui.baseview{ + adjust():void; + bind(target:any, rule?:WebixCallback, format?:string):void; + define(property:string, value:any):void; + destructor():void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hide():void; + isEnabled():boolean; + isVisible():boolean; + resize():void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: viewConfig; + name: string; +} +interface vscrollConfig{ + container?: HTMLElement; + id?: string; + on?: any; + scroll?: string; + scrollHeight?: number; + scrollPos?: number; + scrollSize?: number; + scrollStep?: number; + scrollVisible?: boolean; + scrollWidth?: number; + zoom?: number; +} +interface vscroll extends webix.ui.baseview{ + activeArea(node:HTMLElement):void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + detachEvent(id:string):void; + getScroll():number; + getSize():number; + hasEvent(name:string):boolean; + mapEvent(map:any):void; + scrollTo(pos:number):void; + sizeTo(size:number):void; + unblockEvent():void; + config: vscrollConfig; + name: string; +} +interface accordionConfig{ + animate?: any; + borderless?: boolean; + collapsed?: boolean; + cols?: any[]; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + isolate?: boolean; + margin?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + multi?: boolean|string; + on?: any; + padding?: number; + paddingX?: number; + paddingY?: number; + panelClass?: string; + responsive?: string; + rows?: any[]; + type?: string; + visibleBatch?: string; + width?: number; +} +interface accordion extends webix.ui.baseview{ + addView(view:any, index?:number):webix.ui.baseview; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + index(obj:any):number; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + reconstruct():void; + removeView(id:string):void; + resize():void; + resizeChildren():void; + show(force?:boolean, animation?:boolean):void; + showBatch(name:string):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: accordionConfig; + name: string; +} +interface accordionitemConfig{ + animate?: any; + body?: string|webix.ui.baseview; + borderless?: boolean; + collapsed?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + header?: boolean|string|WebixCallback; + headerAlt?: string|WebixCallback; + headerAltHeight?: number; + headerHeight?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + width?: number; +} +interface accordionitem extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + collapse():void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + expand():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + resize():void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: accordionitemConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; +} +interface barcodeConfig{ + animate?: any; + borderless?: boolean; + color?: string; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + paddingX?: number; + paddingY?: number; + textHeight?: number; + type?: any; + value?: string; + width?: number; +} +interface barcode extends webix.ui.baseview{ + adjust():void; + bind(target:any, rule?:WebixCallback, format?:string):void; + define(property:string, value:any):void; + destructor():void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hide():void; + isEnabled():boolean; + isVisible():boolean; + render():void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: barcodeConfig; + name: string; + types: any[]; +} +interface buttonConfig{ + align?: string; + animate?: any; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: any; + popup?: any; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + value?: string; + width?: number; +} +interface button extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $getValue():string; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: buttonConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface calendarConfig{ + animate?: any; + blockDates?: WebixCallback; + borderless?: boolean; + calendarHeader?: string; + calendarTime?: string; + calendarWeekHeader?: string; + cellHeight?: number; + container?: HTMLElement; + css?: string; + date?: any; + dayTemplate?: WebixCallback; + disabled?: boolean; + events?: WebixCallback; + gravity?: number; + headerHeight?: number; + height?: number; + hidden?: boolean; + icons?: any; + id?: string; + maxDate?: Date|string; + maxHeight?: number; + maxWidth?: number; + minDate?: Date|string; + minHeight?: number; + minWidth?: number; + minuteStep?: number; + monthSelect?: boolean; + mouseEventDelay?: number; + navigation?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + select?: boolean; + skipEmptyWeeks?: boolean; + timepicker?: boolean; + timepickerHeight?: number; + type?: string; + weekHeader?: boolean; + weekNumber?: boolean; + width?: number; +} +interface calendar extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getSelectedDate():any; + getTopParentView():webix.ui.baseview; + getValue():any; + getVisibleDate():any; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + locate(e:Event):string; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + selectDate(date:any):void; + setValue(date:any):void; + show(force?:boolean, animation?:boolean):void; + showCalendar(date:any):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: calendarConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; +} +interface chartConfig{ + alpha?: number; + animate?: any; + barWidth?: number; + border?: boolean; + borderColor?: string; + borderless?: boolean; + cant?: number; + color?: string|WebixCallback; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datathrottle?: number; + datatype?: string; + disableLines?: boolean; + disabled?: boolean; + eventRadius?: number; + fill?: string; + fixOverflow?: boolean; + gradient?: boolean|string|WebixCallback; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + item?: any; + label?: string|WebixCallback; + labelOffset?: number; + legend?: any; + line?: any; + lineColor?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + offset?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + origin?: number; + padding?: any; + pieHeight?: number; + pieInnerText?: string|WebixCallback; + preset?: string; + radius?: number; + ready?: WebixCallback; + removeMissed?: boolean; + save?: string; + scale?: string; + scheme?: any; + series?: any[]; + shadow?: boolean; + tooltip?: any; + type?: string; + url?: string; + value?: string|WebixTemplate; + width?: number; + x?: number; + xAxis?: any; + xValue?: string; + y?: number; + yAxis?: any; + yValue?: string; +} +interface chart extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addSeries(obj:any):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearCanvas():void; + count():number; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getChildViews():any[]; + getFirstId():string; + getFormView():webix.ui.baseview; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getLastId():string; + getNextId(id:string, step:number):string; + getNode():any; + getParentView():any; + getPrevId(id:string, step:number):string; + getTopParentView():webix.ui.baseview; + group(config:any, mode:boolean):void; + hasEvent(name:string):boolean; + hide():void; + hideSeries(series:string):void; + isEnabled():boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(e:Event):string; + mapEvent(map:any):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + removeAllSeries():void; + render(id:string, data:any, type:string):void; + resize():void; + serialize():any; + show(force?:boolean, animation?:boolean):void; + showSeries(series:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + ungroup(mode:boolean):void; + updateItem(id:string, data:any):void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + colormap: { [key: string]: any; }; + config: chartConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + presets: { [key: string]: any; }; +} +interface checkboxConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + checkValue?: string; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + customCheckbox?: boolean; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + uncheckValue?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface checkbox extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + toggle():void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: checkboxConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface carouselConfig{ + animate?: any; + borderless?: boolean; + cols?: any[]; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + navigation?: any; + on?: any; + rows?: any[]; + scrollSpeed?: string; + type?: string; + width?: number; +} +interface carousel extends webix.ui.baseview{ + adjust():void; + adjustScroll(matrix:any):void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getActiveId():string; + getActiveIndex():number; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getLayout():any; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + resize():void; + scrollTo(x:number, y:number):void; + setActive(id:string):void; + setActiveIndex(index:number):void; + show(force?:boolean, animation?:boolean):void; + showNext():void; + showPrev():void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: carouselConfig; + name: string; +} +interface colorboardConfig{ + animate?: any; + borderless?: boolean; + cols?: number; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxLightness?: number; + maxWidth?: number; + minHeight?: number; + minLightness?: number; + minWidth?: number; + on?: any; + palette?: any[]; + rows?: number; + template?: WebixCallback; + value?: string; + width?: number; +} +interface colorboard extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):string; + show(force?:boolean, animation?:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: colorboardConfig; + name: string; +} +interface colorpickerConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + editable?: boolean; + format?: string; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + icon?: string; + icons?: any; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + stringResult?: any; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + timeIcon?: string; + timepicker?: boolean; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface colorpicker extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getPopup():webix.ui.baseview; + getText():void; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: colorpickerConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface comboConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + icon?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + options?: any; + placeholder?: string; + popup?: any; + popupWidth?: number; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + text?: string; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface combo extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getPopup():webix.ui.baseview; + getText():string; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: comboConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface contextConfig{ + animate?: any; + autofit?: boolean; + autofocus?: boolean; + body?: string|webix.ui.baseview; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + head?: any; + headHeight?: number; + height?: number; + hidden?: boolean; + id?: string; + left?: number; + master?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + move?: boolean; + on?: any; + padding?: any; + position?: string|WebixCallback; + relative?: string; + top?: number; + width?: number; + zIndex?: number; +} +interface context extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + attachTo(view:any):void; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + close():void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getBody():any; + getChildViews():any[]; + getContext():any; + getFormView():webix.ui.baseview; + getHead():any; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + resize():void; + resizeChildren():void; + setPosition(x:number, y:number):void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: contextConfig; + name: string; +} +interface contextmenuConfig{ + animate?: any; + autofit?: boolean; + autofocus?: boolean; + autoheight?: boolean; + autowidth?: boolean; + body?: string|webix.ui.baseview; + borderless?: boolean; + click?: string|WebixCallback; + clipboard?: boolean|string; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datathrottle?: number; + datatype?: string; + disabled?: boolean; + drag?: boolean|string; + dragscroll?: boolean|string; + externalData?: WebixCallback; + gravity?: number; + head?: any; + headHeight?: number; + height?: number; + hidden?: boolean; + id?: string; + layout?: string; + left?: number; + master?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + mouseEventDelay?: number; + move?: boolean; + navigation?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + padding?: any; + pager?: any; + position?: string|WebixCallback; + ready?: WebixCallback; + relative?: string; + removeMissed?: boolean; + rules?: any; + save?: string; + scheme?: any; + scroll?: boolean|string; + scrollSpeed?: string; + select?: boolean|string; + subMenuPos?: string; + submenu?: any; + template?: string|WebixCallback; + templateCopy?: WebixCallback; + tooltip?: any; + top?: number; + type?: any; + url?: string; + width?: number; + xCount?: number; + yCount?: number; + zIndex?: number; +} +interface contextmenu extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCss(id:string|number, css:string, silent?:boolean):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + attachTo(view:any):void; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + clearValidation():void; + close():void; + copy(sid:string, tindex:number, tobj?:any, details?:any):void; + count():number; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + disableItem(id:string):void; + enable():void; + enableItem(id:string):void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getBody():any; + getChildViews():any[]; + getContext():any; + getFirstId():string; + getFormView():webix.ui.baseview; + getHead():any; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getMenu(id:string|number):any; + getMenuItem(id:string):any; + getNextId(id:string, step:number):string; + getNode():any; + getPage():number; + getPager():any; + getParentView():any; + getPrevId(id:string, step:number):string; + getScrollState():any; + getSelectedId(as_array:boolean):string|any[]; + getSelectedItem(as_array?:boolean):any; + getSubMenu(id:string|number):any; + getTopMenu():any; + getTopParentView():webix.ui.baseview; + getVisibleCount():number; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + hideItem(id:string):void; + isEnabled():boolean; + isSelected(id:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(e:Event):string; + mapEvent(map:any):void; + move(sid:string, tindex:number, tobj?:any, details?:any):string; + moveBottom(id:string):void; + moveDown(id:string, step:number):void; + moveSelection(direction:string):void; + moveTop(id:string):void; + moveUp(id:string, step:number):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + render(id:string, data:any, type:string):void; + resize():void; + resizeChildren():void; + scrollTo(x:number, y:number):void; + select(id:string|any[], preserve:boolean):void; + selectAll(from?:string, to?:string):void; + serialize():any; + setPage(page:number):void; + setPosition(x:number, y:number):void; + show(force?:boolean, animation?:boolean):void; + showItem(id:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + unselect(id?:string):void; + unselectAll():void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + $drag(source:HTMLElement, ev:Event):string; + $dragHTML: WebixCallback; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragMark(context:any, ev:Event):boolean; + $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; + $dropAllow: WebixCallback; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: contextmenuConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + type: { [key: string]: any; }; + types: { [key: string]: any; }; +} +interface counterConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + max?: number; + maxHeight?: number; + maxWidth?: number; + min?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + step?: number; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface counter extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():number; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + next(step?:number):void; + prev(step?:number):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:number):void; + shift(value?:number):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: counterConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface datatableConfig{ + animate?: any; + autoConfig?: boolean; + autoheight?: boolean; + autowidth?: boolean; + blockselect?: boolean; + borderless?: boolean; + checkboxRefresh?: boolean; + clipboard?: boolean|string; + columnWidth?: number; + columns?: any[]; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datafetch?: number; + datathrottle?: number; + datatype?: string; + delimiter?: any; + disabled?: boolean; + drag?: boolean|string; + dragColumn?: boolean|string; + dragscroll?: boolean|string; + editMath?: boolean; + editValue?: string; + editable?: boolean; + editaction?: string; + externalData?: WebixCallback; + filterMode?: any; + fixedRowHeight?: boolean; + footer?: boolean; + form?: string; + gravity?: number; + header?: boolean; + headerRowHeight?: number; + headermenu?: any; + height?: number; + hidden?: boolean; + hover?: string; + id?: string; + leftSplit?: number; + liveValidation?: boolean; + loadahead?: number; + math?: boolean; + maxHeight?: number; + maxWidth?: number; + minColumnHeight?: number; + minColumnWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + multiselect?: boolean; + navigation?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + pager?: any; + prerender?: boolean; + ready?: WebixCallback; + removeMissed?: boolean; + resizeColumn?: boolean; + resizeRow?: boolean; + rightSplit?: number; + rowHeight?: number; + rowLineHeight?: number; + rules?: any; + save?: string; + scheme?: any; + scroll?: boolean; + scrollAlignY?: boolean; + scrollX?: boolean; + scrollY?: boolean; + select?: boolean|string; + spans?: any[]; + tooltip?: any; + type?: any; + url?: string; + width?: number; + yCount?: number; +} +interface datatable extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCellCss(id:string, name:string, css:string):void; + addCss(id:string|number, css:string, silent?:boolean):void; + addRowCss(id:string, css:string):void; + addSpan(id:any, column:string, width:number, height:number, value?:string, css?:string):void; + adjust():void; + adjustColumn(id:string|number, header?:string):void; + adjustRowHeight(columnId:string, silent:boolean):void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + clearSelection():void; + clearValidation():void; + collectValues(id:string):any[]; + columnId(index:number):string; + copy(sid:string, tindex:number, tobj?:any, details?:any):void; + count():number; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + eachColumn(handler:WebixCallback, all?:boolean):void; + eachRow(handler:WebixCallback, all?:boolean):void; + edit(id:any):void; + editCancel():void; + editCell(row:string, col:string, preserve?:boolean, show?:boolean):void; + editColumn(id:string):void; + editNext():boolean; + editRow(id:string):void; + editStop():void; + enable():void; + exists(id:string):boolean; + exportToExcel(url?:string):void; + exportToPDF(url?:string):void; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + filterByAll():void; + find(criterion:WebixCallback, first?:boolean):any; + focusEditor():void; + getChildViews():any[]; + getColumnConfig(id:string):any; + getColumnIndex(id:string):number; + getEditState():any; + getEditor(row?:any, column?:string|number):any; + getEditorValue():string; + getFilter(columnID:string):any; + getFirstId():string; + getFormView():webix.ui.baseview; + getHeaderContent(id:string):{ [key: string]: any; }; + getHeaderNode(columnId:string, rowIndex?:number):HTMLElement; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getNextId(id:string, step:number):string; + getNode():any; + getPage():number; + getPager():any; + getParentView():any; + getPrevId(id:string, step:number):string; + getScrollState():any; + getSelectedId(asArray?:boolean, asString?:boolean):any; + getSelectedItem(mode?:boolean):void; + getState():any; + getText(rowid:string, colid:string):string; + getTopParentView():webix.ui.baseview; + getVisibleCount():number; + group(config:any, mode:boolean):void; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + hideColumn(id:string):void; + hideOverlay():void; + isColumnVisible(id:string):boolean; + isEnabled():boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(node:HTMLElement|Event):any; + mapCells(startrow:number, startcol:string, numrows:number, numcols:number, callback:WebixCallback):void; + mapEvent(map:any):void; + mapSelection(callback:WebixCallback):void; + markSorting(column_id:string, dir:string):void; + move(sid:string, tindex:number, tobj?:any, details?:any):string; + moveBottom(id:string):void; + moveColumn(id:string, index:number):void; + moveDown(id:string, step:number):void; + moveSelection(direction:string):void; + moveTop(id:string):void; + moveUp(id:string, step:number):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + refreshColumns(config?:any[]):void; + refreshFilter(id:string):void; + refreshHeaderContent():void; + registerFilter(node:HTMLElement, config:any, obj:any):void; + remove(id:string):void; + removeCellCss(id:string, name:string, css_name:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + removeRowCss(id:string, css_name:string):void; + removeSpan(id:string|number, column:string):void; + render(id:string, data:any, operation:string):void; + resize():void; + scrollTo(x:number, y:number):void; + select(row_id:string, preserve:boolean):void; + selectRange(row_id:any, end_row_id:any):void; + serialize():any; + setColumnWidth(id:string, width:number):void; + setPage(page:number):void; + setRowHeight(id:string, height:number):void; + setState(state:any):void; + show(force?:boolean, animation?:boolean):void; + showCell(row:string, column:string):void; + showColumn(id:string):void; + showColumnBatch(batch:string|number):void; + showItem(id:string):void; + showItemByIndex(index:number):void; + showOverlay(message:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + ungroup(mode:boolean):void; + unselect(row_id:string):void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + validateEditor(id?:string):boolean; + $drag(source:HTMLElement, ev:Event):string; + $dragHTML: WebixCallback; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragMark(context:any, ev:Event):boolean; + $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; + $dropAllow: WebixCallback; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: datatableConfig; + headerContent: any; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + waitData: PromisedData; +} +interface dataviewConfig{ + animate?: any; + autoheight?: boolean; + borderless?: boolean; + click?: string|WebixCallback; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datafetch?: number; + datathrottle?: number; + datatype?: string; + disabled?: boolean; + drag?: boolean|string; + dragscroll?: boolean|string; + externalData?: WebixCallback; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + loadahead?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + navigation?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + pager?: any; + ready?: WebixCallback; + removeMissed?: boolean; + rules?: any; + save?: string; + scheme?: any; + scroll?: boolean|string; + scrollSpeed?: string; + select?: boolean|string; + template?: string|WebixCallback; + tooltip?: any; + type?: any; + url?: string; + width?: number; + xCount?: number; + yCount?: number; +} +interface dataview extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCss(id:string|number, css:string, silent?:boolean):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + clearValidation():void; + copy(sid:string, tindex:number, tobj?:any, details?:any):void; + count():number; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getChildViews():any[]; + getFirstId():string; + getFormView():webix.ui.baseview; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getNextId(id:string, step:number):string; + getNode():any; + getPage():number; + getPager():any; + getParentView():any; + getPrevId(id:string, step:number):string; + getScrollState():any; + getSelectedId(as_array:boolean):string|any[]; + getSelectedItem(as_array?:boolean):any; + getTopParentView():webix.ui.baseview; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isSelected(id:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(e:Event):string; + mapEvent(map:any):void; + move(sid:string, tindex:number, tobj?:any, details?:any):string; + moveBottom(id:string):void; + moveDown(id:string, step:number):void; + moveSelection(direction:string):void; + moveTop(id:string):void; + moveUp(id:string, step:number):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + render(id:string, data:any, type:string):void; + resize():void; + scrollTo(x:number, y:number):void; + select(id:string|any[], preserve:boolean):void; + selectAll(from?:string, to?:string):void; + serialize():any; + setPage(page:number):void; + show(force?:boolean, animation?:boolean):void; + showItem(id:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + unselect(id?:string):void; + unselectAll():void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + $drag(source:HTMLElement, ev:Event):string; + $dragHTML: WebixCallback; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragMark(context:any, ev:Event):boolean; + $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; + $dropAllow: WebixCallback; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: dataviewConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + type: { [key: string]: any; }; + types: { [key: string]: any; }; + waitData: PromisedData; +} +interface datepickerConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + editable?: boolean; + format?: string; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + icon?: string; + icons?: any; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + stringResult?: any; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + text?: string; + timeIcon?: string; + timepicker?: boolean; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface datepicker extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getPopup():webix.ui.baseview; + getText():void; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: datepickerConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface fieldsetConfig{ + animate?: any; + body?: webix.ui.baseview; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + label?: any; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + width?: number; +} +interface fieldset extends webix.ui.baseview{ + adjust():void; + bind(target:any, rule?:WebixCallback, format?:string):void; + define(property:string, value:any):void; + destructor():void; + disable():void; + enable():void; + getBody():any; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hide():void; + isEnabled():boolean; + isVisible():boolean; + resize():void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: fieldsetConfig; + name: string; +} +interface formConfig{ + animate?: any; + autoheight?: boolean; + borderless?: boolean; + cols?: any[]; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datatype?: string; + disabled?: boolean; + elements?: any[]; + elementsConfig?: { [key: string]: any; }; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + isolate?: boolean; + margin?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + on?: any; + padding?: number; + paddingX?: number; + paddingY?: number; + responsive?: string; + rows?: any[]; + rules?: any; + scroll?: boolean|string; + scrollSpeed?: string; + type?: string; + url?: string; + visibleBatch?: string; + width?: number; +} +interface form extends webix.ui.baseview{ + addView(view:any, index?:number):webix.ui.baseview; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clear():void; + clearValidation():void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus(item:string):void; + getChildViews():any[]; + getCleanValues():any; + getDirtyValues():any; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getScrollState():any; + getTopParentView():webix.ui.baseview; + getValues(details?:any):any[]; + hasEvent(name:string):boolean; + hide():void; + index(obj:any):number; + isDirty():boolean; + isEnabled():boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + mapEvent(map:any):void; + parse(data:any, type:string):void; + reconstruct():void; + refresh():void; + removeView(id:string):void; + render(id:string, data:any, type:string):void; + resize():void; + resizeChildren():void; + scrollTo(x:number, y:number):void; + setDirty(mark?:boolean):void; + setValues(values:any, update?:boolean):void; + show(force?:boolean, animation?:boolean):void; + showBatch(name:string):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $height: number; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: formConfig; + name: string; +} +interface grouplistConfig{ + animate?: any; + autoheight?: boolean; + autowidth?: boolean; + borderless?: boolean; + click?: string|WebixCallback; + clipboard?: boolean|string; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datathrottle?: number; + datatype?: string; + disabled?: boolean; + drag?: boolean|string; + dragscroll?: boolean|string; + externalData?: WebixCallback; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + layout?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + navigation?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + pager?: any; + ready?: WebixCallback; + removeMissed?: boolean; + rules?: any; + save?: string; + scheme?: any; + scroll?: boolean|string; + scrollSpeed?: string; + select?: boolean|string; + template?: string|WebixCallback; + templateBack?: string|WebixTemplate; + templateCopy?: WebixCallback; + templateGroup?: string|WebixTemplate; + templateItem?: string|WebixTemplate; + tooltip?: any; + type?: any; + url?: string; + width?: number; + xCount?: number; + yCount?: number; +} +interface grouplist extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCss(id:string|number, css:string, silent?:boolean):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + clearValidation():void; + copy(sid:string, tindex:number, tobj?:any, details?:any):void; + count():number; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getChildViews():any[]; + getFirstId():string; + getFormView():webix.ui.baseview; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getNextId(id:string, step:number):string; + getNode():any; + getOpenState():any; + getPage():number; + getPager():any; + getParentView():any; + getPrevId(id:string, step:number):string; + getScrollState():any; + getSelectedId(as_array:boolean):string|any[]; + getSelectedItem(as_array?:boolean):any; + getTopParentView():webix.ui.baseview; + getVisibleCount():number; + group(config:any, mode:boolean):void; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isSelected(id:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(e:Event):string; + mapEvent(map:any):void; + move(sid:string, tindex:number, tobj?:any, details?:any):string; + moveBottom(id:string):void; + moveDown(id:string, step:number):void; + moveSelection(direction:string):void; + moveTop(id:string):void; + moveUp(id:string, step:number):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + render(id:string, data:any, type:string):void; + resize():void; + scrollTo(x:number, y:number):void; + select(id:string|any[], preserve:boolean):void; + selectAll(from?:string, to?:string):void; + serialize():any; + setPage(page:number):void; + show(force?:boolean, animation?:boolean):void; + showItem(id:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + ungroup(mode:boolean):void; + unselect(id?:string):void; + unselectAll():void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + $drag(source:HTMLElement, ev:Event):string; + $dragHTML: WebixCallback; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragMark(context:any, ev:Event):boolean; + $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; + $dropAllow: WebixCallback; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: grouplistConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + type: { [key: string]: any; }; + types: { [key: string]: any; }; +} +interface headerlayoutConfig{ + animate?: any; + borderless?: boolean; + collapsed?: boolean; + cols?: any[]; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + isolate?: boolean; + margin?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + multi?: boolean|string; + on?: any; + padding?: number; + paddingX?: number; + paddingY?: number; + panelClass?: string; + responsive?: string; + rows?: any[]; + type?: string; + visibleBatch?: string; + width?: number; +} +interface headerlayout extends webix.ui.baseview{ + addView(view:any, index?:number):webix.ui.baseview; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + index(obj:any):number; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + reconstruct():void; + removeView(id:string):void; + resize():void; + resizeChildren():void; + show(force?:boolean, animation?:boolean):void; + showBatch(name:string):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: headerlayoutConfig; + name: string; +} +interface htmlformConfig{ + animate?: any; + autoheight?: any; + borderless?: boolean; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datatype?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + on?: any; + onClick?: { [key: string]: any; }; + scroll?: boolean|string; + scrollSpeed?: string; + src?: string; + template?: string|WebixCallback; + type?: string; + url?: string; + width?: number; +} +interface htmlform extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clear(all?:boolean):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus(item:string):void; + getChildViews():any[]; + getCleanValues():any; + getDirtyValues():any; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getScrollState():any; + getTopParentView():webix.ui.baseview; + getValues(details?:any):any[]; + hasEvent(name:string):boolean; + hide():void; + isDirty():boolean; + isEnabled():boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + mapEvent(map:any):void; + parse(data:any, type:string):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + scrollTo(x:number, y:number):void; + setContent(node:any):void; + setDirty(mark?:boolean):void; + setHTML(html:string):void; + setValues(values:any, update?:boolean):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: htmlformConfig; + name: string; +} +interface iconConfig{ + align?: string; + animate?: any; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: any; + popup?: any; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + value?: string; + width?: number; +} +interface icon extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $getValue():string; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: iconConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface iframeConfig{ + animate?: any; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + on?: any; + src?: string; + width?: number; +} +interface iframe extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getIframe():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getWindow():HTMLElement; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + load(value:string):void; + mapEvent(map:any):void; + resize():void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: iframeConfig; + name: string; +} +interface labelConfig{ + align?: string; + animate?: any; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: any; + popup?: any; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + value?: string; + width?: number; +} +interface label extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setHTML(html:string):void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $getValue():string; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: labelConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface layoutConfig{ + animate?: any; + borderless?: boolean; + cols?: any[]; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + isolate?: boolean; + margin?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + on?: any; + padding?: number; + paddingX?: number; + paddingY?: number; + responsive?: string; + rows?: any[]; + type?: string; + visibleBatch?: string; + width?: number; +} +interface layout extends webix.ui.baseview{ + addView(view:any, index?:number):webix.ui.baseview; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + index(obj:any):number; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + reconstruct():void; + removeView(id:string):void; + resize():void; + resizeChildren():void; + show(force?:boolean, animation?:boolean):void; + showBatch(name:string):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: layoutConfig; + name: string; +} +interface listConfig{ + animate?: any; + autoheight?: boolean; + autowidth?: boolean; + borderless?: boolean; + click?: string|WebixCallback; + clipboard?: boolean|string; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datathrottle?: number; + datatype?: string; + disabled?: boolean; + drag?: boolean|string; + dragscroll?: boolean|string; + externalData?: WebixCallback; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + layout?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + navigation?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + pager?: any; + ready?: WebixCallback; + removeMissed?: boolean; + rules?: any; + save?: string; + scheme?: any; + scroll?: boolean|string; + scrollSpeed?: string; + select?: boolean|string; + template?: string|WebixCallback; + templateCopy?: WebixCallback; + tooltip?: any; + type?: any; + url?: string; + width?: number; + xCount?: number; + yCount?: number; +} +interface list extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCss(id:string|number, css:string, silent?:boolean):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + clearValidation():void; + copy(sid:string, tindex:number, tobj?:any, details?:any):void; + count():number; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getChildViews():any[]; + getFirstId():string; + getFormView():webix.ui.baseview; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getNextId(id:string, step:number):string; + getNode():any; + getPage():number; + getPager():any; + getParentView():any; + getPrevId(id:string, step:number):string; + getScrollState():any; + getSelectedId(as_array:boolean):string|any[]; + getSelectedItem(as_array?:boolean):any; + getTopParentView():webix.ui.baseview; + getVisibleCount():number; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isSelected(id:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(e:Event):string; + mapEvent(map:any):void; + move(sid:string, tindex:number, tobj?:any, details?:any):string; + moveBottom(id:string):void; + moveDown(id:string, step:number):void; + moveSelection(direction:string):void; + moveTop(id:string):void; + moveUp(id:string, step:number):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + render(id:string, data:any, type:string):void; + resize():void; + scrollTo(x:number, y:number):void; + select(id:string|any[], preserve:boolean):void; + selectAll(from?:string, to?:string):void; + serialize():any; + setPage(page:number):void; + show(force?:boolean, animation?:boolean):void; + showItem(id:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + unselect(id?:string):void; + unselectAll():void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + $drag(source:HTMLElement, ev:Event):string; + $dragHTML: WebixCallback; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragMark(context:any, ev:Event):boolean; + $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; + $dropAllow: WebixCallback; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: listConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + type: { [key: string]: any; }; + types: { [key: string]: any; }; +} +interface menuConfig{ + animate?: any; + autoheight?: boolean; + autowidth?: boolean; + borderless?: boolean; + click?: string|WebixCallback; + clipboard?: boolean|string; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datathrottle?: number; + datatype?: string; + disabled?: boolean; + drag?: boolean|string; + dragscroll?: boolean|string; + externalData?: WebixCallback; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + layout?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + navigation?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + pager?: any; + ready?: WebixCallback; + removeMissed?: boolean; + rules?: any; + save?: string; + scheme?: any; + scroll?: boolean|string; + scrollSpeed?: string; + select?: boolean|string; + subMenuPos?: string; + submenu?: any; + template?: string|WebixCallback; + templateCopy?: WebixCallback; + tooltip?: any; + type?: any; + url?: string; + width?: number; + xCount?: number; + yCount?: number; +} +interface menu extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCss(id:string|number, css:string, silent?:boolean):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + clearValidation():void; + copy(sid:string, tindex:number, tobj?:any, details?:any):void; + count():number; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + disableItem(id:string):void; + enable():void; + enableItem(id:string):void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getChildViews():any[]; + getFirstId():string; + getFormView():webix.ui.baseview; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getMenu(id:string|number):any; + getMenuItem(id:string):any; + getNextId(id:string, step:number):string; + getNode():any; + getPage():number; + getPager():any; + getParentView():any; + getPrevId(id:string, step:number):string; + getScrollState():any; + getSelectedId(as_array:boolean):string|any[]; + getSelectedItem(as_array?:boolean):any; + getSubMenu(id:string|number):any; + getTopMenu():any; + getTopParentView():webix.ui.baseview; + getVisibleCount():number; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + hideItem(id:string):void; + isEnabled():boolean; + isSelected(id:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(e:Event):string; + mapEvent(map:any):void; + move(sid:string, tindex:number, tobj?:any, details?:any):string; + moveBottom(id:string):void; + moveDown(id:string, step:number):void; + moveSelection(direction:string):void; + moveTop(id:string):void; + moveUp(id:string, step:number):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + render(id:string, data:any, type:string):void; + resize():void; + scrollTo(x:number, y:number):void; + select(id:string|any[], preserve:boolean):void; + selectAll(from?:string, to?:string):void; + serialize():any; + setPage(page:number):void; + show(force?:boolean, animation?:boolean):void; + showItem(id:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + unselect(id?:string):void; + unselectAll():void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + $drag(source:HTMLElement, ev:Event):string; + $dragHTML: WebixCallback; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragMark(context:any, ev:Event):boolean; + $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; + $dropAllow: WebixCallback; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: menuConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + type: { [key: string]: any; }; + types: { [key: string]: any; }; +} +interface multiviewConfig{ + animate?: any; + borderless?: boolean; + cells?: any; + cols?: any[]; + container?: HTMLElement; + css?: string; + disabled?: boolean; + fitBiggest?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + on?: any; + responsive?: string; + rows?: any[]; + visibleBatch?: string; + width?: number; +} +interface multiview extends webix.ui.baseview{ + addView(view:any, index?:number):webix.ui.baseview; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + back(step:number):void; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getActiveId():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + index(obj:any):number; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + reconstruct():void; + removeView(id:string):void; + resize():void; + resizeChildren():void; + setValue(toshow:string):void; + show(force?:boolean, animation?:boolean):void; + showBatch(name:string):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: multiviewConfig; + name: string; +} +interface organogramConfig{ + animate?: any; + autoheight?: boolean; + autowidth?: boolean; + borderless?: boolean; + click?: string|WebixCallback; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datathrottle?: number; + datatype?: string; + disabled?: boolean; + filterMode?: any; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + ready?: WebixCallback; + removeMissed?: boolean; + save?: string; + scheme?: any; + scroll?: boolean|string; + scrollSpeed?: string; + select?: boolean|string; + template?: string|WebixCallback; + threeState?: boolean; + tooltip?: any; + type?: any; + url?: string; + width?: number; +} +interface organogram extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCss(id:string|number, css:string, silent?:boolean):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + close(id:string):void; + closeAll():void; + count():number; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getBranchIndex(id:string, parent?:string):number; + getChildViews():any[]; + getFirstChildId(id:string):string; + getFirstId():string; + getFormView():webix.ui.baseview; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getNextId(id:string, step:number):string; + getNextSiblingId(id:any):string; + getNode():any; + getOpenItems():any[]; + getParentId(id:string):string; + getParentView():any; + getPrevId(id:string, step:number):string; + getPrevSiblingId(id:any):string; + getScrollState():any; + getSelectedId(as_array:boolean):string|any[]; + getSelectedItem(as_array?:boolean):any; + getState():any; + getTopParentView():webix.ui.baseview; + group(config:any, mode:boolean):void; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + isBranch(id:string):boolean; + isBranchOpen(id:string):boolean; + isEnabled():boolean; + isSelected(id:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadBranch(id:string, callback:WebixCallback, url:string):void; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(e:Event):string; + mapEvent(map:any):void; + open(id:string):void; + openAll():void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + render(id:string, data:any, type:string):void; + resize():void; + scrollTo(x:number, y:number):void; + select(id:string|any[], preserve:boolean):void; + selectAll(from?:string, to?:string):void; + serialize():any; + setState(state:any):void; + show(force?:boolean, animation?:boolean):void; + showItem(id:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + ungroup(mode:boolean):void; + unselect(id?:string):void; + unselectAll():void; + updateItem(id:string, data:any):void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: organogramConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + type: { [key: string]: any; }; + types: { [key: string]: any; }; +} +interface pagerConfig{ + animate?: any; + apiOnly?: any; + borderless?: boolean; + container?: HTMLElement; + content?: string|HTMLElement; + count?: number; + css?: string; + disabled?: boolean; + gravity?: number; + group?: number; + height?: number; + hidden?: boolean; + id?: string; + limit?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + page?: number; + size?: number; + template?: string|WebixCallback; + width?: number; +} +interface pager extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clone(config:any):any; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh(id?:string):void; + render(id:string, data:any, type:string):void; + resize():void; + select(page:number):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: pagerConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + type: { [key: string]: any; }; +} +interface popupConfig{ + animate?: any; + autofit?: boolean; + autofocus?: boolean; + body?: string|webix.ui.baseview; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + head?: any; + headHeight?: number; + height?: number; + hidden?: boolean; + id?: string; + left?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + move?: boolean; + on?: any; + padding?: any; + position?: string|WebixCallback; + relative?: string; + top?: number; + width?: number; + zIndex?: number; +} +interface popup extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + close():void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getBody():any; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getHead():any; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + resize():void; + resizeChildren():void; + setPosition(x:number, y:number):void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: popupConfig; + name: string; +} +interface propertyConfig{ + animate?: any; + autoheight?: boolean; + borderless?: boolean; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datatype?: string; + disabled?: boolean; + editValue?: string; + editable?: boolean; + editaction?: string; + elements?: any; + form?: string; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + nameWidth?: number; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + scroll?: boolean|string; + scrollSpeed?: string; + template?: string|WebixCallback; + url?: string; + width?: number; +} +interface property extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + edit(id:any):void; + editCancel():void; + editNext():boolean; + editStop():void; + enable():void; + focusEditor():void; + getChildViews():any[]; + getEditState():any; + getEditor(id?:string):any; + getEditorValue():string; + getFormView():webix.ui.baseview; + getItem(id:string):any; + getItemNode(id:string):void; + getNode():any; + getParentView():any; + getScrollState():any; + getTopParentView():webix.ui.baseview; + getValues():any[]; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + locate(e:Event):string; + mapEvent(map:any):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + registerType(name:string, data:any):void; + render(id:string, data:any, type:string):void; + resize():void; + scrollTo(x:number, y:number):void; + setValues(values:any, update?:boolean):void; + show(force?:boolean, animation?:boolean):void; + showItem(id:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + updateItem():void; + validateEditor(id?:string):boolean; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: propertyConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_edit: { [key: string]: any; }; + on_mouse_move: WebixCallback; + on_render: { [key: string]: any; }; + type: { [key: string]: any; }; +} +interface radioConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + customRadio?: boolean; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + optionHeight?: number; + options?: any[]; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + vertical?: boolean; + width?: number; +} +interface radio extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: radioConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface resizerConfig{ + animate?: any; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + width?: number; +} +interface resizer extends webix.ui.baseview{ + adjust():void; + bind(target:any, rule?:WebixCallback, format?:string):void; + define(property:string, value:any):void; + destructor():void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hide():void; + isEnabled():boolean; + isVisible():boolean; + resize():void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: resizerConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; +} +interface richselectConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + icon?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + options?: any; + placeholder?: string; + popup?: any; + popupWidth?: number; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + text?: string; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface richselect extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getPopup():webix.ui.baseview; + getText():string; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: richselectConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface multitextConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + icon?: string; + iconWidth?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + separator?: string; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface multitext extends webix.ui.baseview{ + addSection():string|number; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + getValueHere():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + removeSection(id?:string|number):void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + setValueHere(value:string|number):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $cssName: string; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: multitextConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface multiselectConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + icon?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + optionWidth?: number; + options?: any; + placeholder?: string; + popup?: any; + popupWidth?: number; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + separator?: string; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + text?: string; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface multiselect extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getPopup():webix.ui.baseview; + getText():string; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $cssName: string; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: multiselectConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface scrollviewConfig{ + animate?: any; + body?: any; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + scroll?: boolean|string; + scrollSpeed?: string; + width?: number; +} +interface scrollview extends webix.ui.baseview{ + adjust():void; + bind(target:any, rule?:WebixCallback, format?:string):void; + define(property:string, value:any):void; + destructor():void; + disable():void; + enable():void; + getBody():any; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getScrollState():any; + getTopParentView():webix.ui.baseview; + hide():void; + isEnabled():boolean; + isVisible():boolean; + resize():void; + resizeChildren():void; + scrollTo(x:number, y:number):void; + show(force?:boolean, animation?:boolean):void; + showView(id:string):void; + unbind():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: scrollviewConfig; + name: string; +} +interface searchConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + icon?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface search extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: searchConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface segmentedConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + multiview?: boolean; + name?: string; + on?: any; + options?: any; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface segmented extends webix.ui.baseview{ + addOption(id:string, value:any, show?:boolean, index?:number):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + optionIndex(ID:string):number; + refresh():void; + removeOption(id:string):void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: segmentedConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface selectConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + options?: any[]|string; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface select extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: selectConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface sliderConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + max?: any; + maxHeight?: number; + maxWidth?: number; + min?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + step?: number; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + title?: string|WebixCallback; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface slider extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $touchCapture: any; + $view: HTMLElement; + $width: number; + config: sliderConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface spacerConfig{ + animate?: any; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + width?: number; +} +interface spacer extends webix.ui.baseview{ + adjust():void; + bind(target:any, rule?:WebixCallback, format?:string):void; + define(property:string, value:any):void; + destructor():void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hide():void; + isEnabled():boolean; + isVisible():boolean; + resize():void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: spacerConfig; + name: string; +} +interface submenuConfig{ + animate?: any; + autofit?: boolean; + autofocus?: boolean; + autoheight?: boolean; + autowidth?: boolean; + body?: string|webix.ui.baseview; + borderless?: boolean; + click?: string|WebixCallback; + clipboard?: boolean|string; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datathrottle?: number; + datatype?: string; + disabled?: boolean; + drag?: boolean|string; + dragscroll?: boolean|string; + externalData?: WebixCallback; + gravity?: number; + head?: any; + headHeight?: number; + height?: number; + hidden?: boolean; + id?: string; + layout?: string; + left?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + mouseEventDelay?: number; + move?: boolean; + navigation?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + padding?: any; + pager?: any; + position?: string|WebixCallback; + ready?: WebixCallback; + relative?: string; + removeMissed?: boolean; + rules?: any; + save?: string; + scheme?: any; + scroll?: boolean|string; + scrollSpeed?: string; + select?: boolean|string; + subMenuPos?: string; + submenu?: any; + template?: string|WebixCallback; + templateCopy?: WebixCallback; + tooltip?: any; + top?: number; + type?: any; + url?: string; + width?: number; + xCount?: number; + yCount?: number; + zIndex?: number; +} +interface submenu extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCss(id:string|number, css:string, silent?:boolean):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + clearValidation():void; + close():void; + copy(sid:string, tindex:number, tobj?:any, details?:any):void; + count():number; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + disableItem(id:string):void; + enable():void; + enableItem(id:string):void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getBody():any; + getChildViews():any[]; + getFirstId():string; + getFormView():webix.ui.baseview; + getHead():any; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getMenu(id:string|number):any; + getMenuItem(id:string):any; + getNextId(id:string, step:number):string; + getNode():any; + getPage():number; + getPager():any; + getParentView():any; + getPrevId(id:string, step:number):string; + getScrollState():any; + getSelectedId(as_array:boolean):string|any[]; + getSelectedItem(as_array?:boolean):any; + getSubMenu(id:string|number):any; + getTopMenu():any; + getTopParentView():webix.ui.baseview; + getVisibleCount():number; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + hideItem(id:string):void; + isEnabled():boolean; + isSelected(id:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(e:Event):string; + mapEvent(map:any):void; + move(sid:string, tindex:number, tobj?:any, details?:any):string; + moveBottom(id:string):void; + moveDown(id:string, step:number):void; + moveSelection(direction:string):void; + moveTop(id:string):void; + moveUp(id:string, step:number):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + render(id:string, data:any, type:string):void; + resize():void; + resizeChildren():void; + scrollTo(x:number, y:number):void; + select(id:string|any[], preserve:boolean):void; + selectAll(from?:string, to?:string):void; + serialize():any; + setPage(page:number):void; + setPosition(x:number, y:number):void; + show(force?:boolean, animation?:boolean):void; + showItem(id:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + unselect(id?:string):void; + unselectAll():void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + $drag(source:HTMLElement, ev:Event):string; + $dragHTML: WebixCallback; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragMark(context:any, ev:Event):boolean; + $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; + $dropAllow: WebixCallback; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: submenuConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + type: { [key: string]: any; }; + types: { [key: string]: any; }; +} +interface suggestConfig{ + animate?: any; + autofit?: boolean; + autofocus?: boolean; + body?: string|webix.ui.baseview; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + filter?: WebixCallback; + fitMaster?: boolean; + gravity?: number; + head?: any; + headHeight?: number; + height?: number; + hidden?: boolean; + id?: string; + input?: any; + keyPressTimeout?: number; + left?: number; + master?: webix.ui.baseview; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + move?: boolean; + on?: any; + padding?: any; + position?: string|WebixCallback; + relative?: string; + template?: string|WebixTemplate; + textValue?: string; + top?: number; + type?: string; + width?: number; + zIndex?: number; +} +interface suggest extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + close():void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getBody():any; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getHead():any; + getItemText(id:string):string; + getList():webix.ui.baseview; + getMasterValue():any; + getNode():any; + getParentView():any; + getSuggestion():string; + getTopParentView():webix.ui.baseview; + getValue():string|number; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + linkInput(input:HTMLElement):void; + mapEvent(map:any):void; + resize():void; + resizeChildren():void; + setMasterValue(value:any):void; + setPosition(x:number, y:number):void; + setValue(value:string|number):void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: suggestConfig; + name: string; +} +interface multisuggestConfig{ + animate?: any; + autofit?: boolean; + autofocus?: boolean; + body?: string|webix.ui.baseview; + borderless?: boolean; + buttonText?: string; + container?: HTMLElement; + css?: string; + disabled?: boolean; + filter?: WebixCallback; + fitMaster?: boolean; + gravity?: number; + head?: any; + headHeight?: number; + height?: number; + hidden?: boolean; + id?: string; + input?: any; + keyPressTimeout?: number; + left?: number; + master?: webix.ui.baseview; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + move?: boolean; + on?: any; + padding?: any; + position?: string|WebixCallback; + relative?: string; + separator?: string; + template?: string|WebixTemplate; + textValue?: string; + top?: number; + type?: string; + width?: number; + zIndex?: number; +} +interface multisuggest extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + close():void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getBody():any; + getButton():webix.ui.baseview; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getHead():any; + getItemText(id:string):string; + getList():webix.ui.baseview; + getMasterValue():any; + getNode():any; + getParentView():any; + getSuggestion():string; + getTopParentView():webix.ui.baseview; + getValue():string|number; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + linkInput(input:HTMLElement):void; + mapEvent(map:any):void; + resize():void; + resizeChildren():void; + setMasterValue(value:any):void; + setPosition(x:number, y:number):void; + setValue(value:string|number):void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: multisuggestConfig; + name: string; +} +interface datasuggestConfig{ + animate?: any; + autofit?: boolean; + autofocus?: boolean; + body?: string|webix.ui.baseview; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + filter?: WebixCallback; + fitMaster?: boolean; + gravity?: number; + head?: any; + headHeight?: number; + height?: number; + hidden?: boolean; + id?: string; + input?: any; + keyPressTimeout?: number; + left?: number; + master?: webix.ui.baseview; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + move?: boolean; + on?: any; + padding?: any; + position?: string|WebixCallback; + relative?: string; + template?: string|WebixTemplate; + textValue?: string; + top?: number; + type?: string; + width?: number; + zIndex?: number; +} +interface datasuggest extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + close():void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getBody():any; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getHead():any; + getItemText(id:string):string; + getList():webix.ui.baseview; + getMasterValue():any; + getNode():any; + getParentView():any; + getSuggestion():string; + getTopParentView():webix.ui.baseview; + getValue():string|number; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + linkInput(input:HTMLElement):void; + mapEvent(map:any):void; + resize():void; + resizeChildren():void; + setMasterValue(value:any):void; + setPosition(x:number, y:number):void; + setValue(value:string|number):void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: datasuggestConfig; + name: string; +} +interface gridsuggestConfig{ + animate?: any; + autofit?: boolean; + autofocus?: boolean; + body?: string|webix.ui.baseview; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + filter?: WebixCallback; + fitMaster?: boolean; + gravity?: number; + head?: any; + headHeight?: number; + height?: number; + hidden?: boolean; + id?: string; + input?: any; + keyPressTimeout?: number; + left?: number; + master?: webix.ui.baseview; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + move?: boolean; + on?: any; + padding?: any; + position?: string|WebixCallback; + relative?: string; + template?: string|WebixTemplate; + textValue?: string; + top?: number; + type?: string; + width?: number; + zIndex?: number; +} +interface gridsuggest extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + close():void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getBody():any; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getHead():any; + getItemText(id:string):string; + getList():webix.ui.baseview; + getMasterValue():any; + getNode():any; + getParentView():any; + getSuggestion():string; + getTopParentView():webix.ui.baseview; + getValue():string|number; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + linkInput(input:HTMLElement):void; + mapEvent(map:any):void; + resize():void; + resizeChildren():void; + setMasterValue(value:any):void; + setPosition(x:number, y:number):void; + setValue(value:string|number):void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: gridsuggestConfig; + name: string; +} +interface tabbarConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + bottomOffset?: number; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + moreTemplate?: WebixCallback; + multiview?: boolean; + name?: string; + on?: any; + options?: any; + placeholder?: string; + popup?: any; + popupTemplate?: WebixCallback; + popupWidth?: number; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + tabMargin?: number; + tabMinWidth?: number; + tabMoreWidth?: number; + tabOffset?: number; + tabbarPopup?: webix.ui.baseview; + template?: string|WebixCallback; + tooltip?: string; + topOffset?: number; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; + yCount?: number; +} +interface tabbar extends webix.ui.baseview{ + addOption(id:string, value:any, show?:boolean, index?:number):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getPopup():webix.ui.baseview; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + optionIndex(ID:string):number; + refresh():void; + removeOption(id:string):void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: tabbarConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface tabviewConfig{ + animate?: any; + borderless?: boolean; + cells?: any[]; + cols?: any[]; + container?: HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + isolate?: boolean; + margin?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + multiview?: any; + on?: any; + padding?: number; + paddingX?: number; + paddingY?: number; + responsive?: string; + rows?: any[]; + tabbar?: any; + type?: string; + visibleBatch?: string; + width?: number; +} +interface tabview extends webix.ui.baseview{ + addView(view:any, index?:number):webix.ui.baseview; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getMultiview():any; + getNode():any; + getParentView():any; + getTabbar():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + index(obj:any):number; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + reconstruct():void; + removeView(id:string):void; + resize():void; + resizeChildren():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + showBatch(name:string):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: tabviewConfig; + name: string; +} +interface templateConfig{ + animate?: any; + autoheight?: any; + borderless?: boolean; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datatype?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + on?: any; + onClick?: { [key: string]: any; }; + scroll?: boolean|string; + scrollSpeed?: string; + src?: string; + template?: string|WebixCallback; + type?: string; + url?: string; + width?: number; +} +interface template extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getScrollState():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + mapEvent(map:any):void; + parse(data:any, type:string):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + scrollTo(x:number, y:number):void; + setContent(node:any):void; + setHTML(html:string):void; + setValues(obj:any, update?:boolean):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: templateConfig; + name: string; +} +interface textConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface text extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: textConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface textareaConfig{ + align?: string; + animate?: any; + attributes?: { [key: string]: any; }; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputPadding?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + labelWidth?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: string; + popup?: any; + readonly?: boolean; + relatedAction?: string; + relatedView?: string; + required?: boolean; + suggest?: string|webix.ui.baseview; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + validate?: boolean; + validateEvent?: string; + value?: string; + width?: number; +} +interface textarea extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $getValue():string; + $height: number; + $render: WebixCallback; + $renderIcon: WebixCallback; + $renderInput(obj:any, html:string, id:string):string; + $renderLabel(config:any, id:string):string; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: textareaConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface toggleConfig{ + align?: string; + animate?: any; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + name?: string; + on?: any; + placeholder?: any; + popup?: any; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + value?: string; + width?: number; +} +interface toggle extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + toggle():void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $getValue():string; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: toggleConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface toolbarConfig{ + animate?: any; + borderless?: boolean; + cols?: any[]; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datatype?: string; + disabled?: boolean; + elements?: any[]; + elementsConfig?: { [key: string]: any; }; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + isolate?: boolean; + margin?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + on?: any; + padding?: number; + paddingX?: number; + paddingY?: number; + responsive?: string; + rows?: any[]; + rules?: any; + scroll?: boolean|string; + scrollSpeed?: string; + type?: string; + url?: string; + visibleBatch?: string; + width?: number; +} +interface toolbar extends webix.ui.baseview{ + addView(view:any, index?:number):webix.ui.baseview; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clear():void; + clearValidation():void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + focus(item:string):void; + getChildViews():any[]; + getCleanValues():any; + getDirtyValues():any; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getScrollState():any; + getTopParentView():webix.ui.baseview; + getValues(details?:any):any[]; + hasEvent(name:string):boolean; + hide():void; + index(obj:any):number; + isDirty():boolean; + isEnabled():boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + mapEvent(map:any):void; + parse(data:any, type:string):void; + reconstruct():void; + refresh():void; + removeView(id:string):void; + render(id:string, data:any, type:string):void; + resize():void; + resizeChildren():void; + scrollTo(x:number, y:number):void; + setDirty(mark?:boolean):void; + setValues(values:any, update?:boolean):void; + show(force?:boolean, animation?:boolean):void; + showBatch(name:string):void; + unbind():void; + unblockEvent():void; + validate():boolean; + $getSize():any[]; + $height: number; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: toolbarConfig; + name: string; +} +interface tooltipConfig{ + animate?: any; + borderless?: boolean; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + dx?: number; + dy?: number; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + on?: any; + template?: string|WebixCallback; + width?: number; +} +interface tooltip extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + render(id:string, data:any, type:string):void; + resize():void; + show(force?:boolean, animation?:boolean):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: tooltipConfig; + name: string; + type: { [key: string]: any; }; +} +interface treeConfig{ + animate?: any; + borderless?: boolean; + click?: string|WebixCallback; + clipboard?: boolean|string; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datathrottle?: number; + datatype?: string; + disabled?: boolean; + drag?: boolean; + dragscroll?: boolean|string; + filterMode?: any; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + navigation?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + pager?: any; + ready?: WebixCallback; + removeMissed?: boolean; + rules?: any; + save?: string; + scheme?: any; + scroll?: boolean|string; + scrollSpeed?: string; + select?: boolean; + template?: string|WebixCallback; + templateCopy?: WebixCallback; + threeState?: boolean; + tooltip?: any; + type?: any; + url?: string; + width?: number; +} +interface tree extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCss(id:string|number, css:string, silent?:boolean):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + checkAll(id?:string):void; + checkItem(id:string):void; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + clearValidation():void; + close(id:string):void; + closeAll():void; + copy(sid:string, tindex:number, tobj?:webix.ui.baseview, details?:any):string; + count():number; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getBranchIndex(id:string, parent?:string):number; + getChecked():any[]; + getChildViews():any[]; + getFirstChildId(id:string):string; + getFirstId():string; + getFormView():webix.ui.baseview; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getNextId(id:string, step:number):string; + getNextSiblingId(id:any):string; + getNode():any; + getOpenItems():any[]; + getParentId(id:string):string; + getParentView():any; + getPrevId(id:string, step:number):string; + getPrevSiblingId(id:any):string; + getScrollState():any; + getSelectedId(as_array:boolean):string|any[]; + getSelectedItem(as_array?:boolean):any; + getState():any; + getTopParentView():webix.ui.baseview; + group(config:any, mode:boolean):void; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + isBranch(id:string):boolean; + isBranchOpen(id:string):boolean; + isChecked(id:string):boolean; + isEnabled():boolean; + isSelected(id:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadBranch(id:string, callback:WebixCallback, url:string):void; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(e:Event):string; + mapEvent(map:any):void; + move(sid:string, tindex:number, tobj?:any, details?:any):string; + moveSelection(direction:string):void; + open(id:string):void; + openAll():void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + render(id:string, data:any, type:string):void; + resize():void; + scrollTo(x:number, y:number):void; + select(id:string|any[], preserve:boolean):void; + selectAll(from?:string, to?:string):void; + serialize():any; + setState(state:any):void; + show(force?:boolean, animation?:boolean):void; + showItem(id:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + uncheckAll(id?:string):void; + uncheckItem(id:string):void; + ungroup(mode:boolean):void; + unselect(id?:string):void; + unselectAll():void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + $drag(source:HTMLElement, ev:Event):string; + $dragHTML: WebixCallback; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragMark(context:any, ev:Event):boolean; + $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; + $dropAllow: WebixCallback; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: treeConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + type: { [key: string]: any; }; + types: { [key: string]: any; }; +} +interface treetableConfig{ + animate?: any; + autoConfig?: boolean; + autoheight?: boolean; + autowidth?: boolean; + blockselect?: boolean; + borderless?: boolean; + checkboxRefresh?: boolean; + clipboard?: boolean|string; + columnWidth?: number; + columns?: any[]; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datafetch?: number; + datathrottle?: number; + datatype?: string; + delimiter?: any; + disabled?: boolean; + drag?: boolean|string; + dragColumn?: boolean|string; + dragscroll?: boolean|string; + editMath?: boolean; + editValue?: string; + editable?: boolean; + editaction?: string; + externalData?: WebixCallback; + filterMode?: any; + fixedRowHeight?: boolean; + footer?: boolean; + form?: string; + gravity?: number; + header?: boolean; + headerRowHeight?: number; + headermenu?: any; + height?: number; + hidden?: boolean; + hover?: string; + id?: string; + leftSplit?: number; + liveValidation?: boolean; + loadahead?: number; + math?: boolean; + maxHeight?: number; + maxWidth?: number; + minColumnHeight?: number; + minColumnWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + multiselect?: boolean; + navigation?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + pager?: any; + prerender?: boolean; + ready?: WebixCallback; + removeMissed?: boolean; + resizeColumn?: boolean; + resizeRow?: boolean; + rightSplit?: number; + rowHeight?: number; + rowLineHeight?: number; + rules?: any; + save?: string; + scheme?: any; + scroll?: boolean; + scrollAlignY?: boolean; + scrollX?: boolean; + scrollY?: boolean; + select?: boolean|string; + spans?: any[]; + threeState?: boolean; + tooltip?: any; + type?: any; + url?: string; + width?: number; + yCount?: number; +} +interface treetable extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCellCss(id:string, name:string, css:string):void; + addCss(id:string|number, css:string, silent?:boolean):void; + addRowCss(id:string, css:string):void; + adjust():void; + adjustColumn(id:string|number, header?:string):void; + adjustRowHeight(columnId:string, silent:boolean):void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + checkAll(id?:string):void; + checkItem(id:string):void; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + clearValidation():void; + close(id:string):void; + closeAll():void; + collectValues(id:string):any[]; + columnId(index:number):string; + copy(sid:string, tindex:number, tobj?:webix.ui.baseview, details?:any):string; + count():number; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + eachColumn(handler:WebixCallback, all?:boolean):void; + eachRow(handler:WebixCallback, all?:boolean):void; + edit(id:any):void; + editCancel():void; + editCell(row:string, col:string, preserve?:boolean, show?:boolean):void; + editColumn(id:string):void; + editNext():boolean; + editRow(id:string):void; + editStop():void; + enable():void; + exists(id:string):boolean; + exportToExcel(url?:string):void; + exportToPDF(url?:string):void; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + filterByAll():void; + find(criterion:WebixCallback, first?:boolean):any; + focusEditor():void; + getBranchIndex(id:string, parent?:string):number; + getChecked():any[]; + getChildViews():any[]; + getColumnConfig(id:string):any; + getColumnIndex(id:string):number; + getEditState():any; + getEditor(row?:any, column?:string|number):any; + getEditorValue():string; + getFilter(columnID:string):any; + getFirstChildId(id:string):string; + getFirstId():string; + getFormView():webix.ui.baseview; + getHeaderContent(id:string):{ [key: string]: any; }; + getHeaderNode(columnId:string, rowIndex?:number):HTMLElement; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getNextId(id:string, step:number):string; + getNextSiblingId(id:any):string; + getNode():any; + getOpenItems():any[]; + getPage():number; + getPager():any; + getParentId(id:string):string; + getParentView():any; + getPrevId(id:string, step:number):string; + getPrevSiblingId(id:any):string; + getScrollState():any; + getSelectedId(asArray?:boolean, asString?:boolean):any; + getSelectedItem(mode?:boolean):void; + getState():any; + getText(rowid:string, colid:string):string; + getTopParentView():webix.ui.baseview; + getVisibleCount():number; + group(config:any, mode:boolean):void; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + hideColumn(id:string):void; + hideOverlay():void; + isBranch(id:string):boolean; + isBranchOpen(id:string):boolean; + isChecked(id:string):boolean; + isColumnVisible(id:string):boolean; + isEnabled():boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadBranch(id:string, callback:WebixCallback, url:string):void; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(node:HTMLElement|Event):any; + mapCells(startrow:number, startcol:string, numrows:number, numcols:number, callback:WebixCallback):void; + mapEvent(map:any):void; + markSorting(column_id:string, dir:string):void; + move(sid:string, tindex:number, tobj?:webix.ui.baseview, details?:any):string; + moveBottom(id:string):void; + moveColumn(id:string, index:number):void; + moveDown(id:string, step:number):void; + moveSelection(direction:string):void; + moveTop(id:string):void; + moveUp(id:string, step:number):void; + open(id:string):void; + openAll():void; + parse(data:any, type:string):void; + refresh(id?:string):void; + refreshColumns(config?:any[]):void; + refreshFilter(id:string):void; + refreshHeaderContent():void; + registerFilter(node:HTMLElement, config:any, obj:any):void; + remove(id:string):void; + removeCellCss(id:string, name:string, css_name:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + removeRowCss(id:string, css_name:string):void; + render(id:string, data:any, operation:string):void; + resize():void; + scrollTo(x:number, y:number):void; + serialize():any; + setColumnWidth(id:string, width:number):void; + setPage(page:number):void; + setRowHeight(id:string, height:number):void; + setState(state:any):void; + show(force?:boolean, animation?:boolean):void; + showCell(row:string, column:string):void; + showColumn(id:string):void; + showColumnBatch(batch:string|number):void; + showItem(id:string):void; + showItemByIndex(index:number):void; + showOverlay(message:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + uncheckAll(id?:string):void; + uncheckItem(id:string):void; + ungroup(mode:boolean):void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + validateEditor(id?:string):boolean; + $drag(source:HTMLElement, ev:Event):string; + $dragHTML: WebixCallback; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragMark(context:any, ev:Event):boolean; + $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; + $dropAllow: WebixCallback; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: treetableConfig; + headerContent: any; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + waitData: PromisedData; +} +interface unitlistConfig{ + animate?: any; + autoheight?: boolean; + autowidth?: boolean; + borderless?: boolean; + click?: string|WebixCallback; + clipboard?: boolean|string; + container?: HTMLElement; + css?: string; + data?: string|any[]; + dataFeed?: string|WebixCallback; + datathrottle?: number; + datatype?: string; + disabled?: boolean; + drag?: boolean|string; + dragscroll?: boolean|string; + externalData?: WebixCallback; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + layout?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + mouseEventDelay?: number; + navigation?: boolean; + on?: any; + onClick?: { [key: string]: any; }; + onContext?: { [key: string]: any; }; + onDblClick?: WebixCallback; + onMouseMove?: WebixCallback; + pager?: any; + ready?: WebixCallback; + removeMissed?: boolean; + rules?: any; + save?: string; + scheme?: any; + scroll?: boolean|string; + scrollSpeed?: string; + select?: boolean|string; + sort?: WebixCallback; + template?: string|WebixCallback; + templateCopy?: WebixCallback; + tooltip?: any; + type?: any; + uniteBy?: WebixCallback; + url?: string; + width?: number; + xCount?: number; + yCount?: number; +} +interface unitlist extends webix.ui.baseview{ + add(obj:any, index?:number):string; + addCss(id:string|number, css:string, silent?:boolean):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + clearAll():void; + clearCss(css:string, silent?:boolean):void; + clearValidation():void; + copy(sid:string, tindex:number, tobj?:any, details?:any):void; + count():number; + customize(obj:any):void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + exists(id:string):boolean; + filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; + getChildViews():any[]; + getFirstId():string; + getFormView():webix.ui.baseview; + getIdByIndex(index:number):string; + getIndexById(id:string):number; + getItem(id:string):any; + getItemNode(id:string):void; + getLastId():string; + getNextId(id:string, step:number):string; + getNode():any; + getPage():number; + getPager():any; + getParentView():any; + getPrevId(id:string, step:number):string; + getScrollState():any; + getSelectedId(as_array:boolean):string|any[]; + getSelectedItem(as_array?:boolean):any; + getTopParentView():webix.ui.baseview; + getUnitList(name:string):any[]; + getUnits():any[]; + getVisibleCount():number; + hasCss(id:string, css:string):boolean; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isSelected(id:string):boolean; + isVisible():boolean; + load(url:string, type?:string, callback?:WebixCallback):PromisedData; + loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; + locate(e:Event):string; + mapEvent(map:any):void; + move(sid:string, tindex:number, tobj?:any, details?:any):string; + moveBottom(id:string):void; + moveDown(id:string, step:number):void; + moveSelection(direction:string):void; + moveTop(id:string):void; + moveUp(id:string, step:number):void; + parse(data:any, type:string):void; + refresh(id?:string):void; + remove(id:string):void; + removeCss(id:string|number, css:string, silent?:boolean):void; + render(id:string, data:any, type:string):void; + resize():void; + scrollTo(x:number, y:number):void; + select(id:string|any[], preserve:boolean):void; + selectAll(from?:string, to?:string):void; + serialize():any; + setPage(page:number):void; + show(force?:boolean, animation?:boolean):void; + showItem(id:string):void; + sort(by:string, dir?:string, as?:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + unselect(id?:string):void; + unselectAll():void; + updateItem(id:string, data:any):void; + validate(id?:string):boolean; + $drag(source:HTMLElement, ev:Event):string; + $dragHTML: WebixCallback; + $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; + $dragMark(context:any, ev:Event):boolean; + $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; + $drop(source:HTMLElement, target:HTMLElement, ev:any):void; + $dropAllow: WebixCallback; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: unitlistConfig; + name: string; + on_click: WebixCallback; + on_context: { [key: string]: any; }; + on_dblclick: WebixCallback; + on_mouse_move: WebixCallback; + type: { [key: string]: any; }; + types: { [key: string]: any; }; +} +interface uploaderConfig{ + align?: string; + animate?: any; + apiOnly?: boolean; + autosend?: boolean; + borderless?: boolean; + click?: WebixCallback; + container?: HTMLElement; + content?: string|HTMLElement; + css?: string; + disabled?: boolean; + formData?: { [key: string]: any; }; + getValue():string; + gravity?: number; + height?: number; + hidden?: boolean; + hotkey?: string; + id?: string; + inputHeight?: number; + inputWidth?: number; + label?: string; + labelPosition?: string; + link?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + multiple?: boolean; + name?: string; + on?: any; + placeholder?: any; + popup?: any; + tabFocus?: boolean; + template?: string|WebixCallback; + tooltip?: string; + type?: string; + value?: string; + width?: number; +} +interface uploader extends webix.ui.baseview{ + addDropZone(element:HTMLElement):void; + addFile(name:string, size:number, type?:string):void; + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + blur():void; + callEvent(name:string, params:any[]):boolean; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + fileDialog(content?:any):void; + focus():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getInputNode():HTMLElement; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getValue():string; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isUploaded():boolean; + isVisible():boolean; + mapEvent(map:any):void; + refresh():void; + render(id:string, data:any, type:string):void; + resize():void; + send(id:number|string|WebixCallback, details:any):void; + setValue(value:string):void; + show(force?:boolean, animation?:boolean):void; + stopUpload(id:string):void; + sync(source:any, filter:WebixCallback, silent:boolean):void; + unbind():void; + unblockEvent():void; + $cssName: string; + $getSize():any[]; + $getValue():string; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $setValue(value:string):void; + $skin: any; + $view: HTMLElement; + $width: number; + config: uploaderConfig; + name: string; + on_click: WebixCallback; + touchable: any; +} +interface videoConfig{ + animate?: any; + borderless?: boolean; + container?: HTMLElement; + controls?: boolean; + css?: string; + disabled?: boolean; + gravity?: number; + height?: number; + hidden?: boolean; + id?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + src?: any; + width?: number; +} +interface video extends webix.ui.baseview{ + adjust():void; + bind(target:any, rule?:WebixCallback, format?:string):void; + define(property:string, value:any):void; + destructor():void; + disable():void; + enable():void; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + getVideo():void; + hide():void; + isEnabled():boolean; + isVisible():boolean; + resize():void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: videoConfig; + name: string; +} +interface windowConfig{ + animate?: any; + autofit?: boolean; + autofocus?: boolean; + body?: string|webix.ui.baseview; + borderless?: boolean; + container?: HTMLElement; + css?: string; + disabled?: boolean; + fullscreen?: boolean; + gravity?: number; + head?: any; + headHeight?: number; + height?: number; + hidden?: boolean; + id?: string; + left?: number; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + move?: boolean; + on?: any; + padding?: any; + position?: string|WebixCallback; + relative?: string; + top?: number; + width?: number; + zIndex?: number; +} +interface window extends webix.ui.baseview{ + adjust():void; + attachEvent(type:string, functor:WebixCallback, id?:string):string; + bind(target:any, rule?:WebixCallback, format?:string):void; + blockEvent():void; + callEvent(name:string, params:any[]):boolean; + close():void; + define(property:string, value:any):void; + destructor():void; + detachEvent(id:string):void; + disable():void; + enable():void; + getBody():any; + getChildViews():any[]; + getFormView():webix.ui.baseview; + getHead():any; + getNode():any; + getParentView():any; + getTopParentView():webix.ui.baseview; + hasEvent(name:string):boolean; + hide():void; + isEnabled():boolean; + isVisible():boolean; + mapEvent(map:any):void; + resize():void; + resizeChildren():void; + setPosition(x:number, y:number):void; + show(force?:boolean, animation?:boolean):void; + unbind():void; + unblockEvent():void; + $getSize():any[]; + $height: number; + $scope: any; + $setSize(x:number, y:number):boolean; + $skin: any; + $view: HTMLElement; + $width: number; + config: windowConfig; + name: string; +} + +}} + +declare function $$(id: string|Event|HTMLElement):webix.ui.view; From e60ccd8a23c986aa5792f6a2831a5cb80e31d94a Mon Sep 17 00:00:00 2001 From: Michael Zabka Date: Mon, 23 Mar 2015 18:45:53 +0100 Subject: [PATCH 163/243] Add library http-status --- http-status/http-status-tests.ts | 91 ++++++++++++++++++++++++++++++ http-status/http-status.d.ts | 95 ++++++++++++++++++++++++++++++++ 2 files changed, 186 insertions(+) create mode 100644 http-status/http-status-tests.ts create mode 100644 http-status/http-status.d.ts diff --git a/http-status/http-status-tests.ts b/http-status/http-status-tests.ts new file mode 100644 index 000000000..8717e99c3 --- /dev/null +++ b/http-status/http-status-tests.ts @@ -0,0 +1,91 @@ +/// + +import httpStatus = require('http-status'); + +var str: string; +var nmr: number; + +str = httpStatus[100]; +str = httpStatus[101]; +str = httpStatus[200]; +str = httpStatus[201]; +str = httpStatus[202]; +str = httpStatus[203]; +str = httpStatus[204]; +str = httpStatus[205]; +str = httpStatus[206]; +str = httpStatus[300]; +str = httpStatus[301]; +str = httpStatus[302]; +str = httpStatus[303]; +str = httpStatus[304]; +str = httpStatus[305]; +str = httpStatus[307]; +str = httpStatus[400]; +str = httpStatus[401]; +str = httpStatus[402]; +str = httpStatus[403]; +str = httpStatus[404]; +str = httpStatus[405]; +str = httpStatus[406]; +str = httpStatus[407]; +str = httpStatus[408]; +str = httpStatus[409]; +str = httpStatus[410]; +str = httpStatus[411]; +str = httpStatus[412]; +str = httpStatus[413]; +str = httpStatus[414]; +str = httpStatus[415]; +str = httpStatus[416]; +str = httpStatus[417]; +str = httpStatus[429]; +str = httpStatus[500]; +str = httpStatus[501]; +str = httpStatus[502]; +str = httpStatus[503]; +str = httpStatus[504]; +str = httpStatus[505]; + + +nmr = httpStatus.CONTINUE; +nmr = httpStatus.SWITCHING_PROTOCOLS; +nmr = httpStatus.OK; +nmr = httpStatus.CREATED; +nmr = httpStatus.ACCEPTED; +nmr = httpStatus.NON_AUTHORITATIVE_INFORMATION; +nmr = httpStatus.NO_CONTENT; +nmr = httpStatus.RESET_CONTENT; +nmr = httpStatus.PARTIAL_CONTENT; +nmr = httpStatus.MULTIPLE_CHOICES; +nmr = httpStatus.MOVED_PERMANENTLY; +nmr = httpStatus.FOUND; +nmr = httpStatus.SEE_OTHER; +nmr = httpStatus.NOT_MODIFIED; +nmr = httpStatus.USE_PROXY; +nmr = httpStatus.TEMPORARY_REDIRECT; +nmr = httpStatus.BAD_REQUEST; +nmr = httpStatus.UNAUTHORIZED; +nmr = httpStatus.PAYMENT_REQUIRED; +nmr = httpStatus.FORBIDDEN; +nmr = httpStatus.NOT_FOUND; +nmr = httpStatus.METHOD_NOT_ALLOWED; +nmr = httpStatus.NOT_ACCEPTABLE; +nmr = httpStatus.PROXY_AUTHENTICATION_REQUIRED; +nmr = httpStatus.REQUEST_TIMEOUT; +nmr = httpStatus.CONFLICT; +nmr = httpStatus.GONE; +nmr = httpStatus.LENGTH_REQUIRED; +nmr = httpStatus.PRECONDITION_FAILED; +nmr = httpStatus.REQUEST_ENTITY_TOO_LARGE; +nmr = httpStatus.REQUEST_URI_TOO_LONG; +nmr = httpStatus.UNSUPPORTED_MEDIA_TYPE; +nmr = httpStatus.REQUESTED_RANGE_NOT_SATISFIABLE; +nmr = httpStatus.EXPECTATION_FAILED; +nmr = httpStatus.TOO_MANY_REQUESTS; +nmr = httpStatus.INTERNAL_SERVER_ERROR; +nmr = httpStatus.NOT_IMPLEMENTED; +nmr = httpStatus.BAD_GATEWAY; +nmr = httpStatus.SERVICE_UNAVAILABLE; +nmr = httpStatus.GATEWAY_TIMEOUT; +nmr = httpStatus.HTTP_VERSION_NOT_SUPPORTED; diff --git a/http-status/http-status.d.ts b/http-status/http-status.d.ts new file mode 100644 index 000000000..39328b71a --- /dev/null +++ b/http-status/http-status.d.ts @@ -0,0 +1,95 @@ +// Type definitions for http-status v0.1.8 +// Project: https://github.com/wdavidw/node-http-status +// Definitions by: Michael Zabka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface HttpStatus { + 100: string; + 101: string; + 200: string; + 201: string; + 202: string; + 203: string; + 204: string; + 205: string; + 206: string; + 300: string; + 301: string; + 302: string; + 303: string; + 304: string; + 305: string; + 307: string; + 400: string; + 401: string; + 402: string; + 403: string; + 404: string; + 405: string; + 406: string; + 407: string; + 408: string; + 409: string; + 410: string; + 411: string; + 412: string; + 413: string; + 414: string; + 415: string; + 416: string; + 417: string; + 429: string; + 500: string; + 501: string; + 502: string; + 503: string; + 504: string; + 505: string; + CONTINUE: number; + SWITCHING_PROTOCOLS: number; + OK: number; + CREATED: number; + ACCEPTED: number; + NON_AUTHORITATIVE_INFORMATION: number; + NO_CONTENT: number; + RESET_CONTENT: number; + PARTIAL_CONTENT: number; + MULTIPLE_CHOICES: number; + MOVED_PERMANENTLY: number; + FOUND: number; + SEE_OTHER: number; + NOT_MODIFIED: number; + USE_PROXY: number; + TEMPORARY_REDIRECT: number; + BAD_REQUEST: number; + UNAUTHORIZED: number; + PAYMENT_REQUIRED: number; + FORBIDDEN: number; + NOT_FOUND: number; + METHOD_NOT_ALLOWED: number; + NOT_ACCEPTABLE: number; + PROXY_AUTHENTICATION_REQUIRED: number; + REQUEST_TIMEOUT: number; + CONFLICT: number; + GONE: number; + LENGTH_REQUIRED: number; + PRECONDITION_FAILED: number; + REQUEST_ENTITY_TOO_LARGE: number; + REQUEST_URI_TOO_LONG: number; + UNSUPPORTED_MEDIA_TYPE: number; + REQUESTED_RANGE_NOT_SATISFIABLE: number; + EXPECTATION_FAILED: number; + TOO_MANY_REQUESTS: number; + INTERNAL_SERVER_ERROR: number; + NOT_IMPLEMENTED: number; + BAD_GATEWAY: number; + SERVICE_UNAVAILABLE: number; + GATEWAY_TIMEOUT: number; + HTTP_VERSION_NOT_SUPPORTED: number +} + +declare var httpStatus: HttpStatus; + +declare module 'http-status' { + export = httpStatus; +} From 1429bcc7fed522b2eac523118ffca0b2486578e1 Mon Sep 17 00:00:00 2001 From: Michael Zabka Date: Mon, 23 Mar 2015 19:20:49 +0100 Subject: [PATCH 164/243] Add library crypto-js --- crypto-js/crypto-js-tests.ts | 23 +++++++++++++ crypto-js/crypto-js.d.ts | 67 ++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 crypto-js/crypto-js-tests.ts create mode 100644 crypto-js/crypto-js.d.ts diff --git a/crypto-js/crypto-js-tests.ts b/crypto-js/crypto-js-tests.ts new file mode 100644 index 000000000..199c32ef2 --- /dev/null +++ b/crypto-js/crypto-js-tests.ts @@ -0,0 +1,23 @@ +/// + +import CryptoJS = require('crypto-js'); + +var str: string; + +str = CryptoJS.MD5('some message'); +str = CryptoJS.MD5('some message', 'some key'); + +str = CryptoJS.SHA1('some message'); +str = CryptoJS.SHA1('some message', 'some key', { any: true }); + +str = CryptoJS.format.OpenSSL('some message'); +str = CryptoJS.format.OpenSSL('some message', 'some key'); + +str = CryptoJS.enc.Utf8('some message'); +str = CryptoJS.enc.Utf8('some message', 'some key'); + +str = CryptoJS.mode.OFB('some message'); +str = CryptoJS.mode.OFB('some message', 'some key'); + +str = CryptoJS.pad.Ansix923('some message'); +str = CryptoJS.pad.Ansix923('some message', 'some key'); diff --git a/crypto-js/crypto-js.d.ts b/crypto-js/crypto-js.d.ts new file mode 100644 index 000000000..0f0251402 --- /dev/null +++ b/crypto-js/crypto-js.d.ts @@ -0,0 +1,67 @@ +// Type definitions for crypto-js v3.1.3 +// Project: https://github.com/evanvosberg/crypto-js +// Definitions by: Michael Zabka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module CryptoJS { + type Hash = (message: string, key?: string, ...options: any[]) => string; + + export interface Hashes { + MD5: Hash; + SHA1: Hash; + SHA256: Hash; + SHA224: Hash; + SHA512: Hash; + SHA384: Hash; + SHA3: Hash; + RIPEMD160: Hash; + HmacMD5: Hash; + HmacSHA1: Hash; + HmacSHA256: Hash; + HmacSHA224: Hash; + HmacSHA512: Hash; + HmacSHA384: Hash; + HmacSHA3: Hash; + HmacRIPEMD160: Hash; + PBKDF2: Hash; + AES: Hash; + TripleDES: Hash; + RC4: Hash; + Rabbit: Hash; + RabbitLegacy: Hash; + EvpKDF: Hash; + format: { + OpenSSL: Hash; + Hex: Hash; + }; + enc: { + Latin1: Hash; + Utf8: Hash; + Hex: Hash; + Utf16: Hash; + Base64: Hash; + }; + mode: { + CFB: Hash; + CTR: Hash; + CTRGladman: Hash; + OFB: Hash; + ECB: Hash; + }; + pad: { + Pkcs7: Hash; + Ansix923: Hash; + Iso10126: Hash; + Iso97971: Hash; + ZeroPadding: Hash; + NoPadding: Hash; + }; + } + + export var hashes: Hashes; +} + +declare module 'crypto-js' { + import hashes = CryptoJS.hashes; + export = hashes; +} From 4260bec48a07f49bc47f87e3984ceea6270cc044 Mon Sep 17 00:00:00 2001 From: ColsaCorp Date: Mon, 23 Mar 2015 13:46:51 -0500 Subject: [PATCH 165/243] Update s3-uploader.d.ts --- s3-uploader/s3-uploader.d.ts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/s3-uploader/s3-uploader.d.ts b/s3-uploader/s3-uploader.d.ts index 215cb7df6..b7c093c3f 100644 --- a/s3-uploader/s3-uploader.d.ts +++ b/s3-uploader/s3-uploader.d.ts @@ -32,8 +32,35 @@ interface S3UploaderOptions { versions?: S3UploaderVersion; } +declare class Meta { + public format: string; + public fileSize: string; + public imageSize: imageSize; + public orientation: string; + public colorSpace: string; + public compression: string; + public quallity: string; +} + +declare class imageSize { + public height: number; + public width: number; +} + +declare class image { + public etag: string; + public format: string; + public height: number; + public original: boolean; + public path: string; + public size: string; + public src: string; + public url: string; + public width: number; +} + declare class Upload { public constructor(awsBucketName: string, opts: S3UploaderOptions); - public upload(src: string, opts?: S3UploaderOptions, cb?: (err, images, meta) => void); + public upload(src: string, opts?: S3UploaderOptions, cb?: (err: string, images: image[], meta: Meta) => void): void; } From fe8fabf5f71b11a68f078781e563749bc51edd86 Mon Sep 17 00:00:00 2001 From: ColsaCorp Date: Mon, 23 Mar 2015 14:01:16 -0500 Subject: [PATCH 166/243] Update mssql.d.ts --- mssql/mssql.d.ts | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/mssql/mssql.d.ts b/mssql/mssql.d.ts index dcdd0f700..fdcad2642 100644 --- a/mssql/mssql.d.ts +++ b/mssql/mssql.d.ts @@ -42,17 +42,17 @@ declare module "mssql" { public constructor(config: config, callback?: (err?: any) => void); - public connect(callback?: (err?: any) => void); + public connect(callback?: (err?: any) => void): void; - public close(); + public close(): void; } class columns { - public add(name: string, type: any, options: any); + public add(name: string, type: any, options: any): void; } class rows { - public add(any); + public add(any): void; } export class Table { @@ -65,32 +65,32 @@ declare module "mssql" { export class Request { public constructor(connection?: Connection); - public execute(procedure: string, callback?: (err?: any, recordsets?: any, returnValue?: any) => void); - public input(name: string, value: any); - public input(name: string, type: any, value: any); - public output(name: string, type: any, value?: any); - public pipe(stream: any); - public query(command: string, callback?: (err?: any, recordset?: any) => void); - public batch(batch: string, callback?: (err?: any, recordset?: any) => void); - public bulk(table: Table, callback?: (err?: any, rowCount?: any) => void); - public cancel(); + public execute(procedure: string, callback?: (err?: any, recordsets?: any, returnValue?: any) => void): void; + public input(name: string, value: any): void; + public input(name: string, type: any, value: any): void; + public output(name: string, type: any, value?: any): void; + public pipe(stream: any): void; + public query(command: string, callback?: (err?: any, recordset?: any) => void): void; + public batch(batch: string, callback?: (err?: any, recordset?: any) => void): void; + public bulk(table: Table, callback?: (err?: any, rowCount?: any) => void): void; + public cancel(): void; public parameters: any; } export class Transaction { public constructor(connection?: Connection); - public begin(isolationLevel?: any, callback?: (err?: any) => void); - public begin(callback?: (err?: any) => void); - public commit(callback?: (err?: any) => void); - public rollback(callback?: (err?: any) => void); + public begin(isolationLevel?: any, callback?: (err?: any) => void): void; + public begin(callback?: (err?: any) => void): void; + public commit(callback?: (err?: any) => void): void; + public rollback(callback?: (err?: any) => void): void; } export class PreparedStatement { public constructor(connection?: Connection); - public input(name: string, type: any); - public output(name: string, type: any); - public prepare(statement: string, callback?: (err?: any) => void); - public execute(values: any, callback?: (err?: any) => void); - public unprepare(callback?: (err?: any) => void); + public input(name: string, type: any): void; + public output(name: string, type: any): void; + public prepare(statement: string, callback?: (err?: any) => void): void; + public execute(values: any, callback?: (err?: any) => void): void; + public unprepare(callback?: (err?: any) => void): void; } } From e889118f0e741c5c1e659fb732ccd68354fc8e3d Mon Sep 17 00:00:00 2001 From: ColsaCorp Date: Mon, 23 Mar 2015 14:15:30 -0500 Subject: [PATCH 167/243] Update mssql.d.ts --- mssql/mssql.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mssql/mssql.d.ts b/mssql/mssql.d.ts index fdcad2642..5a6e6a00c 100644 --- a/mssql/mssql.d.ts +++ b/mssql/mssql.d.ts @@ -52,7 +52,7 @@ declare module "mssql" { } class rows { - public add(any): void; + public add(row: any): void; } export class Table { From 88b4ec57704662a9d422aa3558890bd1751e9749 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Mon, 23 Mar 2015 18:34:52 -0400 Subject: [PATCH 168/243] Use stricter Element type in tether options --- tether/tether.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tether/tether.d.ts b/tether/tether.d.ts index be1200f28..2fffb16c9 100644 --- a/tether/tether.d.ts +++ b/tether/tether.d.ts @@ -14,11 +14,11 @@ declare module tether { classes?: {[className: string]: boolean}; classPrefix?: string; constraints?: ITetherConstraint[]; - element?: Element | string | any /* JQuery */; + element?: HTMLElement | string | any /* JQuery */; enabled?: boolean; offset?: string; optimizations?: any; - target?: Element | string | any /* JQuery */; + target?: HTMLElement | string | any /* JQuery */; targetAttachment?: string; targetOffset?: string; targetModifier?: string; @@ -29,7 +29,7 @@ declare module tether { outOfBoundsClass?: string; pin?: boolean | string[]; pinnedClass?: string; - to?: string | Element | number[]; + to?: string | HTMLElement | number[]; } interface Tether { From 0a848b2ea82df63a0190dcc0bd194fa97ceebd94 Mon Sep 17 00:00:00 2001 From: ryiwamoto Date: Tue, 24 Mar 2015 19:15:51 +0900 Subject: [PATCH 169/243] jquery.contextMenu type definitions are now compatible with --noImplicitAy. --- .../jquery.contextMenu-tests.ts | 19 +++++++++++++++++++ jquery.contextMenu/jquery.contextMenu.d.ts | 16 +++++++++++----- .../jquery.contextMenu.d.ts.tscparams | 2 +- 3 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 jquery.contextMenu/jquery.contextMenu-tests.ts diff --git a/jquery.contextMenu/jquery.contextMenu-tests.ts b/jquery.contextMenu/jquery.contextMenu-tests.ts new file mode 100644 index 000000000..df1b47943 --- /dev/null +++ b/jquery.contextMenu/jquery.contextMenu-tests.ts @@ -0,0 +1,19 @@ +/// + +//http://medialize.github.io/jQuery-contextMenu/docs.html + +//Disable a contextMenu trigger +$(".some-selector").contextMenu(false); + +//Manually show a contextMenu +$(".some-selector").contextMenu(); +$(".some-selector").contextMenu({x: 123, y: 123}); + +//Manually hide a contextMenu +$(".some-selector").contextMenu("hide"); + +//Unregister contextMenu +$.contextMenu('destroy', ".some-selector"); + +//Unregister all contextMenus +$.contextMenu('destroy'); diff --git a/jquery.contextMenu/jquery.contextMenu.d.ts b/jquery.contextMenu/jquery.contextMenu.d.ts index 620564fcd..34fd543e2 100644 --- a/jquery.contextMenu/jquery.contextMenu.d.ts +++ b/jquery.contextMenu/jquery.contextMenu.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jQuery contextMenu 1.6.6 +// Type definitions for jQuery contextMenu 1.7.0 // Project: http://medialize.github.com/jQuery-contextMenu/ // Definitions by: Natan Vivo // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -11,9 +11,9 @@ interface JQueryContextMenuOptions { trigger?: string; autoHide?: boolean; delay?: number; - determinePosition?: (menu) => void; - position?: (opt, x, y) => void; - positionSubmenu?: (menu) => void; + determinePosition?: (menu: JQuery) => void; + position?: (opt: JQuery, x: number, y: number) => void; + positionSubmenu?: (menu: JQuery) => void; zIndex?: number; animation?: { duration?: number; @@ -26,9 +26,15 @@ interface JQueryContextMenuOptions { }; callback?: (key: any, options: any) => any; items: any; + reposition?: boolean; + className?: string; } interface JQueryStatic { contextMenu(options?: JQueryContextMenuOptions): JQuery; - contextMenu(type: string): JQuery; + contextMenu(type: string, selector?: any): JQuery; +} + +interface JQuery { + contextMenu(options?: any): JQuery; } diff --git a/jquery.contextMenu/jquery.contextMenu.d.ts.tscparams b/jquery.contextMenu/jquery.contextMenu.d.ts.tscparams index d3f5a12fa..2f5856b19 100644 --- a/jquery.contextMenu/jquery.contextMenu.d.ts.tscparams +++ b/jquery.contextMenu/jquery.contextMenu.d.ts.tscparams @@ -1 +1 @@ - +--noImplicitAny From 7990c5250af8a8ab0aa95e3fbdbf7da113c38048 Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Tue, 24 Mar 2015 11:46:41 +0100 Subject: [PATCH 170/243] Add definitions for stack-mapper. --- CONTRIBUTORS.md | 1 + stack-mapper/stack-mapper-tests.ts | 8 ++++++ stack-mapper/stack-mapper.d.ts | 46 ++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 stack-mapper/stack-mapper-tests.ts create mode 100644 stack-mapper/stack-mapper.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 0db9eae38..5b8a18dca 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -730,6 +730,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](stack-mapper/stack-mapper.d.ts) [stack-mapper](https://github.com/thlorenz/stack-mapper) by [rogierschouten](https://github.com/rogierschouten) * [: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 r12](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) diff --git a/stack-mapper/stack-mapper-tests.ts b/stack-mapper/stack-mapper-tests.ts new file mode 100644 index 000000000..98dd70ef1 --- /dev/null +++ b/stack-mapper/stack-mapper-tests.ts @@ -0,0 +1,8 @@ +/// + +import stackMapper = require("stack-mapper"); + +var map: any = {}; +var sm: stackMapper.StackMapper = stackMapper(map); +var input: stackMapper.Callsite[] = [{ filename: "boo", line: 1, column: 10 }]; +var cs: stackMapper.Callsite[] = sm.map(input); diff --git a/stack-mapper/stack-mapper.d.ts b/stack-mapper/stack-mapper.d.ts new file mode 100644 index 000000000..3426f5b9d --- /dev/null +++ b/stack-mapper/stack-mapper.d.ts @@ -0,0 +1,46 @@ +// Type definitions for stack-mapper 0.2.2 +// Project: https://github.com/thlorenz/stack-mapper +// Definitions by: Rogier Schouten +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "stack-mapper" { + + module stackMapper { + + export class StackMapper { + + /** + * Maps the trace statements of the given error stack and replaces locations + * referencing code in the generated file with the locations inside the original files. + * + * @name map + * @function + * @param {Array} array of callsite objects (see readme for details about Callsite object) + * @return {Array.} info about the error stack with adapted locations, each with the following properties + * - filename: original filename + * - line: origial line in that filename of the trace + * - column: origial column on that line of the trace + */ + public map(stack: Callsite[]): Callsite[]; + } + + export interface Callsite { + filename: string; + line: number; + column: number; + } + + } + + /** + * Returns a Stackmapper that will use the given source map to map error trace locations. + * + * @name stackMapper + * @function + * @param {Object} sourcemap source map for the generated file + * @return {StackMapper} stack mapper for the particular source map + */ + function stackMapper(sourcemap: any): stackMapper.StackMapper; + + export = stackMapper; +} From c0391f4fcf1416b569c5b2fe5c323ace99364dd1 Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Tue, 24 Mar 2015 11:53:04 +0100 Subject: [PATCH 171/243] Add definitions for fs-mock. --- CONTRIBUTORS.md | 1 + fs-mock/fs-mock-tests.ts | 23 +++++++ fs-mock/fs-mock.d.ts | 144 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100644 fs-mock/fs-mock-tests.ts create mode 100644 fs-mock/fs-mock.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 0db9eae38..5faf5871d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -231,6 +231,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](fs-mock/fs-mock.d.ts) [fs-mock](https://github.com/sakren/node-fs-mock) by [Rogier Schouten](https://github.com/rogierschouten) * [: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) diff --git a/fs-mock/fs-mock-tests.ts b/fs-mock/fs-mock-tests.ts new file mode 100644 index 000000000..953b27472 --- /dev/null +++ b/fs-mock/fs-mock-tests.ts @@ -0,0 +1,23 @@ +/// + +import FS = require("fs-mock"); + +var fs: FS = new FS({ + 'Users': { + 'David': { + 'password.txt': 'my super password' + } + } +}, { + windows: true +}); + +var fsopts: FS.Opts = { + windows: true, + drives: ["A", "B"], + root: "/" +}; + +fs.rename("/a/b.txt", "/a/c/txt", (err?: Error): void => { + // nothing +}); diff --git a/fs-mock/fs-mock.d.ts b/fs-mock/fs-mock.d.ts new file mode 100644 index 000000000..fdf82b4d1 --- /dev/null +++ b/fs-mock/fs-mock.d.ts @@ -0,0 +1,144 @@ +// Type definitions for fs-mock 1.1.3 +// Project: https://github.com/sakren/node-fs-mock +// Definitions by: Rogier Schouten +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "fs-mock" { + import stream = require("stream"); + import events = require("events"); + import fs = require("fs"); + + module FS { + export interface Opts { + windows?: boolean; + drives?: string[]; + root?: string; + } + } + + class FS { + constructor(content: any, opts?: FS.Opts) + + rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + renameSync(oldPath: string, newPath: string): void; + truncate(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + truncate(path: string, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + truncateSync(path: string, len?: number): void; + ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + ftruncateSync(fd: number, len?: number): void; + chown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + chownSync(path: string, uid: number, gid: number): void; + fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + fchownSync(fd: number, uid: number, gid: number): void; + lchown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + lchownSync(path: string, uid: number, gid: number): void; + chmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + chmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + chmodSync(path: string, mode: number): void; + chmodSync(path: string, mode: string): void; + fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + fchmodSync(fd: number, mode: number): void; + fchmodSync(fd: number, mode: string): void; + lchmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + lchmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + lchmodSync(path: string, mode: number): void; + lchmodSync(path: string, mode: string): void; + stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: fs.Stats) => any): void; + lstat(path: string, callback?: (err: NodeJS.ErrnoException, stats: fs.Stats) => any): void; + fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: fs.Stats) => any): void; + statSync(path: string): fs.Stats; + lstatSync(path: string): fs.Stats; + fstatSync(fd: number): fs.Stats; + link(srcpath: string, dstpath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + linkSync(srcpath: string, dstpath: string): void; + symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + symlinkSync(srcpath: string, dstpath: string, type?: string): void; + readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; + readlinkSync(path: string): string; + realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; + realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void; + realpathSync(path: string, cache?: {[path: string]: string}): string; + unlink(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + unlinkSync(path: string): void; + rmdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + rmdirSync(path: string): void; + mkdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + mkdir(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + mkdir(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + mkdirSync(path: string, mode?: number): void; + mkdirSync(path: string, mode?: string): void; + readdir(path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; + readdirSync(path: string): string[]; + close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + closeSync(fd: number): void; + open(path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + open(path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + open(path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + openSync(path: string, flags: string, mode?: number): number; + openSync(path: string, flags: string, mode?: string): number; + utimes(path: string, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + utimes(path: string, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; + utimesSync(path: string, atime: number, mtime: number): void; + utimesSync(path: string, atime: Date, mtime: Date): void; + futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; + futimesSync(fd: number, atime: number, mtime: number): void; + futimesSync(fd: number, atime: Date, mtime: Date): void; + fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + fsyncSync(fd: number): void; + write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; + writeSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; + read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void; + readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; + readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void ): void; + readFileSync(filename: string, encoding: string): string; + readFileSync(filename: string, options: { encoding: string; flag?: string; }): string; + readFileSync(filename: string, options?: { flag?: string; }): Buffer; + writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; + writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; + appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; + appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; + watchFile(filename: string, listener: (curr: fs.Stats, prev: fs.Stats) => void): void; + watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: fs.Stats, prev: fs.Stats) => void): void; + unwatchFile(filename: string, listener?: (curr: fs.Stats, prev: fs.Stats) => void): void; + watch(filename: string, listener?: (event: string, filename: string) => any): fs.FSWatcher; + watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): fs.FSWatcher; + exists(path: string, callback?: (exists: boolean) => void): void; + existsSync(path: string): boolean; + createReadStream(path: string, options?: { + flags?: string; + encoding?: string; + fd?: string; + mode?: number; + bufferSize?: number; + }): fs.ReadStream; + createReadStream(path: string, options?: { + flags?: string; + encoding?: string; + fd?: string; + mode?: string; + bufferSize?: number; + }): fs.ReadStream; + createWriteStream(path: string, options?: { + flags?: string; + encoding?: string; + string?: string; + }): fs.WriteStream; + } + + export = FS; + +} \ No newline at end of file From a565c4ed685e963c66de8b1ad828e0858afabd88 Mon Sep 17 00:00:00 2001 From: Armando Garcia Date: Tue, 24 Mar 2015 09:38:37 -0500 Subject: [PATCH 172/243] Update sinon-chai.d.ts declare module chai { interface Expect { callCount(count: number): Expect; } } Added --> callCount(count: number): Expect; --- sinon-chai/sinon-chai.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/sinon-chai/sinon-chai.d.ts b/sinon-chai/sinon-chai.d.ts index 0f639abb7..d16969dd9 100644 --- a/sinon-chai/sinon-chai.d.ts +++ b/sinon-chai/sinon-chai.d.ts @@ -11,6 +11,7 @@ declare module chai { calledOnce: Expect; calledTwice: Expect; calledThrice: Expect; + callCount(count: number): Expect; calledBefore(spy: Function): Expect; calledAfter(spy: Function): Expect; calledWithNew: Expect; From 54d3f5068568fb304e38492864c431e67d522c23 Mon Sep 17 00:00:00 2001 From: ryan-codingintrigue Date: Tue, 24 Mar 2015 15:47:47 +0000 Subject: [PATCH 173/243] Removed unnecessary reference to typescriptServices --- whatwg-fetch/whatwg-fetch.d.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/whatwg-fetch/whatwg-fetch.d.ts b/whatwg-fetch/whatwg-fetch.d.ts index 18340110a..d847463bd 100644 --- a/whatwg-fetch/whatwg-fetch.d.ts +++ b/whatwg-fetch/whatwg-fetch.d.ts @@ -3,7 +3,6 @@ // Definitions by: Ryan Graham // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// /// declare class Request { @@ -38,17 +37,13 @@ declare enum RequestMode { "same-origin", "no-cors", "cors" } declare enum RequestCredentials { "omit", "same-origin", "include" } declare enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" } -declare class Headers implements TypeScript.Iterator { +declare class Headers { append(name: string, value: string): void; delete(name: string):void; get(name: string): string; getAll(name: string): Array; has(name: string): boolean; set(name: string, value: string): void; - - moveNext(): boolean; - - current(): string; } declare class Body { From 0c2ee8583c9a27873d7c40cc79fdcb79b5868150 Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 25 Mar 2015 01:29:24 +0900 Subject: [PATCH 174/243] update CONTRIBUTORS.md --- CONTRIBUTORS.md | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 55812debb..73a873bfa 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -19,7 +19,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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-ui-router/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-material/angular-material.d.ts) [Angular Material (ng.material module)](https://github.com/angular/material) by [Matt Traynham](https://github.com/mtraynham) * [:link:](angular-protractor/angular-protractor.d.ts) [Angular Protractor](https://github.com/angular/protractor) by [Bill Armstrong](https://github.com/BillArmstrong) * [:link:](angular-scenario/angular-scenario.d.ts) [Angular Scenario Testing (ngScenario module)](http://angularjs.org) by [RomanoLindano](https://github.com/RomanoLindano) @@ -32,7 +32,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped) * [:link:](angular-scroll/angular-scroll.d.ts) [angular-scroll](https://github.com/oblador/angular-scroll) by [Sam Herrmann](https://github.com/samherrmann) * [: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-ui/angular-ui-sortable.d.ts) [angular.ui.sortable module](https://github.com/angular-ui/ui-sortable) by [Thodoris Greasidis](https://github.com/thgreasi) +* [:link:](angular-ui-sortable/angular-ui-sortable.d.ts) [angular.ui.sortable module](https://github.com/angular-ui/ui-sortable) by [Thodoris Greasidis](https://github.com/thgreasi) * [: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) @@ -58,10 +58,12 @@ 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:](axios/axios.d.ts) [axios](https://github.com/mzabriskie/axios) by [Marcel Buesing](https://github.com/marcelbuesing) * [: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:](backbone.layoutmanager/backbone.layoutmanager.d.ts) [Backbone.LayoutManager](http://layoutmanager.org) by [He Jiang](https://github.com/hejiang2000) +* [:link:](backbone.paginator/backbone.paginator.d.ts) [backbone.paginator](https://github.com/backbone-paginator/backbone.paginator) by [Nyamazing](https://github.com/Nyamazing) * [:link:](backbone.radio/backbone.radio.d.ts) [Backbone.Radio](https://github.com/marionettejs/backbone.radio) by [Peter Palotas](https://github.com/alphaleonis) * [: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) @@ -135,6 +137,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](crypto-js/crypto-js.d.ts) [crypto-js](https://github.com/evanvosberg/crypto-js) by [Michael Zabka](https://github.com/misak113) * [: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:](csurf/csurf.d.ts) [csurf](https://www.npmjs.org/package/csurf) by [Hiroki Horiuchi](https://github.com/horiuchi) @@ -143,6 +146,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](d3/d3.d.ts) [d3JS](http://d3js.org) by [Boris Yankov](https://github.com/borisyankov) * [:link:](d3.cloud.layout/d3.cloud.layout.d.ts) [d3JS cloud layout plugin by Jason Davies](https://github.com/jasondavies/d3-cloud) by [hans windhoff](https://github.com/hansrwindhoff) * [:link:](dagre/dagre.d.ts) [dagre](https://github.com/cpettitt/dagre) by [Qinfeng Chen](https://github.com/qinfchen) +* [:link:](dagre-d3/dagre-d3.d.ts) [dagre-d3.core.js](https://github.com/cpettitt/dagre-d3) by [Mark Wong Siang Kai](https://github.com/markwongsk) * [: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) @@ -208,6 +212,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov) * [:link:](fast-stats/fast-stats.d.ts) [fast-stats](https://github.com/bluesmoon/node-faststats) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](fastclick/fastclick.d.ts) [FastClick](https://github.com/ftlabs/fastclick) by [Shinnosuke Watanabe](https://github.com/shinnn) +* [:link:](whatwg-fetch/whatwg-fetch.d.ts) [fetch API](https://github.com/github/fetch) by [Ryan Graham](https://github.com/ryan-codingintrigue) * [: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) @@ -231,6 +236,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](fs-finder/fs-finder.d.ts) [fs-finder](https://github.com/sakren/node-fs-finder) by [Michael Zabka](https://github.com/misak113) * [:link:](fs-mock/fs-mock.d.ts) [fs-mock](https://github.com/sakren/node-fs-mock) by [Rogier Schouten](https://github.com/rogierschouten) * [: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) @@ -251,8 +257,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:](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:](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:](google.picker/google.picker.d.ts) [Google Picker API](https://developers.google.com/picker) by [grapswiz](https://github.com/grapswiz) * [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73) @@ -291,6 +297,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](hammerjs/hammerjs.d.ts) [Hammer.js](http://hammerjs.github.io) by [Philip Bulley](https://github.com/milkisevil), [Han Lin Yap](https://github.com/codler) * [: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 [Jason Swearingen](http://github.com/jasonswearingen) +* [:link:](hasher/hasher.d.ts) [Hasher.js](https://github.com/millermedeiros/hasher) by [flyfishMT](https://github.com/flyfishMT) * [:link:](hashmap/hashmap.d.ts) [HashMap](https://github.com/flesler/hashmap) by [Rafał Wrzeszcz](http://wrzasq.pl) * [:link:](Headroom/headroom.d.ts) [headroom.js](http://wicky.nillia.ms/headroom.js) by [Jakub Olek](https://github.com/hakubo) * [:link:](heatmap.js/heatmap.d.ts) [heatmap.js](https://github.com/pa7/heatmap.js) by [Yang Guan](https://github.com/lookuptable) @@ -303,6 +310,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](touch-events/touch-events.d.ts) [HTML Touch Events](http://www.w3.org/TR/touch-events) by [Kevin Barabash](https://github.com/kevinb7) * [: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-status/http-status.d.ts) [http-status](https://github.com/wdavidw/node-http-status) by [Michael Zabka](https://github.com/misak113) * [: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) @@ -338,6 +346,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jest/jest.d.ts) [Jest](http://facebook.github.io/jest) by [Asana](https://asana.com) * [:link:](jjv/jjv.d.ts) [JJV](https://github.com/acornejo/jjv) by [Wim Looman](https://github.com/Nemo157) * [:link:](jjve/jjve.d.ts) [JJVE](https://github.com/silas/jjve) by [Wim Looman](https://github.com/Nemo157) +* [:link:](johnny-five/johnny-five.d.ts) [johnny-five](https://github.com/rwaldron/johnny-five) by [Toshiya Nakakura](https://github.com/nakakura) * [: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), [Ewout Van Gossum](https://github.com/DenEwout) * [:link:](jqrangeslider/jqrangeslider.d.ts) [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) by [Dániel Tar](https://github.com/qcz) @@ -480,6 +489,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](log4js/log4js.d.ts) [log4js](https://github.com/nomiddlename/log4js-node) by [Kentaro Okuno](http://github.com/armorik83) * [:link:](logg/logg.d.ts) [logg](https://github.com/dpup/node-logg) by [Bret Little](https://github.com/blittle) * [:link:](logrotate-stream/logrotate-stream.d.ts) [logrotate-stream](https://github.com/dstokes/logrotate-stream) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](lolex/lolex.d.ts) [lolex](https://github.com/sinonjs/lolex) by [Wim Looman](https://github.com/Nemo157) * [: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:](lscache/lscache.d.ts) [lscache](https://github.com/pamelafox/lscache) by [Chris Martinez](https://github.com/Chris-Martinezz) @@ -488,6 +498,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](main-bower-files/main-bower-files.d.ts) [main-bower-files](https://github.com/ck86/main-bower-files) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [: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:](mariasql/mariasql.d.ts) [mariasql](https://github.com/mscdex/node-mariasql) by [MichaelBennett](https://github.com/bennett000) * [: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:](maskedinput/maskedinput.d.ts) [Masked Input plugin for jQuery](http://digitalbush.com/projects/masked-input-plugin) by [Lokesh Peta](https://github.com/lokeshpeta) @@ -521,6 +532,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mkpath/mkpath.d.ts) [mkpath](https://www.npmjs.com/package/mkpath) by [Jared Klopper](https://github.com/optical) * [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000) * [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom) +* [:link:](mock-fs/mock-fs.d.ts) [mock-fs](https://github.com/tschaub/mock-fs) by [Wim Looman](https://github.com/Nemo157) * [:link:](mockery/mockery.d.ts) [mockery](https://github.com/mfncooper/mockery) by [jt000](https://github.com/jt000) * [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) * [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib) @@ -537,6 +549,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](mssql/mssql.d.ts) [mssql](https://www.npmjs.com/package/mssql) by [COLSA Corporation](http://www.colsa.com) * [:link:](mu2/mu2.d.ts) [mu2](http://github.com/raycmorgan/mu) by [Jeff Goddard](https://github.com/jedigo) * [:link:](multer/multer.d.ts) [multer](https://github.com/expressjs/multer) by [jt000](https://github.com/jt000) * [:link:](mustache/mustache.d.ts) [Mustache](https://github.com/janl/mustache.js) by [Mark Ashley Bell](https://github.com/markashleybell) @@ -582,12 +595,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](nopt/nopt.d.ts) [nopt](https://github.com/npm/nopt) by [jbondc](https://github.com/jbondc) -* [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar) * [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker) +* [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar) +* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Corey Jepperson](https://github.com/acoreyj) +* [:link:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj) * [: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:](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-hash/object-hash.d.ts) [object-hash](https://github.com/puleos/object-hash) by [Michael Zabka](https://github.com/misak113) * [:link:](object-path/object-path.d.ts) [objectPath](https://github.com/mariocasciaro/object-path) by [Paulo Cesar](https://github.com/pocesar) * [:link:](oboe/oboe.d.ts) [oboe](https://github.com/jimhigson/oboe.js) by [Jared Klopper](https://github.com/optical) * [:link:](oclazyload/oclazyload.d.ts) [oc.LazyLoad](https://github.com/ocombe/ocLazyLoad) by [Roland Zwaga](https://github.com/rolandzwaga) @@ -602,7 +618,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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-facebook-token/passport-facebook-token.d.ts) [passport-facebook-token](https://github.com/drudge/passport-facebook-token) by [Ray Martone](https://github.com/rmartone) * [:link:](passport-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](path-to-regexp/path-to-regexp.d.ts) [path-to-regexp](https://github.com/pillarjs/path-to-regexp) by [xica](https://github.com/xica) * [: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/peerjs.d.ts) [PeerJS](http://peerjs.com) by [Toshiya Nakakura](https://github.com/nakakura) @@ -623,8 +641,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](podcast/podcast.d.ts) [podcast](http://github.com/maxnowack/node-podcast) by [Niklas Mollenhauer](https://github.com/nikeee) * [:link:](poly2tri/poly2tri.d.ts) [poly2tri](http://github.com/r3mi/poly2tri.js) by [Elemar Junior](https://github.com/elemarjr) * [:link:](polymer/polymer.d.ts) [polymer](https://github.com/polymer) by [Louis Grignon](https://github.com/lgrignon) -* [:link:](polymer/polymer.core-drawer-panel.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-drawer-panel) by [Louis Grignon](https://github.com/lgrignon) * [:link:](polymer/polymer.paper-toast.d.ts) [polymer's paper-toast](https://github.com/Polymer/paper-toast) by [Louis Grignon](https://github.com/lgrignon) +* [:link:](polymer/polymer.core-drawer-panel.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-drawer-panel) by [Louis Grignon](https://github.com/lgrignon) * [: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:](power-assert/power-assert.d.ts) [power-assert](https://github.com/twada/power-assert) by [vvakame](https://github.com/vvakame) @@ -645,15 +663,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](rabbit.js/rabbit.js.d.ts) [rabbit.js](https://github.com/squaremo/rabbit.js) by [Wonshik Kim](https://github.com/wokim) -* [:link:](ractive/ractive.d.ts) [Ractive 0.7.0 edge f22ab8ad0a640591b1c263f57e21d1565cb26bf5](http://ractivejs.org) by [Han Lin Yap](http://yap.nu) +* [:link:](ractive/ractive.d.ts) [Ractive](http://ractivejs.org) by [Han Lin Yap](http://yap.nu) * [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall) * [:link:](rappid/rappid.d.ts) [Rappid](http://jointjs.com/about-rappid) by [Ewout Van Gossum](https://github.com/DenEwout) * [: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 (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) +* [:link:](react/react-global.d.ts) [React (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) * [:link:](react-router/react-router.d.ts) [React Router](https://github.com/rackt/react-router) by [Yuichi Murata](https://github.com/mrk21) -* [:link:](react/react.d.ts) [React v0.13.0 RC2 (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) -* [:link:](react/react-global.d.ts) [React v0.13.0 RC2 (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) -* [:link:](react/react-addons.d.ts) [ReactWithAddons v0.13.0 RC2 (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) -* [:link:](react/react-addons-global.d.ts) [ReactWithAddons v0.13.0 RC2 (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) +* [:link:](react/react-addons.d.ts) [ReactWithAddons (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) +* [:link:](react/react-addons-global.d.ts) [ReactWithAddons (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.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) @@ -662,6 +680,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ref-union/ref-union.d.ts) [ref-union](https://github.com/TooTallNate/ref-union) by [Paul Loyd](https://github.com/loyd) * [: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:](response-time/response-time.d.ts) [response-time](https://github.com/expressjs/response-time) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](rest/rest.d.ts) [rest.js](https://github.com/cujojs/rest) by [Wim Looman](https://github.com/Nemo157) * [: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) @@ -686,6 +705,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](s3-uploader/s3-uploader.d.ts) [s3-uploader](https://www.npmjs.com/package/s3-uploader) by [COLSA Corporation](http://www.colsa.com) * [:link:](sammyjs/sammyjs.d.ts) [Sammy.js](http://sammyjs.org) by [Boris Yankov](https://github.com/borisyankov), [Oisin Grehan](https://github.com/oising) * [:link:](sanitize-filename/sanitize-filename.d.ts) [sanitize-filename](https://github.com/parshap/node-sanitize-filename) by [Wim Looman](https://github.com/Nemo157) * [:link:](sanitize-html/sanitize-html.d.ts) [sanitize-html](https://github.com/punkave/sanitize-html) by [Rogier Schouten](https://github.com/rogierschouten) @@ -697,6 +717,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](sequelize/sequelize.d.ts) [Sequelize 2.0.0 dev13](http://sequelizejs.com) by [samuelneff](https://github.com/samuelneff), [Peter Harris](https://github.com/codeanimal) +* [:link:](serve-favicon/serve-favicon.d.ts) [serve-favicon](https://github.com/expressjs/serve-favicon) by [Uros Smolnik](https://github.com/urossmolnik) +* [:link:](serve-static/serve-static.d.ts) [serve-static](https://github.com/expressjs/serve-static) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](sharedworker/SharedWorker.d.ts) [SharedWorker](http://www.w3.org/TR/workers) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](shelljs/shelljs.d.ts) [ShellJS](http://shelljs.org) by [Niklas Mollenhauer](https://github.com/nikeee) * [:link:](should-promised/should-promised.d.ts) [should-promised](https://github.com/shouldjs/promised) by [Yaroslav Admin](https://github.com/devoto13) @@ -731,7 +753,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](stack-mapper/stack-mapper.d.ts) [stack-mapper](https://github.com/thlorenz/stack-mapper) by [rogierschouten](https://github.com/rogierschouten) +* [:link:](stack-mapper/stack-mapper.d.ts) [stack-mapper](https://github.com/thlorenz/stack-mapper) by [Rogier Schouten](https://github.com/rogierschouten) * [: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 r12](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) @@ -826,6 +848,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](webspeechapi/webspeechapi.d.ts) [Web Speech API](https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html) by [SaschaNaz](https://github.com/saschanaz) * [:link:](webcola/webcola.d.ts) [webcola](https://github.com/tgdwyer/WebCola) by [Qinfeng Chen](https://github.com/qinfchen) * [:link:](webcrypto/WebCrypto.d.ts) [WebCrypto](http://www.w3.org/TR/WebCryptoAPI) by [Lucas Dixon](https://github.com/iislucas) +* [:link:](webix/webix.d.ts) [Webix UI](http://webix.com) by [Maksim Kozhukh](http://github.com/mkozhukh) * [: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), [Wim Looman](https://github.com/Nemo157) From da74caeab8c15185a646d0090cd2c64bbe8a7ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Morch=C3=B3n=20Poveda?= Date: Tue, 24 Mar 2015 17:42:07 +0100 Subject: [PATCH 175/243] Update knockout.d.ts Optional viewmodel on component registration --- 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 c20207199..a906348a6 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -574,7 +574,7 @@ interface KnockoutComputedContext { declare module KnockoutComponentTypes { interface Config { - viewModel: ViewModelFunction | ViewModelSharedInstance | ViewModelFactoryFunction | AMDModule; + viewModel?: ViewModelFunction | ViewModelSharedInstance | ViewModelFactoryFunction | AMDModule; template: string | Node[]| DocumentFragment | TemplateElement | AMDModule; } From c7cb3bcbf71f92a527d18bde51ac7d892fb8076f Mon Sep 17 00:00:00 2001 From: Elad Zelingher Date: Tue, 24 Mar 2015 21:32:57 +0200 Subject: [PATCH 176/243] AutobahnJS definition --- autobahn/autobahn-tests.ts | 47 +++++++++ autobahn/autobahn.d.ts | 195 +++++++++++++++++++++++++++++++++++++ 2 files changed, 242 insertions(+) create mode 100644 autobahn/autobahn-tests.ts create mode 100644 autobahn/autobahn.d.ts diff --git a/autobahn/autobahn-tests.ts b/autobahn/autobahn-tests.ts new file mode 100644 index 000000000..ee9c41b3e --- /dev/null +++ b/autobahn/autobahn-tests.ts @@ -0,0 +1,47 @@ +/// + +class MyClass { + add2Count: number = 0; + session: autobahn.Session; + + constructor(session: autobahn.Session) { + this.session = session; + } + + add2(args: Array): number { + this.add2Count++; + return args[0] + args[1]; + } + + onEvent(args: Array): void { + console.log("Event:", args[0]); + } +} + +function test_client() { + var options: autobahn.IConnectionOptions = + { url: 'ws://127.0.0.1:8080/ws', realm: 'realm1' }; + + var connection = new autobahn.Connection(options); + + connection.onopen = session => { + var myInstance = new MyClass(session); + + // 1) subscribe to a topic + session.subscribe('com.myapp.hello', myInstance.onEvent); + + // 2) publish an event + session.publish('com.myapp.hello', ['Hello, world!']); + + // 3) register a procedure for remoting + session.register('com.myapp.add2', myInstance.add2); + + // 4) call a remote procedure + session.call('com.myapp.add2', [2, 3]).then( + res => { + console.log("Result:", res); + }); + }; + + connection.open(); +} \ No newline at end of file diff --git a/autobahn/autobahn.d.ts b/autobahn/autobahn.d.ts new file mode 100644 index 000000000..7191e9c4f --- /dev/null +++ b/autobahn/autobahn.d.ts @@ -0,0 +1,195 @@ +// Type definitions for AutobahnJS v0.9.6 +// Project: http://autobahn.ws/js/ +// Definitions by: Elad Zelingher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +declare module autobahn { + + export class Session { + id: number; + realm: string; + isOpen: boolean; + features: any; + caller_disclose_me: boolean; + publisher_disclose_me: boolean; + subscriptions: ISubscription[][]; + registrations: IRegistration[]; + + constructor(transport: ITransport, defer: DeferFactory, challenge: OnChallengeHandler); + + join(realm: string, authmethods: string[], authid: string): void; + + leave(reason: string, message: string): void; + + call(procedure: string, args?: any[], kwargs?: any, options?: ICallOptions): When.Promise; + + publish(topic: string, args?: any[], kwargs?: any, options?: IPublishOptions): When.Promise; + + subscribe(topic: string, handler: SubscribeHandler, options?: ISubscribeOptions): When.Promise; + + register(procedure: string, endpoint: RegisterEndpoint, options?: IRegisterOptions): When.Promise; + + unsubscribe(subscription: ISubscription): When.Promise; + + unregister(registration: IRegistration): When.Promise; + + prefix(prefix: string, uri: string): void; + + resolve(curie: string): string; + + onjoin: (roleFeatures: any) => void; + onleave: (reason: string, details: any) => void; + } + + interface IInvocation { + caller?: number; + progress?: boolean; + procedure: string; + } + + interface IEvent { + publication: number; + publisher?: number; + topic: string; + } + + interface IResult { + args: any[]; + kwargs: any; + } + + interface IError { + error: string; + args: any[]; + kwargs: any; + } + + type SubscribeHandler = (args?: any[], kwargs?: any, details?: IEvent) => void; + + interface ISubscription { + topic: string; + handler: SubscribeHandler; + options: ISubscribeOptions; + session: Session; + id: number; + active: boolean; + unsubscribe(): When.Promise; + } + + type RegisterEndpoint = (args?: any[], kwargs?: any, details?: IInvocation) => void; + + interface IRegistration { + procedure: string; + endpoint: RegisterEndpoint; + options: IRegisterOptions; + session: Session; + id: number; + active: boolean; + unregister(): When.Promise; + } + + interface IPublication { + id: number; + } + + interface ICallOptions { + timeout?: number; + receive_progress?: boolean; + disclose_me?: boolean; + } + + interface IPublishOptions { + exclude?: number[]; + eligible?: number[]; + disclose_me? : Boolean; + } + + interface ISubscribeOptions { + match? : string; + } + + interface IRegisterOptions { + disclose_caller?: boolean; + } + + export class Connection { + constructor(options?: IConnectionOptions); + + open(): void; + + close(reason: string, message: string): void; + + onopen: (session: Session, details: any) => void; + onclose: (reason: string, details: any) => boolean; + } + + interface ITransportDefinition { + url?: string; + protocols?: string[]; + type: string; + } + + type DeferFactory = () => any; + + type OnChallengeHandler = (session: Session, method: string, extra: any) => When.Promise; + + interface IConnectionOptions { + use_es6_promises?: boolean; + // use explicit deferred factory, e.g. jQuery.Deferred or Q.defer + use_deferred?: DeferFactory; + transports?: ITransportDefinition[]; + retry_if_unreachable?: boolean; + max_retries?: number; + initial_retry_delay?: number; + max_retry_delay?: number; + retry_delay_growth?: number; + retry_delay_jitter?: number; + url?: string; + protocols?: string[]; + onchallenge?: (session: Session, method: string, extra: any) => OnChallengeHandler; + realm?: string; + authmethods?: string[]; + authid?: string; + } + + interface ICloseEventDetails { + wasClean: boolean; + reason: string; + code: number; + } + + interface ITransport { + onopen: () => void; + onmessage: (message: any[]) => void; + onclose: (details: ICloseEventDetails) => void; + + send(message: any[]): void; + close(errorCode: number, reason?: string): void; + } + + interface ITransportFactory { + //constructor(options: any); + type: string; + create(): ITransport; + } + + interface ITransports { + register(name: string, factory: any): void; + isRegistered(name: string): boolean; + get(name: string): any; + list(): any[]; + } + + interface ILog { + debug(...args: any[]): void; + } + + interface IUtil { + assert(condition: boolean, message: string): void; + } + + var util: IUtil; + var log: ILog; + var transports: ITransports; +} \ No newline at end of file From 1e6120577ba9aba83008a3033569a3cf4cd8dd5c Mon Sep 17 00:00:00 2001 From: mbuesing Date: Tue, 24 Mar 2015 19:34:17 +0100 Subject: [PATCH 177/243] Fix axios definitions by removing enums and config generic --- axios/axios-tests.ts | 23 +++++++++-------------- axios/axios.d.ts | 29 ++++++++++++++--------------- 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/axios/axios-tests.ts b/axios/axios-tests.ts index a11421e19..93787cf3d 100644 --- a/axios/axios-tests.ts +++ b/axios/axios-tests.ts @@ -1,23 +1,18 @@ /// -interface InputBody { - random: number; -} +enum HttpMethod { GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH } +enum ResponseType { arraybuffer, blob, document, json, text } interface Repository { id: number; name: string; } -function convenientGet () { - axios.get("https://api.github.com/repos/mzabriskie/axios") - .then(r => console.log(r.config.data.random)); -} +axios.get("https://api.github.com/repos/mzabriskie/axios") + .then(r => console.log(r.config.method)); -function get() { - axios({ - url: "https://api.github.com/repos/mzabriskie/axios", - method: Axios.HTTPMethod.GET, - headers: {}, - }).then(r => console.log("ID:" + r.data.id + " Name: " + r.data.name)); -} \ No newline at end of file +axios({ + url: "https://api.github.com/repos/mzabriskie/axios", + method: HttpMethod[HttpMethod.GET], + headers: {}, +}).then(r => console.log("ID:" + r.data.id + " Name: " + r.data.name)); diff --git a/axios/axios.d.ts b/axios/axios.d.ts index 5455ba167..c2a2873ea 100644 --- a/axios/axios.d.ts +++ b/axios/axios.d.ts @@ -6,8 +6,6 @@ /// declare module Axios { - export enum HTTPMethod { GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH } - export enum ResponseType { arraybuffer, blob, document, json, text } /** * - request body data type @@ -46,7 +44,7 @@ declare module Axios { * indicates the type of data that the server will respond with * options are 'arraybuffer', 'blob', 'document', 'json', 'text' */ - responseType?: Axios.ResponseType; + responseType?: string; /** * name of the cookie to use as a value for xsrf token @@ -65,14 +63,15 @@ declare module Axios { */ interface AxiosXHRConfig extends AxiosXHRConfigBase { /** - * server URL that will be used for the request + * server URL that will be used for the request, options are: + * GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH */ url: string; /** * request method to be used when making the request */ - method?: Axios.HTTPMethod; + method?: string; /** * data to be sent as the request body @@ -86,7 +85,7 @@ declare module Axios { * - expected response type, * - request body data type */ - interface AxiosXHR { + interface AxiosXHR { /** * Response that was provided by the server */ @@ -110,7 +109,7 @@ declare module Axios { /** * config that was provided to `axios` for the request */ - config: AxiosXHRConfig; + config: AxiosXHRConfig; } /** @@ -119,40 +118,40 @@ declare module Axios { */ interface AxiosStatic { - (config: AxiosXHRConfig): Promise>; + (config: AxiosXHRConfig): Promise>; - new (config: AxiosXHRConfig): Promise>; + new (config: AxiosXHRConfig): Promise>; /** * convenience alias, method = GET */ - get(url: string, config?: AxiosXHRConfigBase): Promise>; + get(url: string, config?: AxiosXHRConfigBase): Promise>; /** * convenience alias, method = DELETE */ - delete(url: string, config?: AxiosXHRConfigBase): Promise>; + delete(url: string, config?: AxiosXHRConfigBase): Promise>; /** * convenience alias, method = HEAD */ - head(url: string, config?: AxiosXHRConfigBase): Promise>; + head(url: string, config?: AxiosXHRConfigBase): Promise>; /** * convenience alias, method = POST */ - post(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + post(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; /** * convenience alias, method = PUT */ - put(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + put(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; /** * convenience alias, method = PATCH */ - patch(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; + patch(url: string, data?: any, config?: AxiosXHRConfigBase): Promise>; } } From f95f0eee795e7de4b86f213825f1c0d42711c1b2 Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Wed, 25 Mar 2015 15:02:21 +0100 Subject: [PATCH 178/243] Add definitions for ftp and ftpd. --- CONTRIBUTORS.md | 2 + ftp/ftp-tests.ts | 28 +++++ ftp/ftp.d.ts | 294 +++++++++++++++++++++++++++++++++++++++++++++ ftpd/ftpd-tests.ts | 32 +++++ ftpd/ftpd.d.ts | 202 +++++++++++++++++++++++++++++++ 5 files changed, 558 insertions(+) create mode 100644 ftp/ftp-tests.ts create mode 100644 ftp/ftp.d.ts create mode 100644 ftpd/ftpd-tests.ts create mode 100644 ftpd/ftpd.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 73a873bfa..c8f458501 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -239,6 +239,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](fs-finder/fs-finder.d.ts) [fs-finder](https://github.com/sakren/node-fs-finder) by [Michael Zabka](https://github.com/misak113) * [:link:](fs-mock/fs-mock.d.ts) [fs-mock](https://github.com/sakren/node-fs-mock) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](ftdomdelegate/ftdomdelegate.d.ts) [ftdomdelegate](https://github.com/ftlabs/ftdomdelegate) by [Christian Holm Nielsen](https://github.com/dotnetnerd) +* [:link:](ftp/ftp.d.ts) [ftp](https://github.com/mscdex/node-ftp) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](ftpd/ftpd.d.ts) [ftp](https://github.com/sstur/nodeftpd) by [Rogier Schouten](https://github.com/rogierschouten) * [: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:](jquery-galleria/jquery-galleria.d.ts) [galleria.js](https://github.com/aino/galleria) by [Robert Imig](https://github.com/rimig) diff --git a/ftp/ftp-tests.ts b/ftp/ftp-tests.ts new file mode 100644 index 000000000..2e37e53f9 --- /dev/null +++ b/ftp/ftp-tests.ts @@ -0,0 +1,28 @@ +/// +/// + +import Client = require("ftp"); +import fs = require("fs"); + +var c = new Client(); +c.on('ready', (): void => { + c.get('foo.txt', function(err: Error, stream: NodeJS.ReadableStream): void { + if (err) throw err; + stream.once('close', function(): void { + c.end(); + }); + stream.pipe(fs.createWriteStream('foo.local-copy.txt')); + }); +}); +// connect to localhost:21 as anonymous +c.connect(); + +c.connect({ + host: "127.0.0.1", + port: 21, + username: "Boo", + password: "secret" +}); + + + diff --git a/ftp/ftp.d.ts b/ftp/ftp.d.ts new file mode 100644 index 000000000..764505037 --- /dev/null +++ b/ftp/ftp.d.ts @@ -0,0 +1,294 @@ +// Type definitions for ftp 0.3.8 +// Project: https://github.com/mscdex/node-ftp +// Definitions by: Rogier Schouten +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "ftp" { + + import events = require("events"); + import tls = require("tls"); + + module Client { + + /** + * Options for Client#connect() + */ + export interface Options { + /** + * The hostname or IP address of the FTP server. Default: 'localhost' + */ + host?: string; + /** + * The port of the FTP server. Default: 21 + */ + port?: number; + /** + * Set to true for both control and data connection encryption, 'control' for control connection encryption only, or 'implicit' for + * implicitly encrypted control connection (this mode is deprecated in modern times, but usually uses port 990) Default: false + */ + secure?: string|boolean; + /** + * Additional options to be passed to tls.connect(). Default: (none) + */ + secureOptions?: tls.ConnectionOptions; + /** + * Username for authentication. Default: 'anonymous' + */ + user?: string; + /** + * Password for authentication. Default: 'anonymous@' + */ + password?: string; + /** + * How long (in milliseconds) to wait for the control connection to be established. Default: 10000 + */ + connTimeout?: number; + /** + * How long (in milliseconds) to wait for a PASV data connection to be established. Default: 10000 + */ + pasvTimeout?: number; + /** + * How often (in milliseconds) to send a 'dummy' (NOOP) command to keep the connection alive. Default: 10000 + */ + keepalive?: number; + } + + /** + * Element returned by Client#list() + */ + export interface ListingElement { + /** + * A single character denoting the entry type: 'd' for directory, '-' for file (or 'l' for symlink on **\*NIX only**). + */ + "type": string; + /** + * The name of the entry + */ + name: string; + /** + * The size of the entry in bytes + */ + size: string; + /** + * The last modified date of the entry + */ + date: Date; + /** + * The various permissions for this entry **(*NIX only)** + */ + rights?: { + /** + * An empty string or any combination of 'r', 'w', 'x'. + */ + user: string; + /** + * An empty string or any combination of 'r', 'w', 'x'. + */ + group: string; + /** + * An empty string or any combination of 'r', 'w', 'x'. + */ + other: string; + }; + /** + * The user name or ID that this entry belongs to **(*NIX only)**. + */ + owner?: string; + /** + * The group name or ID that this entry belongs to **(*NIX only)**. + */ + group?: string; + /** + * For symlink entries, this is the symlink's target **(*NIX only)**. + */ + target?: string; + /** + * True if the sticky bit is set for this entry **(*NIX only)**. + */ + sticky?: boolean; + } + } + + + /** + * FTP client. + * + * Events: + * @event greeting(< string >msg) - Emitted after connection. msg is the text the server sent upon connection. + * @event ready() - Emitted when connection and authentication were sucessful. + * @event close(< boolean >hadErr) - Emitted when the connection has fully closed. + * @event end() - Emitted when the connection has ended. + * @event error(< Error >err) - Emitted when an error occurs. In case of protocol-level errors, err contains + * a 'code' property that references the related 3-digit FTP response code. + */ + class Client extends events.EventEmitter { + + /** + * Creates and returns a new FTP client instance. + */ + constructor(); + + /** + * Connects to an FTP server. + */ + connect(config?: Client.Options): void; + + /** + * Closes the connection to the server after any/all enqueued commands have been executed. + */ + end(): void; + + /** + * Closes the connection to the server immediately. + */ + destroy(): void; + + /** + * Retrieves the directory listing of path. + * @param path defaults to the current working directory. + * @param useCompression defaults to false. + */ + list(path: string, useCompression: boolean, callback: (error: Error, listing: Client.ListingElement[]) => void): void; + list(path: string, callback: (error: Error, listing: Client.ListingElement[]) => void): void; + list(useCompression: boolean, callback: (error: Error, listing: Client.ListingElement[]) => void): void; + list(callback: (error: Error, listing: Client.ListingElement[]) => void): void; + + /** + * Retrieves a file at path from the server. useCompression defaults to false + */ + get(path: string, callback: (error: Error, stream: NodeJS.ReadableStream) => void): void; + get(path: string, useCompression: boolean, callback: (error: Error, stream: NodeJS.ReadableStream) => void): void; + + /** + * Sends data to the server to be stored as destPath. + * @param input can be a ReadableStream, a Buffer, or a path to a local file. + * @param destPath + * @param useCompression defaults to false. + */ + put(input: NodeJS.ReadableStream|Buffer|string, destPath: string, useCompression: boolean, callback: (error: Error) => void): void; + put(input: NodeJS.ReadableStream|Buffer|string, destPath: string, callback: (error: Error) => void): void; + + /** + * Same as put(), except if destPath already exists, it will be appended to instead of overwritten. + * @param input can be a ReadableStream, a Buffer, or a path to a local file. + * @param destPath + * @param useCompression defaults to false. + */ + append(input: NodeJS.ReadableStream|Buffer|string, destPath: string, useCompression: boolean, callback: (error: Error) => void): void; + append(input: NodeJS.ReadableStream|Buffer|string, destPath: string, callback: (error: Error) => void): void; + + /** + * Renames oldPath to newPath on the server + */ + rename(oldPath: string, newPath: string, callback: (error: Error) => void): void; + + /** + * Logout the user from the server. + */ + logout(callback: (error: Error) => void): void; + + /** + * Delete a file on the server + */ + delete(path: string, callback: (error: Error) => void): void; + + /** + * Changes the current working directory to path. callback has 2 parameters: < Error >err, < string >currentDir. + * Note: currentDir is only given if the server replies with the path in the response text. + */ + cwd(path: string, callback: (error: Error, currentDir?: string) => void): void; + + /** + * Aborts the current data transfer (e.g. from get(), put(), or list()) + */ + abort(callback: (error: Error) => void): void; + + /** + * Sends command (e.g. 'CHMOD 755 foo', 'QUOTA') using SITE. callback has 3 parameters: + * < Error >err, < _string >responseText, < integer >responseCode. + */ + site(command: string, callback: (error: Error, responseText: string, responseCode: number) => void): void; + + /** + * Retrieves human-readable information about the server's status. + */ + status(callback: (error: Error, status: string) => void): void; + + /** + * Sets the transfer data type to ASCII. + */ + ascii(callback: (error: Error) => void): void; + + /** + * Sets the transfer data type to binary (default at time of connection). + */ + binary(callback: (error: Error) => void): void; + + /** + * Optional "standard" commands (RFC 959) + * Creates a new directory, path, on the server. recursive is for enabling a 'mkdir -p' algorithm and defaults to false + */ + mkdir(path: string, recursive: boolean, callback: (error: Error) => void): void; + mkdir(path: string, callback: (error: Error) => void): void; + + + /** + * Optional "standard" commands (RFC 959) + * Removes a directory, path, on the server. If recursive, this call will delete the contents of the directory if it is not empty + */ + rmdir(path: string, recursive: boolean, callback: (error: Error) => void): void; + rmdir(path: string, callback: (error: Error) => void): void; + + /** + * Optional "standard" commands (RFC 959) + * Changes the working directory to the parent of the current directory + */ + cdup(callback: (error: Error) => void): void; + + /** + * Optional "standard" commands (RFC 959) + * Retrieves the current working directory + */ + pwd(callback: (error: Error, path: string) => void): void; + + /** + * Optional "standard" commands (RFC 959) + * Retrieves the server's operating system. + */ + system(callback: (error: Error, OS: string) => void): void; + + /** + * Optional "standard" commands (RFC 959) + * Similar to list(), except the directory is temporarily changed to path to retrieve the directory listing. + * This is useful for servers that do not handle characters like spaces and quotes in directory names well for the LIST command. + * This function is "optional" because it relies on pwd() being available. + */ + listSafe(path: string, useCompression: boolean, callback: (error: Error, listing: Client.ListingElement[]) => void): void; + listSafe(path: string, callback: (error: Error, listing: Client.ListingElement[]) => void): void; + listSafe(useCompression: boolean, callback: (error: Error, listing: Client.ListingElement[]) => void): void; + listSafe(callback: (error: Error, listing: Client.ListingElement[]) => void): void; + + /** + * Extended commands (RFC 3659) + * Retrieves the size of path + */ + size(path: string, callback: (error: Error, size: number) => void): void; + + /** + * Extended commands (RFC 3659) + * Retrieves the last modified date and time for path + */ + lastMod(path: string, callback: (error: Error, lastMod: Date) => void): void; + + /** + * Extended commands (RFC 3659) + * Sets the file byte offset for the next file transfer action (get/put) to byteOffset + */ + restart(byteOffset: number, callback: (error: Error) => void): void; + + } + + export = Client; +} diff --git a/ftpd/ftpd-tests.ts b/ftpd/ftpd-tests.ts new file mode 100644 index 000000000..9d8485a9e --- /dev/null +++ b/ftpd/ftpd-tests.ts @@ -0,0 +1,32 @@ +/// + +import ftpd = require("ftpd"); + +var options: ftpd.FtpServerOptions = { + pasvPortRangeStart: 4000, + pasvPortRangeEnd: 5000, + getInitialCwd: function(connection: ftpd.FtpConnection, callback: (error: Error, path: string) => void): void { + callback(null, "boo"); + }, + getRoot: function(connection: ftpd.FtpConnection): string { + return '/'; + } +}; + +var host: string = '10.0.0.42'; + +var server = new ftpd.FtpServer(host, options); + +server.on('client:connected', function(conn: ftpd.FtpConnection): void { + conn.on('command:user', function(user: string, success: () => void, failure: () => void): void { + success(); + }); + conn.on('command:pass', function( + pass: string, + success: (username: string, fs?: ftpd.FtpFileSystem) => void, + failure: () => void) { + success("Rogier"); + }); +}); + +server.listen(21); diff --git a/ftpd/ftpd.d.ts b/ftpd/ftpd.d.ts new file mode 100644 index 000000000..ac0123256 --- /dev/null +++ b/ftpd/ftpd.d.ts @@ -0,0 +1,202 @@ +// Type definitions for ftpd 0.2.11 +// Project: https://github.com/sstur/nodeftpd +// Definitions by: Rogier Schouten +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "ftpd" { + + import events = require("events"); + import fs = require("fs"); + import net = require("net"); + import tls = require("tls"); + + /** + * Options for FtpServer constructor + */ + export interface FtpServerOptions { + /** + * Gets the initial working directory for the user. Called after user is authenticated + * Typical cases where you would want/need the callback involve retrieving configurations from external datasources and suchlike. + */ + getInitialCwd: (connection: FtpConnection, callback?: (error: Error, path: string) => void) => void|string; + /** + * Gets the root directory for the user relative to the CWD. Called after getInitialCwd. The user is not able to escape this directory. + * Typical cases where you would want/need the callback involve retrieving configurations from external datasources and suchlike. + */ + getRoot: (connection: FtpConnection, callback?: (error: Error, path: string) => void) => void|string; + /** + * If set to true, then files which the client uploads are buffered in memory and then written to disk using writeFile. + * If false, files are written using writeStream. + */ + useWriteFile?: boolean; + /** + * If set to true, then files which the client uploads are slurped using 'readFile'. + * If false, files are read using readStream. + */ + useReadFile?: boolean; + /** + * Determines the maximum file size (in bytes) for which uploads are buffered in memory before being written to disk. + * Has an effect only if useWriteFile is set to true. + * If uploadMaxSlurpSize is not set, then there is no limit on buffer size. + */ + uploadMaxSlurpSize?: number; + /** + * The maximum number of concurrent calls to fs.stat which will be made when processing a LIST request. Default 5. + */ + maxStatsAtOnce?: number; + /** + * A function which can be used as the argument of an array's sort method. Used to sort filenames for directory listings. + * See [https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/sort] for more info. + */ + filenameSortFunc?: (a: string, b: string) => number; + /** + * A function which is applied to each filename before sorting. + * If set to false, filenames are unaltered. + */ + filenameSortMap?: ((a: string) => string) | boolean; + /** + * If this is set, then filenames are not sorted in responses to the LIST and NLST commands. + */ + dontSortFilenames?: boolean; + /** + * If set to true, then LIST and NLST treat the characters ? and * as literals instead of as wildcards. + */ + noWildcards?: boolean; + /** + * If this is set, the server will allow explicit TLS authentication. Value should be a dictionary which is suitable as the options argument of tls.createServer. + */ + tlsOptions?: tls.TlsOptions; + /** + * If this is set to true, and tlsOptions is also set, then the server will not allow logins over non-secure connections. + * Default false + */ + tlsOnly?: boolean; + /** + * I obviously set this to true when tlsOnly is on -someone needs to update this. + */ + allowUnauthorizedTls?: boolean; + /** + * Integer, specifies the lower-bound port (min port) for creating PASV connections + */ + pasvPortRangeStart?: number; + /** + * Integer, specifies the upper-bound port (max port) for creating PASV connections + */ + pasvPortRangeEnd?: number; + } + + /** + * Represents one Ftp connection. Incomplete type definition. + * + * @event command:user (username: string, success: () => void, failure: () => void) + * @event command:pass (password: string, success: (username: string, fs?: FtpFileSystem) => void, failure: () => void) + * The server raises a command:pass event which is given pass, success and failure arguments. + * On successful login, success should be called with a username argument. It may also optionally + * be given a second argument, which should be an object providing an implementation of the API for Node's fs module. + */ + export class FtpConnection extends events.EventEmitter { + server: FtpServer; + socket: net.Socket; + pasv: net.Server; + dataSocket: net.Socket; // the actual data socket + mode: string; + username: string; + cwd: string; + root: string; + hasQuit: boolean; + // State for handling TLS upgrades. + secure: boolean; + pbszReceived: boolean; + } + + + /** + * Optional mock fs implementation to set in the command:pass event of FtpConnection + */ + export interface FtpFileSystem { + unlink: (path: string, callback?: (err?: NodeJS.ErrnoException) => void) => void; + readdir: (path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void) => void; + mkdir: ((path: string, callback?: (err?: NodeJS.ErrnoException) => void) => void) + | ((path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void) => void) + | ((path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void) => void); + open: ((path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any) => void) + | ((path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any) => void) + | ((path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any) => void); + close: (fd: number, callback?: (err?: NodeJS.ErrnoException) => void) => void; + rmdir: (path: string, callback?: (err?: NodeJS.ErrnoException) => void) => void; + rename: (oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void) => void; + /** + * specific object properties: { mode, isDirectory(), size, mtime } + */ + stat: (path: string, callback?: (err: NodeJS.ErrnoException, stats: fs.Stats) => any) => void; + /** + * if useReadFile option is not set or is false + */ + createReadStream?: (path: string, options?: { + flags?: string; + encoding?: string; + fd?: string; + mode?: string; + bufferSize?: number; + }) => fs.ReadStream; + /** + * if useWriteFile option is not set or is false + */ + createWriteStream?: (path: string, options?: { + flags?: string; + encoding?: string; + string?: string; + }) => fs.WriteStream; + /** + * if useReadFile option is set to 'true' + */ + readFile?: + ((filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void) => void) + | ((filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void) => void) + | ((filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void) => void) + | ((filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void ) => void); + /** + * if useWriteFile option is set to 'true' + */ + writeFile?: + ((filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void) => void) + | ((filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void) => void) + | ((filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void) => void); + + } + + /** + * FTP server + * + * Events: + * @event close net.Server close event + * @event error net.Server error event + * @event client:connected (connection: FtpConnection) + */ + export class FtpServer extends events.EventEmitter { + + /** + * @param host host is a string representation of the IP address clients use to connect to the FTP server. + * It's imperative that this actually reflects the remote IP the clients use to access the server, + * as this IP will be used in the establishment of PASV data connections. If this IP is not the one clients use to connect, + * you will see some strange behavior from the client side (hangs). + * @param options See test.js for a simple example. + */ + constructor(host: string, options: FtpServerOptions); + + /** + * Start listening, see net.Server.listen() + */ + public listen(port: number, host?: string, backlog?: number, listeningListener?: () => void): void; + + /** + * Stop listening + */ + public close(callback?: () => void): void; + } + + + +} From c7b467e42e5d876aee69e4430d0cd6252134289a Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Wed, 25 Mar 2015 21:07:30 +0700 Subject: [PATCH 179/243] mocha.d.ts: Boolean should be boolean. --- mocha/mocha.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mocha/mocha.d.ts b/mocha/mocha.d.ts index 6a2a53959..3f5d3e571 100644 --- a/mocha/mocha.d.ts +++ b/mocha/mocha.d.ts @@ -37,10 +37,10 @@ interface MochaSetupOptions { reporter?: any; // bail on the first test failure - bail?: Boolean; + bail?: boolean; // ignore global leaks - ignoreLeaks?: Boolean; + ignoreLeaks?: boolean; // grep string or regexp to filter tests with grep?: any; From 00ac8bd29c2b32f964616ed607b8f7b4dc4d8a16 Mon Sep 17 00:00:00 2001 From: Jason Saelhof Date: Wed, 25 Mar 2015 09:41:19 -0600 Subject: [PATCH 180/243] Add registerSounds method declaration --- soundjs/soundjs.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/soundjs/soundjs.d.ts b/soundjs/soundjs.d.ts index f719be5b3..90e50200d 100644 --- a/soundjs/soundjs.d.ts +++ b/soundjs/soundjs.d.ts @@ -177,6 +177,7 @@ declare module createjs { static registerManifest(manifest: Object[], basePath: string): Object; static registerPlugins(plugins: any[]): boolean; static registerSound(src: string | Object, id?: string, data?: number | Object, basePath?: string): Object; + static registerSounds(sounds: Object[], basePath?: string): Object[]; static removeAllSounds(): void; static removeManifest(manifest: any[], basePath: string): Object; static removeSound(src: string | Object, basePath: string): boolean; From ce9ef6f36e1cf68e8486949a8c52330bdb3f795f Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Wed, 25 Mar 2015 16:55:12 +0100 Subject: [PATCH 181/243] fix capitalization error --- leaflet/leaflet.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index ed6b2dbcf..4696e1f55 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -947,7 +947,7 @@ declare module L { * used in GeoJSON for points. If reverse is set to true, the numbers will be interpreted * as (longitude, latitude). */ - coordsToLatlng(coords: number[], reverse?: boolean): LatLng; + coordsToLatLng(coords: number[], reverse?: boolean): LatLng; /** * Creates a multidimensional array of LatLng objects from a GeoJSON coordinates @@ -955,7 +955,7 @@ declare module L { * 1 for an array of arrays of points, etc., 0 by default). If reverse is set to * true, the numbers will be interpreted as (longitude, latitude). */ - coordsToLatlngs(coords: number[], levelsDeep?: number, reverse?: boolean): LatLng[]; + coordsToLatLngs(coords: number[], levelsDeep?: number, reverse?: boolean): LatLng[]; } export var GeoJSON: GeoJSONStatic; From 1fa293c651fa77b3e5160ccfbcc61526d3b53606 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Wed, 25 Mar 2015 16:55:49 +0100 Subject: [PATCH 182/243] coordsToLatLngs may take number[] or number[][] or number[][][]... --- leaflet/leaflet.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 4696e1f55..efe8f8ebf 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -955,7 +955,7 @@ declare module L { * 1 for an array of arrays of points, etc., 0 by default). If reverse is set to * true, the numbers will be interpreted as (longitude, latitude). */ - coordsToLatLngs(coords: number[], levelsDeep?: number, reverse?: boolean): LatLng[]; + coordsToLatLngs(coords: any[], levelsDeep?: number, reverse?: boolean): any[]; } export var GeoJSON: GeoJSONStatic; From 7e957ea49b987ced50d4ee517cc52ab1c97b24c0 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Wed, 25 Mar 2015 16:56:11 +0100 Subject: [PATCH 183/243] Strip Whitespace --- leaflet/leaflet.d.ts | 868 +++++++++++++++++++++---------------------- 1 file changed, 434 insertions(+), 434 deletions(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index efe8f8ebf..1708a9d10 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -3,7 +3,7 @@ // Definitions by: Vladimir Zotov // Definitions: https://github.com/borisyankov/DefinitelyTyped - + declare module L { export interface AttributionOptions { @@ -13,16 +13,16 @@ declare module L { * Default value: 'bottomright'. */ position?: string; - + /** * The HTML text shown before the attributions. Pass false to disable. * Default value: 'Powered by Leaflet'. */ prefix?: string; - + } } - + declare module L { /** @@ -56,49 +56,49 @@ declare module L { * Extends the bounds to contain the given point. */ extend(point: Point): void; - + /** * Returns the center point of the bounds. */ getCenter(): Point; - + /** * Returns true if the rectangle contains the given one. */ contains(otherBounds: Bounds): boolean; - + /** * Returns true if the rectangle contains the given point. */ contains(point: Point): boolean; - + /** * Returns true if the rectangle intersects the given bounds. */ intersects(otherBounds: Bounds): boolean; - + /** * Returns true if the bounds are properly initialized. */ isValid(): boolean; - + /** * Returns the size of the given bounds. */ getSize(): Point; - + /** * The top left corner of the rectangle. */ min: Point; - + /** * The bottom right corner of the rectangle. */ max: Point; } } - + declare module L { module Browser { @@ -107,73 +107,73 @@ declare module L { * true for all Internet Explorer versions. */ export var ie: boolean; - + /** * true for Internet Explorer 6. */ export var ie6: boolean; - + /** * true for Internet Explorer 6. */ export var ie7: boolean; - + /** * true for webkit-based browsers like Chrome and Safari (including mobile * versions). */ export var webkit: boolean; - + /** * true for webkit-based browsers that support CSS 3D transformations. */ export var webkit3d: boolean; - + /** * true for Android mobile browser. */ export var android: boolean; - + /** * true for old Android stock browsers (2 and 3). */ export var android23: boolean; - + /** * true for modern mobile browsers (including iOS Safari and different Android * browsers). */ export var mobile: boolean; - + /** * true for mobile webkit-based browsers. */ export var mobileWebkit: boolean; - + /** * true for mobile Opera. */ export var mobileOpera: boolean; - + /** * true for all browsers on touch devices. */ export var touch: boolean; - + /** * true for browsers with Microsoft touch model (e.g. IE10). */ export var msTouch: boolean; - + /** * true for devices with Retina screens. */ export var retina: boolean; - + } } - - + + declare module L { /** @@ -196,17 +196,17 @@ declare module L { * Returns the current geographical position of the circle. */ getLatLng(): LatLng; - + /** * Returns the current radius of a circle. Units are in meters. */ getRadius(): number; - + /** * Sets the position of a circle to a new location. */ setLatLng(latlng: LatLng): Circle; - + /** * Sets the radius of a circle. Units are in meters. */ @@ -219,7 +219,7 @@ declare module L { } } - + declare module L { /** @@ -245,7 +245,7 @@ declare module L { * Sets the position of a circle marker to a new location. */ setLatLng(latlng: LatLng): CircleMarker; - + /** * Sets the radius of a circle marker. Units are in pixels. */ @@ -261,24 +261,24 @@ declare module L { declare module L { export interface ClassExtendOptions { /** - * options is a special property that unlike other objects that you pass - * to extend will be merged with the parent one instead of overriding it - * completely, which makes managing configuration of objects and default + * options is a special property that unlike other objects that you pass + * to extend will be merged with the parent one instead of overriding it + * completely, which makes managing configuration of objects and default * values convenient. */ options?: any; /** - * includes is a special class property that merges all specified objects + * includes is a special class property that merges all specified objects * into the class (such objects are called mixins). A good example of this - * is L.Mixin.Events that event-related methods like on, off and fire + * is L.Mixin.Events that event-related methods like on, off and fire * to the class. */ includes?: any; /** - * statics is just a convenience property that injects specified object - * properties as the static properties of the class, useful for defining + * statics is just a convenience property that injects specified object + * properties as the static properties of the class, useful for defining * constants. */ static?: any; @@ -491,7 +491,7 @@ declare module L { export function scale(options?: ScaleOptions): L.Control.Scale; } } - + declare module L { export interface ControlOptions { @@ -505,7 +505,7 @@ declare module L { } } - + declare module L { module CRS { @@ -516,28 +516,28 @@ declare module L { * Map's crs option. */ export var EPSG3857: ICRS; - + /** * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection. */ export var EPSG4326: ICRS; - + /** * Rarely used by some commercial tile providers. Uses Elliptical Mercator * projection. */ export var EPSG3395: ICRS; - + /** * A simple CRS that maps longitude and latitude into x and y directly. May be * used for maps of flat surfaces (e.g. game maps). Note that the y axis should * still be inverted (going from bottom to top). */ export var Simple: ICRS; - + } } - + declare module L { /** @@ -556,7 +556,7 @@ declare module L { export interface DivIcon extends Icon { } } - + declare module L { export interface DivIconOptions { @@ -565,7 +565,7 @@ declare module L { * Size of the icon in pixels. Can be also set through CSS. */ iconSize?: Point; - + /** * The coordinates of the "tip" of the icon (relative to its top left corner). * The icon will be aligned so that this point is at the marker's geographical @@ -573,24 +573,24 @@ declare module L { * with negative margins. */ iconAnchor?: Point; - + /** * A custom class name to assign to the icon. * * Default value: 'leaflet-div-icon'. */ className?: string; - + /** * A custom HTML code to put inside the div element. * * Default value: ''. */ html?: string; - + } } - + declare module L { export interface DomEvent { @@ -601,13 +601,13 @@ declare module L { */ addListener(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent; on(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent; - + /** * Removes an event listener from the element. */ removeListener(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent; off(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent; - + /** * Stop the given event from propagation to parent elements. Used inside the * listener functions: @@ -617,41 +617,41 @@ declare module L { * }); */ stopPropagation(e: Event): DomEvent; - + /** * Prevents the default action of the event from happening (such as following * a link in the href of the a element, or doing a POST request with page reload * when form is submitted). Use it inside listener functions. */ preventDefault(e: Event): DomEvent; - + /** * Does stopPropagation and preventDefault at the same time. */ stop(e: Event): DomEvent; - + /** * Adds stopPropagation to the element's 'click', 'doubleclick', 'mousedown' * and 'touchstart' events. */ disableClickPropagation(el: HTMLElement): DomEvent; - + /** * Gets normalized mouse position from a DOM event relative to the container * or to the whole page if not specified. */ getMousePosition(e: Event, container?: HTMLElement): Point; - + /** * Gets normalized wheel delta from a mousewheel DOM event. */ getWheelDelta(e: Event): number; - + } export var DomEvent: DomEvent; } - + declare module L { module DomUtil { @@ -661,74 +661,74 @@ declare module L { * the element if it was passed directly. */ export function get(id: string): HTMLElement; - + /** * Returns the value for a certain style attribute on an element, including * computed values or values set through CSS. */ export function getStyle(el: HTMLElement, style: string): string; - + /** * Returns the offset to the viewport for the requested element. */ export function getViewportOffset(el: HTMLElement): Point; - + /** * Creates an element with tagName, sets the className, and optionally appends * it to container element. */ export function create(tagName: string, className: string, container?: HTMLElement): HTMLElement; - + /** * Makes sure text cannot be selected, for example during dragging. */ export function disableTextSelection(): void; - + /** * Makes text selection possible again. */ export function enableTextSelection(): void; - + /** * Returns true if the element class attribute contains name. */ export function hasClass(el: HTMLElement, name: string): boolean; - + /** * Adds name to the element's class attribute. */ export function addClass(el: HTMLElement, name: string): void; - + /** * Removes name from the element's class attribute. */ export function removeClass(el: HTMLElement, name: string): void; - + /** * Set the opacity of an element (including old IE support). Value must be from * 0 to 1. */ export function setOpacity(el: HTMLElement, value: number): void; - + /** * Goes through the array of style names and returns the first name that is a valid * style name for an element. If no such name is found, it returns false. Useful * for vendor-prefixed styles like transform. */ export function testProp(props: string[]): any; - + /** * Returns a CSS transform string to move an element by the offset provided in * the given point. Uses 3D translate on WebKit for hardware-accelerated transforms * and 2D on other browsers. */ export function getTranslateString(point: Point): string; - + /** * Returns a CSS transform string to scale an element (with the given scale origin). */ export function getScaleString(scale: number, origin: Point): string; - + /** * Sets the position of an element to coordinates specified by point, using * CSS translate or top/left positioning depending on the browser (used by @@ -736,25 +736,25 @@ declare module L { * if disable3D is true. */ export function setPosition(el: HTMLElement, point: Point, disable3D?: boolean): void; - + /** * Returns the coordinates of an element previously positioned with setPosition. */ export function getPosition(el: HTMLElement): Point; - + /** * Vendor-prefixed transition style name (e.g. 'webkitTransition' for WebKit). */ export var TRANSITION: string; - + /** * Vendor-prefixed transform style name. */ export var TRANSFORM: string; - + } } - + declare module L { /** @@ -778,12 +778,12 @@ declare module L { * Enables the dragging ability. */ enable(): void; - + /** * Disables the dragging ability. */ disable(): void; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): Draggable; @@ -801,10 +801,10 @@ declare module L { on(eventMap: any, context?: any): Draggable; off(eventMap?: any, context?: any): Draggable; } -} - - - +} + + + declare module L { /** @@ -827,23 +827,23 @@ declare module L { * group that has a bindPopup method. */ bindPopup(htmlContent: string, options?: PopupOptions): FeatureGroup; - + /** * Returns the LatLngBounds of the Feature Group (created from bounds and coordinates * of its children). */ getBounds(): LatLngBounds; - + /** * Sets the given path options to each layer of the group that has a setStyle method. */ setStyle(style: PathOptions): FeatureGroup; - + /** * Brings the layer group to the top of all other layers. */ bringToFront(): FeatureGroup; - + /** * Brings the layer group to the bottom of all other layers. */ @@ -857,13 +857,13 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). */ onRemove(map: Map): void; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup; @@ -882,7 +882,7 @@ declare module L { off(eventMap?: any, context?: any): FeatureGroup; } } - + declare module L { export interface FitBoundsOptions extends ZoomPanOptions { @@ -899,14 +899,14 @@ declare module L { /** * The same for bottom right corner of the map. - * + * * Default value: [0, 0]. */ paddingBottomRight?: Point; /** * Equivalent of setting both top left and bottom right padding to the same value. - * + * * Default value: [0, 0]. */ padding?: Point; @@ -919,7 +919,7 @@ declare module L { maxZoom?: number; } } - + declare module L { /** @@ -961,20 +961,20 @@ declare module L { export interface GeoJSON extends FeatureGroup { /** - * Adds a GeoJSON object to the layer. + * Adds a GeoJSON object to the layer. */ addData(data: any): boolean; - + /** * Changes styles of GeoJSON vector layers with the given style function. */ setStyle(style: (featureData: any) => any): GeoJSON; - + /** * Changes styles of GeoJSON vector layers with the given style options. */ setStyle(style: PathOptions): GeoJSON; - + /** * Resets the the given vector layer's style to the original GeoJSON style, * useful for resetting style after hover events. @@ -1017,9 +1017,9 @@ declare module L { } } - - - + + + declare module L { /** @@ -1056,7 +1056,7 @@ declare module L { } } } - + declare module L { export interface IconOptions { @@ -1066,18 +1066,18 @@ declare module L { * path). */ iconUrl?: string; - + /** * The URL to a retina sized version of the icon image (absolute or relative to * your script path). Used for Retina screen devices. */ iconRetinaUrl?: string; - + /** * Size of the icon image in pixels. */ iconSize?: Point; - + /** * The coordinates of the "tip" of the icon (relative to its top left corner). * The icon will be aligned so that this point is at the marker's geographical @@ -1085,43 +1085,43 @@ declare module L { * with negative margins. */ iconAnchor?: Point; - + /** * The URL to the icon shadow image. If not specified, no shadow image will be * created. */ shadowUrl?: string; - + /** * The URL to the retina sized version of the icon shadow image. If not specified, * no shadow image will be created. Used for Retina screen devices. */ shadowRetinaUrl?: string; - + /** * Size of the shadow image in pixels. */ shadowSize?: Point; - + /** * The coordinates of the "tip" of the shadow (relative to its top left corner) * (the same as iconAnchor if not specified). */ shadowAnchor?: Point; - + /** * The coordinates of the point from which popups will "open", relative to the * icon anchor. */ popupAnchor?: Point; - + /** * A custom class name to assign to both icon and shadow images. Empty by default. */ className?: string; } } - + declare module L { export interface IControl { @@ -1132,7 +1132,7 @@ declare module L { * containing the control. Called on map.addControl(control) or control.addTo(map). */ onAdd(map: Map): HTMLElement; - + /** * Optional, should contain all clean up code (e.g. removes control's event * listeners). Called on map.removeControl(control) or control.removeFrom(map). @@ -1141,7 +1141,7 @@ declare module L { onRemove(map: Map): void; } } - + declare module L { export interface ICRS { @@ -1150,35 +1150,35 @@ declare module L { * Projection that this CRS uses. */ projection: IProjection; - + /** * Transformation that this CRS uses to turn projected coordinates into screen * coordinates for a particular tile service. */ transformation: Transformation; - + /** * Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857'). */ code: string; - + /** * Projects geographical coordinates on a given zoom into pixel coordinates. */ latLngToPoint(latlng: LatLng, zoom: number): Point; - + /** * The inverse of latLngToPoint. Projects pixel coordinates on a given zoom * into geographical coordinates. */ pointToLatLng(point: Point, zoom: number): LatLng; - + /** * Projects geographical coordinates into coordinates in units accepted * for this CRS (e.g. meters for EPSG:3857, for passing it to WMS services). */ project(latlng: LatLng): Point; - + /** * Returns the scale used when transforming projected coordinates into pixel * coordinates for a particular zoom. For example, it returns 256 * 2^zoom for @@ -1190,10 +1190,10 @@ declare module L { * Returns the size of the world in pixels for a particular zoom. */ getSize(zoom: number): Point; - + } } - + declare module L { export interface IEventPowered { @@ -1205,7 +1205,7 @@ declare module L { * dblclick'). */ addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): T; - + /** * The same as above except the listener will only get fired once and then removed. */ @@ -1214,29 +1214,29 @@ declare module L { * Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} */ addEventListener(eventMap: any, context?: any): T; - + /** * Removes a previously added listener function. If no function is specified, * it will remove all the listeners of that particular event from the object. */ removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): T; - + /** * Removes a set of type/listener pairs. */ removeEventListener(eventMap?: any, context?: any): T; - + /** * Returns true if a particular event type has some listeners attached to it. */ hasEventListeners(type: string): boolean; - + /** * Fires an event of the specified type. You can optionally provide an data object * — the first argument of the listener function will contain its properties. */ fireEvent(type: string, data?: any): T; - + /** * Removes all listeners to all events on the object. */ @@ -1266,14 +1266,14 @@ declare module L { * Alias to removeEventListener. */ off(eventMap?: any, context?: any): T; - + /** * Alias to fireEvent. */ fire(type: string, data?: any): T; } } - + declare module L { export interface IHandler { @@ -1282,12 +1282,12 @@ declare module L { * Enables the handler. */ enable(): void; - + /** * Disables the handler. */ disable(): void; - + /** * Returns true if the handler is enabled. */ @@ -1298,7 +1298,7 @@ declare module L { initialize(map: Map): void; } } - + declare module L { export interface ILayer { @@ -1309,7 +1309,7 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). @@ -1326,7 +1326,7 @@ declare module L { export var Events: LeafletMixinEvents; } } - + declare module L { /** @@ -1349,7 +1349,7 @@ declare module L { * Adds the overlay to the map. */ addTo(map: Map): ImageOverlay; - + /** * Sets the opacity of the overlay. */ @@ -1358,13 +1358,13 @@ declare module L { /** * Changes the URL of the image. */ - setUrl(imageUrl: string): ImageOverlay; - + setUrl(imageUrl: string): ImageOverlay; + /** * Brings the layer to the top of all overlays. */ bringToFront(): ImageOverlay; - + /** * Brings the layer to the bottom of all overlays. */ @@ -1378,7 +1378,7 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). @@ -1386,7 +1386,7 @@ declare module L { onRemove(map: Map): void; } } - + declare module L { export interface ImageOverlayOptions { @@ -1397,7 +1397,7 @@ declare module L { opacity?: number; } } - + declare module L { export interface IProjection { @@ -1406,14 +1406,14 @@ declare module L { * Projects geographical coordinates into a 2D point. */ project(latlng: LatLng): Point; - + /** * The inverse of project. Projects a 2D point into geographical location. */ unproject(point: Point): LatLng; } } - + declare module L { /** @@ -1427,7 +1427,7 @@ declare module L { */ export function noConflict(): typeof L; } - + declare module L { /** * Creates an object representing a geographical point with the given latitude @@ -1483,29 +1483,29 @@ declare module L { * Haversine formula. See description on wikipedia */ distanceTo(otherLatlng: LatLng): number; - + /** * Returns true if the given LatLng point is at the same position (within a small * margin of error). */ equals(otherLatlng: LatLng): boolean; - + /** * Returns a string representation of the point (for debugging purposes). */ toString(): string; - + /** * Returns a new LatLng object with the longitude wrapped around left and right * boundaries (-180 to 180 by default). */ wrap(left: number, right: number): LatLng; - + /** * Latitude in degrees. */ lat: number; - + /** * Longitude in degrees. */ @@ -1547,7 +1547,7 @@ declare module L { * Extends the bounds to contain the given point. */ extend(latlng: LatLng): LatLngBounds; - + /** * Extends the bounds to contain the given bounds. */ @@ -1557,68 +1557,68 @@ declare module L { * Returns the south-west point of the bounds. */ getSouthWest(): LatLng; - + /** * Returns the north-east point of the bounds. */ getNorthEast(): LatLng; - + /** * Returns the north-west point of the bounds. */ getNorthWest(): LatLng; - + /** * Returns the south-east point of the bounds. */ getSouthEast(): LatLng; - + /** * Returns the center point of the bounds. */ getCenter(): LatLng; - + /** * Returns true if the rectangle contains the given one. */ contains(otherBounds: LatLngBounds): boolean; - + /** * Returns true if the rectangle contains the given point. */ contains(latlng: LatLng): boolean; - + /** * Returns true if the rectangle intersects the given bounds. */ intersects(otherBounds: LatLngBounds): boolean; - + /** * Returns true if the rectangle is equivalent (within a small margin of error) * to the given bounds. */ equals(otherBounds: LatLngBounds): boolean; - + /** * Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' * format. Useful for sending requests to web services that return geo data. */ toBBoxString(): string; - + /** * Returns bigger bounds created by extending the current bounds by a given * percentage in each direction. */ pad(bufferRatio: number): LatLngBounds; - + /** * Returns true if the bounds are properly initialized. */ isValid(): boolean; - + } } - + declare module L { /** @@ -1640,17 +1640,17 @@ declare module L { * Adds the group of layers to the map. */ addTo(map: Map): LayerGroup; - + /** * Adds a given layer to the group. */ addLayer(layer: T): LayerGroup; - + /** * Removes a given layer from the group. */ removeLayer(layer: T): LayerGroup; - + /** * Removes a given layer of the given id from the group. */ @@ -1675,7 +1675,7 @@ declare module L { * Removes all the layers from the group. */ clearLayers(): LayerGroup; - + /** * Iterates over the layers of the group, optionally specifying context of * the iterator function. @@ -1695,7 +1695,7 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). @@ -1703,8 +1703,8 @@ declare module L { onRemove(map: Map): void; } } - - + + declare module L { export interface LayersOptions { @@ -1715,7 +1715,7 @@ declare module L { * Default value: 'topright'. */ position?: string; - + /** * If true, the control will be collapsed into an icon and expanded on mouse hover * or touch. @@ -1723,7 +1723,7 @@ declare module L { * Default value: true. */ collapsed?: boolean; - + /** * If true, the control will assign zIndexes in increasing order to all of its * layers so that the order is preserved when switching them on/off. @@ -1731,10 +1731,10 @@ declare module L { * Default value: true. */ autoZIndex?: boolean; - + } } - + declare module L { export interface LeafletErrorEvent extends LeafletEvent { @@ -1743,14 +1743,14 @@ declare module L { * Error message. */ message: string; - + /** * Error code (if applicable). */ code: number; } } - + declare module L { export interface LeafletEvent { @@ -1766,7 +1766,7 @@ declare module L { target: any; } } - + declare module L { export interface LeafletGeoJSONEvent extends LeafletEvent { @@ -1775,24 +1775,24 @@ declare module L { * The layer for the GeoJSON feature that is being added to the map. */ layer: ILayer; - + /** * GeoJSON properties of the feature. */ properties: any; - + /** * GeoJSON geometry type of the feature. */ geometryType: string; - + /** * GeoJSON ID of the feature (if present). */ id: string; } } - + declare module L { export interface LeafletLayerEvent extends LeafletEvent { @@ -1803,7 +1803,7 @@ declare module L { layer: ILayer; } } - + declare module L { export interface LeafletLocationEvent extends LeafletEvent { @@ -1812,13 +1812,13 @@ declare module L { * Detected geographical location of the user. */ latlng: LatLng; - + /** * Geographical bounds of the area user is located in (with respect to the accuracy * of location). */ bounds: LatLngBounds; - + /** * Accuracy of location in meters. */ @@ -1848,10 +1848,10 @@ declare module L { * The time when the position was acquired. */ timestamp: number; - + } } - + declare module L { export interface LeafletMouseEvent extends LeafletEvent { @@ -1860,26 +1860,26 @@ declare module L { * The geographical point where the mouse event occured. */ latlng: LatLng; - + /** * Pixel coordinates of the point where the mouse event occured relative to * the map layer. */ layerPoint: Point; - + /** * Pixel coordinates of the point where the mouse event occured relative to * the map сontainer. */ containerPoint: Point; - + /** * The original DOM mouse event fired by the browser. */ originalEvent: MouseEvent; } } - + declare module L { export interface LeafletPopupEvent extends LeafletEvent { @@ -1901,7 +1901,7 @@ declare module L { distance: number; } } - + declare module L { export interface LeafletResizeEvent extends LeafletEvent { @@ -1910,14 +1910,14 @@ declare module L { * The old size before resize event. */ oldSize: Point; - + /** * The new size after the resize event. */ newSize: Point; } } - + declare module L { export interface LeafletTileEvent extends LeafletEvent { @@ -1926,14 +1926,14 @@ declare module L { * The tile element (image). */ tile: HTMLElement; - + /** * The source URL of the tile. */ url: string; } } - + declare module L { module LineUtil { @@ -1947,27 +1947,27 @@ declare module L { * released as a separated micro-library Simplify.js. */ export function simplify(points: Point[], tolerance: number): Point[]; - + /** * Returns the distance between point p and segment p1 to p2. */ export function pointToSegmentDistance(p: Point, p1: Point, p2: Point): number; - + /** * Returns the closest point from a point p on a segment p1 to p2. */ export function closestPointOnSegment(p: Point, p1: Point, p2: Point): number; - + /** * Clips the segment a to b by rectangular bounds (modifying the segment points * directly!). Used by Leaflet to only show polyline points that are on the screen * or near, increasing performance. */ export function clipSegment(a: Point, b: Point, bounds: Bounds): void; - + } } - + declare module L { export interface LocateOptions { @@ -1980,7 +1980,7 @@ declare module L { * Default value: false. */ watch?: boolean; - + /** * If true, automatically sets the map view to the user location with respect * to detection accuracy, or to world view if geolocation failed. @@ -1988,14 +1988,14 @@ declare module L { * Default value: false. */ setView?: boolean; - + /** * The maximum zoom for automatic view setting when using `setView` option. * * Default value: Infinity. */ maxZoom?: number; - + /** * Number of millisecond to wait for a response from geolocation before firing * a locationerror event. @@ -2003,7 +2003,7 @@ declare module L { * Default value: 10000. */ timeout?: number; - + /** * Maximum age of detected location. If less than this amount of milliseconds * passed since last geolocation response, locate will return a cached location. @@ -2011,7 +2011,7 @@ declare module L { * Default value: 0. */ maximumAge?: number; - + /** * Enables high accuracy, see description in the W3C spec. * @@ -2020,7 +2020,7 @@ declare module L { enableHighAccuracy?: boolean; } } - + declare module L { /** @@ -2063,17 +2063,17 @@ declare module L { * animation options. */ setView(center: LatLng, zoom?: number, options?: ZoomPanOptions): Map; - + /** * Sets the zoom of the map. */ setZoom(zoom: number, options?: ZoomOptions): Map; - + /** * Increases the zoom of the map by delta (1 by default). */ zoomIn(delta?: number, options?: ZoomOptions): Map; - + /** * Decreases the zoom of the map by delta (1 by default). */ @@ -2084,43 +2084,43 @@ declare module L { * (e.g. used internally for scroll zoom and double-click zoom). */ setZoomAround(latlng: LatLng, zoom: number, options?: ZoomOptions): Map; - + /** * Sets a map view that contains the given geographical bounds with the maximum * zoom level possible. */ fitBounds(bounds: LatLngBounds, options?: FitBoundsOptions): Map; - + /** * Sets a map view that mostly contains the whole world with the maximum zoom * level possible. */ fitWorld(options?: FitBoundsOptions): Map; - + /** * Pans the map to a given center. Makes an animated pan if new center is not more * than one screen away from the current one. */ panTo(latlng: LatLng, options?: PanOptions): Map; - + /** * Pans the map to the closest view that would lie inside the given bounds (if * it's not already). */ panInsideBounds(bounds: LatLngBounds): Map; - + /** * Pans the map by a given number of pixels (animated). */ panBy(point: Point, options?: PanOptions): Map; - + /** * Checks if the map container size changed and updates the map if so — call it * after you've changed the map size dynamically, also animating pan by default. * If options.pan is false, panning will not occur. */ invalidateSize(options: ZoomPanOptions): Map; - + /** * Checks if the map container size changed and updates the map if so — call it * after you've changed the map size dynamically, also animating pan by default. @@ -2132,7 +2132,7 @@ declare module L { * passing the given animation options through to `setView`, if required. */ setMaxBounds(bounds: LatLngBounds, options?: ZoomPanOptions): Map; - + /** * Tries to locate the user using Geolocation API, firing locationfound event * with location data on success or locationerror event on failure, and optionally @@ -2141,7 +2141,7 @@ declare module L { * details. */ locate(options?: LocateOptions): Map; - + /** * Stops watching location previously initiated by map.locate({watch: true}) * and aborts resetting the map view if map.locate was called with {setView: true}. @@ -2152,34 +2152,34 @@ declare module L { * Destroys the map and clears all related event listeners. */ remove(): Map; - + // Methods for Getting Map State /** * Returns the geographical center of the map view. */ getCenter(): LatLng; - + /** * Returns the current zoom of the map view. */ getZoom(): number; - + /** * Returns the minimum zoom level of the map. */ getMinZoom(): number; - + /** * Returns the maximum zoom level of the map. */ getMaxZoom(): number; - + /** * Returns the LatLngBounds of the current map view. */ getBounds(): LatLngBounds; - + /** * Returns the maximum zoom level on which the given bounds fit to the map view * in its entirety. If inside (optional) is set to true, the method instead returns @@ -2187,24 +2187,24 @@ declare module L { * entirety. */ getBoundsZoom(bounds: LatLngBounds, inside?: boolean): number; - + /** * Returns the current size of the map container. */ getSize(): Point; - + /** * Returns the bounds of the current map view in projected pixel coordinates * (sometimes useful in layer and overlay implementations). */ getPixelBounds(): Bounds; - + /** * Returns the projected pixel coordinates of the top left point of the map layer * (useful in custom layer and overlay implementations). */ getPixelOrigin(): Point; - + // Methods for Layers and Controls /** @@ -2212,31 +2212,31 @@ declare module L { * the layer is inserted under all others (useful when switching base tile layers). */ addLayer(layer: ILayer, insertAtTheBottom?: boolean): Map; - + /** * Removes the given layer from the map. */ removeLayer(layer: ILayer): Map; - + /** * Returns true if the given layer is currently added to the map. */ hasLayer(layer: ILayer): boolean; - + /** * Opens the specified popup while closing the previously opened (to make sure * only one is opened at one time for usability). */ openPopup(popup: Popup): Map; - + /** - * Creates a popup with the specified options and opens it in the given point + * Creates a popup with the specified options and opens it in the given point * on a map. */ openPopup(html: string, latlng: LatLng, options?: PopupOptions): Map; - + /** - * Creates a popup with the specified options and opens it in the given point + * Creates a popup with the specified options and opens it in the given point * on a map. */ openPopup(el: HTMLElement, latlng: LatLng, options?: PopupOptions): Map; @@ -2245,17 +2245,17 @@ declare module L { * Closes the popup previously opened with openPopup (or the given one). */ closePopup(popup?: Popup): Map; - + /** * Adds the given control to the map. */ addControl(control: IControl): Map; - + /** * Removes the given control from the map. */ removeControl(control: IControl): Map; - + // Conversion Methods /** @@ -2263,116 +2263,116 @@ declare module L { * (useful for placing overlays on the map). */ latLngToLayerPoint(latlng: LatLng): Point; - + /** * Returns the geographical coordinates of a given map layer point. */ layerPointToLatLng(point: Point): LatLng; - + /** * Converts the point relative to the map container to a point relative to the * map layer. */ containerPointToLayerPoint(point: Point): Point; - + /** * Converts the point relative to the map layer to a point relative to the map * container. */ layerPointToContainerPoint(point: Point): Point; - + /** * Returns the map container point that corresponds to the given geographical * coordinates. */ latLngToContainerPoint(latlng: LatLng): Point; - + /** * Returns the geographical coordinates of a given map container point. */ containerPointToLatLng(point: Point): LatLng; - + /** * Projects the given geographical coordinates to absolute pixel coordinates * for the given zoom level (current zoom level by default). */ project(latlng: LatLng, zoom?: number): Point; - + /** * Projects the given absolute pixel coordinates to geographical coordinates * for the given zoom level (current zoom level by default). */ unproject(point: Point, zoom?: number): LatLng; - + /** * Returns the pixel coordinates of a mouse click (relative to the top left corner * of the map) given its event object. */ mouseEventToContainerPoint(event: LeafletMouseEvent): Point; - + /** * Returns the pixel coordinates of a mouse click relative to the map layer given * its event object. */ mouseEventToLayerPoint(event: LeafletMouseEvent): Point; - + /** * Returns the geographical coordinates of the point the mouse clicked on given * the click's event object. */ mouseEventToLatLng(event: LeafletMouseEvent): LatLng; - + // Other Methods /** * Returns the container element of the map. */ getContainer(): HTMLElement; - + /** * Returns an object with different map panes (to render overlays in). */ getPanes(): MapPanes; - + // REVIEW: Should we make it more flexible declaring parameter 'fn' as Function? /** * Runs the given callback when the map gets initialized with a place and zoom, * or immediately if it happened already, optionally passing a function context. */ whenReady(fn: (map: Map) => void, context?: any): Map; - + // Properties /** * Map dragging handler (by both mouse and touch). */ dragging: IHandler; - + /** * Touch zoom handler. */ touchZoom: IHandler; - + /** * Double click zoom handler. */ doubleClickZoom: IHandler; - + /** * Scroll wheel zoom handler. */ scrollWheelZoom: IHandler; - + /** * Box (shift-drag with mouse) zoom handler. */ boxZoom: IHandler; - + /** * Keyboard navigation handler. */ keyboard: IHandler; - + /** * Mobile touch hacks (quick tap and touch hold) handler. */ @@ -2421,27 +2421,27 @@ declare module L { * Initial geographical center of the map. */ center?: LatLng; - + /** * Initial map zoom. */ zoom?: number; - + /** * Layers that will be added to the map initially. */ layers?: ILayer[]; - + /** * Minimum zoom level of the map. Overrides any minZoom set on map layers. */ minZoom?: number; - + /** * Maximum zoom level of the map. This overrides any maxZoom set on map layers. */ maxZoom?: number; - + /** * When this option is set, the map restricts the view to the given geographical * bounds, bouncing the user back when he tries to pan outside the view, and also @@ -2449,7 +2449,7 @@ declare module L { * on the map size). To set the restriction dynamically, use setMaxBounds method */ maxBounds?: LatLngBounds; - + /** * Coordinate Reference System to use. Don't change this if you're not sure * what it means. @@ -2457,7 +2457,7 @@ declare module L { * Default value: L.CRS.EPSG3857. */ crs?: ICRS; - + // Interaction Options /** @@ -2466,14 +2466,14 @@ declare module L { * Default value: true. */ dragging?: boolean; - + /** * Whether the map can be zoomed by touch-dragging with two fingers. * * Default value: true. */ touchZoom?: boolean; - + /** * Whether the map can be zoomed by using the mouse wheel. * If passed 'center', it will zoom to the center of the view regardless of @@ -2482,7 +2482,7 @@ declare module L { * Default value: true. */ scrollWheelZoom?: boolean; - + /** * Whether the map can be zoomed in by double clicking on it and zoomed out * by double clicking while holding shift. @@ -2523,7 +2523,7 @@ declare module L { * Default value: true. */ trackResize?: boolean; - + /** * With this option enabled, the map tracks when you pan to another "copy" of * the world and seamlessly jumps to the original one so that all overlays like @@ -2532,14 +2532,14 @@ declare module L { * Default value: false. */ worldCopyJump?: boolean; - + /** * Set it to false if you don't want popups to close when user clicks the map. * * Default value: true. */ closePopupOnClick?: boolean; - + // Keyboard Navigation Options /** @@ -2549,21 +2549,21 @@ declare module L { * Default value: true. */ keyboard?: boolean; - + /** * Amount of pixels to pan when pressing an arrow key. * * Default value: 80. */ keyboardPanOffset?: number; - + /** * Number of zoom levels to change when pressing + or - key. * * Default value: 1. */ keyboardZoomOffset?: number; - + // Panning Inertia Options /** @@ -2574,21 +2574,21 @@ declare module L { * Default value: true. */ inertia?: boolean; - + /** * The rate with which the inertial movement slows down, in pixels/second2. * * Default value: 3000. */ inertiaDeceleration?: number; - + /** * Max speed of the inertial movement, in pixels/second. * * Default value: 1500. */ inertiaMaxSpeed?: number; - + /** * Amount of milliseconds that should pass between stopping the movement and * releasing the mouse or touch to prevent inertial movement. @@ -2596,7 +2596,7 @@ declare module L { * Default value: 32 for touch devices and 14 for the rest. */ inertiaThreshold?: number; - + // Control options /** @@ -2605,14 +2605,14 @@ declare module L { * Default value: true. */ zoomControl?: boolean; - + /** * Whether the attribution control is added to the map by default. * * Default value: true. */ attributionControl?: boolean; - + // Animation options /** @@ -2620,7 +2620,7 @@ declare module L { * browsers that support CSS3 Transitions except Android. */ fadeAnimation?: boolean; - + /** * Whether the tile zoom animation is enabled. By default it's enabled in all * browsers that support CSS3 Transitions except Android. @@ -2650,7 +2650,7 @@ declare module L { bounceAtZoomLimits?: boolean; } } - + declare module L { export interface MapPanes { @@ -2691,7 +2691,7 @@ declare module L { popupPane: HTMLElement; } } - + declare module L { /** @@ -2713,44 +2713,44 @@ declare module L { * Adds the marker to the map. */ addTo(map: Map): Marker; - + /** * Returns the current geographical position of the marker. */ getLatLng(): LatLng; - + /** * Changes the marker position to the given point. */ setLatLng(latlng: LatLng): Marker; - + /** * Changes the marker icon. */ setIcon(icon: Icon): Marker; - + /** * Changes the zIndex offset of the marker. */ setZIndexOffset(offset: number): Marker; - + /** * Changes the opacity of the marker. */ setOpacity(opacity: number): Marker; - + /** * Updates the marker position, useful if coordinates of its latLng object * were changed directly. */ update(): Marker; - + /** * Binds a popup with a particular HTML content to a click on this marker. You * can also open the bound popup with the Marker openPopup method. */ bindPopup(html: string, options?: PopupOptions): Marker; - + /** * Binds a popup with a particular HTML content to a click on this marker. You * can also open the bound popup with the Marker openPopup method. @@ -2767,7 +2767,7 @@ declare module L { * Unbinds the popup previously bound to the marker with bindPopup. */ unbindPopup(): Marker; - + /** * Opens the popup previously bound by the bindPopup method. */ @@ -2776,8 +2776,8 @@ declare module L { /** * Returns the popup previously bound by the bindPopup method. */ - getPopup(): Popup; - + getPopup(): Popup; + /** * Closes the bound popup of the marker if it's opened. */ @@ -2816,13 +2816,13 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). */ onRemove(map: Map): void; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): Marker; @@ -2841,7 +2841,7 @@ declare module L { off(eventMap?: any, context?: any): Marker; } } - + declare module L { export interface MarkerOptions { @@ -2853,7 +2853,7 @@ declare module L { * Default value: new L.Icon.Default(). */ icon?: Icon; - + /** * If false, the marker will not emit mouse events and will act as a part of the * underlying map. @@ -2861,7 +2861,7 @@ declare module L { * Default value: true. */ clickable?: boolean; - + /** * Whether the marker is draggable with mouse/touch or not. * @@ -2875,7 +2875,7 @@ declare module L { * Default value: true. */ keyboard?: boolean; - + /** * Text for the browser tooltip that appear on marker hover (no tooltip by default). * @@ -2889,7 +2889,7 @@ declare module L { * Default value: ''. */ alt?: string; - + /** * By default, marker images zIndex is set automatically based on its latitude. * You this option if you want to put the marker on top of all others (or below), @@ -2898,21 +2898,21 @@ declare module L { * Default value: 0. */ zIndexOffset?: number; - + /** * The opacity of the marker. * * Default value: 1.0. */ opacity?: number; - + /** * If true, the marker will get on top of others when you hover the mouse over it. * * Default value: false. */ riseOnHover?: boolean; - + /** * The z-index offset used for the riseOnHover feature. * @@ -2921,7 +2921,7 @@ declare module L { riseOffset?: number; } } - + declare module L { /** @@ -2964,7 +2964,7 @@ declare module L { toGeoJSON(): any; } } - + declare module L { /** @@ -3005,7 +3005,7 @@ declare module L { toGeoJSON(): any; } } - + declare module L { export interface PanOptions { @@ -3013,14 +3013,14 @@ declare module L { /** * If true, panning will always be animated if possible. If false, it will not * animate panning, either resetting the map view if panning more than a screen - * away, or just setting a new offset for the map pane (except for `panBy` + * away, or just setting a new offset for the map pane (except for `panBy` * which always does the latter). */ animate?: boolean; /** * Duration of animated panning. - * + * * Default value: 0.25. */ duration?: number; @@ -3035,13 +3035,13 @@ declare module L { /** * If true, panning won't fire movestart event on start (used internally for panning inertia). - * + * * Default value: false. */ noMoveStart?: boolean; } } - + declare module L { export interface Path extends ILayer, IEventPowered { @@ -3050,12 +3050,12 @@ declare module L { * Adds the layer to the map. */ addTo(map: Map): Path; - + /** * Binds a popup with a particular HTML content to a click on this path. */ bindPopup(html: string, options?: PopupOptions): Path; - + /** * Binds a popup with a particular HTML content to a click on this path. */ @@ -3070,38 +3070,38 @@ declare module L { * Unbinds the popup previously bound to the path with bindPopup. */ unbindPopup(): Path; - + /** * Opens the popup previously bound by the bindPopup method in the given point, * or in one of the path's points if not specified. */ openPopup(latlng?: LatLng): Path; - + /** * Closes the path's bound popup if it is opened. */ closePopup(): Path; - + /** * Changes the appearance of a Path based on the options in the Path options object. */ setStyle(object: PathOptions): Path; - + /** * Returns the LatLngBounds of the path. */ getBounds(): LatLngBounds; - + /** * Brings the layer to the top of all path layers. */ bringToFront(): Path; - + /** * Brings the layer to the bottom of all path layers. */ bringToBack(): Path; - + /** * Redraws the layer. Sometimes useful after you changed the coordinates that * the path uses. @@ -3115,13 +3115,13 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). */ onRemove(map: Map): void; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): Path; @@ -3181,48 +3181,48 @@ declare module L { * Default value: true. */ stroke?: boolean; - + /** * Stroke color. * * Default value: '#03f'. */ color?: string; - + /** * Stroke width in pixels. * * Default value: 5. */ weight?: number; - + /** * Stroke opacity. * * Default value: 0.5. */ opacity?: number; - + /** * Whether to fill the path with color. Set it to false to disable filling on polygons * or circles. */ fill?: boolean; - + /** * Fill color. * * Default value: same as color. */ fillColor?: string; - + /** * Fill opacity. * * Default value: 0.2. */ fillOpacity?: number; - + /** * A string that defines the stroke dash pattern. Doesn't work on canvas-powered * layers (e.g. Android 2). @@ -3242,7 +3242,7 @@ declare module L { * Default: null. */ lineJoin?: string; - + /** * If false, the vector will not emit mouse events and will act as a part of the * underlying map. @@ -3262,10 +3262,10 @@ declare module L { * Default value: ''. */ className?: string; - + } } - + declare module L { /** @@ -3288,48 +3288,48 @@ declare module L { * Returns the result of addition of the current and the given points. */ add(otherPoint: Point): Point; - + /** * Returns the result of subtraction of the given point from the current. */ subtract(otherPoint: Point): Point; - + /** * Returns the result of multiplication of the current point by the given number. */ multiplyBy(number: number): Point; - + /** * Returns the result of division of the current point by the given number. If * optional round is set to true, returns a rounded result. */ divideBy(number: number, round?: boolean): Point; - + /** * Returns the distance between the current and the given points. */ distanceTo(otherPoint: Point): number; - + /** * Returns a copy of the current point. */ clone(): Point; - + /** * Returns a copy of the current point with rounded coordinates. */ round(): Point; - + /** * Returns true if the given point has the same coordinates. */ equals(otherPoint: Point): boolean; - + /** * Returns a string representation of the point for debugging purposes. */ toString(): string; - + /** * The x coordinate. */ @@ -3341,7 +3341,7 @@ declare module L { y: number; } } - + declare module L { /** @@ -3369,7 +3369,7 @@ declare module L { export interface Polygon extends Polyline { } } - + declare module L { /** @@ -3392,24 +3392,24 @@ declare module L { * Adds a given point to the polyline. */ addLatLng(latlng: LatLng): Polyline; - + /** * Replaces all the points in the polyline with the given array of geographical * points. */ setLatLngs(latlngs: LatLng[]): Polyline; - + /** * Returns an array of the points in the path. */ getLatLngs(): LatLng[]; - + /** * Allows adding, removing or replacing points in the polyline. Syntax is the * same as in Array#splice. Returns the array of removed points (if any). */ spliceLatLngs(index: number, pointsToRemove: number, ...latlngs: LatLng[]): LatLng[]; - + /** * Returns the LatLngBounds of the polyline. */ @@ -3421,7 +3421,7 @@ declare module L { toGeoJSON(): any; } } - + declare module L { export interface PolylineOptions { @@ -3433,7 +3433,7 @@ declare module L { * Default value: 1.0. */ smoothFactor?: number; - + /** * Disabled polyline clipping. * @@ -3442,7 +3442,7 @@ declare module L { noClip?: boolean; } } - + declare module L { module PolyUtil { @@ -3456,7 +3456,7 @@ declare module L { export function clipPolygon(points: Point[], bounds: Bounds): Point[]; } } - + declare module L { /** @@ -3481,17 +3481,17 @@ declare module L { * Adds the popup to the map. */ addTo(map: Map): Popup; - + /** * Adds the popup to the map and closes the previous one. The same as map.openPopup(popup). */ openOn(map: Map): Popup; - + /** * Sets the geographical point where the popup will open. */ setLatLng(latlng: LatLng): Popup; - + /** * Returns the geographical point of popup. */ @@ -3521,7 +3521,7 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). @@ -3535,7 +3535,7 @@ declare module L { update(): Popup; } } - + declare module L { export interface PopupOptions { @@ -3546,20 +3546,20 @@ declare module L { * Default value: 300. */ maxWidth?: number; - + /** * Min width of the popup. * * Default value: 50. */ minWidth?: number; - + /** * If set, creates a scrollable container of the given height inside a popup * if its content exceeds it. */ maxHeight?: number; - + /** * Set it to false if you don't want the map to do panning animation to fit the opened * popup. @@ -3567,14 +3567,14 @@ declare module L { * Default value: true. */ autoPan?: boolean; - + /** * Controls the presense of a close button in the popup. * * Default value: true. */ closeButton?: boolean; - + /** * The offset of the popup position. Useful to control the anchor of the popup * when opening it on some overlays. @@ -3598,7 +3598,7 @@ declare module L { * Default value: null. */ autoPanPaddingBottomRight?: Point; - + /** * The margin between the popup and the edges of the map view after autopanning * was performed. @@ -3606,7 +3606,7 @@ declare module L { * Default value: new Point(5, 5). */ autoPanPadding?: Point; - + /** * Whether to animate the popup on zoom. Disable it if you have problems with * Flash content inside popups. @@ -3616,14 +3616,14 @@ declare module L { zoomAnimation?: boolean; /** - * Set it to false if you want to override the default behavior of the popup + * Set it to false if you want to override the default behavior of the popup * closing when user clicks the map (set globally by the Map closePopupOnClick * option). */ closeOnClick?: boolean; } } - + declare module L { export interface PosAnimationStatic extends ClassStatic { @@ -3641,7 +3641,7 @@ declare module L { * of the cubic bezier curve, 0.5 by default) */ run(element: HTMLElement, newPos: Point, duration?: number, easeLinearity?: number): PosAnimation; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): PosAnimation; @@ -3660,7 +3660,7 @@ declare module L { off(eventMap?: any, context?: any): PosAnimation; } } - + declare module L { module Projection { @@ -3671,14 +3671,14 @@ declare module L { * is a sphere. Used by the EPSG:3857 CRS. */ export var SphericalMercator: IProjection; - + /** * Elliptical Mercator projection — more complex than Spherical Mercator. * Takes into account that Earth is a geoid, not a perfect sphere. Used by the * EPSG:3395 CRS. */ export var Mercator: IProjection; - + /** * Equirectangular, or Plate Carree projection — the most simple projection, * mostly used by GIS enthusiasts. Directly maps x as longitude, and y as latitude. @@ -3688,7 +3688,7 @@ declare module L { export var LonLat: IProjection; } } - + declare module L { /** @@ -3713,8 +3713,8 @@ declare module L { setBounds(bounds: LatLngBounds): Rectangle; } } - - + + declare module L { export interface ScaleOptions { @@ -3724,26 +3724,26 @@ declare module L { * Default value: 'bottomleft'. */ position?: string; - + /** * Maximum width of the control in pixels. The width is set dynamically to show * round values (e.g. 100, 200, 500). * Default value: 100. */ maxWidth?: number; - + /** * Whether to show the metric scale line (m/km). * Default value: true. */ metric?: boolean; - + /** * Whether to show the imperial scale line (mi/ft). * Default value: true. */ imperial?: boolean; - + /** * If true, the control is updated on moveend, otherwise it's always up-to-date * (updated on move). @@ -3752,7 +3752,7 @@ declare module L { updateWhenIdle?: boolean; } } - + declare module L { export interface TileLayerStatic extends ClassStatic { @@ -3784,32 +3784,32 @@ declare module L { * Adds the layer to the map. */ addTo(map: Map): TileLayer; - + /** * Brings the tile layer to the top of all tile layers. */ bringToFront(): TileLayer; - + /** * Brings the tile layer to the bottom of all tile layers. */ bringToBack(): TileLayer; - + /** * Changes the opacity of the tile layer. */ setOpacity(opacity: number): TileLayer; - + /** * Sets the zIndex of the tile layer. */ setZIndex(zIndex: number): TileLayer; - + /** * Causes the layer to clear all the tiles and request them again. */ redraw(): TileLayer; - + /** * Updates the layer's URL template and redraws it. */ @@ -3828,13 +3828,13 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). */ onRemove(map: Map): void; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): TileLayer; @@ -3879,7 +3879,7 @@ declare module L { } export interface TileLayerFactory { - + /** * Instantiates a tile layer object given a URL template and optionally an options * object. @@ -3900,7 +3900,7 @@ declare module L { export var tileLayer: TileLayerFactory; } - + declare module L { export interface TileLayerOptions { @@ -3911,7 +3911,7 @@ declare module L { * Default value: 0. */ minZoom?: number; - + /** * Maximum zoom number. * @@ -3927,14 +3927,14 @@ declare module L { * Default value: null. */ maxNativeZoom?: number; - + /** * Tile size (width and height in pixels, assuming tiles are square). * * Default value: 256. */ tileSize?: number; - + /** * Subdomains of the tile service. Can be passed in the form of one string (where * each letter is a subdomain name) or an array of strings. @@ -3942,14 +3942,14 @@ declare module L { * Default value: 'abc'. */ subdomains?: string[]; - + /** * URL to the tile image to show in place of the tile that failed to load. * * Default value: ''. */ errorTileUrl?: string; - + /** * e.g. "© CloudMade" — the string used by the attribution control, describes * the layer data. @@ -3957,14 +3957,14 @@ declare module L { * Default value: ''. */ attribution?: string; - + /** * If true, inverses Y axis numbering for tiles (turn this on for TMS services). * * Default value: false. */ tms?: boolean; - + /** * If set to true, the tile coordinates won't be wrapped by world width (-180 * to 180 longitude) or clamped to lie within world height (-90 to 90). Use this @@ -3974,7 +3974,7 @@ declare module L { * Default value: false. */ continuousWorld?: boolean; - + /** * If set to true, the tiles just won't load outside the world width (-180 to 180 * longitude) instead of repeating. @@ -3982,14 +3982,14 @@ declare module L { * Default value: false. */ noWrap?: boolean; - + /** * The zoom number used in tile URLs will be offset with this value. * * Default value: 0. */ zoomOffset?: number; - + /** * If set to true, the zoom number used in tile URLs will be reversed (maxZoom * - zoom instead of zoom) @@ -3997,31 +3997,31 @@ declare module L { * Default value: false. */ zoomReverse?: boolean; - + /** * The opacity of the tile layer. * * Default value: 1.0. */ opacity?: number; - + /** * The explicit zIndex of the tile layer. Not set by default. */ zIndex?: number; - + /** * If true, all the tiles that are not visible after panning are removed (for * better performance). true by default on mobile WebKit, otherwise false. */ unloadInvisibleTiles?: boolean; - + /** * If false, new tiles are loaded during panning, otherwise only after it (for * better performance). true by default on mobile WebKit, otherwise false. */ updateWhenIdle?: boolean; - + /** * If true and user is on a retina display, it will request four tiles of half the * specified size and a bigger zoom level in place of one to utilize the high resolution. @@ -4029,7 +4029,7 @@ declare module L { * Default value: false. */ detectRetina?: boolean; - + /** * If true, all the tiles that are not visible after panning are placed in a reuse * queue from which they will be fetched when new tiles become visible (as opposed @@ -4058,7 +4058,7 @@ declare module L { * Only accepts real L.Point instances, not arrays. */ transform(point: Point, scale?: number): Point; - + /** * Returns the reverse transformation of the given point, optionally divided * by the given scale. Only accepts real L.Point instances, not arrays. @@ -4066,7 +4066,7 @@ declare module L { untransform(point: Point, scale?: number): Point; } } - + declare module L { module Util { @@ -4076,18 +4076,18 @@ declare module L { * and returns the latter. Has an L.extend shortcut. */ export function extend(dest: any, ...sources: any[]): any; - + /** * Returns a function which executes function fn with the given scope obj (so * that this keyword refers to obj inside the function code). Has an L.bind shortcut. */ export function bind(fn: T, obj: any): T; - + /** * Applies a unique key to the object and returns that key. Has an L.stamp shortcut. */ export function stamp(obj: any): string; - + /** * Returns a wrapper around the function fn that makes sure it's called not more * often than a certain time interval time, but as fast as possible otherwise @@ -4096,46 +4096,46 @@ declare module L { * be called. */ export function limitExecByInterval(fn: T, time: number, context?: any): T; - + /** * Returns a function which always returns false. */ export function falseFn(): () => boolean; - + /** * Returns the number num rounded to digits decimals. */ export function formatNum(num: number, digits: number): number; - + /** * Trims and splits the string on whitespace and returns the array of parts. */ export function splitWords(str: string): string[]; - + /** * Merges the given properties to the options of the obj object, returning the * resulting options. See Class options. Has an L.setOptions shortcut. */ export function setOptions(obj: any, options: any): any; - + /** * Converts an object into a parameter URL string, e.g. {a: "foo", b: "bar"} * translates to '?a=foo&b=bar'. */ export function getParamString(obj: any): string; - + /** * Simple templating facility, creates a string by applying the values of the * data object of a form {a: 'foo', b: 'bar', …} to a template string of the form * 'Hello {a}, {b}' — in this example you will get 'Hello foo, bar'. */ export function template(str: string, data: any): string; - + /** * Returns true if the given object is an array. */ export function isArray(obj: any): boolean; - + /** * Trims the whitespace from both ends of the string and returns the result. */ @@ -4149,8 +4149,8 @@ declare module L { export var emptyImageUrl: string; } } - - + + declare module L { export interface WMSOptions { @@ -4161,37 +4161,37 @@ declare module L { * Default value: ''. */ layers?: string; - + /** * Comma-separated list of WMS styles. * * Default value: 'image/jpeg'. */ styles?: string; - + /** * WMS image format (use 'image/png' for layers with transparency). * * Default value: false. */ format?: string; - + /** * If true, the WMS service will return images with transparency. * * Default value: '1.1.1'. */ transparent?: boolean; - + /** * Version of the WMS service to use. */ version?: string; - + } } - - + + declare module L { export interface ZoomOptions { @@ -4204,7 +4204,7 @@ declare module L { position?: string; } } - + declare module L { export interface ZoomPanOptions { @@ -4237,10 +4237,10 @@ declare module L { debounceMoveend?: boolean; } } - + /** - * Forces Leaflet to use the Canvas back-end (if available) for vector layers - * instead of SVG. This can increase performance considerably in some cases + * Forces Leaflet to use the Canvas back-end (if available) for vector layers + * instead of SVG. This can increase performance considerably in some cases * (e.g. many thousands of circle markers on the map). */ declare var L_PREFER_CANVAS: boolean; @@ -4251,11 +4251,11 @@ declare var L_PREFER_CANVAS: boolean; declare var L_NO_TOUCH: boolean; /** - * Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning + * Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning * (which may cause glitches in some rare environments) even if they're supported. */ declare var L_DISABLE_3D: boolean; - + declare module "leaflet" { export = L; } From 609b0436871f42a8a5ff13ed3104ee688ec55538 Mon Sep 17 00:00:00 2001 From: ray Date: Wed, 25 Mar 2015 13:14:20 -0400 Subject: [PATCH 184/243] adding def for loggly --- loggly/loggly-tests.ts | 12 ++++++++++++ loggly/loggly-tests.ts.tscparams | 1 + loggly/loggly.d.ts | 25 +++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 loggly/loggly-tests.ts create mode 100644 loggly/loggly-tests.ts.tscparams create mode 100644 loggly/loggly.d.ts diff --git a/loggly/loggly-tests.ts b/loggly/loggly-tests.ts new file mode 100644 index 000000000..bf022999f --- /dev/null +++ b/loggly/loggly-tests.ts @@ -0,0 +1,12 @@ +/// +import loggly = require("loggly"); + +var options: loggly.LogglyOptions = { + token: "YOUR_TOKEN", + subdomain: "YOUR_DOMAIN", + tags: ["NodeJS"], + json: true +}; + +var client: loggly.Loggly = loggly.createClient(options) +client.log('hello world'); diff --git a/loggly/loggly-tests.ts.tscparams b/loggly/loggly-tests.ts.tscparams new file mode 100644 index 000000000..5f84b9777 --- /dev/null +++ b/loggly/loggly-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs --target es5 diff --git a/loggly/loggly.d.ts b/loggly/loggly.d.ts new file mode 100644 index 000000000..40724f855 --- /dev/null +++ b/loggly/loggly.d.ts @@ -0,0 +1,25 @@ +// Type definitions for loggly 1.0.8 +// Project: https://github.com/nodejitsu/node-loggly +// Definitions by: Ray Martone +// Definitions: https://github.com/borisyankov/DefinitelyTyped +declare module "loggly" { + + interface LogglyOptions { + token: string; + subdomain: string; + tags?: string[]; + json?: boolean; + host?: string; + auth?: { + username: string; + password: string; + } + } + + interface Loggly { + log(message: any, tags?: string[], callback?: (err: any, results: any) => void): void; + log(message: any, callback?: (err: any, results: any) => void): void; + } + + function createClient(options: LogglyOptions): Loggly; +} From 775c2cbc24f54eae286017f5915f5ebd8255603d Mon Sep 17 00:00:00 2001 From: Michael Hohl Date: Thu, 26 Mar 2015 10:26:58 +0100 Subject: [PATCH 185/243] Model extends NodeJS.EventEmitter - see #3968 --- mongoose/mongoose.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index 8c60b638f..fedd8fec6 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -128,7 +128,7 @@ declare module "mongoose" { versionKey?: boolean; } - export interface Model { + export interface Model extends NodeJS.EventEmitter { new(doc: Object): T; aggregate(...aggregations: Object[]): Aggregate; From 16f4b2bad2b278c5619c521e2fea46bd192a30a5 Mon Sep 17 00:00:00 2001 From: progre Date: Thu, 26 Mar 2015 22:02:03 +0900 Subject: [PATCH 186/243] fix ClientResponse to IncommingMessage --- node/node.d.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 3838a2952..471cfd23b 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -340,14 +340,18 @@ declare module "http" { end(str: string, encoding?: string, cb?: Function): void; end(data?: any, encoding?: string): void; } - export interface ClientResponse extends events.EventEmitter, stream.Readable { - statusCode: number; + export interface IncomingMessage extends events.EventEmitter, stream.Readable { httpVersion: string; headers: any; + rawHeaders: string[]; trailers: any; - setEncoding(encoding?: string): void; - pause(): void; - resume(): void; + rawTrailers: any; + setTimeout(msecs: number, callback: Function): NodeJS.Timer; + method: string; + url: string; + statusCode: number; + statusMessage: string; + socket: net.Socket; } export interface AgentOptions { @@ -392,8 +396,8 @@ declare module "http" { }; export function createServer(requestListener?: (request: ServerRequest, response: ServerResponse) =>void ): Server; export function createClient(port?: number, host?: string): any; - export function request(options: any, callback?: Function): ClientRequest; - export function get(options: any, callback?: Function): ClientRequest; + export function request(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; + export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; export var globalAgent: Agent; } @@ -563,8 +567,8 @@ declare module "https" { }; export interface Server extends tls.Server { } export function createServer(options: ServerOptions, requestListener?: Function): Server; - export function request(options: RequestOptions, callback?: (res: http.ClientResponse) =>void ): http.ClientRequest; - export function get(options: RequestOptions, callback?: (res: http.ClientResponse) =>void ): http.ClientRequest; + export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; + export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; export var globalAgent: Agent; } From 4f1e6ccc1b29593113e6eb9672fb27cc88d1c1ad Mon Sep 17 00:00:00 2001 From: progre Date: Thu, 26 Mar 2015 22:07:01 +0900 Subject: [PATCH 187/243] add ClientResponse for compatibility --- node/node.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 471cfd23b..0e2aceb28 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -353,6 +353,10 @@ declare module "http" { statusMessage: string; socket: net.Socket; } + /** + * @deprecated Use IncomingMessage + */ + export interface ClientResponse extends IncomingMessage { } export interface AgentOptions { /** From f5855b4d5b3903e999e880fcf0e47eeccd8b5ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20M=C3=BCnch?= Date: Thu, 26 Mar 2015 14:37:10 +0100 Subject: [PATCH 188/243] restangular: Add missing save method --- restangular/restangular.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/restangular/restangular.d.ts b/restangular/restangular.d.ts index 8b8fd9d2f..c3a1178bf 100644 --- a/restangular/restangular.d.ts +++ b/restangular/restangular.d.ts @@ -113,6 +113,7 @@ declare module restangular { options(queryParams?: any, headers?: any): IPromise; patch(queryParams?: any, headers?: any): IPromise; withHttpConfig(httpConfig: IRequestConfig): IElement; + save(queryParams?: any, headers?: any): IPromise; getRestangularUrl(): string; } From b707d6fbddb55e5f6b8f8fce37406e2b76b6c5c0 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Thu, 26 Mar 2015 14:08:35 -0400 Subject: [PATCH 189/243] Add Drop.createContext typing --- drop/drop.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drop/drop.d.ts b/drop/drop.d.ts index 18568afdd..e3615d510 100644 --- a/drop/drop.d.ts +++ b/drop/drop.d.ts @@ -9,6 +9,12 @@ declare module drop { interface DropStatic { new(options: IDropOptions): Drop; + createContext(options: IDropContextOptions): DropStatic; + } + + interface IDropContextOptions { + classPrefix?: string; + defaults?: IDropOptions; } interface IDropOptions { From 300d87447e61fd5e153bec8ec08333b9ce597651 Mon Sep 17 00:00:00 2001 From: Sam Herrmann Date: Thu, 26 Mar 2015 22:34:59 -0400 Subject: [PATCH 190/243] Add missing plain and clone method to restangular IElement See https://github.com/mgonto/restangular#element-methods for documentation on the methods. --- restangular/restangular-tests.ts | 3 +++ restangular/restangular.d.ts | 2 ++ 2 files changed, 5 insertions(+) diff --git a/restangular/restangular-tests.ts b/restangular/restangular-tests.ts index 11d7a086d..82dfcd805 100644 --- a/restangular/restangular-tests.ts +++ b/restangular/restangular-tests.ts @@ -82,6 +82,9 @@ myApp.controller('TestCtrl', ( Restangular.one('accounts', 123).getList('buildings'); Restangular.one('accounts', 123).getList('buildings'); + var accountData = Restangular.one('accounts', 123).plain(); + var accountClone: restangular.IElement = Restangular.one('accounts', 123).clone(); + baseAccounts.getList().then(function (accounts) { var firstAccount = accounts[0]; $scope.buildings = firstAccount.getList("buildings"); diff --git a/restangular/restangular.d.ts b/restangular/restangular.d.ts index 8b8fd9d2f..84f167302 100644 --- a/restangular/restangular.d.ts +++ b/restangular/restangular.d.ts @@ -112,6 +112,8 @@ declare module restangular { trace(queryParams?: any, headers?: any): IPromise; options(queryParams?: any, headers?: any): IPromise; patch(queryParams?: any, headers?: any): IPromise; + clone(): IElement; + plain(): any; withHttpConfig(httpConfig: IRequestConfig): IElement; getRestangularUrl(): string; } From 7dd54357a8e379e5ee55f75d3b71a30fa316115e Mon Sep 17 00:00:00 2001 From: progre Date: Fri, 27 Mar 2015 19:42:43 +0900 Subject: [PATCH 191/243] fix ServerRequest to IncomingMessage --- node/node.d.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 0e2aceb28..519612380 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -282,15 +282,10 @@ declare module "http" { address(): { port: number; family: string; address: string; }; maxHeadersCount: number; } - export interface ServerRequest extends events.EventEmitter, stream.Readable { - method: string; - url: string; - headers: any; - trailers: string; - httpVersion: string; - setEncoding(encoding?: string): void; - pause(): void; - resume(): void; + /** + * @deprecated Use IncomingMessage + */ + export interface ServerRequest extends IncomingMessage { connection: net.Socket; } export interface ServerResponse extends events.EventEmitter, stream.Writable { @@ -398,7 +393,7 @@ declare module "http" { [errorCode: number]: string; [errorCode: string]: string; }; - export function createServer(requestListener?: (request: ServerRequest, response: ServerResponse) =>void ): Server; + export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server; export function createClient(port?: number, host?: string): any; export function request(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; From b552570fb87fbfb016e1905a9d2187c749f70d16 Mon Sep 17 00:00:00 2001 From: progre Date: Fri, 27 Mar 2015 19:55:43 +0900 Subject: [PATCH 192/243] fix ServerRequest to IncomingMessage --- formidable/formidable.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formidable/formidable.d.ts b/formidable/formidable.d.ts index ba0ed8122..d1cbb16f6 100644 --- a/formidable/formidable.d.ts +++ b/formidable/formidable.d.ts @@ -25,7 +25,7 @@ declare module "formidable" { onPart: (part: Part) => void; handlePart(part: Part): void; - parse(req: http.ServerRequest, callback?: (err: any, fields: Fields, files: Files) => any): void; + parse(req: http.IncomingMessage, callback?: (err: any, fields: Fields, files: Files) => any): void; } export interface Fields { From 070ce8218c8ab3f923d96d165e715b92e64dd07f Mon Sep 17 00:00:00 2001 From: kubo-takaichi Date: Sat, 14 Mar 2015 16:54:33 +0900 Subject: [PATCH 193/243] Create files --- knex/knex-test.ts | 3 +++ knex/knex.d.ts | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 knex/knex-test.ts create mode 100644 knex/knex.d.ts diff --git a/knex/knex-test.ts b/knex/knex-test.ts new file mode 100644 index 000000000..c3612f036 --- /dev/null +++ b/knex/knex-test.ts @@ -0,0 +1,3 @@ +/// + +import Knex = require('knex'); diff --git a/knex/knex.d.ts b/knex/knex.d.ts new file mode 100644 index 000000000..17885ec20 --- /dev/null +++ b/knex/knex.d.ts @@ -0,0 +1,36 @@ +// Type definitions for Knex.js +// Project: https://github.com/tgriesser/knex +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "knex" { + interface KnexStatic { + Clients: Clients; + new(): Knex; + } + + interface Knex { + + } + + interface Clients { + "mysql": Function; + "mysql2": Function; + "maria": Function; + "mariadb": Function; + "mariasql": Function; + "oracle": Function; + "pg": Function; + "postgres": Function; + "postgresql": Function; + "sqlite": Function; + "sqlite3": Function; + "strong-oracle": Function; + "websql": Function; + "fdbsql": Function; + } + + + var _: KnexStatic; + export = _; +} From 11d3d8db09de7b03eeca23e472551111be752180 Mon Sep 17 00:00:00 2001 From: kubo_takaichi Date: Fri, 27 Mar 2015 23:48:19 +0900 Subject: [PATCH 194/243] Add sample code --- knex/knex-test.ts | 562 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 561 insertions(+), 1 deletion(-) diff --git a/knex/knex-test.ts b/knex/knex-test.ts index c3612f036..4cd7ec0d7 100644 --- a/knex/knex-test.ts +++ b/knex/knex-test.ts @@ -1,3 +1,563 @@ /// - +/// import Knex = require('knex'); +import _ = require('lodash'); +'use strict'; +// Initializing the Library +var knex = Knex({ + client: 'sqlite3', + connection: { + filename: "./mydb.sqlite" + } +}); + +var knex = Knex({ + client: 'mysql', + connection: { + socketPath : '/path/to/socket.sock', + user : 'your_database_user', + password : 'your_database_password', + database : 'myapp_test' + } +}); + +// Pooling +var knex = Knex({ + client: 'mysql', + connection: { + host : '127.0.0.1', + user : 'your_database_user', + password : 'your_database_password', + database : 'myapp_test' + }, + pool: { + min: 0, + max: 7 + } +}); + +// Migrations +var knex = Knex({ + client: 'mysql', + connection: { + host : '127.0.0.1', + user : 'your_database_user', + password : 'your_database_password', + database : 'myapp_test' + }, + migrations: { + tableName: 'migrations' + } +}); + +// Knex Query Builder +knex.select('title', 'author', 'year').from('books'); +knex.select().table('books'); + +knex.avg('sum_column1').from(function() { + this.sum('column1 as sum_column1').from('t1').groupBy('column1').as('t1') +}).as('ignored_alias'); + +knex.column('title', 'author', 'year').select().from('books'); +knex.column(['title', 'author', 'year']).select().from('books'); +knex.select('*').from('users'); + +knex('users').where({ + first_name: 'Test', + last_name: 'User' +}).select('id'); + +knex('users').where('id', 1); + +knex('users').where(() => { + this.where('id', 1).orWhere('id', '>', 10) +}).orWhere({name: 'Tester'}); + +knex('users').where('votes', '>', 100); + +var subquery = knex('users').where('votes', '>', 100).andWhere('status', 'active').orWhere('name', 'John').select('id'); +knex('accounts').where('id', 'in', subquery); + +knex.select('name').from('users') + .whereIn('id', [1, 2, 3]) + .orWhereIn('id', [4, 5, 6]); + +var subquery = knex.select('id').from('accounts'); +knex.select('name').from('users') + .whereIn('account_id', subquery); + +knex('users') + .where('name', '=', 'John') + .orWhere(function() { + this.where('votes', '>', 100).andWhere('title', '<>', 'Admin'); + }); + +knex('users').whereNotIn('id', [1, 2, 3]); + +knex('users').where('name', 'like', '%Test%').orWhereNotIn('id', [1, 2, 3]); + +knex('users').whereNull('updated_at'); + +knex('users').whereNotNull('created_at'); + +knex('users').whereExists(function() { + this.select('*').from('accounts').whereRaw('users.account_id = accounts.id'); +}); + +knex('users').whereExists(knex.select('*').from('accounts').whereRaw('users.account_id = accounts.id')); + +knex('users').whereNotExists(function() { + this.select('*').from('accounts').whereRaw('users.account_id = accounts.id'); +}); + +knex('users').whereBetween('votes', [1, 100]); + +knex('users').whereNotBetween('votes', [1, 100]); + +knex('users').whereRaw('id = ?', [1]); + +// Join methods +knex('users') + .join('contacts', 'users.id', '=', 'contacts.user_id') + .select('users.id', 'contacts.phone'); + +knex('users') + .join('contacts', 'users.id', 'contacts.user_id') + .select('users.id', 'contacts.phone'); + +knex.select('*').from('users').join('accounts', function() { + this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id') +}); + +knex.select('*').from('users').join('accounts', 'accounts.type', knex.raw('?', ['admin'])); + +knex.from('users').innerJoin('accounts', 'users.id', 'accounts.user_id'); + +knex.table('users').innerJoin('accounts', 'users.id', '=', 'accounts.user_id'); + +knex('users').innerJoin('accounts', function() { + this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id') +}); + +knex.select('*').from('users').leftJoin('accounts', 'users.id', 'accounts.user_id'); + +knex.select('*').from('users').leftJoin('accounts', function() { + this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id') +}); + +knex.select('*').from('users').leftOuterJoin('accounts', 'users.id', 'accounts.user_id'); + +knex.select('*').from('users').leftOuterJoin('accounts', function() { + this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id') +}); + +knex.select('*').from('users').rightJoin('accounts', 'users.id', 'accounts.user_id'); + +knex.select('*').from('users').rightJoin('accounts', function() { + this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id') +}); + +knex.select('*').from('users').rightOuterJoin('accounts', 'users.id', 'accounts.user_id'); + +knex.select('*').from('users').rightOuterJoin('accounts', function() { + this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id') +}); + +knex.select('*').from('users').outerJoin('accounts', 'users.id', 'accounts.user_id'); + +knex.select('*').from('users').outerJoin('accounts', function() { + this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id') +}); + +knex.select('*').from('users').fullOuterJoin('accounts', 'users.id', 'accounts.user_id'); + +knex.select('*').from('users').fullOuterJoin('accounts', function() { + this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id') +}); + +knex.select('*').from('users').crossJoin('accounts', 'users.id', 'accounts.user_id'); + +knex.select('*').from('accounts').joinRaw('natural full join table1').where('id', 1); + +knex.select('*').from('accounts').join(knex.raw('natural full join table1')).where('id', 1); + +knex('customers') + .distinct('first_name', 'last_name') + .select(); + +knex('users').groupBy('count'); + +knex.select('year', knex.raw('SUM(profit)')).from('sales').groupByRaw('year WITH ROLLUP'); + +knex('users').orderBy('name', 'desc'); + +knex.select('*').from('table').orderByRaw('col NULLS LAST DESC'); + +knex('books').insert({title: 'Slaughterhouse Five'}); + +knex('coords').insert([{x: 20}, {y: 30}, {x: 10, y: 20}]); + +knex.insert([{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}], 'id').into('books'); + +knex('books') + .returning('id') + .insert({title: 'Slaughterhouse Five'}); + +knex('books') + .returning('id') + .insert([{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}]); + +knex('books') + .where('published_date', '<', 2000) + .update({ + status: 'archived' + }); + +knex('books').update('title', 'Slaughterhouse Five'); + +knex('accounts') + .where('activated', false) + .del(); + +var someExternalMethod: Function; + +knex.transaction(function(trx) { + knex('books').transacting(trx).insert({name: 'Old Books'}) + .then(function(resp) { + var id = resp[0]; + return someExternalMethod(id, trx); + }) + .then(trx.commit) + .catch(trx.rollback); + +}).then(function() { + console.log('Transaction complete.'); +}).catch(function(err) { + console.error(err); +}); + +knex.transaction(function(trx) { + knex('tableName') + .transacting(trx) + .forUpdate() + .select('*'); + + knex('tableName') + .transacting(trx) + .forShare() + .select('*') +}); + +knex('users').count('active'); + +knex('users').min('age'); + +knex('users').min('age as a'); + +knex('users').max('age'); + +knex('users').max('age as a'); + +knex('users').sum('products'); + +knex('users').sum('products as p'); + +knex('users').avg('age'); + +knex('users').avg('age as a'); + +knex('accounts') + .where('userid', '=', 1) + .increment('balance', 10); + +knex('accounts').where('userid', '=', 1).decrement('balance', 5); + +knex('accounts').truncate(); + +knex.table('users').pluck('id').then(function(ids) { + console.log(ids); +}); + +knex.table('users').first('id', 'name').then(function(row) { + console.log(row); +}); + +// Using trx as a query builder: +knex.transaction(function(trx) { + + var info: any; + var books: any[] = [ + {title: 'Canterbury Tales'}, + {title: 'Moby Dick'}, + {title: 'Hamlet'} + ]; + + return trx + .insert({name: 'Old Books'}, 'id') + .into('catalogues') + .then(function(ids) { + return Promise.map(books, function(book) { + book.catalogue_id = ids[0]; + // Some validation could take place here. + return trx.insert(info).into('books'); + }); + }); +}) +.then(function(inserts) { + console.log(inserts.length + ' new books saved.'); +}) +.catch(function(error) { + // If we get here, that means that neither the 'Old Books' catalogues insert, + // nor any of the books inserts will have taken place. + console.error(error); +}); + +// Using trx as a transaction object: +knex.transaction(function(trx) { + + var info: any; + var books: any[] = [ + {title: 'Canterbury Tales'}, + {title: 'Moby Dick'}, + {title: 'Hamlet'} + ]; + + knex.insert({name: 'Old Books'}, 'id') + .into('catalogues') + .transacting(trx) + .then(function(ids) { + return Promise.map(books, function(book) { + book.catalogue_id = ids[0]; + + // Some validation could take place here. + + return knex.insert(info).into('books').transacting(trx); + }); + }) + .then(trx.commit) + .catch(trx.rollback); +}) +.then(function(inserts) { + console.log(inserts.length + ' new books saved.'); +}) +.catch(function(error) { + // If we get here, that means that neither the 'Old Books' catalogues insert, + // nor any of the books inserts will have taken place. + console.error(error); +}); + +knex.schema.createTable('users', function (table) { + table.increments(); + table.string('name'); + table.timestamps(); +}); + +knex.schema.renameTable('users', 'old_users'); + +knex.schema.dropTable('users'); + +knex.schema.hasTable('users').then(function(exists) { + if (!exists) { + return knex.schema.createTable('users', function(t) { + t.increments('id').primary(); + t.string('first_name', 100); + t.string('last_name', 100); + t.text('bio'); + }); + } +}); + +var tableName: string; +var columnName: string; +knex.schema.hasColumn(tableName, columnName); + +knex.schema.dropTableIfExists('users'); + +knex.schema.table('users', function (table) { + table.dropColumn('name'); + table.string('first_name'); + table.string('last_name'); +}); + +knex.schema.raw("SET sql_mode='TRADITIONAL'") +.table('users', function (table) { + table.dropColumn('name'); + table.string('first_name'); + table.string('last_name'); +}); + +knex('users') + .select(knex.raw('count(*) as user_count, status')) + .where(knex.raw(1)) + .orWhere(knex.raw('status <> ?', [1])) + .groupBy('status'); + + knex.raw('select * from users where id = ?', [1]).then(function(resp) { + // ... + }); + +(() => { + var subcolumn = knex.raw('select avg(salary) from employee where dept_no = e.dept_no') + .wrap('(', ') avg_sal_dept'); + + knex.select('e.lastname', 'e.salary', subcolumn) + .from('employee as e') + .whereRaw('dept_no = e.dept_no'); +})(); + +(() => { + var subcolumn = knex.avg('salary') + .from('employee') + .whereRaw('dept_no = e.dept_no') + .as('avg_sal_dept'); + + knex.select('e.lastname', 'e.salary', subcolumn) + .from('employee as e') + .whereRaw('dept_no = e.dept_no'); +})(); + +var x: number; +knex.select('name').from('users') + .where('id', '>', 20) + .andWhere('id', '<', 200) + .limit(10) + .offset(x) + .then(function(rows: any) { + return _.pluck(rows, 'name'); + }) + .then(function(names: any) { + return knex.select('id').from('nicknames').whereIn('nickname', names); + }) + .then(function(rows) { + console.log(rows); + }) + .catch(function(error) { + console.error(error) + }); + +knex.select('*').from('users').where({name: 'Tim'}) + .then(function(rows) { + return knex.insert({user_id: rows[0].id, name: 'Test'}, 'id').into('accounts'); + }).then(function(id) { + console.log('Inserted Account ' + id); + }).catch(function(error) { + console.error(error); + }); + +knex.insert({id: 1, name: 'Test'}, 'id').into('accounts') + .catch(function(error) { + console.error(error); + }).then(function() { + return knex.select('*').from('accounts').where('id', 1); + }).then(function(rows) { + console.log(rows[0]); + }).catch(function(error) { + console.error(error); + }); + +var query: any; +query.then(function(x: any) { + // doSideEffectsHere(x); + return x; +}); + +knex.select('name').from('users').limit(10).map(function(row: any) { + return row.name; +}).then(function(names) { + console.log(names); +}).catch(function(e) { + console.error(e); +}); + +knex.select('name').from('users').limit(10).reduce(function(memo: any, row: any) { + memo.names.push(row.name); + memo.count++; + return memo; +}, {count: 0, names: []}).then(function(obj) { + console.log(obj); +}).catch(function(e) { + console.error(e); +}); + +knex.select('name').from('users') + .limit(10) + .bind(console) + .then(console.log) + .catch(console.error); + +var values: any[]; +// Without return: +knex.insert(values).into('users') + .then(function() { + return {inserted: true}; + }); + +knex.insert(values).into('users').return({inserted: true}); + +knex.select('name').from('users') + .where('id', '>', 20) + .andWhere('id', '<', 200) + .limit(10) + .offset(x) + .exec(function(err: any, rows: any[]) { + if (err) return console.error(err); + knex.select('id').from('nicknames').whereIn('nickname', _.pluck(rows, 'name')) + .exec(function(err: any, rows: any[]) { + if (err) return console.error(err); + console.log(rows); + }); + }); + +// Retrieve the stream: +var stream = knex.select('*').from('users').stream(); +var writableStream: any; +stream.pipe(writableStream); + +// With options: +var stream = knex.select('*').from('users').stream({highWaterMark: 5}); +stream.pipe(writableStream); + +// Use as a promise: +(() => { + +var stream = knex.select('*').from('users').where(knex.raw('id = ?', [1])).stream(function(stream: any) { + stream.pipe(writableStream); +}).then(function() { + // ... +}).catch(function(e: Error) { + console.error(e); +}); + +})(); + +var stream = knex.select('*').from('users').pipe(writableStream); +var app: any; + +knex.select('*') + .from('users') + .on('query', function(data: any) { + app.log(data); + }) + .then(function() { + // ... + }); + + knex.select('*').from('users').where(knex.raw('id = ?', [1])).toString(); + + knex.select('*').from('users').where(knex.raw('id = ?', [1])).toSQL(); + +// +// Migrations +// +var config = { }; +knex.migrate.make(name, [config]); + +knex.migrate.latest([config]); + +knex.migrate.rollback([config]); + +knex.migrate.currentversion([config]); + +knex.seed.make(name, [config]); + +knex.seed.run([config]); From 837b520227f05ca910cda34d47ca4b84079bd441 Mon Sep 17 00:00:00 2001 From: kubo_takaichi Date: Fri, 27 Mar 2015 23:48:38 +0900 Subject: [PATCH 195/243] Add definitions --- knex/knex.d.ts | 457 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 439 insertions(+), 18 deletions(-) diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 17885ec20..d3216acf9 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -3,33 +3,454 @@ // Definitions by: Qubo // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// +/// + declare module "knex" { - interface KnexStatic { - Clients: Clients; - new(): Knex; + import Promise = require("bluebird"); + import events = require("events"); + + type Callback = Function; + type Client = Function; + type Value = string|number|boolean|Date; + type ColumnName = string|Raw|QueryBuilder; + + module KnexStatic { + interface ConfigStatic { } } + interface KnexStatic { + (config: Config): Knex; + } + + interface Knex extends QueryInterface { } + interface Knex { + (tableName?: string): QueryBuilder; + VERSION: string; + __knex__: string; + raw: RawBuilder; + transaction: (transactionScope: ((trx: Transaction) => void)) => Promise; + destroy(callback: Function): void; + destroy(): Promise; + + client: any; + migrate: any; + seed: any; + fn: any; } - interface Clients { - "mysql": Function; - "mysql2": Function; - "maria": Function; - "mariadb": Function; - "mariasql": Function; - "oracle": Function; - "pg": Function; - "postgres": Function; - "postgresql": Function; - "sqlite": Function; - "sqlite3": Function; - "strong-oracle": Function; - "websql": Function; - "fdbsql": Function; + // + // QueryInterface + // + + interface QueryInterface { + select: Select; + as: As; + columns: Select; + column: Select; + from: Table; + into: Table; + table: Table; + distinct: Distinct; + + // Joins + join: Join; + joinRaw: JoinRaw; + innerJoin: Join; + leftJoin: Join; + leftOuterJoin: Join; + rightJoin: Join; + rightOuterJoin: Join; + outerJoin: Join; + fullOuterJoin: Join; + crossJoin: Join; + + // Wheres + where: Where; + andWhere: Where; + orWhere: Where; + whereRaw: WhereRaw; + whereWrapped: WhereWrapped; + havingWrapped: WhereWrapped; + orWhereRaw: WhereRaw; + whereExists: WhereExists; + orWhereExists: WhereExists; + whereNotExists: WhereExists; + orWhereNotExists: WhereExists; + whereIn: WhereIn; + orWhereIn: WhereIn; + whereNotIn: WhereIn; + orWhereNotIn: WhereIn; + whereNull: WhereNull; + orWhereNull: WhereNull; + whereNotNull: WhereNull; + orWhereNotNull: WhereNull; + whereBetween: WhereBetween; + whereNotBetween: WhereBetween; + orWhereBetween: WhereBetween; + orWhereNotBetween: WhereBetween; + + // Group by + groupBy: GroupBy; + groupByRaw: RawQueryBuilder; + + // Order by + orderBy: OrderBy; + orderByRaw: RawQueryBuilder; + + // Union + union: Union; + unionAll(callback: Function): QueryBuilder; + + // Having + having: Having; + havingRaw: RawQueryBuilder; + orHaving: Having; + orHavingRaw: RawQueryBuilder; + + // Paging + offset(offset: number): QueryBuilder; + limit(limit: number): QueryBuilder; + + // Aggregation + count(columnName?: string): QueryBuilder; + min(columnName: string): QueryBuilder; + max(columnName: string): QueryBuilder; + sum(columnName: string): QueryBuilder; + avg(columnName: string): QueryBuilder; + increment(columnName: string, amount?: number): QueryBuilder; + decrement(columnName: string, amount?: number): QueryBuilder; + + // Others + first(...columns: string[]): QueryBuilder; + + debug(enabled?: boolean): QueryBuilder; + pluck(column: string): QueryBuilder; + + insert(data: any, returning?: string): QueryBuilder; + update(data: any, returning?: string): QueryBuilder; + update(columnName: string, value: Value, returning?: string): QueryBuilder; + returning(column: string): QueryBuilder; + + del(returning?: string): QueryBuilder; + delete(returning?: string): QueryBuilder; + truncate(): QueryBuilder; + + transacting(trx: Transaction): QueryBuilder; + connection(connection: any): QueryBuilder; } + interface As { + (columnName: string): QueryBuilder; + } + + interface Select extends ColumnNameQueryBuilder { + } + + interface Table { + (tableName: string): QueryBuilder; + (callback: Function): QueryBuilder; + } + + interface Distinct extends ColumnNameQueryBuilder { + } + + interface Join { + (raw: Raw): QueryBuilder; + (tableName: string, callback: Function): QueryBuilder; + (tableName: string, column1: string, column2: string): QueryBuilder; + (tableName: string, column1: string, raw: Raw): QueryBuilder; + (tableName: string, column1: string, operator: string, column2: string): QueryBuilder; + } + + interface JoinRaw { + (tableName: string, binding?: Value): QueryBuilder; + } + + interface Where extends WhereRaw, WhereWrapped, WhereNull { + (object: Object): QueryBuilder; + (columnName: string, value: Value): QueryBuilder; + (columnName: string, operator: string, value: Value): QueryBuilder; + (columnName: string, operator: string, query: QueryBuilder): QueryBuilder; + } + + interface WhereRaw extends RawQueryBuilder { + (condition: boolean): QueryBuilder; + } + + interface WhereWrapped { + (callback: Function): QueryBuilder; + } + + interface WhereNull { + (columnName: string): QueryBuilder; + } + + interface WhereIn { + (columnName: string, values: Value[]): QueryBuilder; + (columnName: string, callback: Function): QueryBuilder; + (columnName: string, query: QueryBuilder): QueryBuilder; + } + + interface WhereBetween { + (columnName: string, range: [Value, Value]): QueryBuilder; + } + + interface WhereExists { + (callback: Function): QueryBuilder; + (query: QueryBuilder): QueryBuilder; + } + + interface WhereNull { + (columnName: string): QueryBuilder; + } + + interface WhereIn { + (columnName: string, values: Value[]): QueryBuilder; + } + + interface GroupBy extends RawQueryBuilder, ColumnNameQueryBuilder { + } + + interface OrderBy { + (columnName: string, direction?: string): QueryBuilder; + } + + interface Union { + (callback: Function, wrap?: boolean): QueryBuilder; + (callbacks: Function[], wrap?: boolean): QueryBuilder; + (...callbacks: Function[]): QueryBuilder; + // (...callbacks: Function[], wrap?: boolean): QueryInterface; + } + + interface Having extends RawQueryBuilder, WhereWrapped { + (tableName: string, column1: string, operator: string, column2: string): QueryBuilder; + } + + // commons + + interface ColumnNameQueryBuilder { + (...columnNames: ColumnName[]): QueryBuilder; + (columnNames: ColumnName[]): QueryBuilder; + } + + interface RawQueryBuilder { + (sql: string, ...bindings: Value[]): QueryBuilder; + (sql: string, bindings: Value[]): QueryBuilder; + (raw: Raw): QueryBuilder; + } + + // Raw + + interface Raw extends events.EventEmitter, ChainableInterface { + wrap(before: string, after: string): Raw; + } + + interface RawBuilder { + (value: Value): Raw; + (sql: string, ...bindings: Value[]): Raw; + (sql: string, bindings: Value[]): Raw; + } + + // + // QueryBuilder + // + + interface QueryBuilder extends QueryInterface, ChainableInterface { + or: QueryBuilder; + and: QueryBuilder; + + //TODO: Promise? + columnInfo(column?: string): Promise; + + forUpdate(): QueryBuilder; + forShare(): QueryBuilder; + + toSQL(): Sql; + + on(event: string, callback: Function): QueryBuilder; + } + + interface Sql { + method: string; + options: any; + bindings: Value[]; + sql: string; + } + + // + // Chainable interface + // + + interface ChainableInterface extends Promise { + toQuery(): string; + options(options: any): QueryBuilder; + stream(options?: any, callback?: (builder: QueryBuilder) => any): QueryBuilder; + stream(callback?: (builder: QueryBuilder) => any): QueryBuilder; + pipe(writable: any): QueryBuilder; + exec(callback: Function): QueryBuilder; + } + + interface Transaction extends QueryBuilder { + commit: any; + rollback: any; + } + + // + // Schema builder + // + + interface Knex { + schema: SchemaBuilder; + } + + interface SchemaBuilder { + createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): void; + renameTable(oldTableName: string, newTableName: string): void; + dropTable(tableName: string): void; + hasTable(tableName: string): Promise; + hasColumn(tableName: string, columnName: string): Promise; + table(tableName: string, callback: (tableBuilder: AlterTableBuilder) => any): void; + dropTableIfExists(tableName: string): void; + raw(statement: string): SchemaBuilder; + } + + interface TableBuilder { + increments(columnName?: string): ColumnBuilder; + dropColumn(columnName: string): TableBuilder; + dropColumns(...columnNames: string[]): TableBuilder; + renameColumn(from: string, to: string): ColumnBuilder; + integer(columnName: string): ColumnBuilder; + bigInteger(columnName: string): ColumnBuilder; + text(columnName: string, textType?: string): ColumnBuilder; + string(columnName: string, length?: number): ColumnBuilder; + float(columnName: string, precision?: number, scale?: number): ColumnBuilder; + decimal(columnName: string, precision?: number, scale?: number): ColumnBuilder; + boolean(columnName: string): ColumnBuilder; + date(columnName: string): ColumnBuilder; + dateTime(columnName: string): ColumnBuilder; + time(columnName: string): ColumnBuilder; + timestamp(columnName: string): ColumnBuilder; + timestamps(): ColumnBuilder; + binary(columnName: string): ColumnBuilder; + enum(columnName: string): ColumnBuilder; + enu(columnName: string): ColumnBuilder; + json(columnName: string): ColumnBuilder; + uuid(columnName: string): ColumnBuilder; + comment(val: string): TableBuilder; + specificType(columnName: string, type: string): ColumnBuilder; + } + + interface CreateTableBuilder extends TableBuilder { + } + + interface MySqlTableBuilder extends CreateTableBuilder { + engine(val: string): CreateTableBuilder; + charset(val: string): CreateTableBuilder; + collate(val: string): CreateTableBuilder; + } + + interface AlterTableBuilder extends TableBuilder { + } + + interface MySqlAlterTableBuilder extends AlterTableBuilder { + } + + interface ColumnBuilder { + index(indexName?: string): ColumnBuilder; + primary(): ColumnBuilder; + unique(): ColumnBuilder; + references(columnName: string): ReferencingColumnBuilder; + onDelete(command: string): ColumnBuilder; + onUpdate(command: string): ColumnBuilder; + defaultTo(value: Value): ColumnBuilder; + unsigned(): ColumnBuilder; + notNullable(): ColumnBuilder; + nullable(): ColumnBuilder; + comment(value: string): ColumnBuilder; + } + + interface PostgreSqlColumnBuilder extends ColumnBuilder { + index(indexName?: string, indexType?: string): ColumnBuilder; + } + + interface ReferencingColumnBuilder { + inTable(tableName: string): ColumnBuilder; + } + + interface AlterColumnBuilder extends ColumnBuilder { + } + + interface MySqlAlterColumnBuilder extends AlterColumnBuilder { + first(): AlterColumnBuilder; + after(columnName: string): AlterColumnBuilder; + } + + // + // Configurations + // + + interface ColumnInfo { + defaultValue: Value; + type: string; + maxLength: number; + nullable: boolean; + } + + interface Config { + client?: string; + dialect?: string; + connection: string|ConnectionConfig| + Sqlite3ConnectionConfig|SocketConnectionConfig; + pool?: PoolConfig; + migrations?: MigrationConfig; + } + + interface ConnectionConfig { + host: string; + user: string; + password: string; + database: string; + debug?: boolean; + } + + /** Used with SQLite3 adapter */ + interface Sqlite3ConnectionConfig { + filename: string; + debug?: boolean; + } + + interface SocketConnectionConfig { + socketPath: string; + user: string; + password: string; + database: string; + debug?: boolean; + } + + interface PoolConfig { + name?: string; + create?: Function; + destroy?: Function; + min?: number; + max?: number; + refreshIdle?: boolean; + idleTimeoutMillis?: number; + reapIntervalMillis?: number; + returnToHead?: boolean; + priorityRange?: number; + validate?: Function; + log?: boolean; + } + + interface MigrationConfig { + database?: string; + directory?: string; + extension?: string; + tableName?: string; + } var _: KnexStatic; export = _; From 16b8577157db59d0341b638abc09bd70e2063d37 Mon Sep 17 00:00:00 2001 From: kubo_takaichi Date: Fri, 27 Mar 2015 23:57:27 +0900 Subject: [PATCH 196/243] Modify migration samples --- knex/knex-test.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/knex/knex-test.ts b/knex/knex-test.ts index 4cd7ec0d7..39b441d6b 100644 --- a/knex/knex-test.ts +++ b/knex/knex-test.ts @@ -550,14 +550,20 @@ knex.select('*') // Migrations // var config = { }; -knex.migrate.make(name, [config]); +knex.migrate.make(name, config); +knex.migrate.make(name); -knex.migrate.latest([config]); +knex.migrate.latest(config); +knex.migrate.latest(); -knex.migrate.rollback([config]); +knex.migrate.rollback(config); +knex.migrate.rollback(); -knex.migrate.currentversion([config]); +knex.migrate.currentversion(config); +knex.migrate.currentversion(); -knex.seed.make(name, [config]); +knex.seed.make(name, config); +knex.seed.make(name); -knex.seed.run([config]); +knex.seed.run(config); +knex.seed.run(); From b6b0a561ca03bed639e14b6b616509b2b51a01cd Mon Sep 17 00:00:00 2001 From: Luke William Westby Date: Sat, 28 Mar 2015 13:20:43 -0500 Subject: [PATCH 197/243] added imgur-api typings --- imgur-api/imgur-api-tests.ts | 103 ++++++++++++++ imgur-api/imgur-api.d.ts | 255 +++++++++++++++++++++++++++++++++++ 2 files changed, 358 insertions(+) create mode 100644 imgur-api/imgur-api-tests.ts create mode 100644 imgur-api/imgur-api.d.ts diff --git a/imgur-api/imgur-api-tests.ts b/imgur-api/imgur-api-tests.ts new file mode 100644 index 000000000..beb21f74e --- /dev/null +++ b/imgur-api/imgur-api-tests.ts @@ -0,0 +1,103 @@ +/// + +function testAccount(account: ImgurApi.Account) : ImgurApi.Account { + return account; +} + +function testAccountSettings(accountSettings: ImgurApi.AccountSettings) : ImgurApi.AccountSettings { + return accountSettings; +} + +function testAlbum(album: ImgurApi.Album) : ImgurApi.Album { + return album; +} + +function testAlbumImages(album: ImgurApi.Album) : ImgurApi.Image { + return album.images[0]; +} + +function testComment(comment: ImgurApi.Comment) : ImgurApi.Comment { + return comment; +} + +function testConversation(conversation: ImgurApi.Conversation) : ImgurApi.Conversation { + return conversation; +} + +function testCustomGallery(customGallery: ImgurApi.CustomGallery) : ImgurApi.CustomGallery { + return customGallery; +} + +function testGalleryItem(galleryItem: ImgurApi.GalleryItem) : ImgurApi.GalleryItem { + return galleryItem; +} + +function testGalleryAlbum(galleryItem: ImgurApi.GalleryItem) : ImgurApi.GalleryAlbum { + if(galleryItem.is_album) { + var galleryAlbum = galleryItem; + return galleryAlbum; + } + return null; +} + +function testGalleryImage(galleryItem: ImgurApi.GalleryItem) : ImgurApi.GalleryImage { + if(!galleryItem.is_album) { + var galleryImage = galleryItem; + return galleryImage; + } + return null; +} + +function testGalleryProfile(galleryProfile: ImgurApi.GalleryProfile) : ImgurApi.GalleryProfile { + return galleryProfile; +} + +function testImage(image: ImgurApi.Image) : ImgurApi.Image { + return image; +} + +function testMemeMeta(meta: ImgurApi.MemeMetadata) : ImgurApi.MemeMetadata { + return meta; +} + +function testMessage(message: ImgurApi.Message) : ImgurApi.Message { + return message; +} + +function testAccountNotificationsReply(accountNotif: ImgurApi.AccountNotifications) : ImgurApi.Notification { + return accountNotif.replies[0]; +} + +function testAccountNotificationsMessage(accountNotif: ImgurApi.AccountNotifications) : ImgurApi.Notification { + return accountNotif.messages[0]; +} + +function testTag(tag: ImgurApi.Tag) : ImgurApi.Tag { + return tag; +} + +function testTagVote(tagVote: ImgurApi.TagVote) : ImgurApi.TagVote { + return tagVote; +} + +function testTopic(topic: ImgurApi.Topic) : ImgurApi.Topic { + return topic; +} + +function testVote(vote: ImgurApi.Vote) : ImgurApi.Vote { + return vote; +} + +function testResponseWithError(response: ImgurApi.Response) : ImgurApi.Error { + if(response.success === false) { + return response.data; + } + return null; +} + +function testResponseWithValue(response: ImgurApi.Response) : ImgurApi.GalleryProfile { + if(response.success === true) { + return response.data; + } + return null; +} diff --git a/imgur-api/imgur-api.d.ts b/imgur-api/imgur-api.d.ts new file mode 100644 index 000000000..0f96707ff --- /dev/null +++ b/imgur-api/imgur-api.d.ts @@ -0,0 +1,255 @@ +// Type definitions for Imgur API v3 +// Project: https://api.imgur.com/ +// Definitions by: Luke William Westby +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module ImgurApi { + + interface Response { + data: any; //T|Error; + status: number; + success: boolean; + } + + interface Account { + id: number; + url: string; + bio: string; + reputation: number; + created: number; + pro_expiration: any; //number|boolean; + } + + interface AccountSettings { + email: string; + high_quality: boolean; + public_images: boolean; + album_privacy: string; + pro_expiration: any; //number|boolean; + accepted_gallery_terms: boolean; + active_emails: Array; + messaging_enabled: boolean; + blocked_users: Array; + } + + /** + * This model represents the data for albums + */ + interface Album { + id: string; + title: string; + description: string; + datetime: number; + cover: string; + cover_width: number; + cover_height: number; + account_url?: string; + account_id?: number; + privacy: string; + layout: string; + views: number; + link: string; + favorite: boolean; + nsfw?: boolean; + section: string; + order: number; + deletehash?: string; + images_count: number; + images: Array; + } + + interface BlockedUser { + blocked_id: number; + blocked_url: string; + } + + interface Comment { + id: number; + image_id: string; + comment: string; + author: string; + author_id: number; + on_album: boolean; + album_cover: string; + ups: number; + downs: number; + points: number; + datetime: number; + parent_id: number; + deleted: boolean; + vote?: string; + children: Array + } + + interface Conversation { + id: number; + last_message_preview: string; + datetime: number; + with_account_id: number; + with_account: string; + message_count: number; + messages?: Array; + done?: boolean; + page?: number; + } + + interface CustomGallery { + account_url: string; + link: string; + tags: Array + item_count: number; + items: Array; + } + + interface GalleryItem { + id: string; + title: string; + description: string; + datetime: number; + account_url?: string; + account_id?: number; + ups: number; + downs: number; + score: number; + is_album: boolean; + views: number; + link: string; + vote?: string; + favorite: boolean; + nsfw?: boolean; + comment_count: number; + topic: string; + topic_id: number; + } + + interface GalleryAlbum extends GalleryItem { + cover: string; + cover_width: number; + cover_height: number; + privacy: string; + layout: string; + images_count: number; + images: Array; + } + + interface GalleryImage extends GalleryItem { + type: string; + animated: boolean; + width: number; + height: number; + size: number; + bandwidth: number; + deletehash?: string; + gifv?: string; + mp4?: string; + webm?: string; + looping?: boolean; + section: string; + } + + interface GalleryProfile { + total_gallery_comments: number; + total_gallery_favorites: number; + total_gallery_submissions: number; + trophies: Array; + } + + interface Trophy { + id: number; + name: string; + name_clean: string; + description: string; + data: string; + data_link: string; + datetime: number; + image: string; + } + + interface Image { + id: string; + title: string; + description: string; + datetime: number; + type: string; + animated: boolean; + width: number; + height: number; + size: number; + views: number; + bandwidth: number; + deletehash?: string; + name?: string; + section: string; + link: string; + gifv?: string; + mp4?: string; + webm?: string; + looping?: boolean; + vote?: string; + favorite: boolean; + nsfw?: boolean; + account_url?: string; + account_id?: number; + } + + interface MemeMetadata { + meme_name: string; + top_text: string; + bottom_text: string; + bg_image: string; + } + + interface Message { + id: number; + from: string; + account_id: number; + sender_id: number; + body: string; + conversation_id: number; + datetime: number; + } + + interface Notification { + id: number; + account_id: number; + viewed: boolean; + content: T; + } + + interface AccountNotifications { + replies: Array>; + messages: Array>; + } + + interface Tag { + name: string; + followers: number; + total_items: number; + following?: boolean; + items: Array + } + + interface TagVote { + ups: number; + downs: number; + name: string; + author: string; + } + + interface Topic { + id: number; + name: string; + description: string; + } + + interface Vote { + ups: number; + downs: number; + } + + interface Error { + error: string; + request: string; + method: string; + } +} From 5908e54415e813ab4d175a86a04bf05ef61f01fd Mon Sep 17 00:00:00 2001 From: Luke William Westby Date: Sat, 28 Mar 2015 13:21:50 -0500 Subject: [PATCH 198/243] removing stray doc comment, will add doc comments later --- imgur-api/imgur-api.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/imgur-api/imgur-api.d.ts b/imgur-api/imgur-api.d.ts index 0f96707ff..c25cd8acb 100644 --- a/imgur-api/imgur-api.d.ts +++ b/imgur-api/imgur-api.d.ts @@ -32,9 +32,6 @@ declare module ImgurApi { blocked_users: Array; } - /** - * This model represents the data for albums - */ interface Album { id: string; title: string; From d32982d38d186ed87934862d99e41b5ba58d3ac8 Mon Sep 17 00:00:00 2001 From: Craig Younkins Date: Sat, 28 Mar 2015 14:56:09 -0400 Subject: [PATCH 199/243] Updating Titanium definitions to 3.5.0 --- titanium/titanium.d.ts | 2729 +++++++++++++++++++++++++--------------- 1 file changed, 1745 insertions(+), 984 deletions(-) diff --git a/titanium/titanium.d.ts b/titanium/titanium.d.ts index 5ebe93024..a325611df 100644 --- a/titanium/titanium.d.ts +++ b/titanium/titanium.d.ts @@ -1,33 +1,36 @@ -// Type definitions for Titanium Movile 3.1.3.GA +// Type definitions for Titanium Mobile 3.5.0 // Project: http://www.appcelerator.com/ -// Definitions by: Airam Rguez +// Definitions by: Craig Younkins // Definitions: https://github.com/borisyankov/DefinitelyTyped -// This file has been automatically generated. declare module Ti { + export var apiName : string; export var bubbleParent : boolean; export var buildDate : string; export var buildHash : string; export var userAgent : string; - export var version : number; + export var version : string; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; export function applyProperties (props: Dictionary) : void; export function createBuffer (params: CreateBufferArgs) : Ti.Buffer; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function getBubbleParent () : boolean; export function getBuildDate () : string; export function getBuildHash () : string; export function getUserAgent () : string; - export function getVersion () : number; + export function getVersion () : string; export function include (name: string) : void; export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; export function setBubbleParent (bubbleParent: boolean) : void; export function setUserAgent (userAgent: string) : void; export module XML { + export var apiName : string; export var bubbleParent : boolean; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; export function applyProperties (props: Dictionary) : void; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function getBubbleParent () : boolean; export function parseString (xml: string) : Ti.XML.Document; export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; @@ -175,6 +178,9 @@ declare module Ti { } export interface Text extends Ti.XML.CharacterData { splitText (offset: number) : Ti.XML.Text; + } + export enum Comment { + } export enum DocumentFragment { @@ -184,9 +190,6 @@ declare module Ti { systemId : string; getPublicId () : string; getSystemId () : string; - } - export enum Comment { - } export interface NodeList extends Ti.Proxy { length : number; @@ -349,6 +352,12 @@ declare module Ti { export var TEXT_AUTOCAPITALIZATION_NONE : number; export var TEXT_AUTOCAPITALIZATION_SENTENCES : number; export var TEXT_AUTOCAPITALIZATION_WORDS : number; + export var TEXT_STYLE_BODY : string; + export var TEXT_STYLE_CAPTION1 : string; + export var TEXT_STYLE_CAPTION2 : string; + export var TEXT_STYLE_FOOTNOTE : string; + export var TEXT_STYLE_HEADLINE : string; + export var TEXT_STYLE_SUBHEADLINE : string; export var TEXT_VERTICAL_ALIGNMENT_BOTTOM : any; export var TEXT_VERTICAL_ALIGNMENT_CENTER : any; export var TEXT_VERTICAL_ALIGNMENT_TOP : any; @@ -370,6 +379,7 @@ declare module Ti { export var URL_ERROR_TIMEOUT : number; export var URL_ERROR_UNKNOWN : number; export var URL_ERROR_UNSUPPORTED_SCHEME : number; + export var apiName : string; export var backgroundColor : string; export var backgroundImage : string; export var bubbleParent : boolean; @@ -378,7 +388,7 @@ declare module Ti { export var orientation : number; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; export function applyProperties (props: Dictionary) : void; - export function convertUnits (convertFromValue: string, convertToUnits: string) : number; + export function convertUnits (convertFromValue: string, convertToUnits: number) : number; export function create2DMatrix (parameters?: MatrixCreationDict) : Ti.UI._2DMatrix; export function create3DMatrix (parameters?: Dictionary) : Ti.UI._3DMatrix; export function createActivityIndicator (parameters?: Dictionary) : Ti.UI.ActivityIndicator; @@ -401,6 +411,7 @@ declare module Ti { export function createPickerColumn (parameters?: Dictionary) : Ti.UI.PickerColumn; export function createPickerRow (parameters?: Dictionary) : Ti.UI.PickerRow; export function createProgressBar (parameters?: Dictionary) : Ti.UI.ProgressBar; + export function createRefreshControl (parameters?: Dictionary) : Ti.UI.RefreshControl; export function createSMSDialog (parameters?: Dictionary) : Ti.UI.SMSDialog; export function createScrollView (parameters?: Dictionary) : Ti.UI.ScrollView; export function createScrollableView (parameters?: Dictionary) : Ti.UI.ScrollableView; @@ -420,6 +431,7 @@ declare module Ti { export function createWebView (parameters?: Dictionary) : Ti.UI.WebView; export function createWindow (parameters?: Dictionary) : Ti.UI.Window; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function getBackgroundColor () : string; export function getBackgroundImage () : string; export function getBubbleParent () : boolean; @@ -439,6 +451,7 @@ declare module Ti { export var POPOVER_ARROW_DIRECTION_RIGHT : number; export var POPOVER_ARROW_DIRECTION_UNKNOWN : number; export var POPOVER_ARROW_DIRECTION_UP : number; + export var apiName : string; export var bubbleParent : boolean; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; export function applyProperties (props: Dictionary) : void; @@ -446,6 +459,7 @@ declare module Ti { export function createPopover (parameters?: Dictionary) : Ti.UI.iPad.Popover; export function createSplitWindow (parameters?: Dictionary) : Ti.UI.iPad.SplitWindow; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function getBubbleParent () : boolean; export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; export function setBubbleParent (bubbleParent: boolean) : void; @@ -460,220 +474,447 @@ declare module Ti { } export interface DocumentViewer extends Ti.UI.View { setUrl (url: string) : void; - show(animated?: boolean, view?: any) : void; + show () : void; } - export interface Popover extends Ti.UI.View { + export interface Popover extends Ti.Proxy { arrowDirection : number; + contentView : Ti.UI.View; + height : any; leftNavButton : any; + passthroughViews : Array; rightNavButton : any; title : string; + width : any; + add () : void; getArrowDirection () : number; + getContentView () : Ti.UI.View; + getHeight () : any; getLeftNavButton () : any; + getPassthroughViews () : Array; getRightNavButton () : any; getTitle () : string; + getWidth () : any; + hide (options: PopoverParams) : void; + remove () : void; + setArrowDirection (arrowDirection: number) : void; + setContentView (contentView: Ti.UI.View) : void; + setHeight (height: number) : void; + setHeight (height: string) : void; setLeftNavButton (leftNavButton: any) : void; setPassthroughViews (passthroughViews: Array) : void; setRightNavButton (rightNavButton: any) : void; setTitle (title: string) : void; + setWidth (width: number) : void; + setWidth (width: string) : void; + show (params: PopoverParams) : void; } } - export interface ScrollableView extends Ti.UI.View { - cacheSize : number; - clipViews : boolean; - currentPage : number; - disableBounce : boolean; - hitRect : Dimension; - overScrollMode : number; - overlayEnabled : boolean; - pagingControlAlpha : number; - pagingControlColor : string; - pagingControlHeight : number; - pagingControlOnTop : boolean; - pagingControlTimeout : number; - scrollingEnabled : boolean; - showPagingControl : boolean; - views : Array; - addView (view: Ti.UI.View) : void; - getCacheSize () : number; - getClipViews () : boolean; - getCurrentPage () : number; - getDisableBounce () : boolean; - getHitRect () : Dimension; - getOverScrollMode () : number; - getOverlayEnabled () : boolean; - getPagingControlAlpha () : number; - getPagingControlColor () : string; - getPagingControlHeight () : number; - getPagingControlOnTop () : boolean; - getPagingControlTimeout () : number; - getScrollingEnabled () : boolean; - getShowPagingControl () : boolean; - getViews () : Array; - moveNext () : void; - movePrevious () : void; - removeView (view: number) : void; - removeView (view: Ti.UI.View) : void; - scrollToView (view: number) : void; - scrollToView (view: Ti.UI.View) : void; - setCacheSize (cacheSize: number) : void; - setCurrentPage (currentPage: number) : void; - setDisableBounce (disableBounce: boolean) : void; - setHitRect (hitRect: Dimension) : void; - setOverScrollMode (overScrollMode: number) : void; - setOverlayEnabled (overlayEnabled: boolean) : void; - setPagingControlAlpha (pagingControlAlpha: number) : void; - setPagingControlColor (pagingControlColor: string) : void; - setPagingControlHeight (pagingControlHeight: number) : void; - setPagingControlOnTop (pagingControlOnTop: boolean) : void; - setScrollingEnabled (scrollingEnabled: boolean) : void; - setShowPagingControl (showPagingControl: boolean) : void; - setViews (views: Array) : void; - } - export interface View extends Ti.Proxy { - accessibilityHidden : boolean; - accessibilityHint : string; - accessibilityLabel : string; - accessibilityValue : string; - anchorPoint : Point; - animatedCenter : Point; - backgroundColor : string; - backgroundDisabledColor : string; - backgroundDisabledImage : string; - backgroundFocusedColor : string; - backgroundFocusedImage : string; - backgroundGradient : Gradient; - backgroundImage : string; - backgroundLeftCap : number; - backgroundRepeat : boolean; - backgroundSelectedColor : string; - backgroundSelectedImage : string; - backgroundTopCap : number; - borderColor : string; - borderRadius : number; - borderWidth : number; - bottom : any; - center : Point; - children : Array; - enabled : boolean; - focusable : boolean; - height : any; - horizontalWrap : boolean; - keepScreenOn : boolean; - layout : string; - left : any; - opacity : number; - rect : Dimension; - right : any; - size : Dimension; - softKeyboardOnFocus : number; - tintColor : any; - top : any; - touchEnabled : boolean; - transform : any; - visible : boolean; - width : any; - zIndex : number; - add (view: Ti.UI.View) : void; - animate (animation: Ti.UI.Animation, callback: (...args : any[]) => any) : void; - animate (animation: Dictionary, callback: (...args : any[]) => any) : void; - convertPointToView (point: Point, destinationView: Ti.UI.View) : Point; - finishLayout () : void; - getAccessibilityHidden () : boolean; - getAccessibilityHint () : string; - getAccessibilityLabel () : string; - getAccessibilityValue () : string; - getAnchorPoint () : Point; - getAnimatedCenter () : Point; - getBackgroundColor () : string; - getBackgroundDisabledColor () : string; - getBackgroundDisabledImage () : string; - getBackgroundFocusedColor () : string; - getBackgroundFocusedImage () : string; - getBackgroundGradient () : Gradient; - getBackgroundImage () : string; - getBackgroundLeftCap () : number; - getBackgroundRepeat () : boolean; - getBackgroundSelectedColor () : string; - getBackgroundSelectedImage () : string; - getBackgroundTopCap () : number; - getBorderColor () : string; - getBorderRadius () : number; - getBorderWidth () : number; - getBottom () : any; - getCenter () : Point; - getChildren () : Array; - getEnabled () : boolean; - getFocusable () : boolean; - getHeight () : any; - getHorizontalWrap () : boolean; - getKeepScreenOn () : boolean; - getLayout () : string; - getLeft () : any; - getOpacity () : number; - getRect () : Dimension; - getRight () : any; - getSize () : Dimension; - getSoftKeyboardOnFocus () : number; - getTintColor () : string; - getTop () : any; - getTouchEnabled () : boolean; - getTransform () : any; - getVisible () : boolean; - getWidth () : any; - getZIndex () : number; - hide () : void; - remove (view: Ti.UI.View) : void; - removeAllChildren () : void; - setAccessibilityHidden (accessibilityHidden: boolean) : void; - setAccessibilityHint (accessibilityHint: string) : void; - setAccessibilityLabel (accessibilityLabel: string) : void; - setAccessibilityValue (accessibilityValue: string) : void; - setAnchorPoint (anchorPoint: Point) : void; - setBackgroundColor (backgroundColor: string) : void; - setBackgroundDisabledColor (backgroundDisabledColor: string) : void; - setBackgroundDisabledImage (backgroundDisabledImage: string) : void; - setBackgroundFocusedColor (backgroundFocusedColor: string) : void; - setBackgroundFocusedImage (backgroundFocusedImage: string) : void; - setBackgroundGradient (backgroundGradient: Gradient) : void; - setBackgroundImage (backgroundImage: string) : void; - setBackgroundLeftCap (backgroundLeftCap: number) : void; - setBackgroundRepeat (backgroundRepeat: boolean) : void; - setBackgroundSelectedColor (backgroundSelectedColor: string) : void; - setBackgroundSelectedImage (backgroundSelectedImage: string) : void; - setBackgroundTopCap (backgroundTopCap: number) : void; - setBorderColor (borderColor: string) : void; - setBorderRadius (borderRadius: number) : void; - setBorderWidth (borderWidth: number) : void; - setBottom (bottom: number) : void; - setBottom (bottom: string) : void; - setCenter (center: Point) : void; - setEnabled (enabled: boolean) : void; - setFocusable (focusable: boolean) : void; - setHeight (height: number) : void; - setHeight (height: string) : void; - setHorizontalWrap (horizontalWrap: boolean) : void; - setKeepScreenOn (keepScreenOn: boolean) : void; - setLayout (layout: string) : void; - setLeft (left: number) : void; - setLeft (left: string) : void; - setOpacity (opacity: number) : void; - setRight (right: number) : void; - setRight (right: string) : void; - setSoftKeyboardOnFocus (softKeyboardOnFocus: number) : void; - setTintColor (tintColor: string) : void; - setTop (top: number) : void; - setTop (top: string) : void; - setTouchEnabled (touchEnabled: boolean) : void; - setTransform (transform: Ti.UI._2DMatrix) : void; - setTransform (transform: Ti.UI._3DMatrix) : void; - setVisible (visible: boolean) : void; - setWidth (width: number) : void; - setWidth (width: string) : void; - setZIndex (zIndex: number) : void; - show (...args: Array) : void; - startLayout () : void; - toImage (callback?: (...args : any[]) => any, honorScaleFactor?: boolean) : Ti.Blob; - updateLayout (params: Dictionary) : void; + export module iOS { + export var AD_SIZE_LANDSCAPE : string; + export var AD_SIZE_PORTRAIT : string; + export var ANIMATION_CURVE_EASE_IN : number; + export var ANIMATION_CURVE_EASE_IN_OUT : number; + export var ANIMATION_CURVE_EASE_OUT : number; + export var ANIMATION_CURVE_LINEAR : number; + export var ATTRIBUTE_BACKGROUND_COLOR : number; + export var ATTRIBUTE_BASELINE_OFFSET : number; + export var ATTRIBUTE_EXPANSION : number; + export var ATTRIBUTE_FONT : number; + export var ATTRIBUTE_FOREGROUND_COLOR : number; + export var ATTRIBUTE_KERN : number; + export var ATTRIBUTE_LETTERPRESS_STYLE : number; + export var ATTRIBUTE_LIGATURE : number; + export var ATTRIBUTE_LINK : number; + export var ATTRIBUTE_OBLIQUENESS : number; + export var ATTRIBUTE_SHADOW : number; + export var ATTRIBUTE_STRIKETHROUGH_COLOR : number; + export var ATTRIBUTE_STRIKETHROUGH_STYLE : number; + export var ATTRIBUTE_STROKE_COLOR : number; + export var ATTRIBUTE_STROKE_WIDTH : number; + export var ATTRIBUTE_TEXT_EFFECT : number; + export var ATTRIBUTE_UNDERLINES_STYLE : number; + export var ATTRIBUTE_UNDERLINE_BY_WORD : number; + export var ATTRIBUTE_UNDERLINE_COLOR : number; + export var ATTRIBUTE_UNDERLINE_PATTERN_DASH : number; + export var ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT : number; + export var ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT_DOT : number; + export var ATTRIBUTE_UNDERLINE_PATTERN_DOT : number; + export var ATTRIBUTE_UNDERLINE_PATTERN_SOLID : number; + export var ATTRIBUTE_UNDERLINE_STYLE_DOUBLE : number; + export var ATTRIBUTE_UNDERLINE_STYLE_NONE : number; + export var ATTRIBUTE_UNDERLINE_STYLE_SINGLE : number; + export var ATTRIBUTE_UNDERLINE_STYLE_THICK : number; + export var ATTRIBUTE_WRITING_DIRECTION : number; + export var ATTRIBUTE_WRITING_DIRECTION_EMBEDDING : number; + export var ATTRIBUTE_WRITING_DIRECTION_LEFT_TO_RIGHT : number; + export var ATTRIBUTE_WRITING_DIRECTION_NATURAL : number; + export var ATTRIBUTE_WRITING_DIRECTION_OVERRIDE : number; + export var ATTRIBUTE_WRITING_DIRECTION_RIGHT_TO_LEFT : number; + export var AUTODETECT_ADDRESS : number; + export var AUTODETECT_ALL : number; + export var AUTODETECT_CALENDAR : number; + export var AUTODETECT_LINK : number; + export var AUTODETECT_NONE : number; + export var AUTODETECT_PHONE : number; + export var BLEND_MODE_CLEAR : number; + export var BLEND_MODE_COLOR : number; + export var BLEND_MODE_COLOR_BURN : number; + export var BLEND_MODE_COLOR_DODGE : number; + export var BLEND_MODE_COPY : number; + export var BLEND_MODE_DARKEN : number; + export var BLEND_MODE_DESTINATION_ATOP : number; + export var BLEND_MODE_DESTINATION_IN : number; + export var BLEND_MODE_DESTINATION_OUT : number; + export var BLEND_MODE_DESTINATION_OVER : number; + export var BLEND_MODE_DIFFERENCE : number; + export var BLEND_MODE_EXCLUSION : number; + export var BLEND_MODE_HARD_LIGHT : number; + export var BLEND_MODE_HUE : number; + export var BLEND_MODE_LIGHTEN : number; + export var BLEND_MODE_LUMINOSITY : number; + export var BLEND_MODE_MULTIPLY : number; + export var BLEND_MODE_NORMAL : number; + export var BLEND_MODE_OVERLAY : number; + export var BLEND_MODE_PLUS_DARKER : number; + export var BLEND_MODE_PLUS_LIGHTER : number; + export var BLEND_MODE_SATURATION : number; + export var BLEND_MODE_SCREEN : number; + export var BLEND_MODE_SOFT_LIGHT : number; + export var BLEND_MODE_SOURCE_ATOP : number; + export var BLEND_MODE_SOURCE_IN : number; + export var BLEND_MODE_SOURCE_OUT : number; + export var BLEND_MODE_XOR : number; + export var CLIP_MODE_DEFAULT : number; + export var CLIP_MODE_DISABLED : number; + export var CLIP_MODE_ENABLED : number; + export var COLLISION_MODE_ALL : number; + export var COLLISION_MODE_BOUNDARY : number; + export var COLLISION_MODE_ITEM : number; + export var COLOR_GROUP_TABLEVIEW_BACKGROUND : string; + export var COLOR_SCROLLVIEW_BACKGROUND : string; + export var COLOR_UNDER_PAGE_BACKGROUND : string; + export var COLOR_VIEW_FLIPSIDE_BACKGROUND : string; + export var PUSH_MODE_CONTINUOUS : number; + export var PUSH_MODE_INSTANTANEOUS : number; + export var SCROLL_DECELERATION_RATE_FAST : number; + export var SCROLL_DECELERATION_RATE_NORMAL : number; + export var WEBVIEW_NAVIGATIONTYPE_BACK_FORWARD : number; + export var WEBVIEW_NAVIGATIONTYPE_FORM_RESUBMITTED : number; + export var WEBVIEW_NAVIGATIONTYPE_FORM_SUBMITTED : number; + export var WEBVIEW_NAVIGATIONTYPE_LINK_CLICKED : number; + export var WEBVIEW_NAVIGATIONTYPE_OTHER : number; + export var WEBVIEW_NAVIGATIONTYPE_RELOAD : number; + export var apiName : string; + export var bubbleParent : boolean; + export function addEventListener (name: string, callback: (...args : any[]) => any) : void; + export function applyProperties (props: Dictionary) : void; + export function create3DMatrix (parameters?: Dictionary) : Ti.UI.iOS._3DMatrix; + export function createAdView (parameters?: Dictionary) : Ti.UI.iOS.AdView; + export function createAnchorAttachmentBehavior (parameters?: Dictionary) : Ti.UI.iOS.AnchorAttachmentBehavior; + export function createAnimator (parameters?: Dictionary) : Ti.UI.iOS.Animator; + export function createAttributedString (parameters?: Dictionary) : Ti.UI.iOS.AttributedString; + export function createCollisionBehavior (parameters?: Dictionary) : Ti.UI.iOS.CollisionBehavior; + export function createCoverFlowView (parameters?: Dictionary) : Ti.UI.iOS.CoverFlowView; + export function createDocumentViewer (parameters?: Dictionary) : Ti.UI.iOS.DocumentViewer; + export function createDynamicItemBehavior (parameters?: Dictionary) : Ti.UI.iOS.DynamicItemBehavior; + export function createGravityBehavior (parameters?: Dictionary) : Ti.UI.iOS.GravityBehavior; + export function createNavigationWindow (parameters?: Dictionary) : Ti.UI.iOS.NavigationWindow; + export function createPushBehavior (parameters?: Dictionary) : Ti.UI.iOS.PushBehavior; + export function createSnapBehavior (parameters?: Dictionary) : Ti.UI.iOS.SnapBehavior; + export function createTabbedBar (parameters?: Dictionary) : Ti.UI.iOS.TabbedBar; + export function createToolbar (parameters?: Dictionary) : Ti.UI.iOS.Toolbar; + export function createTransitionAnimation (transition: transitionAnimationParam) : Ti.Proxy; + export function createViewAttachmentBehavior (parameters?: Dictionary) : Ti.UI.iOS.ViewAttachmentBehavior; + export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; + export function getBubbleParent () : boolean; + export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; + export function setBubbleParent (bubbleParent: boolean) : void; + export interface Animator extends Ti.Proxy { + behaviors : Array; + referenceView : Ti.UI.View; + running : boolean; + addBehavior (behavior: Ti.Proxy) : void; + getBehaviors () : Array; + getReferenceView () : Ti.UI.View; + getRunning () : boolean; + removeAllBehaviors () : void; + removeBehavior (behavior: Ti.Proxy) : void; + setBehaviors (behaviors: Array) : void; + setReferenceView (referenceView: Ti.UI.View) : void; + startAnimator () : void; + stopAnimator () : void; + updateItemUsingCurrentState (item: Ti.UI.View) : void; + } + export interface DynamicItemBehavior extends Ti.Proxy { + allowsRotation : boolean; + angularResistance : number; + density : number; + elasticity : number; + friction : number; + items : Array; + resistance : number; + addAngularVelocityForItem (item: Ti.UI.View, velocity: number) : void; + addItem (item: Ti.UI.View) : void; + addLinearVelocityForItem (item: Ti.UI.View, velocity: Point) : void; + angularVelocityForItem (item: Ti.UI.View) : number; + getAllowsRotation () : boolean; + getAngularResistance () : number; + getDensity () : number; + getElasticity () : number; + getFriction () : number; + getItems () : Array; + getResistance () : number; + linearVelocityForItem (item: Ti.UI.View) : Point; + removeItem (item: Ti.UI.View) : void; + setAllowsRotation (allowsRotation: boolean) : void; + setAngularResistance (angularResistance: number) : void; + setDensity (density: number) : void; + setElasticity (elasticity: number) : void; + setFriction (friction: number) : void; + setResistance (resistance: number) : void; + } + export interface SnapBehavior extends Ti.Proxy { + damping : number; + item : Ti.UI.View; + snapPoint : Point; + getDamping () : number; + getItem () : Ti.UI.View; + getSnapPoint () : Point; + setDamping (damping: number) : void; + setItem (item: Ti.UI.View) : void; + setSnapPoint (snapPoint: Point) : void; + } + export interface GravityBehavior extends Ti.Proxy { + angle : number; + gravityDirection : Point; + items : Array; + magnitude : number; + addItem (item: Ti.UI.View) : void; + getAngle () : number; + getGravityDirection () : Point; + getItems () : Array; + getMagnitude () : number; + removeItem (item: Ti.UI.View) : void; + setAngle (angle: number) : void; + setGravityDirection (gravityDirection: Point) : void; + setMagnitude (magnitude: number) : void; + } + export interface CollisionBehavior extends Ti.Proxy { + boundaryIdentifiers : Array; + collisionMode : number; + items : Array; + referenceInsets : ReferenceInsets; + treatReferenceAsBoundary : boolean; + addBoundary (boundary: BoundaryIdentifier) : void; + addItem (item: Ti.UI.View) : void; + getBoundaryIdentifiers () : Array; + getCollisionMode () : number; + getItems () : Array; + getReferenceInsets () : ReferenceInsets; + getTreatReferenceAsBoundary () : boolean; + removeAllBoundaries () : void; + removeBoundary (boundary: BoundaryIdentifier) : void; + removeItem (item: Ti.UI.View) : void; + setCollisionMode (collisionMode: number) : void; + setReferenceInsets (referenceInsets: ReferenceInsets) : void; + setTreatReferenceAsBoundary (treatReferenceAsBoundary: boolean) : void; + } + export interface Toolbar extends Ti.UI.View { + barColor : string; + borderBottom : boolean; + borderTop : boolean; + extendBackground : boolean; + items : Array; + translucent : boolean; + getBarColor () : string; + getBorderBottom () : boolean; + getBorderTop () : boolean; + getExtendBackground () : boolean; + getItems () : Array; + getTranslucent () : boolean; + setBarColor (barColor: string) : void; + setBorderBottom (borderBottom: boolean) : void; + setBorderTop (borderTop: boolean) : void; + setItems (items: Array) : void; + setTranslucent (translucent: boolean) : void; + } + export interface ViewAttachmentBehavior extends Ti.Proxy { + anchorItem : Ti.UI.View; + anchorOffset : Point; + damping : number; + distance : number; + frequency : number; + item : Ti.UI.View; + itemOffset : Point; + getAnchorItem () : Ti.UI.View; + getAnchorOffset () : Point; + getDamping () : number; + getDistance () : number; + getFrequency () : number; + getItem () : Ti.UI.View; + getItemOffset () : Point; + setAnchorItem (anchorItem: Ti.UI.View) : void; + setAnchorOffset (anchorOffset: Point) : void; + setDamping (damping: number) : void; + setDistance (distance: number) : void; + setFrequency (frequency: number) : void; + setItem (item: Ti.UI.View) : void; + setItemOffset (itemOffset: Point) : void; + } + export interface PushBehavior extends Ti.Proxy { + active : boolean; + angle : number; + items : Array; + magnitude : number; + pushDirection : Point; + pushMode : number; + addItem (item: Ti.UI.View) : void; + getActive () : boolean; + getAngle () : number; + getItems () : Array; + getMagnitude () : number; + getPushDirection () : Point; + getPushMode () : number; + removeItem (item: Ti.UI.View) : void; + setActive (active: boolean) : void; + setAngle (angle: number) : void; + setMagnitude (magnitude: number) : void; + setPushDirection (pushDirection: Point) : void; + setPushMode (pushMode: number) : void; + } + export interface CoverFlowView extends Ti.UI.View { + images : any; + selected : number; + getImages () : any; + getSelected () : number; + setImage (index: number, image: string) : void; + setImage (image: Ti.Blob) : void; + setImage (image: Ti.Filesystem.File) : void; + setImage (index: number, image: CoverFlowImageType) : void; + setImages (images: Array) : void; + setImages (images: Array) : void; + setImages (images: Array) : void; + setImages (images: Array) : void; + setSelected (selected: number) : void; + } + export interface DocumentViewer extends Ti.UI.View { + name : string; + url : string; + getName () : string; + getUrl () : string; + hide (options?: DocumentViewerOptions) : void; + setUrl (url: string) : void; + show (options?: DocumentViewerOptions) : void; + } + export interface NavigationWindow extends Ti.UI.Window { + window : Ti.UI.Window; + closeWindow (window: Ti.UI.Window, options: Dictionary) : void; + getWindow () : Ti.UI.Window; + openWindow (window: Ti.UI.Window, options: Dictionary) : void; + } + export interface AttributedString extends Ti.Proxy { + attributes : Array; + text : string; + addAttribute (attribute: Attribute) : void; + getAttributes () : Array; + getText () : string; + setAttributes (attributes: Array) : void; + setText (text: string) : void; + } + export interface AnchorAttachmentBehavior extends Ti.Proxy { + anchor : Point; + damping : number; + distance : number; + frequency : number; + item : Ti.UI.View; + offset : Point; + getAnchor () : Point; + getDamping () : number; + getDistance () : number; + getFrequency () : number; + getItem () : Ti.UI.View; + getOffset () : Point; + setAnchor (anchor: Point) : void; + setDamping (damping: number) : void; + setDistance (distance: number) : void; + setFrequency (frequency: number) : void; + setItem (item: Ti.UI.View) : void; + setOffset (offset: Point) : void; + } + export interface TabbedBar extends Ti.UI.View { + index : number; + labels : any; + style : number; + getIndex () : number; + getLabels () : any; + getStyle () : number; + setIndex (index: number) : void; + setLabels (labels: Array) : void; + setLabels (labels: Array) : void; + setStyle (style: number) : void; + } + export interface _3DMatrix extends Ti.Proxy { + m11 : number; + m12 : number; + m13 : number; + m14 : number; + m21 : number; + m22 : number; + m23 : number; + m24 : number; + m31 : number; + m32 : number; + m33 : number; + m34 : number; + m41 : number; + m42 : number; + m43 : number; + m44 : number; + getM11 () : number; + getM12 () : number; + getM13 () : number; + getM14 () : number; + getM21 () : number; + getM22 () : number; + getM23 () : number; + getM24 () : number; + getM31 () : number; + getM32 () : number; + getM33 () : number; + getM34 () : number; + getM41 () : number; + getM42 () : number; + getM43 () : number; + getM44 () : number; + invert () : Ti.UI._3DMatrix; + multiply (t2: Ti.UI._3DMatrix) : Ti.UI._3DMatrix; + rotate (angle: number, x: number, y: number, z: number) : Ti.UI._3DMatrix; + scale (sx: number, sy: number, sz: number) : Ti.UI._3DMatrix; + setM11 (m11: number) : void; + setM12 (m12: number) : void; + setM13 (m13: number) : void; + setM14 (m14: number) : void; + setM21 (m21: number) : void; + setM22 (m22: number) : void; + setM23 (m23: number) : void; + setM24 (m24: number) : void; + setM31 (m31: number) : void; + setM32 (m32: number) : void; + setM33 (m33: number) : void; + setM34 (m34: number) : void; + setM41 (m41: number) : void; + setM42 (m42: number) : void; + setM43 (m43: number) : void; + setM44 (m44: number) : void; + translate (tx: number, ty: number, tz: number) : Ti.UI._3DMatrix; + } + export interface AdView extends Ti.UI.View { + adSize : string; + cancelAction () : void; + getAdSize () : string; + setAdSize (adSize: string) : void; + } } export module iPhone { export var MODAL_PRESENTATION_CURRENT_CONTEXT : number; @@ -684,6 +925,7 @@ declare module Ti { export var MODAL_TRANSITION_STYLE_CROSS_DISSOLVE : number; export var MODAL_TRANSITION_STYLE_FLIP_HORIZONTAL : number; export var MODAL_TRANSITION_STYLE_PARTIAL_CURL : number; + export var apiName : string; export var appBadge : number; export var appSupportsShakeToEdit : boolean; export var bubbleParent : boolean; @@ -693,6 +935,7 @@ declare module Ti { export function applyProperties (props: Dictionary) : void; export function createNavigationGroup (parameters?: Dictionary) : Ti.UI.iPhone.NavigationGroup; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function getAppBadge () : number; export function getAppSupportsShakeToEdit () : boolean; export function getBubbleParent () : boolean; @@ -703,8 +946,6 @@ declare module Ti { export function setAppBadge (appBadge: number) : void; export function setAppSupportsShakeToEdit (appSupportsShakeToEdit: boolean) : void; export function setBubbleParent (bubbleParent: boolean) : void; - export function setStatusBarHidden (statusBarHidden: boolean) : void; - export function setStatusBarStyle (statusBarStyle: number) : void; export function showStatusBar (params?: showStatusBarParams) : void; export enum ScrollIndicatorStyle { BLACK, @@ -848,6 +1089,7 @@ declare module Ti { } export interface TextArea extends Ti.UI.View { appearance : number; + attributedString : Ti.UI.iOS.AttributedString; autoLink : number; autocapitalization : number; autocorrect : boolean; @@ -857,6 +1099,7 @@ declare module Ti { ellipsize : boolean; enableReturnKey : boolean; font : Font; + handleLinks : boolean; hintText : string; keyboardToolbar : any; keyboardToolbarColor : string; @@ -866,6 +1109,7 @@ declare module Ti { returnKeyType : number; scrollable : boolean; scrollsToTop : boolean; + selection : textAreaSelectedParams; suppressReturn : boolean; textAlign : any; value : string; @@ -873,6 +1117,7 @@ declare module Ti { blur () : void; focus () : void; getAppearance () : number; + getAttributedString () : Ti.UI.iOS.AttributedString; getAutoLink () : number; getAutocapitalization () : number; getAutocorrect () : boolean; @@ -882,6 +1127,7 @@ declare module Ti { getEllipsize () : boolean; getEnableReturnKey () : boolean; getFont () : Font; + getHandleLinks () : boolean; getHintText () : string; getKeyboardToolbar () : any; getKeyboardToolbarColor () : string; @@ -891,12 +1137,14 @@ declare module Ti { getReturnKeyType () : number; getScrollable () : boolean; getScrollsToTop () : boolean; + getSelection () : textAreaSelectedParams; getSuppressReturn () : boolean; getTextAlign () : any; getValue () : string; getVerticalAlign () : any; hasText () : boolean; setAppearance (appearance: number) : void; + setAttributedString (attributedString: Ti.UI.iOS.AttributedString) : void; setAutoLink (autoLink: number) : void; setAutocapitalization (autocapitalization: number) : void; setAutocorrect (autocorrect: boolean) : void; @@ -906,6 +1154,7 @@ declare module Ti { setEllipsize (ellipsize: boolean) : void; setEnableReturnKey (enableReturnKey: boolean) : void; setFont (font: Font) : void; + setHandleLinks (handleLinks: boolean) : void; setHintText (hintText: string) : void; setKeyboardToolbar (keyboardToolbar: Array) : void; setKeyboardToolbar (keyboardToolbar: Ti.UI.iOS.Toolbar) : void; @@ -924,6 +1173,169 @@ declare module Ti { setVerticalAlign (verticalAlign: number) : void; setVerticalAlign (verticalAlign: string) : void; } + export interface View extends Ti.Proxy { + accessibilityHidden : boolean; + accessibilityHint : string; + accessibilityLabel : string; + accessibilityValue : string; + anchorPoint : Point; + animatedCenter : Point; + backgroundColor : string; + backgroundDisabledColor : string; + backgroundDisabledImage : string; + backgroundFocusedColor : string; + backgroundFocusedImage : string; + backgroundGradient : Gradient; + backgroundImage : string; + backgroundLeftCap : number; + backgroundRepeat : boolean; + backgroundSelectedColor : string; + backgroundSelectedImage : string; + backgroundTopCap : number; + borderColor : string; + borderRadius : number; + borderWidth : number; + bottom : any; + center : Point; + children : Array; + clipMode : number; + enabled : boolean; + focusable : boolean; + height : any; + horizontalWrap : boolean; + keepScreenOn : boolean; + layout : string; + left : any; + opacity : number; + overrideCurrentAnimation : boolean; + pullBackgroundColor : string; + rect : Dimension; + right : any; + size : Dimension; + softKeyboardOnFocus : number; + tintColor : any; + top : any; + touchEnabled : boolean; + transform : any; + viewShadowColor : string; + viewShadowOffset : Point; + viewShadowRadius : number; + visible : boolean; + width : any; + zIndex : number; + add (view: Ti.UI.View) : void; + animate (animation: Ti.UI.Animation, callback: (...args : any[]) => any) : void; + animate (animation: Dictionary, callback: (...args : any[]) => any) : void; + convertPointToView (point: Point, destinationView: Ti.UI.View) : Point; + finishLayout () : void; + getAccessibilityHidden () : boolean; + getAccessibilityHint () : string; + getAccessibilityLabel () : string; + getAccessibilityValue () : string; + getAnchorPoint () : Point; + getAnimatedCenter () : Point; + getBackgroundColor () : string; + getBackgroundDisabledColor () : string; + getBackgroundDisabledImage () : string; + getBackgroundFocusedColor () : string; + getBackgroundFocusedImage () : string; + getBackgroundGradient () : Gradient; + getBackgroundImage () : string; + getBackgroundLeftCap () : number; + getBackgroundRepeat () : boolean; + getBackgroundSelectedColor () : string; + getBackgroundSelectedImage () : string; + getBackgroundTopCap () : number; + getBorderColor () : string; + getBorderRadius () : number; + getBorderWidth () : number; + getBottom () : any; + getCenter () : Point; + getChildren () : Array; + getClipMode () : number; + getEnabled () : boolean; + getFocusable () : boolean; + getHeight () : any; + getHorizontalWrap () : boolean; + getKeepScreenOn () : boolean; + getLayout () : string; + getLeft () : any; + getOpacity () : number; + getOverrideCurrentAnimation () : boolean; + getPullBackgroundColor () : string; + getRect () : Dimension; + getRight () : any; + getSize () : Dimension; + getSoftKeyboardOnFocus () : number; + getTintColor () : string; + getTop () : any; + getTouchEnabled () : boolean; + getTransform () : any; + getViewShadowColor () : string; + getViewShadowOffset () : Point; + getViewShadowRadius () : number; + getVisible () : boolean; + getWidth () : any; + getZIndex () : number; + hide () : void; + remove (view: Ti.UI.View) : void; + removeAllChildren () : void; + setAccessibilityHidden (accessibilityHidden: boolean) : void; + setAccessibilityHint (accessibilityHint: string) : void; + setAccessibilityLabel (accessibilityLabel: string) : void; + setAccessibilityValue (accessibilityValue: string) : void; + setAnchorPoint (anchorPoint: Point) : void; + setBackgroundColor (backgroundColor: string) : void; + setBackgroundDisabledColor (backgroundDisabledColor: string) : void; + setBackgroundDisabledImage (backgroundDisabledImage: string) : void; + setBackgroundFocusedColor (backgroundFocusedColor: string) : void; + setBackgroundFocusedImage (backgroundFocusedImage: string) : void; + setBackgroundGradient (backgroundGradient: Gradient) : void; + setBackgroundImage (backgroundImage: string) : void; + setBackgroundLeftCap (backgroundLeftCap: number) : void; + setBackgroundRepeat (backgroundRepeat: boolean) : void; + setBackgroundSelectedColor (backgroundSelectedColor: string) : void; + setBackgroundSelectedImage (backgroundSelectedImage: string) : void; + setBackgroundTopCap (backgroundTopCap: number) : void; + setBorderColor (borderColor: string) : void; + setBorderRadius (borderRadius: number) : void; + setBorderWidth (borderWidth: number) : void; + setBottom (bottom: number) : void; + setBottom (bottom: string) : void; + setCenter (center: Point) : void; + setClipMode (clipMode: number) : void; + setEnabled (enabled: boolean) : void; + setFocusable (focusable: boolean) : void; + setHeight (height: number) : void; + setHeight (height: string) : void; + setHorizontalWrap (horizontalWrap: boolean) : void; + setKeepScreenOn (keepScreenOn: boolean) : void; + setLayout (layout: string) : void; + setLeft (left: number) : void; + setLeft (left: string) : void; + setOpacity (opacity: number) : void; + setPullBackgroundColor (pullBackgroundColor: string) : void; + setRight (right: number) : void; + setRight (right: string) : void; + setSoftKeyboardOnFocus (softKeyboardOnFocus: number) : void; + setTintColor (tintColor: string) : void; + setTop (top: number) : void; + setTop (top: string) : void; + setTouchEnabled (touchEnabled: boolean) : void; + setTransform (transform: Ti.UI._2DMatrix) : void; + setTransform (transform: Ti.UI._3DMatrix) : void; + setViewShadowColor (viewShadowColor: string) : void; + setViewShadowOffset (viewShadowOffset: Point) : void; + setViewShadowRadius (viewShadowRadius: number) : void; + setVisible (visible: boolean) : void; + setWidth (width: number) : void; + setWidth (width: string) : void; + setZIndex (zIndex: number) : void; + show () : void; + startLayout () : void; + toImage (callback?: (...args : any[]) => any, honorScaleFactor?: boolean) : Ti.Blob; + updateLayout (params: Dictionary) : void; + } export enum ActivityIndicatorStyle { BIG, BIG_DARK, @@ -933,8 +1345,11 @@ declare module Ti { export interface Switch extends Ti.UI.View { color : string; font : Font; + onTintColor : string; style : number; textAlign : any; + thumbTintColor : string; + tintColor : string; title : string; titleOff : string; titleOn : string; @@ -942,8 +1357,10 @@ declare module Ti { verticalAlign : any; getColor () : string; getFont () : Font; + getOnTintColor () : string; getStyle () : number; getTextAlign () : any; + getThumbTintColor () : string; getTitle () : string; getTitleOff () : string; getTitleOn () : string; @@ -951,9 +1368,11 @@ declare module Ti { getVerticalAlign () : any; setColor (color: string) : void; setFont (font: Font) : void; + setOnTintColor (onTintColor: string) : void; setStyle (style: number) : void; setTextAlign (textAlign: string) : void; setTextAlign (textAlign: number) : void; + setThumbTintColor (thumbTintColor: string) : void; setTitle (title: string) : void; setTitleOff (titleOff: string) : void; setTitleOn (titleOn: string) : void; @@ -961,6 +1380,22 @@ declare module Ti { setVerticalAlign (verticalAlign: number) : void; setVerticalAlign (verticalAlign: string) : void; } + export interface DashboardItem extends Ti.Proxy { + badge : number; + canDelete : boolean; + image : any; + selectedImage : any; + getBadge () : number; + getCanDelete () : boolean; + getImage () : any; + getSelectedImage () : any; + setBadge (badge: number) : void; + setCanDelete (canDelete: boolean) : void; + setImage (image: string) : void; + setImage (image: Ti.Blob) : void; + setSelectedImage (selectedImage: string) : void; + setSelectedImage (selectedImage: Ti.Blob) : void; + } export interface Tab extends Ti.UI.View { active : boolean; activeIcon : string; @@ -1056,6 +1491,18 @@ declare module Ti { setFontSize (fontSize: number) : void; setTitle (title: string) : void; } + export interface ButtonBar extends Ti.UI.View { + index : number; + labels : any; + style : number; + getIndex () : number; + getLabels () : any; + getStyle () : number; + setIndex (index: number) : void; + setLabels (labels: Array) : void; + setLabels (labels: Array) : void; + setStyle (style: number) : void; + } export interface Slider extends Ti.UI.View { disabledLeftTrackImage : string; disabledRightTrackImage : string; @@ -1169,12 +1616,14 @@ declare module Ti { export var WEBVIEW_PLUGINS_OFF : number; export var WEBVIEW_PLUGINS_ON : number; export var WEBVIEW_PLUGINS_ON_DEMAND : number; + export var apiName : string; export var bubbleParent : boolean; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; export function applyProperties (props: Dictionary) : void; export function createProgressIndicator (parameters?: Dictionary) : Ti.UI.Android.ProgressIndicator; export function createSearchView (parameters?: Dictionary) : Ti.UI.Android.SearchView; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function getBubbleParent () : boolean; export function hideSoftKeyboard () : void; export function openPreferences () : void; @@ -1225,22 +1674,6 @@ declare module Ti { show () : void; } } - export interface DashboardItem extends Ti.Proxy { - badge : number; - canDelete : boolean; - image : any; - selectedImage : any; - getBadge () : number; - getCanDelete () : boolean; - getImage () : any; - getSelectedImage () : any; - setBadge (badge: number) : void; - setCanDelete (canDelete: boolean) : void; - setImage (image: string) : void; - setImage (image: Ti.Blob) : void; - setSelectedImage (selectedImage: string) : void; - setSelectedImage (selectedImage: Ti.Blob) : void; - } export interface DashboardView extends Ti.UI.View { columnCount : number; data : Array; @@ -1308,192 +1741,6 @@ declare module Ti { setTitle (title: string) : void; show () : void; } - export module iOS { - export var AD_SIZE_LANDSCAPE : string; - export var AD_SIZE_PORTRAIT : string; - export var ANIMATION_CURVE_EASE_IN : number; - export var ANIMATION_CURVE_EASE_IN_OUT : number; - export var ANIMATION_CURVE_EASE_OUT : number; - export var ANIMATION_CURVE_LINEAR : number; - export var AUTODETECT_ADDRESS : number; - export var AUTODETECT_ALL : number; - export var AUTODETECT_CALENDAR : number; - export var AUTODETECT_LINK : number; - export var AUTODETECT_NONE : number; - export var AUTODETECT_PHONE : number; - export var BLEND_MODE_CLEAR : number; - export var BLEND_MODE_COLOR : number; - export var BLEND_MODE_COLOR_BURN : number; - export var BLEND_MODE_COLOR_DODGE : number; - export var BLEND_MODE_COPY : number; - export var BLEND_MODE_DARKEN : number; - export var BLEND_MODE_DESTINATION_ATOP : number; - export var BLEND_MODE_DESTINATION_IN : number; - export var BLEND_MODE_DESTINATION_OUT : number; - export var BLEND_MODE_DESTINATION_OVER : number; - export var BLEND_MODE_DIFFERENCE : number; - export var BLEND_MODE_EXCLUSION : number; - export var BLEND_MODE_HARD_LIGHT : number; - export var BLEND_MODE_HUE : number; - export var BLEND_MODE_LIGHTEN : number; - export var BLEND_MODE_LUMINOSITY : number; - export var BLEND_MODE_MULTIPLY : number; - export var BLEND_MODE_NORMAL : number; - export var BLEND_MODE_OVERLAY : number; - export var BLEND_MODE_PLUS_DARKER : number; - export var BLEND_MODE_PLUS_LIGHTER : number; - export var BLEND_MODE_SATURATION : number; - export var BLEND_MODE_SCREEN : number; - export var BLEND_MODE_SOFT_LIGHT : number; - export var BLEND_MODE_SOURCE_ATOP : number; - export var BLEND_MODE_SOURCE_IN : number; - export var BLEND_MODE_SOURCE_OUT : number; - export var BLEND_MODE_XOR : number; - export var COLOR_GROUP_TABLEVIEW_BACKGROUND : string; - export var COLOR_SCROLLVIEW_BACKGROUND : string; - export var COLOR_UNDER_PAGE_BACKGROUND : string; - export var COLOR_VIEW_FLIPSIDE_BACKGROUND : string; - export var WEBVIEW_NAVIGATIONTYPE_BACK_FORWARD : number; - export var WEBVIEW_NAVIGATIONTYPE_FORM_RESUBMITTED : number; - export var WEBVIEW_NAVIGATIONTYPE_FORM_SUBMITTED : number; - export var WEBVIEW_NAVIGATIONTYPE_LINK_CLICKED : number; - export var WEBVIEW_NAVIGATIONTYPE_OTHER : number; - export var WEBVIEW_NAVIGATIONTYPE_RELOAD : number; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function create3DMatrix (parameters?: Dictionary) : Ti.UI.iOS._3DMatrix; - export function createAdView (parameters?: Dictionary) : Ti.UI.iOS.AdView; - export function createCoverFlowView (parameters?: Dictionary) : Ti.UI.iOS.CoverFlowView; - export function createDocumentViewer (parameters?: Dictionary) : Ti.UI.iOS.DocumentViewer; - export function createNavigationWindow (parameters?: Dictionary) : Ti.UI.iOS.NavigationWindow; - export function createTabbedBar (parameters?: Dictionary) : Ti.UI.iOS.TabbedBar; - export function createToolbar (parameters?: Dictionary) : Ti.UI.iOS.Toolbar; - export function fireEvent (name: string, event: Dictionary) : void; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface Toolbar extends Ti.UI.View { - barColor : string; - borderBottom : boolean; - borderTop : boolean; - items : Array; - translucent : boolean; - getBarColor () : string; - getBorderBottom () : boolean; - getBorderTop () : boolean; - getItems () : Array; - getTranslucent () : boolean; - setBarColor (barColor: string) : void; - setBorderBottom (borderBottom: boolean) : void; - setBorderTop (borderTop: boolean) : void; - setItems (items: Array) : void; - setTranslucent (translucent: boolean) : void; - } - export interface CoverFlowView extends Ti.UI.View { - images : any; - selected : number; - getImages () : any; - getSelected () : number; - setImage (index: number, image: string) : void; - setImage (image: Ti.Blob) : void; - setImage (image: Ti.Filesystem.File) : void; - setImage (index: number, image: CoverFlowImageType) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setSelected (selected: number) : void; - } - export interface DocumentViewer extends Ti.UI.View { - name : string; - url : string; - getName () : string; - getUrl () : string; - hide (options?: DocumentViewerOptions) : void; - setUrl (url: string) : void; - show (options?: DocumentViewerOptions) : void; - } - export interface NavigationWindow extends Ti.UI.Window { - window : Ti.UI.Window; - closeWindow (window: Ti.UI.Window, options: Dictionary) : void; - getWindow () : Ti.UI.Window; - openWindow (window: Ti.UI.Window, options: Dictionary) : void; - } - export interface TabbedBar extends Ti.UI.View { - index : number; - labels : any; - style : number; - getIndex () : number; - getLabels () : any; - getStyle () : number; - setIndex (index: number) : void; - setLabels (labels: Array) : void; - setLabels (labels: Array) : void; - setStyle (style: number) : void; - } - export interface _3DMatrix extends Ti.Proxy { - m11 : number; - m12 : number; - m13 : number; - m14 : number; - m21 : number; - m22 : number; - m23 : number; - m24 : number; - m31 : number; - m32 : number; - m33 : number; - m34 : number; - m41 : number; - m42 : number; - m43 : number; - m44 : number; - getM11 () : number; - getM12 () : number; - getM13 () : number; - getM14 () : number; - getM21 () : number; - getM22 () : number; - getM23 () : number; - getM24 () : number; - getM31 () : number; - getM32 () : number; - getM33 () : number; - getM34 () : number; - getM41 () : number; - getM42 () : number; - getM43 () : number; - getM44 () : number; - invert () : Ti.UI._3DMatrix; - multiply (t2: Ti.UI._3DMatrix) : Ti.UI._3DMatrix; - rotate (angle: number, x: number, y: number, z: number) : Ti.UI._3DMatrix; - scale (sx: number, sy: number, sz: number) : Ti.UI._3DMatrix; - setM11 (m11: number) : void; - setM12 (m12: number) : void; - setM13 (m13: number) : void; - setM14 (m14: number) : void; - setM21 (m21: number) : void; - setM22 (m22: number) : void; - setM23 (m23: number) : void; - setM24 (m24: number) : void; - setM31 (m31: number) : void; - setM32 (m32: number) : void; - setM33 (m33: number) : void; - setM34 (m34: number) : void; - setM41 (m41: number) : void; - setM42 (m42: number) : void; - setM43 (m43: number) : void; - setM44 (m44: number) : void; - translate (tx: number, ty: number, tz: number) : Ti.UI._3DMatrix; - } - export interface AdView extends Ti.UI.View { - adSize : string; - cancelAction () : void; - getAdSize () : string; - setAdSize (adSize: string) : void; - } - } export interface _2DMatrix extends Ti.Proxy { a : number; b : number; @@ -1540,26 +1787,35 @@ declare module Ti { barImage : string; exitOnClose : boolean; extendEdges : Array; + flagSecure : boolean; fullscreen : boolean; + hideShadow : boolean; includeOpaqueBars : boolean; leftNavButton : Ti.UI.View; + leftNavButtons : Array; modal : boolean; navBarHidden : boolean; navTintColor : any; orientation : number; orientationModes : Array; rightNavButton : Ti.UI.View; + rightNavButtons : Array; + shadowImage : string; statusBarStyle : any; tabBarHidden : boolean; + theme : string; title : string; + titleAttributes : titleAttributesParams; titleControl : Ti.UI.View; titleImage : string; titlePrompt : string; titleid : string; titlepromptid : string; toolbar : Array; + transitionAnimation : Ti.Proxy; translucent : boolean; url : string; + windowFlags : number; windowPixelFormat : number; windowSoftInputMode : number; close (params?: Dictionary) : void; @@ -1572,28 +1828,38 @@ declare module Ti { getBarImage () : string; getExitOnClose () : boolean; getExtendEdges () : Array; + getFlagSecure () : boolean; getFullscreen () : boolean; + getHideShadow () : boolean; getIncludeOpaqueBars () : boolean; getLeftNavButton () : Ti.UI.View; + getLeftNavButtons () : Array; getModal () : boolean; getNavBarHidden () : boolean; getNavTintColor () : string; getOrientation () : number; getOrientationModes () : Array; getRightNavButton () : Ti.UI.View; + getRightNavButtons () : Array; + getShadowImage () : string; getStatusBarStyle () : number; getTabBarHidden () : boolean; + getTheme () : string; getTitle () : string; + getTitleAttributes () : titleAttributesParams; getTitleControl () : Ti.UI.View; getTitleImage () : string; getTitlePrompt () : string; getTitleid () : string; getTitlepromptid () : string; getToolbar () : Array; + getTransitionAnimation () : Ti.Proxy; getTranslucent () : boolean; getUrl () : string; + getWindowFlags () : number; getWindowPixelFormat () : number; getWindowSoftInputMode () : number; + hideNavBar (options?: Dictionary) : void; hideTabBar () : void; open (params?: openWindowParams) : void; setAutoAdjustScrollViewInsets (autoAdjustScrollViewInsets: boolean) : void; @@ -1602,29 +1868,39 @@ declare module Ti { setBackButtonTitleImage (backButtonTitleImage: Ti.Blob) : void; setBarColor (barColor: string) : void; setBarImage (barImage: string) : void; + setExitOnClose (exitOnClose: boolean) : void; setExtendEdges (extendEdges: Array) : void; setFullscreen (fullscreen: boolean) : void; + setHideShadow (hideShadow: boolean) : void; setIncludeOpaqueBars (includeOpaqueBars: boolean) : void; setLeftNavButton (leftNavButton: Ti.UI.View) : void; + setLeftNavButtons (leftNavButtons: Array) : void; setModal (modal: boolean) : void; setNavBarHidden (navBarHidden: boolean) : void; setNavTintColor (navTintColor: string) : void; setOrientationModes (orientationModes: Array) : void; setRightNavButton (rightNavButton: Ti.UI.View) : void; + setRightNavButtons (rightNavButtons: Array) : void; + setShadowImage (shadowImage: string) : void; setStatusBarStyle (statusBarStyle: number) : void; setTabBarHidden (tabBarHidden: boolean) : void; setTitle (title: string) : void; + setTitleAttributes (titleAttributes: titleAttributesParams) : void; setTitleControl (titleControl: Ti.UI.View) : void; setTitleImage (titleImage: string) : void; setTitlePrompt (titlePrompt: string) : void; setTitleid (titleid: string) : void; setTitlepromptid (titlepromptid: string) : void; setToolbar (items: Array, params?: windowToolbarParam) : void; + setTransitionAnimation (transitionAnimation: Ti.Proxy) : void; setTranslucent (translucent: boolean) : void; setWindowPixelFormat (windowPixelFormat: number) : void; + showNavBar (options?: Dictionary) : void; } export interface TextField extends Ti.UI.View { appearance : number; + attributedHintText : Ti.UI.iOS.AttributedString; + attributedString : Ti.UI.iOS.AttributedString; autoLink : number; autocapitalization : number; autocorrect : boolean; @@ -1653,6 +1929,7 @@ declare module Ti { rightButton : any; rightButtonMode : number; rightButtonPadding : number; + selection : textFieldSelectedParams; suppressReturn : boolean; textAlign : any; value : string; @@ -1660,6 +1937,8 @@ declare module Ti { blur () : void; focus () : void; getAppearance () : number; + getAttributedHintText () : Ti.UI.iOS.AttributedString; + getAttributedString () : Ti.UI.iOS.AttributedString; getAutoLink () : number; getAutocapitalization () : number; getAutocorrect () : boolean; @@ -1688,12 +1967,15 @@ declare module Ti { getRightButton () : any; getRightButtonMode () : number; getRightButtonPadding () : number; + getSelection () : textFieldSelectedParams; getSuppressReturn () : boolean; getTextAlign () : any; getValue () : string; getVerticalAlign () : any; hasText () : boolean; setAppearance (appearance: number) : void; + setAttributedHintText (attributedHintText: Ti.UI.iOS.AttributedString) : void; + setAttributedString (attributedString: Ti.UI.iOS.AttributedString) : void; setAutoLink (autoLink: number) : void; setAutocapitalization (autocapitalization: number) : void; setAutocorrect (autocorrect: boolean) : void; @@ -1791,11 +2073,13 @@ declare module Ti { data : any; disableBounce : boolean; enableZoomControls : boolean; + handlePlatformUrl : boolean; hideLoadIndicator : boolean; html : string; ignoreSslError : boolean; lightTouchEnabled : boolean; loading : boolean; + onCreateWindow : (...args : any[]) => any; overScrollMode : number; pluginState : number; scalesPageToFit : boolean; @@ -1811,11 +2095,13 @@ declare module Ti { getData () : any; getDisableBounce () : boolean; getEnableZoomControls () : boolean; + getHandlePlatformUrl () : boolean; getHideLoadIndicator () : boolean; getHtml () : string; getIgnoreSslError () : boolean; getLightTouchEnabled () : boolean; getLoading () : boolean; + getOnCreateWindow () : (...args : any[]) => any; getOverScrollMode () : number; getPluginState () : number; getScalesPageToFit () : boolean; @@ -1837,11 +2123,13 @@ declare module Ti { setData (data: Ti.Filesystem.File) : void; setDisableBounce (disableBounce: boolean) : void; setEnableZoomControls (enableZoomControls: boolean) : void; + setHandlePlatformUrl (handlePlatformUrl: boolean) : void; setHideLoadIndicator (hideLoadIndicator: boolean) : void; setHtml (html: any, options?: Dictionary) : void; setIgnoreSslError (ignoreSslError: boolean) : void; setLightTouchEnabled (lightTouchEnabled: boolean) : void; setLoading (loading: boolean) : void; + setOnCreateWindow (onCreateWindow: (...args : any[]) => any) : void; setOverScrollMode (overScrollMode: number) : void; setPluginState (pluginState: number) : void; setScalesPageToFit (scalesPageToFit: boolean) : void; @@ -1862,6 +2150,58 @@ declare module Ti { setData (type: string, data: any) : void; setText (text: string) : void; } + export interface ScrollableView extends Ti.UI.View { + cacheSize : number; + clipViews : boolean; + currentPage : number; + disableBounce : boolean; + hitRect : Dimension; + overScrollMode : number; + overlayEnabled : boolean; + pagingControlAlpha : number; + pagingControlColor : string; + pagingControlHeight : number; + pagingControlOnTop : boolean; + pagingControlTimeout : number; + scrollingEnabled : boolean; + showPagingControl : boolean; + views : Array; + addView (view: Ti.UI.View) : void; + getCacheSize () : number; + getClipViews () : boolean; + getCurrentPage () : number; + getDisableBounce () : boolean; + getHitRect () : Dimension; + getOverScrollMode () : number; + getOverlayEnabled () : boolean; + getPagingControlAlpha () : number; + getPagingControlColor () : string; + getPagingControlHeight () : number; + getPagingControlOnTop () : boolean; + getPagingControlTimeout () : number; + getScrollingEnabled () : boolean; + getShowPagingControl () : boolean; + getViews () : Array; + moveNext () : void; + movePrevious () : void; + removeView (view: number) : void; + removeView (view: Ti.UI.View) : void; + scrollToView (view: number) : void; + scrollToView (view: Ti.UI.View) : void; + setCacheSize (cacheSize: number) : void; + setCurrentPage (currentPage: number) : void; + setDisableBounce (disableBounce: boolean) : void; + setHitRect (hitRect: Dimension) : void; + setOverScrollMode (overScrollMode: number) : void; + setOverlayEnabled (overlayEnabled: boolean) : void; + setPagingControlAlpha (pagingControlAlpha: number) : void; + setPagingControlColor (pagingControlColor: string) : void; + setPagingControlHeight (pagingControlHeight: number) : void; + setPagingControlOnTop (pagingControlOnTop: boolean) : void; + setScrollingEnabled (scrollingEnabled: boolean) : void; + setShowPagingControl (showPagingControl: boolean) : void; + setViews (views: Array) : void; + } export interface ListSection extends Ti.Proxy { footerTitle : string; footerView : Ti.UI.View; @@ -1890,6 +2230,7 @@ declare module Ti { contentHeight : any; contentOffset : Dictionary; contentWidth : any; + decelerationRate : number; disableBounce : boolean; horizontalBounce : boolean; maxZoomScale : number; @@ -1907,6 +2248,7 @@ declare module Ti { getContentHeight () : any; getContentOffset () : Dictionary; getContentWidth () : any; + getDecelerationRate () : number; getDisableBounce () : boolean; getHorizontalBounce () : boolean; getMaxZoomScale () : number; @@ -1928,6 +2270,7 @@ declare module Ti { setContentOffset (contentOffset: Dictionary, animated?: contentOffsetOption) : void; setContentWidth (contentWidth: number) : void; setContentWidth (contentWidth: string) : void; + setDecelerationRate (decelerationRate: number) : void; setDisableBounce (disableBounce: boolean) : void; setHorizontalBounce (horizontalBounce: boolean) : void; setMaxZoomScale (maxZoomScale: number) : void; @@ -1947,13 +2290,16 @@ declare module Ti { caseInsensitiveSearch : boolean; defaultItemTemplate : any; editing : boolean; + footerDividersEnabled : boolean; footerTitle : string; footerView : Ti.UI.View; + headerDividersEnabled : boolean; headerTitle : string; headerView : Ti.UI.View; keepSectionsInSearch : boolean; pruneSectionsOnEdit : boolean; pullView : Ti.UI.View; + refreshControl : Ti.UI.RefreshControl; scrollIndicatorStyle : number; searchText : string; searchView : any; @@ -1961,6 +2307,7 @@ declare module Ti { sectionIndexTitles : Array; sections : Array; separatorColor : string; + separatorInsets : Dictionary; separatorStyle : number; showVerticalScrollIndicator : boolean; style : number; @@ -1975,20 +2322,24 @@ declare module Ti { getCaseInsensitiveSearch () : boolean; getDefaultItemTemplate () : any; getEditing () : boolean; + getFooterDividersEnabled () : boolean; getFooterTitle () : string; getFooterView () : Ti.UI.View; + getHeaderDividersEnabled () : boolean; getHeaderTitle () : string; getHeaderView () : Ti.UI.View; getKeepSectionsInSearch () : boolean; getPruneSectionsOnEdit () : boolean; getPullView () : Ti.UI.View; + getRefreshControl () : Ti.UI.RefreshControl; getScrollIndicatorStyle () : number; getSearchText () : string; - getSearchView () : Ti.UI.SearchBar; + getSearchView () : any; getSectionCount () : number; getSectionIndexTitles () : Array; getSections () : Array; getSeparatorColor () : string; + getSeparatorInsets () : Dictionary; getSeparatorStyle () : number; getShowVerticalScrollIndicator () : boolean; getStyle () : number; @@ -2014,12 +2365,15 @@ declare module Ti { setMarker (markerProps: ListViewMarkerProps) : void; setPruneSectionsOnEdit (pruneSectionsOnEdit: boolean) : void; setPullView (pullView: Ti.UI.View) : void; + setRefreshControl (refreshControl: Ti.UI.RefreshControl) : void; setScrollIndicatorStyle (scrollIndicatorStyle: number) : void; setSearchText (searchText: string) : void; setSearchView (searchView: Ti.UI.SearchBar) : void; + setSearchView (searchView: Ti.UI.Android.SearchView) : void; setSectionIndexTitles (sectionIndexTitles: Array) : void; setSections (sections: Array) : void; setSeparatorColor (separatorColor: string) : void; + setSeparatorInsets (separatorInsets: Dictionary) : void; setSeparatorStyle (separatorStyle: number) : void; setShowVerticalScrollIndicator (showVerticalScrollIndicator: boolean) : void; setWillScrollOnStatusTap (willScrollOnStatusTap: boolean) : void; @@ -2041,6 +2395,7 @@ declare module Ti { editButtonTitle : string; exitOnClose : boolean; navBarHidden : boolean; + navTintColor : any; shadowImage : string; tabDividerColor : string; tabDividerWidth : any; @@ -2056,6 +2411,9 @@ declare module Ti { tabsBackgroundSelectedColor : string; tabsBackgroundSelectedImage : string; tabsTintColor : any; + title : string; + titleAttributes : titleAttributesParams; + translucent : boolean; windowSoftInputMode : number; addTab (tab: Ti.UI.Tab) : void; close () : void; @@ -2075,6 +2433,7 @@ declare module Ti { getEditButtonTitle () : string; getExitOnClose () : boolean; getNavBarHidden () : boolean; + getNavTintColor () : string; getShadowImage () : string; getTabDividerColor () : string; getTabDividerWidth () : any; @@ -2090,6 +2449,9 @@ declare module Ti { getTabsBackgroundSelectedColor () : string; getTabsBackgroundSelectedImage () : string; getTabsTintColor () : string; + getTitle () : string; + getTitleAttributes () : titleAttributesParams; + getTranslucent () : boolean; getWindowSoftInputMode () : number; open () : void; removeTab (tab: Ti.UI.Tab) : void; @@ -2107,7 +2469,9 @@ declare module Ti { setAllowUserCustomization (allowUserCustomization: boolean) : void; setBarColor (barColor: string) : void; setEditButtonTitle (editButtonTitle: string) : void; + setExitOnClose (exitOnClose: boolean) : void; setNavBarHidden (navBarHidden: boolean) : void; + setNavTintColor (navTintColor: string) : void; setShadowImage (shadowImage: string) : void; setTabDividerColor (tabDividerColor: string) : void; setTabDividerWidth (tabDividerWidth: number) : void; @@ -2125,6 +2489,9 @@ declare module Ti { setTabsBackgroundSelectedColor (tabsBackgroundSelectedColor: string) : void; setTabsBackgroundSelectedImage (tabsBackgroundSelectedImage: string) : void; setTabsTintColor (tabsTintColor: string) : void; + setTitle (title: string) : void; + setTitleAttributes (titleAttributes: titleAttributesParams) : void; + setTranslucent (translucent: boolean) : void; } export interface TableView extends Ti.UI.View { allowsSelection : boolean; @@ -2132,10 +2499,13 @@ declare module Ti { data : any; editable : boolean; editing : boolean; + filterAnchored : boolean; filterAttribute : string; filterCaseInsensitive : boolean; + footerDividersEnabled : boolean; footerTitle : string; footerView : Ti.UI.View; + headerDividersEnabled : boolean; headerPullView : Ti.UI.View; headerTitle : string; headerView : Ti.UI.View; @@ -2146,6 +2516,7 @@ declare module Ti { moveable : boolean; moving : boolean; overScrollMode : number; + refreshControl : Ti.UI.RefreshControl; rowHeight : number; scrollIndicatorStyle : number; scrollable : boolean; @@ -2156,6 +2527,7 @@ declare module Ti { sectionCount : number; sections : Array; separatorColor : string; + separatorInsets : Dictionary; separatorStyle : number; showVerticalScrollIndicator : boolean; style : number; @@ -2176,10 +2548,13 @@ declare module Ti { getData () : any; getEditable () : boolean; getEditing () : boolean; + getFilterAnchored () : boolean; getFilterAttribute () : string; getFilterCaseInsensitive () : boolean; + getFooterDividersEnabled () : boolean; getFooterTitle () : string; getFooterView () : Ti.UI.View; + getHeaderDividersEnabled () : boolean; getHeaderPullView () : Ti.UI.View; getHeaderTitle () : string; getHeaderView () : Ti.UI.View; @@ -2190,6 +2565,7 @@ declare module Ti { getMoveable () : boolean; getMoving () : boolean; getOverScrollMode () : number; + getRefreshControl () : Ti.UI.RefreshControl; getRowHeight () : number; getScrollIndicatorStyle () : number; getScrollable () : boolean; @@ -2200,6 +2576,7 @@ declare module Ti { getSectionCount () : number; getSections () : Array; getSeparatorColor () : string; + getSeparatorInsets () : Dictionary; getSeparatorStyle () : number; getShowVerticalScrollIndicator () : boolean; getStyle () : number; @@ -2222,6 +2599,7 @@ declare module Ti { setData (data: Array, animation: TableViewAnimationProperties) : void; setEditable (editable: boolean) : void; setEditing (editing: boolean) : void; + setFilterAnchored (filterAnchored: boolean) : void; setFilterAttribute (filterAttribute: string) : void; setFilterCaseInsensitive (filterCaseInsensitive: boolean) : void; setFooterTitle (footerTitle: string) : void; @@ -2236,6 +2614,7 @@ declare module Ti { setMoveable (moveable: boolean) : void; setMoving (moving: boolean) : void; setOverScrollMode (overScrollMode: number) : void; + setRefreshControl (refreshControl: Ti.UI.RefreshControl) : void; setRowHeight (rowHeight: number) : void; setScrollIndicatorStyle (scrollIndicatorStyle: number) : void; setScrollable (scrollable: boolean) : void; @@ -2246,6 +2625,7 @@ declare module Ti { setSearchHidden (searchHidden: boolean) : void; setSections (sections: Array) : void; setSeparatorColor (separatorColor: string) : void; + setSeparatorInsets (separatorInsets: Dictionary) : void; setSeparatorStyle (separatorStyle: number) : void; setShowVerticalScrollIndicator (showVerticalScrollIndicator: boolean) : void; setStyle (style: number) : void; @@ -2254,9 +2634,13 @@ declare module Ti { } export interface Button extends Ti.UI.View { color : string; + disabledColor : string; font : Font; image : any; selectedColor : string; + shadowColor : string; + shadowOffset : Dictionary; + shadowRadius : number; style : number; systemButton : number; textAlign : any; @@ -2264,9 +2648,13 @@ declare module Ti { titleid : string; verticalAlign : any; getColor () : string; + getDisabledColor () : string; getFont () : Font; getImage () : any; getSelectedColor () : string; + getShadowColor () : string; + getShadowOffset () : Dictionary; + getShadowRadius () : number; getStyle () : number; getSystemButton () : number; getTextAlign () : any; @@ -2274,10 +2662,14 @@ declare module Ti { getTitleid () : string; getVerticalAlign () : any; setColor (color: string) : void; + setDisabledColor (disabledColor: string) : void; setFont (font: Font) : void; setImage (image: string) : void; setImage (image: Ti.Blob) : void; setSelectedColor (selectedColor: string) : void; + setShadowColor (shadowColor: string) : void; + setShadowOffset (shadowOffset: Dictionary) : void; + setShadowRadius (shadowRadius: number) : void; setStyle (style: number) : void; setSystemButton (systemButton: number) : void; setTextAlign (textAlign: string) : void; @@ -2292,6 +2684,7 @@ declare module Ti { buttonNames : Array; cancel : number; destructive : number; + opaquebackground : boolean; options : Array; persistent : boolean; selectedIndex : number; @@ -2301,6 +2694,7 @@ declare module Ti { getButtonNames () : Array; getCancel () : number; getDestructive () : number; + getOpaquebackground () : boolean; getOptions () : Array; getPersistent () : boolean; getSelectedIndex () : number; @@ -2309,22 +2703,21 @@ declare module Ti { hide (params?: hideParams) : void; setAndroidView (androidView: Ti.UI.View) : void; setCancel (cancel: number) : void; + setOpaquebackground (opaquebackground: boolean) : void; setPersistent (persistent: boolean) : void; setTitle (title: string) : void; setTitleid (titleid: string) : void; show (params?: showParams) : void; } - export interface ButtonBar extends Ti.UI.View { - index : number; - labels : any; - style : number; - getIndex () : number; - getLabels () : any; - getStyle () : number; - setIndex (index: number) : void; - setLabels (labels: Array) : void; - setLabels (labels: Array) : void; - setStyle (style: number) : void; + export interface RefreshControl extends Ti.Proxy { + tintColor : string; + title : Ti.UI.iOS.AttributedString; + beginRefreshing () : void; + endRefreshing () : void; + getTintColor () : string; + getTitle () : Ti.UI.iOS.AttributedString; + setTintColor (tintColor: string) : void; + setTitle (title: Ti.UI.iOS.AttributedString) : void; } export interface EmailDialog extends Ti.Proxy { CANCELLED : number; @@ -2460,10 +2853,12 @@ declare module Ti { setValue (value: number) : void; } export module MobileWeb { + export var apiName : string; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; export function applyProperties (props: Dictionary) : void; export function createNavigationGroup (parameters?: Dictionary) : Ti.UI.MobileWeb.NavigationGroup; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; export enum TableViewSeparatorStyle { NONE, @@ -2480,6 +2875,7 @@ declare module Ti { } } export interface Label extends Ti.UI.View { + attributedString : Ti.UI.iOS.AttributedString; autoLink : number; backgroundPaddingBottom : number; backgroundPaddingLeft : number; @@ -2490,14 +2886,17 @@ declare module Ti { font : Font; highlightedColor : string; html : string; + includeFontPadding : boolean; minimumFontSize : number; shadowColor : string; - shadowOffset : any; + shadowOffset : Dictionary; + shadowRadius : number; text : string; textAlign : any; textid : string; verticalAlign : any; wordWrap : boolean; + getAttributedString () : Ti.UI.iOS.AttributedString; getAutoLink () : number; getBackgroundPaddingBottom () : number; getBackgroundPaddingLeft () : number; @@ -2508,14 +2907,17 @@ declare module Ti { getFont () : Font; getHighlightedColor () : string; getHtml () : string; + getIncludeFontPadding () : boolean; getMinimumFontSize () : number; getShadowColor () : string; - getShadowOffset () : any; + getShadowOffset () : Dictionary; + getShadowRadius () : number; getText () : string; getTextAlign () : any; getTextid () : string; getVerticalAlign () : any; getWordWrap () : boolean; + setAttributedString (attributedString: Ti.UI.iOS.AttributedString) : void; setAutoLink (autoLink: number) : void; setBackgroundPaddingBottom (backgroundPaddingBottom: number) : void; setBackgroundPaddingLeft (backgroundPaddingLeft: number) : void; @@ -2526,9 +2928,11 @@ declare module Ti { setFont (font: Font) : void; setHighlightedColor (highlightedColor: string) : void; setHtml (html: string) : void; + setIncludeFontPadding (includeFontPadding: boolean) : void; setMinimumFontSize (minimumFontSize: number) : void; setShadowColor (shadowColor: string) : void; - setShadowOffset (shadowOffset: any) : void; + setShadowOffset (shadowOffset: Dictionary) : void; + setShadowRadius (shadowRadius: number) : void; setText (text: string) : void; setTextAlign (textAlign: string) : void; setTextAlign (textAlign: number) : void; @@ -2608,55 +3012,6 @@ declare module Ti { setHeaderTitle (headerTitle: string) : void; setHeaderView (headerView: Ti.UI.View) : void; } - export interface ActivityIndicator extends Ti.Proxy { - bottom : any; - color : string; - font : Font; - height : string; - indicatorColor : string; - indicatorDiameter : string; - left : any; - message : string; - messageid : string; - right : any; - style : number; - top : any; - width : string; - add () : void; - getBottom () : any; - getColor () : string; - getFont () : Font; - getHeight () : string; - getIndicatorColor () : string; - getIndicatorDiameter () : string; - getLeft () : any; - getMessage () : string; - getMessageid () : string; - getRight () : any; - getStyle () : number; - getTop () : any; - getWidth () : string; - hide () : void; - remove () : void; - setBottom (bottom: number) : void; - setBottom (bottom: string) : void; - setColor (color: string) : void; - setFont (font: Font) : void; - setHeight (height: string) : void; - setIndicatorColor (indicatorColor: string) : void; - setIndicatorDiameter (indicatorDiameter: string) : void; - setLeft (left: number) : void; - setLeft (left: string) : void; - setMessage (message: string) : void; - setMessageid (messageid: string) : void; - setRight (right: number) : void; - setRight (right: string) : void; - setStyle (style: number) : void; - setTop (top: number) : void; - setTop (top: string) : void; - setWidth (width: string) : void; - show () : void; - } export interface Animation extends Ti.Proxy { anchorPoint : Point; autoreverse : boolean; @@ -2764,20 +3119,73 @@ declare module Ti { setYOffset (yOffset: number) : void; } export interface PickerColumn extends Ti.UI.View { + font : Font; rowCount : number; rows : Array; selectedRow : Ti.UI.PickerRow; addRow (row: Ti.UI.PickerRow) : void; + getFont () : Font; getRowCount () : number; getRows () : Array; getSelectedRow () : Ti.UI.PickerRow; removeRow (row: Ti.UI.PickerRow) : void; + setFont (font: Font) : void; setSelectedRow (selectedRow: Ti.UI.PickerRow) : void; } - export interface Picker extends Ti.Proxy { + export interface ActivityIndicator extends Ti.Proxy { + bottom : any; + color : string; + font : Font; + height : string; + indicatorColor : string; + indicatorDiameter : string; + left : any; + message : string; + messageid : string; + right : any; + style : number; + top : any; + width : string; + add () : void; + getBottom () : any; + getColor () : string; + getFont () : Font; + getHeight () : string; + getIndicatorColor () : string; + getIndicatorDiameter () : string; + getLeft () : any; + getMessage () : string; + getMessageid () : string; + getRight () : any; + getStyle () : number; + getTop () : any; + getWidth () : string; + hide () : void; + remove () : void; + setBottom (bottom: number) : void; + setBottom (bottom: string) : void; + setColor (color: string) : void; + setFont (font: Font) : void; + setHeight (height: string) : void; + setIndicatorColor (indicatorColor: string) : void; + setIndicatorDiameter (indicatorDiameter: string) : void; + setLeft (left: number) : void; + setLeft (left: string) : void; + setMessage (message: string) : void; + setMessageid (messageid: string) : void; + setRight (right: number) : void; + setRight (right: string) : void; + setStyle (style: number) : void; + setTop (top: number) : void; + setTop (top: string) : void; + setWidth (width: string) : void; + show () : void; + } + export interface Picker extends Ti.UI.View { calendarViewShown : boolean; columns : Array; countDownDuration : number; + font : Font; format24 : boolean; locale : string; maxDate : Date; @@ -2795,6 +3203,7 @@ declare module Ti { getCalendarViewShown () : boolean; getColumns () : Array; getCountDownDuration () : number; + getFont () : Font; getFormat24 () : boolean; getLocale () : string; getMaxDate () : Date; @@ -2810,6 +3219,7 @@ declare module Ti { setCalendarViewShown (calendarViewShown: boolean) : void; setColumns (columns: Array) : void; setCountDownDuration (countDownDuration: number) : void; + setFont (font: Font) : void; setFormat24 (format24: boolean) : void; setLocale (locale: string) : void; setMaxDate (maxDate: Date) : void; @@ -2828,7 +3238,7 @@ declare module Ti { export enum Module { } - export interface API { + export interface API { debug (message: Array) : void; debug (message: string) : void; error (message: Array) : void; @@ -2857,10 +3267,12 @@ declare module Ti { export var ACTIVITYTYPE_FITNESS : string; export var ACTIVITYTYPE_OTHER : string; export var ACTIVITYTYPE_OTHER_NAVIGATION : string; + export var AUTHORIZATION_ALWAYS : number; export var AUTHORIZATION_AUTHORIZED : number; export var AUTHORIZATION_DENIED : number; export var AUTHORIZATION_RESTRICTED : number; export var AUTHORIZATION_UNKNOWN : number; + export var AUTHORIZATION_WHEN_IN_USE : number; export var ERROR_DENIED : number; export var ERROR_HEADING_FAILURE : number; export var ERROR_LOCATION_UNKNOWN : number; @@ -2874,6 +3286,7 @@ declare module Ti { export var PROVIDER_PASSIVE : string; export var accuracy : number; export var activityType : number; + export var apiName : string; export var bubbleParent : boolean; export var distanceFilter : number; export var frequency : number; @@ -2893,6 +3306,7 @@ declare module Ti { export function forwardGeocoder (address: string, callback: (...args : any[]) => any) : void; export function getAccuracy () : number; export function getActivityType () : number; + export function getApiName () : string; export function getBubbleParent () : boolean; export function getCurrentHeading (callback: (...args : any[]) => any) : void; export function getCurrentPosition (callback: (...args : any[]) => any) : void; @@ -2923,6 +3337,7 @@ declare module Ti { export function setShowCalibration (showCalibration: boolean) : void; export function setTrackSignificantLocationChange (trackSignificantLocationChange: boolean) : void; export module Android { + export var apiName : string; export var bubbleParent : boolean; export var manualMode : boolean; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; @@ -2932,6 +3347,7 @@ declare module Ti { export function createLocationProvider (parameters?: Dictionary) : Ti.Geolocation.Android.LocationProvider; export function createLocationRule (parameters?: Dictionary) : Ti.Geolocation.Android.LocationRule; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function getBubbleParent () : boolean; export function getManualMode () : boolean; export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; @@ -2984,16 +3400,149 @@ declare module Ti { } } export interface Proxy { + apiName : string; bubbleParent : boolean; addEventListener (name: string, callback: (...args : any[]) => any) : void; applyProperties (props: Dictionary) : void; fireEvent (name: string, event: Dictionary) : void; + getApiName () : string; getBubbleParent () : boolean; removeEventListener (name: string, callback: (...args : any[]) => any) : void; setBubbleParent (bubbleParent: boolean) : void; } + export module Map { + export var ANNOTATION_DRAG_STATE_CANCEL : number; + export var ANNOTATION_DRAG_STATE_DRAG : number; + export var ANNOTATION_DRAG_STATE_END : number; + export var ANNOTATION_DRAG_STATE_NONE : number; + export var ANNOTATION_DRAG_STATE_START : number; + export var ANNOTATION_GREEN : number; + export var ANNOTATION_PURPLE : number; + export var ANNOTATION_RED : number; + export var HYBRID_TYPE : number; + export var SATELLITE_TYPE : number; + export var STANDARD_TYPE : number; + export var TERRAIN_TYPE : number; + export var apiName : string; + export var bubbleParent : boolean; + export function addEventListener (name: string, callback: (...args : any[]) => any) : void; + export function applyProperties (props: Dictionary) : void; + export function createAnnotation (parameters?: Dictionary) : Ti.Map.Annotation; + export function createView (parameters?: Dictionary) : Ti.Map.View; + export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; + export function getBubbleParent () : boolean; + export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; + export function setBubbleParent (bubbleParent: boolean) : void; + export interface View extends Ti.UI.View { + animated : boolean; + annotations : Array; + hideAnnotationWhenTouchMap : boolean; + latitudeDelta : number; + longitudeDelta : number; + mapType : number; + region : MapRegionType; + regionFit : boolean; + userLocation : boolean; + addAnnotation (annotation: Dictionary) : void; + addAnnotation (annotation: Ti.Map.Annotation) : void; + addAnnotations (annotations: Array) : void; + addAnnotations (annotations: Array>) : void; + addRoute (route: MapRouteType) : void; + deselectAnnotation (annotation: string) : void; + deselectAnnotation (annotation: Ti.Map.Annotation) : void; + getAnimate () : boolean; + getAnimated () : boolean; + getAnnotations () : Array; + getHideAnnotationWhenTouchMap () : boolean; + getLatitudeDelta () : number; + getLongitudeDelta () : number; + getMapType () : number; + getRegion () : MapRegionType; + getRegionFit () : boolean; + getUserLocation () : boolean; + removeAllAnnotations () : void; + removeAnnotation (annotation: string) : void; + removeAnnotation (annotation: Ti.Map.Annotation) : void; + removeAnnotations (annotations: Array) : void; + removeAnnotations (annotations: Array) : void; + removeRoute (route: MapRouteType) : void; + selectAnnotation (annotation: string) : void; + selectAnnotation (annotation: Ti.Map.Annotation) : void; + setAnimate (animate: boolean) : void; + setAnimated (animated: boolean) : void; + setAnnotations (annotations: Array) : void; + setHideAnnotationWhenTouchMap (hideAnnotationWhenTouchMap: boolean) : void; + setLocation (location: MapLocationType) : void; + setMapType (mapType: number) : void; + setRegion (region: MapRegionType) : void; + setRegionFit (regionFit: boolean) : void; + setUserLocation (userLocation: boolean) : void; + zoom (level: number) : void; + } + export interface Annotation extends Ti.Proxy { + animate : boolean; + canShowCallout : boolean; + centerOffset : Point; + customView : Ti.UI.View; + draggable : boolean; + image : any; + latitude : number; + leftButton : any; + leftView : Ti.UI.View; + longitude : number; + pinImage : string; + pincolor : number; + rightButton : any; + rightView : Ti.UI.View; + subtitle : string; + subtitleid : string; + title : string; + titleid : string; + getAnimate () : boolean; + getCanShowCallout () : boolean; + getCenterOffset () : Point; + getCustomView () : Ti.UI.View; + getDraggable () : boolean; + getImage () : any; + getLatitude () : number; + getLeftButton () : any; + getLeftView () : Ti.UI.View; + getLongitude () : number; + getPinImage () : string; + getPincolor () : number; + getRightButton () : any; + getRightView () : Ti.UI.View; + getSubtitle () : string; + getSubtitleid () : string; + getTitle () : string; + getTitleid () : string; + setAnimate (animate: boolean) : void; + setCanShowCallout (canShowCallout: boolean) : void; + setCenterOffset (centerOffset: Point) : void; + setCustomView (customView: Ti.UI.View) : void; + setDraggable (draggable: boolean) : void; + setImage (image: string) : void; + setImage (image: Ti.Blob) : void; + setLatitude (latitude: number) : void; + setLeftButton (leftButton: number) : void; + setLeftButton (leftButton: string) : void; + setLeftView (leftView: Ti.UI.View) : void; + setLongitude (longitude: number) : void; + setPinImage (pinImage: string) : void; + setPincolor (pincolor: number) : void; + setRightButton (rightButton: number) : void; + setRightButton (rightButton: string) : void; + setRightView (rightView: Ti.UI.View) : void; + setSubtitle (subtitle: string) : void; + setSubtitleid (subtitleid: string) : void; + setTitle (title: string) : void; + setTitleid (titleid: string) : void; + } + } export module Cloud { export var accessToken : string; + export var apiName : string; export var bubbleParent : boolean; export var debug : boolean; export var expiresIn : number; @@ -3003,6 +3552,7 @@ declare module Ti { export var useSecure : boolean; export function applyProperties (props: Dictionary) : void; export function getAccessToken () : string; + export function getApiName () : string; export function getBubbleParent () : boolean; export function getDebug () : boolean; export function getExpiresIn () : number; @@ -3012,6 +3562,7 @@ declare module Ti { export function getUseSecure () : boolean; export function hasStoredSession () : boolean; export function retrieveStoredSession () : string; + export function sendRequest (parameters: Dictionary, callback: (...args : any[]) => any) : void; export function setAccessToken (accessToken: string) : void; export function setBubbleParent (bubbleParent: boolean) : void; export function setDebug (debug: boolean) : void; @@ -3026,13 +3577,6 @@ declare module Ti { show (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; update (parameters: Dictionary, callback: (...args : any[]) => any) : void; } - export interface Files { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } export interface SocialIntegrations { externalAccountLink (parameters: Dictionary, callback: (...args : any[]) => any) : void; externalAccountLogin (parameters: Dictionary, callback: (...args : any[]) => any) : void; @@ -3042,10 +3586,16 @@ declare module Ti { export interface PushNotifications { notify (parameters: Dictionary, callback: (...args : any[]) => any) : void; notifyTokens (parameters: Dictionary, callback: (...args : any[]) => any) : void; + query (parameters: Dictionary, callback: (...args : any[]) => any) : void; + queryChannels (parameters: Dictionary, callback: (...args : any[]) => any) : void; + resetBadge (parameters: Dictionary, callback: (...args : any[]) => any) : void; + setBadge (parameters: Dictionary, callback: (...args : any[]) => any) : void; + showChannels (parameters: Dictionary, callback: (...args : any[]) => any) : void; subscribe (parameters: Dictionary, callback: (...args : any[]) => any) : void; subscribeToken (parameters: Dictionary, callback: (...args : any[]) => any) : void; unsubscribe (parameters: Dictionary, callback: (...args : any[]) => any) : void; unsubscribeToken (parameters: Dictionary, callback: (...args : any[]) => any) : void; + updateSubscription (parameters: Dictionary, callback: (...args : any[]) => any) : void; } export interface Clients { geolocate (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; @@ -3066,6 +3616,7 @@ declare module Ti { query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; requestResetPassword (parameters: Dictionary, callback: (...args : any[]) => any) : void; + resendConfirmation (parameters: Dictionary, callback: (...args : any[]) => any) : void; search (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; secureCreate (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; secureLogin (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; @@ -3107,6 +3658,8 @@ declare module Ti { create (parameters: Dictionary, callback: (...args : any[]) => any) : void; getChatGroups (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; query (parameters: Dictionary, callback: (...args : any[]) => any) : void; + queryChatGroups (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; + remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; } export interface KeyValues { append (parameters: Dictionary, callback: (...args : any[]) => any) : void; @@ -3115,6 +3668,12 @@ declare module Ti { remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; set (parameters: Dictionary, callback: (...args : any[]) => any) : void; } + export interface GeoFences { + create (parameters: Dictionary, callback: (...args : any[]) => any) : void; + query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; + remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; + update (parameters: Dictionary, callback: (...args : any[]) => any) : void; + } export interface Checkins { create (parameters: Dictionary, callback: (...args : any[]) => any) : void; query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; @@ -3128,6 +3687,22 @@ declare module Ti { requests (parameters: Dictionary, callback: (...args : any[]) => any) : void; search (parameters: Dictionary, callback: (...args : any[]) => any) : void; } + export interface Files { + create (parameters: Dictionary, callback: (...args : any[]) => any) : void; + query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; + remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; + show (parameters: Dictionary, callback: (...args : any[]) => any) : void; + update (parameters: Dictionary, callback: (...args : any[]) => any) : void; + } + export interface PushSchedules { + create (parameters: Dictionary, callback: (...args : any[]) => any) : void; + query (parameters: Dictionary, callback: (...args : any[]) => any) : void; + remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; + } + export interface Likes { + create (parameters: Dictionary, callback: (...args : any[]) => any) : void; + remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; + } export interface Photos { create (parameters: Dictionary, callback: (...args : any[]) => any) : void; query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; @@ -3138,8 +3713,11 @@ declare module Ti { } export interface Statuses { create (parameters: Dictionary, callback: (...args : any[]) => any) : void; + delete (parameters: Dictionary, callback: (...args : any[]) => any) : void; query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; search (parameters: Dictionary, callback: (...args : any[]) => any) : void; + show (parameters: Dictionary, callback: (...args : any[]) => any) : void; + update (parameters: Dictionary, callback: (...args : any[]) => any) : void; } export interface PhotoCollections { create (parameters: Dictionary, callback: (...args : any[]) => any) : void; @@ -3234,11 +3812,13 @@ declare module Ti { export var EVENT_ACCESSIBILITY_CHANGED : string; export var accessibilityEnabled : boolean; export var analytics : boolean; + export var apiName : string; export var bubbleParent : boolean; export var copyright : string; export var deployType : string; export var description : string; export var disableNetworkActivityIndicator : boolean; + export var forceSplashAsSnapshot : boolean; export var guid : string; export var id : string; export var idleTimerDisabled : boolean; @@ -3257,12 +3837,14 @@ declare module Ti { export function fireSystemEvent (eventName: string, param?: any) : void; export function getAccessibilityEnabled () : boolean; export function getAnalytics () : boolean; + export function getApiName () : string; export function getArguments () : launchOptions; export function getBubbleParent () : boolean; export function getCopyright () : string; export function getDeployType () : string; export function getDescription () : string; export function getDisableNetworkActivityIndicator () : boolean; + export function getForceSplashAsSnapshot () : boolean; export function getGuid () : string; export function getId () : string; export function getIdleTimerDisabled () : boolean; @@ -3278,29 +3860,87 @@ declare module Ti { export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; export function setBubbleParent (bubbleParent: boolean) : void; export function setDisableNetworkActivityIndicator (disableNetworkActivityIndicator: boolean) : void; + export function setForceSplashAsSnapshot (forceSplashAsSnapshot: boolean) : void; export function setIdleTimerDisabled (idleTimerDisabled: boolean) : void; export function setProximityDetection (proximityDetection: boolean) : void; - export enum Android { - R + export module Android { + export var R : Ti.App.Android.R; + export var apiName : string; + export var appVersionCode : number; + export var appVersionName : string; + export var bubbleParent : boolean; + export var launchIntent : Ti.Android.Intent; + export function addEventListener (name: string, callback: (...args : any[]) => any) : void; + export function applyProperties (props: Dictionary) : void; + export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; + export function getAppVersionCode () : number; + export function getAppVersionName () : string; + export function getBubbleParent () : boolean; + export function getLaunchIntent () : Ti.Android.Intent; + export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; + export function setBubbleParent (bubbleParent: boolean) : void; + export interface R { + + } } export module iOS { + export var BACKGROUNDFETCHINTERVAL_MIN : number; + export var BACKGROUNDFETCHINTERVAL_NEVER : number; export var EVENT_ACCESSIBILITY_LAYOUT_CHANGED : string; export var EVENT_ACCESSIBILITY_SCREEN_CHANGED : string; + export var USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND : number; + export var USER_NOTIFICATION_ACTIVATION_MODE_FOREGROUND : number; + export var USER_NOTIFICATION_TYPE_ALERT : number; + export var USER_NOTIFICATION_TYPE_BADGE : number; + export var USER_NOTIFICATION_TYPE_NONE : number; + export var USER_NOTIFICATION_TYPE_SOUND : number; + export var apiName : string; + export var applicationOpenSettingsURL : string; export var bubbleParent : boolean; + export var currentUserNotificationSettings : UserNotificationSettings; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; export function applyProperties (props: Dictionary) : void; export function cancelAllLocalNotifications () : void; export function cancelLocalNotification (id: number) : void; - export function createLocalNotification (parameters?: Dictionary) : Ti.App.iOS.LocalNotification; + export function cancelLocalNotification (id: string) : void; + export function createUserNotificationAction (parameters?: Dictionary) : Ti.App.iOS.UserNotificationAction; + export function createUserNotificationCategory (parameters?: Dictionary) : Ti.App.iOS.UserNotificationCategory; + export function endBackgroundHandler (handlerID: string) : void; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; + export function getApplicationOpenSettingsURL () : string; export function getBubbleParent () : boolean; + export function getCurrentUserNotificationSettings () : UserNotificationSettings; export function registerBackgroundService (params: Dictionary) : Ti.App.iOS.BackgroundService; + export function registerUserNotificationSettings (params: UserNotificationSettings) : void; export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function scheduleLocalNotification (params: Dictionary) : Ti.App.iOS.LocalNotification; + export function scheduleLocalNotification (params: NotificationParams) : Ti.App.iOS.LocalNotification; export function setBubbleParent (bubbleParent: boolean) : void; + export function setMinimumBackgroundFetchInterval (fetchInterval: number) : void; + export interface UserNotificationAction extends Ti.Proxy { + activationMode : number; + authenticationRequired : boolean; + destructive : boolean; + identifier : string; + title : string; + getActivationMode () : number; + getAuthenticationRequired () : boolean; + getDestructive () : boolean; + getIdentifier () : string; + getTitle () : string; + } export interface LocalNotification extends Ti.Proxy { cancel () : void; } + export interface UserNotificationCategory extends Ti.Proxy { + actionsForDefaultContext : Array; + actionsForMinimalContext : Array; + identifier : string; + getActionsForDefaultContext () : Array; + getActionsForMinimalContext () : Array; + getIdentifier () : string; + } export interface BackgroundService extends Ti.Proxy { url : string; getUrl () : string; @@ -3534,6 +4174,7 @@ declare module Ti { export var STREAM_SYSTEM : number; export var STREAM_VOICE_CALL : number; export var URI_INTENT_SCHEME : number; + export var apiName : string; export var bubbleParent : boolean; export var currentActivity : Ti.Android.Activity; export var currentService : Ti.Android.Service; @@ -3549,6 +4190,7 @@ declare module Ti { export function createService (intent: Ti.Android.Intent) : Ti.Android.Service; export function createServiceIntent (options: ServiceIntentOptions) : Ti.Android.Intent; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function getBubbleParent () : boolean; export function getCurrentActivity () : Ti.Android.Activity; export function getCurrentService () : Ti.Android.Service; @@ -3587,29 +4229,6 @@ declare module Ti { putExtraUri (name: string, value: string) : void; setFlags (flags: number) : void; } - export interface Activity extends Ti.Proxy { - actionBar : Ti.Android.ActionBar; - intent : Ti.Android.Intent; - onCreateOptionsMenu : (...args : any[]) => any; - onPrepareOptionsMenu : (...args : any[]) => any; - requestedOrientation : number; - finish () : void; - getActionBar () : Ti.Android.ActionBar; - getIntent () : Ti.Android.Intent; - getOnCreateOptionsMenu () : (...args : any[]) => any; - getOnPrepareOptionsMenu () : (...args : any[]) => any; - getString (resourceId: number, format: any) : string; - invalidateOptionsMenu () : void; - openOptionsMenu () : void; - sendBroadcast (intent: Ti.Android.Intent) : void; - sendBroadcastWithPermission (intent: Ti.Android.Intent, receiverPermission?: string) : void; - setOnCreateOptionsMenu (onCreateOptionsMenu: (...args : any[]) => any) : void; - setOnPrepareOptionsMenu (onPrepareOptionsMenu: (...args : any[]) => any) : void; - setRequestedOrientation (orientation: number) : void; - setResult (resultCode: number, intent?: Ti.Android.Intent) : void; - startActivity (intent: Ti.Android.Intent) : void; - startActivityForResult (intent: Ti.Android.Intent, callback: (...args : any[]) => any) : void; - } export interface Notification extends Ti.Proxy { audioStreamType : number; contentIntent : Ti.Android.PendingIntent; @@ -3679,6 +4298,7 @@ declare module Ti { export var VISIBILITY_PUBLIC : number; export var allAlerts : Array; export var allCalendars : Array; + export var apiName : string; export var bubbleParent : boolean; export var selectableCalendars : Array; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; @@ -3686,6 +4306,7 @@ declare module Ti { export function fireEvent (name: string, event: Dictionary) : void; export function getAllAlerts () : Array; export function getAllCalendars () : Array; + export function getApiName () : string; export function getBubbleParent () : boolean; export function getCalendarById (id: number) : Ti.Android.Calendar.Calendar; export function getSelectableCalendars () : Array; @@ -3837,20 +4458,27 @@ declare module Ti { export interface ActionBar extends Ti.Proxy { backgroundImage : string; displayHomeAsUp : boolean; + homeButtonEnabled : boolean; icon : string; logo : string; navigationMode : number; onHomeIconItemSelected : (...args : any[]) => any; + subtitle : string; title : string; getNavigationMode () : number; + getSubtitle () : string; getTitle () : string; hide () : void; setBackgroundImage (backgroundImage: string) : void; setDisplayHomeAsUp (displayHomeAsUp: boolean) : void; + setDisplayShowHomeEnabled (show: boolean) : void; + setDisplayShowTitleEnabled (show: boolean) : void; + setHomeButtonEnabled (homeButtonEnabled: boolean) : void; setIcon (icon: string) : void; setLogo (logo: string) : void; setNavigationMode (navigationMode: number) : void; setOnHomeIconItemSelected (onHomeIconItemSelected: (...args : any[]) => any) : void; + setSubtitle (subtitle: string) : void; setTitle (title: string) : void; show () : void; } @@ -3878,6 +4506,50 @@ declare module Ti { setGroupVisible (groupId: number, visible: boolean) : void; size () : number; } + export interface Activity extends Ti.Proxy { + actionBar : Ti.Android.ActionBar; + intent : Ti.Android.Intent; + onCreate : (...args : any[]) => any; + onCreateOptionsMenu : (...args : any[]) => any; + onDestroy : (...args : any[]) => any; + onPause : (...args : any[]) => any; + onPrepareOptionsMenu : (...args : any[]) => any; + onRestart : (...args : any[]) => any; + onResume : (...args : any[]) => any; + onStart : (...args : any[]) => any; + onStop : (...args : any[]) => any; + requestedOrientation : number; + finish () : void; + getActionBar () : Ti.Android.ActionBar; + getIntent () : Ti.Android.Intent; + getOnCreate () : (...args : any[]) => any; + getOnCreateOptionsMenu () : (...args : any[]) => any; + getOnDestroy () : (...args : any[]) => any; + getOnPause () : (...args : any[]) => any; + getOnPrepareOptionsMenu () : (...args : any[]) => any; + getOnRestart () : (...args : any[]) => any; + getOnResume () : (...args : any[]) => any; + getOnStart () : (...args : any[]) => any; + getOnStop () : (...args : any[]) => any; + getString (resourceId: number, format: any) : string; + invalidateOptionsMenu () : void; + openOptionsMenu () : void; + sendBroadcast (intent: Ti.Android.Intent) : void; + sendBroadcastWithPermission (intent: Ti.Android.Intent, receiverPermission?: string) : void; + setOnCreate (onCreate: (...args : any[]) => any) : void; + setOnCreateOptionsMenu (onCreateOptionsMenu: (...args : any[]) => any) : void; + setOnDestroy (onDestroy: (...args : any[]) => any) : void; + setOnPause (onPause: (...args : any[]) => any) : void; + setOnPrepareOptionsMenu (onPrepareOptionsMenu: (...args : any[]) => any) : void; + setOnRestart (onRestart: (...args : any[]) => any) : void; + setOnResume (onResume: (...args : any[]) => any) : void; + setOnStart (onStart: (...args : any[]) => any) : void; + setOnStop (onStop: (...args : any[]) => any) : void; + setRequestedOrientation (orientation: number) : void; + setResult (resultCode: number, intent?: Ti.Android.Intent) : void; + startActivity (intent: Ti.Android.Intent) : void; + startActivityForResult (intent: Ti.Android.Intent, callback: (...args : any[]) => any) : void; + } export interface Service extends Ti.Proxy { intent : Ti.Android.Intent; serviceInstanceId : number; @@ -3919,10 +4591,12 @@ declare module Ti { export var FIELD_TYPE_FLOAT : number; export var FIELD_TYPE_INT : number; export var FIELD_TYPE_STRING : number; + export var apiName : string; export var bubbleParent : boolean; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; export function applyProperties (props: Dictionary) : void; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function getBubbleParent () : boolean; export function install (path: string, dbName: string) : Ti.Database.DB; export function open (dbName: string) : Ti.Database.DB; @@ -3972,6 +4646,7 @@ declare module Ti { export var CONTACTS_KIND_PERSON : number; export var CONTACTS_SORT_FIRST_NAME : number; export var CONTACTS_SORT_LAST_NAME : number; + export var apiName : string; export var bubbleParent : boolean; export var contactsAuthorization : number; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; @@ -3981,6 +4656,7 @@ declare module Ti { export function fireEvent (name: string, event: Dictionary) : void; export function getAllGroups () : Array; export function getAllPeople (limit: number) : Array; + export function getApiName () : string; export function getBubbleParent () : boolean; export function getContactsAuthorization () : number; export function getGroupByID (id: number) : Ti.Contacts.Group; @@ -3995,10 +4671,12 @@ declare module Ti { export function setBubbleParent (bubbleParent: boolean) : void; export function showContacts (params: showContactsParams) : void; export module Tizen { + export var apiName : string; export function addEventListener (name: string, callback: (...args : any[]) => any) : void; export function applyProperties (props: Dictionary) : void; export function fireEvent (name: string, event: Dictionary) : void; export function getAllPeople (callback: (...args : any[]) => any) : void; + export function getApiName () : string; export function getPeopleWithName (name: string, callback: (...args : any[]) => any) : void; export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; export interface Group { @@ -4100,6 +4778,11 @@ declare module Ti { } } export interface CloudPush { + SERVICE_DISABLED : number; + SERVICE_INVALID : number; + SERVICE_MISSING : number; + SERVICE_VERSION_UPDATE_REQUIRED : number; + SUCCESS : number; enabled : boolean; focusAppOnPush : boolean; showAppOnTrayClick : boolean; @@ -4113,6 +4796,7 @@ declare module Ti { getShowTrayNotification () : boolean; getShowTrayNotificationsWhenFocused () : boolean; getSingleCallback () : boolean; + isGooglePlayServicesAvailable () : number; retrieveDeviceToken (config: CloudPushNotificationConfig) : void; setEnabled (enabled: boolean) : void; setFocusAppOnPush (focusAppOnPush: boolean) : void; @@ -4145,14 +4829,38 @@ declare module Ti { export var AUDIO_MICROPHONE : number; export var AUDIO_MUTED : number; export var AUDIO_RECEIVER_AND_MIC : number; + export var AUDIO_SESSION_CATEGORY_AMBIENT : string; + export var AUDIO_SESSION_CATEGORY_PLAYBACK : string; + export var AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD : string; + export var AUDIO_SESSION_CATEGORY_RECORD : string; + export var AUDIO_SESSION_CATEGORY_SOLO_AMBIENT : string; export var AUDIO_SESSION_MODE_AMBIENT : number; export var AUDIO_SESSION_MODE_PLAYBACK : number; export var AUDIO_SESSION_MODE_PLAY_AND_RECORD : number; export var AUDIO_SESSION_MODE_RECORD : number; export var AUDIO_SESSION_MODE_SOLO_AMBIENT : number; + export var AUDIO_SESSION_OVERRIDE_ROUTE_NONE : number; + export var AUDIO_SESSION_OVERRIDE_ROUTE_SPEAKER : number; + export var AUDIO_SESSION_PORT_AIRPLAY : string; + export var AUDIO_SESSION_PORT_BLUETOOTHA2DP : string; + export var AUDIO_SESSION_PORT_BLUETOOTHHFP : string; + export var AUDIO_SESSION_PORT_BLUETOOTHLE : string; + export var AUDIO_SESSION_PORT_BUILTINMIC : string; + export var AUDIO_SESSION_PORT_BUILTINRECEIVER : string; + export var AUDIO_SESSION_PORT_BUILTINSPEAKER : string; + export var AUDIO_SESSION_PORT_CARAUDIO : string; + export var AUDIO_SESSION_PORT_HDMI : string; + export var AUDIO_SESSION_PORT_HEADPHONES : string; + export var AUDIO_SESSION_PORT_HEADSETMIC : string; + export var AUDIO_SESSION_PORT_LINEIN : string; + export var AUDIO_SESSION_PORT_LINEOUT : string; + export var AUDIO_SESSION_PORT_USBAUDIO : string; export var AUDIO_SPEAKER : number; export var AUDIO_UNAVAILABLE : number; export var AUDIO_UNKNOWN : number; + export var CAMERA_FLASH_AUTO : number; + export var CAMERA_FLASH_OFF : number; + export var CAMERA_FLASH_ON : number; export var CAMERA_FRONT : number; export var CAMERA_REAR : number; export var DEVICE_BUSY : number; @@ -4224,9 +4932,11 @@ declare module Ti { export var VIDEO_SOURCE_TYPE_UNKNOWN : number; export var VIDEO_TIME_OPTION_EXACT : number; export var VIDEO_TIME_OPTION_NEAREST_KEYFRAME : number; + export var apiName : string; export var appMusicPlayer : Ti.Media.MusicPlayer; export var audioLineType : number; export var audioPlaying : boolean; + export var audioSessionCategory : number; export var audioSessionMode : number; export var availableCameraMediaTypes : Array; export var availableCameras : Array; @@ -4234,7 +4944,9 @@ declare module Ti { export var availablePhotoMediaTypes : Array; export var averageMicrophonePower : number; export var bubbleParent : boolean; + export var cameraFlashMode : number; export var canRecord : boolean; + export var currentRoute : RouteDescription; export var isCameraSupported : boolean; export var peakMicrophonePower : number; export var systemMusicPlayer : Ti.Media.MusicPlayer; @@ -4249,9 +4961,11 @@ declare module Ti { export function createSound (parameters?: Dictionary) : Ti.Media.Sound; export function createVideoPlayer (parameters?: Dictionary) : Ti.Media.VideoPlayer; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function getAppMusicPlayer () : Ti.Media.MusicPlayer; export function getAudioLineType () : number; export function getAudioPlaying () : boolean; + export function getAudioSessionCategory () : number; export function getAudioSessionMode () : number; export function getAvailableCameraMediaTypes () : Array; export function getAvailableCameras () : Array; @@ -4259,7 +4973,9 @@ declare module Ti { export function getAvailablePhotoMediaTypes () : Array; export function getAverageMicrophonePower () : number; export function getBubbleParent () : boolean; + export function getCameraFlashMode () : number; export function getCanRecord () : boolean; + export function getCurrentRoute () : RouteDescription; export function getIsCameraSupported () : boolean; export function getPeakMicrophonePower () : number; export function getSystemMusicPlayer () : Ti.Media.MusicPlayer; @@ -4275,12 +4991,15 @@ declare module Ti { export function requestAuthorization (callback: (...args : any[]) => any) : void; export function saveToPhotoGallery (media: Ti.Blob, callbacks: any) : void; export function saveToPhotoGallery (media: Ti.Filesystem.File, callbacks: any) : void; + export function setAudioSessionCategory (audioSessionCategory: number) : void; export function setAudioSessionMode (audioSessionMode: number) : void; export function setAvailableCameraMediaTypes (availableCameraMediaTypes: Array) : void; export function setAvailablePhotoGalleryMediaTypes (availablePhotoGalleryMediaTypes: Array) : void; export function setAvailablePhotoMediaTypes (availablePhotoMediaTypes: Array) : void; export function setAverageMicrophonePower (averageMicrophonePower: number) : void; export function setBubbleParent (bubbleParent: boolean) : void; + export function setCameraFlashMode (cameraFlashMode: number) : void; + export function setOverrideAudioRoute (route: number) : void; export function showCamera (options: CameraOptionsType) : void; export function startMicrophoneMonitor () : void; export function stopMicrophoneMonitor () : void; @@ -4289,6 +5008,15 @@ declare module Ti { export function takeScreenshot (callback: (...args : any[]) => any) : void; export function vibrate (pattern?: Array) : void; export interface Sound extends Ti.Proxy { + STATE_BUFFERING : number; + STATE_INITIALIZED : number; + STATE_PAUSED : number; + STATE_PLAYING : number; + STATE_STARTING : number; + STATE_STOPPED : number; + STATE_STOPPING : number; + STATE_WAITING_FOR_DATA : number; + STATE_WAITING_FOR_QUEUE : number; allowBackground : boolean; duration : number; looping : boolean; @@ -4315,64 +5043,6 @@ declare module Ti { setVolume (volume: number) : void; stop () : void; } - export interface AudioRecorder extends Ti.Proxy { - compression : number; - format : number; - paused : boolean; - recording : boolean; - stopped : boolean; - getCompression () : number; - getFormat () : number; - getPaused () : boolean; - getRecording () : boolean; - getStopped () : boolean; - pause () : void; - resume () : void; - setCompression (compression: number) : void; - setFormat (format: number) : void; - start () : void; - stop () : Ti.Filesystem.File; - } - export interface Item extends Ti.Proxy { - albumArtist : string; - albumTitle : string; - albumTrackCount : number; - albumTrackNumber : number; - artist : string; - artwork : Ti.Blob; - composer : string; - discCount : number; - discNumber : number; - genre : string; - isCompilation : boolean; - lyrics : string; - mediaType : number; - playCount : number; - playbackDuration : number; - podcastTitle : string; - rating : number; - skipCount : number; - title : string; - getAlbumArtist () : string; - getAlbumTitle () : string; - getAlbumTrackCount () : number; - getAlbumTrackNumber () : number; - getArtist () : string; - getArtwork () : Ti.Blob; - getComposer () : string; - getDiscCount () : number; - getDiscNumber () : number; - getGenre () : string; - getIsCompilation () : boolean; - getLyrics () : string; - getMediaType () : number; - getPlayCount () : number; - getPlaybackDuration () : number; - getPodcastTitle () : string; - getRating () : number; - getSkipCount () : number; - getTitle () : string; - } export interface VideoPlayer extends Ti.UI.View { allowsAirPlay : boolean; autoplay : boolean; @@ -4450,6 +5120,64 @@ declare module Ti { stop () : void; thumbnailImageAtTime (time: number, option: number) : Ti.Blob; } + export interface AudioRecorder extends Ti.Proxy { + compression : number; + format : number; + paused : boolean; + recording : boolean; + stopped : boolean; + getCompression () : number; + getFormat () : number; + getPaused () : boolean; + getRecording () : boolean; + getStopped () : boolean; + pause () : void; + resume () : void; + setCompression (compression: number) : void; + setFormat (format: number) : void; + start () : void; + stop () : Ti.Filesystem.File; + } + export interface Item extends Ti.Proxy { + albumArtist : string; + albumTitle : string; + albumTrackCount : number; + albumTrackNumber : number; + artist : string; + artwork : Ti.Blob; + composer : string; + discCount : number; + discNumber : number; + genre : string; + isCompilation : boolean; + lyrics : string; + mediaType : number; + playCount : number; + playbackDuration : number; + podcastTitle : string; + rating : number; + skipCount : number; + title : string; + getAlbumArtist () : string; + getAlbumTitle () : string; + getAlbumTrackCount () : number; + getAlbumTrackNumber () : number; + getArtist () : string; + getArtwork () : Ti.Blob; + getComposer () : string; + getDiscCount () : number; + getDiscNumber () : number; + getGenre () : string; + getIsCompilation () : boolean; + getLyrics () : string; + getMediaType () : number; + getPlayCount () : number; + getPlaybackDuration () : number; + getPodcastTitle () : string; + getRating () : number; + getSkipCount () : number; + getTitle () : string; + } export interface MusicPlayer extends Ti.Proxy { currentPlaybackTime : number; nowPlaying : Ti.Media.Item; @@ -4494,11 +5222,13 @@ declare module Ti { autoplay : boolean; bitRate : number; bufferSize : number; + duration : number; idle : boolean; paused : boolean; playing : boolean; progress : number; state : number; + time : number; url : string; volume : number; waiting : boolean; @@ -4506,11 +5236,13 @@ declare module Ti { getAutoplay () : boolean; getBitRate () : number; getBufferSize () : number; + getDuration () : number; getIdle () : boolean; getPaused () : boolean; getPlaying () : boolean; getProgress () : number; getState () : number; + getTime () : number; getUrl () : string; getVolume () : number; getWaiting () : boolean; @@ -4522,6 +5254,7 @@ declare module Ti { setBitRate (bitRate: number) : void; setBufferSize (bufferSize: number) : void; setPaused (paused: boolean) : void; + setTime (time: number) : void; setUrl (url: string) : void; setVolume (volume: number) : void; start () : void; @@ -4533,274 +5266,13 @@ declare module Ti { setSystemWallpaper (image: Ti.Blob, scale: boolean) : void; } } - export module Network { - export var INADDR_ANY : string; - export var NETWORK_LAN : number; - export var NETWORK_MOBILE : number; - export var NETWORK_NONE : number; - export var NETWORK_UNKNOWN : number; - export var NETWORK_WIFI : number; - export var NOTIFICATION_TYPE_ALERT : number; - export var NOTIFICATION_TYPE_BADGE : number; - export var NOTIFICATION_TYPE_NEWSSTAND : number; - export var NOTIFICATION_TYPE_SOUND : number; - export var READ_MODE : number; - export var READ_WRITE_MODE : number; - export var SOCKET_CLOSED : number; - export var SOCKET_CONNECTED : number; - export var SOCKET_ERROR : number; - export var SOCKET_INITIALIZED : number; - export var SOCKET_LISTENING : number; - export var TLS_VERSION_1_0 : number; - export var TLS_VERSION_1_1 : number; - export var TLS_VERSION_1_2 : number; - export var WRITE_MODE : number; - export var bubbleParent : boolean; - export var httpURLFormatter : (...args : any[]) => any; - export var networkType : number; - export var networkTypeName : string; - export var online : boolean; - export var remoteDeviceUUID : string; - export var remoteNotificationTypes : Array; - export var remoteNotificationsEnabled : boolean; - export function addConnectivityListener (callback: (...args : any[]) => any) : void; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createBonjourBrowser (serviceType: string, domain: string, parameters?: Dictionary) : Ti.Network.BonjourBrowser; - export function createBonjourService (name: string, type: string, domain: string, parameters?: Dictionary) : Ti.Network.BonjourService; - export function createHTTPClient (parameters?: Dictionary) : Ti.Network.HTTPClient; - export function createTCPSocket (hostName: string, port: number, mode: number, parameters: Dictionary) : Ti.Network.TCPSocket; - export function decodeURIComponent (value: string) : string; - export function encodeURIComponent (value: string) : string; - export function fireEvent (name: string, event: Dictionary) : void; - export function getBubbleParent () : boolean; - export function getHttpURLFormatter () : (...args : any[]) => any; - export function getNetworkType () : number; - export function getNetworkTypeName () : string; - export function getOnline () : boolean; - export function getRemoteDeviceUUID () : string; - export function getRemoteNotificationTypes () : Array; - export function getRemoteNotificationsEnabled () : boolean; - export function registerForPushNotifications (config: PushNotificationConfig) : void; - export function removeConnectivityListener (callback: (...args : any[]) => any) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setHttpURLFormatter (httpURLFormatter: (...args : any[]) => any) : void; - export function unregisterForPushNotifications () : void; - export module Socket { - export var CLOSED : number; - export var CONNECTED : number; - export var ERROR : number; - export var INITIALIZED : number; - export var LISTENING : number; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createTCP (params?: Dictionary) : Ti.Network.Socket.TCP; - export function createUDP (params?: Dictionary) : Ti.Network.Socket.UDP; - export function fireEvent (name: string, event: Dictionary) : void; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface UDP extends Ti.IOStream { - data : (...args : any[]) => any; - error : (...args : any[]) => any; - port : number; - started : (...args : any[]) => any; - getData () : (...args : any[]) => any; - getError () : (...args : any[]) => any; - getPort () : number; - getStarted () : (...args : any[]) => any; - sendBytes (port: number, host: string, data: Array) : void; - sendString (port: number, host: string, data: string) : void; - setData (data: (...args : any[]) => any) : void; - setError (error: (...args : any[]) => any) : void; - setPort (port: number) : void; - setStarted (started: (...args : any[]) => any) : void; - start (port: number) : void; - stop () : void; - } - export interface TCP extends Ti.IOStream { - accepted : (...args : any[]) => any; - connected : (...args : any[]) => any; - error : (...args : any[]) => any; - host : string; - listenQueueSize : number; - port : number; - state : number; - timeout : number; - accept (options: AcceptDict) : void; - connect () : void; - getAccepted () : (...args : any[]) => any; - getConnected () : (...args : any[]) => any; - getError () : (...args : any[]) => any; - getHost () : string; - getListenQueueSize () : number; - getPort () : number; - getState () : number; - getTimeout () : number; - listen () : void; - setAccepted (accepted: (...args : any[]) => any) : void; - setConnected (connected: (...args : any[]) => any) : void; - setError (error: (...args : any[]) => any) : void; - setHost (host: string) : void; - setListenQueueSize (listenQueueSize: number) : void; - setPort (port: number) : void; - setTimeout (timeout: number) : void; - } - } - export interface TCPSocket extends Ti.Proxy { - hostName : string; - isValid : boolean; - mode : number; - port : number; - stripTerminator : boolean; - close () : void; - connect () : void; - getHostName () : string; - getIsValid () : boolean; - getMode () : number; - getPort () : number; - getStripTerminator () : boolean; - listen () : void; - setHostName (hostName: string) : void; - setIsValid (isValid: boolean) : void; - setMode (mode: number) : void; - setPort (port: number) : void; - setStripTerminator (stripTerminator: boolean) : void; - write (data: any, sendTo: number) : void; - write (data: string, sendTo: number) : void; - } - export interface BonjourService extends Ti.Proxy { - domain : string; - isLocal : boolean; - name : string; - socket : any; - type : string; - getDomain () : string; - getIsLocal () : boolean; - getName () : string; - getSocket () : any; - getType () : string; - publish (socket: any) : void; - resolve (timeout: number) : void; - setDomain (domain: string) : void; - setIsLocal (isLocal: boolean) : void; - setName (name: string) : void; - setSocket (socket: any) : void; - setType (type: string) : void; - stop () : void; - } - export interface HTTPClient extends Ti.Proxy { - DONE : number; - HEADERS_RECEIVED : number; - LOADING : number; - OPENED : number; - UNSENT : number; - allResponseHeaders : string; - autoEncodeUrl : boolean; - autoRedirect : boolean; - cache : boolean; - connected : boolean; - connectionType : string; - domain : string; - enableKeepAlive : boolean; - file : string; - location : string; - ondatastream : (...args : any[]) => any; - onerror : (...args : any[]) => any; - onload : (...args : any[]) => any; - onreadystatechange : (...args : any[]) => any; - onsendstream : (...args : any[]) => any; - password : string; - readyState : number; - responseData : Ti.Blob; - responseText : string; - responseXML : Ti.XML.Document; - status : number; - statusText : string; - timeout : number; - tlsVersion : number; - username : string; - validatesSecureCertificate : boolean; - withCredentials : boolean; - abort () : void; - addAuthFactory (scheme: string, factory: any) : void; - addKeyManager (X509KeyManager: any) : void; - addTrustManager (X509TrustManager: any) : void; - clearCookies (host: string) : void; - getAllResponseHeaders () : string; - getAutoEncodeUrl () : boolean; - getAutoRedirect () : boolean; - getCache () : boolean; - getConnected () : boolean; - getConnectionType () : string; - getDomain () : string; - getEnableKeepAlive () : boolean; - getFile () : string; - getLocation () : string; - getOndatastream () : (...args : any[]) => any; - getOnerror () : (...args : any[]) => any; - getOnload () : (...args : any[]) => any; - getOnreadystatechange () : (...args : any[]) => any; - getOnsendstream () : (...args : any[]) => any; - getPassword () : string; - getReadyState () : number; - getResponseData () : Ti.Blob; - getResponseHeader (name: string) : string; - getResponseText () : string; - getResponseXML () : Ti.XML.Document; - getStatus () : number; - getStatusText () : string; - getTimeout () : number; - getTlsVersion () : number; - getUsername () : string; - getValidatesSecureCertificate () : boolean; - getWithCredentials () : boolean; - open (method: string, url: string, async?: boolean) : void; - send (data?: any) : void; - send (data?: string) : void; - send (data?: Ti.Filesystem.File) : void; - send (data?: Ti.Blob) : void; - setAutoEncodeUrl (autoEncodeUrl: boolean) : void; - setAutoRedirect (autoRedirect: boolean) : void; - setCache (cache: boolean) : void; - setDomain (domain: string) : void; - setEnableKeepAlive (enableKeepAlive: boolean) : void; - setFile (file: string) : void; - setOndatastream (ondatastream: (...args : any[]) => any) : void; - setOnerror (onerror: (...args : any[]) => any) : void; - setOnload (onload: (...args : any[]) => any) : void; - setOnreadystatechange (onreadystatechange: (...args : any[]) => any) : void; - setOnsendstream (onsendstream: (...args : any[]) => any) : void; - setPassword (password: string) : void; - setRequestHeader (name: string, value: string) : void; - setTimeout (timeout: number) : void; - setTlsVersion (tlsVersion: number) : void; - setUsername (username: string) : void; - setValidatesSecureCertificate (validatesSecureCertificate: boolean) : void; - setWithCredentials (withCredentials: boolean) : void; - } - export interface BonjourBrowser extends Ti.Proxy { - domain : string; - isSearching : boolean; - serviceType : string; - getDomain () : string; - getIsSearching () : boolean; - getServiceType () : string; - search () : void; - setDomain (domain: string) : void; - setIsSearching (isSearching: boolean) : void; - setServiceType (serviceType: string) : void; - stopSearch () : void; - } - } export module Platform { export var BATTERY_STATE_CHARGING : number; export var BATTERY_STATE_FULL : number; export var BATTERY_STATE_UNKNOWN : number; export var BATTERY_STATE_UNPLUGGED : number; export var address : string; + export var apiName : string; export var architecture : string; export var availableMemory : number; export var batteryLevel : number; @@ -4827,6 +5299,7 @@ declare module Ti { export function createUUID () : string; export function fireEvent (name: string, event: Dictionary) : void; export function getAddress () : string; + export function getApiName () : string; export function getArchitecture () : string; export function getAvailableMemory () : number; export function getBatteryLevel () : number; @@ -4867,13 +5340,6 @@ declare module Ti { getPlatformWidth () : number; getXdpi () : number; getYdpi () : number; - setDensity (density: string) : void; - setDpi (dpi: number) : void; - setLogicalDensityFactor (logicalDensityFactor: number) : void; - setPlatformHeight (platformHeight: number) : void; - setPlatformWidth (platformWidth: number) : void; - setXdpi (xdpi: number) : void; - setYdpi (ydpi: number) : void; } export interface Android { API_LEVEL : number; @@ -4943,6 +5409,7 @@ declare module Ti { export var allAlerts : Array; export var allCalendars : Array; export var allEditableCalendars : Array; + export var apiName : string; export var bubbleParent : boolean; export var defaultCalendar : Ti.Calendar.Calendar; export var eventsAuthorization : number; @@ -4953,8 +5420,9 @@ declare module Ti { export function getAllAlerts () : Array; export function getAllCalendars () : Array; export function getAllEditableCalendars () : Array; + export function getApiName () : string; export function getBubbleParent () : boolean; - export function getCalendarById (id: number) : Ti.Calendar.Calendar; + export function getCalendarById (id: string) : Ti.Calendar.Calendar; export function getDefaultCalendar () : Ti.Calendar.Calendar; export function getEventsAuthorization () : number; export function getSelectableCalendars () : Array; @@ -5087,138 +5555,11 @@ declare module Ti { setRelativeOffset (relativeOffset: number) : void; } } - export module Map { - export var ANNOTATION_DRAG_STATE_CANCEL : number; - export var ANNOTATION_DRAG_STATE_DRAG : number; - export var ANNOTATION_DRAG_STATE_END : number; - export var ANNOTATION_DRAG_STATE_NONE : number; - export var ANNOTATION_DRAG_STATE_START : number; - export var ANNOTATION_GREEN : number; - export var ANNOTATION_PURPLE : number; - export var ANNOTATION_RED : number; - export var HYBRID_TYPE : number; - export var SATELLITE_TYPE : number; - export var STANDARD_TYPE : number; - export var TERRAIN_TYPE : number; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createAnnotation (parameters?: Dictionary) : Ti.Map.Annotation; - export function createView (parameters?: Dictionary) : Ti.Map.View; - export function fireEvent (name: string, event: Dictionary) : void; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface View extends Ti.UI.View { - animated : boolean; - annotations : Array; - hideAnnotationWhenTouchMap : boolean; - latitudeDelta : number; - longitudeDelta : number; - mapType : number; - region : MapRegionType; - regionFit : boolean; - userLocation : boolean; - addAnnotation (annotation: Dictionary) : void; - addAnnotation (annotation: Ti.Map.Annotation) : void; - addAnnotations (annotations: Array) : void; - addAnnotations (annotations: Array>) : void; - addRoute (route: MapRouteType) : void; - deselectAnnotation (annotation: string) : void; - deselectAnnotation (annotation: Ti.Map.Annotation) : void; - getAnimate () : boolean; - getAnimated () : boolean; - getAnnotations () : Array; - getHideAnnotationWhenTouchMap () : boolean; - getLatitudeDelta () : number; - getLongitudeDelta () : number; - getMapType () : number; - getRegion () : MapRegionType; - getRegionFit () : boolean; - getUserLocation () : boolean; - removeAllAnnotations () : void; - removeAnnotation (annotation: string) : void; - removeAnnotation (annotation: Ti.Map.Annotation) : void; - removeAnnotations (annotations: Array) : void; - removeAnnotations (annotations: Array) : void; - removeRoute (route: MapRouteType) : void; - selectAnnotation (annotation: string) : void; - selectAnnotation (annotation: Ti.Map.Annotation) : void; - setAnimate (animate: boolean) : void; - setAnimated (animated: boolean) : void; - setAnnotations (annotations: Array) : void; - setHideAnnotationWhenTouchMap (hideAnnotationWhenTouchMap: boolean) : void; - setLocation (location: MapLocationType) : void; - setMapType (mapType: number) : void; - setRegion (region: MapRegionType) : void; - setRegionFit (regionFit: boolean) : void; - setUserLocation (userLocation: boolean) : void; - zoom (level: number) : void; - } - export interface Annotation extends Ti.Proxy { - animate : boolean; - canShowCallout : boolean; - centerOffset : Point; - customView : Ti.UI.View; - draggable : boolean; - image : any; - latitude : number; - leftButton : any; - leftView : Ti.UI.View; - longitude : number; - pinImage : string; - pincolor : number; - rightButton : any; - rightView : Ti.UI.View; - subtitle : string; - subtitleid : string; - title : string; - titleid : string; - getAnimate () : boolean; - getCanShowCallout () : boolean; - getCenterOffset () : Point; - getCustomView () : Ti.UI.View; - getDraggable () : boolean; - getImage () : any; - getLatitude () : number; - getLeftButton () : any; - getLeftView () : Ti.UI.View; - getLongitude () : number; - getPinImage () : string; - getPincolor () : number; - getRightButton () : any; - getRightView () : Ti.UI.View; - getSubtitle () : string; - getSubtitleid () : string; - getTitle () : string; - getTitleid () : string; - setAnimate (animate: boolean) : void; - setCanShowCallout (canShowCallout: boolean) : void; - setCenterOffset (centerOffset: Point) : void; - setCustomView (customView: Ti.UI.View) : void; - setDraggable (draggable: boolean) : void; - setImage (image: string) : void; - setImage (image: Ti.Blob) : void; - setLatitude (latitude: number) : void; - setLeftButton (leftButton: number) : void; - setLeftButton (leftButton: string) : void; - setLeftView (leftView: Ti.UI.View) : void; - setLongitude (longitude: number) : void; - setPinImage (pinImage: string) : void; - setPincolor (pincolor: number) : void; - setRightButton (rightButton: number) : void; - setRightButton (rightButton: string) : void; - setRightView (rightView: Ti.UI.View) : void; - setSubtitle (subtitle: string) : void; - setSubtitleid (subtitleid: string) : void; - setTitle (title: string) : void; - setTitleid (titleid: string) : void; - } - } export module Filesystem { export var MODE_APPEND : number; export var MODE_READ : number; export var MODE_WRITE : number; + export var apiName : string; export var applicationCacheDirectory : string; export var applicationDataDirectory : string; export var applicationDirectory : string; @@ -5235,20 +5576,21 @@ declare module Ti { export function createTempDirectory () : Ti.Filesystem.File; export function createTempFile () : Ti.Filesystem.File; export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; export function getApplicationCacheDirectory () : string; export function getApplicationDataDirectory () : string; export function getApplicationDirectory () : string; export function getApplicationSupportDirectory () : string; export function getBubbleParent () : boolean; export function getExternalStorageDirectory () : string; - export function getFile (path: string) : Ti.Filesystem.File; + export function getFile (path: string, ...extraPaths: string[]) : Ti.Filesystem.File; export function getLineEnding () : string; export function getResRawDirectory () : string; export function getResourcesDirectory () : string; export function getSeparator () : string; export function getTempDirectory () : string; export function isExternalStoragePresent () : boolean; - export function openStream (mode: number, path: string) : Ti.Filesystem.FileStream; + export function openStream (mode: number, path: string, ...extraPaths: string[]) : Ti.Filesystem.FileStream; export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; export function setBubbleParent (bubbleParent: boolean) : void; export interface File extends Ti.Proxy { @@ -5305,6 +5647,320 @@ declare module Ti { } } + export module Network { + export var INADDR_ANY : string; + export var NETWORK_LAN : number; + export var NETWORK_MOBILE : number; + export var NETWORK_NONE : number; + export var NETWORK_UNKNOWN : number; + export var NETWORK_WIFI : number; + export var NOTIFICATION_TYPE_ALERT : number; + export var NOTIFICATION_TYPE_BADGE : number; + export var NOTIFICATION_TYPE_NEWSSTAND : number; + export var NOTIFICATION_TYPE_SOUND : number; + export var PROGRESS_UNKNOWN : number; + export var READ_MODE : number; + export var READ_WRITE_MODE : number; + export var SOCKET_CLOSED : number; + export var SOCKET_CONNECTED : number; + export var SOCKET_ERROR : number; + export var SOCKET_INITIALIZED : number; + export var SOCKET_LISTENING : number; + export var TLS_VERSION_1_0 : number; + export var TLS_VERSION_1_1 : number; + export var TLS_VERSION_1_2 : number; + export var WRITE_MODE : number; + export var allHTTPCookies : Array; + export var apiName : string; + export var bubbleParent : boolean; + export var httpURLFormatter : (...args : any[]) => any; + export var networkType : number; + export var networkTypeName : string; + export var online : boolean; + export var remoteDeviceUUID : string; + export var remoteNotificationTypes : Array; + export var remoteNotificationsEnabled : boolean; + export function addConnectivityListener (callback: (...args : any[]) => any) : void; + export function addEventListener (name: string, callback: (...args : any[]) => any) : void; + export function addHTTPCookie (cookie: Ti.Network.Cookie) : void; + export function addSystemCookie (cookie: Ti.Network.Cookie) : void; + export function applyProperties (props: Dictionary) : void; + export function createBonjourBrowser (serviceType: string, domain: string, parameters?: Dictionary) : Ti.Network.BonjourBrowser; + export function createBonjourService (name: string, type: string, domain: string, parameters?: Dictionary) : Ti.Network.BonjourService; + export function createCookie (parameters?: Dictionary) : Ti.Network.Cookie; + export function createHTTPClient (parameters?: Dictionary) : Ti.Network.HTTPClient; + export function createTCPSocket (hostName: string, port: number, mode: number, parameters: Dictionary) : Ti.Network.TCPSocket; + export function decodeURIComponent (value: string) : string; + export function encodeURIComponent (value: string) : string; + export function fireEvent (name: string, event: Dictionary) : void; + export function getAllHTTPCookies () : Array; + export function getApiName () : string; + export function getBubbleParent () : boolean; + export function getHTTPCookies (domain: string, path: string, name: string) : Array; + export function getHTTPCookiesForDomain (domain: string) : Array; + export function getHttpURLFormatter () : (...args : any[]) => any; + export function getNetworkType () : number; + export function getNetworkTypeName () : string; + export function getOnline () : boolean; + export function getRemoteDeviceUUID () : string; + export function getRemoteNotificationTypes () : Array; + export function getRemoteNotificationsEnabled () : boolean; + export function getSystemCookies (domain: string, path: string, name: string) : Array; + export function registerForPushNotifications (config: PushNotificationConfig) : void; + export function removeAllHTTPCookies () : void; + export function removeAllSystemCookies () : void; + export function removeConnectivityListener (callback: (...args : any[]) => any) : void; + export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; + export function removeHTTPCookie (domain: string, path: string, name: string) : void; + export function removeHTTPCookiesForDomain (domain: string) : void; + export function removeSystemCookie (domain: string, path: string, name: string) : void; + export function setBubbleParent (bubbleParent: boolean) : void; + export function setHttpURLFormatter (httpURLFormatter: (...args : any[]) => any) : void; + export function unregisterForPushNotifications () : void; + export interface TCPSocket extends Ti.Proxy { + hostName : string; + isValid : boolean; + mode : number; + port : number; + stripTerminator : boolean; + close () : void; + connect () : void; + getHostName () : string; + getIsValid () : boolean; + getMode () : number; + getPort () : number; + getStripTerminator () : boolean; + listen () : void; + setHostName (hostName: string) : void; + setIsValid (isValid: boolean) : void; + setMode (mode: number) : void; + setPort (port: number) : void; + setStripTerminator (stripTerminator: boolean) : void; + write (data: any, sendTo: number) : void; + write (data: string, sendTo: number) : void; + } + export module Socket { + export var CLOSED : number; + export var CONNECTED : number; + export var ERROR : number; + export var INITIALIZED : number; + export var LISTENING : number; + export var apiName : string; + export var bubbleParent : boolean; + export function addEventListener (name: string, callback: (...args : any[]) => any) : void; + export function applyProperties (props: Dictionary) : void; + export function createTCP (params?: Dictionary) : Ti.Network.Socket.TCP; + export function createUDP (params?: Dictionary) : Ti.Network.Socket.UDP; + export function fireEvent (name: string, event: Dictionary) : void; + export function getApiName () : string; + export function getBubbleParent () : boolean; + export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; + export function setBubbleParent (bubbleParent: boolean) : void; + export interface UDP extends Ti.IOStream { + data : (...args : any[]) => any; + error : (...args : any[]) => any; + port : number; + started : (...args : any[]) => any; + getData () : (...args : any[]) => any; + getError () : (...args : any[]) => any; + getPort () : number; + getStarted () : (...args : any[]) => any; + sendBytes (port: number, host: string, data: Array) : void; + sendString (port: number, host: string, data: string) : void; + setData (data: (...args : any[]) => any) : void; + setError (error: (...args : any[]) => any) : void; + setPort (port: number) : void; + setStarted (started: (...args : any[]) => any) : void; + start (port: number) : void; + stop () : void; + } + export interface TCP extends Ti.IOStream { + accepted : (...args : any[]) => any; + connected : (...args : any[]) => any; + error : (...args : any[]) => any; + host : string; + listenQueueSize : number; + port : number; + state : number; + timeout : number; + accept (options: AcceptDict) : void; + connect () : void; + getAccepted () : (...args : any[]) => any; + getConnected () : (...args : any[]) => any; + getError () : (...args : any[]) => any; + getHost () : string; + getListenQueueSize () : number; + getPort () : number; + getState () : number; + getTimeout () : number; + listen () : void; + setAccepted (accepted: (...args : any[]) => any) : void; + setConnected (connected: (...args : any[]) => any) : void; + setError (error: (...args : any[]) => any) : void; + setHost (host: string) : void; + setListenQueueSize (listenQueueSize: number) : void; + setPort (port: number) : void; + setTimeout (timeout: number) : void; + } + } + export interface BonjourService extends Ti.Proxy { + domain : string; + isLocal : boolean; + name : string; + socket : any; + type : string; + getDomain () : string; + getIsLocal () : boolean; + getName () : string; + getSocket () : any; + getType () : string; + publish (socket: any) : void; + resolve (timeout: number) : void; + setDomain (domain: string) : void; + setIsLocal (isLocal: boolean) : void; + setName (name: string) : void; + setSocket (socket: any) : void; + setType (type: string) : void; + stop () : void; + } + export interface HTTPClient extends Ti.Proxy { + DONE : number; + HEADERS_RECEIVED : number; + LOADING : number; + OPENED : number; + UNSENT : number; + allResponseHeaders : string; + autoEncodeUrl : boolean; + autoRedirect : boolean; + cache : boolean; + connected : boolean; + connectionType : string; + domain : string; + enableKeepAlive : boolean; + file : string; + location : string; + ondatastream : (...args : any[]) => any; + onerror : (...args : any[]) => any; + onload : (...args : any[]) => any; + onreadystatechange : (...args : any[]) => any; + onsendstream : (...args : any[]) => any; + password : string; + readyState : number; + responseData : Ti.Blob; + responseText : string; + responseXML : Ti.XML.Document; + securityManager : SecurityManagerProtocol; + status : number; + statusText : string; + timeout : number; + tlsVersion : number; + username : string; + validatesSecureCertificate : boolean; + withCredentials : boolean; + abort () : void; + addAuthFactory (scheme: string, factory: any) : void; + addKeyManager (X509KeyManager: any) : void; + addTrustManager (X509TrustManager: any) : void; + clearCookies (host: string) : void; + getAllResponseHeaders () : string; + getAutoEncodeUrl () : boolean; + getAutoRedirect () : boolean; + getCache () : boolean; + getConnected () : boolean; + getConnectionType () : string; + getDomain () : string; + getEnableKeepAlive () : boolean; + getFile () : string; + getLocation () : string; + getOndatastream () : (...args : any[]) => any; + getOnerror () : (...args : any[]) => any; + getOnload () : (...args : any[]) => any; + getOnreadystatechange () : (...args : any[]) => any; + getOnsendstream () : (...args : any[]) => any; + getPassword () : string; + getReadyState () : number; + getResponseData () : Ti.Blob; + getResponseHeader (name: string) : string; + getResponseText () : string; + getResponseXML () : Ti.XML.Document; + getSecurityManager () : SecurityManagerProtocol; + getStatus () : number; + getStatusText () : string; + getTimeout () : number; + getTlsVersion () : number; + getUsername () : string; + getValidatesSecureCertificate () : boolean; + getWithCredentials () : boolean; + open (method: string, url: string, async?: boolean) : void; + send (data?: any) : void; + send (data?: string) : void; + send (data?: Ti.Filesystem.File) : void; + send (data?: Ti.Blob) : void; + setAutoEncodeUrl (autoEncodeUrl: boolean) : void; + setAutoRedirect (autoRedirect: boolean) : void; + setCache (cache: boolean) : void; + setDomain (domain: string) : void; + setEnableKeepAlive (enableKeepAlive: boolean) : void; + setFile (file: string) : void; + setOndatastream (ondatastream: (...args : any[]) => any) : void; + setOnerror (onerror: (...args : any[]) => any) : void; + setOnload (onload: (...args : any[]) => any) : void; + setOnreadystatechange (onreadystatechange: (...args : any[]) => any) : void; + setOnsendstream (onsendstream: (...args : any[]) => any) : void; + setPassword (password: string) : void; + setRequestHeader (name: string, value: string) : void; + setTimeout (timeout: number) : void; + setTlsVersion (tlsVersion: number) : void; + setUsername (username: string) : void; + setValidatesSecureCertificate (validatesSecureCertificate: boolean) : void; + setWithCredentials (withCredentials: boolean) : void; + } + export interface BonjourBrowser extends Ti.Proxy { + domain : string; + isSearching : boolean; + serviceType : string; + getDomain () : string; + getIsSearching () : boolean; + getServiceType () : string; + search () : void; + setDomain (domain: string) : void; + setIsSearching (isSearching: boolean) : void; + setServiceType (serviceType: string) : void; + stopSearch () : void; + } + export interface Cookie extends Ti.Proxy { + comment : string; + domain : string; + expiryDate : string; + httponly : boolean; + name : string; + originalUrl : string; + path : string; + secure : boolean; + value : string; + version : number; + getComment () : string; + getDomain () : string; + getExpiryDate () : string; + getHttponly () : boolean; + getName () : string; + getOriginalUrl () : string; + getPath () : string; + getSecure () : boolean; + getValue () : string; + getVersion () : number; + isValid () : boolean; + setComment (comment: string) : void; + setDomain (domain: string) : void; + setExpiryDate (expiryDate: string) : void; + setHttponly (httponly: boolean) : void; + setOriginalUrl (originalUrl: string) : void; + setPath (path: string) : void; + setSecure (secure: boolean) : void; + setValue (value: string) : void; + setVersion (version: number) : void; + } + } export interface Yahoo { yql (yql: string, callback: (...args : any[]) => any) : void; } @@ -5334,6 +5990,7 @@ declare module Ti { export var BUTTON_STYLE_NORMAL : number; export var BUTTON_STYLE_WIDE : number; export var accessToken : string; + export var apiName : string; export var appid : string; export var bubbleParent : boolean; export var expirationDate : Date; @@ -5348,6 +6005,7 @@ declare module Ti { export function dialog (action: string, params: any, callback: (...args : any[]) => any) : void; export function fireEvent (name: string, event: Dictionary) : void; export function getAccessToken () : string; + export function getApiName () : string; export function getAppid () : string; export function getBubbleParent () : boolean; export function getExpirationDate () : Date; @@ -5381,6 +6039,7 @@ declare module Ti { base64decode (obj: Ti.Blob) : Ti.Blob; base64encode (obj: string) : Ti.Blob; base64encode (obj: Ti.Blob) : Ti.Blob; + base64encode (obj: Ti.Filesystem.File) : Ti.Blob; md5HexDigest (obj: string) : string; md5HexDigest (obj: Ti.Blob) : string; sha1 (obj: string) : string; @@ -5437,6 +6096,12 @@ declare class FacebookRESTResponsev1 { success : boolean; } +declare class titleAttributesParams { + color : string; + font : Font; + shadow : shadowDict; +} + declare class MapRegionType { latitude : number; latitudeDelta : number; @@ -5462,8 +6127,8 @@ declare class ErrorResponse { success : boolean; } -declare enum CloudPushNotificationsResponse { - +declare class CloudPushNotificationsQueryResponse extends CloudResponse { + subscriptions : Array>; } declare class CloudResponse { @@ -5474,6 +6139,15 @@ declare class CloudResponse { success : boolean; } +declare enum CloudPushNotificationsResponse { + +} + +declare class textFieldSelectedParams { + length : number; + location : number; +} + declare class recurrenceEndDictionary { endDate : Date; occurrenceCount : number; @@ -5513,6 +6187,10 @@ declare module Global { } } +declare class CloudGeoFenceResponse extends CloudResponse { + geo_fences : Array>; +} + declare class ServiceIntentOptions { startMode : number; url : string; @@ -5609,6 +6287,10 @@ declare class ListViewAnimationProperties { position : number; } +declare class CloudPushSchedulesResponse extends CloudResponse { + push_schedules : Array; +} + declare class DataCallbackArgs { address : string; bytesData : Array; @@ -5650,13 +6332,19 @@ declare class CloudEventsResponse extends CloudResponse { events : Array>; } +declare class ReadyStatePayload { + readyState : number; +} + declare class ErrorCallbackArgs { errorCode : number; socket : Ti.Network.Socket.TCP; } -declare enum FailureResponse { - +declare class FailureResponse { + code: Number; + error: string; + success: boolean; } declare class WriteCallbackArgs extends ErrorResponse { @@ -5691,6 +6379,11 @@ declare class ListViewContentInsetOption { duration : number; } +declare class RouteDescription { + inputs : Array; + outputs : Array; +} + declare class CreateStreamArgs { mode : number; source : any; @@ -5772,6 +6465,12 @@ declare class MusicLibraryOptionsType { success : (...args : any[]) => any; } +declare class shadowDict { + blurRadius : number; + color : string; + offset : Dictionary; +} + declare class launchOptions { launchOptionsLocationKey : boolean; source : string; @@ -5813,11 +6512,21 @@ declare class CloudObjectsResponse extends CloudResponse { classname : Array>; } +declare class PopoverParams { + animated : boolean; + rect : Dimension; + view : Ti.UI.View; +} + declare class MediaScannerResponse { path : string; uri : string; } +declare class CloudPushNotificationsQueryChannelResponse extends CloudResponse { + push_channels : Array; +} + declare class CloudPostsResponse extends CloudResponse { posts : Array>; } @@ -5826,11 +6535,16 @@ declare class CloudSocialIntegrationsResponse extends CloudResponse { users : Array>; } +declare class APSConnectionDelegate { + +} + declare class CameraOptionsType { allowEditing : boolean; animated : boolean; arrowDirection : number; autohide : boolean; + autorotate : boolean; cancel : (...args : any[]) => any; error : (...args : any[]) => any; inPopOver : boolean; @@ -6004,6 +6718,7 @@ declare class NotificationParams { alertBody : string; alertLaunchImage : string; badge : number; + category : string; date : Date; repeat : string; sound : string; @@ -6024,11 +6739,24 @@ declare class Modules { } +declare class ReferenceInsets { + bottom : number; + left : number; + right : number; + top : number; +} + declare class hideStatusBarParams { animated : boolean; animationStyle : number; } +declare class PreviewImageOptions { + error : (...args : any[]) => any; + image : Ti.Blob; + success : (...args : any[]) => any; +} + declare class ListDataItem { properties : Dictionary; template : any; @@ -6062,6 +6790,12 @@ declare class ListViewEdgeInsets { top : number; } +declare class BoundaryIdentifier { + identifier : string; + point1 : Point; + point2 : Point; +} + declare enum CloudEmailsResponse { } @@ -6076,6 +6810,7 @@ declare class Font { fontSize : any; fontStyle : string; fontWeight : string; + textStyle : string; } declare class CloudPlacesResponse extends CloudResponse { @@ -6119,6 +6854,13 @@ declare class hideParams { animated : boolean; } +declare class SecurityManagerProtocol { + connectionDelegateForUrl (url: any) : APSConnectionDelegate; + getKeyManagers (proxy: any) : Array; + getTrustManagers (proxy: any) : Array; + willHandleURL (url: any) : boolean; +} + declare class openWindowParams { activityEnterAnimation : number; activityExitAnimation : number; @@ -6153,6 +6895,12 @@ declare class showStatusBarParams { animationStyle : number; } +declare class transitionAnimationParam { + duration : number; + tranistionTo : Ti.UI.Animation; + transitionFrom : Ti.UI.Animation; +} + declare class MapPointType { latitude : number; longitude : number; @@ -6173,6 +6921,16 @@ declare class ReverseGeocodeResponse extends ErrorResponse { places : Array; } +declare class contentOffsetOption { + animated : boolean; +} + +declare class Attribute { + range : Array; + type : number; + value : number; +} + declare class PushNotificationSuccessArg { deviceToken : string; type : string; @@ -6189,9 +6947,13 @@ declare class closeWindowParams { animated : boolean; } +declare class CloudLikesResponse extends CloudResponse { + likes : Array>; +} + declare class showParams { animated : boolean; - rect : Dictionary; + rect : Dimension; view : Ti.UI.View; } @@ -6203,6 +6965,10 @@ declare class CloudMessagesResponse extends CloudResponse { messages : Array>; } +declare class CloudPushNotificationsShowChannelResponse extends CloudResponse { + devices : Dictionary; +} + declare class ImageAsCroppedDict { height : number; width : number; @@ -6210,14 +6976,9 @@ declare class ImageAsCroppedDict { y : number; } -declare class PreviewImageOptions { - error : (...args : any[]) => any; - image : Ti.Blob; - success : (...args : any[]) => any; -} - -declare class contentOffsetOption { - animated : boolean; +declare class UserNotificationSettings { + categories : Array; + types : Array; } declare class TableViewAnimationProperties { @@ -6237,4 +6998,4 @@ declare class EncodeStringDict { source : string; sourceLength : number; sourcePosition : number; -} \ No newline at end of file +} From 721bde01ef8c48852c5357996cf8b2bb02732c9c Mon Sep 17 00:00:00 2001 From: Craig Younkins Date: Sat, 28 Mar 2015 14:56:41 -0400 Subject: [PATCH 200/243] Fixing implicit any type on titanium tests --- titanium/titanium-tests.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/titanium/titanium-tests.ts b/titanium/titanium-tests.ts index a4057b80c..087ba05c2 100644 --- a/titanium/titanium-tests.ts +++ b/titanium/titanium-tests.ts @@ -26,7 +26,7 @@ function test_window() { } function test_tableview() { - var data = []; + var data : Ti.UI.View[] = []; for (var i = 0; i < 10; i++) { var row = Ti.UI.createTableViewRow(); var label = Ti.UI.createLabel({ @@ -73,12 +73,12 @@ function test_network() { var url = "http://www.appcelerator.com"; var client = Ti.Network.createHTTPClient({ // function called when the response data is available - onload : function(e) { + onload : function(e: SuccessResponse) { alert(this.responseText); }, // function called when an error occurs, including a timeout - onerror : function(e) { - alert(e.rror); + onerror : function(e: FailureResponse) { + alert(e.error); }, timeout : 5000 // in milliseconds }); From 3f4a36cbdce84b0fa086000b4541d8b7e55304a1 Mon Sep 17 00:00:00 2001 From: aaron Date: Sat, 28 Mar 2015 15:39:24 -0400 Subject: [PATCH 201/243] fix youtube addEventListener signature --- youtube/youtube.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube/youtube.d.ts b/youtube/youtube.d.ts index cfdba0efb..85f96b22f 100644 --- a/youtube/youtube.d.ts +++ b/youtube/youtube.d.ts @@ -146,7 +146,7 @@ declare module YT { getPlaylistIndex(): number; // Event Listener - addEventListener(event: string, listener: string): void; + addEventListener(event: string, handler: EventHandler): void; } export enum PlayerState { From 119a642d1a30e1d4131febde7bc55450d28c9ef4 Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Sat, 28 Mar 2015 20:30:52 +0100 Subject: [PATCH 202/243] Add typescript-deferred header & test. --- .../typescript-deferred-tests.ts | 61 +++++++++++++++++++ typescript-deferred/typescript-deferred.d.ts | 47 ++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 typescript-deferred/typescript-deferred-tests.ts create mode 100644 typescript-deferred/typescript-deferred.d.ts diff --git a/typescript-deferred/typescript-deferred-tests.ts b/typescript-deferred/typescript-deferred-tests.ts new file mode 100644 index 000000000..0bfa82582 --- /dev/null +++ b/typescript-deferred/typescript-deferred-tests.ts @@ -0,0 +1,61 @@ +/// + +import tsd = require('typescript-deferred'); + +var t1: tsd.PromiseInterface = tsd.when(10) + .then(() => tsd.when('foo')); + +var t2: tsd. PromiseInterface = tsd.when(10) + .then(() => 'foo'); + +var t3: tsd.PromiseInterface = tsd.when(10) + .then(() => 'foo', () => tsd.when('bar')); + +var t4: tsd.PromiseInterface = tsd.when(10) + .then(() => 'foo', () => 'bar'); + +var t5: tsd.PromiseInterface = tsd.when(10) + .then(() => tsd.when('foo'), () => 'bar'); + +var t6: tsd.PromiseInterface = tsd.when(10) + .then(() => tsd.when('foo'), () => tsd.when('bar')); + +var t7: tsd.PromiseInterface = tsd.when(10) + .always(() => 'foo'); + +var t8: tsd.PromiseInterface = tsd.when(10) + .always(() => tsd.when('foo')); + +var t9: tsd.PromiseInterface = tsd.when(10) + .otherwise(() => 11); + +var t10: tsd.PromiseInterface = tsd.when(10) + .otherwise(() => tsd.when(11)); + +var t11: tsd.PromiseInterface = tsd.when('foo'); + +var t12: tsd.PromiseInterface = tsd.when(tsd.when('foo')); + +var t13: tsd.PromiseInterface = tsd.create() + .promise; + +var t14: tsd.DeferredInterface = tsd.create(); + +var t15: tsd.ThenableInterface = tsd.when('foo'); + +var t16: tsd.PromiseInterface = tsd.when( >tsd.when('foo')); + +var t17: tsd.PromiseInterface = tsd.when(10) + .then(() => >tsd.when('foo'), () => >tsd.when('bar')); + +var t18: tsd.PromiseInterface = tsd.create() + .resolve('foo') + .promise; + +var t19: tsd.PromiseInterface = tsd.create() + .resolve(tsd.when('foo')) + .promise; + +var t20: tsd.PromiseInterface = tsd.create() + .reject(new Error('foo')) + .promise; diff --git a/typescript-deferred/typescript-deferred.d.ts b/typescript-deferred/typescript-deferred.d.ts new file mode 100644 index 000000000..bffc65b70 --- /dev/null +++ b/typescript-deferred/typescript-deferred.d.ts @@ -0,0 +1,47 @@ +// Type definitions for typescript-deferred v0.1.5 +// Project: https://github.com/DirtyHairy/typescript-deferred +// Definitions by: Christian Speckner +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "typescript-deferred" { + + export interface ImmediateSuccessCB { + (value: T): TP; + } + export interface ImmediateErrorCB { + (err: any): TP; + } + export interface DeferredSuccessCB { + (value: T): ThenableInterface; + } + export interface DeferredErrorCB { + (error: any): ThenableInterface; + } + export interface ThenableInterface { + then(successCB?: DeferredSuccessCB, errorCB?: DeferredErrorCB): ThenableInterface; + then(successCB?: DeferredSuccessCB, errorCB?: ImmediateErrorCB): ThenableInterface; + then(successCB?: ImmediateSuccessCB, errorCB?: DeferredErrorCB): ThenableInterface; + then(successCB?: ImmediateSuccessCB, errorCB?: ImmediateErrorCB): ThenableInterface; + } + export interface PromiseInterface extends ThenableInterface { + then(successCB?: DeferredSuccessCB, errorCB?: DeferredErrorCB): PromiseInterface; + then(successCB?: DeferredSuccessCB, errorCB?: ImmediateErrorCB): PromiseInterface; + then(successCB?: ImmediateSuccessCB, errorCB?: DeferredErrorCB): PromiseInterface; + then(successCB?: ImmediateSuccessCB, errorCB?: ImmediateErrorCB): PromiseInterface; + otherwise(errorCB?: DeferredErrorCB): PromiseInterface; + otherwise(errorCB?: ImmediateErrorCB): PromiseInterface; + always(errorCB?: DeferredErrorCB): PromiseInterface; + always(errorCB?: ImmediateErrorCB): PromiseInterface; + } + export interface DeferredInterface { + resolve(value?: ThenableInterface): DeferredInterface; + resolve(value?: T): DeferredInterface; + reject(error?: any): DeferredInterface; + promise: PromiseInterface; + } + export function create(): DeferredInterface; + export function when(value?: ThenableInterface): PromiseInterface; + export function when(value?: T): PromiseInterface; + + +} From 7c0ed32587d0563179f2665bf69beac95be9e7d8 Mon Sep 17 00:00:00 2001 From: rafw87 Date: Sun, 29 Mar 2015 00:48:59 +0100 Subject: [PATCH 203/243] Update angular.d.ts $q.all() - separate overloads for array and hash version --- angularjs/angular.d.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index bc7fa9de0..f3aadc9f7 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -930,11 +930,19 @@ declare module angular { /** * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. * - * Returns a single promise that will be resolved with an array/hash of values, each value corresponding to the promise at the same index/key in the promises array/hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value. + * Returns a single promise that will be resolved with an array of values, each value corresponding to the promise at the same index in the promises array. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value. * - * @param promises An array or hash of promises. + * @param promises An array of promises. */ - all(promises: IPromise[]|{ [id: string]: IPromise; }): IPromise; + all(promises: IPromise[]): IPromise; + /** + * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. + * + * Returns a single promise that will be resolved with a hash of values, each value corresponding to the promise at the same key in the promises hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value. + * + * @param promises A hash of promises. + */ + all(promises: { [id: string]: IPromise; }): IPromise<{ [id: string]: any; }>; /** * Creates a Deferred object which represents a task which will finish in the future. */ From fbb8c672d56d1cfe677b81c300f8506a31e0404c Mon Sep 17 00:00:00 2001 From: vvakame Date: Sun, 29 Mar 2015 23:18:12 +0900 Subject: [PATCH 204/243] update CONTRIBUTORS.md --- CONTRIBUTORS.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c8f458501..c2a12283a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -57,6 +57,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](autobahn/autobahn.d.ts) [AutobahnJS](http://autobahn.ws/js) by [Elad Zelingher](https://github.com/darkl) * [:link:](aws-sdk/aws-sdk.d.ts) [aws-sdk](https://github.com/aws/aws-sdk-js) by [midknight41](https://github.com/midknight41) * [:link:](axios/axios.d.ts) [axios](https://github.com/mzabriskie/axios) by [Marcel Buesing](https://github.com/marcelbuesing) * [: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) @@ -83,8 +84,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 1.5.x](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:](browser-sync/browser-sync.d.ts) [browser-sync](http://www.browsersync.io) by [Asana](https://asana.com) @@ -240,7 +241,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](fs-mock/fs-mock.d.ts) [fs-mock](https://github.com/sakren/node-fs-mock) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](ftdomdelegate/ftdomdelegate.d.ts) [ftdomdelegate](https://github.com/ftlabs/ftdomdelegate) by [Christian Holm Nielsen](https://github.com/dotnetnerd) * [:link:](ftp/ftp.d.ts) [ftp](https://github.com/mscdex/node-ftp) by [Rogier Schouten](https://github.com/rogierschouten) -* [:link:](ftpd/ftpd.d.ts) [ftp](https://github.com/sstur/nodeftpd) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](ftpd/ftpd.d.ts) [ftpd](https://github.com/sstur/nodeftpd) by [Rogier Schouten](https://github.com/rogierschouten) * [: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:](jquery-galleria/jquery-galleria.d.ts) [galleria.js](https://github.com/aino/galleria) by [Robert Imig](https://github.com/rimig) @@ -273,9 +274,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) -* [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gsap/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) +* [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) +* [:link:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com) * [:link:](gulp-autoprefixer/gulp-autoprefixer.d.ts) [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer) by [Asana](https://asana.com) * [:link:](gulp-concat/gulp-concat.d.ts) [gulp-concat](http://github.com/wearefractal/gulp-concat) by [Keita Kagurazaka](https://github.com/k-kagurazaka) @@ -451,6 +452,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](knex/knex.d.ts) [Knex.js](https://github.com/tgriesser/knex) by [Qubo](https://github.com/tkQubo) * [: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), [Clément Bourgeois](https://github.com/moonpyk) * [: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) @@ -490,6 +492,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](log4javascript/log4javascript.d.ts) [log4javascript](http://log4javascript.org) by [Markus Wagner](https://github.com/Ritzlgrmft) * [:link:](log4js/log4js.d.ts) [log4js](https://github.com/nomiddlename/log4js-node) by [Kentaro Okuno](http://github.com/armorik83) * [:link:](logg/logg.d.ts) [logg](https://github.com/dpup/node-logg) by [Bret Little](https://github.com/blittle) +* [:link:](loggly/loggly.d.ts) [loggly](https://github.com/nodejitsu/node-loggly) by [Ray Martone](https://github.com/rmartone) * [:link:](logrotate-stream/logrotate-stream.d.ts) [logrotate-stream](https://github.com/dstokes/logrotate-stream) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](lolex/lolex.d.ts) [lolex](https://github.com/sinonjs/lolex) by [Wim Looman](https://github.com/Nemo157) * [:link:](long/long.d.ts) [Long.js](https://github.com/dcodeIO/Long.js) by [Toshihide Hara](https://github.com/kerug) @@ -820,6 +823,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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/typescript.d.ts) [TypeScript API](http://www.typescriptlang.org) by [Microsoft TypeScript](http://typescriptlang.org) +* [:link:](typescript-deferred/typescript-deferred.d.ts) [typescript-deferred](https://github.com/DirtyHairy/typescript-deferred) by [Christian Speckner](https://github.com/DirtyHairy) * [: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) From 7dd2af62affa78d6dafa26aee9a529f23334540d Mon Sep 17 00:00:00 2001 From: Greg Cohan Date: Wed, 25 Mar 2015 16:47:48 -0400 Subject: [PATCH 205/243] add vex typings --- vex-js/vex-js.d.ts | 45 +++++++++++++++++++++++++++++++++++++++++++++ vex-js/vex-tests.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 vex-js/vex-js.d.ts create mode 100644 vex-js/vex-tests.ts diff --git a/vex-js/vex-js.d.ts b/vex-js/vex-js.d.ts new file mode 100644 index 000000000..118c61867 --- /dev/null +++ b/vex-js/vex-js.d.ts @@ -0,0 +1,45 @@ +// Type definitions for Vex v2.3.2 +// Project: https://github.com/HubSpot/vex +// Definitions by: Greg Cohan +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module vex { + + interface ICSSAttributes { + [property: string]: string | number; + } + + interface IVexOptions { + afterClose?: (() => void); + afterOpen?: ((vexContent: JQuery) => void); + content?: string; + showCloseButton?: boolean; + escapeButtonCloses?: boolean; + overlayClosesOnClick?: boolean; + appendLocation?: HTMLElement | JQuery | string; + className?: string; + css?: ICSSAttributes; + overlayClassName?: string; + overlayCSS?: ICSSAttributes; + contentClassName?: string; + contentCSS?: ICSSAttributes; + closeClassName?: string; + closeCSS?: ICSSAttributes; + } + + interface Vex { + open(options: IVexOptions): JQuery; + close(id?: number): boolean; + closeAll(): boolean; + closeByID(id: number): boolean; + } + +} + +declare module "vex" { + export = vex; +} + +declare var vex: vex.Vex; diff --git a/vex-js/vex-tests.ts b/vex-js/vex-tests.ts new file mode 100644 index 000000000..ea1778d61 --- /dev/null +++ b/vex-js/vex-tests.ts @@ -0,0 +1,26 @@ +/// +/// + +var vexContent = vex.open({ + afterClose: (() => null), + afterOpen: ((vexContent: JQuery) => null), + content: "

Modal

", + showCloseButton: false, + escapeButtonCloses: true, + overlayClosesOnClick: false, + appendLocation: "body", + className: "vex-dialog", + css: {background: "blue"}, + overlayClassName: "vex-overlay", + overlayCSS: {border: 0}, + contentClassName: "vex-content", + contentCSS: {margin: "0 auto"}, + closeClassName: "vex-close", + closeCSS: {margin: 0} +}); + +var id = vexContent.data().vex.id; + +vex.close(id); +vex.closeByID(id); +vex.closeAll(); From 9626637b273d607d4831e93cc092f43bf393c449 Mon Sep 17 00:00:00 2001 From: PROGRE Date: Mon, 30 Mar 2015 12:39:33 +0900 Subject: [PATCH 206/243] fix optionals --- node/node.d.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 519612380..e3250e9ed 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -342,10 +342,22 @@ declare module "http" { trailers: any; rawTrailers: any; setTimeout(msecs: number, callback: Function): NodeJS.Timer; - method: string; - url: string; - statusCode: number; - statusMessage: string; + /** + * Only valid for request obtained from http.Server. + */ + method?: string; + /** + * Only valid for request obtained from http.Server. + */ + url?: string; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusCode?: number; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusMessage?: string; socket: net.Socket; } /** From ebae8dab2113c87145a3fc8dc4b7e2843b173ea7 Mon Sep 17 00:00:00 2001 From: yortus Date: Mon, 30 Mar 2015 14:15:55 +0800 Subject: [PATCH 207/243] knex.d.ts: All SchemaBulder functions promises --- knex/knex.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/knex/knex.d.ts b/knex/knex.d.ts index d3216acf9..c9a6ada4b 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -307,13 +307,13 @@ declare module "knex" { } interface SchemaBuilder { - createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): void; - renameTable(oldTableName: string, newTableName: string): void; - dropTable(tableName: string): void; + createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): Promise; + renameTable(oldTableName: string, newTableName: string): Promise; + dropTable(tableName: string): Promise; hasTable(tableName: string): Promise; hasColumn(tableName: string, columnName: string): Promise; - table(tableName: string, callback: (tableBuilder: AlterTableBuilder) => any): void; - dropTableIfExists(tableName: string): void; + table(tableName: string, callback: (tableBuilder: AlterTableBuilder) => any): Promise; + dropTableIfExists(tableName: string): Promise; raw(statement: string): SchemaBuilder; } From f6a35d9ac841fa5b3425d89f81ad9c83dbdbc002 Mon Sep 17 00:00:00 2001 From: Kjartan Ferstl Date: Mon, 30 Mar 2015 13:10:14 +0200 Subject: [PATCH 208/243] underscore _.findIndex now returns the correct type (number instead of the element type) --- underscore/underscore.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index 9f49bc47a..7ff9aa5eb 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -278,7 +278,7 @@ interface UnderscoreStatic { findIndex( list: _.List, iterator: _.ListIterator, - context?: any): T; + context?: any): number; /** From 61deb1c1848f58c2a9b75904a213dfde77ee8bfb Mon Sep 17 00:00:00 2001 From: Tim Jonischkat Date: Mon, 30 Mar 2015 15:51:34 +0200 Subject: [PATCH 209/243] added definition for yamljs module --- yamljs/yamljs.d.ts | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 yamljs/yamljs.d.ts diff --git a/yamljs/yamljs.d.ts b/yamljs/yamljs.d.ts new file mode 100644 index 000000000..1ebd90a07 --- /dev/null +++ b/yamljs/yamljs.d.ts @@ -0,0 +1,5 @@ +declare module "yamljs" { + + export function load(path : string) : any[]; + +} \ No newline at end of file From 275c43c7a63eb7cc9ec3af4c042015e43bbc7b70 Mon Sep 17 00:00:00 2001 From: Tim Jonischkat Date: Mon, 30 Mar 2015 15:54:23 +0200 Subject: [PATCH 210/243] added documentation to yamljs def --- yamljs/yamljs.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yamljs/yamljs.d.ts b/yamljs/yamljs.d.ts index 1ebd90a07..5bdfd60a4 100644 --- a/yamljs/yamljs.d.ts +++ b/yamljs/yamljs.d.ts @@ -1,4 +1,9 @@ -declare module "yamljs" { +// Type definitions for yamljs 0.2.1 +// Project: https://github.com/jeremyfa/yaml.js +// Definitions by: Tim Jonischkat +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module yamljs { export function load(path : string) : any[]; From ffd22a1f3e71575f2dc84a168f1d7fb3817f0559 Mon Sep 17 00:00:00 2001 From: Tim Jonischkat Date: Mon, 30 Mar 2015 16:02:48 +0200 Subject: [PATCH 211/243] yamljs tests file --- yamljs/yamljs-tests.ts | 11 +++++++++++ yamljs/yamljs.d.ts | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 yamljs/yamljs-tests.ts diff --git a/yamljs/yamljs-tests.ts b/yamljs/yamljs-tests.ts new file mode 100644 index 000000000..a2453edff --- /dev/null +++ b/yamljs/yamljs-tests.ts @@ -0,0 +1,11 @@ +/// + +yamljs.load('yaml-testfile.yml'); + +yamljs.parse('this_is_no_ymlstring'); + +yamljs.stringify({ a : 'val', b : { ba : 123, bb : 'nothing' }}); + +yamljs.stringify({ a : 'val', b : { ba : 123, bb : 'nothing' }}, 1); + +yamljs.stringify({ a : 'val', b : { ba : 123, bb : 'nothing' }}, 1, 2); \ No newline at end of file diff --git a/yamljs/yamljs.d.ts b/yamljs/yamljs.d.ts index 5bdfd60a4..ca287110d 100644 --- a/yamljs/yamljs.d.ts +++ b/yamljs/yamljs.d.ts @@ -5,6 +5,10 @@ declare module yamljs { - export function load(path : string) : any[]; + export function load(path : string) : any; + + export function stringify(nativeObject : any, inline? : number, spaces? : number) : string; + + export function parse(yamlString : string) : any; } \ No newline at end of file From d6d74731209dd4dccb2dededffb7302a5b42e0a7 Mon Sep 17 00:00:00 2001 From: Tim Jonischkat Date: Mon, 30 Mar 2015 16:04:49 +0200 Subject: [PATCH 212/243] corrected documentation --- yamljs/yamljs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yamljs/yamljs.d.ts b/yamljs/yamljs.d.ts index ca287110d..34b5f40dc 100644 --- a/yamljs/yamljs.d.ts +++ b/yamljs/yamljs.d.ts @@ -1,6 +1,6 @@ // Type definitions for yamljs 0.2.1 // Project: https://github.com/jeremyfa/yaml.js -// Definitions by: Tim Jonischkat +// Definitions by: Tim Jonischkat // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module yamljs { From 1bdfd37e924263c8988a40e1aa65806fd266bf59 Mon Sep 17 00:00:00 2001 From: Tim Jonischkat Date: Mon, 30 Mar 2015 16:38:03 +0200 Subject: [PATCH 213/243] corrected module name --- yamljs/yamljs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yamljs/yamljs.d.ts b/yamljs/yamljs.d.ts index 34b5f40dc..65d2fd923 100644 --- a/yamljs/yamljs.d.ts +++ b/yamljs/yamljs.d.ts @@ -3,7 +3,7 @@ // Definitions by: Tim Jonischkat // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module yamljs { +declare module "yamljs" { export function load(path : string) : any; From a965499ef65d88c30e4e87bbb36ef908e1a20bde Mon Sep 17 00:00:00 2001 From: Tim Jonischkat Date: Mon, 30 Mar 2015 16:41:03 +0200 Subject: [PATCH 214/243] adapted test to renaming --- yamljs/yamljs-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yamljs/yamljs-tests.ts b/yamljs/yamljs-tests.ts index a2453edff..9780c504d 100644 --- a/yamljs/yamljs-tests.ts +++ b/yamljs/yamljs-tests.ts @@ -1,5 +1,7 @@ /// +import yamljs = require('yamljs'); + yamljs.load('yaml-testfile.yml'); yamljs.parse('this_is_no_ymlstring'); From 1c05872e7811235f43780b8b596bfd26fe8e7760 Mon Sep 17 00:00:00 2001 From: Audrey Date: Mon, 30 Mar 2015 11:53:44 -0400 Subject: [PATCH 215/243] Include padAngle to PieLayout interface Based on line 68 of pie.js https://github.com/mbostock/d3/blob/master/src/layout/pie.js --- d3/d3.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 57e817818..f2579b948 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -1279,6 +1279,13 @@ declare module D3 { (angle: (d : any) => number): PieLayout (angle: (d : any, i: number) => number): PieLayout; }; + padAngle: { + (): number; + (angle: number): PieLayout; + (angle: () => number): PieLayout; + (angle: (d : any) => number): PieLayout + (angle: (d : any, i: number) => number): PieLayout; + }; } export interface ArcDescriptor { From 7acd4688471832500a161e1c0514f919318fc050 Mon Sep 17 00:00:00 2001 From: Peter Grman Date: Mon, 30 Mar 2015 18:03:48 +0200 Subject: [PATCH 216/243] add options object to errorhandler function --- errorhandler/errorhandler.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/errorhandler/errorhandler.d.ts b/errorhandler/errorhandler.d.ts index 31bf44ce1..40f845d09 100644 --- a/errorhandler/errorhandler.d.ts +++ b/errorhandler/errorhandler.d.ts @@ -7,6 +7,6 @@ declare module "errorhandler" { import express = require('express'); - function e(): express.ErrorRequestHandler; + function e(options?: {log?: any}): express.ErrorRequestHandler; export = e; -} \ No newline at end of file +} From 5229045da8d24b8b4ef9ebeac50372ea13550a06 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Tue, 31 Mar 2015 01:04:56 +0500 Subject: [PATCH 217/243] Expose _.shuffle() in chained array and object wrappers --- lodash/lodash-tests.ts | 2 ++ lodash/lodash.d.ts | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 6f24b75dc..46c11ebf6 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -565,6 +565,8 @@ result = _.sample([1, 2, 3, 4]); result = _.sample([1, 2, 3, 4], 2); result = _.shuffle([1, 2, 3, 4, 5, 6]); +result = <_.LoDashArrayWrapper>_([1, 2, 3]).shuffle(); +result = <_.LoDashArrayWrapper<_.Dictionary>>_(<{ [index: string]: string; }>{ 'key1': 'test1', 'key2': 'test2' }).shuffle(); result = _.size([1, 2]); result = _.size({ 'one': 1, 'two': 2, 'three': 3 }); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index c43f27c5c..426162e2e 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -4398,6 +4398,20 @@ declare module _ { shuffle(collection: Dictionary): T[]; } + interface LoDashArrayWrapper { + /** + * @see _.shuffle + **/ + shuffle(): LoDashArrayWrapper; + } + + interface LoDashObjectWrapper { + /** + * @see _.shuffle + **/ + shuffle(): LoDashArrayWrapper; + } + //_.size interface LoDashStatic { /** From c673b469b7d1b5c55433e4bdf5466eff2ef919a2 Mon Sep 17 00:00:00 2001 From: Josh McCullough Date: Mon, 30 Mar 2015 16:24:42 -0400 Subject: [PATCH 218/243] Fixed type of assert.async()`. The function `assert.async` is not of type `any`, it is a parameterless, void function. --- qunit/qunit.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qunit/qunit.d.ts b/qunit/qunit.d.ts index dbf5d9c08..ddbf014e4 100644 --- a/qunit/qunit.d.ts +++ b/qunit/qunit.d.ts @@ -170,7 +170,7 @@ interface QUnitAssert { * resolution callback for each async operation. The callback returned from assert.async() * will throw an Error if is invoked more than once. */ - async(): any; + async(): () => void; /** * A deep recursive comparison assertion, working on primitive types, arrays, objects, From cfb41c331e005095dd134b69e176a0e45cdd78b0 Mon Sep 17 00:00:00 2001 From: Ricardo Franco Date: Mon, 30 Mar 2015 18:17:40 -0300 Subject: [PATCH 219/243] fix missing module 'ng' --- angularjs/angular.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 9f7efea89..90822f603 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -452,9 +452,9 @@ declare module angular { $invalid: boolean; $submitted: boolean; $error: any; - $addControl(control: ng.INgModelController): void; - $removeControl(control: ng.INgModelController): void; - $setValidity(validationErrorKey: string, isValid: boolean, control: ng.INgModelController): void; + $addControl(control: INgModelController): void; + $removeControl(control: INgModelController): void; + $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController): void; $setDirty(): void; $setPristine(): void; $commitViewValue(): void; @@ -509,7 +509,7 @@ declare module angular { } interface IAsyncModelValidators { - [index: string]: (...args: any[]) => ng.IPromise; + [index: string]: (...args: any[]) => IPromise; } interface IModelParser { @@ -1573,12 +1573,12 @@ declare module angular { * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to. */ decorator(name: string, inlineAnnotatedFunction: any[]): void; - factory(name: string, serviceFactoryFunction: Function): ng.IServiceProvider; - factory(name: string, inlineAnnotatedFunction: any[]): ng.IServiceProvider; - provider(name: string, provider: ng.IServiceProvider): ng.IServiceProvider; - provider(name: string, serviceProviderConstructor: Function): ng.IServiceProvider; - service(name: string, constructor: Function): ng.IServiceProvider; - value(name: string, value: any): ng.IServiceProvider; + factory(name: string, serviceFactoryFunction: Function): IServiceProvider; + factory(name: string, inlineAnnotatedFunction: any[]): IServiceProvider; + provider(name: string, provider: IServiceProvider): IServiceProvider; + provider(name: string, serviceProviderConstructor: Function): IServiceProvider; + service(name: string, constructor: Function): IServiceProvider; + value(name: string, value: any): IServiceProvider; } } From 4d1663493e4994cdf025d237434b5916719b569d Mon Sep 17 00:00:00 2001 From: Ricardo Franco Date: Mon, 30 Mar 2015 18:22:58 -0300 Subject: [PATCH 220/243] rename module 'ng' to 'angular' --- angular-ui-bootstrap/angular-ui-bootstrap.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts index c9bf91c01..d7e65c77c 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts @@ -190,15 +190,15 @@ declare module angular.ui.bootstrap { /** * a promise that is resolved when a modal is closed and rejected when a modal is dismissed */ - result: ng.IPromise; + result: angular.IPromise; /** * a promise that is resolved when a modal gets opened after downloading content's template and resolving all variables */ - opened: ng.IPromise; + opened: angular.IPromise; } - interface IModalScope extends ng.IScope { + interface IModalScope extends angular.IScope { /** * Those methods make it easy to close a modal window without a need to create a dedicated controller */ @@ -623,7 +623,7 @@ declare module angular.ui.bootstrap { * * @return A promise that is resolved when the transition finishes. */ - (element: ng.IAugmentedJQuery, trigger: any, options?: ITransitionServiceOptions): ng.IPromise; + (element: angular.IAugmentedJQuery, trigger: any, options?: ITransitionServiceOptions): angular.IPromise; } interface ITransitionServiceOptions { From c124eaac95739dd9775635a4ddacbd4828febe2e Mon Sep 17 00:00:00 2001 From: Thomas Michon Date: Mon, 30 Mar 2015 19:14:40 -0700 Subject: [PATCH 221/243] Add support for mappingOptions in knockout.projections Added support for new features introduced in knockout-projections, mappingOptions parameters with either a mapping/disposeItem pair or a single mappingWithDisposeCallback function which produces a mappedItem/dispose pair. --- .../knockout.projections-tests.ts | 28 +++++++++++++++++++ .../knockout.projections.d.ts | 14 ++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/knockout.projections/knockout.projections-tests.ts b/knockout.projections/knockout.projections-tests.ts index 3d479e7ac..d8d6c8dcd 100644 --- a/knockout.projections/knockout.projections-tests.ts +++ b/knockout.projections/knockout.projections-tests.ts @@ -26,3 +26,31 @@ sourceItems.push(9); sourceItems.push(10); // evenSquares now contains [36, 16, 4, 100] + +// Testing mapping options + +interface IComplexItem { + value: string; + dispose(): void; +} + +var complexItems = sourceItems.map({ + mapping: x => { + var item: IComplexItem = { + value: (x * x).toString(), + dispose: () => { } + }; + + return item; + }, + disposeItem: (item: IComplexItem) => item.dispose() +}); + +var complexItems2 = sourceItems.map({ + mappingWithDisposeCallback: x => { + return { + mappedValue: (x * x).toString(), + dispose: () => { } + }; + } +}); diff --git a/knockout.projections/knockout.projections.d.ts b/knockout.projections/knockout.projections.d.ts index 77f3bf0ec..a9ff8b5f3 100644 --- a/knockout.projections/knockout.projections.d.ts +++ b/knockout.projections/knockout.projections.d.ts @@ -6,7 +6,17 @@ /// interface KnockoutObservableArrayFunctions { - - map(mapping: (value: T) => TResult): KnockoutObservableArray; + map(mappingOptions: { + mappingWithDisposeCallback: (value: T) => { + mappedValue: TResult; + dispose: () => void; + }; + }): KnockoutObservableArray; + map(mappingOptions: { + mapping: (value: T) => TResult; + disposeItem?: (mappedItem: TResult) => void; + }): KnockoutObservableArray; + map(mappingOptions: (value: T) => TResult): KnockoutObservableArray; + filter(predicate: (value: T) => boolean): KnockoutObservableArray; } From 697223d3e63621b69b2f0db894335f2d0758bf03 Mon Sep 17 00:00:00 2001 From: Thomas Michon Date: Mon, 30 Mar 2015 19:27:44 -0700 Subject: [PATCH 222/243] Make map and filter return type with a dispose method Defined a KnockoutMappedObservableArray type which extends KnockoutSubscription, providing a dispose() method since the mapped arrays require disposal for proper cleanup. --- knockout.projections/knockout.projections-tests.ts | 8 ++++++++ knockout.projections/knockout.projections.d.ts | 11 +++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/knockout.projections/knockout.projections-tests.ts b/knockout.projections/knockout.projections-tests.ts index d8d6c8dcd..138d36946 100644 --- a/knockout.projections/knockout.projections-tests.ts +++ b/knockout.projections/knockout.projections-tests.ts @@ -54,3 +54,11 @@ var complexItems2 = sourceItems.map({ }; } }); + +// Test disposal + +evenSquares.dispose(); + +complexItems.dispose(); + +complexItems2.dispose(); diff --git a/knockout.projections/knockout.projections.d.ts b/knockout.projections/knockout.projections.d.ts index a9ff8b5f3..e1443478a 100644 --- a/knockout.projections/knockout.projections.d.ts +++ b/knockout.projections/knockout.projections.d.ts @@ -5,18 +5,21 @@ /// +interface KnockoutMappedObservableArray extends KnockoutObservableArray, KnockoutSubscription { +} + interface KnockoutObservableArrayFunctions { map(mappingOptions: { mappingWithDisposeCallback: (value: T) => { mappedValue: TResult; dispose: () => void; }; - }): KnockoutObservableArray; + }): KnockoutMappedObservableArray; map(mappingOptions: { mapping: (value: T) => TResult; disposeItem?: (mappedItem: TResult) => void; - }): KnockoutObservableArray; - map(mappingOptions: (value: T) => TResult): KnockoutObservableArray; + }): KnockoutMappedObservableArray; + map(mappingOptions: (value: T) => TResult): KnockoutMappedObservableArray; - filter(predicate: (value: T) => boolean): KnockoutObservableArray; + filter(predicate: (value: T) => boolean): KnockoutMappedObservableArray; } From e03ab669e35e4d4f324e9b9a23a0d9945ff49817 Mon Sep 17 00:00:00 2001 From: Bradley Ayers Date: Tue, 31 Mar 2015 14:25:46 +1100 Subject: [PATCH 223/243] Add squirejs. --- squirejs/squirejs-tests.ts | 37 +++++++++++++++++++++++++++++++++++++ squirejs/squirejs.d.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 squirejs/squirejs-tests.ts create mode 100644 squirejs/squirejs.d.ts diff --git a/squirejs/squirejs-tests.ts b/squirejs/squirejs-tests.ts new file mode 100644 index 000000000..fc1701fbf --- /dev/null +++ b/squirejs/squirejs-tests.ts @@ -0,0 +1,37 @@ +/// + +import Squire = require('Squire'); + +// Default Configuration +var injector = new Squire(); + +// Different Context +injector = new Squire('other-requirejs-context'); + +// require(Array dependencies, Function callback, Function errback) +injector.require(['a'], function(A: any) {}, function(err: any) {}); + +// mock(String name | Object(name: mock), Object mock) +injector.mock("a", {}); +injector.mock({a: {}}); + +// store(String name | Array names) +injector.store('a'); +injector.store(['a', 'b']); + +// clean(Optional (String name | Array names)) +injector.clean('a'); +injector.clean(['a', 'b']); +injector.clean(); + +// remove() +injector.remove(); + +// run() +injector.run(['a'], function test(a: any) {})(function done() {}); + +// Squire.Helpers.returns(Any what) +Squire.Helpers.returns({}); + +// Squire.Helpers.constructs(Any what) +Squire.Helpers.constructs({}); diff --git a/squirejs/squirejs.d.ts b/squirejs/squirejs.d.ts new file mode 100644 index 000000000..693ca7d90 --- /dev/null +++ b/squirejs/squirejs.d.ts @@ -0,0 +1,28 @@ +// Type definitions for Squire 0.2.1 +// Project: https://github.com/iammerrick/Squire.js +// Definitions by: Bradley Ayers +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'Squire' { + class Squire { + constructor(); + constructor(context: string); + mock(name: string, mock: any): Squire; + mock(mocks: {[name: string]: any}): Squire; + require(dependencies: string[], callback: Function, errback: Function): Squire; + store(name: string | string[]): Squire; + clean(): Squire; + clean(name: string | string[]): Squire; + remove(): String; + run(dependencies: string[], test: Function): (done: Function) => void; + } + + module Squire { + module Helpers { + export function returns(what: T): () => T; + export function constructs(what: T): () => (() => T); + } + } + + export = Squire; +} From 81b5b55d9d98f9fe36ab908934a4aaa611169157 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 Mar 2015 14:08:29 +0200 Subject: [PATCH 224/243] updated definitions --- polymer/polymer-tests.ts | 25 +++++++++++++++++++++++ polymer/polymer.app-router.d.ts | 2 +- polymer/polymer.core-drawer-panel.d.ts | 2 +- polymer/polymer.d.ts | 28 +++++++++++++++++++++++--- polymer/polymer.paper-toast.d.ts | 2 +- 5 files changed, 53 insertions(+), 6 deletions(-) diff --git a/polymer/polymer-tests.ts b/polymer/polymer-tests.ts index a606692fd..f594b4f22 100644 --- a/polymer/polymer-tests.ts +++ b/polymer/polymer-tests.ts @@ -10,6 +10,31 @@ class AbstractPolymerElement implements PolymerElement { asyncFire(eventName: string, details?: any, targetNode?: any, bubbles?: boolean, cancelable?: boolean): void { } cancelUnbindAll(): void { } + + /** + * User must call from attached callback + */ + resizableAttachedHandler(): void {} + + /** + * User must call from detached callback + */ + resizableDetachedHandler(): void {} + + /** + * User must call from attached callback + */ + resizerAttachedHandler(): void {} + + /** + * User must call from detached callback + */ + resizerDetachedHandler(): void {} + + /** + * User should call when resizing or un-hiding children + */ + notifyResize(): void {} } class AbstractWebComponent extends AbstractPolymerElement { diff --git a/polymer/polymer.app-router.d.ts b/polymer/polymer.app-router.d.ts index 633479ba2..dc91d2974 100644 --- a/polymer/polymer.app-router.d.ts +++ b/polymer/polymer.app-router.d.ts @@ -5,7 +5,7 @@ declare module PolymerComponents { module App { - export interface Router extends HTMLElement { + export interface Router extends PolymerElement, HTMLElement { init(): void; go(path: string, options?: { replace?: boolean }): void; } diff --git a/polymer/polymer.core-drawer-panel.d.ts b/polymer/polymer.core-drawer-panel.d.ts index 2bad7b633..90f89b3e6 100644 --- a/polymer/polymer.core-drawer-panel.d.ts +++ b/polymer/polymer.core-drawer-panel.d.ts @@ -5,7 +5,7 @@ declare module PolymerComponents { export module Core { - export interface DrawerPanel extends HTMLElement { + export interface DrawerPanel extends PolymerElement, HTMLElement { /** * Width of the drawer panel. default: '256px' */ diff --git a/polymer/polymer.d.ts b/polymer/polymer.d.ts index dfb812f8c..ed084a448 100644 --- a/polymer/polymer.d.ts +++ b/polymer/polymer.d.ts @@ -18,6 +18,31 @@ interface PolymerElement { domReady? (): void; detached? (): void; attributeChanged? (attrName: string, oldVal: any, newVal: any): void; + + /** + * User must call from attached callback + */ + resizableAttachedHandler(): void; + + /** + * User must call from detached callback + */ + resizableDetachedHandler(): void; + + /** + * User must call from attached callback + */ + resizerAttachedHandler(): void; + + /** + * User must call from detached callback + */ + resizerDetachedHandler(): void; + + /** + * User should call when resizing or un-hiding children + */ + notifyResize(): void; } interface Polymer { @@ -34,9 +59,6 @@ interface Polymer { (tagName: string, prototype: any): void; (prototype: PolymerElement): void; (): void; - // hacks for mixins - CoreResizer: any; - CoreResizable: any; } declare var Polymer: Polymer; diff --git a/polymer/polymer.paper-toast.d.ts b/polymer/polymer.paper-toast.d.ts index fbf8cd7a6..49be472e6 100644 --- a/polymer/polymer.paper-toast.d.ts +++ b/polymer/polymer.paper-toast.d.ts @@ -5,7 +5,7 @@ declare module PolymerComponents { export module Paper { - export interface Toast extends HTMLElement { + export interface Toast extends PolymerElement, HTMLElement { /** * The text shows in a toast. * default: '' From 8051bfc3bc8707bc0d34953c939322b1ba0067a7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 Mar 2015 14:11:15 +0200 Subject: [PATCH 225/243] updated defs --- polymer/polymer.core-overlay.d.ts | 90 ++++++++++++++++++++++++++++++ polymer/polymer.core-selector.d.ts | 18 ++++++ polymer/polymer.paper-dialog.d.ts | 27 +++++++++ 3 files changed, 135 insertions(+) create mode 100644 polymer/polymer.core-overlay.d.ts create mode 100644 polymer/polymer.core-selector.d.ts create mode 100644 polymer/polymer.paper-dialog.d.ts diff --git a/polymer/polymer.core-overlay.d.ts b/polymer/polymer.core-overlay.d.ts new file mode 100644 index 000000000..7ca5c5b8f --- /dev/null +++ b/polymer/polymer.core-overlay.d.ts @@ -0,0 +1,90 @@ +// Type definitions for polymer's paper-toast +// Project: https://github.com/Polymer/core-selector +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module PolymerComponents { + export module Core { + export interface Overlay extends PolymerElement, HTMLElement { + /** + * The target element that will be shown when the overlay is opened. If unspecified, the core-overlay itself is the target. + * default: the overlay element + */ + target: Object; + + /** + * A core-overlay's size is guaranteed to be constrained to the window size. To achieve this, the sizingElement is sized with a max-height/width. By default this element is the target element, but it can be specifically set to a specific element inside the target if that is more appropriate. This is useful, for example, when a region inside the overlay should scroll if needed. + * default: the target element + */ + sizingTarget: Object; + + /** + * Set opened to true to show an overlay and to false to hide it. A core-overlay may be made initially opened by setting its opened attribute. + * default: false + */ + opened: boolean; + + /** + * If true, the overlay has a backdrop darkening the rest of the screen. The backdrop element is attached to the document body and may be styled with the class core-overlay-backdrop. When opened the core-opened class is applied. + * default: false + */ + backdrop: boolean; + + /** + * If true, the overlay is guaranteed to display above page content. + * default: false + */ + layered: boolean; + + /** + * By default an overlay will close automatically if the user taps outside it or presses the escape key. Disable this behavior by setting the autoCloseDisabled property to true. + * default: false + */ + autoCloseDisabled: boolean; + + /** + * By default an overlay will focus its target or an element inside it with the autoFocus attribute. Disable this behavior by setting the autoFocusDisabled property to true. + * default: false + */ + autoFocusDisabled: boolean; + + /** + * This property specifies an attribute on elements that should close the overlay on tap. Should not set closeSelector if this is set. + * default: "core-overlay-toggle" + */ + closeAttribute: string; + + /** + * This property specifies a selector matching elements that should close the overlay on tap. Should not set closeAttribute if this is set. + * default: '' + */ + closeSelector: string; + + /** + * The transition property specifies a string which identifies a core-transition element that will be used to help the overlay open and close. The default core-transition-fade will cause the overlay to fade in and out. + * default: 'core-transition-fade' + */ + transition: string; + + /** + * Toggle the opened state of the overlay. + */ + toggle(): void; + + /** + * Open the overlay. This is equivalent to setting the opened property to true. + */ + open(): void; + + /** + * Close the overlay. This is equivalent to setting the opened property to false. + */ + close(): void; + + /** + * Extensions of core-overlay should implement the resizeHandler method to adjust the size and position of the overlay when the browser window resizes. + */ + resizeHandler(): void; + } + } +} \ No newline at end of file diff --git a/polymer/polymer.core-selector.d.ts b/polymer/polymer.core-selector.d.ts new file mode 100644 index 000000000..3371369fe --- /dev/null +++ b/polymer/polymer.core-selector.d.ts @@ -0,0 +1,18 @@ +// Type definitions for polymer's paper-toast +// Project: https://github.com/Polymer/core-selector +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module PolymerComponents { + export module Core { + export interface Selector extends PolymerElement, HTMLElement { + } + + export interface SelectorOnSelectEvent extends Event { + detail: { + item: HTMLElement; + isSelected: boolean; + }; + } + } +} \ No newline at end of file diff --git a/polymer/polymer.paper-dialog.d.ts b/polymer/polymer.paper-dialog.d.ts new file mode 100644 index 000000000..fd585e7b7 --- /dev/null +++ b/polymer/polymer.paper-dialog.d.ts @@ -0,0 +1,27 @@ +// Type definitions for polymer's paper-dialog +// Project: https://github.com/Polymer/paper-dialog +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module PolymerComponents { + export module Paper { + export interface Dialog extends PolymerComponents.Core.Overlay, HTMLElement { + /** + * The title of the dialog. + * default: '' + */ + heading: string; + + /** + * See paper-dialog-transition + * default: '' + */ + transition: string; + + /** + * default: true + */ + layered: boolean; + } + } +} \ No newline at end of file From 7e3615254a348d70f894864b7072a48f64e64ee3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 Mar 2015 14:49:09 +0200 Subject: [PATCH 226/243] references to polymer def file --- polymer/polymer.app-router.d.ts | 2 ++ polymer/polymer.core-drawer-panel.d.ts | 2 ++ polymer/polymer.core-overlay.d.ts | 2 ++ polymer/polymer.core-selector.d.ts | 2 ++ polymer/polymer.paper-dialog.d.ts | 2 ++ polymer/polymer.paper-toast.d.ts | 2 ++ 6 files changed, 12 insertions(+) diff --git a/polymer/polymer.app-router.d.ts b/polymer/polymer.app-router.d.ts index dc91d2974..adf2f8d3b 100644 --- a/polymer/polymer.app-router.d.ts +++ b/polymer/polymer.app-router.d.ts @@ -3,6 +3,8 @@ // Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module PolymerComponents { module App { export interface Router extends PolymerElement, HTMLElement { diff --git a/polymer/polymer.core-drawer-panel.d.ts b/polymer/polymer.core-drawer-panel.d.ts index 90f89b3e6..f219b4d0b 100644 --- a/polymer/polymer.core-drawer-panel.d.ts +++ b/polymer/polymer.core-drawer-panel.d.ts @@ -3,6 +3,8 @@ // Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module PolymerComponents { export module Core { export interface DrawerPanel extends PolymerElement, HTMLElement { diff --git a/polymer/polymer.core-overlay.d.ts b/polymer/polymer.core-overlay.d.ts index 7ca5c5b8f..706dee899 100644 --- a/polymer/polymer.core-overlay.d.ts +++ b/polymer/polymer.core-overlay.d.ts @@ -3,6 +3,8 @@ // Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module PolymerComponents { export module Core { export interface Overlay extends PolymerElement, HTMLElement { diff --git a/polymer/polymer.core-selector.d.ts b/polymer/polymer.core-selector.d.ts index 3371369fe..c7941cdde 100644 --- a/polymer/polymer.core-selector.d.ts +++ b/polymer/polymer.core-selector.d.ts @@ -3,6 +3,8 @@ // Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module PolymerComponents { export module Core { export interface Selector extends PolymerElement, HTMLElement { diff --git a/polymer/polymer.paper-dialog.d.ts b/polymer/polymer.paper-dialog.d.ts index fd585e7b7..fc9623024 100644 --- a/polymer/polymer.paper-dialog.d.ts +++ b/polymer/polymer.paper-dialog.d.ts @@ -3,6 +3,8 @@ // Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module PolymerComponents { export module Paper { export interface Dialog extends PolymerComponents.Core.Overlay, HTMLElement { diff --git a/polymer/polymer.paper-toast.d.ts b/polymer/polymer.paper-toast.d.ts index 49be472e6..6e29c1c8b 100644 --- a/polymer/polymer.paper-toast.d.ts +++ b/polymer/polymer.paper-toast.d.ts @@ -3,6 +3,8 @@ // Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module PolymerComponents { export module Paper { export interface Toast extends PolymerElement, HTMLElement { From 5dded606c4e00af8cc5e922c3f1c84cb5ad91ebd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 Mar 2015 14:54:50 +0200 Subject: [PATCH 227/243] paper dialog dependency to core overlay --- polymer/polymer.paper-dialog.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/polymer/polymer.paper-dialog.d.ts b/polymer/polymer.paper-dialog.d.ts index fc9623024..51758e42c 100644 --- a/polymer/polymer.paper-dialog.d.ts +++ b/polymer/polymer.paper-dialog.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// +/// declare module PolymerComponents { export module Paper { From 0858c16a2c81fb990e3d36463ef71c561663f8b3 Mon Sep 17 00:00:00 2001 From: Anatoly Bakirov Date: Tue, 17 Mar 2015 15:54:46 -0700 Subject: [PATCH 228/243] Make entire D3.Selection generic --- d3/d3-tests.ts | 6 +-- d3/d3.d.ts | 115 +++++++++++++++++++++++++------------------------ 2 files changed, 61 insertions(+), 60 deletions(-) diff --git a/d3/d3-tests.ts b/d3/d3-tests.ts index 51c51f608..a846dbfa8 100644 --- a/d3/d3-tests.ts +++ b/d3/d3-tests.ts @@ -476,7 +476,7 @@ function callenderView() { .style("text-anchor", "middle") .text(function (d) { return d; }); - var rect = svg.selectAll(".day") + var rect: D3.UpdateSelection = svg.selectAll(".day") .data(function (d) { return d3.time.days(new Date(d, 0, 1), new Date(d + 1, 0, 1)); }) .enter().append("rect") .attr("class", "day") @@ -960,7 +960,7 @@ function forcedBasedLabelPlacemant() { var anchorLink = vis.selectAll("line.anchorLink").data(labelAnchorLinks)//.enter().append("svg:line").attr("class", "anchorLink").style("stroke", "#999"); - var anchorNode = vis.selectAll("g.anchorNode").data(force2.nodes()).enter().append("svg:g").attr("class", "anchorNode"); + var anchorNode: D3.Selection = vis.selectAll("g.anchorNode").data(force2.nodes()).enter().append("svg:g").attr("class", "anchorNode"); anchorNode.append("svg:circle").attr("r", 0).style("fill", "#FFF"); anchorNode.append("svg:text").text(function (d, i) { return i % 2 == 0 ? "" : d.node.label @@ -1404,7 +1404,7 @@ function quadtree() { .attr("width", function (d) { return d.width; } ) .attr("height", function (d) { return d.height; } ); - var point = svg.selectAll(".point") + var point: D3.Selection = svg.selectAll(".point") .data(data) .enter().append("circle") .attr("class", "point") diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 57e817818..d95487994 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -12,19 +12,19 @@ declare module D3 { /** * Returns the empty selection */ - (): Selection; + (): _Selection; /** * Selects the first element that matches the specified selector string * * @param selector Selection String to match */ - (selector: string): Selection; + (selector: string): _Selection; /** * Selects the specified node * * @param element Node element to select */ - (element: EventTarget): Selection; + (element: EventTarget): _Selection; }; /** @@ -36,13 +36,13 @@ declare module D3 { * * @param selector Selection String to match */ - (selector: string): Selection; + (selector: string): _Selection; /** * Selects the specified array of elements * * @param elements Array of node elements to select */ - (elements: EventTarget[]): Selection; + (elements: EventTarget[]): _Selection; }; } @@ -458,7 +458,7 @@ declare module D3 { /** * Returns the root selection */ - selection(): Selection; + selection(): _Selection; ns: { /** * The map of registered namespace prefixes @@ -726,56 +726,56 @@ declare module D3 { format(rows: any[]): string; } - export interface Selection extends Selectors, Array { + export interface _Selection extends Selectors, Array { attr: { (name: string): string; - (name: string, value: any): Selection; - (name: string, valueFunction: (data: any, index: number) => any): Selection; - (attrValueMap : Object): Selection; + (name: string, value: any): _Selection; + (name: string, valueFunction: (data: T, index: number) => any): _Selection; + (attrValueMap: Object): _Selection; }; classed: { (name: string): boolean; - (name: string, value: any): Selection; - (name: string, valueFunction: (data: any, index: number) => any): Selection; - (classValueMap: Object): Selection; + (name: string, value: any): _Selection; + (name: string, valueFunction: (data: T, index: number) => any): _Selection; + (classValueMap: Object): _Selection; }; style: { (name: string): string; - (name: string, value: any, priority?: string): Selection; - (name: string, valueFunction: (data: any, index: number) => any, priority?: string): Selection; - (styleValueMap : Object): Selection; + (name: string, value: any, priority?: string): _Selection; + (name: string, valueFunction: (data: T, index: number) => any, priority?: string): _Selection; + (styleValueMap: Object): _Selection; }; property: { (name: string): void; - (name: string, value: any): Selection; - (name: string, valueFunction: (data: any, index: number) => any): Selection; - (propertyValueMap : Object): Selection; + (name: string, value: any): _Selection; + (name: string, valueFunction: (data: T, index: number) => any): _Selection; + (propertyValueMap: Object): _Selection; }; text: { (): string; - (value: any): Selection; - (valueFunction: (data: any, index: number) => any): Selection; + (value: any): _Selection; + (valueFunction: (data: T, index: number) => any): _Selection; }; html: { (): string; - (value: any): Selection; - (valueFunction: (data: any, index: number) => any): Selection; + (value: any): _Selection; + (valueFunction: (data: T, index: number) => any): _Selection; }; - append: (name: string) => Selection; - insert: (name: string, before: string) => Selection; - remove: () => Selection; + append: (name: string) => _Selection; + insert: (name: string, before: string) => _Selection; + remove: () => _Selection; empty: () => boolean; data: { - (values: (data: any, index?: number) => any[], key?: (data: any, index?: number) => any): UpdateSelection; - (values: any[], key?: (data: any, index?: number) => any): UpdateSelection; - (): any[]; + (values: (data: T, index?: number) => U[], key?: (data: U, index?: number) => any): _UpdateSelection; + (values: U[], key?: (data: U, index?: number) => any): _UpdateSelection; + (): T[]; }; datum: { @@ -789,36 +789,31 @@ declare module D3 { * element. The function is then used to set each element's data. A null value will * delete the bound data. This operator has no effect on the index. */ - (values: (data: any, index: number) => any): UpdateSelection; + (values: (data: U, index: number) => any): _UpdateSelection; /** * Sets the element's bound data to the specified value on all selected elements. * Unlike the D3.Selection.data method, this method does not compute a join (and thus * does not compute enter and exit selections). * @param values The same data to be given to all elements. */ - (values: any): UpdateSelection; + (values: U): _UpdateSelection; /** * Returns the bound datum for the first non-null element in the selection. * This is generally useful only if you know the selection contains exactly one element. */ - (): any; - /** - * Returns the bound datum for the first non-null element in the selection. - * This is generally useful only if you know the selection contains exactly one element. - */ - (): T; + (): T; }; filter: { - (filter: (data: any, index: number) => boolean, thisArg?: any): UpdateSelection; - (filter: string): UpdateSelection; + (filter: (data: T, index: number) => boolean, thisArg?: any): _UpdateSelection; + (filter: string): _UpdateSelection; }; - call(callback: (selection: Selection, ...args: any[]) => void, ...args: any[]): Selection; - each(eachFunction: (data: any, index: number) => any): Selection; + call(callback: (selection: _Selection, ...args: any[]) => void, ...args: any[]): _Selection; + each(eachFunction: (data: T, index: number) => any): _Selection; on: { (type: string): (data: any, index: number) => any; - (type: string, listener: (data: any, index: number) => any, capture?: boolean): Selection; + (type: string, listener: (data: any, index: number) => any, capture?: boolean): _Selection; }; /** @@ -840,38 +835,44 @@ declare module D3 { * to compare, and should return either a negative, positive, or zero value to indicate * their relative order. */ - sort(comparator?: (a: T, b: T) => number): Selection; + sort(comparator?: (a: T, b: T) => number): _Selection; /** * Re-inserts elements into the document such that the document order matches the selection * order. This is equivalent to calling sort() if the data is already sorted, but much * faster. */ - order: () => Selection; + order: () => _Selection; /** * Returns the first non-null element in the current selection. If the selection is empty, * returns null. */ - node: () => T; + node: () => E; } - export interface EnterSelection { - append: (name: string) => Selection; - insert: (name: string, before?: string) => Selection; - select: (selector: string) => Selection; + export interface Selection extends _Selection { } + + export interface _EnterSelection { + append: (name: string) => _Selection; + insert: (name: string, before?: string) => _Selection; + select: (selector: string) => _Selection; empty: () => boolean; node: () => Element; - call: (callback: (selection: EnterSelection) => void) => EnterSelection; + call: (callback: (selection: _EnterSelection) => void) => _EnterSelection; size: () => number; } - export interface UpdateSelection extends Selection { - enter: () => EnterSelection; - update: () => Selection; - exit: () => Selection; + export interface EnterSelection extends _EnterSelection { } + + export interface _UpdateSelection extends _Selection { + enter: () => _EnterSelection; + update: () => _Selection; + exit: () => _Selection; } + export interface UpdateSelection extends _UpdateSelection { } + export interface NestKeyValue { key: string; values: any; @@ -1734,7 +1735,7 @@ declare module D3 { /** * Draws or redraws this brush into the specified selection of elements */ - (selection: Selection): void; + (selection: _Selection): void; /** * Gets or sets the x-scale associated with the brush */ @@ -1802,7 +1803,7 @@ declare module D3 { } export interface Axis { - (selection: Selection): void; + (selection: _Selection): void; (transition: Transition.Transition): void; scale: { @@ -2775,7 +2776,7 @@ declare module D3 { * registering the necessary event listeners to support * panning and zooming. */ - (selection: Selection): void; + (selection: _Selection): void; /** * Registers a listener to receive events From 97f2b68e114cab0ecab6c06822161da1e2569fd0 Mon Sep 17 00:00:00 2001 From: Brandon Luong Date: Tue, 31 Mar 2015 16:50:21 -0700 Subject: [PATCH 229/243] making datum/index usage optional --- d3/d3.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 57e817818..8ce8661fb 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -1727,7 +1727,7 @@ declare module D3 { export interface Symbol { type: (symbolType: string | ((datum: any, index: number) => string)) => Symbol; size: (size: number | ((datum: any, index: number) => number)) => Symbol; - (datum:any, index:number): string; + (datum?: any, index?: number): string; } export interface Brush { From e7c88831c1c1a813a966ee3a56fd133b029c533c Mon Sep 17 00:00:00 2001 From: ryiwamoto Date: Wed, 1 Apr 2015 12:39:20 +0900 Subject: [PATCH 230/243] Added slick.autotooltips.d.ts --- slickgrid/slick.autotooltips-tests.ts | 8 ++++++ slickgrid/slick.autotooltips.d.ts | 35 +++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 slickgrid/slick.autotooltips-tests.ts create mode 100644 slickgrid/slick.autotooltips.d.ts diff --git a/slickgrid/slick.autotooltips-tests.ts b/slickgrid/slick.autotooltips-tests.ts new file mode 100644 index 000000000..f2e7f6f39 --- /dev/null +++ b/slickgrid/slick.autotooltips-tests.ts @@ -0,0 +1,8 @@ +/// + +var grid = new Slick.Grid("#myGrid", [], [], {}); +grid.registerPlugin(new Slick.AutoTooltips({ + enableForCells: true, + enableForHeaderCells: true, + maxToolTipLength: 100 +})); diff --git a/slickgrid/slick.autotooltips.d.ts b/slickgrid/slick.autotooltips.d.ts new file mode 100644 index 000000000..34e761754 --- /dev/null +++ b/slickgrid/slick.autotooltips.d.ts @@ -0,0 +1,35 @@ +// Type definitions for SlickGrid AutoToolTips Plugin 2.1.0 +// Project: https://github.com/mleibman/SlickGrid +// Definitions by: Ryo Iwamoto +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Slick { + export interface SlickGridAutoTooltipsOption extends PluginOptions { + /** + * Enable tooltip for grid cells + * @default true + */ + enableForCells?: boolean; + + /** + * Enable tooltip for header cells + * @default false + */ + enableForHeaderCells?: boolean; + + /** + * The maximum length for a tooltip + * @default null + */ + maxToolTipLength?: number; + } + + /** + * AutoTooltips plugin to show/hide tooltips when columns are too narrow to fit content. + */ + export class AutoTooltips extends Plugin { + constructor(option?: SlickGridAutoTooltipsOption); + } +} From fc21d4baae8d09df2a52f3c7bf21f271dee40625 Mon Sep 17 00:00:00 2001 From: Bruno Grieder Date: Wed, 1 Apr 2015 11:03:44 +0200 Subject: [PATCH 231/243] Added Switchery Type Definitions (https://github.com/abpetkov/switchery) --- switchery/switchery-tests.ts | 71 ++++++++++++++++++++++++++++++++++++ switchery/switchery.d.ts | 64 ++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 switchery/switchery-tests.ts create mode 100644 switchery/switchery.d.ts diff --git a/switchery/switchery-tests.ts b/switchery/switchery-tests.ts new file mode 100644 index 000000000..2a0679502 --- /dev/null +++ b/switchery/switchery-tests.ts @@ -0,0 +1,71 @@ +/// + +// +// Examples from https://github.com/abpetkov/switchery +// + +function multipleSwitches() { + + var elems = Array.prototype.slice.call( document.querySelectorAll( '.js-switch' ) ); + + elems.forEach( (html: Element) => { + var switchery = new Switchery( html ); + } ); +} + + +function disabledSwitch() { + + var elem = document.querySelector( '.js-switch' ) + + //inactive switch + var switchery = new Switchery( elem, {disabled: true} ); + + //Customize the default opacity of the disabled switch, using the disabledOpacity option. + switchery = new Switchery( elem, {disabled: true, disabledOpacity: 0.75} ); +} + + +function coloredSwitch() { + + var elem = document.querySelector( '.js-switch' ) + + //You can change the primary color of the switch to fit your design perfectly: + var switchery = new Switchery( elem, {color: '#41b7f1'} ); + + //Or the secondary color, which will change the switch background color and border color: + switchery = new Switchery( elem, {secondaryColor: '#bbf0f0'} ); + + //Since version 0.6.3, you're even allowed to change the jack color from JS, as follows: + switchery = new Switchery( elem, {jackColor: '#fffc00'} ); +} + +function switchSizes() { + + var elem = document.querySelector( '.js-switch' ) + + var switchery = new Switchery( elem, {size: 'small'} ); + switchery = new Switchery( elem, {size: 'large'} ); +} + +function checkingState() { + + var elem = document.querySelector( '.js-switch' ) + + //On click: + + var clickCheckbox = document.querySelector( '.js-check-click' ) + var clickButton = document.querySelector( '.js-check-click-button' ); + + clickButton.addEventListener( 'click', () => { + alert( clickCheckbox.checked ); + } ); + + //On change: + + var changeCheckbox = document.querySelector( '.js-check-change' ); + + changeCheckbox.onchange = function () { + alert( changeCheckbox.checked ); + }; +} \ No newline at end of file diff --git a/switchery/switchery.d.ts b/switchery/switchery.d.ts new file mode 100644 index 000000000..4d953aff8 --- /dev/null +++ b/switchery/switchery.d.ts @@ -0,0 +1,64 @@ +// Type definitions for switchery 0.7.0 +// Project: https://github.com/abpetkov/switchery +// Definitions by: Bruno Grieder +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Switchery { + + export interface Options { + + /** + * color of the switch element (HEX or RGB value) + * @default '#64bd63' + */ + color? : string; + /** + * secondary color for background color and border, when the switch is off + * @default '#dfdfdf' + */ + secondaryColor? : string; + /** + * color of the jack/handle element + * @default '#fff' + */ + jackColor? : string; + /** + * class name for the switch element (by default styled in switchery.css) + * @default 'switchery' + */ + className? : string; + /** + * enable or disable click events and changing the state of the switch (boolean value) + * @default false + */ + disabled? : boolean; + /** + * opacity of the switch when it's disabled (0 to 1) + * @default 0.5 + */ + disabledOpacity? : number; + /** + * length of time that the transition will take, ex. '0.4s', '1s', '2.2s' (Note: transition speed of the handle is twice shorter) + * @default '0.4s' + */ + speed? : string; + /** + * size of the switch element (small or large) + * @default 'default' + */ + size? : string; + } + + +} + +declare class Switchery { + + constructor(node: Node, options?: Switchery.Options); + +} + +declare module "switchery" { + + export = Switchery +} \ No newline at end of file From b79e545dc323badb1fb6b8feed1037982ee71606 Mon Sep 17 00:00:00 2001 From: Bruno Grieder Date: Wed, 1 Apr 2015 11:07:34 +0200 Subject: [PATCH 232/243] jquery-fullscreen type definitions (https://github.com/kayahr/jquery-fullscreen-plugin) --- jquery-fullscreen/jquery-fullscreen-tests.ts | 36 ++++++++++++++++++++ jquery-fullscreen/jquery-fullscreen.d.ts | 28 +++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 jquery-fullscreen/jquery-fullscreen-tests.ts create mode 100644 jquery-fullscreen/jquery-fullscreen.d.ts diff --git a/jquery-fullscreen/jquery-fullscreen-tests.ts b/jquery-fullscreen/jquery-fullscreen-tests.ts new file mode 100644 index 000000000..633b3d393 --- /dev/null +++ b/jquery-fullscreen/jquery-fullscreen-tests.ts @@ -0,0 +1,36 @@ +/// + +// +// Examples from https://github.com/kayahr/jquery-fullscreen-plugin +// + +function enteringFullScreen() { + + $(document).fullScreen(true); + $('#myVideo').fullScreen(true); +} + +function exitingFullScreen() { + + $(document).fullScreen(false); + $('#myVideo').fullScreen(false); +} + + +function queryingFullScreenMode() { + + //The method returns the current fullscreen element (or true if browser doesn't support this) when fullscreen mode is active, + // false if not active or null when the browser does not support fullscreen mode at all + var isFullScreen = $(document).fullScreen() != null; +} + +function fullScreenNotifications() { + + $(document).bind("fullscreenchange", () => { + console.log("Fullscreen " + ($(document).fullScreen() ? "on" : "off")); + }); + + $(document).bind("fullscreenerror", () => { + alert("Browser rejected fullscreen change"); + }); +} \ No newline at end of file diff --git a/jquery-fullscreen/jquery-fullscreen.d.ts b/jquery-fullscreen/jquery-fullscreen.d.ts new file mode 100644 index 000000000..605b9fb59 --- /dev/null +++ b/jquery-fullscreen/jquery-fullscreen.d.ts @@ -0,0 +1,28 @@ +// Type definitions for jquery-fullscreen 1.1.5 +// Project: https://github.com/kayahr/jquery-fullscreen-plugin +// Definitions by: Bruno Grieder +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface JQuery { + + /** + * You can either switch the whole page or a single HTML element to fullscreen mode + * This only works when the code was triggered by a user interaction (For example a onclick event on a button). Browsers don't allow entering fullscreen mode without user interaction. + * Fullscreen mode is always exited via the document but this plugin allows it also via any HTML element. The owner document of the selected HTML element is used + */ + fullScreen(fullScreen: boolean): JQuery | boolean; + + /** + * The method returns the current fullscreen element (or true if browser doesn't support this) when fullscreen mode is active, + * false if not active or null when the browser does not support fullscreen mode at all + */ + fullScreen(): boolean; + + /** + * The plugin provides another method for simple fullscreen mode toggling + */ + toggleFullScreen(): JQuery | boolean; +} + From 00dc7c1c629c3fd5e92a56afc87efda571d84e22 Mon Sep 17 00:00:00 2001 From: davetayls Date: Wed, 1 Apr 2015 13:46:04 +0100 Subject: [PATCH 233/243] move cordova plugins namespace in to cordova definition --- cordova-ionic/cordova-ionic.d.ts | 6 +----- cordova/cordova.d.ts | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cordova-ionic/cordova-ionic.d.ts b/cordova-ionic/cordova-ionic.d.ts index c9b1e635b..5f0adee3e 100644 --- a/cordova-ionic/cordova-ionic.d.ts +++ b/cordova-ionic/cordova-ionic.d.ts @@ -5,10 +5,6 @@ /// -interface Cordova { - plugins:Plugins; -} - -interface Plugins { +interface CordovaPlugins { Keyboard:Ionic.Keyboard; } diff --git a/cordova/cordova.d.ts b/cordova/cordova.d.ts index 75b77ebe2..32ef0a76b 100644 --- a/cordova/cordova.d.ts +++ b/cordova/cordova.d.ts @@ -43,8 +43,12 @@ interface Cordova { define(moduleName: string, factory: (require: any, exports: any, module: any) => any): void; /** Access a Cordova module by name. */ require(moduleName: string): any; + /** Namespace for Cordova plugin functionality */ + plugins:CordovaPlugins; } +interface CordovaPlugins {} + interface Document { addEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; From 9b2bc33eb53b7a2e6a74192254a10fd0fa6151d2 Mon Sep 17 00:00:00 2001 From: davetayls Date: Wed, 1 Apr 2015 13:46:19 +0100 Subject: [PATCH 234/243] add cordova-plugin-email-composer definition --- .../cordova-plugin-email-composer-tests.ts | 19 +++++++++++ .../cordova-plugin-email-composer.d.ts | 33 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 cordova-plugin-email-composer/cordova-plugin-email-composer-tests.ts create mode 100644 cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts diff --git a/cordova-plugin-email-composer/cordova-plugin-email-composer-tests.ts b/cordova-plugin-email-composer/cordova-plugin-email-composer-tests.ts new file mode 100644 index 000000000..ccd1e725d --- /dev/null +++ b/cordova-plugin-email-composer/cordova-plugin-email-composer-tests.ts @@ -0,0 +1,19 @@ +/// +/// + +cordova.plugins.email.isAvailable((isAvailable) => {}, {}); +cordova.plugins.email.open({ + to: ['foo@bar.com'], + body: 'foo bar' +}); +cordova.plugins.email.open(); +cordova.plugins.email.open({}, () => {}); +cordova.plugins.email.open({}, () => {}, {}); + +cordova.plugins.email.openDraft({ + to: ['foo@bar.com'], + body: 'foo bar' +}); +cordova.plugins.email.openDraft(); +cordova.plugins.email.openDraft({}, () => {}); +cordova.plugins.email.openDraft({}, () => {}, {}); diff --git a/cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts b/cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts new file mode 100644 index 000000000..9472ccf35 --- /dev/null +++ b/cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts @@ -0,0 +1,33 @@ +// Type definitions for Apache Cordova Email Composer plugin +// Project: https://github.com/katzer/cordova-plugin-email-composer +// Definitions by: Dave Taylor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * The plugin provides access to the standard interface that manages the + * editing and sending an email message + */ +interface CordovaPluginEmailComposer { + /** Determine if the device is capable to send emails */ + isAvailable(callback:(isAvailable:boolean) => void, scope?:any):void; + /** Open a pre-filled email draft */ + open(options?:ICordovaPluginEmailComposerOpenOptions, callback?:() => void, scope?:any):void; + openDraft(options?:ICordovaPluginEmailComposerOpenOptions, callback?:() => void, scope?:any):void; +} + +interface ICordovaPluginEmailComposerOpenOptions { + /** An configured email account is required to send emails */ + to?:string[]; + body?:string; + cc?:string[]; + bcc?:string[]; + /** Attachments can be either base64 encoded datas, files from the the device storage or assets from within the www folder */ + attachments?:any[]; + subject?:string; + /** The default value for isHTML is true */ + isHtml?:boolean; +} + +interface CordovaPlugins { + email:CordovaPluginEmailComposer; +} From e30c79d328b268dd3a8d87688b4aeef57b7f243e Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 2 Apr 2015 01:58:04 +0900 Subject: [PATCH 235/243] add posix and win32 object to node/path --- node/node.d.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 3838a2952..88745f468 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1036,6 +1036,36 @@ declare module "path" { export var delimiter: string; export function parse(p: string): ParsedPath; export function format(pP: ParsedPath): string; + + export module posix { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; + } + + export module win32 { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; + } } declare module "string_decoder" { From e5d9227b59098c4ea38ce2caea154ac836987eef Mon Sep 17 00:00:00 2001 From: "Michael J. Bennett" Date: Wed, 1 Apr 2015 20:00:42 -0400 Subject: [PATCH 236/243] mariasql definitions are now a ghost module On branch mariasql modified: mariasql/mariasql-tests.ts modified: mariasql/mariasql.d.ts --- mariasql/mariasql-tests.ts | 2 +- mariasql/mariasql.d.ts | 161 +++++++++++++++++++------------------ 2 files changed, 84 insertions(+), 79 deletions(-) diff --git a/mariasql/mariasql-tests.ts b/mariasql/mariasql-tests.ts index 554d3d4a7..6700a0353 100644 --- a/mariasql/mariasql-tests.ts +++ b/mariasql/mariasql-tests.ts @@ -7,7 +7,7 @@ import util = require('util'); import Client = require('mariasql'); -var c:Client = new Client(), +var c:MARIASQL.MariaClient = new Client(), inspect = util.inspect; c.connect({ diff --git a/mariasql/mariasql.d.ts b/mariasql/mariasql.d.ts index 2c375a173..8b3d5551a 100644 --- a/mariasql/mariasql.d.ts +++ b/mariasql/mariasql.d.ts @@ -3,95 +3,100 @@ // Definitions by: MichaelBennett // Definitions: https://github.com/borisyankov/DefinitelyTyped +declare module MARIASQL { + export interface MariaCallBackError { + (error:Error):void + } -/** - */ -interface MariaCallBackError { - (error:Error):void -} + export interface MariaCallBackResult { + (result:MariaResult):void + } -interface MariaCallBackResult { - (result:MariaResult):void -} + export interface MariaCallBackRow { + (result:Array):void + } -interface MariaCallBackRow { - (result:Array):void -} + export interface MariaCallBackBoolean { + (result:boolean):void + } -interface MariaCallBackBoolean { - (result:boolean):void -} + export interface MariaCallBackObject { + (result:Object):void + } -interface MariaCallBackObject { - (result:Object):void -} + export interface MariaCallBackVoid { + ():void + } -interface MariaCallBackVoid { - ():void -} + export interface Dictionary { + [index: string]: any; + } -interface Dictionary { - [index: string]: any; -} + export interface MariaPreparedQuery { + (values:Dictionary):string; + (values:Array):string; + } -interface MariaPreparedQuery { - (values:Dictionary):string; - (values:Array):string; -} + export interface ClientConfig { + host: string; + user: string; + password: string; + db?: string; + port?: number; + unixSocket?: string; + keepQueries?: boolean; + multiStatements?: boolean; + connTimeout?: number; + pingInterval?: number; + secureAuth?: boolean; + compress?: boolean; + ssl?:any; + local_infile?: boolean; + read_default_group?: string; + charset?: string; + } -interface ClientConfig { - host: string; - user: string; - password: string; - db?: string; - port?: number; - unixSocket?: string; - keepQueries?: boolean; - multiStatements?: boolean; - connTimeout?: number; - pingInterval?: number; - secureAuth?: boolean; - compress?: boolean; - ssl?:any; - local_infile?: boolean; - read_default_group?: string; - charset?: string; -} + export interface MariaResult { + on(signal:string, cb:MariaCallBackObject):MariaResult; // signal 'end' + on(signal:string, cb:MariaCallBackError):MariaResult; // signal 'error' + on(signal:string, cb:MariaCallBackRow):MariaResult; // signal 'row' + on(signal:string, cb:MariaCallBackVoid):MariaResult; // signal 'abort' + abort():void; + } -declare class MariaResult { - on(signal:string, cb:MariaCallBackObject):MariaResult; // signal 'end' - on(signal:string, cb:MariaCallBackError):MariaResult; // signal 'error' - on(signal:string, cb:MariaCallBackRow):MariaResult; // signal 'row' - on(signal:string, cb:MariaCallBackVoid):MariaResult; // signal 'abort' - abort():void; -} + export interface MariaQuery { + on(signal:string, cb:MariaCallBackResult):MariaQuery; // signal 'result' + on(signal:string, cb:MariaCallBackVoid):MariaQuery; // signal 'end' + on(signal:string, cb:MariaCallBackVoid):MariaQuery; // signal 'abort' + on(signal:string, cb:MariaCallBackError):MariaQuery; // signal 'error' + abort():void; + } -declare class MariaQuery { - on(signal:string, cb:MariaCallBackResult):MariaQuery; // signal 'result' - on(signal:string, cb:MariaCallBackVoid):MariaQuery; // signal 'end' - on(signal:string, cb:MariaCallBackVoid):MariaQuery; // signal 'abort' - on(signal:string, cb:MariaCallBackError):MariaQuery; // signal 'error' - abort():void; -} + export interface MariaClient { + connect(config:ClientConfig):void; + end():void; + destroy():void; + escape(query:string):string; + query(q:string, placeHolders?:Dictionary, useArray?:boolean):MariaQuery; + query(q:string, placeHolders?:Array, useArray?:boolean):MariaQuery; + query(q:string, useArray?:boolean):MariaQuery; + prepare(query:string): MariaPreparedQuery; + isMariaDB():boolean; + on(signal:string, cb:MariaCallBackError): MariaClient; // signal 'error' + on(signal:string, cb:MariaCallBackObject): MariaClient; // signal 'close' + on(signal:string, cb:MariaCallBackVoid): MariaClient; // signal 'connect' + connected: boolean; + threadId: string; + } -declare class MariaClient { - connect(config:ClientConfig):void; - end():void; - destroy():void; - escape(query:string):string; - query(q:string, placeHolders?:Dictionary, useArray?:boolean):MariaQuery; - query(q:string, placeHolders?:Array, useArray?:boolean):MariaQuery; - query(q:string, useArray?:boolean):MariaQuery; - prepare(query:string): MariaPreparedQuery; - isMariaDB():boolean; - on(signal:string, cb:MariaCallBackError): MariaClient; // signal 'error' - on(signal:string, cb:MariaCallBackObject): MariaClient; // signal 'close' - on(signal:string, cb:MariaCallBackVoid): MariaClient; // signal 'connect' - connected: boolean; - threadId: string; -} - -declare module 'mariasql' { - export = MariaClient; + export interface Client { + new ():MariaClient; + ():MariaClient; + prototype: MariaClient; + } } +declare module "mariasql" { + var Client:MARIASQL.Client; + export = Client; +} \ No newline at end of file From e22dc1bbe6d40022f95f99d3f546609cbabfd5c2 Mon Sep 17 00:00:00 2001 From: Xiaohan Zhang Date: Wed, 1 Apr 2015 17:26:39 -0700 Subject: [PATCH 237/243] add initial photoswipe typings --- photoswipe/photoswipe-tests.ts | 209 ++++++++ photoswipe/photoswipe.d.ts | 898 +++++++++++++++++++++++++++++++++ 2 files changed, 1107 insertions(+) create mode 100644 photoswipe/photoswipe-tests.ts create mode 100644 photoswipe/photoswipe.d.ts diff --git a/photoswipe/photoswipe-tests.ts b/photoswipe/photoswipe-tests.ts new file mode 100644 index 000000000..79125bd05 --- /dev/null +++ b/photoswipe/photoswipe-tests.ts @@ -0,0 +1,209 @@ +/// + +function test_defaultUI() { + var items: PhotoSwipeUI_Default.Item[] = [ + { + src: "path/to/image.jpg", + w: 100, + h: 200, + specialProperty: true + }, + { + src: "path/to/image2.jpg", + w: 1000, + h: 2000, + specialProperty: false + } + ]; + + var options: PhotoSwipe.Options = { + index: 3, + getThumbBoundsFn: function(index) { + return {x: 100, y: 100, w: 100}; + }, + showAnimationDuration: 333, + hideAnimationDuration: 333, + showHideOpacity: false, + bgOpacity: 1, + spacing: 0.12, + allowNoPanText: true, + maxSpreadZoom: 2, + getDoubleTapZoom: function(isMouseClick, item) { + if (isMouseClick) { + return 1; + } else { + return item.initialZoomLevel < 0.7 ? 1 : 1.5; + } + }, + loop: true, + pinchToClose: true, + closeOnScroll: true, + closeOnVerticalDrag: true, + mouseUsed: false, + escKey: true, + arrowKeys: true, + history: true, + galleryUID: 3, + errorMsg: '
The image could not be loaded.
', + preload: [1, 1], + mainClass: "", + getNumItemsFn: () => { return 2; }, + focus: true, + isClickableElement: function(el) { + return el.tagName === 'A'; + }, + mainScrollEndFriction: 0.35, + panEndFriction: 0.35 + }; + + var photoSwipe: PhotoSwipe; + var uiOptions: PhotoSwipeUI_Default.Options = { + barsSize: {top: 44, bottom: 'auto'}, + timeToIdle: 4000, + timeToIdleOutside: 1000, + loadingIndicatorDelay: 1000, + addCaptionHTMLFn: function(item, captionEl, isFake) { + if (!item.title) { + ( captionEl.children[0]).innerHTML = ''; + return false; + } + ( captionEl.children[0]).innerHTML = item.title; + return true; + }, + closeEl: true, + captionEl: true, + fullscreenEl: true, + zoomEl: true, + shareEl: true, + counterEl: true, + arrowEl: true, + preloaderEl: true, + tapToClose: false, + tapToToggleControls: true, + clickToCloseNonZoomable: true, + closeElClasses: ['item', 'caption', 'zoom-wrap', 'ui', 'top-bar'], + indexIndicatorSep: ' / ', + shareButtons: [ + {id: 'facebook', label: 'Share on Facebook', url: 'https://www.facebook.com/sharer/sharer.php?u='}, + {id: 'twitter', label: 'Tweet', url: 'https://twitter.com/intent/tweet?text=&url='}, + {id: 'pinterest', label: 'Pin it', url: 'http://www.pinterest.com/pin/create/button/?url=&media=&description='}, + {id: 'download', label: 'Download image', url: '', download: true} + ], + getImageURLForShare: function( shareButtonData ) { + // `shareButtonData` - object from shareButtons array + // + // `pswp` is the gallery instance object, + // you should define it by yourself + // + return photoSwipe.currItem.src || ''; + }, + getPageURLForShare: function( shareButtonData ) { + return window.location.href; + }, + getTextForShare: function( shareButtonData ) { + return ( photoSwipe.currItem).title || ''; + }, + parseShareButtonOut: function(shareButtonData, shareButtonOut) { + return shareButtonOut; + } + }; + + var pswpElement = document.getElementById("gallery"); + photoSwipe = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, uiOptions); + +} + +function test_photoSwipeMethods() { + var photoSwipe: PhotoSwipe; + + photoSwipe.init(); + + alert(photoSwipe.currItem.src); + alert(photoSwipe.viewportSize.x); + photoSwipe.ui.init(); + photoSwipe.bg.style.borderStyle = "1px solid red"; + photoSwipe.container.style.borderStyle = "1px solid red"; + photoSwipe.options.timeToIdle = 2000; + alert(photoSwipe.getCurrentIndex() === 3); + alert(photoSwipe.getZoomLevel() === 1); + alert(photoSwipe.isDragging()); + + photoSwipe.goTo(9); + photoSwipe.next(); + photoSwipe.prev(); + + photoSwipe.updateSize(true); + + photoSwipe.close(); + photoSwipe.zoomTo(2, + { x: 250, y: 250 }, + 2000, + (x) => { return x*x*(3-2*x); }, + (zoomValue) => { console.log("zoom value is now" + zoomValue); }); + photoSwipe.applyZoomPan(1, 0, 0); + + photoSwipe.items[photoSwipe.getCurrentIndex()].src = "new/path/to/image.jpg"; + photoSwipe.invalidateCurrItems(); +} + +function test_photoSwipeEvents() { + var photoSwipe: PhotoSwipe; + + photoSwipe.listen('beforeChange', () => {}); + photoSwipe.listen('afterChange', () => {}); + photoSwipe.listen('beforeChange', () => {}); + photoSwipe.listen('imageLoadComplete', (idx: number, item: PhotoSwipeUI_Default.Item) => { + item.w *= 2; + }); + photoSwipe.listen('resize', () => {}); + photoSwipe.listen('gettingData', (idx: number, item: PhotoSwipeUI_Default.Item) => { + item.title = "abc"; + }); + photoSwipe.listen('mouseUsed', () => {}); + photoSwipe.listen('initialZoomIn', () => {}); + photoSwipe.listen('initialZoomInEnd', () => {}); + photoSwipe.listen('initialZoomOut', () => {}); + photoSwipe.listen('initialZoomOutEnd', () => {}); + photoSwipe.listen('parseVerticalMargin', (item: PhotoSwipeUI_Default.Item) => { + item.vGap.top = 20; + item.vGap.bottom = 40; + }); + photoSwipe.listen('close', () => {}); + photoSwipe.listen('unbindEvents', () => {}); + photoSwipe.listen('destroy', () => {}); + photoSwipe.listen('preventDragEvent', (e: MouseEvent, isDown: boolean, preventObj: {prevent: boolean}) => { + if (e.x > 50 && isDown) { + preventObj.prevent = true; + } + }); + + photoSwipe.listen('foo', (a, b, c) => { + alert(a + b + c); + }); + photoSwipe.shout('foo', 1, 2, 3); +} + +function test_customUI() { + var pswpElement = document.getElementById("gallery2"); + var myPhotoSwipe = new PhotoSwipe(pswpElement, MyUI, [], { + bgOpacity: 0, + index: 3, + foo: 123, + bar: "abc" + }); +} + +interface MyUIOptions extends PhotoSwipe.Options { + foo: number; + bar: string; +} + +class MyUI implements PhotoSwipe.UI { + constructor(pswp: PhotoSwipe, framework: PhotoSwipe.UIFramework) { + // dummy + } + + init() { + // dummy + } +} diff --git a/photoswipe/photoswipe.d.ts b/photoswipe/photoswipe.d.ts new file mode 100644 index 000000000..b09fe75dd --- /dev/null +++ b/photoswipe/photoswipe.d.ts @@ -0,0 +1,898 @@ +// Type definitions for PhotoSwipe 4.0.7 +// Project: http://photoswipe.com/ +// Definitions by: Xiaohan Zhang +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module PhotoSwipe { + /** + * A specific slide in the PhotoSwipe gallery. The terms "item", "slide", and "slide object" are used interchangeably. + */ + interface Item { + /** + * The url of this image. + */ + src: string; + /** + * The width of this image. + */ + w: number; + /** + * The height of this image. + */ + h: number; + + /** + * Internal property added by PhotoSwipe. + */ + loadError?: boolean; + + /** + * Internal property added by PhotoSwipe. + */ + vGap?: {top: number; bottom: number}; + + /** + * Internal property added by PhotoSwipe. + * This number is computed to be this item's smaller dimension divided by the larger dimension. + */ + fitRatio?: number; + + /** + * Internal property added by PhotoSwipe. + */ + initialZoomLevel?: number; + + /** + * Internal property added by PhotoSwipe. + */ + bounds?: any; + + /** + * Internal property added by PhotoSwipe. + */ + initialPosition?: any; + } + + /** + * Options for the base PhotoSwipe class. Derived from http://photoswipe.com/documentation/options.html + */ + interface Options { + /** + * Start slide index. 0 is the first slide. Must be integer, not a string. + * + * Default 0. + */ + index?: number; + + /** + * Function should return an object with coordinates from which initial zoom-in animation will start (or zoom-out animation will end). + * Object should contain three properties: x (X position, relative to document), y (Y position, relative to document), w (width of the element). + * Height will be calculated automatically based on size of large image. + * For example if you return {x:0,y:0,w:50} zoom animation will start in top left corner of your page. + * Function has one argument - index of the item that is opening or closing. + * + * Default undefined. + */ + getThumbBoundsFn?: (index: number) => { x: number; y: number; w: number }; + + /** + * Initial zoom-in transition duration in milliseconds. Set to 0 to disable. Besides this JS option, you need also to change transition duration in PhotoSwipe CSS file: + * .pswp--animate_opacity, + * .pswp__bg, + * .pswp__caption, + * .pswp__top-bar, + * .pswp--has_mouse .pswp__button--arrow--left, + * .pswp--has_mouse .pswp__button--arrow--right{ + * -webkit-transition: opacity 333ms cubic-bezier(.4,0,.22,1); + * transition: opacity 333ms cubic-bezier(.4,0,.22,1); + * } + * + * Default 333. + */ + showAnimationDuration?: number; + + /** + * The same as the previous option, just for closing (zoom-out) transition. + * After PhotoSwipe is opened pswp--open class will be added to the root element, you may use it to apply different transition duration in CSS. + * + * Default 333. + */ + hideAnimationDuration?: number; + + /** + * If set to false background opacity and image scale will be animated (image opacity is always 1). + * If set to true root PhotoSwipe element opacity and image scale will be animated. + * Enable it when dimensions of your small thumbnail don't match dimensions of large image. + * + * Default false. + */ + showHideOpacity?: boolean; + + /** + * Background (.pswp__bg) opacity. + * Should be a number from 0 to 1, e.g. 0.7. + * This style is defined via JS, not via CSS, as this value is used for a few gesture-based transitions. + * + * Default 1. + */ + bgOpacity?: number; + + /** + * Spacing ratio between slides. For example, 0.12 will render as a 12% of sliding viewport width (rounded). + * + * Default 0.12. + */ + spacing?: number; + + /** + * Allow swipe navigation to next/prev item when current item is zoomed. + * Option is always false on devices that don't have hardware touch support. + * + * Default true. + */ + allowNoPanText?: boolean; + + /** + * Maximum zoom level when performing spread (zoom) gesture. 2 means that image can be zoomed 2x from original size. + * Try to avoid huge values here, as too big image may cause memory issues on mobile (especially on iOS). + * + * Default 2. + */ + maxSpreadZoom?: number; + + /** + * Function should return zoom level to which image will be zoomed after double-tap gesture, or when user clicks on zoom icon, or mouse-click on image itself. + * If you return 1 image will be zoomed to its original size. + * Function is called each time zoom-in animation is initiated. So feel free to return different values for different images based on their size or screen DPI. + * + * Default is: + * + * function(isMouseClick, item) { + * + * // isMouseClick - true if mouse, false if double-tap + * // item - slide object that is zoomed, usually current + * // item.initialZoomLevel - initial scale ratio of image + * // e.g. if viewport is 700px and image is 1400px, + * // initialZoomLevel will be 0.5 + * + * if(isMouseClick) { + * + * // is mouse click on image or zoom icon + * + * // zoom to original + * return 1; + * + * // e.g. for 1400px image: + * // 0.5 - zooms to 700px + * // 2 - zooms to 2800px + * + * } else { + * + * // is double-tap + * + * // zoom to original if initial zoom is less than 0.7x, + * // otherwise to 1.5x, to make sure that double-tap gesture always zooms image + * return item.initialZoomLevel < 0.7 ? 1 : 1.5; + * } + * } + */ + getDoubleTapZoom?: (isMouseClick: boolean, item: Item) => number; + + /** + * Loop slides when using swipe gesture.If set to true you'll be able to swipe from last to first image. + * Option is always false when there are less than 3 slides. + * This option has no relation to arrows navigation. Arrows loop is turned on permanently. You can modify this behavior by making custom UI. + * + * Default true. + */ + loop?: boolean; + + /** + * Pinch to close gallery gesture. The gallery’s background will gradually fade out as the user zooms out. When the gesture is complete, the gallery will close. + * + * Default true. + */ + pinchToClose?: boolean; + + /** + * Close gallery on page scroll. Option works just for devices without hardware touch support. + * + * Default true. + */ + closeOnScroll?: boolean; + + /** + * Close gallery when dragging vertically and when image is not zoomed. Always false when mouse is used. + * + * Default true. + */ + closeOnVerticalDrag?: boolean; + + /** + * Option allows you to predefine if mouse was used or not. + * Some PhotoSwipe feature depend on it, for example default UI left/right arrows will be displayed only after mouse is used. + * If set to false, PhotoSwipe will start detecting when mouse is used by itself, mouseUsed event triggers when mouse is found. + * + * default false. + */ + mouseUsed?: boolean; + + /** + * esc keyboard key to close PhotoSwipe. Option can be changed dynamically (yourPhotoSwipeInstance.options.escKey = false;). + * + * Default true. + */ + escKey?: boolean; + + /** + * Keyboard left or right arrow key navigation. Option can be changed dynamically (yourPhotoSwipeInstance.options.arrowKeys = false;). + * + * Default true. + */ + arrowKeys?: boolean; + + /** + * If set to false disables history module (back button to close gallery, unique URL for each slide). You can also just exclude history.js module from your build. + * + * Default true. + */ + history?: boolean; + + /** + * Gallery unique ID. Used by History module when forming URL. For example, second picture of gallery with UID 1 will have URL: http://example.com/#&gid=1&pid=2. + * + * Default 1. + */ + galleryUID?: number; + + /** + * Error message when image was not loaded. %url% will be replaced by URL of image. + * + * Default is: + * + *
The image could not be loaded.
+ */ + errorMsg?: string; + + /** + * Lazy loading of nearby slides based on direction of movement. + * Should be an array with two integers, first one - number of items to preload before current image, second one - after the current image. + * E.g. if you set it to [1,3], it'll load 1 image before the current, and 3 images after current. Values can not be less than 1. + * + * Default [1, 1]. + */ + preload?: number[]; + + /** + * String with name of class that will be added to root element of PhotoSwipe (.pswp). Can contain multiple classes separated by space. + */ + mainClass?: string; + + /** + * Function that should return total number of items in gallery. Don't put very complex code here, function is executed very often. + * + * By default it returns length of slides array. + */ + getNumItemsFn?: () => number; + + /** + * Will set focus on PhotoSwipe element after it's open. + * + * Default true. + */ + focus?: boolean; + + /** + * Function should check if the element (el) is clickable. + * If it is – PhotoSwipe will not call preventDefault and click event will pass through. + * Function should be as light is possible, as it's executed multiple times on drag start and drag release. + * + * Default is: + * + * function(el) { + * return el.tagName === 'A'; + * } + */ + isClickableElement?: (el: HTMLElement) => boolean; + } + + interface UIFramework { + [name: string]: any; + } + + /** + * Base type for PhotoSwipe user interfaces. + * T is the type of options that this PhotoSwipe.UI uses. + * + * To build your own PhotoSwipe.UI class: + * + * (1) Write an interface for the custom UI's Options that extends PhotoSwipe.Options. + * (2) Write your custom class, implementing the PhotoSwipe.UI interface. + * (3) Pass in your custom interface to the type parameter T of the PhotoSwipe.UI interface. + * + * Example: + * + * // (1) + * interface MyUIOptions extends PhotoSwipe.Options { + * foo: number; + * bar: string; + * } + * + * // (2) and (3) + * class MyUI implements PhotoSwipe.UI { + * constructor(pswp: PhotoSwipe, framework: PhotoSwipe.UIFramework) { + * } + * } + * + * var pswpWithMyUI = new PhotoSwipe(element, MyUI, items, {foo: 1, bar: "abc"}); + */ + interface UI { + /** + * Called by PhotoSwipe after it constructs the UI. + */ + init: () => void; + } +} + +/** + * Base PhotoSwipe class. Derived from http://photoswipe.com/documentation/api.html + */ +declare class PhotoSwipe { + /** + * Constructs a PhotoSwipe. + * + * Note: By default Typescript will not correctly typecheck the options parameter. Make sure to + * explicitly annotate the type of options being passed into the constructor like so: + * + * new PhotoSwipe( element, PhotoSwipeUI_Default, items, options ); + * + * It accepts 4 arguments: + * + * (1) PhotoSwipe element (it must be added to DOM). + * (2) PhotoSwipe UI class. If you included default photoswipe-ui-default.js, class will be PhotoSwipeUI_Default. Can be "false". + * (3) Array with objects (slides). + * (4) Options. + */ + constructor(pswpElement: HTMLElement, + uiConstructor: (new (pswp: PhotoSwipe, framework: PhotoSwipe.UIFramework) => PhotoSwipe.UI) | boolean, + items: PhotoSwipe.Item[], + options: T); + + /** + * Current slide object. + */ + currItem: PhotoSwipe.Item; + + /** + * Items in this gallery. PhotoSwipe will (almost) dynamically respond to changes in this array. + * To add, edit, or remove slides after PhotoSwipe is opened, you just need to modify the items array. + * + * For example, you can push new slide objects into the items array: + * + * pswp.items.push({ + * src: "path/to/image.jpg", + * w:1200, + * h:500 + * }); + * + * If you changed slide that is CURRENT, NEXT or PREVIOUS (which you should try to avoid) – you need to call method that will update their content: + * + * // sets a flag that slides should be updated + * pswp.invalidateCurrItems(); + * // updates the content of slides + * pswp.updateSize(true); + * + * If you're using the DefaultUI, call pswp.ui.update() to update that as well. Also note: + * + * (1) You can't reassign whole array, you can only modify it (e.g. use splice to remove elements). + * (2) If you're going to remove current slide – call goTo method before. + * (3) There must be at least one slide. + * (4) This technique is used to serve responsive images. + */ + items: PhotoSwipe.Item[]; + + /** + * Size of the current viewport. + */ + viewportSize: { + x: number; + y: number; + }; + + /** + * The Framework. Holds utility methods. + */ + framework: PhotoSwipe.UIFramework; + + /** + * The ui instance constructed by PhotoSwipe. + */ + ui: PhotoSwipe.UI; + + /** + * The background element (with class .pswp__bg). + */ + bg: HTMLElement; + + /** + * The container element (with class .pswp__container). + */ + container: HTMLElement; + + /** + * Options for this PhotoSwipe. This object is a copy of the options parameter passed into the constructor. + * Some properties in options are dynamically modifiable. + */ + options: T; + + /** + * Current item index. + */ + getCurrentIndex(): number; + + /** + * Current zoom level. + */ + getZoomLevel(): number; + + /** + * Whether one (or more) pointer is used. + */ + isDragging(): boolean; + + /** + * Whether two (or more) pointers are used. + */ + isZooming(): boolean; + + /** + * true wehn transition between is running (after swipe). + */ + isMainScrollAnimating(): boolean; + + /** + * Initialize and open gallery (you can bind events before this method). + */ + init(): void; + + /** + * Go to slide by index. + */ + goTo(index: number): void; + + /** + * Go to the next slide. + */ + next(): void; + + /** + * Go to the previous slide. + */ + prev(): void; + + /** + * Update gallery size + * @param {boolean} `force` If you set it to `true`, size of the gallery will be updated even if viewport size hasn't changed. + */ + updateSize(force: boolean): void; + + /** + * Close gallery. Calls destroy() after closing. + */ + close(): void; + + /** + * Destroy gallery (unbind listeners, free memory). Automatically called after close(). + */ + destroy(): void; + + /** + * Zoom in/out the current slide to a specified zoom level, optionally with animation. + * + * @param {number} `destZoomLevel` Destination scale number. Set to 1 for unzoomed. + * Use `pswp.currItem.fitRatio - image` to zoom the image to perfectly fit into the viewport. + * @param {object} `centerPoint` The center of the zoom, relative to viewport. + * @param {number} `speed` Animation duration in milliseconds. Can be 0. + * @param {function} `easingFn` Easing function (optional). Set to false to use default easing. + * This method is passed in the percentage that the animation is finished (from 0 to 1) and should return an eased value (which should be 0 at the start and 1 at the end). + * @param {function} `updateFn` Function will be called on each update frame (optional). + * This method is passed the eased zoom level. + * + * Example below will 2x zoom to center of slide: + * + * pswp.zoomTo(2, {x:pswp.viewportSize.x/2,y:pswp.viewportSize.y/2}, 2000, false, function(now) {}); + * + */ + zoomTo(destZoomLevel: number, + centerPoint: {x: number; y: number}, + speed: number, + easingFn?: (k: number) => number, + updateFn?: (now: number) => void): void; + + /** + * Apply zoom and pan to the current slide + * + * @param {number} `zoomLevel` + * @param {int} `panX` + * @param {int} `panY` + * + * For example: `pswp.applyZoomPan(1, 0, 0)` + * will zoom current image to the original size + * and will place it on top left corner. + * + */ + applyZoomPan(zoomLevel: number, panX: number, panY: number): void; + + /** + * Call this method after dynamically modifying the current, next, or previous slide in the items array. + */ + invalidateCurrItems(): void; + + /** + * PhotoSwipe uses very simple Event/Messaging system. + * It has two methods shout (triggers event) and listen (handles event). + * For now there is no method to unbind listener, but all of them are cleared when PhotoSwipe is closed. + */ + listen(eventName: string, callback: (...args: any[]) => void): void; + + /** + * Called before slides change (before the content is changed ,but after navigation). Update UI here. + */ + listen(eventName: 'beforeChange', callback: () => void): void; + /** + * Called after slides change (after content has changed). + */ + listen(eventName: 'afterChange', callback: () => void): void; + /** + * Called when an image is loaded. + */ + listen(eventName: 'imageLoadComplete', callback: (index: number, item: PhotoSwipe.Item) => void): void; + /** + * Called when the viewport size changes. + */ + listen(eventName: 'resize', callback: () => void): void; + /** + * Triggers when PhotoSwipe reads slide object data, which happens before content is set, or before lazy-loading is initiated. + * Use it to dynamically change properties of the slide object. + */ + listen(eventName: 'gettingData', callback: (index: number, item: PhotoSwipe.Item) => void): void; + /** + * Called when mouse is first used (triggers only once). + */ + listen(eventName: 'mouseUsed', callback: () => void): void; + /** + * Called when opening zoom in animation starting. + */ + listen(eventName: 'initialZoomIn', callback: () => void): void; + /** + * Called when opening zoom in animation finished. + */ + listen(eventName: 'initialZoomInEnd', callback: () => void): void; + /** + * Called when closing zoom out animation started. + */ + listen(eventName: 'initialZoomOut', callback: () => void): void; + /** + * Called when closing zoom out animation finished. + */ + listen(eventName: 'initialZoomOutEnd', callback: () => void): void; + /** + * Allows overriding vertical margin for individual items. + * + * Example: + * + * pswp.listen('parseVerticalMargin', function(item) { + * var gap = item.vGap; + * + * gap.top = 50; // There will be 50px gap from top of viewport + * gap.bottom = 100; // and 100px gap from the bottom + * }); + */ + listen(eventName: 'parseVerticalMargin', callback: (item: PhotoSwipe.Item) => void): void; + /** + * Called when the gallery starts closing. + */ + listen(eventName: 'close', callback: () => void): void; + /** + * Gallery unbinds events (triggers before closing animation). + */ + listen(eventName: 'unbindEvents', callback: () => void): void; + /** + * Called after the gallery is closed and the closing animation finishes. + * Clean up your stuff here. + */ + listen(eventName: 'destroy', callback: () => void): void; + /** + * Allow to call preventDefault on down and up events. + */ + listen(eventName: 'preventDragEvent', callback: (e: MouseEvent, isDown: boolean, preventObj: {prevent: boolean}) => void): void; + + /** + * Triggers eventName event with args passed through to listeners. + */ + shout(eventName: string, ...args: any[]): void; +} + +/** + * Default UI class for PhotoSwipe. This class is largely undocumented and doesn't seem to have a public facing API. + */ +declare class PhotoSwipeUI_Default implements PhotoSwipe.UI { + constructor(pswp: PhotoSwipe, framework: PhotoSwipe.UIFramework); + init(): void; + + /** + * Call this method to update the UI after the items array has been modified in the original PhotoSwipe element. + */ + update(): void; +} + +declare module PhotoSwipeUI_Default { + /** + * Options for the PhotoSwipe Default UI. Derived from http://photoswipe.com/documentation/options.html + */ + interface Options extends PhotoSwipe.Options { + /** + * Size of top & bottom bars in pixels. "bottom" parameter can be 'auto' (will calculate height of caption). + * Option applies only when mouse is used, or when width of screen is more than 1200px. + * Also look at `parseVerticalMargin` event. + * + * Default {top: 44, bottom: "auto"}. + */ + barsSize?: { top: number; bottom: number | string }; + + /** + * Adds class pswp__ui--idle to pswp__ui element when mouse isn't moving for timeToIdle milliseconds. + * + * Default 4000. + */ + timeToIdle?: number; + + /** + * Adds class pswp__ui--idle to pswp__ui element when mouse leaves the window for timeToIdleOutside milliseconds. + * + * Default 1000. + */ + timeToIdleOutside?: number; + + /** + * Delay in milliseconds until loading indicator is displayed. + * + * Default 1000. + */ + loadingIndicatorDelay?: number; + + /** + * Function to build caption markup. The function takes three parameters: + * + * item - slide object + * captionEl - caption DOM element + * isFake - true when content is added to fake caption container + * (used to get size of next or previous caption) + * + * Return whether to show the caption or not. + * + * Default is: + * + * function(item, captionEl, isFake) { + * if(!item.title) { + * captionEl.children[0].innerHTML = ''; + * return false; + * } + * captionEl.children[0].innerHTML = item.title; + * return true; + * } + * + */ + addCaptionHTMLFn?: (item: Item, captionEl: HTMLElement, isFake: boolean) => boolean; + + /** + * Whether to show the close button. + * + * Default true. + */ + closeEl?: boolean; + + /** + * Whether to show the caption. + * + * Default true. + */ + captionEl?: boolean; + + /** + * Whether to show the fullscreen button. + * + * Default true. + */ + fullscreenEl?: boolean; + + /** + * Whether to show the zoom button. + * + * Default true. + */ + zoomEl?: boolean; + + /** + * Whether to show the share button. + * + * Default true. + */ + shareEl?: boolean; + + /** + * Whether to show the current image's index in the gallery (located in top-left corner by default). + * + * Default true. + */ + counterEl?: boolean; + + /** + * Whether to show the left/right directional arrows. + * + * Default true. + */ + arrowEl?: boolean; + + /** + * Whether to show the preloader element. + * + * Default true. + */ + preloaderEl?: boolean; + + /** + * Tap on sliding area should close gallery. + * + * Default false. + */ + tapToClose?: boolean; + + /** + * Tap should toggle visibility of controls. + * + * Default true. + */ + tapToToggleControls?: boolean; + + /** + * Mouse click on image should close the gallery, only when image is smaller than size of the viewport. + * + * Default true. + */ + clickToCloseNonZoomable?: boolean; + + /** + * Element classes that should close PhotoSwipe when clicked on. + * In HTML markup, class should always start with "pswp__", e.g.: "pswp__item", "pswp__caption". + * + * "pswp__ui--over-close" class will be added to root element of UI when mouse is over one of these elements + * By default it's used to highlight the close button. + * + * Default ['item', 'caption', 'zoom-wrap', 'ui', 'top-bar']. + */ + closeElClasses?: string[]; + + /** + * Separator for "1 of X" counter. + * + * Default ' / '. + */ + indexIndicatorSep?: string; + + /** + * The entries that show up when you click the Share button. + * + * Default is: + * + * [ + * {id:'facebook', label:'Share on Facebook', url:'https://www.facebook.com/sharer/sharer.php?u='}, + * {id:'twitter', label:'Tweet', url:'https://twitter.com/intent/tweet?text=&url='}, + * {id:'pinterest', label:'Pin it', url:'http://www.pinterest.com/pin/create/button/?url=&media=&description='}, + * {id:'download', label:'Download image', url:'', download:true} + * ] + * + */ + shareButtons?: ShareButtonData[]; + + /** + * A callback that should return the URL for the currently selected image. The callback is passed + * the shareButtonData entry that was clicked on. + * + * Default is: + * + * function( shareButtonData ) { + * // `shareButtonData` - object from shareButtons array + * // + * // `pswp` is the gallery instance object, + * // you should define it by yourself + * // + * return pswp.currItem.src || ''; + * } + * + */ + getImageURLForShare?: (shareButtonData: ShareButtonData) => string; + + /** + * A callback that should return the "Page" associated with the selected image. (e.g. on Facebook, the shared + * content will be associated with the returned page). The callback is passed the shareButtonData entry that + * was clicked on. + * + * Default is: + * + * function( shareButtonData ) { + * return window.location.href; + * } + * + */ + getPageURLForShare?: (shareButtonData: ShareButtonData) => string; + + /** + * A callback that should return the Text associated with the selected image. The callback is passed + * the shareButtonData entry that was clicked on. + * + * Default is: + * + * function( shareButtonData ) { + * return pswp.currItem.title || ''; + * } + * + */ + getTextForShare?: (shareButtonData: ShareButtonData) => string; + + /** + * A final output callback that you can use to further modify the share button's HTML. The callback is passed + * (1) the shareButtonData entry being generated, and (2) the default HTML generated by PhotoSwipUI_Default. + * + * Default is: + * + * function(shareButtonData, shareButtonOut) { + * return shareButtonOut; + * } + * + */ + parseShareButtonOut?: (shareButtonData: ShareButtonData, shareButtonOut: string) => string; + } + + interface ShareButtonData { + /** + * An id for this share button entry. The share element associated with this entry will be classed with + * 'pswp__share--' + id + */ + id: string; + + /** + * The user-visible text to display for this entry. + */ + label: string; + + /** + * The full sharing endpoint URL for this social media site (e.g. Facebook's is facebook.com/sharer/sharer.php), with URL parameters. + * PhotoSwipUI_Default treats the URL specially. In the url string, any of the following text is treated specially: + * '{{url}}', '{{image_url}}, '{{raw_image_url}}, '{{text}}'. PhotoSwipeUI_Default will replace each of them with the following value: + * + * {{url}} becomes the (URIEncoded) url to the current "Page" (as returned by getPageURLForShare). + * {{image_url}} becomes the (URIEncoded) url of the selected image (as returned by getImageURLForShare). + * {{raw_image_url}} becomes the raw url of the selected image (as returned by getImageURLForShare). + * {{text}} becomes the (URIEncoded) share text of the selected image (as returned by getTextForShare). + */ + url: string; + + /** + * Whether this link is a direct download button or not. + * + * Default false. + */ + download?: boolean; + } + + /** + * Extra properties that the Default UI accepts. + */ + interface Item extends PhotoSwipe.Item { + /** + * The caption for this item. + */ + title?: string; + } +} From a8ef959e8ae63bc64fde7b7def7e0a621305c652 Mon Sep 17 00:00:00 2001 From: "Michael J. Bennett" Date: Wed, 1 Apr 2015 20:31:18 -0400 Subject: [PATCH 238/243] Cleaned up ghost module so that its name makes sense On branch mariasql modified: mariasql/mariasql-tests.ts modified: mariasql/mariasql.d.ts --- mariasql/mariasql-tests.ts | 2 +- mariasql/mariasql.d.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mariasql/mariasql-tests.ts b/mariasql/mariasql-tests.ts index 6700a0353..c9173058c 100644 --- a/mariasql/mariasql-tests.ts +++ b/mariasql/mariasql-tests.ts @@ -7,7 +7,7 @@ import util = require('util'); import Client = require('mariasql'); -var c:MARIASQL.MariaClient = new Client(), +var c:mariasql.MariaClient = new Client(), inspect = util.inspect; c.connect({ diff --git a/mariasql/mariasql.d.ts b/mariasql/mariasql.d.ts index 8b3d5551a..05d7fa062 100644 --- a/mariasql/mariasql.d.ts +++ b/mariasql/mariasql.d.ts @@ -3,7 +3,7 @@ // Definitions by: MichaelBennett // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module MARIASQL { +declare module mariasql { export interface MariaCallBackError { (error:Error):void } @@ -97,6 +97,6 @@ declare module MARIASQL { } declare module "mariasql" { - var Client:MARIASQL.Client; + var Client:mariasql.Client; export = Client; } \ No newline at end of file From 2faa0bb67aa2b6f817980b99c0bc8d8c99387812 Mon Sep 17 00:00:00 2001 From: AdvancedREI Date: Wed, 1 Apr 2015 19:27:53 -0700 Subject: [PATCH 239/243] Added definitions for the Auth0.com Lock platform. --- auth0.lock/auth0.lock-tests.ts | 13 ++++++ auth0.lock/auth0.lock.d.ts | 74 ++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 auth0.lock/auth0.lock-tests.ts create mode 100644 auth0.lock/auth0.lock.d.ts diff --git a/auth0.lock/auth0.lock-tests.ts b/auth0.lock/auth0.lock-tests.ts new file mode 100644 index 000000000..2bc77379f --- /dev/null +++ b/auth0.lock/auth0.lock-tests.ts @@ -0,0 +1,13 @@ +/// +/// + +var lock: new Auth0Widget('dsa7d77dsa7d7', 'mine.auth0.com'); + +lock.show({ + connections: ['facebook', 'google-oauth2', 'twitter', 'Username-Password-Authentication'], + icon: 'https://contoso.com/logo-32.png', + socialBigButtons: true +}, + () => { + // The Auth0 Widget is now loaded. + }); diff --git a/auth0.lock/auth0.lock.d.ts b/auth0.lock/auth0.lock.d.ts new file mode 100644 index 000000000..41882759a --- /dev/null +++ b/auth0.lock/auth0.lock.d.ts @@ -0,0 +1,74 @@ +// Type definitions for Auth0Widget.js +// Project: http://auth0.com +// Definitions by: Robert McLaws +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface Auth0LockPopupOptions { + width: number; + height: number; + left: number; + top: number; +} + +interface Auth0LockOptions { + authParams?: any; + callbackURL?: string; + connections?: string[]; + container?: string; + closable: boolean; + dict: any; + defaultUserPasswordConnection: string; + defaultADUsernameFromEmailPrefix?: boolean; + disableResetAction: boolean; + disableSignupAction: boolean; + focusInput: boolean; + forceJSONP?: boolean; + gravatar: boolean; + integratedWindowsLogin: boolean; + loginAfterSignup: boolean; + popup: boolean; + popupOptions: Auth0LockPopupOptions; + rememberLastLogiun: boolean; + resetLink: string; + responseType?: string; + signupLink: string; + socialBigButtons: boolean; + sso?: boolean; + theme: string; + usernameStyle: any; +} + +interface Auth0LockStatic { + new(clientId: string, domain: string, options?: Auth0LockOptions): Auth0LockStatic; + + show(): void; + show(options: Auth0LockOptions) : void; + show(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void)) : void; + show(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void)) : void; + + showSignin(): void; + showSignin(options: Auth0LockOptions) : void; + showSignin(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void)) : void; + showSignin(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void)) : void; + + showSignup(): void; + showSignup(options: Auth0LockOptions) : void; + showSignup(callback: (error?: Auth0Error) => void)) : void; + showSignup(options: Auth0LockOptions, callback: (error?: Auth0Error) => void)) : void; + + showReset(): void; + showReset(options: Auth0LockOptions) : void; + showReset(callback: (error?: Auth0Error) => void)) : void; + showReset(options: Auth0LockOptions, callback: (error?: Auth0Error) => void)) : void; + + hide(callback: () => void) : void; + logout(callback: () => void) : void; + } + +declare var Auth0Lock: Auth0LockStatic; + +declare module "Auth0Lock" { + export = Auth0Lock +} From 75e6886882fbdf080ac249bcec8dec445407a5ed Mon Sep 17 00:00:00 2001 From: AdvancedREI Date: Wed, 1 Apr 2015 20:58:39 -0700 Subject: [PATCH 240/243] Fixes to Auth0 Lock - Made all LockOptions optional. - Added separate ConstructorOptions - Fixed some method overloads. --- auth0.lock/auth0.lock-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auth0.lock/auth0.lock-tests.ts b/auth0.lock/auth0.lock-tests.ts index 2bc77379f..4ca565f23 100644 --- a/auth0.lock/auth0.lock-tests.ts +++ b/auth0.lock/auth0.lock-tests.ts @@ -1,9 +1,9 @@ /// -/// +/// -var lock: new Auth0Widget('dsa7d77dsa7d7', 'mine.auth0.com'); +var lock = new Auth0Lock('dsa7d77dsa7d7', 'mine.auth0.com'); -lock.show({ +lock.showSignin({ connections: ['facebook', 'google-oauth2', 'twitter', 'Username-Password-Authentication'], icon: 'https://contoso.com/logo-32.png', socialBigButtons: true From 72b9fa782cb152097a4da446fc34930e12a4b2c8 Mon Sep 17 00:00:00 2001 From: AdvancedREI Date: Wed, 1 Apr 2015 21:04:29 -0700 Subject: [PATCH 241/243] Additional Auth0 Lock changes Somehow one of the files didn't get checked in on the last go-around. --- auth0.lock/auth0.lock-tests.ts | 12 +++--- auth0.lock/auth0.lock.d.ts | 74 ++++++++++++++++++---------------- 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/auth0.lock/auth0.lock-tests.ts b/auth0.lock/auth0.lock-tests.ts index 4ca565f23..fd646ee1b 100644 --- a/auth0.lock/auth0.lock-tests.ts +++ b/auth0.lock/auth0.lock-tests.ts @@ -1,13 +1,13 @@ /// /// -var lock = new Auth0Lock('dsa7d77dsa7d7', 'mine.auth0.com'); +var lock: Auth0LockStatic = new Auth0Lock("dsa7d77dsa7d7", "mine.auth0.com"); lock.showSignin({ - connections: ['facebook', 'google-oauth2', 'twitter', 'Username-Password-Authentication'], - icon: 'https://contoso.com/logo-32.png', - socialBigButtons: true -}, + connections: ["facebook", "google-oauth2", "twitter", "Username-Password-Authentication"], + icon: "https://contoso.com/logo-32.png", + socialBigButtons: true + }, () => { // The Auth0 Widget is now loaded. - }); +}); diff --git a/auth0.lock/auth0.lock.d.ts b/auth0.lock/auth0.lock.d.ts index 41882759a..e8ba3cb99 100644 --- a/auth0.lock/auth0.lock.d.ts +++ b/auth0.lock/auth0.lock.d.ts @@ -17,58 +17,64 @@ interface Auth0LockOptions { callbackURL?: string; connections?: string[]; container?: string; - closable: boolean; - dict: any; - defaultUserPasswordConnection: string; + closable?: boolean; + dict?: any; + defaultUserPasswordConnection?: string; defaultADUsernameFromEmailPrefix?: boolean; - disableResetAction: boolean; - disableSignupAction: boolean; - focusInput: boolean; + disableResetAction?: boolean; + disableSignupAction?: boolean; + focusInput?: boolean; forceJSONP?: boolean; - gravatar: boolean; - integratedWindowsLogin: boolean; - loginAfterSignup: boolean; - popup: boolean; - popupOptions: Auth0LockPopupOptions; - rememberLastLogiun: boolean; - resetLink: string; + gravatar?: boolean; + integratedWindowsLogin?: boolean; + loginAfterSignup?: boolean; + popup?: boolean; + popupOptions?: Auth0LockPopupOptions; + rememberLastLogin?: boolean; + resetLink?: string; responseType?: string; - signupLink: string; - socialBigButtons: boolean; + signupLink?: string; + socialBigButtons?: boolean; sso?: boolean; - theme: string; - usernameStyle: any; + theme?: string; + usernameStyle?: any; +} + +interface Auth0LockConstructorOptions { + cdn?: string; + assetsUrl?: string; + useCordovaSocialPlugins?: boolean; } interface Auth0LockStatic { - new(clientId: string, domain: string, options?: Auth0LockOptions): Auth0LockStatic; + new (clientId: string, domain: string, options?: Auth0LockConstructorOptions): Auth0LockStatic; show(): void; - show(options: Auth0LockOptions) : void; - show(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void)) : void; - show(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void)) : void; + show(options: Auth0LockOptions): void; + show(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void; + show(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void; showSignin(): void; - showSignin(options: Auth0LockOptions) : void; - showSignin(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void)) : void; - showSignin(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void)) : void; + showSignin(options: Auth0LockOptions): void; + showSignin(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void; + showSignin(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void; showSignup(): void; - showSignup(options: Auth0LockOptions) : void; - showSignup(callback: (error?: Auth0Error) => void)) : void; - showSignup(options: Auth0LockOptions, callback: (error?: Auth0Error) => void)) : void; + showSignup(options: Auth0LockOptions): void; + showSignup(callback: (error?: Auth0Error) => void) : void; + showSignup(options: Auth0LockOptions, callback: (error?: Auth0Error) => void) : void; showReset(): void; - showReset(options: Auth0LockOptions) : void; - showReset(callback: (error?: Auth0Error) => void)) : void; - showReset(options: Auth0LockOptions, callback: (error?: Auth0Error) => void)) : void; + showReset(options: Auth0LockOptions): void; + showReset(callback: (error?: Auth0Error) => void) : void; + showReset(options: Auth0LockOptions, callback: (error?: Auth0Error) => void) : void; - hide(callback: () => void) : void; - logout(callback: () => void) : void; - } + hide(callback: () => void): void; + logout(callback: () => void): void; +} declare var Auth0Lock: Auth0LockStatic; declare module "Auth0Lock" { - export = Auth0Lock + export = Auth0Lock; } From c4076573bbc56c95ec4ad206a7b4584036a18800 Mon Sep 17 00:00:00 2001 From: Luke William Westby Date: Thu, 2 Apr 2015 10:58:56 -0500 Subject: [PATCH 242/243] renamed imgur-api to imgur-rest-api --- .../imgur-rest-api-tests.ts | 0 imgur-api/imgur-api.d.ts => imgur-rest-api/imgur-rest-api.d.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename imgur-api/imgur-api-tests.ts => imgur-rest-api/imgur-rest-api-tests.ts (100%) rename imgur-api/imgur-api.d.ts => imgur-rest-api/imgur-rest-api.d.ts (99%) diff --git a/imgur-api/imgur-api-tests.ts b/imgur-rest-api/imgur-rest-api-tests.ts similarity index 100% rename from imgur-api/imgur-api-tests.ts rename to imgur-rest-api/imgur-rest-api-tests.ts diff --git a/imgur-api/imgur-api.d.ts b/imgur-rest-api/imgur-rest-api.d.ts similarity index 99% rename from imgur-api/imgur-api.d.ts rename to imgur-rest-api/imgur-rest-api.d.ts index c25cd8acb..c06bff5e5 100644 --- a/imgur-api/imgur-api.d.ts +++ b/imgur-rest-api/imgur-rest-api.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Imgur API v3 +// Type definitions for Imgur REST API v3 // Project: https://api.imgur.com/ // Definitions by: Luke William Westby // Definitions: https://github.com/borisyankov/DefinitelyTyped From b9d7ffce3429e2de826c6332a1aab356884fc4cb Mon Sep 17 00:00:00 2001 From: Luke William Westby Date: Thu, 2 Apr 2015 11:01:29 -0500 Subject: [PATCH 243/243] renamed module ImgurApi to ImgurRestApi as well --- imgur-rest-api/imgur-rest-api-tests.ts | 54 +++++++++++++------------- imgur-rest-api/imgur-rest-api.d.ts | 2 +- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/imgur-rest-api/imgur-rest-api-tests.ts b/imgur-rest-api/imgur-rest-api-tests.ts index beb21f74e..247885557 100644 --- a/imgur-rest-api/imgur-rest-api-tests.ts +++ b/imgur-rest-api/imgur-rest-api-tests.ts @@ -1,103 +1,103 @@ -/// +/// -function testAccount(account: ImgurApi.Account) : ImgurApi.Account { +function testAccount(account: ImgurRestApi.Account) : ImgurRestApi.Account { return account; } -function testAccountSettings(accountSettings: ImgurApi.AccountSettings) : ImgurApi.AccountSettings { +function testAccountSettings(accountSettings: ImgurRestApi.AccountSettings) : ImgurRestApi.AccountSettings { return accountSettings; } -function testAlbum(album: ImgurApi.Album) : ImgurApi.Album { +function testAlbum(album: ImgurRestApi.Album) : ImgurRestApi.Album { return album; } -function testAlbumImages(album: ImgurApi.Album) : ImgurApi.Image { +function testAlbumImages(album: ImgurRestApi.Album) : ImgurRestApi.Image { return album.images[0]; } -function testComment(comment: ImgurApi.Comment) : ImgurApi.Comment { +function testComment(comment: ImgurRestApi.Comment) : ImgurRestApi.Comment { return comment; } -function testConversation(conversation: ImgurApi.Conversation) : ImgurApi.Conversation { +function testConversation(conversation: ImgurRestApi.Conversation) : ImgurRestApi.Conversation { return conversation; } -function testCustomGallery(customGallery: ImgurApi.CustomGallery) : ImgurApi.CustomGallery { +function testCustomGallery(customGallery: ImgurRestApi.CustomGallery) : ImgurRestApi.CustomGallery { return customGallery; } -function testGalleryItem(galleryItem: ImgurApi.GalleryItem) : ImgurApi.GalleryItem { +function testGalleryItem(galleryItem: ImgurRestApi.GalleryItem) : ImgurRestApi.GalleryItem { return galleryItem; } -function testGalleryAlbum(galleryItem: ImgurApi.GalleryItem) : ImgurApi.GalleryAlbum { +function testGalleryAlbum(galleryItem: ImgurRestApi.GalleryItem) : ImgurRestApi.GalleryAlbum { if(galleryItem.is_album) { - var galleryAlbum = galleryItem; + var galleryAlbum = galleryItem; return galleryAlbum; } return null; } -function testGalleryImage(galleryItem: ImgurApi.GalleryItem) : ImgurApi.GalleryImage { +function testGalleryImage(galleryItem: ImgurRestApi.GalleryItem) : ImgurRestApi.GalleryImage { if(!galleryItem.is_album) { - var galleryImage = galleryItem; + var galleryImage = galleryItem; return galleryImage; } return null; } -function testGalleryProfile(galleryProfile: ImgurApi.GalleryProfile) : ImgurApi.GalleryProfile { +function testGalleryProfile(galleryProfile: ImgurRestApi.GalleryProfile) : ImgurRestApi.GalleryProfile { return galleryProfile; } -function testImage(image: ImgurApi.Image) : ImgurApi.Image { +function testImage(image: ImgurRestApi.Image) : ImgurRestApi.Image { return image; } -function testMemeMeta(meta: ImgurApi.MemeMetadata) : ImgurApi.MemeMetadata { +function testMemeMeta(meta: ImgurRestApi.MemeMetadata) : ImgurRestApi.MemeMetadata { return meta; } -function testMessage(message: ImgurApi.Message) : ImgurApi.Message { +function testMessage(message: ImgurRestApi.Message) : ImgurRestApi.Message { return message; } -function testAccountNotificationsReply(accountNotif: ImgurApi.AccountNotifications) : ImgurApi.Notification { +function testAccountNotificationsReply(accountNotif: ImgurRestApi.AccountNotifications) : ImgurRestApi.Notification { return accountNotif.replies[0]; } -function testAccountNotificationsMessage(accountNotif: ImgurApi.AccountNotifications) : ImgurApi.Notification { +function testAccountNotificationsMessage(accountNotif: ImgurRestApi.AccountNotifications) : ImgurRestApi.Notification { return accountNotif.messages[0]; } -function testTag(tag: ImgurApi.Tag) : ImgurApi.Tag { +function testTag(tag: ImgurRestApi.Tag) : ImgurRestApi.Tag { return tag; } -function testTagVote(tagVote: ImgurApi.TagVote) : ImgurApi.TagVote { +function testTagVote(tagVote: ImgurRestApi.TagVote) : ImgurRestApi.TagVote { return tagVote; } -function testTopic(topic: ImgurApi.Topic) : ImgurApi.Topic { +function testTopic(topic: ImgurRestApi.Topic) : ImgurRestApi.Topic { return topic; } -function testVote(vote: ImgurApi.Vote) : ImgurApi.Vote { +function testVote(vote: ImgurRestApi.Vote) : ImgurRestApi.Vote { return vote; } -function testResponseWithError(response: ImgurApi.Response) : ImgurApi.Error { +function testResponseWithError(response: ImgurRestApi.Response) : ImgurRestApi.Error { if(response.success === false) { - return response.data; + return response.data; } return null; } -function testResponseWithValue(response: ImgurApi.Response) : ImgurApi.GalleryProfile { +function testResponseWithValue(response: ImgurRestApi.Response) : ImgurRestApi.GalleryProfile { if(response.success === true) { - return response.data; + return response.data; } return null; } diff --git a/imgur-rest-api/imgur-rest-api.d.ts b/imgur-rest-api/imgur-rest-api.d.ts index c06bff5e5..272600656 100644 --- a/imgur-rest-api/imgur-rest-api.d.ts +++ b/imgur-rest-api/imgur-rest-api.d.ts @@ -3,7 +3,7 @@ // Definitions by: Luke William Westby // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module ImgurApi { +declare module ImgurRestApi { interface Response { data: any; //T|Error;