diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 532e0404e..ae430f57d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -83,10 +83,12 @@ All definitions files include a header with the author and editors, so at some p * [Firefox](https://developer.mozilla.org/en-US/docs/Web/API) (by [vvakame](https://github.com/vvakame)) * [FlexSlider](http://www.woothemes.com/flexslider/) (by [Diullei Gomes](https://github.com/Diullei)) * [Flight by Twitter](http://flightjs.github.com/flight/) (by [Jonathan Hedrén](https://github.com/jonathanhedren)) +* [flipsnap.js](http://pxgrid.github.io/js-flipsnap/) (by [kubosho_](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki)) * [Foundation](http://foundation.zurb.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [FPSMeter](http://darsa.in/fpsmeter/) (by [Aaron Lampros](https://github.com/alampros)) * [fs-extra](https://github.com/jprichardson/node-fs-extra) (by [midknight41](https://github.com/midknight41)) * [FullCalendar](http://arshaw.com/fullcalendar/) (by [Neil Stalker](https://github.com/nestalk)) +* [Fuse.js](https://github.com/krisk/Fuse) (by [Greg Smith](https://github.com/smrq)) * [Gamepad](http://www.w3.org/TR/gamepad/) (by [Kon](http://phyzkit.net/)) * [GeoJSON](http://geojson.org/) (by [Jake Bruun](https://github.com/cobster)) * [Giraffe](https://github.com/barc/backbone.giraffe) (by [Matt McCray](https://github.com/darthapo)) @@ -155,9 +157,12 @@ All definitions files include a header with the author and editors, so at some p * [jQuery.joyride](http://zurb.com/playground/jquery-joyride-feature-tour-plugin) (by [Vincent Bortone](https://github.com/vbortone)) * [jQuery.jSignature](https://github.com/willowsystems/jSignature) (by [Patrick Magee](https://github.com/pjmagee)) * [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/)) -* [jQuery.pickadate](https://github.com/amsul/pickadate.js) (by [Theodore Brown](https://github.com/theodorejb)) * [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/)) +* [jQuery.pickadate](https://github.com/amsul/pickadate.js) (by [Theodore Brown](https://github.com/theodorejb)) +* [jQuery.pjax](https://github.com/defunkt/jquery-pjax) (by [Junle Li](https://github.com/lijunle)) * [jQuery.pnotify](http://sciactive.github.io/pnotify/) (by [David Sichau](https://github.com/DavidSichau/)) +* [jQuery.postMessage](http://benalman.com/projects/jquery-postmessage-plugin/) (by [Junle Li](https://github.com/lijunle)) +* [jQuery.prettyphoto](https://github.com/scaron/prettyphoto) (by [Paul Gaske](https://github.com/pgaske)) * [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/)) * [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/)) * [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) (by [Blake Niemyjski](https://github.com/niemyjski)) @@ -210,6 +215,7 @@ All definitions files include a header with the author and editors, so at some p * [Logg](https://github.com/dpup/node-logg) (by [Bret Little](https://github.com/blittle)) * [Long.js](https://github.com/dcodeIO/Long.js) (by [Toshihide Hara](https://github.com/kerug)) * [lz-string](https://github.com/pieroxy/lz-string) (by [Roman Nikitin](https://github.com/M0ns1gn0r)) +* [Mapbox](https://github.com/mapbox/mapbox.js/) (by [Maxime Fabre](https://github.com/anahkiasen)) * [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr)) * [MathJax](https://github.com/mathjax/MathJax) (by [Roland Zwaga](https://github.com/rolandzwaga)) * [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) (by [Sarah Williams](https://github.com/flurg)) @@ -218,6 +224,7 @@ All definitions files include a header with the author and editors, so at some p * [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk)) * [Minimatch](https://github.com/isaacs/minimatch) (by [vvakame](https://github.com/vvakame)) * [minimist](https://github.com/substack/minimist) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [Mixpanel](https://github.com/mixpanel/mixpanel-js) (by [Knut Eirik Leira Hjelle](https://github.com/hjellek)) * [mixto](https://github.com/atom/mixto) (by [vvakame](https://github.com/vvakame)) * [Modernizr](http://modernizr.com/) (by [Boris Yankov](https://github.com/borisyankov) and [Theodore Brown](https://github.com/theodorejb/)) * [Moment.js](https://github.com/timrwood/moment) (by [Michael Lakerveld](https://github.com/Lakerfield)) @@ -270,6 +277,7 @@ All definitions files include a header with the author and editors, so at some p * [Raphael](http://raphaeljs.com/) (by [CheCoxshall](https://github.com/CheCoxshall)) * [Restangular](https://github.com/mgonto/restangular/) (by [Boris Yankov](https://github.com/borisyankov)) * [require.js](http://requirejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/)) +* [rtree.js] (https://github.com/leaflet-extras/RTree) (by [Omede Firouz](https://github.com/oefirouz)) * [Sammy.js](http://sammyjs.org/) (by [Boris Yankov](https://github.com/borisyankov)) * [Select2](http://ivaynberg.github.com/select2/) (by [Boris Yankov](https://github.com/borisyankov)) * [Selenium WebDriverJS](https://code.google.com/p/selenium/) (by [Bill Armstrong](https://github.com/BillArmstrong)) @@ -284,6 +292,7 @@ All definitions files include a header with the author and editors, so at some p * [socket.io](http://socket.io) (by [William Orr](https://github.com/worr)) * [socket.io-client](http://socket.io) (by [Maido Kaara](https://github.com/v3rm0n)) * [SockJS](https://github.com/sockjs/sockjs-client) (by [Emil Ivanov](https://github.com/vladev)) +* [sockjs-node](https://github.com/sockjs/sockjs-node) (by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing)) * [SoundJS](http://www.createjs.com/#!/SoundJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) * [Spin](http://fgnass.github.com/spin.js/) (by [Boris Yankov](https://github.com/borisyankov)) * [sqlite3](https://github.com/mapbox/node-sqlite3) (by [Nick Malaguti](https://github.com/nmalaguti)) @@ -299,6 +308,7 @@ All definitions files include a header with the author and editors, so at some p * [Teechart](http://www.steema.com) (by [Steema](http://www.steema.com)) * [text-buffer](https://github.com/atom/text-buffer) (by [vvakame](https://github.com/vvakame)) * [three.js](http://mrdoob.github.com/three.js/) (by [Kon](http://phyzkit.net/)) +* [TimelineJS](https://github.com/NUKnightLab/TimelineJS) (by [Roland Zwaga](https://github.com/rolandzwaga)) * [Toastr](https://github.com/CodeSeven/toastr) (by [Boris Yankov](https://github.com/borisyankov)) * [trunk8](https://github.com/rviscomi/trunk8) (by [Blake Niemyjski](https://github.com/niemyjski)) * [TweenJS](http://www.createjs.com/#!/TweenJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) @@ -315,6 +325,7 @@ All definitions files include a header with the author and editors, so at some p * [urlrouter](https://github.com/fengmk2/urlrouter) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) * [UUID.js](https://github.com/LiosK/UUID.js) (by [Jason Jarrett](https://github.com/staxmanade)) * [Valerie](https://github.com/davewatts/valerie) (by [Howard Richards](https://github.com/conficient)) +* [Velocity](http://velocityjs.org/) (by [Greg Smith](https://github.com/smrq)) * [Viewporter](https://github.com/zynga/viewporter) (by [Boris Yankov](https://github.com/borisyankov)) * [Vimeo](http://developer.vimeo.com/player/js-api) (by [Daz Wilkin](https://github.com/DazWilkin/)) * [vinyl](https://github.com/wearefractal/vinyl) (by [vvakame](https://github.com/vvakame/)) @@ -325,6 +336,7 @@ All definitions files include a header with the author and editors, so at some p * [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) (from TypeScript samples) * [ws](http://einaros.github.io/ws/) (by [Paul Loyd](https://github.com/loyd)) * [x2js](https://code.google.com/p/x2js/) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) +* [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) (by [Michel Salib](https://github.com/michelsalib)) * [XRegExp](http://xregexp.com/) (by [Bart van der Schoor](https://github.com/Bartvds)) * [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/)) * [YouTube Analytics API](https://developers.google.com/youtube/analytics/) (by [Frank M](https://github.com/sgtfrankieboy)) diff --git a/Finch/Finch.d.ts b/Finch/Finch.d.ts index e23e97ef5..e3dd86c70 100644 --- a/Finch/Finch.d.ts +++ b/Finch/Finch.d.ts @@ -1,6 +1,6 @@ // Type definitions for Finch 0.5.13 -// Project: https://github.com/stoodder/finchjs -// Definitions by: https://github.com/DavidSichau +// Project: https://github.com/stoodder/finchjs +// Definitions by: David Sichau // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/JSONStream/JSONStream-tests.ts b/JSONStream/JSONStream-tests.ts new file mode 100644 index 000000000..ea7eb64ff --- /dev/null +++ b/JSONStream/JSONStream-tests.ts @@ -0,0 +1,15 @@ +/// + +import json = require('JSONStream'); + +var read: NodeJS.ReadableStream; +var write: NodeJS.WritableStream; + +read = read.pipe(json.parse('*')); +read = read.pipe(json.parse(['foo/*', 'bar/*'])); + +read = json.stringify(); +read = json.stringify('{', ',', '}'); + +read = json.stringifyObject(); +read = json.stringifyObject('{', ',', '}'); diff --git a/JSONStream/JSONStream.d.ts b/JSONStream/JSONStream.d.ts new file mode 100644 index 000000000..869f965f4 --- /dev/null +++ b/JSONStream/JSONStream.d.ts @@ -0,0 +1,22 @@ +// Type definitions for JSONStream v0.8.0 +// Project: http://github.com/dominictarr/JSONStream +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'JSONStream' { + + export interface Options { + recurse: boolean; + } + + export function parse(pattern: any): NodeJS.ReadWriteStream; + export function parse(patterns: any[]): NodeJS.ReadWriteStream; + + export function stringify(): NodeJS.ReadWriteStream; + export function stringify(open: string, sep: string, close: string): NodeJS.ReadWriteStream; + + export function stringifyObject(): NodeJS.ReadWriteStream; + export function stringifyObject(open: string, sep: string, close: string): NodeJS.ReadWriteStream; +} diff --git a/alertify/alertify-tests.ts b/alertify/alertify-tests.ts new file mode 100644 index 000000000..9f6c0cd86 --- /dev/null +++ b/alertify/alertify-tests.ts @@ -0,0 +1,32 @@ +/// + +alertify.init(); + +alertify.alert("This is an alert"); +alertify.alert("This is an alert with a callback", () => { + alertify.success("Alert finished"); +}, "myCustomClass"); + + +alertify.confirm("This is a confirm request"); +alertify.confirm("This is a confirm request with a callback", () => { + alertify.success("Confirm finished"); +}, "myCustomClass"); + +var custom = alertify.extend("custom"); + +alertify.log("log message 1"); +alertify.log("log message 2", "success", 3000); + +alertify.prompt("prompt message 1"); +alertify.prompt("prompt message 2", () => { console.log("callback"); }, "ok", "myClass"); + +alertify.set({ delay: 1000 }); +alertify.set({ labels: { ok: "OK", cancel: "Cancel" }}); +alertify.set({ buttonFocus: "ok" }); +alertify.set({ buttonReverse: true }); + +alertify.success("This is a success message"); +alertify.error("This is an error message"); + +alertify.debug(); diff --git a/alertify/alertify.d.ts b/alertify/alertify.d.ts new file mode 100644 index 000000000..79ff53ec3 --- /dev/null +++ b/alertify/alertify.d.ts @@ -0,0 +1,124 @@ +// Type definitions for alertify 0.3.11 +// Project: http://fabien-d.github.io/alertify.js/ +// Definitions by: John Jeffery +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare var alertify: alertify.IAlertifyStatic; + +declare module alertify { + interface IAlertifyStatic { + /** + * Create an alert dialog box + * @param message The message passed from the callee + * @param fn Callback function + * @param cssClass Class(es) to append to dialog box + * @return alertify (ie this) + * @since 0.0.1 + */ + alert(message: string, fn?: Function, cssClass?: string): IAlertifyStatic; + + /** + * Create a confirm dialog box + * @param message The message passed from the callee + * @param fn Callback function + * @param cssClass Class(es) to append to dialog box + * @return alertify (ie this) + * @since 0.0.1 + */ + confirm(message: string, fn?: Function, cssClass?: string): IAlertifyStatic; + + /** + * Extend the log method to create custom methods + * @param type Custom method name + * @return function for logging + * @since 0.0.1 + */ + extend(type: string): (message: string, wait?: number) => IAlertifyStatic; + + /** + * Initialize Alertify and create the 2 main elements. + * Initialization will happen automatically on the first + * use of alert, confirm, prompt or log. + * @since 0.0.1 + */ + init(): void; + + /** + * Show a new log message box + * @param message The message passed from the callee + * @param type Optional type of log message + * @param wait Optional time (in ms) to wait before auto-hiding + * @return alertify (ie this) + * @since 0.0.1 + */ + log(message: string, type?: string, wait?: number): IAlertifyStatic; + + /** + * Create a prompt dialog box + * @param message The message passed from the callee + * @param fn Callback function + * @param placeholder Default value for prompt input + * @param cssClass Class(es) to append to dialog + * @return alertify (ie this) + * @since 0.0.1 + */ + prompt(message: string, fn?: Function, placeholder?: string, cssClass?: string): IAlertifyStatic; + + /** + * Shorthand for log messages + * @param message The message passed from the callee + * @return alertify (ie this) + * @since 0.0.1 + */ + success(message: string): IAlertifyStatic; + + /** + * Shorthand for log messages + * @param message The message passed from the callee + * @return alertify (ie this) + * @since 0.0.1 + */ + error(message: string): IAlertifyStatic; + + /** + * Used to set alertify properties + * @param Properties + * @since 0.2.11 + */ + set(args: IProperties): void; + + /** + * The labels used for dialog buttons + */ + labels: ILabels; + + /** + * Attaches alertify.error to window.onerror method + * @since 0.3.8 + */ + debug(): void; + } + + /** + * Properties for alertify.set function + */ + interface IProperties { + /** Default value for milliseconds display of log messages */ + delay?: number; + + /** Default values for display of labels */ + labels?: ILabels; + + /** Default button for focus */ + buttonFocus?: string; + + /** Should buttons be displayed in reverse order */ + buttonReverse?: boolean; + } + + /** Labels for altertify.set function */ + interface ILabels { + ok?: string; + cancel?: string; + } +} \ No newline at end of file diff --git a/amplifyjs/amplifyjs-tests.ts b/amplifyjs/amplifyjs-tests.ts index c26955348..a104d4a7c 100644 --- a/amplifyjs/amplifyjs-tests.ts +++ b/amplifyjs/amplifyjs-tests.ts @@ -176,8 +176,7 @@ amplify.request("twitter-mentions", { user: "amplifyjs" }); //Example: -amplify.request.decoders.appEnvelope = -function (data, status, xhr, success, error) { +var appEnvelopeDecoder: amplifyDecoder = function (data, status, xhr, success, error) { if (data.status === "success") { success(data.data); } else if (data.status === "fail" || data.status === "error") { @@ -187,6 +186,17 @@ function (data, status, xhr, success, error) { } }; +//a new decoder can be added to the amplifyDecoders interface +interface amplifyDecoders { + appEnvelope: amplifyDecoder; +} + +amplify.request.decoders.appEnvelope = appEnvelopeDecoder; + +//but you can also just add it via an index +amplify.request.decoders['appEnvelopeStr'] = appEnvelopeDecoder; + + amplify.request.define("decoderExample", "ajax", { url: "/myAjaxUrl", type: "POST", diff --git a/amplifyjs/amplifyjs.d.ts b/amplifyjs/amplifyjs.d.ts index c8de7260a..364845f3c 100644 --- a/amplifyjs/amplifyjs.d.ts +++ b/amplifyjs/amplifyjs.d.ts @@ -3,11 +3,33 @@ // Definitions by: Jonas Eriksson // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + interface amplifyRequestSettings { resourceId: string; data?: any; - success?: Function; - error?: Function; + success?: (...args: any[]) => void; + error?: (...args: any[]) => void; +} + +interface amplifyDecoder { + ( + data?: any, + status?: string, + xhr?: JQueryXHR, + success?: (...args: any[]) => void, + error?: (...args: any[]) => void + ): void +} + +interface amplifyDecoders { + [decoderName: string]: amplifyDecoder; + jsSend: amplifyDecoder; +} + +interface amplifyAjaxSettings extends JQueryAjaxSettings { + cache?: any; + decoder?: any /* string or amplifyDecoder */; } interface amplifyRequest { @@ -39,7 +61,7 @@ interface amplifyRequest { * cache: See the cache section for more details. * decoder: See the decoder section for more details. */ - define(resourceId: string, requestType: string, settings?: any): void; + define(resourceId: string, requestType: string, settings?: amplifyAjaxSettings): void; /*** * Define a custom request. @@ -50,9 +72,9 @@ interface amplifyRequest { * success: Callback to invoke on success. * error: Callback to invoke on error. */ - define(resourceId: string, resource: Function): void; - - decoders: any; + define(resourceId: string, resource: (settings: amplifyRequestSettings) => void): void; + + decoders: amplifyDecoders; cache: any; } diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts index 6b6071102..47dfa63a5 100644 --- a/angular-translate/angular-translate.d.ts +++ b/angular-translate/angular-translate.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular Translate (pascalprecht.translate module) // Project: https://github.com/PascalPrecht/angular-translate -// Definitions by: Michel Salib +// Definitions by: Michel Salib // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/angular-ui/angular-ui-router-tests.ts b/angular-ui/angular-ui-router-tests.ts index 4804ad297..971a47cd2 100644 --- a/angular-ui/angular-ui-router-tests.ts +++ b/angular-ui/angular-ui-router-tests.ts @@ -13,6 +13,10 @@ myApp.config(( $urlMatcherFactory: ng.ui.IUrlMatcherFactory) => { var matcher: ng.ui.IUrlMatcher = $urlMatcherFactory.compile("/foo/:bar?param1"); + var obj: Object = matcher.exec('/user/bob', { x:'1', q:'hello' }); + var concat: ng.ui.IUrlMatcher = matcher.concat('/test'); + var str: string = matcher.format({ id:'bob', q:'yes' }); + var arr: string[] = matcher.parameters(); $urlRouterProvider .when('/test', '/list') @@ -78,12 +82,13 @@ interface IUrlLocatorTestService { // Service for determining who the currently logged on user is. class UrlLocatorTestService implements IUrlLocatorTestService { - static $inject = ["$http", "$rootScope", "$urlRouter"]; + static $inject = ["$http", "$rootScope", "$urlRouter", "$state"]; constructor( private $http: ng.IHttpService, private $rootScope: ng.IRootScopeService, - private $urlRouter: ng.ui.IUrlRouterService + private $urlRouter: ng.ui.IUrlRouterService, + private $state: ng.ui.IStateService ) { $rootScope.$on("$locationChangeSuccess", (event: ng.IAngularEvent) => this.onLocationChangeSuccess(event)); } @@ -107,6 +112,23 @@ class UrlLocatorTestService implements IUrlLocatorTestService { }); } } + + private stateServiceTest() { + this.$state.go("myState"); + this.$state.transitionTo("myState"); + if (this.$state.includes("myState") === true) { + // + } + if (this.$state.is("myState") === true) { + // + } + if (this.$state.href("myState") === "/myState") { + // + } + this.$state.get("myState"); + this.$state.get(); + this.$state.reload(); + } } myApp.service("urlLocatorTest", UrlLocatorTestService); @@ -124,4 +146,3 @@ module UiViewScrollProviderTests { $uiViewScrollProvider.useAnchorScroll(); }]); } - diff --git a/angular-ui/angular-ui-router.d.ts b/angular-ui/angular-ui-router.d.ts index 499f1c474..081d35723 100644 --- a/angular-ui/angular-ui-router.d.ts +++ b/angular-ui/angular-ui-router.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular JS 1.1.5+ (ui.router module) // Project: https://github.com/angular-ui/ui-router -// Definitions by: Michel Salib +// Definitions by: Michel Salib // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -33,13 +33,13 @@ declare module ng.ui { interface IUrlMatcher { concat(pattern: string): IUrlMatcher; exec(path: string, searchParams: {}): {}; + parameters(): string[]; + format(values: {}): string; } interface IUrlMatcherFactory { compile(pattern: string): IUrlMatcher; isMatcher(o: any): boolean; - parameters(): string[]; - format(values: {}): string; } interface IUrlRouterProvider extends IServiceProvider { @@ -86,6 +86,7 @@ declare module ng.ui { get(): IState[]; current: IState; params: IStateParamsService; + reload(): void; } interface IStateParamsService { diff --git a/angularjs/angular-animate.d.ts b/angularjs/angular-animate.d.ts index 696e6f834..9503e36d7 100644 --- a/angularjs/angular-animate.d.ts +++ b/angularjs/angular-animate.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular JS 1.2+ (ngAnimate module) // Project: http://angularjs.org -// Definitions by: Michel Salib +// Definitions by: Michel Salib // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/angularjs/angular-cookies.d.ts b/angularjs/angular-cookies.d.ts index 60eebbacb..622221675 100644 --- a/angularjs/angular-cookies.d.ts +++ b/angularjs/angular-cookies.d.ts @@ -1,4 +1,4 @@ -/// Type definitions for Angular JS 1.2 (ngCookies module) +// Type definitions for Angular JS 1.2 (ngCookies module) // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 51b93091f..597a58e40 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular JS 1.2 (ngResource module) // Project: http://angularjs.org -// Definitions by: Diego Vilar , Michael Jess (minor enhancements) +// Definitions by: Diego Vilar , Michael Jess // Definitions: https://github.com/daptiv/DefinitelyTyped /// diff --git a/angularjs/angular-route-tests.ts b/angularjs/angular-route-tests.ts index 2ebe16a21..3b35a97bb 100644 --- a/angularjs/angular-route-tests.ts +++ b/angularjs/angular-route-tests.ts @@ -9,6 +9,9 @@ declare var $routeProvider: ng.route.IRouteProvider; $routeProvider .when('/projects/:projectId/dashboard',{ - controller: '' + controller: '', + templateUrl: '', + caseInsensitiveMatch: true, + reloadOnSearch: false }) .otherwise({redirectTo: '/'}); diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index 025c5da22..ba6d0aac9 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular JS 1.2 (ngRoute module) // Project: http://angularjs.org -// Definitions by: Jonathan Park +// Definitions by: Jonathan Park // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -15,7 +15,9 @@ declare module ng.route { // RouteParamsService // see http://docs.angularjs.org/api/ngRoute.$routeParams /////////////////////////////////////////////////////////////////////////// - interface IRouteParamsService {} + interface IRouteParamsService { + [key: string]: any; + } /////////////////////////////////////////////////////////////////////////// // RouteService @@ -30,17 +32,73 @@ declare module ng.route { // to a controller that was not initialized as a result of a route maching. current?: ICurrentRoute; } - - // see http://docs.angularjs.org/api/ngRoute.$routeProvider#when for options explanations + + + /** + * see http://docs.angularjs.org/api/ngRoute/provider/$routeProvider#when for API documentation + */ interface IRoute { + /** + * {(string|function()=} + * Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string. + */ controller?: any; - controllerAs?: any; + /** + * A controller alias name. If present the controller will be published to scope under the controllerAs name. + */ + controllerAs?: string; + /** + * Undocumented? + */ name?: string; + /** + * {string=|function()=} + * Html template as a string or a function that returns an html template as a string which should be used by ngView or ngInclude directives. This property takes precedence over templateUrl. + * + * If template is a function, it will be called with the following parameters: + * + * {Array.} - route parameters extracted from the current $location.path() by applying the current route + */ template?: string; + /** + * {string=|function()=} + * Path or function that returns a path to an html template that should be used by ngView. + * + * If templateUrl is a function, it will be called with the following parameters: + * + * {Array.} - route parameters extracted from the current $location.path() by applying the current route + */ templateUrl?: any; + /** + * {Object.=} - An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired. The map object is: + * + * - key - {string}: a name of a dependency to be injected into the controller. + * - factory - {string|function}: If string then it is an alias for a service. Otherwise if function, then it is injected and the return value is treated as the dependency. If the result is a promise, it is resolved before its value is injected into the controller. Be aware that ngRoute.$routeParams will still refer to the previous route within these resolve functions. Use $route.current.params to access the new route parameters, instead. + */ resolve?: any; + /** + * {(string|function())=} + * Value to update $location path with and trigger route redirection. + * + * If redirectTo is a function, it will be called with the following parameters: + * + * - {Object.} - route parameters extracted from the current $location.path() by applying the current route templateUrl. + * - {string} - current $location.path() + * - {Object} - current $location.search() + * - The custom redirectTo function is expected to return a string which will be used to update $location.path() and $location.search(). + */ redirectTo?: any; + /** + * Reload route when only $location.search() or $location.hash() changes. + * + * This option defaults to true. If the option is set to false and url in the browser changes, then $routeUpdate event is broadcasted on the root scope. + */ reloadOnSearch?: boolean; + /** + * Match routes without being case sensitive + * + * This option defaults to false. If the option is set to true, then the particular route can be matched without being case sensitive + */ caseInsensitiveMatch?: boolean; } @@ -55,10 +113,24 @@ declare module ng.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; /** - * This is a description + * 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-scenario.d.ts b/angularjs/angular-scenario.d.ts index ec3efd9f9..ee71ffbea 100644 --- a/angularjs/angular-scenario.d.ts +++ b/angularjs/angular-scenario.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular Scenario Testing // Project: http://angularjs.org -// Definitions by: RomanoLindano +// Definitions by: RomanoLindano // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index 419bed0d6..bb859c26a 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -223,6 +223,7 @@ foo.then((x) => { // angular.element() tests var element = angular.element("div.myApp"); var scope: ng.IScope = element.scope(); +var isolateScope: ng.IScope = element.isolateScope(); diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 9d5074945..c7f0882d4 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -51,16 +51,21 @@ declare module ng { isString(value: any): boolean; isUndefined(value: any): boolean; lowercase(str: string): string; - /** construct your angular application - official docs: Interface for configuring angular modules. - see: http://docs.angularjs.org/api/angular.Module - */ + + /** + * The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism. + * + * When passed two or more arguments, a new module is created. If passed only one argument, an existing module (the name passed as the first argument to module) is retrieved. + * + * @param name The name of the module to create or retrieve. + * @param requires The names of modules this module depends on. If specified then new module is being created. If unspecified then the module is being retrieved for further configuration. + * @param configFn Optional configuration function for the module. + */ module( - /** name of your module you want to create */ name: string, - /** name of modules yours depends on */ requires?: string[], - configFunction?: any): IModule; + configFn?: Function): IModule; + noop(...args: any[]): void; toJson(obj: any, pretty?: boolean): string; uppercase(str: string): string; @@ -81,23 +86,55 @@ declare module ng { animation(name: string, animationFactory: Function): IModule; animation(name: string, inlineAnnotatedFunction: any[]): IModule; animation(object: Object): IModule; - /** configure existing services. - Use this method to register work which needs to be performed on module loading + /** + * Use this method to register work which needs to be performed on module loading. + * + * @param configFn Execute this function on module load. Useful for service configuration. */ config(configFn: Function): IModule; - /** configure existing services. - Use this method to register work which needs to be performed on module loading + /** + * Use this method to register work which needs to be performed on module loading. + * + * @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration. */ config(inlineAnnotatedFunction: any[]): IModule; constant(name: string, value: any): IModule; constant(object: Object): IModule; + /** + * The $controller service is used by Angular to create new controllers. + * + * This provider allows controller registration via the register method. + * + * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors. + * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation). + */ controller(name: string, controllerConstructor: Function): IModule; + /** + * The $controller service is used by Angular to create new controllers. + * + * This provider allows controller registration via the register method. + * + * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors. + * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation). + */ controller(name: string, inlineAnnotatedConstructor: any[]): IModule; controller(object : Object): IModule; directive(name: string, directiveFactory: Function): IModule; directive(name: string, inlineAnnotatedFunction: any[]): IModule; directive(object: Object): IModule; + /** + * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. + * + * @param name The name of the instance. + * @param $getFn The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}). + */ factory(name: string, serviceFactoryFunction: Function): IModule; + /** + * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. + * + * @param name The name of the instance. + * @param inlineAnnotatedFunction The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}). + */ factory(name: string, inlineAnnotatedFunction: any[]): IModule; factory(object: Object): IModule; filter(name: string, filterFactoryFunction: Function): IModule; @@ -166,6 +203,7 @@ declare module ng { $error: any; $addControl(control: ng.INgModelController): void; $removeControl(control: ng.INgModelController): void; + $setValidity(validationErrorKey: string, isValid: boolean, control: ng.INgModelController): void; $setDirty(): void; $setPristine(): void; } @@ -241,6 +279,8 @@ declare module ng { $parent: IScope; + $root: IRootScopeService; + $id: string; // Hidden members @@ -263,13 +303,17 @@ declare module ng { // WindowService // see http://docs.angularjs.org/api/ng.$window /////////////////////////////////////////////////////////////////////////// - interface IWindowService extends Window {} + interface IWindowService extends Window { + [key: string]: any; + } /////////////////////////////////////////////////////////////////////////// // BrowserService // TODO undocumented, so we need to get it from the source code /////////////////////////////////////////////////////////////////////////// - interface IBrowserService {} + interface IBrowserService { + [key: string]: any; + } /////////////////////////////////////////////////////////////////////////// // TimeoutService @@ -925,6 +969,7 @@ declare module ng { controller(name: string): any; injector(): any; scope(): IScope; + isolateScope(): IScope; inheritedData(key: string, value: any): JQuery; inheritedData(obj: { [key: string]: any; }): JQuery; diff --git a/ansicolors/ansicolors.d.ts b/ansicolors/ansicolors.d.ts index 0ffc99910..2f61b0435 100644 --- a/ansicolors/ansicolors.d.ts +++ b/ansicolors/ansicolors.d.ts @@ -1,4 +1,9 @@ +// Type definitions for ansicolors +// Project: https://github.com/thlorenz/ansicolors +// Definitions by: rogierschouten +// Definitions: https://github.com/borisyankov/DefinitelyTyped + declare module "ansicolors" { var colors: {[index: string]: (s: string) => string;}; - export = colors; + export = colors; } diff --git a/arbiter/Arbiter-tests.ts.tscparams b/arbiter/Arbiter-tests.ts.tscparams deleted file mode 100644 index e16c76dff..000000000 --- a/arbiter/Arbiter-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" diff --git a/arbiter/Arbiter.d.ts b/arbiter/Arbiter.d.ts index cb35f9c58..b5bededed 100644 --- a/arbiter/Arbiter.d.ts +++ b/arbiter/Arbiter.d.ts @@ -121,12 +121,12 @@ declare module ArbiterDef { /** * Unsubscribing simply sets a flag which prevents the subscriber from executing, in case you want to re-subscribe later. */ - unsubscribe(subscription_id: number); + unsubscribe(subscription_id: number): boolean; /** * After unsubscribing, you can later re-subscribe to begin receiving messages again. */ - resubscribe(subscription_id: number); + resubscribe(subscription_id: number): boolean; } } diff --git a/arbiter/Arbiter.d.ts.tscparams b/arbiter/Arbiter.d.ts.tscparams deleted file mode 100644 index e16c76dff..000000000 --- a/arbiter/Arbiter.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" diff --git a/asciify/asciify.d.ts b/asciify/asciify.d.ts index 4dc47cd3a..33f82019b 100644 --- a/asciify/asciify.d.ts +++ b/asciify/asciify.d.ts @@ -1,6 +1,6 @@ // Type definitions for asciify 1.3.5 // Project: https://www.npmjs.org/package/asciify -// Definitions by: Alan Norbauer http://alan.norbauer.com +// Definitions by: Alan Norbauer // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -26,4 +26,4 @@ declare module "asciify" { } export = asciify -} \ No newline at end of file +} diff --git a/async/async-tests.ts b/async/async-tests.ts index ae92bbff9..169bc9cb1 100644 --- a/async/async-tests.ts +++ b/async/async-tests.ts @@ -156,6 +156,22 @@ q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { console.log('finished processing bar'); }); +// tests for strongly typed tasks +var q2 = async.queue(function (task: string, callback) { + console.log('Task: ' + task); + callback(); +}, 1); + +q2.push('task1'); + +q2.push('task2', function (error, results: string[]) { + console.log('Finished tasks: ' + results.join(', ')); +}); + +q2.push(['task3', 'task4', 'task5'], function (error, results: string[]) { + console.log('Finished tasks: ' + results.join(', ')); +}); + var filename = ''; async.auto({ get_data: function (callback) { }, diff --git a/async/async.d.ts b/async/async.d.ts index d85679b68..25736941f 100644 --- a/async/async.d.ts +++ b/async/async.d.ts @@ -16,6 +16,7 @@ interface AsyncQueue { length(): number; concurrency: number; push(task: T, callback?: AsyncMultipleResultsCallback): void; + push(task: T[], callback?: AsyncMultipleResultsCallback): void; saturated: AsyncMultipleResultsCallback; empty: AsyncMultipleResultsCallback; drain: AsyncMultipleResultsCallback; diff --git a/async/async.d.ts.tscparams b/async/async.d.ts.tscparams deleted file mode 100644 index e16c76dff..000000000 --- a/async/async.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" diff --git a/async/asyncamd-tests.ts.tscparams b/async/asyncamd-tests.ts.tscparams deleted file mode 100644 index e16c76dff..000000000 --- a/async/asyncamd-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" diff --git a/atom/atom.d.ts b/atom/atom.d.ts index 8cbde4d55..1b5e55f2a 100644 --- a/atom/atom.d.ts +++ b/atom/atom.d.ts @@ -15,7 +15,7 @@ // if js file include to another npm package (e.g. "space-pen", "mixto" and "emissary"). // you should create a separate file. -// NOTE Document? You should use DevTools hehe... +// API documentation : https://atom.io/docs/api/v0.106.0/api/docs/README.md.html interface Window { atom: AtomCore.IAtom; @@ -1010,7 +1010,14 @@ declare module AtomCore { interface IAtomStatic extends ISerializationStatic { version: number; loadSettings: IAtomSettings; + + /* Load or create the Atom environment in the given mode */ + loadOrCreate(mode:'editor'):IAtom; + /* Load or create the Atom environment in the given mode */ + loadOrCreate(mode:'spec'):IAtom; + /* Load or create the Atom environment in the given mode */ loadOrCreate(mode:string):IAtom; + loadState(mode:any):void; getStatePath(mode:any):string; getConfigDirPath():string; @@ -1023,6 +1030,8 @@ declare module AtomCore { new(state:IAtomState):IAtom; } + // https://atom.io/docs/api/v0.106.0/api/classes/Atom.html + /* Global Atom class : instance members */ interface IAtom { constructor:IAtomStatic; diff --git a/auth0.widget/auth0.widget.d.ts b/auth0.widget/auth0.widget.d.ts index 932d79c94..d45c3a212 100644 --- a/auth0.widget/auth0.widget.d.ts +++ b/auth0.widget/auth0.widget.d.ts @@ -1,5 +1,5 @@ // Type definitions for Auth0Widget.js -// Project: Auth0.com +// Project: http://auth0.com // Definitions by: Robert McLaws // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -45,4 +45,4 @@ declare var Auth0Widget: Auth0WidgetStatic; declare module "Auth0Widget" { export = Auth0Widget -} \ No newline at end of file +} diff --git a/auth0/auth0.d.ts b/auth0/auth0.d.ts index 02b8e0196..5d3149ead 100644 --- a/auth0/auth0.d.ts +++ b/auth0/auth0.d.ts @@ -1,5 +1,5 @@ // Type definitions for Auth0.js -// Project: Auth0.com +// Project: http://auth0.com // Definitions by: Robert McLaws // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -130,4 +130,4 @@ declare var Auth0: Auth0Static; declare module "Auth0" { export = Auth0 -} \ No newline at end of file +} diff --git a/azure-mobile-services-client/AzureMobileServicesClient.d.ts b/azure-mobile-services-client/AzureMobileServicesClient.d.ts index 3b2b8fc16..2aec11114 100644 --- a/azure-mobile-services-client/AzureMobileServicesClient.d.ts +++ b/azure-mobile-services-client/AzureMobileServicesClient.d.ts @@ -42,21 +42,21 @@ declare module Microsoft.WindowsAzure { getTableName(): string; getMobileServiceClient(): MobileServiceClient; - insert(istance: any, paramsQS: Object, callback: (error: any, retInserted: any) => any): void; - insert(istance: any, paramsQS: Object): asyncPromise; - insert(istance: any): asyncPromise; + insert(instance: any, paramsQS: Object, callback: (error: any, retInserted: any) => any): void; + insert(instance: any, paramsQS: Object): asyncPromise; + insert(instance: any): asyncPromise; - update(istance: any, paramsQS: Object, callback: (error: any, retUpdated: any) => any): void; - update(istance: any, paramsQS: Object): asyncPromise; - update(istance: any): asyncPromise; + update(instance: any, paramsQS: Object, callback: (error: any, retUpdated: any) => any): void; + update(instance: any, paramsQS: Object): asyncPromise; + update(instance: any): asyncPromise; lookup(id: number, paramsQS: Object, callback: (error: any, retValue: any) => any): void; lookup(id: number, paramsQS: Object): asyncPromise; lookup(id: number): asyncPromise; - del(istance: any, paramsQS: Object, callback: (error?: any) => void ): void; - del(istance: any, paramsQS: Object): asyncPromise; - del(istance: any): asyncPromise; + del(instance: any, paramsQS: Object, callback: (error?: any) => void ): void; + del(instance: any, paramsQS: Object): asyncPromise; + del(instance: any): asyncPromise; read(query: IQuery, paramsQS: Object, callback: (error: any, retValues: any) => any): void; diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index 6fa7e6d60..b58c4652f 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -1,10 +1,8 @@ // Type definitions for Backbone 1.0.0 // Project: http://backbonejs.org/ -// Definitions by: Boris Yankov -// Definitions by: Natan Vivo +// Definitions by: Boris Yankov , Natan Vivo // Definitions: https://github.com/borisyankov/DefinitelyTyped - /// /// diff --git a/bootstrap.v3.datetimepicker/boostrap.v3.datetimepicker-tests.ts b/bootstrap.v3.datetimepicker/boostrap.v3.datetimepicker-tests.ts new file mode 100644 index 000000000..6abf38f94 --- /dev/null +++ b/bootstrap.v3.datetimepicker/boostrap.v3.datetimepicker-tests.ts @@ -0,0 +1,31 @@ +/// +/// + +function test_cases() { + $('#datetimepicker').datetimepicker(); + $('#datetimepicker').datetimepicker({ + pickDate: false + }); + $('#datetimepicker').datetimepicker({ + pickTime: false + }); + $('#datetimepicker').datetimepicker({ + minDate: '2012-12-31' + }); + + $('#datetimepicker').data("DateTimePicker").setMaxDate('2012-12-31'); + + var startDate = new Date(2012, 1, 20); + var endDate = new Date(2012, 1, 25); + $('#datetimepicker2') + .datetimepicker() + .on("dp.change", function (ev) { + if (ev.date.valueOf() > endDate.valueOf()) { + $('#alert').show().find('strong').text('The start date must be before the end date.'); + } else { + $('#alert').hide(); + startDate = ev.date; + $('#date-start-display').text($('#date-start').data('date')); + } + }); +} \ No newline at end of file diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts new file mode 100644 index 000000000..6f1147cc1 --- /dev/null +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts @@ -0,0 +1,100 @@ +// Type definitions for Bootstrap datetimepicker v3 +// Project: http://eonasdan.github.io/bootstrap-datetimepicker +// Definitions by: Jesica N. Fera +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * bootstrap-datetimepicker.js 3.0.0 Copyright (c) 2014 Jonathan Peterson + * Available via the MIT license. + * see: http://eonasdan.github.io/bootstrap-datetimepicker or https://github.com/Eonasdan/bootstrap-datetimepicker for details. + */ + +/// + +declare module BootstrapV3DatetimePicker { + interface DatetimepickerChangeEventObject extends JQueryEventObject { + date: any; + oldDate: any; + } + + interface DatetimepickerEventObject extends JQueryEventObject { + date: any; + } + + interface DatetimepickerIcons { + time?: string; + date?: string; + up?: string; + down?: string; + } + + interface DatetimepickerOptions { + pickDate?: boolean; + pickTime?: boolean; + useMinutes?: boolean; + useSeconds?: boolean; + useCurrent?: boolean; + minuteStepping?: number; + minDate?: any; + maxDate?: any; + showToday?: boolean; + collapse?: boolean; + language?: string; + defaultDate?: string; + disabledDates?: Array; + enabledDates?: Array; + icons?: DatetimepickerIcons; + useStrict?: boolean; + direction?: string; + sideBySide?: boolean; + daysOfWeekDisabled?: Array; + } + + interface Datetimepicker { + setDate(date: any): void; + setMinDate(date: any): void; + setMaxDate(date: any): void; + show(): void; + disable(): void; + enable(): void; + getDate(): void; + } + +} + + +interface JQuery { + + datetimepicker(): JQuery; + datetimepicker(options: BootstrapV3DatetimePicker.DatetimepickerOptions): JQuery; + + off(events: "dp.change", selector?: string, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerChangeEventObject) => any): JQuery; + off(events: "dp.change", handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerChangeEventObject) => any): JQuery; + + on(events: "dp.change", selector: string, data: any, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerChangeEventObject) => any): JQuery; + on(events: "dp.change", selector: string, handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerChangeEventObject) => any): JQuery; + on(events: 'dp.change', handler: (eventObject: BootstrapV3DatetimePicker.DatetimepickerChangeEventObject) => any): JQuery; + + off(events: "dp.show", selector?: string, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + off(events: "dp.show", handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + + on(events: "dp.show", selector: string, data: any, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + on(events: "dp.show", selector: string, handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + on(events: 'dp.show', handler: (eventObject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + + off(events: "dp.hide", selector?: string, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + off(events: "dp.hide", handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + + on(events: "dp.hide", selector: string, data: any, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + on(events: "dp.hide", selector: string, handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + on(events: 'dp.hide', handler: (eventObject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + + off(events: "dp.error", selector?: string, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + off(events: "dp.error", handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + + on(events: "dp.error", selector: string, data: any, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + on(events: "dp.error", selector: string, handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + on(events: 'dp.error', handler: (eventObject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery; + + data(key: 'DateTimePicker'): BootstrapV3DatetimePicker.Datetimepicker; +} \ No newline at end of file diff --git a/buffer-equal/buffer-equal.d.ts b/buffer-equal/buffer-equal.d.ts index 5f671662d..a3597c684 100644 --- a/buffer-equal/buffer-equal.d.ts +++ b/buffer-equal/buffer-equal.d.ts @@ -1,5 +1,5 @@ // Type definitions for buffer-equal 1.0 0 -// Project: https://github.com/chaijs/assertion-error +// Project: https://github.com/substack/node-buffer-equal // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/bufferstream/bufferstream-tests.ts b/bufferstream/bufferstream-tests.ts new file mode 100644 index 000000000..fe1ea70aa --- /dev/null +++ b/bufferstream/bufferstream-tests.ts @@ -0,0 +1,14 @@ +/// + +import BufferStream = require('bufferstream') + +var stream = new BufferStream({encoding:'utf8', size:'flexible'}); +stream.enable(); +stream.disable(); +stream.split('//', ':'); +stream.on('split', (chunk: any, token: any) => { + console.log("got '%s' by '%s'", chunk.toString(), token.toString()) +}); +stream.write("buffer:stream//23"); +console.log(stream.toString()); + diff --git a/bufferstream/bufferstream.d.ts b/bufferstream/bufferstream.d.ts new file mode 100644 index 000000000..5323103e2 --- /dev/null +++ b/bufferstream/bufferstream.d.ts @@ -0,0 +1,119 @@ +// Type definitions for bufferstream v0.6.2 +// Project: https://github.com/dodo/node-bufferstream +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'bufferstream' { + import stream = require('stream'); + + export = BufferStream; + + class BufferStream extends stream.Duplex { + constructor(options?: BufferStream.Opts); + + /* + different buffer behaviors can be triggered by size: + + none when output drains, bufferstream drains too + flexible buffers everthing that it gets and not piping out + TODO buffer has given size. buffers everthing until buffer is full. when buffer is full then the stream will drain + */ + setSize(size: string): void; // can be one of ['none', 'flexible', ] + setSize(size: number): void; // can be one of ['none', 'flexible', ] + /* + enables stream buffering default + */ + enable(): void; + /* + flushes buffer and disables stream buffering. BufferStream now pipes all data as long as the output accepting data. when the output is draining BufferStream will buffer all input temporary. + + token[s] buffer splitters (should be String or Buffer) + + disables given tokens. wont flush until no splitter tokens are left. + */ + disable(): void; + disable(token: string, ...tokens: string[]): void; + disable(tokens: string[]): void; // Array + disable(token: Buffer, ...tokens: Buffer[]): void; + disable(tokens: Buffer[]): void; // Array + /* + each time BufferStream finds a splitter token in the input data it will emit a split event. this also works for binary data. + + token[s] buffer splitters (should be String or Buffer) + */ + split(token: string, ...tokens: string[]): void; + split(tokens: string[]): void; // Array + split(token: Buffer, ...tokens: Buffer[]): void; + split(tokens: Buffer[]): void; // Array + /* + returns Buffer. + */ + getBuffer(): Buffer; + /* + returns Buffer. + */ + buffer: Buffer; + /* + shortcut for buffer.toString() + */ + toString(): string; + /* + shortcut for buffer.length + */ + length: number; + } + module BufferStream { + + export interface Opts { + /* + default encoding for writing strings + */ + encoding?: string; + /* + if true and the source is a child_process the stream will block the entire process (timeouts wont work anymore, but splitting and listening on data still works, because they work sync) + */ + blocking?: boolean; + /* + defines buffer level or sets buffer to given size (see ↓setSize for more) + */ + size?: any; + /* + immediately call disable + */ + disabled?: boolean; + /* + short form for: + split(token, function (chunk) {emit('data', chunk)}) + */ + // String or Buffer + split?: any; + } + export var fn: {warn: boolean}; + } +} + +declare module 'bufferstream/postbuffer' { + import http = require('http'); + import BufferStream = require('bufferstream'); + + class PostBuffer extends BufferStream { + /* + for if you want to get all the post data from a http server request and do some db reqeust before. + + http client buffer + */ + constructor(req: http.ServerRequest); + /* + set a callback to get all post data from a http server request + */ + onEnd(callback: (data: any) => void): void; + /* + pumps data into another stream to allow incoming streams given options will be passed to Stream.pipe + */ + pipe(stream: NodeJS.WritableStream, options?: BufferStream.Opts): NodeJS.ReadableStream; + } + + export = PostBuffer; +} diff --git a/camljs/camljs.d.ts b/camljs/camljs.d.ts index 7cfba8a40..0127b3e1d 100644 --- a/camljs/camljs.d.ts +++ b/camljs/camljs.d.ts @@ -102,6 +102,10 @@ declare module CamlBuilder { All(...conditions: IExpression[]): IExpression; /** Adds Or clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression(). */ Any(...conditions: IExpression[]): IExpression; + /** Adds And clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression(). */ + All(conditions: IExpression[]): IExpression; + /** Adds Or clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression(). */ + Any(conditions: IExpression[]): IExpression; /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Text */ TextField(internalName: string): ITextFieldExpression; /** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Boolean */ diff --git a/chai-datetime/chai-datetime.d.ts b/chai-datetime/chai-datetime.d.ts index 263034361..bce063443 100644 --- a/chai-datetime/chai-datetime.d.ts +++ b/chai-datetime/chai-datetime.d.ts @@ -1,7 +1,7 @@ // Type definitions for chai-datetime // Project: https://github.com/gaslight/chai-datetime.git // Definitions by: Cliff Burger -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/chai-jquery/chai-jquery.d.ts b/chai-jquery/chai-jquery.d.ts index 52fd4f3f5..826e66579 100644 --- a/chai-jquery/chai-jquery.d.ts +++ b/chai-jquery/chai-jquery.d.ts @@ -1,7 +1,7 @@ // Type definitions for chai-jquery 1.1.1 // Project: https://github.com/chaijs/chai-jquery // Definitions by: Kazi Manzur Rashid -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/chai/chai-assert-tests.ts.tscparams b/chai/chai-assert-tests.ts.tscparams deleted file mode 100644 index e16c76dff..000000000 --- a/chai/chai-assert-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" diff --git a/chai/chai.d.ts b/chai/chai.d.ts index d840aba96..54d5770c9 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -1,8 +1,7 @@ // Type definitions for chai 1.7.2 // Project: http://chaijs.com/ // Definitions by: Jed Hunsaker -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped - +// Definitions: https://github.com/borisyankov/DefinitelyTyped declare module chai { diff --git a/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts index c8dd2e6d4..ad319394f 100644 --- a/chrome/chrome-app.d.ts +++ b/chrome/chrome-app.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chrome packaged application development. +// Type definitions for Chrome packaged application development // Project: http://developer.chrome.com/apps/ // Definitions by: Adam Lay // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -92,4 +92,4 @@ declare module chrome.app.window { var onMaximized: WindowEvent; var onMinimized: WindowEvent; var onRestored: WindowEvent; -} \ No newline at end of file +} diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index e8e0f0639..796635c27 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Chrome extension development. +// Type definitions for Chrome extension development // Project: http://developer.chrome.com/extensions/ -// Definitions by: Matthew Kimber and otiai10 +// Definitions by: Matthew Kimber , otiai10 // Definitions: https://github.com/borisyankov/DefinitelyTyped //////////////////// @@ -1232,6 +1232,68 @@ declare module chrome.management { var onEnabled: ManagementEnabledEvent; } +//////////////////// +// Notifications +// https://developer.chrome.com/extensions/notifications +//////////////////// +declare module chrome.notifications { + interface ButtonOptions { + title: string; + iconUrl?: string; + } + + interface ItemOptions { + title: string; + message: string; + } + + interface NotificationOptions { + type?: string; + iconUrl?: string; + title?: string; + message?: string; + contextMessage?: string; + priority?: number; + eventTime?: number; + buttons?: Array; + items?: Array; + progress?: number; + isClickable?: boolean; + } + + interface OnClosed { + addListener(callback: (notificationId: string, byUser: boolean) => void): void; + } + + interface OnClicked { + addListener(callback: (notificationId: string) => void): void; + } + + interface OnButtonClicked { + addListener(callback: (notificationId: string, buttonIndex: number) => void): void; + } + + interface OnPermissionLevelChanged { + addListener(callback: (level: string) => void): void; + } + + interface OnShowSettings { + addListener(callback: Function): void; + } + + export var onClosed: OnClosed; + export var onClicked: OnClicked; + export var onButtonClicked: OnButtonClicked; + export var onPermissionLevelChanged: OnPermissionLevelChanged; + export var onShowSettings: OnShowSettings; + + export function create(notificationId: string, options: NotificationOptions, callback: (notificationId: string) => void): void; + export function update(notificationId: string, options: NotificationOptions, callback: (wasUpdated: boolean) => void): void; + export function clear(notificationId: string, callback: (wasCleared: boolean) => void): void; + export function getAll(callback: (notifications: any) => void): void; + export function getPermissionLevel(callback: (level: string) => void): void; +} + //////////////////// // Omnibox //////////////////// diff --git a/cordova/cordova.d.ts b/cordova/cordova.d.ts index 95be38882..9377912b0 100644 --- a/cordova/cordova.d.ts +++ b/cordova/cordova.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Apache Cordova. +// Type definitions for Apache Cordova // Project: http://cordova.apache.org -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc. // Definitions: https://github.com/borisyankov/DefinitelyTyped // // Copyright (c) Microsoft Open Technologies, Inc. @@ -57,4 +57,4 @@ interface UrlUtil { } /** Apache Cordova instance */ -declare var cordova: Cordova; \ No newline at end of file +declare var cordova: Cordova; diff --git a/createjs-lib/createjs-lib.d.ts b/createjs-lib/createjs-lib.d.ts index 048fde92d..a61679aa7 100644 --- a/createjs-lib/createjs-lib.d.ts +++ b/createjs-lib/createjs-lib.d.ts @@ -1,5 +1,5 @@ -// Type definitions for EaselJS 0.7.1, TweenJS 0.5.1, SoundJS 0.5.2, PreloadJS 0.4.1 -// Project: http://www.createjs.com/#!/EaselJS +// Type definitions for CreateJS +// Project: http://www.createjs.com/ // Definitions by: Pedro Ferreira , Chris Smith , Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/createjs/createjs.d.ts b/createjs/createjs.d.ts index 7be29abbe..f064d07f6 100644 --- a/createjs/createjs.d.ts +++ b/createjs/createjs.d.ts @@ -1,5 +1,5 @@ -// Type definitions for EaselJS 0.7.1, TweenJS 0.5.1, SoundJS 0.5.2, PreloadJS 0.4.1 -// Project: http://www.createjs.com/#!/EaselJS +// Type definitions for CreateJS +// Project: http://www.createjs.com/ // Definitions by: Pedro Ferreira , Chris Smith , Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/crossroads/crossroads.d.ts b/crossroads/crossroads.d.ts index 76fad217a..e86e3154d 100644 --- a/crossroads/crossroads.d.ts +++ b/crossroads/crossroads.d.ts @@ -1,7 +1,7 @@ // Type definitions for Crossroads.js // Project: http://millermedeiros.github.io/crossroads.js/ // Definitions by: Diullei Gomes -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 2225db5fc..b2f0bf1c9 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -751,8 +751,8 @@ declare module D3 { empty: () => boolean; data: { - (values: (data: any, index?: number) => any[], key?: (data: any, index?: number) => string): UpdateSelection; - (values: any[], key?: (data: any, index?: number) => string): UpdateSelection; + (values: (data: any, index?: number) => any[], key?: (data: any, index?: number) => any): UpdateSelection; + (values: any[], key?: (data: any, index?: number) => any): UpdateSelection; (): any[]; }; @@ -2743,7 +2743,7 @@ declare module D3 { clamp(clamp: boolean): TimeScale; ticks: { (count: number): any[]; - (range: Range, count: number): any[]; + (range: D3.Time.Range, count: number): any[]; }; tickFormat(count: number): (n: number) => string; copy(): TimeScale; diff --git a/date.format.js/date.format-tests.ts b/date.format.js/date.format-tests.ts new file mode 100644 index 000000000..d06e78cb7 --- /dev/null +++ b/date.format.js/date.format-tests.ts @@ -0,0 +1,10 @@ +/// + +// test dateFormat +var now : string = dateFormat(); +var nowFullDate : string = dateFormat( dateFormat.masks.fullDate ); + +// test format() (on the prototype of Date) +var then : Date = new Date( 2014, 1, 1 ); +var thenDefaultFormat : string = then.format(); +var thenCustomFormat : string = then.format('yyyy/m/d HH:MM'); diff --git a/date.format.js/date.format.d.ts b/date.format.js/date.format.d.ts new file mode 100644 index 000000000..6e4ef4ea6 --- /dev/null +++ b/date.format.js/date.format.d.ts @@ -0,0 +1,244 @@ +// Type definitions for Date Format 1.2.3 +// Project: http://blog.stevenlevithan.com/archives/date-time-format +// Definitions by: Rob Stutton +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/***************************************************************************** + Portions Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + +/** Enables basic storage and retrieval of dates and times. */ +interface Date { + /** Returns a string representation of a date. The format of the string depends on the locale. */ + toString(): string; + /** Returns a date as a string value. */ + toDateString(): string; + /** Returns a time as a string value. */ + toTimeString(): string; + /** Returns a value as a string value appropriate to the host environment's current locale. */ + toLocaleString(): string; + /** Returns a date as a string value appropriate to the host environment's current locale. */ + toLocaleDateString(): string; + /** Returns a time as a string value appropriate to the host environment's current locale. */ + toLocaleTimeString(): string; + /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ + valueOf(): number; + /** Gets the time value in milliseconds. */ + getTime(): number; + /** Gets the year, using local time. */ + getFullYear(): number; + /** Gets the year using Universal Coordinated Time (UTC). */ + getUTCFullYear(): number; + /** Gets the month, using local time. */ + getMonth(): number; + /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ + getUTCMonth(): number; + /** Gets the day-of-the-month, using local time. */ + getDate(): number; + /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ + getUTCDate(): number; + /** Gets the day of the week, using local time. */ + getDay(): number; + /** Gets the day of the week using Universal Coordinated Time (UTC). */ + getUTCDay(): number; + /** Gets the hours in a date, using local time. */ + getHours(): number; + /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ + getUTCHours(): number; + /** Gets the minutes of a Date object, using local time. */ + getMinutes(): number; + /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ + getUTCMinutes(): number; + /** Gets the seconds of a Date object, using local time. */ + getSeconds(): number; + /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCSeconds(): number; + /** Gets the milliseconds of a Date, using local time. */ + getMilliseconds(): number; + /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCMilliseconds(): number; + /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ + getTimezoneOffset(): number; + /** + * Sets the date and time value in the Date object. + * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. + */ + setTime(time: number): void; + /** + * Sets the milliseconds value in the Date object using local time. + * @param ms A numeric value equal to the millisecond value. + */ + setMilliseconds(ms: number): void; + /** + * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). + * @param ms A numeric value equal to the millisecond value. + */ + setUTCMilliseconds(ms: number): void; + + /** + * Sets the seconds value in the Date object using local time. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setSeconds(sec: number, ms?: number): void; + /** + * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCSeconds(sec: number, ms?: number): void; + /** + * Sets the minutes value in the Date object using local time. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setMinutes(min: number, sec?: number, ms?: number): void; + /** + * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCMinutes(min: number, sec?: number, ms?: number): void; + /** + * Sets the hour value in the Date object using local time. + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setHours(hours: number, min?: number, sec?: number, ms?: number): void; + /** + * Sets the hours value in the Date object using Universal Coordinated Time (UTC). + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCHours(hours: number, min?: number, sec?: number, ms?: number): void; + /** + * Sets the numeric day-of-the-month value of the Date object using local time. + * @param date A numeric value equal to the day of the month. + */ + setDate(date: number): void; + /** + * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). + * @param date A numeric value equal to the day of the month. + */ + setUTCDate(date: number): void; + /** + * Sets the month value in the Date object using local time. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. + */ + setMonth(month: number, date?: number): void; + /** + * Sets the month value in the Date object using Universal Coordinated Time (UTC). + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. + */ + setUTCMonth(month: number, date?: number): void; + /** + * Sets the year of the Date object using local time. + * @param year A numeric value for the year. + * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. + * @param date A numeric value equal for the day of the month. + */ + setFullYear(year: number, month?: number, date?: number): void; + /** + * Sets the year value in the Date object using Universal Coordinated Time (UTC). + * @param year A numeric value equal to the year. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. + * @param date A numeric value equal to the day of the month. + */ + setUTCFullYear(year: number, month?: number, date?: number): void; + /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ + toUTCString(): string; + /** Returns a date as a string value in ISO format. */ + toISOString(): string; + /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ + toJSON(key?: any): string; + /** + * This is a convenience addition to the Date prototype + * Returns a formatted version of the date. + * The mask defaults to dateFormat.masks.default. + * @param {string=} mask + * @param {boolean=} utc + */ + format(mask?: string, utc?: boolean) : string; +} + +declare var Date: { + new (): Date; + new (value: number): Date; + new (value: string): Date; + new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; + (): string; + prototype: Date; + /** + * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. + * @param s A date string + */ + parse(s: string): number; + /** + * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. + * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. + * @param month The month as an number between 0 and 11 (January to December). + * @param date The date as an number between 1 and 31. + * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. + * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. + * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. + * @param ms An number from 0 to 999 that specifies the milliseconds. + */ + UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; + now(): number; +}; + +// Some common format strings +interface DateFormatMasks { + "default": string; + shortDate: string; + mediumDate: string; + longDate: string; + fullDate: string; + shortTime: string; + mediumTime: string; + longTime: string; + isoDate: string; + isoTime: string; + isoDateTime: string; + isoUtcDateTime: string; +} + +// Internationalization strings +interface DateFormatI18n { + dayNames: string[]; + monthNames: string[]; +} + +/** + * Accepts a date, a mask, or a date and a mask. + * Returns a formatted version of the given date. + * The date defaults to the current date/time. + * The mask defaults to dateFormat.masks.default. + * @param {Date=} date + * @param {string=} mask + * @param {boolean=} utc + */ +declare var dateFormat: { + (date?: any, mask?: string, utc?: boolean ): string; + masks : DateFormatMasks; + i18n : DateFormatI18n; +}; diff --git a/dcjs/dc.d.ts b/dcjs/dc.d.ts index 0391d2502..2b06c34dd 100644 --- a/dcjs/dc.d.ts +++ b/dcjs/dc.d.ts @@ -1,7 +1,8 @@ // Type definitions for DCJS // Project: https://github.com/dc-js -// Definitions by: hans windhoff +// Definitions by: hans windhoff // Definitions: https://github.com/borisyankov/DefinitelyTyped + // this makes only sense together with d3 and crossfilter so you need the d3.d.ts and crossfilter.d.ts files /// @@ -195,4 +196,4 @@ export interface ILegendwidget { export function rowChart(cssSel: string): IRowchart; -} \ No newline at end of file +} diff --git a/deep-freeze/deep-freeze-tests.ts b/deep-freeze/deep-freeze-tests.ts new file mode 100644 index 000000000..8369d3087 --- /dev/null +++ b/deep-freeze/deep-freeze-tests.ts @@ -0,0 +1,8 @@ +/// + +import df = require('deep-freeze'); + +class Foo { + foo: string; +} +var foo:Foo = df(new Foo()); diff --git a/deep-freeze/deep-freeze.d.ts b/deep-freeze/deep-freeze.d.ts new file mode 100644 index 000000000..3d7ede8ad --- /dev/null +++ b/deep-freeze/deep-freeze.d.ts @@ -0,0 +1,9 @@ +// Type definitions for deep-freeze +// Project: https://github.com/substack/deep-freeze +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'deep-freeze' { + function df(obj: T): T; + export = df; +} diff --git a/domready/domready.d.ts b/domready/domready.d.ts index 14ba14011..7dc9c7749 100644 --- a/domready/domready.d.ts +++ b/domready/domready.d.ts @@ -1,6 +1,6 @@ // Type definitions for domready // Project: https://github.com/ded/domready -// Definitions by: Christian Holm Nielsen +// Definitions by: Christian Holm Nielsen // Definitions: https://github.com/borisyankov/DefinitelyTyped declare function domready(callback: () => any) : void; diff --git a/durandal/durandal.d.ts b/durandal/durandal.d.ts index 6c2013ec7..8250a3325 100644 --- a/durandal/durandal.d.ts +++ b/durandal/durandal.d.ts @@ -1,1681 +1,1795 @@ -// Type definitions for Durandal 2.0.1 -// Project: http://durandaljs.com -// Definitions by: Evan Larsen -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/** - * Durandal 2.0.1 Copyright (c) 2012 Blue Spire Consulting, Inc. All Rights Reserved. - * Available via the MIT license. - * see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details. - */ - -/// -/// - -/** - * The system module encapsulates the most basic features used by other modules. - * @requires require - * @requires jquery - */ -declare module 'durandal/system' { - var theModule: DurandalSystemModule; - export = theModule; -} - -/** - * The viewEngine module provides information to the viewLocator module which is used to locate the view's source file. The viewEngine also transforms a view id into a view instance. - * @requires system - * @requires jquery - */ -declare module 'durandal/viewEngine' { - var theModule: DurandalViewEngineModule; - export = theModule; -} - -/** - * Durandal events originate from backbone.js but also combine some ideas from signals.js as well as some additional improvements. - * Events can be installed into any object and are installed into the `app` module by default for convenient app-wide eventing. - * @requires system - */ -declare module 'durandal/events' { - var theModule: DurandalEventModule; - export = theModule; -} - -/** - * The binder joins an object instance and a DOM element tree by applying databinding and/or invoking binding lifecycle callbacks (binding and bindingComplete). - * @requires system - * @requires knockout - */ -declare module 'durandal/binder' { - interface BindingInstruction { - applyBindings: boolean; - } - - /** - * Called before every binding operation. Does nothing by default. - * @param {object} data The data that is about to be bound. - * @param {DOMElement} view The view that is about to be bound. - * @param {object} instruction The object that carries the binding instructions. - */ - export var binding: (data: any, view: HTMLElement, instruction: BindingInstruction) => void; - - /** - * Called after every binding operation. Does nothing by default. - * @param {object} data The data that has just been bound. - * @param {DOMElement} view The view that has just been bound. - * @param {object} instruction The object that carries the binding instructions. - */ - export var bindingComplete: (data: any, view: HTMLElement, instruction: BindingInstruction) => void; - - /** - * Indicates whether or not the binding system should throw errors or not. - * @default false The binding system will not throw errors by default. Instead it will log them. - */ - export var throwOnErrors: boolean; - - /** - * Gets the binding instruction that was associated with a view when it was bound. - * @param {DOMElement} view The view that was previously bound. - * @returns {object} The object that carries the binding instructions. - */ - export function getBindingInstruction(view: HTMLElement): BindingInstruction; - - /** - * Binds the view, preserving the existing binding context. Optionally, a new context can be created, parented to the previous context. - * @param {KnockoutBindingContext} bindingContext The current binding context. - * @param {DOMElement} view The view to bind. - * @param {object} [obj] The data to bind to, causing the creation of a child binding context if present. - */ - export function bindContext(bindingContext: KnockoutBindingContext, view: HTMLElement, obj?: any): BindingInstruction; - - /** - * Binds the view, preserving the existing binding context. Optionally, a new context can be created, parented to the previous context. - * @param {object} obj The data to bind to. - * @param {DOMElement} view The view to bind. - */ - export function bind(obj: any, view: HTMLElement): BindingInstruction; -} - -/** - * The activator module encapsulates all logic related to screen/component activation. - * An activator is essentially an asynchronous state machine that understands a particular state transition protocol. - * The protocol ensures that the following series of events always occur: `canDeactivate` (previous state), `canActivate` (new state), `deactivate` (previous state), `activate` (new state). - * Each of the _can_ callbacks may return a boolean, affirmative value or promise for one of those. If either of the _can_ functions yields a false result, then activation halts. - * @requires system - * @requires knockout - */ -declare module 'durandal/activator' { - /** - * The default settings used by activators. - * @property {ActivatorSettings} defaults - */ - export var defaults: DurandalActivatorSettings; - - /** - * Creates a new activator. - * @method create - * @param {object} [initialActiveItem] The item which should be immediately activated upon creation of the ativator. - * @param {ActivatorSettings} [settings] Per activator overrides of the default activator settings. - * @returns {Activator} The created activator. - */ - export function create(initialActiveItem?: T, settings?: DurandalActivatorSettings): DurandalActivator; - - /** - * Determines whether or not the provided object is an activator or not. - * @method isActivator - * @param {object} object Any object you wish to verify as an activator or not. - * @returns {boolean} True if the object is an activator; false otherwise. - */ - export function isActivator(object: any): boolean; -} - -/** - * The viewLocator module collaborates with the viewEngine module to provide views (literally dom sub-trees) to other parts of the framework as needed. The primary consumer of the viewLocator is the composition module. - * @requires system - * @requires viewEngine - */ -declare module 'durandal/viewLocator' { - var theModule: DurandalViewLocatorModule; - export = theModule; -} - -/** - * The composition module encapsulates all functionality related to visual composition. - * @requires system - * @requires viewLocator - * @requires binder - * @requires viewEngine - * @requires activator - * @requires jquery - * @requires knockout - */ -declare module 'durandal/composition' { - interface CompositionTransation { - /** - * Registers a callback which will be invoked when the current composition transaction has completed. The transaction includes all parent and children compositions. - * @param {function} callback The callback to be invoked when composition is complete. - */ - complete(callback: Function): void; - } - - interface CompositionContext { - mode: string; - parent: HTMLElement; - activeView: HTMLElement; - triggerAttach(): void; - bindingContext?: KnockoutBindingContext; - cacheViews?: boolean; - viewElements?: HTMLElement[]; - model?: any; - view?: any; - area?: string; - preserveContext?: boolean; - activate?: boolean; - strategy?: (context: CompositionContext) => JQueryPromise; - composingNewView: boolean; - child: HTMLElement; - binding?: (child: HTMLElement, parent: HTMLElement, context: CompositionContext) => void; - attached?: (child: HTMLElement, parent: HTMLElement, context: CompositionContext) => void; - compositionComplete?: (child: HTMLElement, parent: HTMLElement, context: CompositionContext) => void; - tranistion?: string; - } - - /** - * Converts a transition name to its moduleId. - * @param {string} name The name of the transtion. - * @returns {string} The moduleId. - */ - export function convertTransitionToModuleId(name: string): string; - - /** - * The name of the transition to use in all compositions. - * @default null - */ - export var defaultTransitionName: string; - - /** - * Represents the currently executing composition transaction. - */ - export var current: CompositionTransation; - - /** - * Registers a binding handler that will be invoked when the current composition transaction is complete. - * @param {string} name The name of the binding handler. - * @param {object} [config] The binding handler instance. If none is provided, the name will be used to look up an existing handler which will then be converted to a composition handler. - * @param {function} [initOptionsFactory] If the registered binding needs to return options from its init call back to knockout, this function will server as a factory for those options. It will receive the same parameters that the init function does. - */ - export function addBindingHandler(name, config?: KnockoutBindingHandler, initOptionsFactory?: (element?: HTMLElement, valueAccessor?: any, allBindingsAccessor?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => any); - - /** - * Gets an object keyed with all the elements that are replacable parts, found within the supplied elements. The key will be the part name and the value will be the element itself. - * @param {DOMElement[]} elements The elements to search for parts. - * @returns {object} An object keyed by part. - */ - export function getParts(elements: HTMLElement[]): any; - - /** - * Gets an object keyed with all the elements that are replacable parts, found within the supplied element. The key will be the part name and the value will be the element itself. - * @param {DOMElement} element The element to search for parts. - * @returns {object} An object keyed by part. - */ - export function getParts(element: HTMLElement): any; - - /** - * Eecutes the default view location strategy. - * @param {object} context The composition context containing the model and possibly existing viewElements. - * @returns {promise} A promise for the view. - */ - export var defaultStrategy: (context: CompositionContext) => JQueryPromise; - - /** - * Initiates a composition. - * @param {DOMElement} element The DOMElement or knockout virtual element that serves as the parent for the composition. - * @param {object} settings The composition settings. - * @param {object} [bindingContext] The current binding context. - */ - export function compose(element: HTMLElement, settings: CompositionContext, bindingContext: KnockoutBindingContext): void; -} - -/** - * The app module controls app startup, plugin loading/configuration and root visual display. - * @requires system - * @requires viewEngine - * @requires composition - * @requires events - * @requires jquery - */ -declare module 'durandal/app' { - var theModule: DurandalAppModule; - export = theModule; -} - -/** - * The dialog module enables the display of message boxes, custom modal dialogs and other overlays or slide-out UI abstractions. Dialogs are constructed by the composition system which interacts with a user defined dialog context. The dialog module enforced the activator lifecycle. - * @requires system - * @requires app - * @requires composition - * @requires activator - * @requires viewEngine - * @requires jquery - * @requires knockout - */ -declare module 'plugins/dialog' { - import composition = require('durandal/composition'); - - /** - * Models a message box's message, title and options. - * @class - */ - class Box { - constructor(message: string, title: string, options: string[]); - - /** - * Selects an option and closes the message box, returning the selected option through the dialog system's promise. - * @param {string} dialogResult The result to select. - */ - selectOptions(dialogResult: string): void; - - /** - * Provides the view to the composition system. - * @returns {DOMElement} The view of the message box. - */ - getView(): HTMLElement; - - /** - * The title to be used for the message box if one is not provided. - * @default Application - * @static - */ - static defaultTitle: string; - - /** - * The options to display in the message box of none are specified. - * @default ['Ok'] - * @static - */ - static defaultOptions: string[]; - - /** - * The markup for the message box's view. - * @static - */ - static defaultViewMarkup: string; - - /** - * Configures a custom view to use when displaying message boxes. - * @param {string} viewUrl The view url relative to the base url which the view locator will use to find the message box's view. - * @static - */ - static setViewUrl(url: string): void; - } - - interface DialogContext { - /** - * In this function, you are expected to add a DOM element to the tree which will serve as the "host" for the modal's composed view. You must add a property called host to the modalWindow object which references the dom element. It is this host which is passed to the composition module. - * @param {Dialog} theDialog The dialog model. - */ - addHost(theDialog: Dialog); - - /** - * This function is expected to remove any DOM machinery associated with the specified dialog and do any other necessary cleanup. - * @param {Dialog} theDialog The dialog model. - */ - removeHost(theDialog: Dialog); - - /** - * This function is called after the modal is fully composed into the DOM, allowing your implementation to do any final modifications, such as positioning or animation. You can obtain the original dialog object by using `getDialog` on context.model. - * @param {DOMElement} child The dialog view. - * @param {DOMElement} parent The parent view. - * @param {object} context The composition context. - */ - compositionComplete(child: HTMLElement, parent: HTMLElement, context: composition.CompositionContext); - } - - interface Dialog { - owner: any; - context: DialogContext; - activator: DurandalActivator; - close(): JQueryPromise; - settings: composition.CompositionContext; - } - - /** - * The constructor function used to create message boxes. - */ - export var MessageBox: Box; - - /** - * The css zIndex that the last dialog was displayed at. - */ - export var currentZIndex: number; - - /** - * Gets the next css zIndex at which a dialog should be displayed. - * @returns {number} The next usable zIndex. - */ - export function getNextZIndex(): number; - - /** - * Determines whether or not there are any dialogs open. - * @returns {boolean} True if a dialog is open. false otherwise. - */ - export function isOpen(): boolean; - - /** - * Gets the dialog context by name or returns the default context if no name is specified. - * @param {string} [name] The name of the context to retrieve. - * @returns {DialogContext} True context. - */ - export function getContext(name: string): DialogContext; - - /** - * Adds (or replaces) a dialog context. - * @param {string} name The name of the context to add. - * @param {DialogContext} dialogContext The context to add. - */ - export function addContext(name: string, modalContext: DialogContext): void; - - /** - * Gets the dialog model that is associated with the specified object. - * @param {object} obj The object for whom to retrieve the dialog. - * @returns {Dialog} The dialog model. - */ - export function getDialog(obj: any): Dialog; - - /** - * Closes the dialog associated with the specified object. - * @param {object} obj The object whose dialog should be closed. - * @param {object} results* The results to return back to the dialog caller after closing. - */ - export function close(obj: any, ...results: any[]): void; - - /** - * Shows a dialog. - * @param {object|string} obj The object (or moduleId) to display as a dialog. - * @param {object} [activationData] The data that should be passed to the object upon activation. - * @param {string} [context] The name of the dialog context to use. Uses the default context if none is specified. - * @returns {Promise} A promise that resolves when the dialog is closed and returns any data passed at the time of closing. - */ - export function show(obj: any, activationData?: any, context?: string): JQueryPromise; - - /** - * Shows a message box. - * @param {string} message The message to display in the dialog. - * @param {string} [title] The title message. - * @param {string[]} [options] The options to provide to the user. - * @returns {Promise} A promise that resolves when the message box is closed and returns the selected option. - */ - export function showMessage(message: string, title?: string, options?: string[]): JQueryPromise; - - /** - * Installs this module into Durandal; called by the framework. Adds `app.showDialog` and `app.showMessage` convenience methods. - * @param {object} [config] Add a `messageBox` property to supply a custom message box constructor. Add a `messageBoxView` property to supply custom view markup for the built-in message box. - */ - export function install(config: Object): void; -} - -/** - * This module is based on Backbone's core history support. It abstracts away the low level details of working with browser history and url changes in order to provide a solid foundation for a router. - * @requires system - * @requires jquery - */ -declare module 'plugins/history' { - /** - * The setTimeout interval used when the browser does not support hash change events. - * @default 50 - */ - export var interval: number; - - /** - * Indicates whether or not the history module is actively tracking history. - */ - export var active: boolean; - - /** - * Gets the true hash value. Cannot use location.hash directly due to a bug in Firefox where location.hash will always be decoded. - * @param {string} [window] The optional window instance - * @returns {string} The hash. - */ - export function getHash(window?: Window): string; - - /** - * Get the cross-browser normalized URL fragment, either from the URL, the hash, or the override. - * @param {string} fragment The fragment. - * @param {boolean} forcePushState Should we force push state? - * @returns {string} he fragment. - */ - export function getFragment(fragment: string, forcePushState: boolean): string; - - /** - * Activate the hash change handling, returning `true` if the current URL matches an existing route, and `false` otherwise. - * @param {HistoryOptions} options. - * @returns {boolean|undefined} Returns true/false from loading the url unless the silent option was selected. - */ - export function activate(options: DurandalHistoryOptions): boolean; - - /** - * Disable history, perhaps temporarily. Not useful in a real app, but possibly useful for unit testing Routers. - */ - export function deactivate(): void; - - /** - * Checks the current URL to see if it has changed, and if it has, calls `loadUrl`, normalizing across the hidden iframe. - * @returns {boolean} Returns true/false from loading the url. - */ - export function checkUrl(): boolean; - - /** - * Attempts to load the current URL fragment. A pass-through to options.routeHandler. - * @returns {boolean} Returns true/false from the route handler. - */ - export function loadUrl(): boolean; - - /** - * Save a fragment into the hash history, or replace the URL state if the - * 'replace' option is passed. You are responsible for properly URL-encoding - * the fragment in advance. - * The options object can contain `trigger: false` if you wish to not have the - * route callback be fired, or `replace: true`, if - * you wish to modify the current URL without adding an entry to the history. - * @param {string} fragment The url fragment to navigate to. - * @param {object|boolean} options An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is `true` by default. - * @return {boolean} Returns true/false from loading the url. - */ - export function navigate(fragment: string, trigger?: boolean): boolean; - - /** - * Save a fragment into the hash history, or replace the URL state if the - * 'replace' option is passed. You are responsible for properly URL-encoding - * the fragment in advance. - * The options object can contain `trigger: false` if you wish to not have the - * route callback be fired, or `replace: true`, if - * you wish to modify the current URL without adding an entry to the history. - * @param {string} fragment The url fragment to navigate to. - * @param {object|boolean} options An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is `true` by default. - * @return {boolean} Returns true/false from loading the url. - */ - export function navigate(fragment: string, options: DurandalNavigationOptions): boolean; - - /** - * Navigates back in the browser history. - */ - export function navigateBack(): void; -} - -/** - * Enables common http request scenarios. - * @requires jquery - * @requires knockout - */ -declare module 'plugins/http' { - /** - * The name of the callback parameter to inject into jsonp requests by default. - * @default callback - */ - export var callbackParam: string; - - /** - * Makes an HTTP GET request. - * @param {string} url The url to send the get request to. - * @param {object} [query] An optional key/value object to transform into query string parameters. - * @returns {Promise} A promise of the get response data. - */ - export function get(url: string, query?: Object): JQueryPromise; - - /** - * Makes an JSONP request. - * @param {string} url The url to send the get request to. - * @param {object} [query] An optional key/value object to transform into query string parameters. - * @param {string} [callbackParam] The name of the callback parameter the api expects (overrides the default callbackParam). - * @returns {Promise} A promise of the response data. - */ - export function jsonp(url: string, query?: Object, callbackParam?: string): JQueryPromise; - - /** - * Makes an HTTP POST request. - * @param {string} url The url to send the post request to. - * @param {object} data The data to post. It will be converted to JSON. If the data contains Knockout observables, they will be converted into normal properties before serialization. - * @returns {Promise} A promise of the response data. - */ - export function post(url: string, data: Object): JQueryPromise; -} - -/** - * Enables automatic observability of plain javascript object for ES5 compatible browsers. Also, converts promise properties into observables that are updated when the promise resolves. - * @requires system - * @requires binder - * @requires knockout - */ -declare module 'plugins/observable' { - function observable(obj: any, property: string): KnockoutObservable; - - module observable { - /** - * Converts an entire object into an observable object by re-writing its attributes using ES5 getters and setters. Attributes beginning with '_' or '$' are ignored. - * @param {object} obj The target object to convert. - */ - export function convertObject(obj: any): void; - - /** - * Converts a normal property into an observable property using ES5 getters and setters. - * @param {object} obj The target object on which the property to convert lives. - * @param {string} propertyName The name of the property to convert. - * @param {object} [original] The original value of the property. If not specified, it will be retrieved from the object. - * @returns {KnockoutObservable} The underlying observable. - */ - export function convertProperty(obj: any, propertyName: string, original?: any): KnockoutObservable; - - /** - * Defines a computed property using ES5 getters and setters. - * @param {object} obj The target object on which to create the property. - * @param {string} propertyName The name of the property to define. - * @param {function|object} evaluatorOrOptions The Knockout computed function or computed options object. - * @returns {KnockoutComputed} The underlying computed observable. - */ - export function defineProperty(obj: any, propertyName: string, evaluatorOrOptions?: KnockoutComputedDefine); - - /** - * Installs the plugin into the view model binder's `beforeBind` hook so that objects are automatically converted before being bound. - */ - export function install(config: Object): void; - } - - export = observable; -} - -/** - * Serializes and deserializes data to/from JSON. - * @requires system - */ -declare module 'plugins/serializer' { - interface SerializerOptions { - /** - * The default replacer function used during serialization. By default properties starting with '_' or '$' are removed from the serialized object. - * @param {string} key The object key to check. - * @param {object} value The object value to check. - * @returns {object} The value to serialize. - */ - replacer?: (key: string, value: any) => any; - - /** - * The amount of space to use for indentation when writing out JSON. - * @default undefined - */ - space: any; - } - - interface DeserializerOptions { - /** - * Gets the type id for an object instance, using the configured `typeAttribute`. - * @param {object} object The object to serialize. - * @returns {string} The type. - */ - getTypeId: (object: any) => string; - - /** - * Gets the constructor based on the type id. - * @param {string} typeId The type id. - * @returns {Function} The constructor. - */ - getConstructor: (typeId: string) => () => any; - - /** - * The default reviver function used during deserialization. By default is detects type properties on objects and uses them to re-construct the correct object using the provided constructor mapping. - * @param {string} key The attribute key. - * @param {object} value The object value associated with the key. - * @returns {object} The value. - */ - reviver: (key: string, value: any) => any; - } - - /** - * The name of the attribute that the serializer should use to identify an object's type. - * @default type - */ - export var typeAttribute: string; - - /** - * The amount of space to use for indentation when writing out JSON. - * @default undefined - */ - export var space: any; - - /** - * The default replacer function used during serialization. By default properties starting with '_' or '$' are removed from the serialized object. - * @param {string} key The object key to check. - * @param {object} value The object value to check. - * @returns {object} The value to serialize. - */ - export function replacer(key: string, value: any): any; - - /** - * Serializes the object. - * @param {object} object The object to serialize. - * @param {object} [settings] Settings can specify a replacer or space to override the serializer defaults. - * @returns {string} The JSON string. - */ - export function serialize(object: any, settings?: string); - - /** - * Serializes the object. - * @param {object} object The object to serialize. - * @param {object} [settings] Settings can specify a replacer or space to override the serializer defaults. - * @returns {string} The JSON string. - */ - export function serialize(object: any, settings?: number); - - /** - * Serializes the object. - * @param {object} object The object to serialize. - * @param {object} [settings] Settings can specify a replacer or space to override the serializer defaults. - * @returns {string} The JSON string. - */ - export function serialize(object: any, settings?: SerializerOptions); - - /** - * Gets the type id for an object instance, using the configured `typeAttribute`. - * @param {object} object The object to serialize. - * @returns {string} The type. - */ - export function getTypeId(object: any): string; - - /** - * Maps type ids to object constructor functions. Keys are type ids and values are functions. - */ - export var typeMap: any; - - /** - * Adds a type id/constructor function mampping to the `typeMap`. - * @param {string} typeId The type id. - * @param {function} constructor The constructor. - */ - export function registerType(typeId: string, constructor: () => any); - - /** - * The default reviver function used during deserialization. By default is detects type properties on objects and uses them to re-construct the correct object using the provided constructor mapping. - * @param {string} key The attribute key. - * @param {object} value The object value associated with the key. - * @param {function} getTypeId A custom function used to get the type id from a value. - * @param {object} getConstructor A custom function used to get the constructor function associated with a type id. - * @returns {object} The value. - */ - export function reviver(key: string, value: any, getTypeId: (value: any) => string, getConstructor: (string) => () => any): any; - - /** - * Deserialize the JSON. - * @param {text} string The JSON string. - * @param {DeserializerOptions} settings Settings can specify a reviver, getTypeId function or getConstructor function. - * @returns {object} The deserialized object. - */ - export function deserialize(text: string, settings?: DeserializerOptions): T; -} - -/** - * Layers the widget sugar on top of the composition system. - * @requires system - * @requires composition - * @requires jquery - * @requires knockout - */ -declare module 'plugins/widget' { - interface WidgetSettings { - kind: string; - model?: any; - view?: any; - } - - /** - * Creates a ko binding handler for the specified kind. - * @param {string} kind The kind to create a custom binding handler for. - */ - export function registerKind(kind: string); - - /** - * Maps views and module to the kind identifier if a non-standard pattern is desired. - * @param {string} kind The kind name. - * @param {string} [viewId] The unconventional view id to map the kind to. - * @param {string} [moduleId] The unconventional module id to map the kind to. - */ - export function mapKind(kind: string, viewId?: string, moduleId?: string); - - /** - * Maps a kind name to it's module id. First it looks up a custom mapped kind, then falls back to `convertKindToModulePath`. - * @param {string} kind The kind name. - * @returns {string} The module id. - */ - export function mapKindToModuleId(kind: string): string; - - /** - * Converts a kind name to it's module path. Used to conventionally map kinds who aren't explicitly mapped through `mapKind`. - * @param {string} kind The kind name. - * @returns {string} The module path. - */ - export function convertKindToModulePath(kind: string): string; - - /** - * Maps a kind name to it's view id. First it looks up a custom mapped kind, then falls back to `convertKindToViewPath`. - * @param {string} kind The kind name. - * @returns {string} The view id. - */ - export function mapKindToViewId(kind: string): string; - - /** - * Converts a kind name to it's view id. Used to conventionally map kinds who aren't explicitly mapped through `mapKind`. - * @param {string} kind The kind name. - * @returns {string} The view id. - */ - export function convertKindToViewPath(kind: string): string; - - /** - * Creates a widget. - * @param {DOMElement} element The DOMElement or knockout virtual element that serves as the target element for the widget. - * @param {object} settings The widget settings. - * @param {object} [bindingContext] The current binding context. - */ - export function create(element: HTMLElement, settings: WidgetSettings, bindingContext?: KnockoutBindingContext); -} - -/** - * Connects the history module's url and history tracking support to Durandal's activation and composition engine allowing you to easily build navigation-style applications. - * @requires system - * @requires app - * @requires activator - * @requires events - * @requires composition - * @requires history - * @requires knockout - * @requires jquery - */ -declare module 'plugins/router' { - var theModule: DurandalRootRouter; - export = theModule; -} - -interface DurandalSystemModule { - /** - * Durandal's version. - */ - version: string; - - /** - * A noop function. - */ - noop: Function; - - /** - * Gets the module id for the specified object. - * @param {object} obj The object whose module id you wish to determine. - * @returns {string} The module id. - */ - getModuleId(obj: any): string; - - /** - * Sets the module id for the specified object. - * @param {object} obj The object whose module id you wish to set. - * @param {string} id The id to set for the specified object. - */ - setModuleId(obj, id: string): void; - - /** - * Resolves the default object instance for a module. If the module is an object, the module is returned. If the module is a function, that function is called with `new` and it's result is returned. - * @param {object} module The module to use to get/create the default object for. - * @returns {object} The default object for the module. - */ - resolveObject(module: any): any; - - /** - * Gets/Sets whether or not Durandal is in debug mode. - * @param {boolean} [enable] Turns on/off debugging. - * @returns {boolean} Whether or not Durandal is current debugging. - */ - debug(enable?: boolean): boolean; - - /** - * Logs data to the console. Pass any number of parameters to be logged. Log output is not processed if the framework is not running in debug mode. - * @param {object} info* The objects to log. - */ - log(...msgs: any[]): void; - - /** - * Logs an error. - * @param {string} obj The error to report. - */ - error(error: string): void; - - /** - * Logs an error. - * @param {Error} obj The error to report. - */ - error(error: Error): void; - - /** - * Asserts a condition by throwing an error if the condition fails. - * @param {boolean} condition The condition to check. - * @param {string} message The message to report in the error if the condition check fails. - */ - assert(condition: boolean, message: string): void; - - /** - * Creates a deferred object which can be used to create a promise. Optionally pass a function action to perform which will be passed an object used in resolving the promise. - * @param {function} [action] The action to defer. You will be passed the deferred object as a paramter. - * @returns {JQueryDeferred} The deferred object. - */ - defer(action?: (dfd: JQueryDeferred) => void): JQueryDeferred; - - /** - * Creates a simple V4 UUID. This should not be used as a PK in your database. It can be used to generate internal, unique ids. For a more robust solution see [node-uuid](https://github.com/broofa/node-uuid). - * @returns {string} The guid. - */ - guid(): string; - - /** - * Uses require.js to obtain a module. This function returns a promise which resolves with the module instance. - * @param {string} moduleId The id of the module to load. - * @returns {JQueryPromise} A promise for the loaded module. - */ - acquire(moduleId: string): JQueryPromise; - - /** - * Uses require.js to obtain an array of modules. This function returns a promise which resolves with the modules instances in an array. - * @param {string[]} moduleIds The ids of the modules to load. - * @returns {JQueryPromise} A promise for the loaded module. - */ - acquire(modules: string[]): JQueryPromise; - - /** - * Uses require.js to obtain multiple modules. This function returns a promise which resolves with the module instances in an array. - * @param {string} moduleIds* The ids of the modules to load. - * @returns {JQueryPromise} A promise for the loaded module. - */ - acquire(...moduleIds: string[]): JQueryPromise; - - /** - * Extends the first object with the properties of the following objects. - * @param {object} obj The target object to extend. - * @param {object} extension* Uses to extend the target object. - */ - extend(obj: any, ...extensions: any[]): any; - - /** - * Uses a setTimeout to wait the specified milliseconds. - * @param {number} milliseconds The number of milliseconds to wait. - * @returns {JQueryPromise} - */ - wait(milliseconds: number): JQueryPromise; - - /** - * Gets all the owned keys of the specified object. - * @param {object} object The object whose owned keys should be returned. - * @returns {string[]} The keys. - */ - keys(obj: any): string[]; - - /** - * Determines if the specified object is an html element. - * @param {object} object The object to check. - * @returns {boolean} True if matches the type, false otherwise. - */ - isElement(obj: any): boolean; - - /** - * Determines if the specified object is an array. - * @param {object} object The object to check. - * @returns {boolean} True if matches the type, false otherwise. - */ - isArray(obj: any): boolean; - - /** - * Determines if the specified object is a boolean. - * @param {object} object The object to check. - * @returns {boolean} True if matches the type, false otherwise. - */ - isObject(obj: any): boolean; - - /** - * Determines if the specified object is a promise. - * @param {object} object The object to check. - * @returns {boolean} True if matches the type, false otherwise. - */ - isPromise(obj: any): boolean; - - /** - * Determines if the specified object is a function arguments object. - * @param {object} object The object to check. - * @returns {boolean} True if matches the type, false otherwise. - */ - isArguments(obj: any): boolean; - - /** - * Determines if the specified object is a function. - * @param {object} object The object to check. - * @returns {boolean} True if matches the type, false otherwise. - */ - isFunction(obj: any): boolean; - - /** - * Determines if the specified object is a string. - * @param {object} object The object to check. - * @returns {boolean} True if matches the type, false otherwise. - */ - isString(obj: any): boolean; - - /** - * Determines if the specified object is a number. - * @param {object} object The object to check. - * @returns {boolean} True if matches the type, false otherwise. - */ - isNumber(obj: any): boolean; - - /** - * Determines if the specified object is a date. - * @param {object} object The object to check. - * @returns {boolean} True if matches the type, false otherwise. - */ - isDate(obj: any): boolean; - - /** - * Determines if the specified object is a boolean. - * @param {object} object The object to check. - * @returns {boolean} True if matches the type, false otherwise. - */ - isBoolean(obj: any): boolean; -} - -interface DurandalViewEngineModule { - - /** - * The file extension that view source files are expected to have. - * @default .html - */ - viewExtension: string; - - /** - * The name of the RequireJS loader plugin used by the viewLocator to obtain the view source. (Use requirejs to map the plugin's full path). - * @default text - */ - viewPlugin: string; - - /** - * Determines if the url is a url for a view, according to the view engine. - * @param {string} url The potential view url. - * @returns {boolean} True if the url is a view url, false otherwise. - */ - isViewUrl(url: string): boolean; - - /** - * Converts a view url into a view id. - * @param {string} url The url to convert. - * @returns {string} The view id. - */ - convertViewUrlToViewId(url: string): string; - - /** - * Converts a view id into a full RequireJS path. - * @param {string} viewId The view id to convert. - * @returns {string} The require path. - */ - convertViewIdToRequirePath(viewId: string): string; - - /** - * Parses the view engine recognized markup and returns DOM elements. - * @param {string} markup The markup to parse. - * @returns {HTMLElement[]} The elements. - */ - parseMarkup(markup: string): Node[]; - - /** - * Calls `parseMarkup` and then pipes the results through `ensureSingleElement`. - * @param {string} markup The markup to process. - * @returns {HTMLElement} The view. - */ - processMarkup(markup: string): HTMLElement; - - /** - * Converts an array of elements into a single element. White space and comments are removed. If a single element does not remain, then the elements are wrapped. - * @param {HTMLElement[]} allElements The elements. - * @returns {HTMLElement} A single element. - */ - ensureSingleElement(allElements: Node[]): HTMLElement; - - /** - * Creates the view associated with the view id. - * @param {string} viewId The view id whose view should be created. - * @returns {JQueryPromise} A promise of the view. - */ - createView(viewId: string): JQueryPromise; - - /** - * Called when a view cannot be found to provide the opportunity to locate or generate a fallback view. Mainly used to ease development. - * @param {string} viewId The view id whose view should be created. - * @param {string} requirePath The require path that was attempted. - * @param {Error} requirePath The error that was returned from the attempt to locate the default view. - * @returns {Promise} A promise for the fallback view. - */ - createFallbackView(viewId: string, requirePath: string, err: Error): JQueryPromise; -} - -interface DurandalViewLocatorModule { - - /** - * Allows you to set up a convention for mapping module folders to view folders. It is a convenience method that customizes `convertModuleIdToViewId` and `translateViewIdToArea` under the covers. - * @param {string} [modulesPath] A string to match in the path and replace with the viewsPath. If not specified, the match is 'viewmodels'. - * @param {string} [viewsPath] The replacement for the modulesPath. If not specified, the replacement is 'views'. - * @param {string} [areasPath] Partial views are mapped to the "views" folder if not specified. Use this parameter to change their location. - */ - useConvention(modulesPath?: string, viewsPath?: string, areasPath?: string): void; - - /** - * Maps an object instance to a view instance. - * @param {object} obj The object to locate the view for. - * @param {string} [area] The area to translate the view to. - * @param {DOMElement[]} [elementsToSearch] An existing set of elements to search first. - * @returns {Promise} A promise of the view. - */ - locateViewForObject(obj: any, area: string, elementsToSearch?: HTMLElement[]): JQueryPromise; - - /** - * Converts a module id into a view id. By default the ids are the same. - * @param {string} moduleId The module id. - * @returns {string} The view id. - */ - convertModuleIdToViewId(moduleId: string): string; - - /** - * If no view id can be determined, this function is called to genreate one. By default it attempts to determine the object's type and use that. - * @param {object} obj The object to determine the fallback id for. - * @returns {string} The view id. - */ - determineFallbackViewId(obj: any): string; - - /** - * Takes a view id and translates it into a particular area. By default, no translation occurs. - * @param {string} viewId The view id. - * @param {string} area The area to translate the view to. - * @returns {string} The translated view id. - */ - translateViewIdToArea(viewId: string, area: string): string; - - /** - * Locates the specified view. - * @param {string|DOMElement} view A view. It will be immediately returned. - * @param {string} [area] The area to translate the view to. - * @param {DOMElement[]} [elementsToSearch] An existing set of elements to search first. - * @returns {Promise} A promise of the view. - */ - locateView(view: HTMLElement, area?: string, elementsToSearch?: HTMLElement[]): JQueryPromise; - - /** - * Locates the specified view. - * @param {string|DOMElement} viewUrlOrId A view url or view id to locate. - * @param {string} [area] The area to translate the view to. - * @param {DOMElement[]} [elementsToSearch] An existing set of elements to search first. - * @returns {Promise} A promise of the view. - */ - locateView(viewUrlOrId: string, area?: string, elementsToSearch?: HTMLElement[]): JQueryPromise; -} - -interface DurandalEventSubscription { - /** - * Attaches a callback to the event subscription. - * @param {function} callback The callback function to invoke when the event is triggered. - * @param {object} [context] An object to use as `this` when invoking the `callback`. - * @chainable - */ - then(thenCallback: Function, context?: any): DurandalEventSubscription; - - /** - * Attaches a callback to the event subscription. - * @param {function} [callback] The callback function to invoke when the event is triggered. If `callback` is not provided, the previous callback will be re-activated. - * @param {object} [context] An object to use as `this` when invoking the `callback`. - * @chainable - */ - on(thenCallback: Function, context?: any): DurandalEventSubscription; - - /** - * Cancels the subscription. - * @chainable - */ - off(): DurandalEventSubscription; -} - -interface DurandalEventSupport { - /** - * Creates a subscription or registers a callback for the specified event. - * @param {string} events One or more events, separated by white space. - * @returns {Subscription} A subscription is returned. - */ - on(events: string): DurandalEventSubscription; - - /** - * Creates a subscription or registers a callback for the specified event. - * @param {string} events One or more events, separated by white space. - * @param {function} [callback] The callback function to invoke when the event is triggered. - * @param {object} [context] An object to use as `this` when invoking the `callback`. - * @returns {Events} The events object is returned for chaining. - */ - on(events: string, callback: Function, context?: any): T; - - /** - * Removes the callbacks for the specified events. - * @param {string} [events] One or more events, separated by white space to turn off. If no events are specified, then the callbacks will be removed. - * @param {function} [callback] The callback function to remove. If `callback` is not provided, all callbacks for the specified events will be removed. - * @param {object} [context] The object that was used as `this`. Callbacks with this context will be removed. - * @chainable - */ - off(events: string, callback: Function, context?: any): T; - - /** - * Triggers the specified events. - * @param {string} [events] One or more events, separated by white space to trigger. - * @chainable - */ - trigger(events: string, ...eventArgs: any[]): T; - - /** - * Creates a function that will trigger the specified events when called. Simplifies proxying jQuery (or other) events through to the events object. - * @param {string} events One or more events, separated by white space to trigger by invoking the returned function. - * @returns {function} Calling the function will invoke the previously specified events on the events object. - */ - proxy(events: string): Function; -} - -interface DurandalEventModule { - new (): DurandalEventSupport; - includeIn(targetObject: any): void; -} - -interface DurandalAppModule extends DurandalEventSupport { - /** - * The title of your application. - */ - title: string; - - /** - * Shows a dialog via the dialog plugin. - * @param {object|string} obj The object (or moduleId) to display as a dialog. - * @param {object} [activationData] The data that should be passed to the object upon activation. - * @param {string} [context] The name of the dialog context to use. Uses the default context if none is specified. - * @returns {Promise} A promise that resolves when the dialog is closed and returns any data passed at the time of closing. - */ - showDialog(obj: any, activationData?: any, context?: string): JQueryPromise; - - /** - * Shows a message box via the dialog plugin. - * @param {string} message The message to display in the dialog. - * @param {string} [title] The title message. - * @param {string[]} [options] The options to provide to the user. - * @returns {Promise} A promise that resolves when the message box is closed and returns the selected option. - */ - showMessage(message: string, title?: string, options?: string[]): JQueryPromise; - - /** - * Configures one or more plugins to be loaded and installed into the application. - * @method configurePlugins - * @param {object} config Keys are plugin names. Values can be truthy, to simply install the plugin, or a configuration object to pass to the plugin. - * @param {string} [baseUrl] The base url to load the plugins from. - */ - configurePlugins(config: Object, baseUrl?: string): void; - - /** - * Starts the application. - * @returns {promise} - */ - start(): JQueryPromise; - - /** - * Sets the root module/view for the application. - * @param {string} root The root view or module. - * @param {string} [transition] The transition to use from the previous root (or splash screen) into the new root. - * @param {string} [applicationHost] The application host element id. By default the id 'applicationHost' will be used. - */ - setRoot(root: any, transition?: string, applicationHost?: string): void; - - /** - * Sets the root module/view for the application. - * @param {string} root The root view or module. - * @param {string} [transition] The transition to use from the previous root (or splash screen) into the new root. - * @param {string} [applicationHost] The application host element. By default the id 'applicationHost' will be used. - */ - setRoot(root: any, transition?: string, applicationHost?: HTMLElement): void; -} - -interface DurandalActivatorSettings { - /** - * The default value passed to an object's deactivate function as its close parameter. - * @default true - */ - closeOnDeactivate: boolean; - - /** - * Lower-cased words which represent a truthy value. - * @default ['yes', 'ok', 'true'] - */ - affirmations: string[]; - - /** - * Interprets the response of a `canActivate` or `canDeactivate` call using the known affirmative values in the `affirmations` array. - * @param {object} value - * @returns {boolean} - */ - interpretResponse(value: any): boolean; - - /** - * Determines whether or not the current item and the new item are the same. - * @param {object} currentItem - * @param {object} newItem - * @param {object} currentActivationData - * @param {object} newActivationData - * @returns {boolean} - */ - areSameItem(currentItem: any, newItem: any, currentActivationData: any, newActivationData: any): boolean; - - /** - * Called immediately before the new item is activated. - * @param {object} newItem - */ - beforeActivate(newItem: any): any; - - /** - * Called immediately after the old item is deactivated. - * @param {object} oldItem The previous item. - * @param {boolean} close Whether or not the previous item was closed. - * @param {function} setter The activate item setter function. - */ - afterDeactivate(oldItem: any, close: boolean, setter: Function): void; -} - -interface DurandalActivator extends KnockoutComputed { - /** - * The settings for this activator. - */ - settings: DurandalActivatorSettings; - - /** - * An observable which indicates whether or not the activator is currently in the process of activating an instance. - * @returns {boolean} - */ - isActivating: KnockoutObservable; - - /** - * Determines whether or not the specified item can be deactivated. - * @param {object} item The item to check. - * @param {boolean} close Whether or not to check if close is possible. - * @returns {promise} - */ - canDeactivateItem(item: T, close: boolean): JQueryPromise; - - /** - * Deactivates the specified item. - * @param {object} item The item to deactivate. - * @param {boolean} close Whether or not to close the item. - * @returns {promise} - */ - deactivateItem(item: T, close: boolean): JQueryPromise; - - /** - * Determines whether or not the specified item can be activated. - * @param {object} item The item to check. - * @param {object} activationData Data associated with the activation. - * @returns {promise} - */ - canActivateItem(newItem: T, activationData?: any): JQueryPromise; - - /** - * Activates the specified item. - * @param {object} newItem The item to activate. - * @param {object} newActivationData Data associated with the activation. - * @returns {promise} - */ - activateItem(newItem: T, activationData?: any): JQueryPromise; - - /** - * Determines whether or not the activator, in its current state, can be activated. - * @returns {promise} - */ - canActivate(): JQueryPromise; - - /** - * Activates the activator, in its current state. - * @returns {promise} - */ - activate(): JQueryPromise; - - /** - * Determines whether or not the activator, in its current state, can be deactivated. - * @returns {promise} - */ - canDeactivate(close: boolean): JQueryPromise; - - /** - * Deactivates the activator, in its current state. - * @returns {promise} - */ - deactivate(close: boolean): JQueryPromise; - - /** - * Adds canActivate, activate, canDeactivate and deactivate functions to the provided model which pass through to the corresponding functions on the activator. - */ - includeIn(includeIn: any): void; - - /** - * Sets up a collection representing a pool of objects which the activator will activate. See below for details. Activators without an item bool always close their values on deactivate. Activators with an items pool only deactivate, but do not close them. - */ - forItems(items): DurandalActivator; -} - -interface DurandalHistoryOptions { - /** - * The function that will be called back when the fragment changes. - */ - routeHandler?: (fragment: string) => void; - - /** - * The url root used to extract the fragment when using push state. - */ - root?: string; - - /** - * Use hash change when present. - * @default true - */ - hashChange?: boolean; - - /** - * Use push state when present. - * @default false - */ - pushState?: boolean; - - /** - * Prevents loading of the current url when activating history. - * @default false - */ - silent?: boolean; -} - -interface DurandalNavigationOptions { - trigger: boolean; - replace: boolean; -} - -interface DurandalRouteConfiguration { - title?: string; - moduleId?: string; - hash?: string; - route?: string; - routePattern?: RegExp; - isActive?: KnockoutComputed; - nav: any; -} - -interface DurandalRouteInstruction { - fragment: string; - queryString: string; - config: DurandalRouteConfiguration; - params: any[]; - queryParams: Object; -} - -interface DurandalRelativeRouteSettings { - moduleId?: string; - route?: string; - fromParent?: boolean; -} - -interface DurandalRouterBase extends DurandalEventSupport { - /** - * The route handlers that are registered. Each handler consists of a `routePattern` and a `callback`. - */ - handlers: { routePattern: RegExp; callback: (fragment: string) => void; }[]; - - /** - * The route configs that are registered. - */ - routes: DurandalRouteConfiguration[]; - - /** - * The active item/screen based on the current navigation state. - */ - activeItem: DurandalActivator; - - /** - * The route configurations that have been designated as displayable in a nav ui (nav:true). - */ - navigationModel: KnockoutObservableArray; - - /** - * Indicates that the router (or a child router) is currently in the process of navigating. - */ - isNavigating: KnockoutComputed; - - /** - * An observable surfacing the active routing instruction that is currently being processed or has recently finished processing. - * The instruction object has `config`, `fragment`, `queryString`, `params` and `queryParams` properties. - */ - activeInstruction: KnockoutObservable; - - /** - * Parses a query string into an object. - * @param {string} queryString The query string to parse. - * @returns {object} An object keyed according to the query string parameters. - */ - parseQueryString(queryString: string): Object; - - /** - * Add a route to be tested when the url fragment changes. - * @param {RegEx} routePattern The route pattern to test against. - * @param {function} callback The callback to execute when the route pattern is matched. - */ - route(routePattern: RegExp, callback: (fragment: string) => void): void; - - /** - * Attempt to load the specified URL fragment. If a route succeeds with a match, returns `true`. If no defined routes matches the fragment, returns `false`. - * @param {string} fragment The URL fragment to find a match for. - * @returns {boolean} True if a match was found, false otherwise. - */ - loadUrl(fragment: string): boolean; - - /** - * Updates the document title based on the activated module instance, the routing instruction and the app.title. - * @param {object} instance The activated module. - * @param {object} instruction The routing instruction associated with the action. It has a `config` property that references the original route mapping config. - */ - updateDocumentTitle(instance: Object, instruction: DurandalRouteInstruction): void; - - /** - * Save a fragment into the hash history, or replace the URL state if the - * 'replace' option is passed. You are responsible for properly URL-encoding - * the fragment in advance. - * The options object can contain `trigger: false` if you wish to not have the - * route callback be fired, or `replace: true`, if - * you wish to modify the current URL without adding an entry to the history. - * @param {string} fragment The url fragment to navigate to. - * @param {object|boolean} options An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is `true` by default. - * @return {boolean} Returns true/false from loading the url. - */ - navigate(fragment: string, trigger?: boolean): boolean; - - /** - * Save a fragment into the hash history, or replace the URL state if the - * 'replace' option is passed. You are responsible for properly URL-encoding - * the fragment in advance. - * The options object can contain `trigger: false` if you wish to not have the - * route callback be fired, or `replace: true`, if - * you wish to modify the current URL without adding an entry to the history. - * @param {string} fragment The url fragment to navigate to. - * @param {object|boolean} options An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is `true` by default. - * @return {boolean} Returns true/false from loading the url. - */ - navigate(fragment: string, options: DurandalNavigationOptions): boolean; - - /** - * Navigates back in the browser history. - */ - navigateBack(): void; - - /** - * Converts a route to a hash suitable for binding to a link's href. - * @param {string} route - * @returns {string} The hash. - */ - convertRouteToHash(route: string): string; - - /** - * Converts a route to a module id. This is only called if no module id is supplied as part of the route mapping. - * @param {string} route - * @returns {string} The module id. - */ - convertRouteToModuleId(route: string): string; - - /** - * Converts a route to a displayable title. This is only called if no title is specified as part of the route mapping. - * @method convertRouteToTitle - * @param {string} route - * @returns {string} The title. - */ - convertRouteToTitle(route: string): string; - - /** - * Maps route patterns to modules. - * @param {string} route A route. - * @chainable - */ - map(route: string): T; - - /** - * Maps route patterns to modules. - * @param {string} route A route pattern. - * @param {string} moduleId The module id to map the route to. - * @chainable - */ - map(route: string, moduleId: string): T; - - /** - * Maps route patterns to modules. - * @param {RegExp} route A route pattern. - * @param {string} moduleId The module id to map the route to. - * @chainable - */ - map(route: RegExp, moduleId: string): T; - - /** - * Maps route patterns to modules. - * @param {string} route A route pattern. - * @param {RouteConfiguration} config The route's configuration. - * @chainable - */ - map(route: string, config: DurandalRouteConfiguration): T; - - /** - * Maps route patterns to modules. - * @method map - * @param {RegExp} route A route pattern. - * @param {RouteConfiguration} config The route's configuration. - * @chainable - */ - map(route: RegExp, config: DurandalRouteConfiguration): T; - - /** - * Maps route patterns to modules. - * @param {RouteConfiguration} config The route's configuration. - * @chainable - */ - map(config: DurandalRouteConfiguration): T; - - /** - * Maps route patterns to modules. - * @param {RouteConfiguration[]} configs An array of route configurations. - * @chainable - */ - map(configs: DurandalRouteConfiguration[]): T; - - /** - * Builds an observable array designed to bind a navigation UI to. The model will exist in the `navigationModel` property. - * @param {number} defaultOrder The default order to use for navigation visible routes that don't specify an order. The defualt is 100. - * @chainable - */ - buildNavigationModel(defaultOrder?: number): T; - - /** - * Configures the router to map unknown routes to modules at the same path. - * @chainable - */ - mapUnknownRoutes(): T; - - /** - * Configures the router use the specified module id for all unknown routes. - * @param {string} notFoundModuleId Represents the module id to route all unknown routes to. - * @param {string} [replaceRoute] Optionally provide a route to replace the url with. - * @chainable - */ - mapUnknownRoutes(notFoundModuleId: string, replaceRoute?: string): T; - - /** - * Configures how the router will handle unknown routes. - * @param {function} callback Called back with the route instruction containing the route info. The function can then modify the instruction by adding a moduleId and the router will take over from there. - * @chainable - */ - mapUnknownRoutes(callback: (instruction: DurandalRouteInstruction) => void): T; - - /** - * Configures how the router will handle unknown routes. - * @param {RouteConfiguration} config The route configuration to use for unknown routes. - * @chainable - */ - mapUnknownRoutes(config: DurandalRouteConfiguration): T; - - /** - * Resets the router by removing handlers, routes, event handlers and previously configured options. - * @chainable - */ - reset(): T; - - /** - * Makes all configured routes and/or module ids relative to a certain base url. - * @param {string} settings The value is used as the base for routes and module ids. - * @chainable - */ - makeRelative(settings: string): T; - - /** - * Makes all configured routes and/or module ids relative to a certain base url. - * @param {RelativeRouteSettings} settings If an object, you can specify `route` and `moduleId` separately. In place of specifying route, you can set `fromParent:true` to make routes automatically relative to the parent router's active route. - * @chainable - */ - makeRelative(settings: DurandalRelativeRouteSettings): T; - - /** - * Creates a child router. - * @returns {Router} The child router. - */ - createChildRouter(): T; - - /** - * Inspects routes and modules before activation. Can be used to protect access by cancelling navigation or redirecting. - * @param {object} instance The module instance that is about to be activated by the router. - * @param {object} instruction The route instruction. The instruction object has config, fragment, queryString, params and queryParams properties. - * @returns {Promise|Boolean|String} If a boolean, determines whether or not the route should activate or be cancelled. If a string, causes a redirect to the specified route. Can also be a promise for either of these value types. - */ - guardRoute?: (instance: Object, instruction: DurandalRouteInstruction) => any; -} - -interface DurandalRouter extends DurandalRouterBase { } - -interface DurandalRootRouter extends DurandalRouterBase { - /** - * Activates the router and the underlying history tracking mechanism. - * @returns {Promise} A promise that resolves when the router is ready. - */ - activate(options?: DurandalHistoryOptions): JQueryPromise; - - /** - * Disable history, perhaps temporarily. Not useful in a real app, but possibly useful for unit testing Routers. - */ - deactivate(): void; - - /** - * Installs the router's custom ko binding handler. - */ - install(): void; -} +// Type definitions for Durandal 2.1.0 +// Project: http://durandaljs.com +// Definitions by: Blue Spire +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * Durandal 2.1.0 Copyright (c) 2012 Blue Spire Consulting, Inc. All Rights Reserved. + * Available via the MIT license. + * see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details. + */ + +/// +/// + +/** + * The system module encapsulates the most basic features used by other modules. + * @requires require + * @requires jquery + */ +declare module 'durandal/system' { + var theModule: DurandalSystemModule; + export = theModule; +} + +interface DurandalSystemModule { + /** + * Durandal's version. + */ + version: string; + + /** + * A noop function. + */ + noop: Function; + + /** + * Gets the module id for the specified object. + * @param {object} obj The object whose module id you wish to determine. + * @returns {string} The module id. + */ + getModuleId(obj: any): string; + + /** + * Sets the module id for the specified object. + * @param {object} obj The object whose module id you wish to set. + * @param {string} id The id to set for the specified object. + */ + setModuleId(obj, id: string): void; + + /** + * Resolves the default object instance for a module. If the module is an object, the module is returned. If the module is a function, that function is called with `new` and it's result is returned. + * @param {object} module The module to use to get/create the default object for. + * @returns {object} The default object for the module. + */ + resolveObject(module: any): any; + + /** + * Gets/Sets whether or not Durandal is in debug mode. + * @param {boolean} [enable] Turns on/off debugging. + * @returns {boolean} Whether or not Durandal is current debugging. + */ + debug(enable?: boolean): boolean; + + /** + * Logs data to the console. Pass any number of parameters to be logged. Log output is not processed if the framework is not running in debug mode. + * @param {object} info* The objects to log. + */ + log(...msgs: any[]): void; + + /** + * Logs an error. + * @param {string} obj The error to report. + */ + error(error: string): void; + + /** + * Logs an error. + * @param {Error} obj The error to report. + */ + error(error: Error): void; + + /** + * Asserts a condition by throwing an error if the condition fails. + * @param {boolean} condition The condition to check. + * @param {string} message The message to report in the error if the condition check fails. + */ + assert(condition: boolean, message: string): void; + + /** + * Creates a deferred object which can be used to create a promise. Optionally pass a function action to perform which will be passed an object used in resolving the promise. + * @param {function} [action] The action to defer. You will be passed the deferred object as a paramter. + * @returns {JQueryDeferred} The deferred object. + */ + defer(action?: (dfd: JQueryDeferred) => void): JQueryDeferred; + + /** + * Creates a simple V4 UUID. This should not be used as a PK in your database. It can be used to generate internal, unique ids. For a more robust solution see [node-uuid](https://github.com/broofa/node-uuid). + * @returns {string} The guid. + */ + guid(): string; + + /** + * Uses require.js to obtain a module. This function returns a promise which resolves with the module instance. + * @param {string} moduleId The id of the module to load. + * @returns {JQueryPromise} A promise for the loaded module. + */ + acquire(moduleId: string): JQueryPromise; + + /** + * Uses require.js to obtain an array of modules. This function returns a promise which resolves with the modules instances in an array. + * @param {string[]} moduleIds The ids of the modules to load. + * @returns {JQueryPromise} A promise for the loaded module. + */ + acquire(modules: string[]): JQueryPromise; + + /** + * Uses require.js to obtain multiple modules. This function returns a promise which resolves with the module instances in an array. + * @param {string} moduleIds* The ids of the modules to load. + * @returns {JQueryPromise} A promise for the loaded module. + */ + acquire(...moduleIds: string[]): JQueryPromise; + + /** + * Extends the first object with the properties of the following objects. + * @param {object} obj The target object to extend. + * @param {object} extension* Uses to extend the target object. + */ + extend(obj: any, ...extensions: any[]): any; + + /** + * Uses a setTimeout to wait the specified milliseconds. + * @param {number} milliseconds The number of milliseconds to wait. + * @returns {JQueryPromise} + */ + wait(milliseconds: number): JQueryPromise; + + /** + * Gets all the owned keys of the specified object. + * @param {object} object The object whose owned keys should be returned. + * @returns {string[]} The keys. + */ + keys(obj: any): string[]; + + /** + * Determines if the specified object is an html element. + * @param {object} object The object to check. + * @returns {boolean} True if matches the type, false otherwise. + */ + isElement(obj: any): boolean; + + /** + * Determines if the specified object is an array. + * @param {object} object The object to check. + * @returns {boolean} True if matches the type, false otherwise. + */ + isArray(obj: any): boolean; + + /** + * Determines if the specified object is a boolean. + * @param {object} object The object to check. + * @returns {boolean} True if matches the type, false otherwise. + */ + isObject(obj: any): boolean; + + /** + * Determines if the specified object is a promise. + * @param {object} object The object to check. + * @returns {boolean} True if matches the type, false otherwise. + */ + isPromise(obj: any): boolean; + + /** + * Determines if the specified object is a function arguments object. + * @param {object} object The object to check. + * @returns {boolean} True if matches the type, false otherwise. + */ + isArguments(obj: any): boolean; + + /** + * Determines if the specified object is a function. + * @param {object} object The object to check. + * @returns {boolean} True if matches the type, false otherwise. + */ + isFunction(obj: any): boolean; + + /** + * Determines if the specified object is a string. + * @param {object} object The object to check. + * @returns {boolean} True if matches the type, false otherwise. + */ + isString(obj: any): boolean; + + /** + * Determines if the specified object is a number. + * @param {object} object The object to check. + * @returns {boolean} True if matches the type, false otherwise. + */ + isNumber(obj: any): boolean; + + /** + * Determines if the specified object is a date. + * @param {object} object The object to check. + * @returns {boolean} True if matches the type, false otherwise. + */ + isDate(obj: any): boolean; + + /** + * Determines if the specified object is a boolean. + * @param {object} object The object to check. + * @returns {boolean} True if matches the type, false otherwise. + */ + isBoolean(obj: any): boolean; +} + +/** + * The viewEngine module provides information to the viewLocator module which is used to locate the view's source file. The viewEngine also transforms a view id into a view instance. + * @requires system + * @requires jquery + */ +declare module 'durandal/viewEngine' { + var theModule: DurandalViewEngineModule; + export = theModule; +} + +interface DurandalViewEngineModule { + /** + * The file extension that view source files are expected to have. + * @default .html + */ + viewExtension: string; + + /** + * The name of the RequireJS loader plugin used by the viewLocator to obtain the view source. (Use requirejs to map the plugin's full path). + * @default text + */ + viewPlugin: string; + + /** + * Parameters passed to the RequireJS loader plugin used by the viewLocator to obtain the view source. + * @default The empty string by default. + */ + viewPluginParameters: string; + + /** + * Determines if the url is a url for a view, according to the view engine. + * @param {string} url The potential view url. + * @returns {boolean} True if the url is a view url, false otherwise. + */ + isViewUrl(url: string): boolean; + + /** + * Converts a view url into a view id. + * @param {string} url The url to convert. + * @returns {string} The view id. + */ + convertViewUrlToViewId(url: string): string; + + /** + * Converts a view id into a full RequireJS path. + * @param {string} viewId The view id to convert. + * @returns {string} The require path. + */ + convertViewIdToRequirePath(viewId: string): string; + + /** + * Parses the view engine recognized markup and returns DOM elements. + * @param {string} markup The markup to parse. + * @returns {HTMLElement[]} The elements. + */ + parseMarkup(markup: string): Node[]; + + /** + * Calls `parseMarkup` and then pipes the results through `ensureSingleElement`. + * @param {string} markup The markup to process. + * @returns {HTMLElement} The view. + */ + processMarkup(markup: string): HTMLElement; + + /** + * Converts an array of elements into a single element. White space and comments are removed. If a single element does not remain, then the elements are wrapped. + * @param {HTMLElement[]} allElements The elements. + * @returns {HTMLElement} A single element. + */ + ensureSingleElement(allElements: Node[]): HTMLElement; + + /** + * Gets the view associated with the id from the cache of parsed views. + * @param {string} id The view id to lookup in the cache. + * @return {DOMElement|null} The cached view or null if it's not in the cache. + */ + tryGetViewFromCache(id: string): HTMLElement; + + /** + * Puts the view associated with the id into the cache of parsed views. + * @param {string} id The view id whose view should be cached. + * @param {DOMElement} view The view to cache. + */ + putViewInCache(id:string, view:HTMLElement); + + /** + * Creates the view associated with the view id. + * @param {string} viewId The view id whose view should be created. + * @returns {JQueryPromise} A promise of the view. + */ + createView(viewId: string): JQueryPromise; + + /** + * Called when a view cannot be found to provide the opportunity to locate or generate a fallback view. Mainly used to ease development. + * @param {string} viewId The view id whose view should be created. + * @param {string} requirePath The require path that was attempted. + * @param {Error} requirePath The error that was returned from the attempt to locate the default view. + * @returns {Promise} A promise for the fallback view. + */ + createFallbackView(viewId: string, requirePath: string, err: Error): JQueryPromise; +} + +/** + * Durandal events originate from backbone.js but also combine some ideas from signals.js as well as some additional improvements. + * Events can be installed into any object and are installed into the `app` module by default for convenient app-wide eventing. + * @requires system + */ +declare module 'durandal/events' { + var theModule: DurandalEventModule; + export = theModule; +} + +/** + * The binder joins an object instance and a DOM element tree by applying databinding and/or invoking binding lifecycle callbacks (binding and bindingComplete). + * @requires system + * @requires knockout + */ +declare module 'durandal/binder' { + interface BindingInstruction { + applyBindings: boolean; + } + + /** + * Called before every binding operation. Does nothing by default. + * @param {object} data The data that is about to be bound. + * @param {DOMElement} view The view that is about to be bound. + * @param {object} instruction The object that carries the binding instructions. + */ + export var binding: (data: any, view: HTMLElement, instruction: BindingInstruction) => void; + + /** + * Called after every binding operation. Does nothing by default. + * @param {object} data The data that has just been bound. + * @param {DOMElement} view The view that has just been bound. + * @param {object} instruction The object that carries the binding instructions. + */ + export var bindingComplete: (data: any, view: HTMLElement, instruction: BindingInstruction) => void; + + /** + * Indicates whether or not the binding system should throw errors or not. + * @default false The binding system will not throw errors by default. Instead it will log them. + */ + export var throwOnErrors: boolean; + + /** + * Gets the binding instruction that was associated with a view when it was bound. + * @param {DOMElement} view The view that was previously bound. + * @returns {object} The object that carries the binding instructions. + */ + export function getBindingInstruction(view: HTMLElement): BindingInstruction; + + /** + * Binds the view, preserving the existing binding context. Optionally, a new context can be created, parented to the previous context. + * @param {KnockoutBindingContext} bindingContext The current binding context. + * @param {DOMElement} view The view to bind. + * @param {object} [obj] The data to bind to, causing the creation of a child binding context if present. + * @param {string} [dataAlias] An alias for $data if present. + */ + export function bindContext(bindingContext: KnockoutBindingContext, view: HTMLElement, obj?: any, dataAlias?: string): BindingInstruction; + + /** + * Binds the view, preserving the existing binding context. Optionally, a new context can be created, parented to the previous context. + * @param {object} obj The data to bind to. + * @param {DOMElement} view The view to bind. + */ + export function bind(obj: any, view: HTMLElement): BindingInstruction; +} + +/** + * The activator module encapsulates all logic related to screen/component activation. + * An activator is essentially an asynchronous state machine that understands a particular state transition protocol. + * The protocol ensures that the following series of events always occur: `canDeactivate` (previous state), `canActivate` (new state), `deactivate` (previous state), `activate` (new state). + * Each of the _can_ callbacks may return a boolean, affirmative value or promise for one of those. If either of the _can_ functions yields a false result, then activation halts. + * @requires system + * @requires knockout + */ +declare module 'durandal/activator' { + /** + * The default settings used by activators. + * @property {ActivatorSettings} defaults + */ + export var defaults: DurandalActivatorSettings; + + /** + * Creates a new activator. + * @method create + * @param {object} [initialActiveItem] The item which should be immediately activated upon creation of the ativator. + * @param {ActivatorSettings} [settings] Per activator overrides of the default activator settings. + * @returns {Activator} The created activator. + */ + export function create(initialActiveItem?: T, settings?: DurandalActivatorSettings): DurandalActivator; + + /** + * Determines whether or not the provided object is an activator or not. + * @method isActivator + * @param {object} object Any object you wish to verify as an activator or not. + * @returns {boolean} True if the object is an activator; false otherwise. + */ + export function isActivator(object: any): boolean; +} + +/** + * The viewLocator module collaborates with the viewEngine module to provide views (literally dom sub-trees) to other parts of the framework as needed. The primary consumer of the viewLocator is the composition module. + * @requires system + * @requires viewEngine + */ +declare module 'durandal/viewLocator' { + var theModule: DurandalViewLocatorModule; + export = theModule; +} + +interface DurandalViewLocatorModule { + /** + * Allows you to set up a convention for mapping module folders to view folders. It is a convenience method that customizes `convertModuleIdToViewId` and `translateViewIdToArea` under the covers. + * @param {string} [modulesPath] A string to match in the path and replace with the viewsPath. If not specified, the match is 'viewmodels'. + * @param {string} [viewsPath] The replacement for the modulesPath. If not specified, the replacement is 'views'. + * @param {string} [areasPath] Partial views are mapped to the "views" folder if not specified. Use this parameter to change their location. + */ + useConvention(modulesPath?: string, viewsPath?: string, areasPath?: string): void; + + /** + * Maps an object instance to a view instance. + * @param {object} obj The object to locate the view for. + * @param {string} [area] The area to translate the view to. + * @param {DOMElement[]} [elementsToSearch] An existing set of elements to search first. + * @returns {Promise} A promise of the view. + */ + locateViewForObject(obj: any, area: string, elementsToSearch?: HTMLElement[]): JQueryPromise; + + /** + * Converts a module id into a view id. By default the ids are the same. + * @param {string} moduleId The module id. + * @returns {string} The view id. + */ + convertModuleIdToViewId(moduleId: string): string; + + /** + * If no view id can be determined, this function is called to genreate one. By default it attempts to determine the object's type and use that. + * @param {object} obj The object to determine the fallback id for. + * @returns {string} The view id. + */ + determineFallbackViewId(obj: any): string; + + /** + * Takes a view id and translates it into a particular area. By default, no translation occurs. + * @param {string} viewId The view id. + * @param {string} area The area to translate the view to. + * @returns {string} The translated view id. + */ + translateViewIdToArea(viewId: string, area: string): string; + + /** + * Locates the specified view. + * @param {string|DOMElement} view A view. It will be immediately returned. + * @param {string} [area] The area to translate the view to. + * @param {DOMElement[]} [elementsToSearch] An existing set of elements to search first. + * @returns {Promise} A promise of the view. + */ + locateView(view: HTMLElement, area?: string, elementsToSearch?: HTMLElement[]): JQueryPromise; + + /** + * Locates the specified view. + * @param {string|DOMElement} viewUrlOrId A view url or view id to locate. + * @param {string} [area] The area to translate the view to. + * @param {DOMElement[]} [elementsToSearch] An existing set of elements to search first. + * @returns {Promise} A promise of the view. + */ + locateView(viewUrlOrId: string, area?: string, elementsToSearch?: HTMLElement[]): JQueryPromise; +} + +/** + * The composition module encapsulates all functionality related to visual composition. + * @requires system + * @requires viewLocator + * @requires binder + * @requires viewEngine + * @requires activator + * @requires jquery + * @requires knockout + */ +declare module 'durandal/composition' { + interface CompositionTransation { + /** + * Registers a callback which will be invoked when the current composition transaction has completed. The transaction includes all parent and children compositions. + * @param {function} callback The callback to be invoked when composition is complete. + */ + complete(callback: Function): void; + } + + interface CompositionContext { + mode: string; + parent: HTMLElement; + activeView: HTMLElement; + triggerAttach(): void; + bindingContext?: KnockoutBindingContext; + cacheViews?: boolean; + viewElements?: HTMLElement[]; + model?: any; + view?: any; + area?: string; + preserveContext?: boolean; + activate?: boolean; + strategy?: (context: CompositionContext) => JQueryPromise; + composingNewView: boolean; + child: HTMLElement; + binding?: (child: HTMLElement, parent: HTMLElement, context: CompositionContext) => void; + attached?: (child: HTMLElement, parent: HTMLElement, context: CompositionContext) => void; + compositionComplete?: (child: HTMLElement, parent: HTMLElement, context: CompositionContext) => void; + transition?: string; + } + + /** + * Converts a transition name to its moduleId. + * @param {string} name The name of the transtion. + * @returns {string} The moduleId. + */ + export function convertTransitionToModuleId(name: string): string; + + /** + * The name of the transition to use in all compositions. + * @default null + */ + export var defaultTransitionName: string; + + /** + * Represents the currently executing composition transaction. + */ + export var current: CompositionTransation; + + /** + * Registers a binding handler that will be invoked when the current composition transaction is complete. + * @param {string} name The name of the binding handler. + * @param {object} [config] The binding handler instance. If none is provided, the name will be used to look up an existing handler which will then be converted to a composition handler. + * @param {function} [initOptionsFactory] If the registered binding needs to return options from its init call back to knockout, this function will server as a factory for those options. It will receive the same parameters that the init function does. + */ + export function addBindingHandler(name, config?: KnockoutBindingHandler, initOptionsFactory?: (element?: HTMLElement, valueAccessor?: any, allBindingsAccessor?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => any); + + /** + * Gets an object keyed with all the elements that are replacable parts, found within the supplied elements. The key will be the part name and the value will be the element itself. + * @param {DOMElement[]} elements The elements to search for parts. + * @returns {object} An object keyed by part. + */ + export function getParts(elements: HTMLElement[]): any; + + /** + * Gets an object keyed with all the elements that are replacable parts, found within the supplied element. The key will be the part name and the value will be the element itself. + * @param {DOMElement} element The element to search for parts. + * @returns {object} An object keyed by part. + */ + export function getParts(element: HTMLElement): any; + + /** + * Eecutes the default view location strategy. + * @param {object} context The composition context containing the model and possibly existing viewElements. + * @returns {promise} A promise for the view. + */ + export var defaultStrategy: (context: CompositionContext) => JQueryPromise; + + /** + * Initiates a composition. + * @param {DOMElement} element The DOMElement or knockout virtual element that serves as the parent for the composition. + * @param {object} settings The composition settings. + * @param {object} [bindingContext] The current binding context. + */ + export function compose(element: HTMLElement, settings: CompositionContext, bindingContext: KnockoutBindingContext): void; +} + +/** + * The app module controls app startup, plugin loading/configuration and root visual display. + * @requires system + * @requires viewEngine + * @requires composition + * @requires events + * @requires jquery + */ +declare module 'durandal/app' { + var theModule: DurandalAppModule; + export = theModule; +} + +/** + * The dialog module enables the display of message boxes, custom modal dialogs and other overlays or slide-out UI abstractions. Dialogs are constructed by the composition system which interacts with a user defined dialog context. The dialog module enforced the activator lifecycle. + * @requires system + * @requires app + * @requires composition + * @requires activator + * @requires viewEngine + * @requires jquery + * @requires knockout + */ +declare module 'plugins/dialog' { + import composition = require('durandal/composition'); + + /** + * Models a message box's message, title and options. + * @class + */ + class Box { + constructor(message: string, title?: string, options?: string[], autoclose?: boolean, settings?: Object); + + /** + * Selects an option and closes the message box, returning the selected option through the dialog system's promise. + * @param {string} dialogResult The result to select. + */ + selectOption(dialogResult: string): void; + + /** + * Provides the view to the composition system. + * @returns {DOMElement} The view of the message box. + */ + getView(): HTMLElement; + + /** + * Configures a custom view to use when displaying message boxes. + * @method setViewUrl + * @param {string} viewUrl The view url relative to the base url which the view locator will use to find the message box's view. + */ + static setViewUrl(viewUrl: string): void; + + /** + * The title to be used for the message box if one is not provided. + * @default Application + * @static + */ + static defaultTitle: string; + + /** + * The options to display in the message box if none are specified. + * @default ['Ok'] + * @static + */ + static defaultOptions: string[]; + + /** + * Sets the classes and styles used throughout the message box markup. + * @method setDefaults + * @param {object} settings A settings object containing the following optional properties: buttonClass, primaryButtonClass, secondaryButtonClass, class, style. + */ + static setDefaults(settings: Object): void; + + /** + * The markup for the message box's view. + */ + static defaultViewMarkup: string; + } + + interface DialogContext { + /** + * In this function, you are expected to add a DOM element to the tree which will serve as the "host" for the modal's composed view. You must add a property called host to the modalWindow object which references the dom element. It is this host which is passed to the composition module. + * @param {Dialog} theDialog The dialog model. + */ + addHost(theDialog: Dialog); + + /** + * This function is expected to remove any DOM machinery associated with the specified dialog and do any other necessary cleanup. + * @param {Dialog} theDialog The dialog model. + */ + removeHost(theDialog: Dialog); + + /** + * This function is called after the modal is fully composed into the DOM, allowing your implementation to do any final modifications, such as positioning or animation. You can obtain the original dialog object by using `getDialog` on context.model. + * @param {DOMElement} child The dialog view. + * @param {DOMElement} parent The parent view. + * @param {object} context The composition context. + */ + compositionComplete(child: HTMLElement, parent: HTMLElement, context: composition.CompositionContext); + } + + interface Dialog { + owner: any; + context: DialogContext; + activator: DurandalActivator; + close(): JQueryPromise; + settings: composition.CompositionContext; + } + + /** + * The constructor function used to create message boxes. + */ + export var MessageBox: Box; + + /** + * The css zIndex that the last dialog was displayed at. + */ + export var currentZIndex: number; + + /** + * Gets the next css zIndex at which a dialog should be displayed. + * @returns {number} The next usable zIndex. + */ + export function getNextZIndex(): number; + + /** + * Determines whether or not there are any dialogs open. + * @returns {boolean} True if a dialog is open. false otherwise. + */ + export function isOpen(): boolean; + + /** + * Gets the dialog context by name or returns the default context if no name is specified. + * @param {string} [name] The name of the context to retrieve. + * @returns {DialogContext} True context. + */ + export function getContext(name: string): DialogContext; + + /** + * Adds (or replaces) a dialog context. + * @param {string} name The name of the context to add. + * @param {DialogContext} dialogContext The context to add. + */ + export function addContext(name: string, modalContext: DialogContext): void; + + /** + * Gets the dialog model that is associated with the specified object. + * @param {object} obj The object for whom to retrieve the dialog. + * @returns {Dialog} The dialog model. + */ + export function getDialog(obj: any): Dialog; + + /** + * Closes the dialog associated with the specified object. + * @param {object} obj The object whose dialog should be closed. + * @param {object} results* The results to return back to the dialog caller after closing. + */ + export function close(obj: any, ...results: any[]): void; + + /** + * Shows a dialog. + * @param {object|string} obj The object (or moduleId) to display as a dialog. + * @param {object} [activationData] The data that should be passed to the object upon activation. + * @param {string} [context] The name of the dialog context to use. Uses the default context if none is specified. + * @returns {Promise} A promise that resolves when the dialog is closed and returns any data passed at the time of closing. + */ + export function show(obj: any, activationData?: any, context?: string): JQueryPromise; + + /** + * Shows a message box. + * @param {string} message The message to display in the dialog. + * @param {string} [title] The title message. + * @param {string[]} [options] The options to provide to the user. + * @param {boolean} [autoclose] Automatically close the the message box when clicking outside? + * @param {Object} [settings] Custom settings for this instance of the messsage box, used to change classes and styles. + * @returns {Promise} A promise that resolves when the message box is closed and returns the selected option. + */ + export function showMessage(message: string, title?: string, options?: string[], autoclose?: boolean, settings?: Object): JQueryPromise; + + /** + * Shows a message box. + * @param {string} message The message to display in the dialog. + * @param {string} [title] The title message. + * @param {DialogButton[]} [options] The options to provide to the user. + * @param {boolean} [autoclose] Automatically close the the message box when clicking outside? + * @param {Object} [settings] Custom settings for this instance of the messsage box, used to change classes and styles. + * @returns {Promise} A promise that resolves when the message box is closed and returns the selected option. + */ + export function showMessage(message: string, title?: string, options?: DialogButton[], autoclose?: boolean, settings?: Object): JQueryPromise; + + /** + * Installs this module into Durandal; called by the framework. Adds `app.showDialog` and `app.showMessage` convenience methods. + * @param {object} [config] Add a `messageBox` property to supply a custom message box constructor. Add a `messageBoxView` property to supply custom view markup for the built-in message box. You can also use messageBoxViewUrl to specify the view url. + */ + export function install(config: Object): void; +} + +/** + * This module is based on Backbone's core history support. It abstracts away the low level details of working with browser history and url changes in order to provide a solid foundation for a router. + * @requires system + * @requires jquery + */ +declare module 'plugins/history' { + /** + * The setTimeout interval used when the browser does not support hash change events. + * @default 50 + */ + export var interval: number; + + /** + * Indicates whether or not the history module is actively tracking history. + */ + export var active: boolean; + + /** + * Gets the true hash value. Cannot use location.hash directly due to a bug in Firefox where location.hash will always be decoded. + * @param {string} [window] The optional window instance + * @returns {string} The hash. + */ + export function getHash(window?: Window): string; + + /** + * Get the cross-browser normalized URL fragment, either from the URL, the hash, or the override. + * @param {string} fragment The fragment. + * @param {boolean} forcePushState Should we force push state? + * @returns {string} he fragment. + */ + export function getFragment(fragment: string, forcePushState: boolean): string; + + /** + * Activate the hash change handling, returning `true` if the current URL matches an existing route, and `false` otherwise. + * @param {HistoryOptions} options. + * @returns {boolean|undefined} Returns true/false from loading the url unless the silent option was selected. + */ + export function activate(options: DurandalHistoryOptions): boolean; + + /** + * Disable history, perhaps temporarily. Not useful in a real app, but possibly useful for unit testing Routers. + */ + export function deactivate(): void; + + /** + * Checks the current URL to see if it has changed, and if it has, calls `loadUrl`, normalizing across the hidden iframe. + * @returns {boolean} Returns true/false from loading the url. + */ + export function checkUrl(): boolean; + + /** + * Attempts to load the current URL fragment. A pass-through to options.routeHandler. + * @returns {boolean} Returns true/false from the route handler. + */ + export function loadUrl(): boolean; + + /** + * Save a fragment into the hash history, or replace the URL state if the + * 'replace' option is passed. You are responsible for properly URL-encoding + * the fragment in advance. + * The options object can contain `trigger: false` if you wish to not have the + * route callback be fired, or `replace: true`, if + * you wish to modify the current URL without adding an entry to the history. + * @param {string} fragment The url fragment to navigate to. + * @param {object|boolean} options An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is `true` by default. + * @return {boolean} Returns true/false from loading the url. + */ + export function navigate(fragment: string, trigger?: boolean): boolean; + + /** + * Save a fragment into the hash history, or replace the URL state if the + * 'replace' option is passed. You are responsible for properly URL-encoding + * the fragment in advance. + * The options object can contain `trigger: false` if you wish to not have the + * route callback be fired, or `replace: true`, if + * you wish to modify the current URL without adding an entry to the history. + * @param {string} fragment The url fragment to navigate to. + * @param {object|boolean} options An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is `true` by default. + * @return {boolean} Returns true/false from loading the url. + */ + export function navigate(fragment: string, options: DurandalNavigationOptions): boolean; + + /** + * Navigates back in the browser history. + */ + export function navigateBack(): void; +} + +/** + * Enables common http request scenarios. + * @requires jquery + * @requires knockout + */ +declare module 'plugins/http' { + /** + * The name of the callback parameter to inject into jsonp requests by default. + * @default callback + */ + export var callbackParam: string; + + /** + * Converts the data to JSON. + * @param {object} data The data to convert to JSON. + * @return {string} JSON. + */ + export function toJSON(data: Object): string; + + /** + * Makes an HTTP GET request. + * @param {string} url The url to send the get request to. + * @param {object} [query] An optional key/value object to transform into query string parameters. + * @param {object} [headers] The data to add to the request header. It will be converted to JSON. If the data contains Knockout observables, they will be converted into normal properties before serialization. + * @returns {Promise} A promise of the get response data. + */ + export function get(url: string, query?: Object, headers?: Object): JQueryPromise; + + /** + * Makes an JSONP request. + * @param {string} url The url to send the get request to. + * @param {object} [query] An optional key/value object to transform into query string parameters. + * @param {string} [callbackParam] The name of the callback parameter the api expects (overrides the default callbackParam). + * @param {object} [headers] The data to add to the request header. It will be converted to JSON. If the data contains Knockout observables, they will be converted into normal properties before serialization. + * @returns {Promise} A promise of the response data. + */ + export function jsonp(url: string, query?: Object, callbackParam?: string, headers?: Object): JQueryPromise; + + /** + * Makes an HTTP POST request. + * @param {string} url The url to send the post request to. + * @param {object} data The data to post. It will be converted to JSON. If the data contains Knockout observables, they will be converted into normal properties before serialization. + * @param {object} [headers] The data to add to the request header. It will be converted to JSON. If the data contains Knockout observables, they will be converted into normal properties before serialization. + * @returns {Promise} A promise of the response data. + */ + export function post(url: string, data: Object, headers?: Object): JQueryPromise; + + /** + * Makes an HTTP PUT request. + * @method put + * @param {string} url The url to send the put request to. + * @param {object} data The data to put. It will be converted to JSON. If the data contains Knockout observables, they will be converted into normal properties before serialization. + * @param {object} [headers] The data to add to the request header. It will be converted to JSON. If the data contains Knockout observables, they will be converted into normal properties before serialization. + * @return {Promise} A promise of the response data. + */ + export function put(url: string, data: Object, headers?: Object): JQueryPromise; + + /** + * Makes an HTTP DELETE request. + * @method remove + * @param {string} url The url to send the delete request to. + * @param {object} [query] An optional key/value object to transform into query string parameters. + * @param {object} [headers] The data to add to the request header. It will be converted to JSON. If the data contains Knockout observables, they will be converted into normal properties before serialization. + * @return {Promise} A promise of the get response data. + */ + export function remove(url: string, query?: Object, headers?: Object): JQueryPromise; +} + +/** + * Enables automatic observability of plain javascript object for ES5 compatible browsers. Also, converts promise properties into observables that are updated when the promise resolves. + * @requires system + * @requires binder + * @requires knockout + */ +declare module 'plugins/observable' { + function observable(obj: any, property: string): KnockoutObservable; + + module observable { + /** + * Converts an entire object into an observable object by re-writing its attributes using ES5 getters and setters. Attributes beginning with '_' or '$' are ignored. + * @param {object} obj The target object to convert. + */ + export function convertObject(obj: any): void; + + /** + * Converts a normal property into an observable property using ES5 getters and setters. + * @param {object} obj The target object on which the property to convert lives. + * @param {string} propertyName The name of the property to convert. + * @param {object} [original] The original value of the property. If not specified, it will be retrieved from the object. + * @returns {KnockoutObservable} The underlying observable. + */ + export function convertProperty(obj: any, propertyName: string, original?: any): KnockoutObservable; + + /** + * Defines a computed property using ES5 getters and setters. + * @param {object} obj The target object on which to create the property. + * @param {string} propertyName The name of the property to define. + * @param {function|object} evaluatorOrOptions The Knockout computed function or computed options object. + * @returns {KnockoutComputed} The underlying computed observable. + */ + export function defineProperty(obj: any, propertyName: string, evaluatorOrOptions?: KnockoutComputedDefine); + + /** + * Installs the plugin into the view model binder's `beforeBind` hook so that objects are automatically converted before being bound. + */ + export function install(config: Object): void; + } + + export = observable; +} + +/** + * Serializes and deserializes data to/from JSON. + * @requires system + */ +declare module 'plugins/serializer' { + interface SerializerOptions { + /** + * The default replacer function used during serialization. By default properties starting with '_' or '$' are removed from the serialized object. + * @param {string} key The object key to check. + * @param {object} value The object value to check. + * @returns {object} The value to serialize. + */ + replacer?: (key: string, value: any) => any; + + /** + * The amount of space to use for indentation when writing out JSON. + * @default undefined + */ + space: any; + } + + interface DeserializerOptions { + /** + * Gets the type id for an object instance, using the configured `typeAttribute`. + * @param {object} object The object to serialize. + * @returns {string} The type. + */ + getTypeId: (object: any) => string; + + /** + * Gets the constructor based on the type id. + * @param {string} typeId The type id. + * @returns {Function} The constructor. + */ + getConstructor: (typeId: string) => () => any; + + /** + * The default reviver function used during deserialization. By default is detects type properties on objects and uses them to re-construct the correct object using the provided constructor mapping. + * @param {string} key The attribute key. + * @param {object} value The object value associated with the key. + * @returns {object} The value. + */ + reviver: (key: string, value: any) => any; + } + + /** + * The name of the attribute that the serializer should use to identify an object's type. + * @default type + */ + export var typeAttribute: string; + + /** + * The amount of space to use for indentation when writing out JSON. + * @default undefined + */ + export var space: any; + + /** + * The default replacer function used during serialization. By default properties starting with '_' or '$' are removed from the serialized object. + * @param {string} key The object key to check. + * @param {object} value The object value to check. + * @returns {object} The value to serialize. + */ + export function replacer(key: string, value: any): any; + + /** + * Serializes the object. + * @param {object} object The object to serialize. + * @param {object} [settings] Settings can specify a replacer or space to override the serializer defaults. + * @returns {string} The JSON string. + */ + export function serialize(object: any, settings?: string); + + /** + * Serializes the object. + * @param {object} object The object to serialize. + * @param {object} [settings] Settings can specify a replacer or space to override the serializer defaults. + * @returns {string} The JSON string. + */ + export function serialize(object: any, settings?: number); + + /** + * Serializes the object. + * @param {object} object The object to serialize. + * @param {object} [settings] Settings can specify a replacer or space to override the serializer defaults. + * @returns {string} The JSON string. + */ + export function serialize(object: any, settings?: SerializerOptions); + + /** + * Gets the type id for an object instance, using the configured `typeAttribute`. + * @param {object} object The object to serialize. + * @returns {string} The type. + */ + export function getTypeId(object: any): string; + + /** + * Maps type ids to object constructor functions. Keys are type ids and values are functions. + */ + export var typeMap: any; + + /** + * Adds a type id/constructor function mampping to the `typeMap`. + * @param {string} typeId The type id. + * @param {function} constructor The constructor. + */ + export function registerType(typeId: string, constructor: () => any); + + /** + * The default reviver function used during deserialization. By default is detects type properties on objects and uses them to re-construct the correct object using the provided constructor mapping. + * @param {string} key The attribute key. + * @param {object} value The object value associated with the key. + * @param {function} getTypeId A custom function used to get the type id from a value. + * @param {object} getConstructor A custom function used to get the constructor function associated with a type id. + * @returns {object} The value. + */ + export function reviver(key: string, value: any, getTypeId: (value: any) => string, getConstructor: (string) => () => any): any; + + /** + * Deserialize the JSON. + * @param {text} text The JSON string. + * @param {DeserializerOptions} settings Settings can specify a reviver, getTypeId function or getConstructor function. + * @returns {object} The deserialized object. + */ + export function deserialize(text: string, settings?: DeserializerOptions): T; + + /** + * Clone the object. + * @param {object} obj The object to clone. + * @param {object} [settings] Settings can specify any of the options allowed by the serialize or deserialize methods. + * @return {object} The new clone. + */ + export function clone(obj:T, settings?:Object): T; +} + +/** + * Layers the widget sugar on top of the composition system. + * @requires system + * @requires composition + * @requires jquery + * @requires knockout + */ +declare module 'plugins/widget' { + interface WidgetSettings { + kind: string; + model?: any; + view?: any; + } + + /** + * Creates a ko binding handler for the specified kind. + * @param {string} kind The kind to create a custom binding handler for. + */ + export function registerKind(kind: string); + + /** + * Maps views and module to the kind identifier if a non-standard pattern is desired. + * @param {string} kind The kind name. + * @param {string} [viewId] The unconventional view id to map the kind to. + * @param {string} [moduleId] The unconventional module id to map the kind to. + */ + export function mapKind(kind: string, viewId?: string, moduleId?: string); + + /** + * Maps a kind name to it's module id. First it looks up a custom mapped kind, then falls back to `convertKindToModulePath`. + * @param {string} kind The kind name. + * @returns {string} The module id. + */ + export function mapKindToModuleId(kind: string): string; + + /** + * Converts a kind name to it's module path. Used to conventionally map kinds who aren't explicitly mapped through `mapKind`. + * @param {string} kind The kind name. + * @returns {string} The module path. + */ + export function convertKindToModulePath(kind: string): string; + + /** + * Maps a kind name to it's view id. First it looks up a custom mapped kind, then falls back to `convertKindToViewPath`. + * @param {string} kind The kind name. + * @returns {string} The view id. + */ + export function mapKindToViewId(kind: string): string; + + /** + * Converts a kind name to it's view id. Used to conventionally map kinds who aren't explicitly mapped through `mapKind`. + * @param {string} kind The kind name. + * @returns {string} The view id. + */ + export function convertKindToViewPath(kind: string): string; + + /** + * Creates a widget. + * @param {DOMElement} element The DOMElement or knockout virtual element that serves as the target element for the widget. + * @param {object} settings The widget settings. + * @param {object} [bindingContext] The current binding context. + */ + export function create(element: HTMLElement, settings: WidgetSettings, bindingContext?: KnockoutBindingContext); +} + +/** + * Connects the history module's url and history tracking support to Durandal's activation and composition engine allowing you to easily build navigation-style applications. + * @requires system + * @requires app + * @requires activator + * @requires events + * @requires composition + * @requires history + * @requires knockout + * @requires jquery + */ +declare module 'plugins/router' { + var theModule: DurandalRootRouter; + export = theModule; +} + +interface DurandalEventSubscription { + /** + * Attaches a callback to the event subscription. + * @param {function} callback The callback function to invoke when the event is triggered. + * @param {object} [context] An object to use as `this` when invoking the `callback`. + * @chainable + */ + then(thenCallback: Function, context?: any): DurandalEventSubscription; + + /** + * Attaches a callback to the event subscription. + * @param {function} [callback] The callback function to invoke when the event is triggered. If `callback` is not provided, the previous callback will be re-activated. + * @param {object} [context] An object to use as `this` when invoking the `callback`. + * @chainable + */ + on(thenCallback: Function, context?: any): DurandalEventSubscription; + + /** + * Cancels the subscription. + * @chainable + */ + off(): DurandalEventSubscription; +} + +interface DurandalEventSupport { + /** + * Creates a subscription or registers a callback for the specified event. + * @param {string} events One or more events, separated by white space. + * @returns {Subscription} A subscription is returned. + */ + on(events: string): DurandalEventSubscription; + + /** + * Creates a subscription or registers a callback for the specified event. + * @param {string} events One or more events, separated by white space. + * @param {function} [callback] The callback function to invoke when the event is triggered. + * @param {object} [context] An object to use as `this` when invoking the `callback`. + * @returns {Events} The events object is returned for chaining. + */ + on(events: string, callback: Function, context?: any): T; + + /** + * Removes the callbacks for the specified events. + * @param {string} [events] One or more events, separated by white space to turn off. If no events are specified, then the callbacks will be removed. + * @param {function} [callback] The callback function to remove. If `callback` is not provided, all callbacks for the specified events will be removed. + * @param {object} [context] The object that was used as `this`. Callbacks with this context will be removed. + * @chainable + */ + off(events: string, callback: Function, context?: any): T; + + /** + * Triggers the specified events. + * @param {string} [events] One or more events, separated by white space to trigger. + * @chainable + */ + trigger(events: string, ...eventArgs: any[]): T; + + /** + * Creates a function that will trigger the specified events when called. Simplifies proxying jQuery (or other) events through to the events object. + * @param {string} events One or more events, separated by white space to trigger by invoking the returned function. + * @returns {function} Calling the function will invoke the previously specified events on the events object. + */ + proxy(events: string): Function; +} + +interface DurandalEventModule { + new (): DurandalEventSupport; + includeIn(targetObject: any): void; +} + +interface DialogButton { + text: string; + value: any; +} + +interface DurandalAppModule extends DurandalEventSupport { + /** + * The title of your application. + */ + title: string; + + /** + * Shows a dialog via the dialog plugin. + * @param {object|string} obj The object (or moduleId) to display as a dialog. + * @param {object} [activationData] The data that should be passed to the object upon activation. + * @param {string} [context] The name of the dialog context to use. Uses the default context if none is specified. + * @returns {Promise} A promise that resolves when the dialog is closed and returns any data passed at the time of closing. + */ + showDialog(obj: any, activationData?: any, context?: string): JQueryPromise; + + /** + * Closes the dialog associated with the specified object. via the dialog plugin. + * @param {object} obj The object whose dialog should be closed. + * @param {object} results* The results to return back to the dialog caller after closing. + */ + closeDialog(obj: any, ...results); + + /** + * Shows a message box via the dialog plugin. + * @param {string} message The message to display in the dialog. + * @param {string} [title] The title message. + * @param {string[]} [options] The options to provide to the user. + * @param {boolean} [autoclose] Automatically close the the message box when clicking outside? + * @param {Object} [settings] Custom settings for this instance of the messsage box, used to change classes and styles. + * @returns {Promise} A promise that resolves when the message box is closed and returns the selected option. + */ + showMessage(message: string, title?: string, options?: string[], autoclose?: boolean, settings?: Object): JQueryPromise; + + /** + * Shows a message box. + * @param {string} message The message to display in the dialog. + * @param {string} [title] The title message. + * @param {DialogButton[]} [options] The options to provide to the user. + * @param {boolean} [autoclose] Automatically close the the message box when clicking outside? + * @param {Object} [settings] Custom settings for this instance of the messsage box, used to change classes and styles. + * @returns {Promise} A promise that resolves when the message box is closed and returns the selected option. + */ + showMessage(message: string, title?: string, options?: DialogButton[], autoclose?: boolean, settings?: Object): JQueryPromise; + + /** + * Configures one or more plugins to be loaded and installed into the application. + * @method configurePlugins + * @param {object} config Keys are plugin names. Values can be truthy, to simply install the plugin, or a configuration object to pass to the plugin. + * @param {string} [baseUrl] The base url to load the plugins from. + */ + configurePlugins(config: Object, baseUrl?: string): void; + + /** + * Starts the application. + * @returns {promise} + */ + start(): JQueryPromise; + + /** + * Sets the root module/view for the application. + * @param {string} root The root view or module. + * @param {string} [transition] The transition to use from the previous root (or splash screen) into the new root. + * @param {string} [applicationHost] The application host element id. By default the id 'applicationHost' will be used. + */ + setRoot(root: any, transition?: string, applicationHost?: string): void; + + /** + * Sets the root module/view for the application. + * @param {string} root The root view or module. + * @param {string} [transition] The transition to use from the previous root (or splash screen) into the new root. + * @param {string} [applicationHost] The application host element. By default the id 'applicationHost' will be used. + */ + setRoot(root: any, transition?: string, applicationHost?: HTMLElement): void; +} + +interface DurandalActivatorSettings { + /** + * The default value passed to an object's deactivate function as its close parameter. + * @default true + */ + closeOnDeactivate: boolean; + + /** + * Lower-cased words which represent a truthy value. + * @default ['yes', 'ok', 'true'] + */ + affirmations: string[]; + + /** + * Interprets the response of a `canActivate` or `canDeactivate` call using the known affirmative values in the `affirmations` array. + * @param {object} value + * @returns {boolean} + */ + interpretResponse(value: any): boolean; + + /** + * Determines whether or not the current item and the new item are the same. + * @param {object} currentItem + * @param {object} newItem + * @param {object} currentActivationData + * @param {object} newActivationData + * @returns {boolean} + */ + areSameItem(currentItem: any, newItem: any, currentActivationData: any, newActivationData: any): boolean; + + /** + * Called immediately before the new item is activated. + * @param {object} newItem + */ + beforeActivate(newItem: any): any; + + /** + * Called immediately after the old item is deactivated. + * @param {object} oldItem The previous item. + * @param {boolean} close Whether or not the previous item was closed. + * @param {function} setter The activate item setter function. + */ + afterDeactivate(oldItem: any, close: boolean, setter: Function): void; +} + +interface DurandalActivator extends KnockoutComputed { + /** + * The settings for this activator. + */ + settings: DurandalActivatorSettings; + + /** + * An observable which indicates whether or not the activator is currently in the process of activating an instance. + * @returns {boolean} + */ + isActivating: KnockoutObservable; + + /** + * Determines whether or not the specified item can be deactivated. + * @param {object} item The item to check. + * @param {boolean} close Whether or not to check if close is possible. + * @returns {promise} + */ + canDeactivateItem(item: T, close: boolean): JQueryPromise; + + /** + * Deactivates the specified item. + * @param {object} item The item to deactivate. + * @param {boolean} close Whether or not to close the item. + * @returns {promise} + */ + deactivateItem(item: T, close: boolean): JQueryPromise; + + /** + * Determines whether or not the specified item can be activated. + * @param {object} item The item to check. + * @param {object} activationData Data associated with the activation. + * @returns {promise} + */ + canActivateItem(newItem: T, activationData?: any): JQueryPromise; + + /** + * Activates the specified item. + * @param {object} newItem The item to activate. + * @param {object} newActivationData Data associated with the activation. + * @returns {promise} + */ + activateItem(newItem: T, activationData?: any): JQueryPromise; + + /** + * Determines whether or not the activator, in its current state, can be activated. + * @returns {promise} + */ + canActivate(): JQueryPromise; + + /** + * Activates the activator, in its current state. + * @returns {promise} + */ + activate(): JQueryPromise; + + /** + * Determines whether or not the activator, in its current state, can be deactivated. + * @returns {promise} + */ + canDeactivate(close: boolean): JQueryPromise; + + /** + * Deactivates the activator, in its current state. + * @returns {promise} + */ + deactivate(close: boolean): JQueryPromise; + + /** + * Adds canActivate, activate, canDeactivate and deactivate functions to the provided model which pass through to the corresponding functions on the activator. + */ + includeIn(includeIn: any): void; + + /** + * Sets up a collection representing a pool of objects which the activator will activate. See below for details. Activators without an item bool always close their values on deactivate. Activators with an items pool only deactivate, but do not close them. + */ + forItems(items): DurandalActivator; +} + +interface DurandalHistoryOptions { + /** + * The function that will be called back when the fragment changes. + */ + routeHandler?: (fragment: string) => void; + + /** + * The url root used to extract the fragment when using push state. + */ + root?: string; + + /** + * Use hash change when present. + * @default true + */ + hashChange?: boolean; + + /** + * Use push state when present. + * @default false + */ + pushState?: boolean; + + /** + * Prevents loading of the current url when activating history. + * @default false + */ + silent?: boolean; + + /** + * Override default history init behavior by navigating directly to this route. + */ + startRoute?: string; +} + +interface DurandalNavigationOptions { + trigger: boolean; + replace: boolean; +} + +interface DurandalRouteConfiguration { + title?: any; + moduleId?: string; + hash?: string; + /** string or string[] */ + route?: any; + routePattern?: RegExp; + isActive?: KnockoutComputed; + nav?: any; + hasChildRoutes?: boolean; + viewUrl?:string; +} + +interface DurandalRouteInstruction { + fragment: string; + queryString: string; + config: DurandalRouteConfiguration; + params: any[]; + queryParams: Object; +} + +interface DurandalRelativeRouteSettings { + moduleId?: string; + route?: string; + fromParent?: boolean; +} + +interface DurandalRouterBase extends DurandalEventSupport { + /** + * The route handlers that are registered. Each handler consists of a `routePattern` and a `callback`. + */ + handlers: { routePattern: RegExp; callback: (fragment: string) => void; }[]; + + /** + * The route configs that are registered. + */ + routes: DurandalRouteConfiguration[]; + + /** + * The active item/screen based on the current navigation state. + */ + activeItem: DurandalActivator; + + /** + * The route configurations that have been designated as displayable in a nav ui (nav:true). + */ + navigationModel: KnockoutObservableArray; + + /** + * Indicates that the router (or a child router) is currently in the process of navigating. + */ + isNavigating: KnockoutComputed; + + /** + * An observable surfacing the active routing instruction that is currently being processed or has recently finished processing. + * The instruction object has `config`, `fragment`, `queryString`, `params` and `queryParams` properties. + */ + activeInstruction: KnockoutObservable; + + /** + * Parses a query string into an object. + * @param {string} queryString The query string to parse. + * @returns {object} An object keyed according to the query string parameters. + */ + parseQueryString(queryString: string): Object; + + /** + * Add a route to be tested when the url fragment changes. + * @param {RegEx} routePattern The route pattern to test against. + * @param {function} callback The callback to execute when the route pattern is matched. + */ + route(routePattern: RegExp, callback: (fragment: string) => void): void; + + /** + * Attempt to load the specified URL fragment. If a route succeeds with a match, returns `true`. If no defined routes matches the fragment, returns `false`. + * @param {string} fragment The URL fragment to find a match for. + * @returns {boolean} True if a match was found, false otherwise. + */ + loadUrl(fragment: string): boolean; + + /** + * Updates the document title based on the activated module instance, the routing instruction and the app.title. + * @param {object} instance The activated module. + * @param {object} instruction The routing instruction associated with the action. It has a `config` property that references the original route mapping config. + */ + updateDocumentTitle(instance: Object, instruction: DurandalRouteInstruction): void; + + /** + * Save a fragment into the hash history, or replace the URL state if the + * 'replace' option is passed. You are responsible for properly URL-encoding + * the fragment in advance. + * The options object can contain `trigger: false` if you wish to not have the + * route callback be fired, or `replace: true`, if + * you wish to modify the current URL without adding an entry to the history. + * @param {string} fragment The url fragment to navigate to. + * @param {object|boolean} options An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is `true` by default. + * @return {boolean} Returns true/false from loading the url. + */ + navigate(fragment: string, trigger?: boolean): boolean; + + /** + * Save a fragment into the hash history, or replace the URL state if the + * 'replace' option is passed. You are responsible for properly URL-encoding + * the fragment in advance. + * The options object can contain `trigger: false` if you wish to not have the + * route callback be fired, or `replace: true`, if + * you wish to modify the current URL without adding an entry to the history. + * @param {string} fragment The url fragment to navigate to. + * @param {object|boolean} options An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is `true` by default. + * @return {boolean} Returns true/false from loading the url. + */ + navigate(fragment: string, options: DurandalNavigationOptions): boolean; + + /** + * Navigates back in the browser history. + */ + navigateBack(): void; + + /** + * Converts a route to a hash suitable for binding to a link's href. + * @param {string} route + * @returns {string} The hash. + */ + convertRouteToHash(route: string): string; + + /** + * Converts a route to a module id. This is only called if no module id is supplied as part of the route mapping. + * @param {string} route + * @returns {string} The module id. + */ + convertRouteToModuleId(route: string): string; + + /** + * Converts a route to a displayable title. This is only called if no title is specified as part of the route mapping. + * @method convertRouteToTitle + * @param {string} route + * @returns {string} The title. + */ + convertRouteToTitle(route: string): string; + + /** + * Maps route patterns to modules. + * @param {string} route A route. + * @chainable + */ + map(route: string): T; + + /** + * Maps route patterns to modules. + * @param {string} route A route pattern. + * @param {string} moduleId The module id to map the route to. + * @chainable + */ + map(route: string, moduleId: string): T; + + /** + * Maps route patterns to modules. + * @param {RegExp} route A route pattern. + * @param {string} moduleId The module id to map the route to. + * @chainable + */ + map(route: RegExp, moduleId: string): T; + + /** + * Maps route patterns to modules. + * @param {string} route A route pattern. + * @param {RouteConfiguration} config The route's configuration. + * @chainable + */ + map(route: string, config: DurandalRouteConfiguration): T; + + /** + * Maps route patterns to modules. + * @method map + * @param {RegExp} route A route pattern. + * @param {RouteConfiguration} config The route's configuration. + * @chainable + */ + map(route: RegExp, config: DurandalRouteConfiguration): T; + + /** + * Maps route patterns to modules. + * @param {RouteConfiguration} config The route's configuration. + * @chainable + */ + map(config: DurandalRouteConfiguration): T; + + /** + * Maps route patterns to modules. + * @param {RouteConfiguration[]} configs An array of route configurations. + * @chainable + */ + map(configs: DurandalRouteConfiguration[]): T; + + /** + * Builds an observable array designed to bind a navigation UI to. The model will exist in the `navigationModel` property. + * @param {number} defaultOrder The default order to use for navigation visible routes that don't specify an order. The defualt is 100. + * @chainable + */ + buildNavigationModel(defaultOrder?: number): T; + + /** + * Configures the router to map unknown routes to modules at the same path. + * @chainable + */ + mapUnknownRoutes(): T; + + /** + * Configures the router use the specified module id for all unknown routes. + * @param {string} notFoundModuleId Represents the module id to route all unknown routes to. + * @param {string} [replaceRoute] Optionally provide a route to replace the url with. + * @chainable + */ + mapUnknownRoutes(notFoundModuleId: string, replaceRoute?: string): T; + + /** + * Configures how the router will handle unknown routes. + * @param {function} callback Called back with the route instruction containing the route info. The function can then modify the instruction by adding a moduleId and the router will take over from there. + * @chainable + */ + mapUnknownRoutes(callback: (instruction: DurandalRouteInstruction) => void): T; + + /** + * Configures how the router will handle unknown routes. + * @param {RouteConfiguration} config The route configuration to use for unknown routes. + * @chainable + */ + mapUnknownRoutes(config: DurandalRouteConfiguration): T; + + /** + * Resets the router by removing handlers, routes, event handlers and previously configured options. + * @chainable + */ + reset(): T; + + /** + * Makes all configured routes and/or module ids relative to a certain base url. + * @param {string} settings The value is used as the base for routes and module ids. + * @chainable + */ + makeRelative(settings: string): T; + + /** + * Makes all configured routes and/or module ids relative to a certain base url. + * @param {RelativeRouteSettings} settings If an object, you can specify `route` and `moduleId` separately. In place of specifying route, you can set `fromParent:true` to make routes automatically relative to the parent router's active route. + * @chainable + */ + makeRelative(settings: DurandalRelativeRouteSettings): T; + + /** + * Creates a child router. + * @returns {Router} The child router. + */ + createChildRouter(): T; + + /** + * Inspects routes and modules before activation. Can be used to protect access by cancelling navigation or redirecting. + * @param {object} instance The module instance that is about to be activated by the router. + * @param {object} instruction The route instruction. The instruction object has config, fragment, queryString, params and queryParams properties. + * @returns {Promise|Boolean|String} If a boolean, determines whether or not the route should activate or be cancelled. If a string, causes a redirect to the specified route. Can also be a promise for either of these value types. + */ + guardRoute?: (instance: Object, instruction: DurandalRouteInstruction) => any; +} + +interface DurandalRouter extends DurandalRouterBase { } + +interface DurandalRootRouter extends DurandalRouterBase { + /** + * Makes the RegExp generated for routes case sensitive, rather than the default of case insensitive. + */ + makeRoutesCaseSensitive(): void; + + /** + * Activates the router and the underlying history tracking mechanism. + * @returns {Promise} A promise that resolves when the router is ready. + */ + activate(options?: DurandalHistoryOptions): JQueryPromise; + + /** + * Disable history, perhaps temporarily. Not useful in a real app, but possibly useful for unit testing Routers. + */ + deactivate(): void; + + /** + * Installs the router's custom ko binding handler. + */ + install(): void; +} \ No newline at end of file diff --git a/easy-table/easy-table-tests.ts b/easy-table/easy-table-tests.ts new file mode 100644 index 000000000..732426064 --- /dev/null +++ b/easy-table/easy-table-tests.ts @@ -0,0 +1,15 @@ +/// + +import EasyTable = require('easy-table'); + +var table = new EasyTable(); + +table.cell('aa', 1); +table.cell('bb',1); +table.newRow(); + +table.cell('aa', 1); +table.cell('bb',1); + +table.print(); + diff --git a/easy-table/easy-table.d.ts b/easy-table/easy-table.d.ts new file mode 100644 index 000000000..912b089ce --- /dev/null +++ b/easy-table/easy-table.d.ts @@ -0,0 +1,41 @@ +// Type definitions for easy-table 0.2.0 +// Project: https://github.com/eldargab/easy-table +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "easy-table" { + class EasyTable { + constructor(); + + cell(label: string, value: any, printer?: EasyTable.CellPrinter, width?: number):void; + newRow(): void; + toString(): string; + printTransposed(): string; + print(): string; + sort(fields: string): void; + sort(comparer: (a: any, b: any) => number): void; + total(label: string, accumulator: EasyTable.Accumulator, totalPrinter: EasyTable.CellPrinter): void; + } + + module EasyTable { + function printArray(array: any[], cellPrinter?: CellPrinter, tablePrinter?: Printer): string; + function printObject(object: any, cellPrinter?: CellPrinter, tablePrinter?: Printer): string; + + //printer helpers + function Number(length: number): CellPrinter; + function RightPadder(char: string): CellPrinter; + function LeftPadder(char: string): CellPrinter; + + interface CellPrinter extends Function { + (obj: any, cell: (label: string, value: any, width?: number) => void):string; + } + interface Printer extends Function { + (table: EasyTable):string; + } + interface Accumulator extends Function { + (sum: number, val: number, index: number, length: number):number; + } + } + + export = EasyTable; +} diff --git a/expect.js/expect.js.d.ts b/expect.js/expect.js.d.ts index 64c5871b0..8e5cfe142 100644 --- a/expect.js/expect.js.d.ts +++ b/expect.js/expect.js.d.ts @@ -1,7 +1,7 @@ // Type definitions for expect.js 0.2.0 // Project: https://github.com/LearnBoost/expect.js // Definitions by: Teppei Sato -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped declare function expect(target?: any): Expect.Root; @@ -17,7 +17,7 @@ declare module Expect { * * @param fn callback to match error string against */ - throwError(fn?: (exception: any) => void): void; + throwError(fn?: (exception: any) => void): void; /** * Assert that the function throws. diff --git a/expectations/expectations.d.ts b/expectations/expectations.d.ts index 4b02e1c0c..8e2750583 100644 --- a/expectations/expectations.d.ts +++ b/expectations/expectations.d.ts @@ -1,7 +1,7 @@ // Type definitions for expectations.js 0.2.5 // Project: https://github.com/spmason/expectations // Definitions by: vvakame -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped declare var expect:Expectations.IExpectations; @@ -57,4 +57,4 @@ declare module Expectations { fail(why?:string, what?:any):any; } -} \ No newline at end of file +} diff --git a/express-validator/express-validator.d.ts b/express-validator/express-validator.d.ts index 5a1ba31b7..b18b17e96 100644 --- a/express-validator/express-validator.d.ts +++ b/express-validator/express-validator.d.ts @@ -1,7 +1,7 @@ // Type definitions for express-validator // Project: https://github.com/ctavan/express-validator // Definitions by: Nathan Ridley -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped declare module ExpressValidator { export interface ValidationError { diff --git a/express/express.d.ts b/express/express.d.ts index eafc4c596..40be7e4ec 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -1,7 +1,7 @@ // Type definitions for Express 3.1 // Project: http://expressjs.com // Definitions by: Boris Yankov -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /* =================== USAGE =================== diff --git a/fabricjs/fabricjs.d.ts b/fabricjs/fabricjs.d.ts index 813782047..eec70c8f6 100644 --- a/fabricjs/fabricjs.d.ts +++ b/fabricjs/fabricjs.d.ts @@ -1,7 +1,7 @@ // Type definitions for FabricJS // Project: http://fabricjs.com/ // Definitions by: Oliver Klemencic -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped declare module fabric { diff --git a/filesystem/filesystem.d.ts b/filesystem/filesystem.d.ts index 11fb48dd0..8b20b113c 100644 --- a/filesystem/filesystem.d.ts +++ b/filesystem/filesystem.d.ts @@ -1,4 +1,4 @@ -// Type Definitions for File System API +// Type definitions for File System API // Project: http://www.w3.org/TR/file-system-api/ // Definitions by: Kon // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/filewriter/filewriter.d.ts b/filewriter/filewriter.d.ts index f0d958afa..a4910d0b1 100644 --- a/filewriter/filewriter.d.ts +++ b/filewriter/filewriter.d.ts @@ -1,4 +1,4 @@ -// Type Definitions for File API: Writer +// Type definitions for File API: Writer // Project: http://www.w3.org/TR/file-writer-api/ // Definitions by: Kon // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/flight/flight-tests.ts b/flight/flight-tests.ts index 1bfe68d3a..9c66fa8b4 100644 --- a/flight/flight-tests.ts +++ b/flight/flight-tests.ts @@ -4,8 +4,12 @@ declare var els: Element[]; declare var mixinFn: Function; function TestComponent() { - var self: Flight.Component = this; - + var self: Flight.Component = this; + + self.attributes({ + fooSelector: '.bar' + }); + self.defaultAttrs({ fooSelector: '.bar' }); @@ -14,7 +18,7 @@ function TestComponent() { var el: HTMLElement = data.el; self.select('fooSelector').addClass('bar'); }; - + self.around('initialize', function () { }); self.before('initialize', function () { }); self.after("initialize", function () { diff --git a/flight/flight.d.ts b/flight/flight.d.ts index 19c8528df..3a831f1d9 100644 --- a/flight/flight.d.ts +++ b/flight/flight.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Flight 1.1.1 +// Type definitions for Flight 1.1.4 // Project: http://flightjs.github.com/flight/ // Definitions by: Jonathan Hedrén // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -9,10 +9,25 @@ declare module Flight { export interface Base { + /** + * Most Components and Mixins need to define attributes. In Flight, + * default values are assigned by passing an object to the attributes + * function. + * + * NOTE: this.attributes replaces the now deprecated this.defaultAttrs. + * However, for backwards compatibility, if you are using this.defaultAttrs + * then all the old attribute behavior remains in place. + */ + attributes(obj: Object): void; + /** * Most Components and Mixins need to define attributes. In Flight, * default values are assigned by passing an object to the defaultAttrs * function. + * + * NOTE: this.attributes replaces the now deprecated this.defaultAttrs. + * However, for backwards compatibility, if you are using this.defaultAttrs + * then all the old attribute behavior remains in place. */ defaultAttrs(obj: Object): void; @@ -181,7 +196,6 @@ declare module Flight { $node: JQuery; } - export interface AdviceStatic { withAdvice(): Function; } diff --git a/flipsnap/flipsnap-tests.ts b/flipsnap/flipsnap-tests.ts new file mode 100644 index 000000000..a6b2f4fe8 --- /dev/null +++ b/flipsnap/flipsnap-tests.ts @@ -0,0 +1,13 @@ +/** + * Created by kubosho_ on 6/16/2014. + */ +/// + +Flipsnap('', { + maxPoint: 3, + distance: 230, + transitionDuration: 500, + disableTouch: true, + disable3d: false +}); + diff --git a/flipsnap/flipsnap.d.ts b/flipsnap/flipsnap.d.ts new file mode 100644 index 000000000..55e601704 --- /dev/null +++ b/flipsnap/flipsnap.d.ts @@ -0,0 +1,93 @@ +// Type definitions for flipsnap.js +// Project: http://pxgrid.github.io/js-flipsnap/ +// Definitions by: kubosho_ , gsino , Mayuki Sawatari +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface IFlipsnap { + /** + * Return true or false. true is returned when there is previous element. + */ + hasPrev(): boolean; + + /** + * Return true or false. true is returned when there is next element. + */ + hasNext(): boolean; + + /** + * Move to previous item. + */ + toPrev(transitionDuration?: number): void; + + /** + * Move to next item. + */ + toNext(transitionDuration?: number): void; + + /** + * Move to item of number. + */ + moveToPoint(point: number, transitionDuration?: number): void; + + /** + * Recalculate values + */ + refresh(): void; + + element: HTMLElement; +} + +interface FlipsnapStatic { + /** + * @param element The element + */ + (element: HTMLElement, opts?: FlipsnapOptions): IFlipsnap; + + /** + * @param selector The parameter must be CSS Selector. When set string, to get first element of result. Not all element. + */ + (selector: string, opts?: FlipsnapOptions): IFlipsnap; +} + +interface FlipsnapOptions { + /** + * Stop point count. default is auto calculate from element item count. + */ + maxPoint?: number; + /** + * Move distance. default is auto calculate from element width and maxPont. + */ + distance?: number; + /** + * Transition duration (millisecond). default is 350. + */ + transitionDuration?: number; + /** + * When set true, touch event is disabled. Only handling button or etc interface. default is false. + */ + disableTouch?: boolean; + /** + * When support 3D transform browser and this option set true, it is not used 3D transform and use 2D transform. You should set true, when it is a device which has a bug in 3D transform(old Android or BlackBerry etc). default is false. + */ + disable3d?: boolean; +} + +interface HTMLElement { + addEventListener(type: "fstouchstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "fstouchmove", listener: (ev: FlipsnapTouchMoveEvent) => any, useCapture?: boolean): void; + addEventListener(type: "fstouchend", listener: (ev: FlipsnapTouchEndEvent) => any, useCapture?: boolean): void; +} + +interface FlipsnapTouchMoveEvent extends Event { + delta: number; + direction: number; +} + +interface FlipsnapTouchEndEvent extends Event { + moved: boolean; + cancelled: boolean; + newPoint: number; + originalPoint: number; +} + +declare var Flipsnap: FlipsnapStatic; diff --git a/fs-extra/fs-extra.d.ts b/fs-extra/fs-extra.d.ts index 75f6c71a0..3d1af12ac 100644 --- a/fs-extra/fs-extra.d.ts +++ b/fs-extra/fs-extra.d.ts @@ -1,4 +1,4 @@ -// Type definitions for aws-sdk +// Type definitions for fs-extra // Project: https://github.com/jprichardson/node-fs-extra // Definitions by: midknight41 // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/ftdomdelegate/ftdomdelegate.d.ts b/ftdomdelegate/ftdomdelegate.d.ts index 04766bd26..905bef706 100644 --- a/ftdomdelegate/ftdomdelegate.d.ts +++ b/ftdomdelegate/ftdomdelegate.d.ts @@ -1,6 +1,6 @@ // Type definitions for ftdomdelegate // Project: https://github.com/ftlabs/ftdomdelegate -// Definitions by: Christian Holm Nielsen +// Definitions by: Christian Holm Nielsen // Definitions: https://github.com/borisyankov/DefinitelyTyped declare class Delegate @@ -19,4 +19,4 @@ declare class Delegate root(element? : Element) : void; destroy() : void; -} \ No newline at end of file +} diff --git a/fuse/fuse-tests.ts b/fuse/fuse-tests.ts new file mode 100644 index 000000000..3aa5576fe --- /dev/null +++ b/fuse/fuse-tests.ts @@ -0,0 +1,73 @@ +/// + +function test_fuse_find_identifiers() { + var books = [{ + id: 1, + title: 'The Great Gatsby', + author: 'F. Scott Fitzgerald' + }, { + id: 2, + title: 'The DaVinci Code', + author: 'Dan Brown' + }, { + id: 3, + title: 'Angels & Demons', + author: 'Dan Brown' + }]; + var options = { + keys: ['author', 'title'], // keys to search in + id: 'id' // return a list of identifiers only + }; + var f = new Fuse(books, options); + var result = f.search('brwn'); // Fuzzy-search for pattern 'brwn' +} + +function test_fuse_find_records() { + var books = [{ + id: 1, + title: 'The Great Gatsby', + author: 'F. Scott Fitzgerald' + }, { + id: 2, + title: 'The DaVinci Code', + author: 'Dan Brown' + }, { + id: 3, + title: 'Angels & Demons', + author: 'Dan Brown' + }]; + var options = { + keys: ['author', 'title'] + }; + var f = new Fuse(books, options); + var result = f.search('brwn'); +} + +function test_fuse_flat_array() { + var books = ["Old Man's War", "The Lock Artist", "HTML5", "Right Ho Jeeves", "The Code of the Wooster", "Thank You Jeeves", "The DaVinci Code", "Angels & Demons", "The Silmarillion", "Syrup", "The Lost Symbol", "The Book of Lies", "Lamb", "Fool", "Incompetence", "Fat", "Colony", "Backwards, Red Dwarf", "The Grand Design", "The Book of Samson", "The Preservationist", "Fallen", "Monster 1959"]; + var f = new Fuse(books); + var result = f.search('Falen'); +} + +function test_fuse_deep_key_search() { + var books = [{ + id: 1, + title: 'The Great Gatsby', + author: { + firstName: 'F. Scott', + lastName: 'Fitzgerald' + } + }, { + title: 'The DaVinci Code', + author: { + firstName: 'Dan', + lastName: 'Brown' + } + }]; + + var options = { + keys: ['author.firstName'] + } + var f = new Fuse(books, options); + var result = f.search('brwn'); +} diff --git a/fuse/fuse.d.ts b/fuse/fuse.d.ts new file mode 100644 index 000000000..bf175bff6 --- /dev/null +++ b/fuse/fuse.d.ts @@ -0,0 +1,28 @@ +// Type definitions for Fuse.js 1.1.5 +// Project: https://github.com/krisk/Fuse +// Definitions by: Greg Smith +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare class Fuse { + constructor(list: any[], options?: fuse.IFuseOptions); + search(pattern: string): any[]; +} + +declare module fuse { + interface IFuseOptions extends ISearchOptions { + caseSensitive?: boolean; + includeScore?: boolean; + shouldSort?: boolean; + searchFn?: any; + sortFn?: (a: {score: number}, b: {score: number}) => number; + getFn?: (obj: any, path: string) => any; + keys?: string[]; + } + + interface ISearchOptions { + location?: number; + distance?: number; + threshold?: number; + maxPatternLength?: number; + } +} diff --git a/gldatepicker/gldatepicker.d.ts b/gldatepicker/gldatepicker.d.ts index 3ed84c219..0e517057e 100644 --- a/gldatepicker/gldatepicker.d.ts +++ b/gldatepicker/gldatepicker.d.ts @@ -1,6 +1,6 @@ // Type definitions for glDatePicker 2.0 // Project: http://glad.github.com/glDatePicker/ -// Definitions by: Dániel Tar https://github.com/qcz +// Definitions by: Dániel Tar // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -66,4 +66,4 @@ interface GlDatePicker { interface JQuery { glDatePicker(ret: boolean): GlDatePicker; glDatePicker(options?: GlDatePickerOptions): JQuery; -} \ No newline at end of file +} diff --git a/glob-stream/glob-stream-tests.ts b/glob-stream/glob-stream-tests.ts new file mode 100644 index 000000000..f6a0e4bf3 --- /dev/null +++ b/glob-stream/glob-stream-tests.ts @@ -0,0 +1,12 @@ +/// + +import gs = require('glob-stream'); + +var read: NodeJS.ReadableStream; + +read = gs.create('xx'); +read = gs.create('xx', {}); +read = gs.create(['xx'], {}); +read = gs.create(['xx'], {cwd: 'xx'}); +read = gs.create(['xx'], {base: 'xx'}); +read = gs.create(['xx'], {cwdbase: true}); diff --git a/glob-stream/glob-stream.d.ts b/glob-stream/glob-stream.d.ts new file mode 100644 index 000000000..52db4f437 --- /dev/null +++ b/glob-stream/glob-stream.d.ts @@ -0,0 +1,26 @@ +// Type definitions for glob-stream v3.1.12 +// Project: http://github.com/wearefractal/glob-stream +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module 'glob-stream' { + import glob = require('glob'); + + export interface Options extends glob.IOptions { + cwd?: string; + base?: string; + cwdbase?: boolean; + } + + export interface Element { + cwd: string; + base: string; + path: string; + } + + export function create(glob:string, opts?: Options): NodeJS.ReadableStream; + export function create(globs:string[], opts?: Options): NodeJS.ReadableStream; +} diff --git a/google.visualization/google.visualization-tests.ts b/google.visualization/google.visualization-tests.ts index 0f0082816..76dbd40a8 100644 --- a/google.visualization/google.visualization-tests.ts +++ b/google.visualization/google.visualization-tests.ts @@ -37,5 +37,309 @@ function test_dataTableAddRow() { dataTable.addRow(['row3', 0]); } +function test_geoChart() { + var data = google.visualization.arrayToDataTable([ + ['Country', 'Population', 'Area Percentage'], + ['France', 65700000, 50], + ['Germany', 81890000, 27], + ['Poland', 38540000, 23], + ]); + var options = { + sizeAxis: { minValue: 0, maxValue: 100 }, + region: '155', // Western Europe + displayMode: 'markers', + colorAxis: {colors: ['#e7711c', '#4374e0']} // orange to blue + }; + var chart = new google.visualization.GeoChart(document.getElementById('chart_div')); + chart.draw(data, options); +} + +function test_scatterChart() { + var data = google.visualization.arrayToDataTable([ + ['Age', 'Weight'], + [ 8, 12], + [ 4, 5.5], + [ 11, 14], + [ 4, 5], + [ 3, 3.5], + [ 6.5, 7] + ]); + + var options = { + title: 'Age vs. Weight comparison', + hAxis: {title: 'Age', minValue: 0, maxValue: 15}, + vAxis: {title: 'Weight', minValue: 0, maxValue: 15}, + legend: 'none' + }; + + var chart = new google.visualization.ScatterChart(document.getElementById('chart_div')); + chart.draw(data, options); +} + +function test_barChart() { + var data = google.visualization.arrayToDataTable([ + ["Element", "Density", { role: "style" } ], + ["Copper", 8.94, "#b87333"], + ["Silver", 10.49, "silver"], + ["Gold", 19.30, "gold"], + ["Platinum", 21.45, "color: #e5e4e2"], + ]); + + var view = new google.visualization.DataView(data); + view.setColumns([0, 1, + { calc: "stringify", + sourceColumn: 1, + type: "string", + role: "annotation" }, + 2]); + + var options = { + title: "Density of Precious Metals, in g/cm^3", + width: 600, + height: 400, + bar: {groupWidth: "95%"}, + legend: { position: "none" } + }; + var chart = new google.visualization.BarChart(document.getElementById("barchart_values")); + chart.draw(view, options); +} + +function test_histogram() { + var data = google.visualization.arrayToDataTable([ + ['Dinosaur', 'Length'], + ['Acrocanthosaurus (top-spined lizard)', 12.2], + ['Albertosaurus (Alberta lizard)', 9.1], + ['Allosaurus (other lizard)', 12.2], + ['Apatosaurus (deceptive lizard)', 22.9], + ['Archaeopteryx (ancient wing)', 0.9], + ['Argentinosaurus (Argentina lizard)', 36.6], + ['Baryonyx (heavy claws)', 9.1], + ['Brachiosaurus (arm lizard)', 30.5], + ['Ceratosaurus (horned lizard)', 6.1], + ['Coelophysis (hollow form)', 2.7], + ['Compsognathus (elegant jaw)', 0.9], + ['Deinonychus (terrible claw)', 2.7], + ['Diplodocus (double beam)', 27.1], + ['Dromicelomimus (emu mimic)', 3.4], + ['Gallimimus (fowl mimic)', 5.5], + ['Mamenchisaurus (Mamenchi lizard)', 21.0], + ['Megalosaurus (big lizard)', 7.9], + ['Microvenator (small hunter)', 1.2], + ['Ornithomimus (bird mimic)', 4.6], + ['Oviraptor (egg robber)', 1.5], + ['Plateosaurus (flat lizard)', 7.9], + ['Sauronithoides (narrow-clawed lizard)', 2.0], + ['Seismosaurus (tremor lizard)', 45.7], + ['Spinosaurus (spiny lizard)', 12.2], + ['Supersaurus (super lizard)', 30.5], + ['Tyrannosaurus (tyrant lizard)', 15.2], + ['Ultrasaurus (ultra lizard)', 30.5], + ['Velociraptor (swift robber)', 1.8]]); + + var options = { + title: 'Lengths of dinosaurs, in meters', + legend: { position: 'none' } + }; + + var chart = new google.visualization.Histogram(document.getElementById('chart_div')); + chart.draw(data, options); +} + +function test_areaChart() { + var data = google.visualization.arrayToDataTable([ + ['Year', 'Sales', 'Expenses'], + ['2013', 1000, 400], + ['2014', 1170, 460], + ['2015', 660, 1120], + ['2016', 1030, 540] + ]); + + var options = { + title: 'Company Performance', + hAxis: {title: 'Year', titleTextStyle: {color: '#333'}}, + vAxis: {minValue: 0} + }; + + var chart = new google.visualization.AreaChart(document.getElementById('chart_div')); + chart.draw(data, options); +} + +function test_steppedAreaChart() { + var data = google.visualization.arrayToDataTable([ + ['Director (Year)', 'Rotten Tomatoes', 'IMDB'], + ['Alfred Hitchcock (1935)', 8.4, 7.9], + ['Ralph Thomas (1959)', 6.9, 6.5], + ['Don Sharp (1978)', 6.5, 6.4], + ['James Hawes (2008)', 4.4, 6.2] + ]); + + var options = { + title: 'The decline of \'The 39 Steps\'', + vAxis: {title: 'Accumulated Rating'}, + isStacked: true + }; + + var chart = new google.visualization.SteppedAreaChart(document.getElementById('chart_div')); + chart.draw(data, options); +} + +function test_lineChart() { + var data = google.visualization.arrayToDataTable([ + ['Year', 'Sales', 'Expenses'], + ['2004', 1000, 400], + ['2005', 1170, 460], + ['2006', 660, 1120], + ['2007', 1030, 540] + ]); + + var options = { + title: 'Company Performance' + }; + + var chart = new google.visualization.LineChart(document.getElementById('chart_div')); + chart.draw(data, options); +} + +function test_pieChart() { + var data = google.visualization.arrayToDataTable([ + ['Task', 'Hours per Day'], + ['Work', 11], + ['Eat', 2], + ['Commute', 2], + ['Watch TV', 2], + ['Sleep', 7] + ]); + + var options = { + title: 'My Daily Activities' + }; + + var chart = new google.visualization.PieChart(document.getElementById('piechart')); + chart.draw(data, options); +} + +function test_bubbleChart() { + var data = google.visualization.arrayToDataTable([ + ['ID', 'Life Expectancy', 'Fertility Rate', 'Region', 'Population'], + ['CAN', 80.66, 1.67, 'North America', 33739900], + ['DEU', 79.84, 1.36, 'Europe', 81902307], + ['DNK', 78.6, 1.84, 'Europe', 5523095], + ['EGY', 72.73, 2.78, 'Middle East', 79716203], + ['GBR', 80.05, 2, 'Europe', 61801570], + ['IRN', 72.49, 1.7, 'Middle East', 73137148], + ['IRQ', 68.09, 4.77, 'Middle East', 31090763], + ['ISR', 81.55, 2.96, 'Middle East', 7485600], + ['RUS', 68.6, 1.54, 'Europe', 141850000], + ['USA', 78.09, 2.05, 'North America', 307007000] + ]); + + var options = { + title: 'Correlation between life expectancy, fertility rate and population of some world countries (2010)', + hAxis: {title: 'Life Expectancy'}, + vAxis: {title: 'Fertility Rate'}, + bubble: {textStyle: {fontSize: 11}} + }; + + var chart = new google.visualization.BubbleChart(document.getElementById('chart_div')); + chart.draw(data, options); +} + +function test_treemap() { + // Create and populate the data table. + var data = google.visualization.arrayToDataTable([ + ['Location', 'Parent', 'Market trade volume (size)', 'Market increase/decrease (color)'], + ['Global', null, 0, 0], + ['America', 'Global', 0, 0], + ['Europe', 'Global', 0, 0], + ['Asia', 'Global', 0, 0], + ['Australia', 'Global', 0, 0], + ['Africa', 'Global', 0, 0], + ['Brazil', 'America', 11, 10], + ['USA', 'America', 52, 31], + ['Mexico', 'America', 24, 12], + ['Canada', 'America', 16, -23], + ['France', 'Europe', 42, -11], + ['Germany', 'Europe', 31, -2], + ['Sweden', 'Europe', 22, -13], + ['Italy', 'Europe', 17, 4], + ['UK', 'Europe', 21, -5], + ['China', 'Asia', 36, 4], + ['Japan', 'Asia', 20, -12], + ['India', 'Asia', 40, 63], + ['Laos', 'Asia', 4, 34], + ['Mongolia', 'Asia', 1, -5], + ['Israel', 'Asia', 12, 24], + ['Iran', 'Asia', 18, 13], + ['Pakistan', 'Asia', 11, -52], + ['Egypt', 'Africa', 21, 0], + ['S. Africa', 'Africa', 30, 43], + ['Sudan', 'Africa', 12, 2], + ['Congo', 'Africa', 10, 12], + ['Zaire', 'Africa', 8, 10] + ]); + + // Create and draw the visualization. + var tree = new google.visualization.TreeMap(document.getElementById('chart_div')); + tree.draw(data, { + minColor: '#f00', + midColor: '#ddd', + maxColor: '#0d0', + headerHeight: 15, + fontColor: 'black', + showScale: true}); +} + +function test_table() { + var data = new google.visualization.DataTable(); + data.addColumn('string', 'Name'); + data.addColumn('number', 'Salary'); + data.addColumn('boolean', 'Full Time Employee'); + data.addRows([ + ['Mike', {v: 10000, f: '$10,000'}, true], + ['Jim', {v:8000, f: '$8,000'}, false], + ['Alice', {v: 12500, f: '$12,500'}, true], + ['Bob', {v: 7000, f: '$7,000'}, true] + ]); + + var table = new google.visualization.Table(document.getElementById('table_div')); + table.draw(data, {showRowNumber: true}); +} + +function test_timeline() { + var container = document.getElementById('example1'); + + var chart = new google.visualization.Timeline(container); + + var dataTable = new google.visualization.DataTable(); + + dataTable.addColumn({ type: 'string', id: 'President' }); + dataTable.addColumn({ type: 'date', id: 'Start' }); + dataTable.addColumn({ type: 'date', id: 'End' }); + + dataTable.addRows([ + [ 'Washington', new Date(1789, 3, 29), new Date(1797, 2, 3) ], + [ 'Adams', new Date(1797, 2, 3), new Date(1801, 2, 3) ], + [ 'Jefferson', new Date(1801, 2, 3), new Date(1809, 2, 3) ]]); + + chart.draw(dataTable); +} + +function test_candlestickChart() { + var data = google.visualization.arrayToDataTable([ + ['Mon', 20, 28, 38, 45], + ['Tue', 31, 38, 55, 66], + ['Wed', 50, 55, 77, 80], + ['Thu', 77, 77, 66, 50], + ['Fri', 68, 66, 22, 15] + // Treat first row as data as well. + ], true); + + var options = { + legend:'none' + }; + + var chart = new google.visualization.CandlestickChart(document.getElementById('chart_div')); + chart.draw(data, options); +} \ No newline at end of file diff --git a/google.visualization/google.visualization.d.ts b/google.visualization/google.visualization.d.ts index 553c8e654..38a08ef55 100644 --- a/google.visualization/google.visualization.d.ts +++ b/google.visualization/google.visualization.d.ts @@ -130,7 +130,7 @@ declare module google { maxValue?: any; } - function arrayToDataTable(data: any[]): DataTable; + function arrayToDataTable(data: any[], firstRowIsData?: boolean): DataTable; //#endregion //#region DataView @@ -139,72 +139,39 @@ declare module google { export class DataView { constructor(data: DataTable); constructor(data: DataView); - setColumns(columnIndexes: number[]): void; + setColumns(columnIndexes: any[]): void; } //#endregion //#region GeoChart //https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart - export class GeoChart { - constructor(element: Element); - - // https://developers.google.com/chart/interactive/docs/gallery/geochart?hl=fr&csw=1#Methods + export class GeoChart extends ChartBase { draw(data: DataTable, options: GeoChartOptions): void; - getSelection(): GeoChartSelection[]; - setSelection(selection: VisualizationSelectionArray[]): void; - clearChart(): void; } // https://developers.google.com/chart/interactive/docs/gallery/geochart?hl=fr&csw=1#Configuration_Options export interface GeoChartOptions { backgroundColor?: any; - colorAxis?: GeoChartColorAxis; + colorAxis?: ChartColorAxis; datalessRegionColor?: string; displayMode?: string; enableRegionInteractivity?: boolean; height?: number; keepAspectRatio?: boolean; - legend?: GeoChartLegend; + legend?: ChartLegend; region?: string; magnifyingGlass?: GeoChartMagnifyingGlass; markerOpacity?: number; resolution?: string; - sizeAxis?: GeoChartAxis; - tooltip?: GeoChartTooltip; + sizeAxis?: ChartSizeAxis; + tooltip?: ChartTooltip; width?: number; } - export interface GeoChartAxis { - maxSize?: number; - maxValue?: number; - minSize?: number; - minValue?: number; - } - export interface GeoChartColorAxis extends GeoChartAxis { - minValue?: number; - maxValue?: number; - values?: number[]; - colors?: string[]; - } - export interface GeoChartTextStyle { - color?: string; - fontName?: string; - fontSize?: number; - bold?: boolean; - italic?: boolean; - } - export interface GeoChartLegend { - numberFormat?: string; - textStyle?: GeoChartTextStyle; - } export interface GeoChartMagnifyingGlass { enable?: boolean; zoomFactor?: number; } - export interface GeoChartTooltip { - textStyle?: GeoChartTextStyle; - trigger?: string; - } export interface GeoChartRegionClickEvent { region: string; } @@ -215,6 +182,67 @@ declare module google { //#endregion //#region Common + export interface ChartAnnotations { + boxStyle?: ChartBoxStyle; + textStyle?: ChartTextStyle; + } + + export interface ChartBoxStyle { + stroke?: string; + strokeWidth?: number; + rx?: number; + ry?: number; + gradient?: { + color1: string; + color2: string; + x1: string; + y1: string; + x2: string; + y2: string; + useObjectBoundingBoxUnits?: boolean; + } + } + + export interface ChartTextStyle { + fontName?: string; + fontSize?: number; + bold?: boolean; + italic?: boolean; + color?: string; + auraColor?: string; + opacity?: number; + } + + export interface ChartCrosshair { + color?: string; + focused?: { + color?: string; + opacity?: number; + } + opacity?: number; + orientation?: string; + selected?: { + color?: string; + opacity?: number; + } + trigger?: string; + } + + export interface ChartExplorer { + actions?: string[]; + axis?: string; + keepInBounds?: boolean; + maxZoomIn?: number; + maxZoomOut?: number; + zoomDelta?: number; + } + + export interface ChartStroke { + stroke: string; + strokeWidth: number; + fill: string; + } + export interface ChartArea { top: any; left: any; @@ -222,19 +250,12 @@ declare module google { height: any; } - export interface ChartTextStyle { - color?: string; - fontName?: string; - fontSize?: number; - bold?: boolean; - italic?: boolean; - } - export interface ChartLegend { alignment?: string; maxLines?: number; position?: string; textStyle?: ChartTextStyle; + numberFormat?: string; } // https://google-developers.appspot.com/chart/interactive/docs/animation @@ -298,6 +319,14 @@ declare module google { height: number; } + export interface ChartColorAxis { + minValue?: number; + maxValue?: number; + values?: number[]; + colors?: string[]; + legend?: ChartLegend; + } + export interface ChartLayoutInterface { getBoundingBox(id: string): ChartBoundingBox; getChartAreaBoundingBox(): ChartBoundingBox; @@ -307,34 +336,91 @@ declare module google { getYLocation(position: number, axisIndex?: number): number; } + export interface GroupWidth { + groupWidth: any; // number | string + } + export interface VisualizationSelectionArray { column?: number; row?: number; } + class ChartBase { + constructor(element: Element); + getSelection(): any[]; + setSelection(selection: any[]): void; + clearChart(): void; + getImageURI(): string; + } + + class CoreChartBase extends ChartBase { + getBoundingBox(id: string): ChartBoundingBox; + getChartAreaBoundingBox(): ChartBoundingBox; + getChartLayoutInterface(): ChartLayoutInterface; + getHAxisValue(position: number, axisIndex?: number): number; + getVAxisValue(position: number, axisIndex?: number): number; + getXLocation(position: number, axisIndex?: number): number; + getYLocation(position: number, axisIndex?: number): number; + } + + //#endregion + //#region ScatterChart + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/scatterchart + export class ScatterChart extends CoreChartBase { + draw(data: DataTable, options?: ScatterChartOptions): void; + draw(data: DataView, options?: ScatterChartOptions): void; + } + + export interface ScatterChartOptions { + aggregationTarget?: string; + animation?: TransitionAnimation; + annotations?: ChartAnnotations; + axisTitlesPosition?: string; // in, out, none + backgroundColor?: any; + chartArea?: ChartArea; + colors?: string[]; + crosshair?: ChartCrosshair; + curveType?: string; + dataOpacity?: number; + enableInteractivity?: boolean; + explorer?: ChartExplorer; + fontSize?: number; + fontName?: string; + forceIFrame?: boolean; + hAxis?: ChartAxis; + height?: number; + legend?: ChartLegend; + lineWidth?: number; + pointSize?: number; + selectionMode?: string; + series?: any; + theme?: string; + title?: string; + titlePosition?: string; + titleTextStyle?: ChartTextStyle; + tooltip?: ChartTooltip; + vAxis?: ChartAxis; + width?: number; + } + //#endregion //#region ColumnChart // https://google-developers.appspot.com/chart/interactive/docs/gallery/columnchart - export class ColumnChart { - constructor(element: Element); - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/columnchart#Methods - draw(data: DataTable, options?: ColumnChartOptions): void; - draw(data: DataView, options?: ColumnChartOptions): void; - getChartLayoutInterface(): ChartLayoutInterface; - getSelection(): any[]; - setSelection(selection: any[]): void; - clearChart(): void; + export class ColumnChart extends CoreChartBase { + draw(data: DataTable, options: ColumnChartOptions): void; + draw(data: DataView, options: ColumnChartOptions): void; } // https://google-developers.appspot.com/chart/interactive/docs/gallery/columnchart#Configuration_Options export interface ColumnChartOptions { aggregationTarget?: string; animation?: TransitionAnimation; + annotations?: ChartAnnotations; axisTitlesPosition?: string; // in, out, none backgroundColor?: any; - bar?: ColumnChartBarOptions; + bar?: GroupWidth; chartArea?: ChartArea; colors?: string[]; enableInteractivity?: boolean; @@ -358,36 +444,29 @@ declare module google { width?: number; } - export interface ColumnChartBarOptions { - groupWidth: any; - } - //#endregion //#region LineChart // https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart - export class LineChart { - constructor(element: Element); - - // https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart#Methods - draw(data: DataTable, options: any): void; - draw(data: DataView, options: any): void; - getChartLayoutInterface(): ChartLayoutInterface; - getSelection(): any[]; - setSelection(selection: any[]): void; - clearChart(): void; + export class LineChart extends CoreChartBase { + draw(data: DataTable, options: LineChartOptions): void; + draw(data: DataView, options: LineChartOptions): void; } // https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart#Configuration_Options export interface LineChartOptions { aggregationTarget?: string; animation?: TransitionAnimation; + annotations?: ChartAnnotations; axisTitlesPosition?: string; backgroundColor?: any; chartArea?: ChartArea; colors?: string[]; + crosshair?: ChartCrosshair; curveType?: string; + dataOpacity?: number; enableInteractivity?: boolean; + explorer?: ChartExplorer; focusTarget?: string; fontSize?: number; fontName?: string; @@ -396,6 +475,7 @@ declare module google { interpolateNulls?: boolean; legend?: ChartLegend; lineWidth?: number; + orientation?: string; pointSize?: number; reverseCategories?: boolean; selectionMode?: string // single / multiple @@ -417,9 +497,10 @@ declare module google { export interface BarChartOptions { aggregationTarget?: string; animation?: TransitionAnimation; + annotations?: ChartAnnotations; axisTitlesPosition?: string; // in, out, none backgroundColor?: any; - bar?: ColumnChartBarOptions; + bar?: GroupWidth; chartArea?: ChartArea; colors?: string[]; dataOpacity?: number; @@ -427,6 +508,7 @@ declare module google { focusTarget?: string; fontSize?: number; fontName?: string; + hAxes?: any; hAxis?: ChartAxis; height?: number; isStacked?: boolean; @@ -444,21 +526,388 @@ declare module google { } // https://google-developers.appspot.com/chart/interactive/docs/gallery/barchart - export class BarChart { - constructor(element: Element); + export class BarChart extends CoreChartBase { draw(data: DataTable, options: BarChartOptions): void; draw(data: DataView, options: BarChartOptions): void; - getBoundingBox(id: string): ChartBoundingBox; - getChartAreaBoundingBox(): ChartBoundingBox; - getChartLayoutInterface(): ChartLayoutInterface; - getHAxisValue(position: number, axisIndex?: number): number; - getVAxisValue(position: number, axisIndex?: number): number; - getXLocation(position: number, axisIndex?: number): number; - getYLocation(position: number, axisIndex?: number): number; - getSelection(): any[]; - setSelection(selection: any[]): void; - clearChart(): void; + } + //#endregion + //#region Histogram + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/histogram + export class Histogram extends CoreChartBase { + draw(data: DataTable, options: HistogramOptions): void; + draw(data: DataView, options: HistogramOptions): void; + } + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/histogram#Configuration_Options + export interface HistogramOptions { + animation?: TransitionAnimation; + axisTitlesPosition?: string; // in, out, none + backgroundColor?: any; + bar?: GroupWidth; + chartArea?: ChartArea; + colors?: string[]; + dataOpacity?: number; + enableInteractivity?: boolean; + focusTarget?: string; + fontSize?: number; + fontName?: string; + hAxis?: ChartAxis; + histogram?: HistogramHistogramOptions; + height?: number; + interpolateNulls?: boolean; + isStacked?: boolean; + legend?: ChartLegend; + orientation?: string; + reverseCategories?: boolean; + series?: any; + theme?: string; + title?: string; + titlePosition?: string; + titleTextStyle?: ChartTextStyle; + tooltip?: ChartTooltip; + vAxes?: any; + vAxis?: ChartAxis; + width?: number; + } + + export interface HistogramHistogramOptions { + bucketSize?: number; + hideBucketItems?: boolean; + lastBucketPercentile?: number; + } + + //#endregion + //#region AreaChart + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart + export class AreaChart extends CoreChartBase { + draw(data: DataTable, options: AreaChartOptions): void; + draw(data: DataView, options: AreaChartOptions): void; + } + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart#Configuration_Options + export interface AreaChartOptions { + aggregationTarget?: string; + animation?: TransitionAnimation; + areaOpacity?: number; + axisTitlesPosition?: string; + backgroundColor?: any; + chartArea?: ChartArea; + colors?: string[]; + crosshair?: ChartCrosshair; + dataOpacity?: number; + enableInteractivity?: boolean; + explorer?: ChartExplorer; + focusTarget?: string; + fontSize?: number; + fontName?: string; + hAxis?: ChartAxis; + height?: number; + interpolateNulls?: boolean; + isStacked?: boolean; + legend?: ChartLegend; + lineWidth?: number; + orientation?: string; + pointSize?: number; + reverseCategories?: boolean; + selectionMode?: string // single / multiple + series?: any; + theme?: string; + title?: string; + titlePosition?: string; + titleTextStyle?: ChartTextStyle; + tooltip?: ChartTooltip; + vAxes?: any; + vAxis?: ChartAxis; + width?: number; + } + + //#endregion + //#region SteppedAreaChart + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart + export class SteppedAreaChart extends CoreChartBase { + draw(data: DataTable, options: SteppedAreaChartOptions): void; + draw(data: DataView, options: SteppedAreaChartOptions): void; + } + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart#Configuration_Options + export interface SteppedAreaChartOptions { + aggregationTarget?: string; + animation?: TransitionAnimation; + areaOpacity?: number; + axisTitlesPosition?: string; + backgroundColor?: any; + chartArea?: ChartArea; + colors?: string[]; + connectSteps?: boolean; + enableInteractivity?: boolean; + focusTarget?: string; + fontSize?: number; + fontName?: string; + hAxis?: ChartAxis; + height?: number; + interpolateNulls?: boolean; + isStacked?: boolean; + legend?: ChartLegend; + reverseCategories?: boolean; + selectionMode?: string // single / multiple + series?: any; + theme?: string; + title?: string; + titlePosition?: string; + titleTextStyle?: ChartTextStyle; + tooltip?: ChartTooltip; + vAxes?: any; + vAxis?: ChartAxis; + width?: number; + } + + //#endregion + //#region PieChart + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/piechart + export class PieChart extends CoreChartBase { + draw(data: DataTable, options: PieChartOptions): void; + draw(data: DataView, options: PieChartOptions): void; + } + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/piechart#Configuration_Options + export interface PieChartOptions { + backgroundColor?: any; + chartArea?: ChartArea; + colors?: string[]; + enableInteractivity?: boolean; + fontSize?: number; + fontName?: string; + height?: number; + is3D?: boolean; + legend?: ChartLegend; + pieHole?: number; + pieSliceBorderColor?: string; + pieSliceText?: string; + pieSliceTextStyle?: ChartTextStyle; + pieStartAngle?: number; + reverseCategories?: boolean; + pieResidueSliceColor?: string; + pieResidueSliceLabel?: string; + slices?: any; + sliceVisibilityThreshold?: number; + title?: string; + titleTextStyle?: ChartTextStyle; + tooltip?: ChartTooltip; + width?: number; + } + + //#endregion + //#region BubbleChart + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/scatterchart + export class BubbleChart extends CoreChartBase { + draw(data: DataTable, options?: BubbleChartOptions): void; + draw(data: DataView, options?: BubbleChartOptions): void; + } + + export interface BubbleChartOptions { + animation?: TransitionAnimation; + axisTitlesPosition?: string; // in, out, none + backgroundColor?: any; + bubble?: ChartBubble; + chartArea?: ChartArea; + colors?: string[]; + colorAxis?: ChartColorAxis; + enableInteractivity?: boolean; + explorer?: ChartExplorer; + fontSize?: number; + fontName?: string; + forceIFrame?: boolean; + hAxis?: ChartAxis; + height?: number; + legend?: ChartLegend; + selectionMode?: string; + series?: any; + sizeAxis?: ChartSizeAxis; + sortBubblesBySize?: boolean; + theme?: string; + title?: string; + titlePosition?: string; + titleTextStyle?: ChartTextStyle; + tooltip?: ChartTooltip; + vAxis?: ChartAxis; + width?: number; + } + + export interface ChartBubble { + opacity?: number; + stroke?: string; + textStyle?: ChartTextStyle; + } + + export interface ChartSizeAxis { + maxSize?: number; + maxValue?: number; + minSize?: number; + minValue?: number; + } + + //#endregion + //#region TreeMap + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/treemap + export class TreeMap extends ChartBase { + draw(data: DataTable, options?: TreeMapOptions): void; + draw(data: DataView, options?: TreeMapOptions): void; + goUpAndDraw(): void; + getMaxPossibleDepth(): number; + } + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/treemap#Configuration_Options + export interface TreeMapOptions { + fontColor?: string; + fontFamily?: string; + fontSize?: number; + forceIFrame?: boolean; + headerColor?: string; + headerHeight?: number; + headerHighlightColor?: string; + hintOpacity?: number; + maxColor?: string; + maxDepth?: number; + maxHighlightColor?: string; + maxPostDepth?: number; + maxColorValue?: number; + midColor?: string; + midHighlightColor?: string; + minColor?: string; + minHighlightColor?: string; + minColorValue?: number; + showScale?: boolean; + showTooltips?: boolean; + textStyle?: ChartTextStyle; + title?: string; + titleTextStyle?: ChartTextStyle; + useWeightedAverageForAggregation?: boolean; + } + + //#endregion + //#region Table + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/table + export class Table extends ChartBase { + draw(data: DataTable, options?: TableOptions): void; + draw(data: DataView, options?: TableOptions): void; + } + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/table#Configuration_Options + export interface TableOptions { + allowHtml?: boolean; + alternatingRowStyle?: boolean; + cssClassName?: CssClassNames; + firstRowNumber?: number; + height?: string; + page?: string; + pageSize?: number; + rtlTable?: boolean; + scrollLeftStartPosition?: number; + showRowNumber?: boolean; + sort?: string; + sortAscending?: boolean; + sortColumn?: number; + startPage?: number; + width?: string; + } + + export interface CssClassNames { + headerRow?: string; + tableRow?: string; + oddTableRow?: string; + selectedTableRow?: string; + hoverTableRow?: string; + headerCell?: string; + tableCell?: string; + rowNumberCell?: string; + } + + //#endregion + //#region Timeline + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/timeline + export class Timeline { + constructor(element: Element); + draw(data: DataTable, options?: TimelineOptions): void; + draw(data: DataView, options?: TimelineOptions): void; + clearChart(): void; + } + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/timeline#Configuration_Options + export interface TimelineOptions { + avoidOverlappingGridLines?: boolean; + backgroundColor?: any; + colors?: string[]; + enableInteractivity?: boolean; + forceIFrame?: boolean; + height?: number; + timeline?: { + barLabelStyle?: LabelStyle; + colorByRowLabel?: boolean; + groupByRowLabel?: boolean; + rowLabelStyle?: LabelStyle; + showRowLabels?: boolean; + singleColor?: string; + } + width?: number; + } + + export interface LabelStyle { + color: string; + fontName: string; + fontSize: string; + } + + //#endregion + //#region CandlestickChart + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/candlestickchart + export class CandlestickChart extends CoreChartBase { + draw(data: DataTable, options: CandlestickChartOptions): void; + draw(data: DataView, options: CandlestickChartOptions): void; + } + + // https://google-developers.appspot.com/chart/interactive/docs/gallery/candlestickchart#Configuration_Options + export interface CandlestickChartOptions { + aggregationTarget?: string; + animation?: TransitionAnimation; + axisTitlesPosition?: string; + backgroundColor?: any; + bar?: GroupWidth; + candlestick?: { + hollowIsRising?: boolean; + fallingColor?: ChartStroke; + risingColor?: ChartStroke; + } + chartArea?: ChartArea; + colors?: string[]; + enableInteractivity?: boolean; + focusTarget?: string; + fontSize?: number; + fontName?: string; + hAxis?: ChartAxis; + height?: number; + legend?: ChartLegend; + orientation?: string; + reverseCategories?: boolean; + selectionMode?: string // single / multiple + series?: any; + theme?: string; + title?: string; + titlePosition?: string; + titleTextStyle?: ChartTextStyle; + tooltip?: ChartTooltip; + vAxes?: any; + vAxis?: ChartAxis; + width?: number; } //#endregion diff --git a/googlemaps.infobubble/google.maps.infobubble.d.ts b/googlemaps.infobubble/google.maps.infobubble.d.ts index 2d88d8645..e8d4d438c 100644 --- a/googlemaps.infobubble/google.maps.infobubble.d.ts +++ b/googlemaps.infobubble/google.maps.infobubble.d.ts @@ -1,10 +1,10 @@ -/// - // Type definitions for CSS3 InfoBubble with tabs for Google Maps API V3 // Project: http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/src/ -// Definitions by: Johan Nilsson https://github.com/Dashue +// Definitions by: Johan Nilsson // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + /** * @name CSS3 InfoBubble with tabs for Google Maps API V3 * @version 0.8 @@ -105,4 +105,4 @@ declare module google.maps.infobubble { */ shadowStyle?: number; } -} \ No newline at end of file +} diff --git a/hammerjs/hammerjs.d.ts b/hammerjs/hammerjs.d.ts index 72f09a5e0..f2dff3046 100644 --- a/hammerjs/hammerjs.d.ts +++ b/hammerjs/hammerjs.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Hammer.js 1.0.10 +// Type definitions for Hammer.js 1.1.3 // Project: http://eightmedia.github.com/hammer.js/ // Definitions by: Boris Yankov +// Drew Noakes // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -31,8 +32,6 @@ interface HammerStatic { plugins: any; gestures: any; READY: boolean; - - } declare class HammerInstance { @@ -42,40 +41,51 @@ declare class HammerInstance { off(gesture: string, handler: (event: HammerEvent) => void): HammerInstance; enable(toggle: boolean): HammerInstance; - // You shouldn't use this, this is an internally method use by the gestures. Only use it when you know what you're doing! You can read the sourcecode about how to use this. + // You shouldn't normally use this internal method. Only use it when you know what you're doing! You can read the sourcecode for information about how to use this. trigger(gesture: string, eventData: HammerGestureEventData): HammerInstance; } // Gesture Options : https://github.com/EightMedia/hammer.js/wiki/Getting-Started#gesture-options interface HammerOptions { + behavior?: { + contentZooming?: string; + tapHighlightColor?: string; + touchAction?: string; + touchCallout?: string; + userDrag?: string; + userSelect?: string; + }; + doubleTapDistance?: number; + doubleTapInterval?: number; drag?: boolean; - drag_block_horizontal?: boolean; - drag_block_vertical?: boolean; - drag_lock_to_axis?: boolean; - drag_max_touches?: number; - drag_min_distance?: number; + dragBlockHorizontal?: boolean; + dragBlockVertical?: boolean; + dragDistanceCorrection?: boolean; + dragLockMinDistance?: number; + dragLockToAxis?: boolean; + dragMaxTouches?: number; + dragMinDistance?: number; + gesture?: boolean; hold?: boolean; - hold_threshold?: number; - hold_timeout?: number; - prevent_default?: boolean; - prevent_mouseevents?: boolean; + holdThreshold?: number; + holdTimeout?: number; + preventDefault?: boolean; + preventMouse?: boolean; release?: boolean; - show_touches?: boolean; - stop_browser_behavior?: any; + showTouches?: boolean; swipe?: boolean; - swipe_max_touches?: number; - swipe_velocity?: number; + swipeMaxTouches?: number; + swipeMinTouches?: number; + swipeVelocityX?: number; + swipeVelocityY?: number; tap?: boolean; - tap_always?: boolean; - tap_max_distance?: number; - tap_max_touchtime?: number; - doubletap_distance?: number; - doubletap_interval?: number; + tapAlways?: boolean; + tapMaxDistance?: number; + tapMaxTime?: number; touch?: boolean; transform?: boolean; - transform_always_block?: boolean; - transform_min_rotation?: number; - transform_min_scale?: number; + transformMinRotation?: number; + transformMinScale?: number; } interface HammerGestureEventData { @@ -106,6 +116,8 @@ interface HammerGestureEventData { } interface HammerPoint { + clientX: number; + clientY: number; pageX: number; pageY: number; } diff --git a/highlightjs/highlightjs.d.ts b/highlightjs/highlightjs.d.ts index 9e3567cdb..d730029b5 100644 --- a/highlightjs/highlightjs.d.ts +++ b/highlightjs/highlightjs.d.ts @@ -1,7 +1,8 @@ // Type definitions for highlight.js // Project: https://github.com/isagalaev/highlight.js -// Definitions by: Niklas Mollenhauer +// Definitions by: Niklas Mollenhauer // Definitions: https://github.com/borisyankov/DefinitelyTyped + declare module "highlight.js" { module hljs diff --git a/humane/humane.d.ts b/humane/humane.d.ts index 06f865636..3be0a1d48 100644 --- a/humane/humane.d.ts +++ b/humane/humane.d.ts @@ -1,7 +1,7 @@ // Type definitions for Humane 3.0 // Project: http://wavded.github.com/humane-js/ // Definitions by: jmvrbanac -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface HumaneOptions { diff --git a/i18next/i18next.d.ts b/i18next/i18next.d.ts index 6fabcce44..e9083c4d5 100644 --- a/i18next/i18next.d.ts +++ b/i18next/i18next.d.ts @@ -1,6 +1,6 @@ -// Type definitions for i18next (v1.5.10 incl. jQuery) +// Type definitions for i18next v1.5.10 // Project: http://i18next.com -// Definitions by: Maarten Docter - Blog: http://www.maartendocter.nl +// Definitions by: Maarten Docter // Definitions: https://github.com/borisyankov/DefinitelyTyped // Sources: https://github.com/jamuhl/i18next/ diff --git a/iscroll/iscroll-lite.d.ts b/iscroll/iscroll-lite.d.ts index 1cd83b1dd..85d1a6934 100644 --- a/iscroll/iscroll-lite.d.ts +++ b/iscroll/iscroll-lite.d.ts @@ -1,6 +1,6 @@ // Type definitions for iScroll Lite 4.1 // Project: http://cubiq.org/iscroll-4 -// Definitions by: Boris Yankov and Christiaan Rakowski +// Definitions by: Boris Yankov , Christiaan Rakowski // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/iscroll/iscroll.d.ts b/iscroll/iscroll.d.ts index 34234c00a..ff615a5f8 100644 --- a/iscroll/iscroll.d.ts +++ b/iscroll/iscroll.d.ts @@ -1,6 +1,6 @@ // Type definitions for iScroll 4.2 // Project: http://cubiq.org/iscroll-4 -// Definitions by: Boris Yankov and Christiaan Rakowski +// Definitions by: Boris Yankov , Christiaan Rakowski // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/ix.js/ix.d.ts b/ix.js/ix.d.ts index ebd5b160b..f49a72d3d 100644 --- a/ix.js/ix.d.ts +++ b/ix.js/ix.d.ts @@ -111,3 +111,7 @@ declare module Ix { forIn(source: Enumerable, resultSelector: EnumerableFunc): Enumerable; } } + +declare module "ix" { + export = Ix; +} \ No newline at end of file diff --git a/ix.js/l2o.d.ts b/ix.js/l2o.d.ts index 209c9b675..3e101a662 100644 --- a/ix.js/l2o.d.ts +++ b/ix.js/l2o.d.ts @@ -54,8 +54,10 @@ declare module Ix { some(predicate?: EnumerablePredicate, thisArg?: any): boolean; // alias average(selector?: EnumerableFunc): number; - max(selector?: EnumerableFunc): number; - min(selector?: EnumerableFunc): number; + max(): T; + max(selector: EnumerableFunc): TResult; + min(): T; + min(selector: EnumerableFunc): TResult; sum(selector?: EnumerableFunc): number; concat(...sources: Enumerable[]): Enumerable; @@ -91,16 +93,16 @@ declare module Ix { comparer?: EqualityComparer): Enumerable; groupBy( keySelector: (item: T) => TKey, - elementSelector: (item: T) => TElement): Grouping; + elementSelector: (item: T) => TElement): Enumerable>; groupBy( - keySelector: (item: T) => TKey): Grouping; + keySelector: (item: T) => TKey): Enumerable>; // if need to set comparer without resultSelector groupBy( keySelector: (item: T) => TKey, elementSelector: (item: T) => TElement, _: boolean, - comparer: EqualityComparer): Grouping; + comparer: EqualityComparer): Enumerable>; // if need to set resultSelector without elementSelector groupBy( keySelector: (item: T) => TKey, @@ -112,7 +114,7 @@ declare module Ix { keySelector: (item: T) => TKey, _: boolean, __: boolean, - comparer: EqualityComparer): Grouping; + comparer: EqualityComparer): Enumerable>; groupJoin( inner: Enumerable, @@ -249,3 +251,7 @@ declare module Ix { var Enumerable: EnumerableStatic; } + +declare module "l2o" { + export = Ix; +} diff --git a/jasmine-fixture/jasmine-fixture.d.ts b/jasmine-fixture/jasmine-fixture.d.ts index 4c11fe94f..10da424f7 100644 --- a/jasmine-fixture/jasmine-fixture.d.ts +++ b/jasmine-fixture/jasmine-fixture.d.ts @@ -1,7 +1,7 @@ // Type definitions for Jasmine-fixture 1.0.7 // Project: https://github.com/searls/jasmine-fixture // Definitions by: Craig Brett -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /** Affixes the given jquery selectors into the body and will be removed after each spec * @param {string} selector The JQuery selector to be added to the dom @@ -13,4 +13,4 @@ interface JQuery { * @param {string} selector The JQuery selector to be added to the dom */ affix(selector: string): JQuery; -} \ No newline at end of file +} diff --git a/jasmine-jquery/jasmine-jquery.d.ts b/jasmine-jquery/jasmine-jquery.d.ts index 1d3c30cda..e1ed6c3c0 100644 --- a/jasmine-jquery/jasmine-jquery.d.ts +++ b/jasmine-jquery/jasmine-jquery.d.ts @@ -1,7 +1,7 @@ // Type definitions for Jasmine-JQuery 1.5.8 // Project: https://github.com/velesin/jasmine-jquery // Definitions by: Gregor Stamac -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// /// diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index d8132b4bc..63d7bde37 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -1,7 +1,7 @@ // Type definitions for Jasmine 2.0 // Project: http://pivotal.github.com/jasmine/ // Definitions by: Boris Yankov , Theodore Brown -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped declare function describe(description: string, specDefinitions: () => void): void; diff --git a/jasmine/jasmine-1.3-tests.ts b/jasmine/legacy/jasmine-1.3-tests.ts similarity index 100% rename from jasmine/jasmine-1.3-tests.ts rename to jasmine/legacy/jasmine-1.3-tests.ts diff --git a/jasmine/jasmine-1.3.d.ts b/jasmine/legacy/jasmine-1.3.d.ts similarity index 99% rename from jasmine/jasmine-1.3.d.ts rename to jasmine/legacy/jasmine-1.3.d.ts index b380959d0..c50621085 100644 --- a/jasmine/jasmine-1.3.d.ts +++ b/jasmine/legacy/jasmine-1.3.d.ts @@ -1,7 +1,7 @@ // Type definitions for Jasmine 1.3 // Project: http://pivotal.github.com/jasmine/ // Definitions by: Boris Yankov -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped declare function describe(description: string, specDefinitions: () => void): void; diff --git a/joi/joi-tests.ts b/joi/joi-tests.ts index 45a46dcd0..26048a9dc 100644 --- a/joi/joi-tests.ts +++ b/joi/joi-tests.ts @@ -29,27 +29,6 @@ var funcArr: Function[] = []; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -var validOpts: Joi.ValidationOptions = null; - -validOpts = {abortEarly: bool}; -validOpts = {convert: bool}; -validOpts = {allowUnknown: bool}; -validOpts = {skipFunctions: bool}; -validOpts = {stripUnknown: bool}; -validOpts = {language: bool}; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - -var renOpts: Joi.RenameOptions = null; - -renOpts = {alias: bool}; -renOpts = {multiple: bool}; -renOpts = {override: bool}; - -var validErr: Joi.ValidationError = null; - -// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - var schema: Joi.Schema = null; var anySchema: Joi.AnySchema = null; @@ -61,9 +40,66 @@ var binSchema: Joi.BinarySchema = null; var dateSchema: Joi.DateSchema = null; var funcSchema: Joi.FunctionSchema = null; var objSchema: Joi.ObjectSchema = null; +var altSchema: Joi.AlternativesSchema = null; var schemaArr: Joi.Schema[] = []; +var ref: Joi.Reference = null; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var validOpts: Joi.ValidationOptions = null; + +validOpts = {abortEarly: bool}; +validOpts = {convert: bool}; +validOpts = {allowUnknown: bool}; +validOpts = {skipFunctions: bool}; +validOpts = {stripUnknown: bool}; +validOpts = {language: bool}; +validOpts = {context: obj}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var renOpts: Joi.RenameOptions = null; + +renOpts = {alias: bool}; +renOpts = {multiple: bool}; +renOpts = {override: bool}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var whenOpts: Joi.WhenOptions = null; + +whenOpts = {is: schema}; +whenOpts = {is: schema, then: schema}; +whenOpts = {is: schema, otherwise: schema}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var refOpts: Joi.ReferenceOptions = null; + +refOpts = {alias: bool}; +refOpts = {multiple: bool}; +refOpts = {override: bool}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var validErr: Joi.ValidationError = null; +var validErrItem: Joi.ValidationErrorItem; + +validErrItem= { + message: str, + type: str, + path: str +}; + +validErrItem = { + message: str, + type: str, + path: str, + options: validOpts +}; + // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- schema = anySchema; @@ -76,6 +112,8 @@ schema = dateSchema; schema = funcSchema; schema = objSchema; +schema = ref; + anySchema = anySchema; anySchema = numSchema; anySchema = strSchema; @@ -99,18 +137,22 @@ schemaMap = { anySchema = Joi.any(); -anySchema.validate(x, (err: Joi.ValidationError, value: any) => { - -}); - module common { anySchema = anySchema.allow(x); + anySchema = anySchema.allow(x, x); + anySchema = anySchema.allow([x, x, x]); anySchema = anySchema.valid(x); + anySchema = anySchema.valid(x, x); + anySchema = anySchema.valid([x, x, x]); anySchema = anySchema.invalid(x); + anySchema = anySchema.invalid(x, x); + anySchema = anySchema.invalid([x, x, x]); + anySchema = anySchema.default(x); anySchema = anySchema.required(); anySchema = anySchema.optional(); + anySchema = anySchema.forbidden(); anySchema = anySchema.description(str); anySchema = anySchema.notes(str); @@ -118,8 +160,16 @@ module common { anySchema = anySchema.tags(str); anySchema = anySchema.tags(strArr); + anySchema = anySchema.meta(obj); + anySchema = anySchema.example(obj); + anySchema = anySchema.unit(str); + anySchema = anySchema.options(validOpts); anySchema = anySchema.strict(); + anySchema = anySchema.concat(x); + + altSchema = anySchema.when(str, whenOpts); + altSchema = anySchema.when(ref, whenOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -140,14 +190,23 @@ arrSchema = arrSchema.excludes([numSchema, strSchema]); // - - - - - - - - -module common { - arrSchema = arrSchema.allow(anyArr); - arrSchema = arrSchema.valid(anyArr); - arrSchema = arrSchema.invalid(anyArr); - arrSchema = arrSchema.default(anyArr); +module common_copy_paste { + // use search & replace from any + anySchema = anySchema.allow(x); + anySchema = anySchema.allow(x, x); + anySchema = anySchema.allow([x, x, x]); + anySchema = anySchema.valid(x); + anySchema = anySchema.valid(x, x); + anySchema = anySchema.valid([x, x, x]); + anySchema = anySchema.invalid(x); + anySchema = anySchema.invalid(x, x); + anySchema = anySchema.invalid([x, x, x]); + + anySchema = anySchema.default(x); arrSchema = arrSchema.required(); arrSchema = arrSchema.optional(); + arrSchema = arrSchema.forbidden(); arrSchema = arrSchema.description(str); arrSchema = arrSchema.notes(str); @@ -155,8 +214,16 @@ module common { arrSchema = arrSchema.tags(str); arrSchema = arrSchema.tags(strArr); + arrSchema = arrSchema.meta(obj); + arrSchema = arrSchema.example(obj); + arrSchema = arrSchema.unit(str); + arrSchema = arrSchema.options(validOpts); arrSchema = arrSchema.strict(); + arrSchema = arrSchema.concat(x); + + altSchema = arrSchema.when(str, whenOpts); + altSchema = arrSchema.when(ref, whenOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -164,14 +231,22 @@ module common { boolSchema = Joi.bool(); boolSchema = Joi.boolean(); -module common { - boolSchema = boolSchema.allow(bool); - boolSchema = boolSchema.valid(bool); - boolSchema = boolSchema.invalid(bool); - boolSchema = boolSchema.default(bool); +module common_copy_paste { + boolSchema = boolSchema.allow(x); + boolSchema = boolSchema.allow(x, x); + boolSchema = boolSchema.allow([x, x, x]); + boolSchema = boolSchema.valid(x); + boolSchema = boolSchema.valid(x, x); + boolSchema = boolSchema.valid([x, x, x]); + boolSchema = boolSchema.invalid(x); + boolSchema = boolSchema.invalid(x, x); + boolSchema = boolSchema.invalid([x, x, x]); + + boolSchema = boolSchema.default(x); boolSchema = boolSchema.required(); boolSchema = boolSchema.optional(); + boolSchema = boolSchema.forbidden(); boolSchema = boolSchema.description(str); boolSchema = boolSchema.notes(str); @@ -179,8 +254,16 @@ module common { boolSchema = boolSchema.tags(str); boolSchema = boolSchema.tags(strArr); + boolSchema = boolSchema.meta(obj); + boolSchema = boolSchema.example(obj); + boolSchema = boolSchema.unit(str); + boolSchema = boolSchema.options(validOpts); boolSchema = boolSchema.strict(); + boolSchema = boolSchema.concat(x); + + altSchema = boolSchema.when(str, whenOpts); + altSchema = boolSchema.when(ref, whenOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -192,13 +275,21 @@ binSchema = binSchema.max(num); binSchema = binSchema.length(num); module common { - binSchema = binSchema.allow(bin); - binSchema = binSchema.valid(bin); - binSchema = binSchema.invalid(bin); - binSchema = binSchema.default(bin); + binSchema = binSchema.allow(x); + binSchema = binSchema.allow(x, x); + binSchema = binSchema.allow([x, x, x]); + binSchema = binSchema.valid(x); + binSchema = binSchema.valid(x, x); + binSchema = binSchema.valid([x, x, x]); + binSchema = binSchema.invalid(x); + binSchema = binSchema.invalid(x, x); + binSchema = binSchema.invalid([x, x, x]); + + binSchema = binSchema.default(x); binSchema = binSchema.required(); binSchema = binSchema.optional(); + binSchema = binSchema.forbidden(); binSchema = binSchema.description(str); binSchema = binSchema.notes(str); @@ -206,8 +297,16 @@ module common { binSchema = binSchema.tags(str); binSchema = binSchema.tags(strArr); + binSchema = binSchema.meta(obj); + binSchema = binSchema.example(obj); + binSchema = binSchema.unit(str); + binSchema = binSchema.options(validOpts); binSchema = binSchema.strict(); + binSchema = binSchema.concat(x); + + altSchema = binSchema.when(str, whenOpts); + altSchema = binSchema.when(ref, whenOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -224,23 +323,21 @@ dateSchema = dateSchema.min(num); dateSchema = dateSchema.max(num); module common { - dateSchema = dateSchema.allow(date); - dateSchema = dateSchema.valid(date); - dateSchema = dateSchema.invalid(date); - dateSchema = dateSchema.default(date); - - dateSchema = dateSchema.allow(num); - dateSchema = dateSchema.valid(num); - dateSchema = dateSchema.invalid(num); - dateSchema = dateSchema.default(num); - - dateSchema = dateSchema.allow(str); - dateSchema = dateSchema.valid(str); - dateSchema = dateSchema.invalid(str); - dateSchema = dateSchema.default(str); + dateSchema = dateSchema.allow(x); + dateSchema = dateSchema.allow(x, x); + dateSchema = dateSchema.allow([x, x, x]); + dateSchema = dateSchema.valid(x); + dateSchema = dateSchema.valid(x, x); + dateSchema = dateSchema.valid([x, x, x]); + dateSchema = dateSchema.invalid(x); + dateSchema = dateSchema.invalid(x, x); + dateSchema = dateSchema.invalid([x, x, x]); + + dateSchema = dateSchema.default(x); dateSchema = dateSchema.required(); dateSchema = dateSchema.optional(); + dateSchema = dateSchema.forbidden(); dateSchema = dateSchema.description(str); dateSchema = dateSchema.notes(str); @@ -248,8 +345,16 @@ module common { dateSchema = dateSchema.tags(str); dateSchema = dateSchema.tags(strArr); + dateSchema = dateSchema.meta(obj); + dateSchema = dateSchema.example(obj); + dateSchema = dateSchema.unit(str); + dateSchema = dateSchema.options(validOpts); dateSchema = dateSchema.strict(); + dateSchema = dateSchema.concat(x); + + altSchema = dateSchema.when(str, whenOpts); + altSchema = dateSchema.when(ref, whenOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -265,13 +370,21 @@ numSchema = numSchema.max(num); numSchema = numSchema.integer(); module common { - numSchema = numSchema.allow(num); - numSchema = numSchema.valid(num); - numSchema = numSchema.invalid(num); - numSchema = numSchema.default(num); + numSchema = numSchema.allow(x); + numSchema = numSchema.allow(x, x); + numSchema = numSchema.allow([x, x, x]); + numSchema = numSchema.valid(x); + numSchema = numSchema.valid(x, x); + numSchema = numSchema.valid([x, x, x]); + numSchema = numSchema.invalid(x); + numSchema = numSchema.invalid(x, x); + numSchema = numSchema.invalid([x, x, x]); + + numSchema = numSchema.default(x); numSchema = numSchema.required(); numSchema = numSchema.optional(); + numSchema = numSchema.forbidden(); numSchema = numSchema.description(str); numSchema = numSchema.notes(str); @@ -279,8 +392,16 @@ module common { numSchema = numSchema.tags(str); numSchema = numSchema.tags(strArr); + numSchema = numSchema.meta(obj); + numSchema = numSchema.example(obj); + numSchema = numSchema.unit(str); + numSchema = numSchema.options(validOpts); numSchema = numSchema.strict(); + numSchema = numSchema.concat(x); + + altSchema = numSchema.when(str, whenOpts); + altSchema = numSchema.when(ref, whenOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -295,29 +416,48 @@ objSchema = objSchema.min(num); objSchema = objSchema.max(num); objSchema = objSchema.length(num); +objSchema = objSchema.pattern(exp, schema); + +objSchema = objSchema.and(str, str, str); +objSchema = objSchema.and(strArr); + +objSchema = objSchema.or(str, str, str); +objSchema = objSchema.or(strArr); + +objSchema = objSchema.xor(str, str, str); +objSchema = objSchema.xor(strArr); + objSchema = objSchema.with(str, str); objSchema = objSchema.with(str, strArr); objSchema = objSchema.without(str, str); objSchema = objSchema.without(str, strArr); -objSchema = objSchema.xor(str, str, str); -objSchema = objSchema.xor(strArr); - -objSchema = objSchema.or(str, str, str); -objSchema = objSchema.or(strArr); - objSchema = objSchema.rename(str, str); objSchema = objSchema.rename(str, str, renOpts); +objSchema = objSchema.assert(str, schema, str); +objSchema = objSchema.assert(ref, schema, str); + +objSchema = objSchema.unknown(); +objSchema = objSchema.unknown(bool); + module common { - objSchema = objSchema.allow(obj); - objSchema = objSchema.valid(obj); - objSchema = objSchema.invalid(obj); - objSchema = objSchema.default(obj); + objSchema = objSchema.allow(x); + objSchema = objSchema.allow(x, x); + objSchema = objSchema.allow([x, x, x]); + objSchema = objSchema.valid(x); + objSchema = objSchema.valid(x, x); + objSchema = objSchema.valid([x, x, x]); + objSchema = objSchema.invalid(x); + objSchema = objSchema.invalid(x, x); + objSchema = objSchema.invalid([x, x, x]); + + objSchema = objSchema.default(x); objSchema = objSchema.required(); objSchema = objSchema.optional(); + objSchema = objSchema.forbidden(); objSchema = objSchema.description(str); objSchema = objSchema.notes(str); @@ -325,8 +465,16 @@ module common { objSchema = objSchema.tags(str); objSchema = objSchema.tags(strArr); + objSchema = objSchema.meta(obj); + objSchema = objSchema.example(obj); + objSchema = objSchema.unit(str); + objSchema = objSchema.options(validOpts); objSchema = objSchema.strict(); + objSchema = objSchema.concat(x); + + altSchema = objSchema.when(str, whenOpts); + altSchema = objSchema.when(ref, whenOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -343,35 +491,43 @@ strSchema = strSchema.token(); strSchema = strSchema.email(); strSchema = strSchema.guid(); strSchema = strSchema.isoDate(); +strSchema = strSchema.lowercase(); +strSchema = strSchema.uppercase(); +strSchema = strSchema.trim(); module common { strSchema = strSchema.allow(x); strSchema = strSchema.allow(x, x); - strSchema = strSchema.allow(anyArr); - + strSchema = strSchema.allow([x, x, x]); strSchema = strSchema.valid(x); strSchema = strSchema.valid(x, x); - strSchema = strSchema.valid(anyArr); - + strSchema = strSchema.valid([x, x, x]); strSchema = strSchema.invalid(x); strSchema = strSchema.invalid(x, x); - strSchema = strSchema.invalid(anyArr); + strSchema = strSchema.invalid([x, x, x]); + + strSchema = strSchema.default(x); strSchema = strSchema.required(); - strSchema = strSchema.optional(); + strSchema = strSchema.forbidden(); strSchema = strSchema.description(str); - strSchema = strSchema.notes(str); strSchema = strSchema.notes(strArr); - strSchema = strSchema.tags(str); strSchema = strSchema.tags(strArr); + strSchema = strSchema.meta(obj); + strSchema = strSchema.example(obj); + strSchema = strSchema.unit(str); + strSchema = strSchema.options(validOpts); strSchema = strSchema.strict(); - strSchema = strSchema.default(x); + strSchema = strSchema.concat(x); + + altSchema = strSchema.when(str, whenOpts); + altSchema = strSchema.when(ref, whenOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -390,6 +546,13 @@ Joi.validate(value, schema, validOpts, (err, value) => { str = err.details[0].message; str = err.details[0].type; }); +Joi.validate(value, schema, (err, value) => { + x = value; + str = err.message; + str = err.details[0].path; + str = err.details[0].message; + str = err.details[0].type; +}); // variant Joi.validate(num, schema, validOpts, (err, value) => { num = value; @@ -401,3 +564,8 @@ Joi.validate(value, {}); // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- schema = Joi.compile(obj); + +Joi.assert(obj, schema); + +ref = Joi.ref(str, refOpts); +ref = Joi.ref(str); diff --git a/joi/joi.d.ts b/joi/joi.d.ts index 10bc7225e..57e48a023 100644 --- a/joi/joi.d.ts +++ b/joi/joi.d.ts @@ -1,8 +1,10 @@ -// Type definitions for joi v4.0.0 +// Type definitions for joi v4.6.0 // Project: https://github.com/spumko/joi // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped +// TODO express type of Schema in a type-parameter (.default, .valid, .example etc) + declare module 'joi' { export interface ValidationOptions { @@ -18,6 +20,8 @@ declare module 'joi' { stripUnknown?: boolean; // overrides individual error messages. Defaults to no override ({}). language?: Object + // provides an external data set to be used in references + context?: Object; } export interface RenameOptions { @@ -29,6 +33,20 @@ declare module 'joi' { override?: boolean; } + export interface WhenOptions { + // the required condition joi type. + is: Schema; + // the alternative schema type if the condition is true. Required if otherwise is missing. + then?: Schema; + // the alternative schema type if the condition is false. Required if then is missing + otherwise?: Schema; + } + + export interface ReferenceOptions { + separator?: string; + contextPrefix?: string; + } + export interface ValidationError { message: string; details: ValidationErrorItem[]; @@ -48,12 +66,14 @@ declare module 'joi' { } export interface Schema extends AnySchema { + + } + + export interface Reference extends Schema { + } export interface AnySchema> { - - validate(value: U, options?: ValidationOptions, callback?: (err: ValidationError, value: U) => void): void; - /** * Whitelists a value */ @@ -82,6 +102,11 @@ declare module 'joi' { */ optional(): T; + /** + * Marks a key as forbidden which will not allow any value except undefined. Used to explicitly forbid keys. + */ + forbidden(): T; + /** * Annotates the key */ @@ -100,7 +125,22 @@ declare module 'joi' { tags(notes: string[]): T; /** - * Overrides the global validate() options for the current key and any sub-key + * Attaches metadata to the key. + */ + meta(meta: Object): T; + + /** + * Annotates the key with an example value, must be valid. + */ + example(value: any): T; + + /** + * Annotates the key with an unit name. + */ + unit(name: string): T; + + /** + * Overrides the global validate() options for the current key and any sub-key. */ options(options: ValidationOptions): T; @@ -110,9 +150,20 @@ declare module 'joi' { strict(): T; /** - * Sets a default value if the original value is undefined + * Sets a default value if the original value is undefined. */ default(value: any): T; + + /** + * Returns a new type that is the result of adding the rules of one type to another. + */ + concat(schema: T): T; + + /** + * Converts the type into an alternatives type where the conditions are merged into the type definition where: + */ + when(ref: string, options: WhenOptions): AlternativesSchema; + when(ref: Reference, options: WhenOptions): AlternativesSchema; } export interface BooleanSchema extends AnySchema { @@ -187,6 +238,20 @@ declare module 'joi' { */ isoDate(): StringSchema; + /** + * Requires the string value to be all lowercase. If the validation convert option is on (enabled by default), the string will be forced to lowercase. + */ + lowercase(): StringSchema; + + /** + * Requires the string value to be all uppercase. If the validation convert option is on (enabled by default), the string will be forced to uppercase. + */ + uppercase(): StringSchema; + + /** + * Requires the string value to contain no whitespace before or after. If the validation convert option is on (enabled by default), the string will be trimmed. + */ + trim(): StringSchema; } export interface ArraySchema extends AnySchema { @@ -240,6 +305,29 @@ declare module 'joi' { */ length(limit: number): ObjectSchema; + /** + * Specify validation rules for unknown keys matching a pattern. + */ + pattern(regex: RegExp, schema: Schema): ObjectSchema; + + /** + * Defines an all-or-nothing relationship between keys where if one of the peers is present, all of them are required as well. + */ + and(peer1: string, peer2: string, ...peers: string[]): ObjectSchema; + and(peers: string[]): ObjectSchema; + + /** + * Defines a relationship between keys where one of the peers is required (and more than one is allowed). + */ + or(peer1: string, peer2: string, ...peers: string[]): ObjectSchema; + or(peers: string[]): ObjectSchema; + + /** + * Defines an exclusive relationship between a set of keys. one of them is required but not at the same time where: + */ + xor(peer1: string, peer2: string, ...peers: string[]): ObjectSchema; + xor(peers: string[]): ObjectSchema; + /** * Requires the presence of other keys whenever the specified key is present. */ @@ -252,22 +340,21 @@ declare module 'joi' { without(key: string, peers: string): ObjectSchema; without(key: string, peers: string[]): ObjectSchema; - /** - * Defines an exclusive relationship between a set of keys. one of them is required but not at the same time where: - */ - xor(peer1: string, peer2: string, ...peers: string[]): ObjectSchema; - xor(peers: string[]): ObjectSchema; - - /** - * Defines a relationship between keys where one of the peers is required (and more than one is allowed). - */ - or(peer1: string, peer2: string, ...peers: string[]): ObjectSchema; - or(peers: string[]): ObjectSchema; - /** * Renames a key to another name (deletes the renamed key). */ rename(from: string, to: string, options?: RenameOptions): ObjectSchema; + + /** + * Verifies an assertion where. + */ + assert(ref: string, schema: Schema, message: string): ObjectSchema; + assert(ref: Reference, schema: Schema, message: string): ObjectSchema; + + /** + * Overrides the handling of unknown keys for the scope of the current object only (does not apply to children). + */ + unknown(allow?:boolean): ObjectSchema; } export interface BinarySchema extends AnySchema { @@ -308,6 +395,12 @@ declare module 'joi' { } + export interface AlternativesSchema extends AnySchema { + try(schemas: Schema[]): AlternativesSchema; + when(ref: string, options: WhenOptions): AlternativesSchema; + when(ref: Reference, options: WhenOptions): AlternativesSchema; + } + // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- /** @@ -368,10 +461,21 @@ declare module 'joi' { */ export function validate(value: T, schema: Schema, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void; export function validate(value: T, schema: Object, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void; + export function validate(value: T, schema: Schema, callback: (err: ValidationError, value: T) => void): void; + export function validate(value: T, schema: Object, callback: (err: ValidationError, value: T) => void): void; /** * Converts literal schema definition to joi schema object (or returns the same back if already a joi schema object). */ export function compile(schema: Object): Schema; + /** + * Validates a value against a schema and throws if validation fails. + */ + export function assert(value: any, schema: Schema): void; + + /** + * Generates a reference to the value of the named key. + */ + export function ref(key:string, options?: ReferenceOptions): Reference; } diff --git a/jqrangeslider/jqrangeslider.d.ts b/jqrangeslider/jqrangeslider.d.ts index ef688e5d9..b41df43c0 100644 --- a/jqrangeslider/jqrangeslider.d.ts +++ b/jqrangeslider/jqrangeslider.d.ts @@ -1,6 +1,6 @@ // Type definitions for jQRangeSlider 4.2.8 // Project: http://ghusse.github.com/jQRangeSlider -// Definitions by: Dániel Tar https://github.com/qcz +// Definitions by: Dániel Tar // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/jquery.address/jquery.address.d.ts b/jquery.address/jquery.address.d.ts index bbf91d84a..59f534eff 100644 --- a/jquery.address/jquery.address.d.ts +++ b/jquery.address/jquery.address.d.ts @@ -1,6 +1,6 @@ // Type definitions for jQuery.Address 1.5 // Project: https://github.com/asual/jquery-address -// Definitions by: Martin Duparc <@martinduparc> +// Definitions by: Martin Duparc // Definitions: https://github.com/borisyankov/DefinitelyTyped/ /// diff --git a/jquery.clientSideLogging/jquery.clientSideLogging.d.ts b/jquery.clientSideLogging/jquery.clientSideLogging.d.ts index b52f41be1..4f1318a1f 100644 --- a/jquery.clientSideLogging/jquery.clientSideLogging.d.ts +++ b/jquery.clientSideLogging/jquery.clientSideLogging.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jquery.clientSideLogging. +// Type definitions for jquery.clientSideLogging // Project: https://github.com/remybach/jQuery.clientSideLogging // Definitions by: Diullei Gomes // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/jquery.colorbox/jquery.colorbox.d.ts b/jquery.colorbox/jquery.colorbox.d.ts index d28422346..e13b0bbd5 100644 --- a/jquery.colorbox/jquery.colorbox.d.ts +++ b/jquery.colorbox/jquery.colorbox.d.ts @@ -1,6 +1,6 @@ // Type definitions for jQuery.Colorbox 1.4.15 // Project: http://www.jacklmoore.com/colorbox/ -// Definitions by: Gidon Junge <@gjunge> +// Definitions by: Gidon Junge // Definitions: https://github.com/borisyankov/DefinitelyTyped/ /// diff --git a/jquery.cycle/jquery.cycle.d.ts b/jquery.cycle/jquery.cycle.d.ts index dfe8e1c5c..b482eda80 100644 --- a/jquery.cycle/jquery.cycle.d.ts +++ b/jquery.cycle/jquery.cycle.d.ts @@ -1,6 +1,6 @@ -// Type definitions for jQuery.cycle.js 2.9999.81 (15-JAN-2013) +// Type definitions for jQuery.cycle.js // Project: http://jquery.malsup.com/cycle/ -// Definitions by: Franois Guillot +// Definitions by: François Guillot // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -90,4 +90,4 @@ interface Cycle { interface JQuery { cycle: Cycle; -} \ No newline at end of file +} diff --git a/jquery.cycle2/jquery.cycle2.d.ts b/jquery.cycle2/jquery.cycle2.d.ts index 699d2aff8..d27fbf1c8 100644 --- a/jquery.cycle2/jquery.cycle2.d.ts +++ b/jquery.cycle2/jquery.cycle2.d.ts @@ -1,5 +1,6 @@ // Type definitions for jQuery Cycle2 version 2.1.2 (build 20140216) -// Project: http://jquery.malsup.com/cycle2/ (also https://github.com/malsup/cycle2) +// Project: http://jquery.malsup.com/cycle2/ +// https://github.com/malsup/cycle2 // Definitions by: Donny Nadolny // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -140,4 +141,4 @@ declare module JQueryCycle2 { interface Transition { before(opts: Options, curr: Element, next: Element, fwd: boolean): void; } -} \ No newline at end of file +} diff --git a/jquery.dynatree/jquery.dynatree.d.ts b/jquery.dynatree/jquery.dynatree.d.ts index 91425644d..c2dc0f928 100644 --- a/jquery.dynatree/jquery.dynatree.d.ts +++ b/jquery.dynatree/jquery.dynatree.d.ts @@ -1,22 +1,23 @@ -// Type definitions for jquery.dynatree 1.2 +// Type definitions for jquery.dynatree 1.2.5 // Project: http://code.google.com/p/dynatree/ -// Definitions by: https://github.com/fdecampredon +// Definitions by: François de Campredon // Definitions: https://github.com/borisyankov/DefinitelyTyped /// +/// + +declare module JQueryUI { + interface UI { + dynatree: DynatreeNamespace + } +} interface JQuery { dynatree(options?: DynatreeOptions): DynaTree; dynatree(option?: string, ...rest: any[]): any; } -interface JQueryStatic { - ui: { - dynatree: DynatreeNamespace; - }; -} - interface DynaTree { activateKey(key: string): DynaTreeNode; count(): number; @@ -39,7 +40,7 @@ interface DynaTree { renderInvisibleNodes(): void; selectKey(key: string, flag: string): DynaTreeNode; serializeArray(stopOnParents: boolean): any[]; - toDict(): any; + toDict(includeRoot?: boolean): any; visit(fn: (node: DynaTreeNode) =>boolean, includeRoot: boolean): void; } @@ -77,6 +78,7 @@ interface DynaTreeNode { makeVisible(): boolean; move(targetNode: DynaTreeNode, mode: string): boolean; reload(force: boolean): void; + reloadChildren(callback?: (node: DynaTreeNode, isOk: boolean) => any): void; remove(): void; removeChildren(): void; render(useEffects: boolean, includeInvisible: boolean): void; @@ -177,7 +179,7 @@ interface DynaTreeDataModel { interface DynaTreeDNDOptions { autoExpandMS?: number; // Expand nodes after n milliseconds of hovering. preventVoidMoves?: boolean; // Prevent dropping nodes 'before self', etc. - + revert: boolean; // true: slide helper back to source if drop is rejected // Make tree nodes draggable: onDragStart?: (sourceNode: any) =>void; // Callback(sourceNode), return true, to enable dnd diff --git a/jquery.menuaim/jquery.menuaim.d.ts b/jquery.menuaim/jquery.menuaim.d.ts index 54215620a..86000419f 100644 --- a/jquery.menuaim/jquery.menuaim.d.ts +++ b/jquery.menuaim/jquery.menuaim.d.ts @@ -1,6 +1,6 @@ // Type definitions for jQuery-menu-aim // Project: https://github.com/kamens/jQuery-menu-aim -// Definitions by: Robert Fonseca-Ensor +// Definitions by: Robert Fonseca-Ensor // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/jquery.pjax/jquery.pjax-tests.ts b/jquery.pjax/jquery.pjax-tests.ts new file mode 100644 index 000000000..214bb3922 --- /dev/null +++ b/jquery.pjax/jquery.pjax-tests.ts @@ -0,0 +1,60 @@ +/// +/// + +function test_fn_pjax() { + $(document).pjax("a"); + $(document).pjax("a", "#pjax-container"); + $(document).pjax("a", { push: true }); + $(document).pjax("a", "#pjax-container", { push: true }); +} + +function test_pjax() { + $.pjax(); + $.pjax({ + url: "hello.html", + container: "#main" + }); +} + +function test_click() { + var event = $.Event("click"); + $.pjax.click(event, "#pjax-container"); + $.pjax.click(event, { container: "#pjax-container" }); + $.pjax.click(event, "#pjax-container", { push: true }); +} + +function test_submit() { + var event = $.Event("submit"); + $.pjax.submit(event, "#pjax-container"); + $.pjax.submit(event, { container: "#pjax-container" }); + $.pjax.submit(event, "#pjax-container", { push: true }); +} + +function test_enable() { + $.pjax.enable(); +} + +function test_disable() { + $.pjax.disable(); +} + +function test_reload() { + $.pjax.reload(); +} + +function test_defauluts() { + $.pjax.defaults = { + timeout: 650, + push: true, + replace: false, + type: 'GET', + dataType: 'html', + scrollTo: 0, + maxCacheLength: 20, + version: $.noop + }; +} + +function test_support() { + console.log($.support.pjax); +} diff --git a/jquery.pjax/jquery.pjax.d.ts b/jquery.pjax/jquery.pjax.d.ts new file mode 100644 index 000000000..621d87d21 --- /dev/null +++ b/jquery.pjax/jquery.pjax.d.ts @@ -0,0 +1,142 @@ +// Type definitions for jquery-pjax +// Project: https://github.com/defunkt/jquery-pjax +// Definitions by: Junle Li +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface PjaxSettings extends JQueryAjaxSettings { + /** + * A jQuery selector indicates where to stick the response body. E.g., $(container).html(xhr.responseBody). + * If it is not defined, the `data-pjax` attribute of the link will be treated as container. + * If such an attribute is not defined too, the context will be treated as container. + */ + container?: string; + + /** + * Whether to pushState the URL. Defaults to true. + */ + push?: boolean; + + /** + * Whether to replaceState the URL. Defaults to false. + */ + replace?: boolean; +} + +interface JQuery { + /** + * Tell PJAX to listen links with delegation selector that, when click on them, fetches the href with ajax into the container. + * Tries to make sure the back button and ctrl+click work the way you'd expect. + * If `options.container` is not defined, the `data-pjax` attribute of the link will be treated as container. + * If such an attribute is not defined too, the context runs with this statement will be treated as container. + * @param delegationSelector The selector to limit which links PJAX should listen on. + * @param options PJAX settings, which is a superset of jQuery AJAX settings. It includes the following specific options: + * - container: a jQuery selector indicates where to stick the response body. E.g., $(container).html(xhr.responseBody). + * - push: a boolean indicates whether to pushState the URL. Default is true. + * - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false. + * @return Returns the jQuery object + */ + pjax(delegationSelector: string, options?: PjaxSettings): JQuery; + + /** + * Tell PJAX to listen links with delegation selector that, when click on them, fetches the href with ajax into the container. + * Tries to make sure the back button and ctrl+click work the way you'd expect. + * If `options.container` is not defined, the `data-pjax` attribute of the link will be treated as container. + * If such an attribute is not defined too, the context runs with this statement will be treated as container. + * @param delegationSelector The selector to limit which links PJAX should listen on. + * @param containerSelector A jQuery selector indicates where to stick the response body. E.g., $(containerSelector).html(xhr.responseBody). + * @param options PJAX settings, which is a superset of jQuery AJAX settings. It includes the following specific options: + * - container: a jQuery selector indicates where to stick the response body. The `containerSelector` parameter has priority. + * - push: a boolean indicates whether to pushState the URL. Default is true. + * - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false. + * @return Returns the jQuery object + */ + pjax(delegationSelector: string, containerSelector?: string, options?: PjaxSettings): JQuery; +} + +interface JQueryStatic { + pjax: PjaxStatic; +} + +interface PjaxStatic { + /** + * PJAX default settings. + */ + defaults: PjaxSettings; + + /** + * Loads a URL with ajax, puts the response body inside a container, then pushState()'s the loaded URL. + * Works just like $.ajax in that it accepts a jQuery ajax settings object (with keys like url, type, data, etc). + * @param options PJAX settings, which is a superset of jQuery AJAX settings. It includes the following specific options: + * - container: a jQuery selector indicates where to stick the response body. E.g., $(container).html(xhr.responseBody). + * - push: a boolean indicates whether to pushState the URL. Default is true. + * - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false. + */ + (options?: PjaxSettings): JQueryXHR; + + /** + * PJAX on click handler. + * @param event A jQuery click event. + * @param options PJAX settings, which is a superset of jQuery AJAX settings. It includes the following specific options: + * - container: a jQuery selector indicates where to stick the response body. E.g., $(container).html(xhr.responseBody). + * - push: a boolean indicates whether to pushState the URL. Default is true. + * - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false. + */ + click(event: JQueryEventObject, options?: PjaxSettings): void; + + /** + * PJAX on click handler. + * @param event A jQuery click event. + * @param containerSelector A jQuery selector indicates where to stick the response body. E.g., $(containerSelector).html(xhr.responseBody). + * @param options PJAX settings, which is a superset of jQuery AJAX settings. It includes the following specific options: + * - container: a jQuery selector indicates where to stick the response body. The `containerSelector` parameter has priority. + * - push: a boolean indicates whether to pushState the URL. Default is true. + * - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false. + */ + click(event: JQueryEventObject, containerSelector?: string, options?: PjaxSettings): void; + + /** + * PJAX on form submit handler + * @param event A jQuery click event. + * @param options PJAX settings, which is a superset of jQuery AJAX settings. It includes the following specific options: + * - container: a jQuery selector indicates where to stick the response body. E.g., $(container).html(xhr.responseBody). + * - push: a boolean indicates whether to pushState the URL. Default is true. + * - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false. + */ + submit(event: JQueryEventObject, options?: PjaxSettings): void; + + /** + * PJAX on form submit handler + * @param event A jQuery click event. + * @param containerSelector A jQuery selector indicates where to stick the response body. E.g., $(containerSelector).html(xhr.responseBody). + * @param options PJAX settings, which is a superset of jQuery AJAX settings. It includes the following specific options: + * - container: a jQuery selector indicates where to stick the response body. The `containerSelector` parameter has priority. + * - push: a boolean indicates whether to pushState the URL. Default is true. + * - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false. + */ + submit(event: JQueryEventObject, containerSelector?: string, options?: PjaxSettings): void; + + /** + * Install pjax functions on $.pjax to enable pushState behavior. Does nothing if already enabled. + */ + enable(): void; + + /** + * Disable pushState behavior. + * This is the case when a browser doesn't support pushState. It is sometimes useful to disable pushState for debugging on a modern browser. + */ + disable(): void; + + /** + * Reload current page with pjax. + */ + reload(): JQueryXHR; +} + +interface JQuerySupport { + /** + * A boolean value indicates if pjax is supported by the browser. + */ + pjax: boolean; +} diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index d467a9999..73d0411d5 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -1,6 +1,6 @@ // Type definitions for jquery.pnotify 1.3.1 -// Project: https://github.com/sciactive/pnotify -// Definitions by: https://github.com/DavidSichau +// Project: https://github.com/sciactive/pnotify +// Definitions by: David Sichau // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/jquery.prettyphoto/jquery.prettyphoto-tests.ts b/jquery.prettyphoto/jquery.prettyphoto-tests.ts new file mode 100644 index 000000000..1cf3b40a8 --- /dev/null +++ b/jquery.prettyphoto/jquery.prettyphoto-tests.ts @@ -0,0 +1,34 @@ +// Tests for prettyPhoto library + +/// +/// + +// JQUERY + +$('#id').prettyPhoto(); + +$('#id').prettyPhoto({ animation_speed: 'fast' }); + +// JQUERYSTATIC + +$.prettyPhoto.changeGalleryPage('next'); + +$.prettyPhoto.changeGalleryPage('previous'); + +$.prettyPhoto.changePage('next'); + +$.prettyPhoto.changePage('previous'); + +$.prettyPhoto.close(); + +$.prettyPhoto.open(); + +$.prettyPhoto.open('test.jpg', 'title', 'description'); + +$.prettyPhoto.open(['test1.jpg', 'test2.jpg'], ['title1', 'title2'], ['description1', 'description2']); + +$.prettyPhoto.startSlideshow(); + +$.prettyPhoto.stopSlideshow(); + +$.prettyPhoto.version; diff --git a/jquery.prettyphoto/jquery.prettyphoto.d.ts b/jquery.prettyphoto/jquery.prettyphoto.d.ts new file mode 100644 index 000000000..f60de3b39 --- /dev/null +++ b/jquery.prettyphoto/jquery.prettyphoto.d.ts @@ -0,0 +1,290 @@ +// Type definitions for jQuery prettyPhoto 3.1.5 +// Project: https://github.com/scaron/prettyphoto +// Definitions by: pgaske +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module scaron_prettyPhoto { + /** + * Pretty photo settings + */ + interface PrettyPhotoSettings { + /** + * the attribute tag to use for prettyPhoto hooks. For HTML5, use "data-rel" or similar. + * @default 'rel' + */ + hook?: string; + + /** + * fast/slow/normal + * @default 'fast' + */ + animation_speed?: string; + + + ajaxcallback?: () => void; + + /** + * false OR interval time in ms + * @default 5000 + */ + slideshow?: any; + + /** + * true/false + * @default false + */ + autoplay_slideshow?: boolean; + + /** + * Value between 0 and 1 + * @default 0.80 + */ + opacity?: number; + + /** + * true/false + * @default true + */ + show_title?: boolean; + + /** + * Resize the photos bigger than viewport. true/false + * @default true + */ + allow_resize?: boolean; + + /** + * Allow the user to expand a resized image. true/false + * @default true + */ + allow_expand?: boolean; + + /** + * Pixels + * @default 500 + */ + default_width?: number; + + /** + * Pixels + * @default 344 + */ + default_height?: number; + + /** + * The separator for the gallery counter 1 "of" 2 + * @default '/' + */ + counter_separator_label?: string; + + /** + * light_rounded / dark_rounded / light_square / dark_square / facebook + * @default 'pp_default' + */ + theme?: string; + + /** + * The padding on each side of the picture + * @default 20 + */ + horizontal_padding?: number; + + /** + * Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto + * @default false + */ + hideflash?: boolean; + + /** + * Set the flash wmode attribute + * @default 'opaque' + */ + wmode?: string; + + /** + * Automatically start videos: True/False + * @default true + */ + autoplay?: boolean; + + /** + * If set to true, only the close button will close the window + * @default false + */ + modal?: boolean; + + /** + * Allow prettyPhoto to update the url to enable deeplinking. + * @default true + */ + deeplinking?: boolean; + + /** + * If set to true, a gallery will overlay the fullscreen image on mouse over + * @default true + */ + overlay_gallery?: boolean; + + /** + * Maximum number of pictures in the overlay gallery + * @default 30 + */ + overlay_gallery_max?: number; + + /** + * Set to false if you open forms inside prettyPhoto + * @default true + */ + keyboard_shortcuts?: boolean; + + /** + * Called everytime an item is shown/changed + * @default function () { } + */ + changepicturecallback?: () => void; + + /** + * Called when prettyPhoto is closed + * @default function () { } + */ + callback?: () => void; + + /** + * @default true + */ + ie6_fallback?: boolean; + + /** + * Markup for pretty photo + * @default omitted for brevity + */ + markup?: string; + + /** + * Markup for pretty photo gallery + * @default omitted for brevity + */ + gallery_markup?: string; + + /** + * Markup for image + * @default '' + */ + image_markup?: string; + + /** + * Markup for flash + * @default '' + */ + flash_markup?: string; + + /** + * Markup for quicktime + * @default '' + */ + quicktime_markup?: string; + + /** + * Markup for iframe + * @default '' + */ + iframe_markup?: string; + + /** + * @default '
{content}
' + */ + inline_markup?: string; + + /** + * @default '' + */ + custom_markup?: string; + + /** + * Markup for social tools, set to html or false to disable + * @default '' + */ + social_tools?: any; + } + + interface moduleJQuery { + /** + * Initialises prettyPhoto + */ + (): JQuery; + + /** + * Initialises prettyPhoto specificying overrides for the defaults + * @param pp_settings custom prettyPhoto settings + */ + (pp_settings: PrettyPhotoSettings): JQuery; + } + + interface moduleJQueryStatic { + /** + * prettyPhoto version number + */ + version: string; + + /** + * Opens the prettyPhoto modal box. + * Note: Always returns false. + */ + open(): boolean; + + /** + * Opens the prettyPhoto modal box. + * Note: Always returns false. + * @param image {String} Full path to the image to be open, can also be an array containing full images paths. + * @param title {String} The title to be displayed with the picture, can also be an array containing all the titles. + * @param description {String} The description to be displayed with the picture, can also be an array containing all the descriptions. + */ + open(image: string, title: string, description: string): boolean; + + /** + * Opens the prettyPhoto modal box. + * Note: Always returns false. + * @param image {Array} Full path to the image to be open, can also be an array containing full images paths. + * @param title {Array} The title to be displayed with the picture, can also be an array containing all the titles. + * @param description {Array} The description to be displayed with the picture, can also be an array containing all the descriptions. + */ + open(images: string[], titles: string[], descriptions: string[]): boolean; + + /** + * Change page in the prettyPhoto modal box + * @param direction {String} Direction of the paging, previous or next. + */ + changePage(direction: string): void; + + /** + * Change gallery page in the prettyPhoto modal box + * @param direction {String} Direction of the paging, previous or next. + */ + changeGalleryPage(direction: string): void; + + /** + * Start the slideshow... + */ + startSlideshow(): void; + + /** + * Stop the slideshow... + */ + stopSlideshow(): void; + + /** + * Closes prettyPhoto. + */ + close(): void; + } +} + +interface JQuery { + prettyPhoto: scaron_prettyPhoto.moduleJQuery; +} + +interface JQueryStatic { + prettyPhoto: scaron_prettyPhoto.moduleJQueryStatic; +} \ No newline at end of file diff --git a/jquery.tagsmanager/jquery.tagsmanager.d.ts b/jquery.tagsmanager/jquery.tagsmanager.d.ts index ce03f2dab..4523751c4 100644 --- a/jquery.tagsmanager/jquery.tagsmanager.d.ts +++ b/jquery.tagsmanager/jquery.tagsmanager.d.ts @@ -1,6 +1,6 @@ // Type definitions for jQuery Tags Manager // Project: http://welldonethings.com/tags/manager -// Definitions by: https://github.com/vbortone +// Definitions by: Vincent Bortone // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/jquery.timepicker/jquery.timepicker.d.ts b/jquery.timepicker/jquery.timepicker.d.ts index a63e073bb..13a6d2e69 100644 --- a/jquery.timepicker/jquery.timepicker.d.ts +++ b/jquery.timepicker/jquery.timepicker.d.ts @@ -1,6 +1,6 @@ // Type definitions for jQuery UI Timepicker 0.3 // Project: http://fgelinas.com/code/timepicker/ -// Definitions by: https://github.com/anwarjaved +// Definitions by: Anwar Javed // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts b/jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts index 9d452332b..4e592e728 100644 --- a/jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts +++ b/jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts @@ -1,7 +1,6 @@ -// Type definitions for jQuery UI DateTimePicker 0.3 Addon -// +// Type definitions for jQuery UI DateTimePicker 0.3 // Project: http://trentrichardson.com/examples/timepicker/ -// Definitions by: https://github.com/dougajmcdonald +// Definitions by: dougajmcdonald // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/jquery.validation/jquery.validation.d.ts b/jquery.validation/jquery.validation.d.ts index d0bee3279..f66edadab 100644 --- a/jquery.validation/jquery.validation.d.ts +++ b/jquery.validation/jquery.validation.d.ts @@ -1,6 +1,6 @@ // Type definitions for jquery.validation 1.11.1 -// Project: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ -// Definitions by: https://github.com/fdecampredon , https://github.com/johnnyreilly +// Project: http://jqueryvalidation.org/ +// Definitions by: François de Campredon , Johj Reilly // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/jquery.watermark/jquery.watermark.d.ts b/jquery.watermark/jquery.watermark.d.ts index fd233ee67..cb746bee6 100644 --- a/jquery.watermark/jquery.watermark.d.ts +++ b/jquery.watermark/jquery.watermark.d.ts @@ -1,6 +1,6 @@ // Type definitions for Watermark plugin for jQuery 3.1 // Project: http://jquery-watermark.googlecode.com -// Definitions by: https://github.com/anwarjaved +// Definitions by: Anwar Javed // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -27,4 +27,4 @@ interface JQuery { interface JQueryStatic { watermark: Watermark; -} \ No newline at end of file +} diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 81ddb3ae1..62c237b47 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -6,7 +6,7 @@ function test_add() { $('li').add('p').css('background-color', 'red'); $('li').add(document.getElementsByTagName('p')[0]) - .css('background-color', 'red'); + .css('background-coailor', 'red'); $('li').add('

new paragraph

') .css('background-color', 'red'); $("div").css("border", "2px solid red") @@ -86,6 +86,9 @@ function test_ajax() { success: function (data) { $('.result').html(data); alert('Load was performed.'); + }, + error: function (jqXHR, textStatus, errorThrown) { + alert('Load failed. responseJSON=' + jqXHR.responseJSON); } }); var _super = jQuery.ajaxSettings.xhr; @@ -3114,6 +3117,9 @@ function test_parseHTML() { $( "
    " ) .append( nodeNames.join( "" ) ) .appendTo( $log ); + + // parse HTML with all parameters + $.parseHTML( str, document, true ); } // http://api.jquery.com/jQuery.parseJSON/ diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 70a9532ab..f17e166b0 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1,6 +1,6 @@ // Type definitions for jQuery 1.10.x / 2.0.x // Project: http://jquery.com/ -// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton, Diullei Gomes , Tass Iliopoulos , Jason Swearingen, Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly +// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly // Definitions: https://github.com/borisyankov/DefinitelyTyped /* ***************************************************************************** @@ -80,7 +80,7 @@ interface JQueryAjaxSettings { /** * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. */ - error? (jqXHR: JQueryXHR, textStatus: string, errorThrow: string): any; + error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; /** * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. */ @@ -168,6 +168,10 @@ interface JQueryXHR extends XMLHttpRequest, JQueryPromise { */ overrideMimeType(mimeType: string): any; abort(statusText?: string): void; + /** + * Property containing the parsed response if the response Content-Type is json + */ + responseJSON?: any; } /** @@ -1252,6 +1256,15 @@ interface JQueryStatic { * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string */ parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; + + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + */ + parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; } /** @@ -2421,6 +2434,7 @@ interface JQuery { dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "focus" event on an element. diff --git a/js-fixtures/fixtures.d.ts b/js-fixtures/fixtures.d.ts index 92bd548e0..4adb6f378 100644 --- a/js-fixtures/fixtures.d.ts +++ b/js-fixtures/fixtures.d.ts @@ -1,7 +1,7 @@ // Type definitions for js-fixtures 1.2.0 // Project: https://github.com/badunk/js-fixtures // Definitions by: Kazi Manzur Rashid -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface Fixtures { path: string; @@ -18,4 +18,4 @@ interface Fixtures { cleanUp(): void; } -declare var fixtures: Fixtures; \ No newline at end of file +declare var fixtures: Fixtures; diff --git a/js-signals/js-signals.d.ts b/js-signals/js-signals.d.ts index 4d7d33344..c64c6db2a 100644 --- a/js-signals/js-signals.d.ts +++ b/js-signals/js-signals.d.ts @@ -1,7 +1,7 @@ // Type definitions for JS-Signals // Project: http://millermedeiros.github.io/js-signals/ // Definitions by: Diullei Gomes -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface SignalBinding { active: boolean; diff --git a/js-url/js-url.d.ts b/js-url/js-url.d.ts index ff974f15e..e5df9c246 100644 --- a/js-url/js-url.d.ts +++ b/js-url/js-url.d.ts @@ -1,4 +1,4 @@ -// Type definitions for url() v1.8.6 +// Type definitions for url v1.8.6 // Project: https://github.com/websanova/js-url // Definitions by: MIZUNE Pine // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/jsplumb/jquery.jsPlumb.d.ts b/jsplumb/jquery.jsPlumb.d.ts index ffa26eea8..39d5bf869 100644 --- a/jsplumb/jquery.jsPlumb.d.ts +++ b/jsplumb/jquery.jsPlumb.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jsPlumb 1.3.16 jQuery adapter. +// Type definitions for jsPlumb 1.3.16 jQuery adapter // Project: http://jsplumb.org // Definitions by: Steve Shearn // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -19,26 +19,26 @@ interface jsPlumbInstance { addEndpoint(ep: string): any; removeClass(el: any, clazz: string): void; hasClass(el: any, clazz: string): void; - draggable(el: string, options?: DragOptions): jsPlumbInstance; - draggable(ids: string[], options?: DragOptions): jsPlumbInstance; + draggable(el: string, options?: DragOptions): jsPlumbInstance; + draggable(ids: string[], options?: DragOptions): jsPlumbInstance; connect(connection: ConnectParams, referenceParams?: ConnectParams): Connection; makeSource(el: string, options: SourceOptions): void; makeTarget(el: string, options: TargetOptions): void; repaintEverything(): void; detachEveryConnection(): void; detachAllConnections(el: string): void; - removeAllEndpoints(el: string, recurse?: boolean): jsPlumbInstance; - removeAllEndpoints(el: Element, recurse?: boolean): jsPlumbInstance; + removeAllEndpoints(el: string, recurse?: boolean): jsPlumbInstance; + removeAllEndpoints(el: Element, recurse?: boolean): jsPlumbInstance; select(params: SelectParams): Connections; getConnections(options?: any, flat?: any): any[]; - deleteEndpoint(uuid: string, doNotRepaintAfterwards?: boolean): jsPlumbInstance; - deleteEndpoint(endpoint: Endpoint, doNotRepaintAfterwards?: boolean): jsPlumbInstance; - repaint(el: string): jsPlumbInstance; - repaint(el: Element): jsPlumbInstance; - - SVG: string; - CANVAS: string; - VML: string; + deleteEndpoint(uuid: string, doNotRepaintAfterwards?: boolean): jsPlumbInstance; + deleteEndpoint(endpoint: Endpoint, doNotRepaintAfterwards?: boolean): jsPlumbInstance; + repaint(el: string): jsPlumbInstance; + repaint(el: Element): jsPlumbInstance; + + SVG: string; + CANVAS: string; + VML: string; } interface Defaults { @@ -48,8 +48,8 @@ interface Defaults { ConnectionsDetachable?: boolean; ReattachConnections?: boolean; ConnectionOverlays?: any[][]; - Container?: any; // string(selector or id) or element - DragOptions?: DragOptions; + Container?: any; // string(selector or id) or element + DragOptions?: DragOptions; } interface PaintStyle { @@ -76,8 +76,8 @@ interface Connections { } interface ConnectParams { - source?: any; // string, element or endpoint - target?: any; // string, element or endpoint + source?: any; // string, element or endpoint + target?: any; // string, element or endpoint detachable?: boolean; deleteEndpointsOnDetach?: boolean; endPoint?: string; @@ -118,11 +118,11 @@ interface SelectParams { target: string; } -interface Connection { - setDetachable(detachable: boolean): void; - setParameter(name: string, value: T): void; - endpoints: Endpoint[]; -} - -interface Endpoint { -} \ No newline at end of file +interface Connection { + setDetachable(detachable: boolean): void; + setParameter(name: string, value: T): void; + endpoints: Endpoint[]; +} + +interface Endpoint { +} diff --git a/jsrender/jsrender.d.ts b/jsrender/jsrender.d.ts index 8cdfa13a1..755b17f93 100644 --- a/jsrender/jsrender.d.ts +++ b/jsrender/jsrender.d.ts @@ -1,6 +1,6 @@ // Type definitions for JsRender // Project: http://www.jsviews.com/#jsrender -// Definitions by: https://github.com/zakki +// Definitions by: Kensuke Matsuzaki // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/jstree/jstree.d.ts b/jstree/jstree.d.ts index 7d8561ed4..4039795ba 100644 --- a/jstree/jstree.d.ts +++ b/jstree/jstree.d.ts @@ -121,11 +121,11 @@ interface JSTreeStaticDefaults { * stores all defaults for the search plugin */ search?: JSTreeStaticDefaultsSearch; - /** - * the settings function used to sort the nodes. - * It is executed in the tree's context, accepts two nodes as arguments and should return `1` or `-1`. - * @name $.jstree.defaults.sort - * @plugin sort + /** + * the settings function used to sort the nodes. + * It is executed in the tree's context, accepts two nodes as arguments and should return `1` or `-1`. + * @name $.jstree.defaults.sort + * @plugin sort */ sort?: (x: any, y: any) => number; /** @@ -151,125 +151,131 @@ interface JSTreeStaticDefaults { * default represents the default node - any settings here will be applied to all nodes that do not have a type specified. */ types?: any; + /** + * stores all defaults for the unique plugin + * @name $.jstree.defaults.unique + * @plugin unique + */ + unique?: JSTreeStaticDefaultsUnique; } interface JSTreeStaticDefaultsCore { /** - * data configuration - * - * If left as `false` the HTML inside the jstree container element is used to populate the tree (that should be an unordered list with list items). - * - * You can also pass in a HTML string or a JSON array here. - * - * It is possible to pass in a standard jQuery-like AJAX config and jstree will automatically determine if the response is JSON or HTML and use that to populate the tree. - * In addition to the standard jQuery ajax options here you can suppy functions for `data` and `url`, the functions will be run in the current instance's scope and a param will be passed indicating which node is being loaded, the return value of those functions will be used. - * - * The last option is to specify a function, that function will receive the node being loaded as argument and a second param which is a function which should be called with the result. - * - * __Examples__ - * - * // AJAX - * $('#tree').jstree({ - * 'core' : { - * 'data' : { - * 'url' : '/get/children/', - * 'data' : function (node) { - * return { 'id' : node.id }; - * } - * } - * }); - * - * // direct data - * $('#tree').jstree({ - * 'core' : { - * 'data' : [ - * 'Simple root node', - * { - * 'id' : 'node_2', - * 'text' : 'Root node with options', - * 'state' : { 'opened' : true, 'selected' : true }, - * 'children' : [ { 'text' : 'Child 1' }, 'Child 2'] - * } - * ] - * }); - * - * // function - * $('#tree').jstree({ - * 'core' : { - * 'data' : function (obj, callback) { - * callback.call(this, ['Root 1', 'Root 2']); - * } - * }); - * - * @name $.jstree.defaults.core.data + * data configuration + * + * If left as `false` the HTML inside the jstree container element is used to populate the tree (that should be an unordered list with list items). + * + * You can also pass in a HTML string or a JSON array here. + * + * It is possible to pass in a standard jQuery-like AJAX config and jstree will automatically determine if the response is JSON or HTML and use that to populate the tree. + * In addition to the standard jQuery ajax options here you can suppy functions for `data` and `url`, the functions will be run in the current instance's scope and a param will be passed indicating which node is being loaded, the return value of those functions will be used. + * + * The last option is to specify a function, that function will receive the node being loaded as argument and a second param which is a function which should be called with the result. + * + * __Examples__ + * + * // AJAX + * $('#tree').jstree({ + * 'core' : { + * 'data' : { + * 'url' : '/get/children/', + * 'data' : function (node) { + * return { 'id' : node.id }; + * } + * } + * }); + * + * // direct data + * $('#tree').jstree({ + * 'core' : { + * 'data' : [ + * 'Simple root node', + * { + * 'id' : 'node_2', + * 'text' : 'Root node with options', + * 'state' : { 'opened' : true, 'selected' : true }, + * 'children' : [ { 'text' : 'Child 1' }, 'Child 2'] + * } + * ] + * }); + * + * // function + * $('#tree').jstree({ + * 'core' : { + * 'data' : function (obj, callback) { + * callback.call(this, ['Root 1', 'Root 2']); + * } + * }); + * + * @name $.jstree.defaults.core.data */ data?: any; /** - * configure the various strings used throughout the tree - * - * You can use an object where the key is the string you need to replace and the value is your replacement. - * Another option is to specify a function which will be called with an argument of the needed string and should return the replacement. - * If left as `false` no replacement is made. - * - * __Examples__ - * - * $('#tree').jstree({ - * 'core' : { - * 'strings' : { - * 'Loading...' : 'Please wait ...' - * } - * } - * }); - * - * @name $.jstree.defaults.core.strings + * configure the various strings used throughout the tree + * + * You can use an object where the key is the string you need to replace and the value is your replacement. + * Another option is to specify a function which will be called with an argument of the needed string and should return the replacement. + * If left as `false` no replacement is made. + * + * __Examples__ + * + * $('#tree').jstree({ + * 'core' : { + * 'strings' : { + * 'Loading...' : 'Please wait ...' + * } + * } + * }); + * + * @name $.jstree.defaults.core.strings */ strings?: any; /** - * determines what happens when a user tries to modify the structure of the tree - * If left as `false` all operations like create, rename, delete, move or copy are prevented. - * You can set this to `true` to allow all interactions or use a function to have better control. - * - * __Examples__ - * - * $('#tree').jstree({ - * 'core' : { - * 'check_callback' : function (operation, node, node_parent, node_position, more) { - * // operation can be 'create_node', 'rename_node', 'delete_node', 'move_node' or 'copy_node' - * // in case of 'rename_node' node_position is filled with the new node name - * return operation === 'rename_node' ? true : false; - * } - * } - * }); - * - * @name $.jstree.defaults.core.check_callback + * determines what happens when a user tries to modify the structure of the tree + * If left as `false` all operations like create, rename, delete, move or copy are prevented. + * You can set this to `true` to allow all interactions or use a function to have better control. + * + * __Examples__ + * + * $('#tree').jstree({ + * 'core' : { + * 'check_callback' : function (operation, node, node_parent, node_position, more) { + * // operation can be 'create_node', 'rename_node', 'delete_node', 'move_node' or 'copy_node' + * // in case of 'rename_node' node_position is filled with the new node name + * return operation === 'rename_node' ? true : false; + * } + * } + * }); + * + * @name $.jstree.defaults.core.check_callback */ check_callback?: any; - /** - * a callback called with a single object parameter in the instance's scope when something goes wrong (operation prevented, ajax failed, etc) - * @name $.jstree.defaults.core.error + /** + * a callback called with a single object parameter in the instance's scope when something goes wrong (operation prevented, ajax failed, etc) + * @name $.jstree.defaults.core.error */ error: () => any; - /** - * the open / close animation duration in milliseconds - set this to `false` to disable the animation (default is `200`) - * @name $.jstree.defaults.core.animation + /** + * the open / close animation duration in milliseconds - set this to `false` to disable the animation (default is `200`) + * @name $.jstree.defaults.core.animation */ animation?: any; - /** - * a boolean indicating if multiple nodes can be selected - * @name $.jstree.defaults.core.multiple + /** + * a boolean indicating if multiple nodes can be selected + * @name $.jstree.defaults.core.multiple */ multiple?: boolean; - /** - * theme configuration object - * @name $.jstree.defaults.core.themes + /** + * theme configuration object + * @name $.jstree.defaults.core.themes */ themes?: JSTreeStaticDefaultsCoreThemes; - /** - * if left as `true` all parents of all selected nodes will be opened once the tree loads (so that all selected nodes are visible to the user) - * @name $.jstree.defaults.core.expand_selected_onload + /** + * if left as `true` all parents of all selected nodes will be opened once the tree loads (so that all selected nodes are visible to the user) + * @name $.jstree.defaults.core.expand_selected_onload */ expand_selected_onload?: boolean; } @@ -315,186 +321,203 @@ interface JSTreeStaticDefaultsCoreThemes { } interface JSTreeStaticDefaultsCheckbox { - /** - * a boolean indicating if checkboxes should be visible (can be changed at a later time using `show_checkboxes()` and `hide_checkboxes`). Defaults to `true`. - * @name $.jstree.defaults.checkbox.visible - * @plugin checkbox + /** + * a boolean indicating if checkboxes should be visible (can be changed at a later time using `show_checkboxes()` and `hide_checkboxes`). Defaults to `true`. + * @name $.jstree.defaults.checkbox.visible + * @plugin checkbox */ visible: boolean; - /** - * a boolean indicating if checkboxes should cascade down and have an undetermined state. Defaults to `true`. - * @name $.jstree.defaults.checkbox.three_state - * @plugin checkbox + /** + * a boolean indicating if checkboxes should cascade down and have an undetermined state. Defaults to `true`. + * @name $.jstree.defaults.checkbox.three_state + * @plugin checkbox */ three_state: boolean; - /** - * a boolean indicating if clicking anywhere on the node should act as clicking on the checkbox. Defaults to `true`. - * @name $.jstree.defaults.checkbox.whole_node - * @plugin checkbox + /** + * a boolean indicating if clicking anywhere on the node should act as clicking on the checkbox. Defaults to `true`. + * @name $.jstree.defaults.checkbox.whole_node + * @plugin checkbox */ whole_node: boolean; - /** - * a boolean indicating if the selected style of a node should be kept, or removed. Defaults to `true`. - * @name $.jstree.defaults.checkbox.keep_selected_style - * @plugin checkbox + /** + * a boolean indicating if the selected style of a node should be kept, or removed. Defaults to `true`. + * @name $.jstree.defaults.checkbox.keep_selected_style + * @plugin checkbox */ keep_selected_style: boolean; + /** + * This setting controls how cascading and undetermined nodes are applied. + * If 'up' is in the string - cascading up is enabled, if 'down' is in the string - cascading down is enabled, if 'undetermined' is in the string - undetermined nodes will be used. + * If `three_state` is set to `true` this setting is automatically set to 'up+down+undetermined'. Defaults to ''. + * @name $.jstree.defaults.checkbox.cascade + * @plugin checkbox + */ + cascade:boolean; } interface JSTreeStaticDefaultsContextMenu { - /** - * a boolean indicating if the node should be selected when the context menu is invoked on it. Defaults to `true`. - * @name $.jstree.defaults.contextmenu.select_node - * @plugin contextmenu + /** + * a boolean indicating if the node should be selected when the context menu is invoked on it. Defaults to `true`. + * @name $.jstree.defaults.contextmenu.select_node + * @plugin contextmenu */ select_node: boolean; - /** - * a boolean indicating if the menu should be shown aligned with the node. Defaults to `true`, otherwise the mouse coordinates are used. - * @name $.jstree.defaults.contextmenu.show_at_node - * @plugin contextmenu + /** + * a boolean indicating if the menu should be shown aligned with the node. Defaults to `true`, otherwise the mouse coordinates are used. + * @name $.jstree.defaults.contextmenu.show_at_node + * @plugin contextmenu */ show_at_node: boolean; - /** - * an object of actions, or a function that accepts a node and a callback function and calls the callback function with an object of actions available for that node (you can also return the items too). - * - * Each action consists of a key (a unique name) and a value which is an object with the following properties (only label and action are required): - * - * * `separator_before` - a boolean indicating if there should be a separator before this item - * * `separator_after` - a boolean indicating if there should be a separator after this item - * * `_disabled` - a boolean indicating if this action should be disabled - * * `label` - a string - the name of the action (could be a function returning a string) - * * `action` - a function to be executed if this item is chosen - * * `icon` - a string, can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class - * * `shortcut` - keyCode which will trigger the action if the menu is open (for example `113` for rename, which equals F2) - * * `shortcut_label` - shortcut label (like for example `F2` for rename) - * - * @name $.jstree.defaults.contextmenu.items - * @plugin contextmenu + /** + * an object of actions, or a function that accepts a node and a callback function and calls the callback function with an object of actions available for that node (you can also return the items too). + * + * Each action consists of a key (a unique name) and a value which is an object with the following properties (only label and action are required): + * + * * `separator_before` - a boolean indicating if there should be a separator before this item + * * `separator_after` - a boolean indicating if there should be a separator after this item + * * `_disabled` - a boolean indicating if this action should be disabled + * * `label` - a string - the name of the action (could be a function returning a string) + * * `action` - a function to be executed if this item is chosen + * * `icon` - a string, can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class + * * `shortcut` - keyCode which will trigger the action if the menu is open (for example `113` for rename, which equals F2) + * * `shortcut_label` - shortcut label (like for example `F2` for rename) + * + * @name $.jstree.defaults.contextmenu.items + * @plugin contextmenu */ items: any; } interface JSTreeStaticDefaultsDragNDrop { - /** - * a boolean indicating if a copy should be possible while dragging (by pressint the meta key or Ctrl). Defaults to `true`. - * @name $.jstree.defaults.dnd.copy - * @plugin dnd + /** + * a boolean indicating if a copy should be possible while dragging (by pressint the meta key or Ctrl). Defaults to `true`. + * @name $.jstree.defaults.dnd.copy + * @plugin dnd */ copy: boolean; - /** - * a number indicating how long a node should remain hovered while dragging to be opened. Defaults to `500`. - * @name $.jstree.defaults.dnd.open_timeout - * @plugin dnd + /** + * a number indicating how long a node should remain hovered while dragging to be opened. Defaults to `500`. + * @name $.jstree.defaults.dnd.open_timeout + * @plugin dnd */ open_timeout: number; - /** - * a function invoked each time a node is about to be dragged, invoked in the tree's scope and receives the nodes about to be dragged as an argument (array) - return `false` to prevent dragging - * @name $.jstree.defaults.dnd.is_draggable - * @plugin dnd + /** + * a function invoked each time a node is about to be dragged, invoked in the tree's scope and receives the nodes about to be dragged as an argument (array) - return `false` to prevent dragging + * @name $.jstree.defaults.dnd.is_draggable + * @plugin dnd */ is_draggable: boolean; - /** - * a boolean indicating if checks should constantly be made while the user is dragging the node (as opposed to checking only on drop), default is `true` - * @name $.jstree.defaults.dnd.check_while_dragging - * @plugin dnd + /** + * a boolean indicating if checks should constantly be made while the user is dragging the node (as opposed to checking only on drop), default is `true` + * @name $.jstree.defaults.dnd.check_while_dragging + * @plugin dnd */ check_while_dragging: boolean; - /** - * a boolean indicating if nodes from this tree should only be copied with dnd (as opposed to moved), default is `false` - * @name $.jstree.defaults.dnd.always_copy - * @plugin dnd + /** + * a boolean indicating if nodes from this tree should only be copied with dnd (as opposed to moved), default is `false` + * @name $.jstree.defaults.dnd.always_copy + * @plugin dnd */ always_copy: boolean; - /** - * when dropping a node "inside", this setting indicates the position the node should go to - it can be an integer or a string: "first" (same as 0) or "last", default is `0` - * @name $.jstree.defaults.dnd.inside_pos - * @plugin dnd + /** + * when dropping a node "inside", this setting indicates the position the node should go to - it can be an integer or a string: "first" (same as 0) or "last", default is `0` + * @name $.jstree.defaults.dnd.inside_pos + * @plugin dnd */ inside_pos: any; } interface JSTreeStaticDefaultsSearch { - /** - * a jQuery-like AJAX config, which jstree uses if a server should be queried for results. - * - * A `str` (which is the search string) parameter will be added with the request. - * The expected result is a JSON array with nodes that need to be opened so that matching nodes will be revealed. - * Leave this setting as `false` to not query the server. You can also set this to a function, - * which will be invoked in the instance's scope and receive 2 parameters - - * the search string and the callback to call with the array of nodes to load. - * @name $.jstree.defaults.search.ajax - * @plugin search + /** + * a jQuery-like AJAX config, which jstree uses if a server should be queried for results. + * + * A `str` (which is the search string) parameter will be added with the request. + * The expected result is a JSON array with nodes that need to be opened so that matching nodes will be revealed. + * Leave this setting as `false` to not query the server. You can also set this to a function, + * which will be invoked in the instance's scope and receive 2 parameters - + * the search string and the callback to call with the array of nodes to load. + * @name $.jstree.defaults.search.ajax + * @plugin search */ ajax: any; - /** - * Indicates if the search should be fuzzy or not (should `chnd3` match `child node 3`). Default is `true`. - * @name $.jstree.defaults.search.fuzzy - * @plugin search + /** + * Indicates if the search should be fuzzy or not (should `chnd3` match `child node 3`). Default is `true`. + * @name $.jstree.defaults.search.fuzzy + * @plugin search */ fuzzy: boolean; - /** - * Indicates if the search should be case sensitive. Default is `false`. - * @name $.jstree.defaults.search.case_sensitive - * @plugin search + /** + * Indicates if the search should be case sensitive. Default is `false`. + * @name $.jstree.defaults.search.case_sensitive + * @plugin search */ case_sensitive: boolean; - /** - * Indicates if the tree should be filtered to show only matching nodes - * (keep in mind this can be a heavy on large trees in old browsers). Default is `false`. - * @name $.jstree.defaults.search.show_only_matches - * @plugin search + /** + * Indicates if the tree should be filtered to show only matching nodes + * (keep in mind this can be a heavy on large trees in old browsers). Default is `false`. + * @name $.jstree.defaults.search.show_only_matches + * @plugin search */ show_only_matches: boolean; - /** - * Indicates if all nodes opened to reveal the search result, - * should be closed when the search is cleared or a new search is performed. Default is `true`. - * @name $.jstree.defaults.search.close_opened_onclear - * @plugin search + /** + * Indicates if all nodes opened to reveal the search result, + * should be closed when the search is cleared or a new search is performed. Default is `true`. + * @name $.jstree.defaults.search.close_opened_onclear + * @plugin search */ close_opened_onclear: boolean; - /** - * Indicates if only leaf nodes should be included in search results. Default is `false`. - * @name $.jstree.defaults.search.search_leaves_only - * @plugin search + /** + * Indicates if only leaf nodes should be included in search results. Default is `false`. + * @name $.jstree.defaults.search.search_leaves_only + * @plugin search */ search_leaves_only: boolean; } interface JSTreeStaticDefaultsState { - /** - * A string for the key to use when saving the current tree (change if using multiple trees in your project). Defaults to `jstree`. - * @name $.jstree.defaults.state.key - * @plugin state + /** + * A string for the key to use when saving the current tree (change if using multiple trees in your project). Defaults to `jstree`. + * @name $.jstree.defaults.state.key + * @plugin state */ key: string; - /** - * A space separated list of events that trigger a state save. Defaults to `changed.jstree open_node.jstree close_node.jstree`. - * @name $.jstree.defaults.state.events - * @plugin state + /** + * A space separated list of events that trigger a state save. Defaults to `changed.jstree open_node.jstree close_node.jstree`. + * @name $.jstree.defaults.state.events + * @plugin state */ events: string; - /** - * Time in milliseconds after which the state will expire. Defaults to 'false' meaning - no expire. - * @name $.jstree.defaults.state.ttl - * @plugin state + /** + * Time in milliseconds after which the state will expire. Defaults to 'false' meaning - no expire. + * @name $.jstree.defaults.state.ttl + * @plugin state */ ttl: any; - /** - * A function that will be executed prior to restoring state with one argument - the state object. Can be used to clear unwanted parts of the state. - * @name $.jstree.defaults.state.filter - * @plugin state + /** + * A function that will be executed prior to restoring state with one argument - the state object. Can be used to clear unwanted parts of the state. + * @name $.jstree.defaults.state.filter + * @plugin state */ filter: any; } +interface JSTreeStaticDefaultsUnique { + /** + * Indicates if the comparison should be case sensitive. Default is `false`. + * @name $.jstree.defaults.unique.case_sensitive + * @plugin unique + */ + case_sensitive:boolean; +} + interface JQuery { jstree(): JSTree; jstree(options: JSTreeStaticDefaults): JSTree; @@ -503,482 +526,482 @@ interface JQuery { } interface JSTree extends JQuery { - /** - * destroy an instance - * @name destroy() - * @param {Boolean} keep_html if not set to `true` the container will be emptied, otherwise the current DOM elements will be kept intact + /** + * destroy an instance + * @name destroy() + * @param {Boolean} keep_html if not set to `true` the container will be emptied, otherwise the current DOM elements will be kept intact */ destroy: (keep_html?: boolean) => void; - /** - * returns the jQuery extended instance container - * @name get_container() - * @return {jQuery} + /** + * returns the jQuery extended instance container + * @name get_container() + * @return {jQuery} */ get_container: () => JQuery; - /** - * get the JSON representation of a node (or the actual jQuery extended DOM node) by using any input (child DOM element, ID string, selector, etc) - * @name get_node(obj [, as_dom]) - * @param {mixed} obj - * @param {Boolean} as_dom - * @return {Object|jQuery} + /** + * get the JSON representation of a node (or the actual jQuery extended DOM node) by using any input (child DOM element, ID string, selector, etc) + * @name get_node(obj [, as_dom]) + * @param {mixed} obj + * @param {Boolean} as_dom + * @return {Object|jQuery} */ get_node: (obj: any, as_dom?: boolean) => JQuery; - /** - * get the path to a node, either consisting of node texts, or of node IDs, optionally glued together (otherwise an array) - * @name get_path(obj [, glue, ids]) - * @param {mixed} obj the node - * @param {String} glue if you want the path as a string - pass the glue here (for example '/'), if a falsy value is supplied here, an array is returned - * @param {Boolean} ids if set to true build the path using ID, otherwise node text is used - * @return {mixed} + /** + * get the path to a node, either consisting of node texts, or of node IDs, optionally glued together (otherwise an array) + * @name get_path(obj [, glue, ids]) + * @param {mixed} obj the node + * @param {String} glue if you want the path as a string - pass the glue here (for example '/'), if a falsy value is supplied here, an array is returned + * @param {Boolean} ids if set to true build the path using ID, otherwise node text is used + * @return {mixed} */ get_path: (obj:any, glue:string, ids:boolean) => JQuery; - /** - * get the next visible node that is below the `obj` node. If `strict` is set to `true` only sibling nodes are returned. - * @name get_next_dom(obj [, strict]) - * @param {mixed} obj - * @param {Boolean} strict - * @return {jQuery} + /** + * get the next visible node that is below the `obj` node. If `strict` is set to `true` only sibling nodes are returned. + * @name get_next_dom(obj [, strict]) + * @param {mixed} obj + * @param {Boolean} strict + * @return {jQuery} */ get_next_dom: (obj:any, strict?:boolean) => JQuery; - /** - * get the previous visible node that is above the `obj` node. If `strict` is set to `true` only sibling nodes are returned. - * @name get_prev_dom(obj [, strict]) - * @param {mixed} obj - * @param {Boolean} strict - * @return {jQuery} + /** + * get the previous visible node that is above the `obj` node. If `strict` is set to `true` only sibling nodes are returned. + * @name get_prev_dom(obj [, strict]) + * @param {mixed} obj + * @param {Boolean} strict + * @return {jQuery} */ get_prev_dom: (obj: any, strict?: boolean) => JQuery; - /** - * get the parent ID of a node - * @name get_parent(obj) - * @param {mixed} obj - * @return {String} + /** + * get the parent ID of a node + * @name get_parent(obj) + * @param {mixed} obj + * @return {String} */ get_parent: (obj: any) => string; - /** - * get a jQuery collection of all the children of a node (node must be rendered) - * @name get_children_dom(obj) - * @param {mixed} obj - * @return {jQuery} + /** + * get a jQuery collection of all the children of a node (node must be rendered) + * @name get_children_dom(obj) + * @param {mixed} obj + * @return {jQuery} */ get_children_dom: (obj: any) => JQuery; - /** - * checks if a node has children - * @name is_parent(obj) - * @param {mixed} obj - * @return {Boolean} + /** + * checks if a node has children + * @name is_parent(obj) + * @param {mixed} obj + * @return {Boolean} */ is_parent: (obj: any) => boolean; - /** - * checks if a node is loaded (its children are available) - * @name is_loaded(obj) - * @param {mixed} obj - * @return {Boolean} + /** + * checks if a node is loaded (its children are available) + * @name is_loaded(obj) + * @param {mixed} obj + * @return {Boolean} */ is_loaded: (obj: any) => boolean; - /** - * check if a node is currently loading (fetching children) - * @name is_loading(obj) - * @param {mixed} obj - * @return {Boolean} + /** + * check if a node is currently loading (fetching children) + * @name is_loading(obj) + * @param {mixed} obj + * @return {Boolean} */ is_loading: (obj: any) => boolean; - /** - * check if a node is opened - * @name is_open(obj) - * @param {mixed} obj - * @return {Boolean} + /** + * check if a node is opened + * @name is_open(obj) + * @param {mixed} obj + * @return {Boolean} */ is_open: (obj: any) => boolean; - /** - * check if a node is in a closed state - * @name is_closed(obj) - * @param {mixed} obj - * @return {Boolean} + /** + * check if a node is in a closed state + * @name is_closed(obj) + * @param {mixed} obj + * @return {Boolean} */ is_closed: (obj: any) => boolean; - /** - * check if a node has no children - * @name is_leaf(obj) - * @param {mixed} obj - * @return {Boolean} + /** + * check if a node has no children + * @name is_leaf(obj) + * @param {mixed} obj + * @return {Boolean} */ is_leaf: (obj: any) => boolean; - /** - * loads a node (fetches its children using the `core.data` setting). Multiple nodes can be passed to by using an array. - * @name load_node(obj [, callback]) - * @param {mixed} obj - * @param {function} callback a function to be executed once loading is conplete, the function is executed in the instance's scope - * and receives two arguments - the node and a boolean status - * @return {Boolean} - * @trigger load_node.jstree + /** + * loads a node (fetches its children using the `core.data` setting). Multiple nodes can be passed to by using an array. + * @name load_node(obj [, callback]) + * @param {mixed} obj + * @param {function} callback a function to be executed once loading is conplete, the function is executed in the instance's scope + * and receives two arguments - the node and a boolean status + * @return {Boolean} + * @trigger load_node.jstree */ load_node: (obj: any, callback: any) => boolean; - /** - * redraws all nodes that need to be redrawn or optionally - the whole tree - * @name redraw([full]) - * @param {Boolean} full if set to `true` all nodes are redrawn. + /** + * redraws all nodes that need to be redrawn or optionally - the whole tree + * @name redraw([full]) + * @param {Boolean} full if set to `true` all nodes are redrawn. */ redraw: (full?: boolean) => void; - /** - * opens a node, revaling its children. If the node is not loaded it will be loaded and opened once ready. - * @name open_node(obj [, callback, animation]) - * @param {mixed} obj the node to open - * @param {Function} callback a function to execute once the node is opened - * @param {Number} animation the animation duration in milliseconds - * when opening the node (overrides the `core.animation` setting). Use `false` for no animation. - * @trigger open_node.jstree, after_open.jstree, before_open.jstree + /** + * opens a node, revaling its children. If the node is not loaded it will be loaded and opened once ready. + * @name open_node(obj [, callback, animation]) + * @param {mixed} obj the node to open + * @param {Function} callback a function to execute once the node is opened + * @param {Number} animation the animation duration in milliseconds + * when opening the node (overrides the `core.animation` setting). Use `false` for no animation. + * @trigger open_node.jstree, after_open.jstree, before_open.jstree */ open_node: (obj: any, callback?: any, animation?: any) => void; - /** - * closes a node, hiding its children - * @name close_node(obj [, animation]) - * @param {mixed} obj the node to close - * @param {Number} animation the animation duration in milliseconds - * when closing the node (overrides the `core.animation` setting). Use `false` for no animation. - * @trigger close_node.jstree, after_close.jstree + /** + * closes a node, hiding its children + * @name close_node(obj [, animation]) + * @param {mixed} obj the node to close + * @param {Number} animation the animation duration in milliseconds + * when closing the node (overrides the `core.animation` setting). Use `false` for no animation. + * @trigger close_node.jstree, after_close.jstree */ close_node: (obj: any, animation?: any) => void; - /** - * toggles a node - closing it if it is open, opening it if it is closed - * @name toggle_node(obj) - * @param {mixed} obj the node to toggle + /** + * toggles a node - closing it if it is open, opening it if it is closed + * @name toggle_node(obj) + * @param {mixed} obj the node to toggle */ toggle_node: (obj: any) => void; - /** - * opens all nodes within a node (or the tree), revaling their children. If the node is not loaded it will be loaded and opened once ready. - * @name open_all([obj, animation, original_obj]) - * @param {mixed} obj the node to open recursively, omit to open all nodes in the tree - * @param {Number} animation the animation duration in milliseconds when opening the nodes, the default is no animation - * @param {jQuery} reference to the node that started the process (internal use) - * @trigger open_all.jstree + /** + * opens all nodes within a node (or the tree), revaling their children. If the node is not loaded it will be loaded and opened once ready. + * @name open_all([obj, animation, original_obj]) + * @param {mixed} obj the node to open recursively, omit to open all nodes in the tree + * @param {Number} animation the animation duration in milliseconds when opening the nodes, the default is no animation + * @param {jQuery} reference to the node that started the process (internal use) + * @trigger open_all.jstree */ open_all: (obj?: any, animation?: number, original_obj?: any) => void; - /** - * closes all nodes within a node (or the tree), revaling their children - * @name close_all([obj, animation]) - * @param {mixed} obj the node to close recursively, omit to close all nodes in the tree - * @param {Number} animation the animation duration in milliseconds when closing the nodes, the default is no animation - * @trigger close_all.jstree + /** + * closes all nodes within a node (or the tree), revaling their children + * @name close_all([obj, animation]) + * @param {mixed} obj the node to close recursively, omit to close all nodes in the tree + * @param {Number} animation the animation duration in milliseconds when closing the nodes, the default is no animation + * @trigger close_all.jstree */ close_all: (obj?: any, animation?: number) => void; - /** - * checks if a node is disabled (not selectable) - * @name is_disabled(obj) - * @param {mixed} obj - * @return {Boolean} + /** + * checks if a node is disabled (not selectable) + * @name is_disabled(obj) + * @param {mixed} obj + * @return {Boolean} */ is_disabled: (obj: any) => boolean; - /** - * enables a node - so that it can be selected - * @name enable_node(obj) - * @param {mixed} obj the node to enable - * @trigger enable_node.jstree + /** + * enables a node - so that it can be selected + * @name enable_node(obj) + * @param {mixed} obj the node to enable + * @trigger enable_node.jstree */ enable_node: (obj: any) => boolean; - /** - * disables a node - so that it can not be selected - * @name disable_node(obj) - * @param {mixed} obj the node to disable - * @trigger disable_node.jstree + /** + * disables a node - so that it can not be selected + * @name disable_node(obj) + * @param {mixed} obj the node to disable + * @trigger disable_node.jstree */ disable_node: (obj: any) => boolean; - /** - * select a node - * @name select_node(obj [, supress_event, prevent_open]) - * @param {mixed} obj an array can be used to select multiple nodes - * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered - * @param {Boolean} prevent_open if set to `true` parents of the selected node won't be opened - * @trigger select_node.jstree, changed.jstree + /** + * select a node + * @name select_node(obj [, supress_event, prevent_open]) + * @param {mixed} obj an array can be used to select multiple nodes + * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered + * @param {Boolean} prevent_open if set to `true` parents of the selected node won't be opened + * @trigger select_node.jstree, changed.jstree */ select_node: (obj: any, supress_event?: boolean, prevent_open?: boolean, e?:any) => void; - /** - * deselect a node - * @name deselect_node(obj [, supress_event]) - * @param {mixed} obj an array can be used to deselect multiple nodes - * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered - * @trigger deselect_node.jstree, changed.jstree + /** + * deselect a node + * @name deselect_node(obj [, supress_event]) + * @param {mixed} obj an array can be used to deselect multiple nodes + * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered + * @trigger deselect_node.jstree, changed.jstree */ deselect_node: (obj: any, supress_event?: boolean, e?:any) => void; - /** - * select all nodes in the tree - * @name select_all([supress_event]) - * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered - * @trigger select_all.jstree, changed.jstree + /** + * select all nodes in the tree + * @name select_all([supress_event]) + * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered + * @trigger select_all.jstree, changed.jstree */ select_all: (supress_event?: boolean) => void; - /** - * deselect all selected nodes - * @name deselect_all([supress_event]) - * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered - * @trigger deselect_all.jstree, changed.jstree + /** + * deselect all selected nodes + * @name deselect_all([supress_event]) + * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered + * @trigger deselect_all.jstree, changed.jstree */ deselect_all: (supress_event?: boolean) => void; - /** - * checks if a node is selected - * @name is_selected(obj) - * @param {mixed} obj - * @return {Boolean} + /** + * checks if a node is selected + * @name is_selected(obj) + * @param {mixed} obj + * @return {Boolean} */ is_selected: (obj: any) => boolean; - /** - * get an array of all selected nodes - * @name get_selected([full]) - * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned - * @return {Array} + /** + * get an array of all selected nodes + * @name get_selected([full]) + * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned + * @return {Array} */ get_selected: (full?: any) => string[]; - /** - * get an array of all top level selected nodes (ignoring children of selected nodes) - * @name get_top_selected([full]) - * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned - * @return {Array} + /** + * get an array of all top level selected nodes (ignoring children of selected nodes) + * @name get_top_selected([full]) + * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned + * @return {Array} */ get_top_selected: (full?: any) => string[]; - /** - * get an array of all bottom level selected nodes (ignoring selected parents) - * @name get_top_selected([full]) - * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned - * @return {Array} + /** + * get an array of all bottom level selected nodes (ignoring selected parents) + * @name get_top_selected([full]) + * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned + * @return {Array} */ get_bottom_selected: (full?: any) => string[]; - /** - * refreshes the tree - all nodes are reloaded with calls to `load_node`. - * @name refresh() - * @param {Boolean} skip_loading an option to skip showing the loading indicator - * @trigger refresh.jstree + /** + * refreshes the tree - all nodes are reloaded with calls to `load_node`. + * @name refresh() + * @param {Boolean} skip_loading an option to skip showing the loading indicator + * @trigger refresh.jstree */ refresh: (skip_loading:boolean) => void; - /** - * refreshes a node in the tree (reload its children) all opened nodes inside that node are reloaded with calls to `load_node`. - * @name refresh_node(obj) - * @param {Boolean} skip_loading an option to skip showing the loading indicator - * @trigger refresh.jstree - */ + /** + * refreshes a node in the tree (reload its children) all opened nodes inside that node are reloaded with calls to `load_node`. + * @name refresh_node(obj) + * @param {Boolean} skip_loading an option to skip showing the loading indicator + * @trigger refresh.jstree + */ refresh_node: (obj:any) => void; - /** - * set (change) the ID of a node - * @name set_id(obj, id) - * @param {mixed} obj the node - * @param {String} id the new ID - * @return {Boolean} + /** + * set (change) the ID of a node + * @name set_id(obj, id) + * @param {mixed} obj the node + * @param {String} id the new ID + * @return {Boolean} */ set_id: (obj: any, id: string) => void; - /** - * get the text value of a node - * @name get_text(obj) - * @param {mixed} obj the node - * @return {String} + /** + * get the text value of a node + * @name get_text(obj) + * @param {mixed} obj the node + * @return {String} */ get_text: (obj: any) => string; - /** - * gets a JSON representation of a node (or the whole tree) - * @name get_json([obj, options]) - * @param {mixed} obj - * @param {Object} options - * @param {Boolean} options.no_state do not return state information - * @param {Boolean} options.no_id do not return ID - * @param {Boolean} options.no_children do not include children - * @param {Boolean} options.no_data do not include node data - * @param {Boolean} options.flat return flat JSON instead of nested - * @return {Object} + /** + * gets a JSON representation of a node (or the whole tree) + * @name get_json([obj, options]) + * @param {mixed} obj + * @param {Object} options + * @param {Boolean} options.no_state do not return state information + * @param {Boolean} options.no_id do not return ID + * @param {Boolean} options.no_children do not include children + * @param {Boolean} options.no_data do not include node data + * @param {Boolean} options.flat return flat JSON instead of nested + * @return {Object} */ get_json: (obj?: any, options?: JSTreeGetJsonOptions) => any; - /** - * create a new node (do not confuse with load_node) - * @name create_node([obj, node, pos, callback, is_loaded]) - * @param {mixed} par the parent node (to create a root node use either "#" (string) or `null`) - * @param {mixed} node the data for the new node (a valid JSON object, or a simple string with the name) - * @param {mixed} pos the index at which to insert the node, "first" and "last" are also supported, default is "last" - * @param {Function} callback a function to be called once the node is created - * @param {Boolean} is_loaded internal argument indicating if the parent node was succesfully loaded - * @return {String} the ID of the newly create node - * @trigger model.jstree, create_node.jstree + /** + * create a new node (do not confuse with load_node) + * @name create_node([obj, node, pos, callback, is_loaded]) + * @param {mixed} par the parent node (to create a root node use either "#" (string) or `null`) + * @param {mixed} node the data for the new node (a valid JSON object, or a simple string with the name) + * @param {mixed} pos the index at which to insert the node, "first" and "last" are also supported, default is "last" + * @param {Function} callback a function to be called once the node is created + * @param {Boolean} is_loaded internal argument indicating if the parent node was succesfully loaded + * @return {String} the ID of the newly create node + * @trigger model.jstree, create_node.jstree */ create_node: (obj?: any, node?: any, pos?: any, callback?: any, is_loaded?: boolean) => string; - /** - * set the text value of a node - * @name rename_node(obj, val) - * @param {mixed} obj the node, you can pass an array to rename multiple nodes to the same name - * @param {String} val the new text value - * @return {Boolean} - * @trigger rename_node.jstree + /** + * set the text value of a node + * @name rename_node(obj, val) + * @param {mixed} obj the node, you can pass an array to rename multiple nodes to the same name + * @param {String} val the new text value + * @return {Boolean} + * @trigger rename_node.jstree */ rename_node: (obj: any, val: string) => boolean; - /** - * remove a node - * @name delete_node(obj) - * @param {mixed} obj the node, you can pass an array to delete multiple nodes - * @return {Boolean} - * @trigger delete_node.jstree, changed.jstree + /** + * remove a node + * @name delete_node(obj) + * @param {mixed} obj the node, you can pass an array to delete multiple nodes + * @return {Boolean} + * @trigger delete_node.jstree, changed.jstree */ delete_node: (obj: any) => boolean; - /** - * get the last error - * @name last_error() - * @return {Object} + /** + * get the last error + * @name last_error() + * @return {Object} */ last_error: () => any; - /** - * move a node to a new parent - * @name move_node(obj, par [, pos, callback, is_loaded]) - * @param {mixed} obj the node to move, pass an array to move multiple nodes - * @param {mixed} par the new parent - * @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0` - * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position - * @param {Boolean} internal parameter indicating if the parent node has been loaded - * @trigger move_node.jstree + /** + * move a node to a new parent + * @name move_node(obj, par [, pos, callback, is_loaded]) + * @param {mixed} obj the node to move, pass an array to move multiple nodes + * @param {mixed} par the new parent + * @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0` + * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position + * @param {Boolean} internal parameter indicating if the parent node has been loaded + * @trigger move_node.jstree */ move_node: (obj: any, par: any, pos?: any, callback?: any, internal?: boolean) => void; - /** - * copy a node to a new parent - * @name copy_node(obj, par [, pos, callback, is_loaded]) - * @param {mixed} obj the node to copy, pass an array to copy multiple nodes - * @param {mixed} par the new parent - * @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0` - * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position - * @param {Boolean} internal parameter indicating if the parent node has been loaded - * @trigger model.jstree copy_node.jstree + /** + * copy a node to a new parent + * @name copy_node(obj, par [, pos, callback, is_loaded]) + * @param {mixed} obj the node to copy, pass an array to copy multiple nodes + * @param {mixed} par the new parent + * @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0` + * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position + * @param {Boolean} internal parameter indicating if the parent node has been loaded + * @trigger model.jstree copy_node.jstree */ copy_node: (obj: any, par: any, pos?: any, callback?: any, internal?: boolean) => void; - /** - * cut a node (a later call to `paste(obj)` would move the node) - * @name cut(obj) - * @param {mixed} obj multiple objects can be passed using an array - * @trigger cut.jstree + /** + * cut a node (a later call to `paste(obj)` would move the node) + * @name cut(obj) + * @param {mixed} obj multiple objects can be passed using an array + * @trigger cut.jstree */ cut: (obj: any) => void; - /** - * copy a node (a later call to `paste(obj)` would copy the node) - * @name copy(obj) - * @param {mixed} obj multiple objects can be passed using an array - * @trigger copy.jstre + /** + * copy a node (a later call to `paste(obj)` would copy the node) + * @name copy(obj) + * @param {mixed} obj multiple objects can be passed using an array + * @trigger copy.jstre */ copy: (obj: any) => void; - /** - * get the current buffer (any nodes that are waiting for a paste operation) - * @name get_buffer() - * @return {Object} an object consisting of `mode` ("copy_node" or "move_node"), `node` (an array of objects) and `inst` (the instance) + /** + * get the current buffer (any nodes that are waiting for a paste operation) + * @name get_buffer() + * @return {Object} an object consisting of `mode` ("copy_node" or "move_node"), `node` (an array of objects) and `inst` (the instance) */ get_buffer: () => any; - /** - * check if there is something in the buffer to paste - * @name can_paste() - * @return {Boolean} + /** + * check if there is something in the buffer to paste + * @name can_paste() + * @return {Boolean} */ can_paste: () => boolean; - /** - * copy or move the previously cut or copied nodes to a new parent - * @name paste(obj [, pos]) - * @param {mixed} obj the new parent - * @param {mixed} pos the position to insert at (besides integer, "first" and "last" are supported), defaults to integer `0` - * @trigger paste.jstree + /** + * copy or move the previously cut or copied nodes to a new parent + * @name paste(obj [, pos]) + * @param {mixed} obj the new parent + * @param {mixed} pos the position to insert at (besides integer, "first" and "last" are supported), defaults to integer `0` + * @trigger paste.jstree */ paste: (obj: any) => void; - /** - * put a node in edit mode (input field to rename the node) - * @name edit(obj [, default_text]) - * @param {mixed} obj - * @param {String} default_text the text to populate the input with (if omitted the node text value is used) + /** + * put a node in edit mode (input field to rename the node) + * @name edit(obj [, default_text]) + * @param {mixed} obj + * @param {String} default_text the text to populate the input with (if omitted the node text value is used) */ edit: (obj: any, default_text?: string) => void; - /** - * changes the theme - * @name set_theme(theme_name [, theme_url]) - * @param {String} theme_name the name of the new theme to apply - * @param {mixed} theme_url the location of the CSS file for this theme. Omit or set to `false` - * if you manually included the file. Set to `true` to autoload from the `core.themes.dir` directory. - * @trigger set_theme.jstree + /** + * changes the theme + * @name set_theme(theme_name [, theme_url]) + * @param {String} theme_name the name of the new theme to apply + * @param {mixed} theme_url the location of the CSS file for this theme. Omit or set to `false` + * if you manually included the file. Set to `true` to autoload from the `core.themes.dir` directory. + * @trigger set_theme.jstree */ set_theme: (theme_name: string, theme_url?: any) => void; - /** - * gets the name of the currently applied theme name - * @name get_theme() - * @return {String} + /** + * gets the name of the currently applied theme name + * @name get_theme() + * @return {String} */ get_theme: () => string; - /** - * changes the theme variant (if the theme has variants) - * @name set_theme_variant(variant_name) - * @param {String|Boolean} variant_name the variant to apply (if `false` is used the current variant is removed) + /** + * changes the theme variant (if the theme has variants) + * @name set_theme_variant(variant_name) + * @param {String|Boolean} variant_name the variant to apply (if `false` is used the current variant is removed) */ set_theme_variant: (variant_name: any) => void; - /** - * gets the name of the currently applied theme variant - * @name get_theme() - * @return {String} + /** + * gets the name of the currently applied theme variant + * @name get_theme() + * @return {String} */ get_theme_variant: () => string; - /** - * shows a striped background on the container (if the theme supports it) - * @name show_stripes() + /** + * shows a striped background on the container (if the theme supports it) + * @name show_stripes() */ show_stripes: () => void; - /** - * hides the striped background on the container - * @name hide_stripes() + /** + * hides the striped background on the container + * @name hide_stripes() */ hide_stripes: () => void; - /** - * toggles the striped background on the container - * @name toggle_stripes() + /** + * toggles the striped background on the container + * @name toggle_stripes() */ toggle_stripes: () => void; - /** - * shows the connecting dots (if the theme supports it) - * @name show_dots() + /** + * shows the connecting dots (if the theme supports it) + * @name show_dots() */ show_dots: () => void; - /** - * hides the connecting dots - * @name hide_dots() + /** + * hides the connecting dots + * @name hide_dots() */ hide_dots: () => void; - /** - * toggles the connecting dots - * @name toggle_dots() + /** + * toggles the connecting dots + * @name toggle_dots() */ toggle_dots: () => void; - /** - * show the node icons - * @name show_icons() + /** + * show the node icons + * @name show_icons() */ show_icons: () => void; - /** - * hide the node icons - * @name hide_icons() + /** + * hide the node icons + * @name hide_icons() */ hide_icons: () => void; - /** - * toggle the node icons - * @name toggle_icons() + /** + * toggle the node icons + * @name toggle_icons() */ toggle_icons: () => void; - /** - * set the node icon for a node - * @name set_icon(obj, icon) - * @param {mixed} obj - * @param {String} icon the new icon - can be a path to an icon or a className, - * if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class + /** + * set the node icon for a node + * @name set_icon(obj, icon) + * @param {mixed} obj + * @param {String} icon the new icon - can be a path to an icon or a className, + * if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class */ set_icon: (obj: any, icon: string) => void; - /** - * get the node icon for a node - * @name get_icon(obj) - * @param {mixed} obj - * @return {String} + /** + * get the node icon for a node + * @name get_icon(obj) + * @param {mixed} obj + * @return {String} */ get_icon: (obj: any) => string; - /** - * hide the icon on an individual node - * @name hide_icon(obj) - * @param {mixed} obj + /** + * hide the icon on an individual node + * @name hide_icon(obj) + * @param {mixed} obj */ hide_icon: (obj: any) => void; - /** - * show the icon on an individual node - * @name show_icon(obj) - * @param {mixed} obj + /** + * show the icon on an individual node + * @name show_icon(obj) + * @param {mixed} obj */ show_icon: (obj: any) => void; /** @@ -986,96 +1009,96 @@ interface JSTree extends JQuery { redraw_node: (obj: any, deep:boolean, is_callback:boolean) => any; activate_node: (obj: any, e: any) => any; - /** - * show the node checkbox icons - * @name show_checkboxes() - * @plugin checkbox + /** + * show the node checkbox icons + * @name show_checkboxes() + * @plugin checkbox */ show_checkboxes: () => void; - /** - * hide the node checkbox icons - * @name hide_checkboxes() - * @plugin checkbox + /** + * hide the node checkbox icons + * @name hide_checkboxes() + * @plugin checkbox */ hide_checkboxes: () => void; - /** - * toggle the node icons - * @name toggle_checkboxes() - * @plugin checkbox + /** + * toggle the node icons + * @name toggle_checkboxes() + * @plugin checkbox */ toggle_checkboxes: () => void; /** * context menu plugin */ teardown: () => void; - /** - * prepare and show the context menu for a node - * @name show_contextmenu(obj [, x, y]) - * @param {mixed} obj the node - * @param {Number} x the x-coordinate relative to the document to show the menu at - * @param {Number} y the y-coordinate relative to the document to show the menu at - * @param {Object} e the event if available that triggered the contextmenu - * @plugin contextmenu - * @trigger show_contextmenu.jstree + /** + * prepare and show the context menu for a node + * @name show_contextmenu(obj [, x, y]) + * @param {mixed} obj the node + * @param {Number} x the x-coordinate relative to the document to show the menu at + * @param {Number} y the y-coordinate relative to the document to show the menu at + * @param {Object} e the event if available that triggered the contextmenu + * @plugin contextmenu + * @trigger show_contextmenu.jstree */ show_contextmenu: (obj: any, x?: number, y?: number, e?:any) => void; - /** - * used to search the tree nodes for a given string - * @name search(str [, skip_async]) - * @param {String} str the search string - * @param {Boolean} skip_async if set to true server will not be queried even if configured - * @plugin search - * @trigger search.jstree + /** + * used to search the tree nodes for a given string + * @name search(str [, skip_async]) + * @param {String} str the search string + * @param {Boolean} skip_async if set to true server will not be queried even if configured + * @plugin search + * @trigger search.jstree */ search: (str: string, skip_async?: boolean) => void; - /** - * used to clear the last search (removes classes and shows all nodes if filtering is on) - * @name clear_search() - * @plugin search - * @trigger clear_search.jstree + /** + * used to clear the last search (removes classes and shows all nodes if filtering is on) + * @name clear_search() + * @plugin search + * @trigger clear_search.jstree */ clear_search: () => void; - /** - * save the state - * @name save_state() - * @plugin state + /** + * save the state + * @name save_state() + * @plugin state */ save_state: () => void; - /** - * restore the state from the user's computer - * @name restore_state() - * @plugin state + /** + * restore the state from the user's computer + * @name restore_state() + * @plugin state */ restore_state: () => void; - /** - * clear the state on the user's computer - * @name clear_state() - * @plugin state + /** + * clear the state on the user's computer + * @name clear_state() + * @plugin state */ clear_state: () => void; - /** - * used to retrieve the type settings object for a node - * @name get_rules(obj) - * @param {mixed} obj the node to find the rules for - * @return {Object} - * @plugin types + /** + * used to retrieve the type settings object for a node + * @name get_rules(obj) + * @param {mixed} obj the node to find the rules for + * @return {Object} + * @plugin types */ get_rules: (obj: any) => any; - /** - * used to retrieve the type string or settings object for a node - * @name get_type(obj [, rules]) - * @param {mixed} obj the node to find the rules for - * @param {Boolean} rules if set to `true` instead of a string the settings object will be returned - * @return {String|Object} - * @plugin types + /** + * used to retrieve the type string or settings object for a node + * @name get_type(obj [, rules]) + * @param {mixed} obj the node to find the rules for + * @param {Boolean} rules if set to `true` instead of a string the settings object will be returned + * @return {String|Object} + * @plugin types */ get_type: (obj: any, rules?: any) => any; - /** - * used to change a node's type - * @name set_type(obj, type) - * @param {mixed} obj the node to change - * @param {String} type the new type - * @plugin types + /** + * used to change a node's type + * @name set_type(obj, type) + * @param {mixed} obj the node to change + * @param {String} type the new type + * @plugin types */ set_type: (obj: any, type: string) => any; //bind(eventType: string, handler?: (event: any, data: JSTreeBindOptions) => any): JSTree; diff --git a/karma-jasmine/karma-jasmine.d.ts b/karma-jasmine/karma-jasmine.d.ts index 92b5e962d..e4cdc5a81 100644 --- a/karma-jasmine/karma-jasmine.d.ts +++ b/karma-jasmine/karma-jasmine.d.ts @@ -1,6 +1,6 @@ // Type definitions for karma-jasmine plugin // Project: https://github.com/karma-runner/karma-jasmine -// Definitions by: Michel Salib +// Definitions by: Michel Salib // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/kineticjs/kineticjs.d.ts b/kineticjs/kineticjs.d.ts index bbe2d68e8..ecfbbae1f 100644 --- a/kineticjs/kineticjs.d.ts +++ b/kineticjs/kineticjs.d.ts @@ -1,7 +1,7 @@ // Type definitions for KineticJS // Project: http://kineticjs.com/ // Definitions by: Basarat Ali Syed , Ralph de Ruijter -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped declare module Kinetic { @@ -544,4 +544,4 @@ declare module Kinetic { width: number; height: number; } -} \ No newline at end of file +} diff --git a/knockout.editables/ko.editables.d.ts b/knockout.editables/ko.editables.d.ts index b6da1f13f..8167b3eaf 100644 --- a/knockout.editables/ko.editables.d.ts +++ b/knockout.editables/ko.editables.d.ts @@ -1,5 +1,5 @@ // Type definitions for knockout-editables 0.9 -// Project:http://romanych.github.com/ko.editables/ +// Project: http://romanych.github.com/ko.editables/ // Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/knockout.mapper/knockout.mapper.d.ts b/knockout.mapper/knockout.mapper.d.ts index 8052e4cc7..30476f746 100644 --- a/knockout.mapper/knockout.mapper.d.ts +++ b/knockout.mapper/knockout.mapper.d.ts @@ -1,7 +1,7 @@ // Type definitions for Knockout.Mapper // Project: https://github.com/LucasLorentz/knockout.mapper // Definitions by: Brandon Meyer -// Definitions https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -12,4 +12,4 @@ interface KnockoutMapper { interface KnockoutStatic { mapper: KnockoutMapper; -} \ No newline at end of file +} diff --git a/knockout.mapping/knockout.mapping.d.ts b/knockout.mapping/knockout.mapping.d.ts index e8ffc807e..2c8af4785 100644 --- a/knockout.mapping/knockout.mapping.d.ts +++ b/knockout.mapping/knockout.mapping.d.ts @@ -1,7 +1,7 @@ // Type definitions for Knockout.Mapping 2.0 // Project: https://github.com/SteveSanderson/knockout.mapping // Definitions by: Boris Yankov -// Definitions https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/knockout.rx/knockout.rx.d.ts b/knockout.rx/knockout.rx.d.ts index f897bc761..71d95d758 100644 --- a/knockout.rx/knockout.rx.d.ts +++ b/knockout.rx/knockout.rx.d.ts @@ -1,4 +1,4 @@ -// Type definitions for knockout.rx 0.1 +// Type definitions for knockout.rx 1.0 // Project: https://github.com/Igorbek/knockout.rx // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -13,6 +13,7 @@ interface KnockoutSubscribableFunctions { interface KnockoutObservableFunctions { toObservableWithReplyLatest(): Rx.Observable; + toSubject(): Rx.ISubject; } interface KnockoutComputedFunctions { @@ -24,4 +25,8 @@ declare module Rx { toKoSubscribable(): KnockoutSubscribable; toKoObservable(initialValue?: T): KnockoutObservable; } + + interface Subject { + toKoObservable(initialValue?: T): KnockoutObservable; + } } diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 9c4e02bd8..71252985d 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -123,9 +123,14 @@ interface KnockoutBindingContext { createChildContext(dataItemOrAccessor: any, dataItemAlias?: any, extendCallback?: Function): any; } +interface KnockoutAllBindingsAccessor { + (): any; + get(bindingName: string): any; +} + interface KnockoutBindingHandler { - init?(element: any, valueAccessor: () => any, allBindingsAccessor: () => any, viewModel: any, bindingContext: KnockoutBindingContext): void; - update?(element: any, valueAccessor: () => any, allBindingsAccessor: () => any, viewModel: any, bindingContext: KnockoutBindingContext): void; + init?(element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext): void; + update?(element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext): void; options?: any; } diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts index 1ebef13ef..da5d1e65a 100644 --- a/knockout/tests/knockout-tests.ts +++ b/knockout/tests/knockout-tests.ts @@ -581,4 +581,21 @@ function test_misc() { } } +} + +interface KnockoutBindingHandlers { + allBindingsAccessorTest: KnockoutBindingHandler; +} + +function test_allBindingsAccessor() { + ko.bindingHandlers.allBindingsAccessorTest = { + init: (element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => { + var allBindings = allBindingsAccessor(); + var myBinding = allBindingsAccessor.get("myBindingName"); + }, + update: (element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => { + var allBindings = allBindingsAccessor(); + var myBinding = allBindingsAccessor.get("myBindingName"); + } + }; } \ No newline at end of file diff --git a/kolite/kolite-tests.ts b/kolite/kolite-tests.ts index f2013241d..4306ede53 100644 --- a/kolite/kolite-tests.ts +++ b/kolite/kolite-tests.ts @@ -30,6 +30,22 @@ function test_asyncCommand() { }); } +function test_asyncCommand_isExecuting() { + var primaryCommand = ko.asyncCommand({ + execute: (complete) => { + $.when().always(complete); + }, + canExecute: (isExecuting) => { + return !isExecuting; + } + }); + + var firstRun = true; + var canCancel = ko.computed(() => { + return firstRun && !primaryCommand.isExecuting(); + }); +} + function test_dirtyFlag() { var viewModel; viewModel.dirtyFlag = new ko.DirtyFlag(viewModel.model); diff --git a/kolite/kolite.d.ts b/kolite/kolite.d.ts index 42efda4a9..6310fcad4 100644 --- a/kolite/kolite.d.ts +++ b/kolite/kolite.d.ts @@ -1,7 +1,7 @@ // Type definitions for KoLite 1.1 // Project: https://github.com/CodeSeven/kolite // Definitions by: Boris Yankov -// Definitions https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -58,6 +58,10 @@ interface KoliteCommand { execute(...args: any[]): any; } +interface KoliteAsyncCommand extends KoliteCommand { + isExecuting: KnockoutObservable; +} + interface KoLiteCommandOptions { execute?: any; canExecute?: (isExecuting: boolean) => any; @@ -65,7 +69,7 @@ interface KoLiteCommandOptions { interface KnockoutStatic { command(options: KoLiteCommandOptions): KoliteCommand; - asyncCommand(optons: KoLiteCommandOptions): KoliteCommand; + asyncCommand(optons: KoLiteCommandOptions): KoliteAsyncCommand; } interface KnockoutUtils { @@ -74,4 +78,4 @@ interface KnockoutUtils { interface KnockoutBindingHandlers { command: KnockoutBindingHandler; -} \ No newline at end of file +} diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index a2d91032a..54f0fe4f0 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -474,7 +474,7 @@ declare module L { * positions. * Default value: 'topright'. */ - position: string; + position?: string; } } @@ -773,20 +773,20 @@ declare module L { /** * Create a layer group, optionally given an initial set of layers. */ - function featureGroup(layers?: ILayer[]): FeatureGroup; + function featureGroup(layers?: T[]): FeatureGroup; - export class FeatureGroup extends LayerGroup implements ILayer, IEventPowered { + export class FeatureGroup extends LayerGroup implements ILayer, IEventPowered> { /** * Create a layer group, optionally given an initial set of layers. */ - constructor(layers?: ILayer[]); + constructor(layers?: T[]); /** * Binds a popup with a particular HTML content to a click on any layer from the * group that has a bindPopup method. */ - bindPopup(htmlContent: string, options?: PopupOptions): FeatureGroup; + bindPopup(htmlContent: string, options?: PopupOptions): FeatureGroup; /** * Returns the LatLngBounds of the Feature Group (created from bounds and coordinates @@ -797,17 +797,17 @@ declare module L { /** * Sets the given path options to each layer of the group that has a setStyle method. */ - setStyle(style: PathOptions): FeatureGroup; + setStyle(style: PathOptions): FeatureGroup; /** * Brings the layer group to the top of all other layers. */ - bringToFront(): FeatureGroup; + bringToFront(): FeatureGroup; /** * Brings the layer group to the bottom of all other layers. */ - bringToBack(): FeatureGroup; + bringToBack(): FeatureGroup; //////////// //////////// @@ -826,20 +826,20 @@ declare module L { //////////////// //////////////// - addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup; - addOneTimeEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup; - removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): FeatureGroup; + addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup; + addOneTimeEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup; + removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): FeatureGroup; hasEventListeners(type: string): boolean; - fireEvent(type: string, data?: any): FeatureGroup; - on(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup; - once(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup; - off(type: string, fn?: (e: LeafletEvent) => void, context?: any): FeatureGroup; - fire(type: string, data?: any): FeatureGroup; - addEventListener(eventMap: any, context?: any): FeatureGroup; - removeEventListener(eventMap?: any, context?: any): FeatureGroup; - clearAllEventListeners(): FeatureGroup; - on(eventMap: any, context?: any): FeatureGroup; - off(eventMap?: any, context?: any): FeatureGroup; + fireEvent(type: string, data?: any): FeatureGroup; + on(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup; + once(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup; + off(type: string, fn?: (e: LeafletEvent) => void, context?: any): FeatureGroup; + fire(type: string, data?: any): FeatureGroup; + addEventListener(eventMap: any, context?: any): FeatureGroup; + removeEventListener(eventMap?: any, context?: any): FeatureGroup; + clearAllEventListeners(): FeatureGroup; + on(eventMap: any, context?: any): FeatureGroup; + off(eventMap?: any, context?: any): FeatureGroup; } } @@ -882,7 +882,7 @@ declare module L { */ function geoJson(geojson?: any, options?: GeoJSONOptions): GeoJSON; - export class GeoJSON extends FeatureGroup { + export class GeoJSON extends FeatureGroup { /** * Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format @@ -1539,60 +1539,60 @@ declare module L { /** * Create a layer group, optionally given an initial set of layers. */ - function layerGroup(layers?: ILayer[]): LayerGroup; + function layerGroup(layers?: T[]): LayerGroup; - export class LayerGroup extends Class implements ILayer { + export class LayerGroup extends Class implements ILayer { /** * Create a layer group, optionally given an initial set of layers. */ - constructor(layers?: ILayer[]); + constructor(layers?: T[]); /** * Adds the group of layers to the map. */ - addTo(map: Map): LayerGroup; + addTo(map: Map): LayerGroup; /** * Adds a given layer to the group. */ - addLayer(layer: ILayer): LayerGroup; + addLayer(layer: T): LayerGroup; /** * Removes a given layer from the group. */ - removeLayer(layer: ILayer): LayerGroup; + removeLayer(layer: T): LayerGroup; /** * Removes a given layer of the given id from the group. */ - removeLayer(id: string): LayerGroup; + removeLayer(id: string): LayerGroup; /** * Returns true if the given layer is currently added to the group. */ - hasLayer(layer: ILayer): boolean; + hasLayer(layer: T): boolean; /** * Returns the layer with the given id. */ - getLayer(id: string): ILayer; + getLayer(id: string): T; /** * Returns an array of all the layers added to the group. */ - getLayers(): ILayer[]; + getLayers(): T[]; /** * Removes all the layers from the group. */ - clearLayers(): LayerGroup; + clearLayers(): LayerGroup; /** * Iterates over the layers of the group, optionally specifying context of * the iterator function. */ - eachLayer(fn: (layer: ILayer) => void, context?: any): LayerGroup; + eachLayer(fn: (layer: T) => void, context?: any): LayerGroup; /** * Returns a GeoJSON representation of the layer group (GeoJSON FeatureCollection). @@ -2794,7 +2794,7 @@ declare module L { */ function multiPolygon(latlngs: LatLng[][], options?: PolylineOptions): MultiPolygon; - export class MultiPolygon extends FeatureGroup { + export class MultiPolygon extends FeatureGroup { /** * Instantiates a multi-polyline object given an array of latlngs arrays (one @@ -2829,7 +2829,7 @@ declare module L { */ function multiPolyline(latlngs: LatLng[][], options?: PolylineOptions): MultiPolyline; - export class MultiPolyline extends FeatureGroup { + export class MultiPolyline extends FeatureGroup { /** * Instantiates a multi-polyline object given an array of arrays of geographical @@ -3655,27 +3655,27 @@ declare module L { } } - export interface TileLayerFactory { + export interface TileLayerFactory { /** * Instantiates a tile layer object given a URL template and optionally an options * object. */ - (urlTemplate: string, options?: TileLayerOptions): TileLayer; + (urlTemplate: string, options?: TileLayerOptions): TileLayer; /** * Instantiates a WMS tile layer object given a base URL of the WMS service and * a WMS parameters/options object. */ - wms(baseUrl: string, options: WMSOptions): L.TileLayer.WMS; + wms(baseUrl: string, options: WMSOptions): L.TileLayer.WMS; /** * Instantiates a Canvas tile layer object given an options object (optionally). */ - canvas(options?: TileLayerOptions): L.TileLayer.Canvas; + canvas(options?: TileLayerOptions): L.TileLayer.Canvas; } - - export var tileLayer: TileLayerFactory; + + export var tileLayer: TileLayerFactory; } declare module L { diff --git a/linq/linq.3.0.3-Beta4.d.ts b/linq/linq.3.0.3-Beta4.d.ts index d75d0982b..ff550d675 100755 --- a/linq/linq.3.0.3-Beta4.d.ts +++ b/linq/linq.3.0.3-Beta4.d.ts @@ -1,6 +1,6 @@ -// Type definitions for linq.js, ver 3.0.3-Beta4 +// Type definitions for linq.js v3.0.3-Beta4 // Project: http://linqjs.codeplex.com/ -// Definitions by: neuecc (http://www.codeplex.com/site/users/view/neuecc) +// Definitions by: neuecc // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module linqjs { diff --git a/linq/linq.d.ts b/linq/linq.d.ts index 960b20a90..d155ba806 100644 --- a/linq/linq.d.ts +++ b/linq/linq.d.ts @@ -1,6 +1,6 @@ // Type definitions for linq.js 2.2 // Project: http://linqjs.codeplex.com/ -// Definitions by: Marcin Najder +// Definitions by: Marcin Najder // Definitions: https://github.com/borisyankov/DefinitelyTyped // todo: jQuery plugin, RxJS Binding diff --git a/linq/linq.jquery.d.ts b/linq/linq.jquery.d.ts index c4b874bae..c79708f66 100755 --- a/linq/linq.jquery.d.ts +++ b/linq/linq.jquery.d.ts @@ -1,6 +1,6 @@ // Type definitions for linq.jquery (from linq.js) // Project: http://linqjs.codeplex.com/ -// Definitions by: neuecc (http://www.codeplex.com/site/users/view/neuecc) +// Definitions by: neuecc // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 953d32d37..cc4ab4408 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -183,6 +183,14 @@ result = _.first([1, 2, 3], function (num) { result = _.first(foodsOrganic, 'organic'); result = _.first(foodsType, { 'type': 'fruit' }); +result = _([1, 2, 3]).first(); +result = _([1, 2, 3]).first(2).value(); +result = _([1, 2, 3]).first(function (num) { + return num < 3; +}).value(); +result = _(foodsOrganic).first('organic').value(); +result = _(foodsType).first({ 'type': 'fruit' }).value(); + result = _.head([1, 2, 3]); result = _.head([1, 2, 3], 2); result = _.head([1, 2, 3], function (num) { @@ -191,12 +199,28 @@ result = _.head([1, 2, 3], function (num) { result = _.head(foodsOrganic, 'organic'); result = _.head(foodsType, { 'type': 'fruit' }); +result = _([1, 2, 3]).head(); +result = _([1, 2, 3]).head(2).value(); +result = _([1, 2, 3]).head(function (num) { + return num < 3; +}).value(); +result = _(foodsOrganic).head('organic').value(); +result = _(foodsType).head({ 'type': 'fruit' }).value(); + result = _.take([1, 2, 3]); result = _.take([1, 2, 3], 2); result = _.take([1, 2, 3], (num) => num < 3); result = _.take(foodsOrganic, 'organic'); result = _.take(foodsType, { 'type': 'fruit' }); +result = _([1, 2, 3]).take(); +result = _([1, 2, 3]).take(2).value(); +result = _([1, 2, 3]).take(function (num) { + return num < 3; +}).value(); +result = _(foodsOrganic).take('organic').value(); +result = _(foodsType).take({ 'type': 'fruit' }).value(); + result = _.flatten([1, [2], [3, [[4]]]]); result = _.flatten([1, [2], [3, [[4]]]], true); var result: any @@ -277,6 +301,22 @@ result = _.unique(['A', 'b', 'C', 'a', 'B', 'c'], function (letter) { result = _.unique([1, 2.5, 3, 1.5, 2, 3.5], function (num) { return this.floor(num); }, Math); result = <{ x: number; }[]>_.unique([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); +result = _([1, 2, 1, 3, 1]).uniq().value(); +result = _([1, 1, 2, 2, 3]).uniq(true).value(); +result = _(['A', 'b', 'C', 'a', 'B', 'c']).uniq(function (letter) { + return letter.toLowerCase(); +}).value(); +result = _([1, 2.5, 3, 1.5, 2, 3.5]).uniq(function (num) { return this.floor(num); }, Math).value(); +result = <{ x: number; }[]>_([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }]).uniq('x').value(); + +result = _([1, 2, 1, 3, 1]).unique().value(); +result = _([1, 1, 2, 2, 3]).unique(true).value(); +result = _(['A', 'b', 'C', 'a', 'B', 'c']).unique(function (letter) { + return letter.toLowerCase(); +}).value(); +result = _([1, 2.5, 3, 1.5, 2, 3.5]).unique(function (num) { return this.floor(num); }, Math).value(); +result = <{ x: number; }[]>_([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }]).unique('x').value(); + result = _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); result = _.zip(['moe', 'larry'], [30, 40], [true, false]); @@ -357,9 +397,11 @@ result = _.findLast(foodsCombined, 'organic'); result = _.forEach([1, 2, 3], function (num) { console.log(num); }); result = <_.Dictionary>_.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function (num) { console.log(num); }); +result = _.forEach({ name: 'apple', type: 'fruit' }, function (value, key) { console.log(value, key) }); result = _.each([1, 2, 3], function (num) { console.log(num); }); result = <_.Dictionary>_.each({ 'one': 1, 'two': 2, 'three': 3 }, function (num) { console.log(num); }); +result = _.each({ name: 'apple', type: 'fruit' }, function (value, key) { console.log(value, key) }); result = <_.LoDashArrayWrapper>_([1, 2, 3]).forEach(function (num) { console.log(num); }); result = <_.LoDashObjectWrapper<_.Dictionary>>_(<{ [index: string]: number; }>{ 'one': 1, 'two': 2, 'three': 3 }).forEach(function (num) { console.log(num); }); @@ -383,9 +425,17 @@ result = <_.Dictionary>_.groupBy([4.2, 6.1, 6.4], function (num) { ret result = <_.Dictionary>_.groupBy([4.2, 6.1, 6.4], function (num) { return this.floor(num); }, Math); result = <_.Dictionary>_.groupBy(['one', 'two', 'three'], 'length'); -result = <_.LoDashObjectWrapper<_.Dictionary>>_([4.2, 6.1, 6.4]).groupBy(function (num) { return Math.floor(num); }); -result = <_.LoDashObjectWrapper<_.Dictionary>>_([4.2, 6.1, 6.4]).groupBy(function (num) { return this.floor(num); }, Math); -result = <_.LoDashObjectWrapper<_.Dictionary>>_(['one', 'two', 'three']).groupBy('length'); +result = <_.Dictionary>_.groupBy({ prop1: 4.2, prop2: 6.1, prop3: 6.4}, function (num) { return Math.floor(num); }); +result = <_.Dictionary>_.groupBy({ prop1: 4.2, prop2: 6.1, prop3: 6.4}, function (num) { return this.floor(num); }, Math); +result = <_.Dictionary>_.groupBy({ prop1: 'one', prop2: 'two', prop3: 'three'}, 'length'); + +result = <_.Dictionary>_([4.2, 6.1, 6.4]).groupBy(function (num) { return Math.floor(num); }).value(); +result = <_.Dictionary>_([4.2, 6.1, 6.4]).groupBy(function (num) { return this.floor(num); }, Math).value(); +result = <_.Dictionary>_(['one', 'two', 'three']).groupBy('length').value(); + +result = <_.Dictionary>_({ prop1: 4.2, prop2: 6.1, prop3: 6.4}).groupBy(function (num) { return Math.floor(num); }).value(); +result = <_.Dictionary>_({ prop1: 4.2, prop2: 6.1, prop3: 6.4}).groupBy(function (num) { return this.floor(num); }, Math).value(); +result = <_.Dictionary>_({ prop1: 'one', prop2: 'two', prop3: 'three'}).groupBy('length').value(); result = <_.Dictionary>_.indexBy(keys, 'dir'); result = <_.Dictionary>_.indexBy(keys, function (key) { return String.fromCharCode(key.code); }); @@ -419,16 +469,18 @@ result = _.min(stoogesAges, function (stooge) { return stooge.age; result = _.min(stoogesAges, 'age'); result = _.pluck(stoogesAges, 'name'); +result = _(stoogesAges).pluck('name').value(); -result = _.reduce([1, 2, 3], function (sum: number, num: number) { - return sum + num; -}); interface ABC { [index: string]: number; a: number; b: number; c: number; } + +result = _.reduce([1, 2, 3], function (sum: number, num: number) { + return sum + num; +}); result = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function (r: ABC, num: number, key: string) { r[key] = num * 3; return r; @@ -450,6 +502,30 @@ result = _.inject({ 'a': 1, 'b': 2, 'c': 3 }, function (r: ABC, num: number return r; }, {}); +result = _([1, 2, 3]).reduce(function (sum: number, num: number) { + return sum + num; +}); +result = _({ 'a': 1, 'b': 2, 'c': 3 }).reduce(function (r: ABC, num: number, key: string) { + r[key] = num * 3; + return r; +}, {}); + +result = _([1, 2, 3]).foldl(function (sum: number, num: number) { + return sum + num; +}); +result = _({ 'a': 1, 'b': 2, 'c': 3 }).foldl(function (r: ABC, num: number, key: string) { + r[key] = num * 3; + return r; +}, {}); + +result = _([1, 2, 3]).inject(function (sum: number, num: number) { + return sum + num; +}); +result = _({ 'a': 1, 'b': 2, 'c': 3 }).inject(function (r: ABC, num: number, key: string) { + r[key] = num * 3; + return r; +}, {}); + result = _.reduceRight([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, []); result = _.foldr([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, []); @@ -457,6 +533,10 @@ result = _.reject([1, 2, 3, 4, 5, 6], function (num) { return num % 2 result = _.reject(foodsCombined, 'organic'); result = _.reject(foodsCombined, { 'type': 'fruit' }); +result = _([1, 2, 3, 4, 5, 6]).reject(function (num) { return num % 2 == 0; }).value(); +result = _(foodsCombined).reject('organic').value(); +result = _(foodsCombined).reject({ 'type': 'fruit' }).value(); + result = _.sample([1, 2, 3, 4]); result = _.sample([1, 2, 3, 4], 2); @@ -469,20 +549,33 @@ result = _.size('curly'); result = _.some([null, 0, 'yes', false], Boolean); result = _.some(foodsCombined, 'organic'); result = _.some(foodsCombined, { 'type': 'meat' }); +result = _.some(foodsOrganic[0]); result = _.any([null, 0, 'yes', false], Boolean); result = _.any(foodsCombined, 'organic'); result = _.any(foodsCombined, { 'type': 'meat' }); +result = _.any(foodsOrganic[0]); result = _.sortBy([1, 2, 3], function (num) { return Math.sin(num); }); result = _.sortBy([1, 2, 3], function (num) { return this.sin(num); }, Math); result = _.sortBy(['banana', 'strawberry', 'apple'], 'length'); -(function (a: number, b: number, c: number, d: number) { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); +result = _([1, 2, 3]).sortBy(function (num) { return Math.sin(num); }).value(); +result = _([1, 2, 3]).sortBy(function (num) { return this.sin(num); }, Math).value(); +result = _(['banana', 'strawberry', 'apple']).sortBy('length').value(); + +(function (a: number, b: number, c: number, d: number): Array { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); +result = _.toArray([1, 2, 3, 4]); +(function (a: number, b: number, c: number, d: number): Array { return _(arguments).toArray().slice(1).value(); })(1, 2, 3, 4); +result = _([1,2,3,4]).toArray().value(); + result = _.where(stoogesCombined, { 'age': 40 }); result = _.where(stoogesCombined, { 'quotes': ['Poifect!'] }); +result = _(stoogesCombined).where({ 'age': 40 }).value(); +result = _(stoogesCombined).where({ 'quotes': ['Poifect!'] }).value(); + /************* * Functions * *************/ @@ -832,6 +925,7 @@ result = _.isString('moe'); result = _.isUndefined(void 0); result = _.keys({ 'one': 1, 'two': 2, 'three': 3 }); +result = _({ 'one': 1, 'two': 2, 'three': 3 }).keys().value(); var mergeNames = { 'stooges': [ @@ -877,8 +971,14 @@ result = _.omit({ 'name': 'moe', 'age': 40 }, ['age']); result = _.omit({ 'name': 'moe', 'age': 40 }, function (value) { return typeof value == 'number'; }); +result = _({ 'name': 'moe', 'age': 40 }).omit('age').value(); +result = _({ 'name': 'moe', 'age': 40 }).omit(['age']).value(); +result = _({ 'name': 'moe', 'age': 40 }).omit(function (value) { + return typeof value == 'number'; +}).value(); result = _.pairs({ 'moe': 30, 'larry': 40 }); +result = _({ 'moe': 30, 'larry': 40 }).pairs().value(); result = _.pick({ 'name': 'moe', '_userid': 'moe1' }, 'name'); result = _.pick({ 'name': 'moe', '_userid': 'moe1' }, ['name']); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index cf227c25e..24e55836a 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -644,6 +644,104 @@ declare module _ { whereValue: W): T[]; } + interface LoDashArrayWrapper { + /** + * @see _.first + **/ + first(): T; + + /** + * @see _.first + * @param n The number of elements to return. + **/ + first(n: number): LoDashArrayWrapper; + + /** + * @see _.first + * @param callback The function called per element. + * @param [thisArg] The this binding of callback. + **/ + first( + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.first + * @param pluckValue "_.pluck" style callback value + **/ + first(pluckValue: string): LoDashArrayWrapper; + + /** + * @see _.first + * @param whereValue "_.where" style callback value + **/ + first(whereValue: W): LoDashArrayWrapper; + + /** + * @see _.first + **/ + head(): T; + + /** + * @see _.first + * @param n The number of elements to return. + **/ + head(n: number): LoDashArrayWrapper; + + /** + * @see _.first + * @param callback The function called per element. + * @param [thisArg] The this binding of callback. + **/ + head( + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.first + * @param pluckValue "_.pluck" style callback value + **/ + head(pluckValue: string): LoDashArrayWrapper; + + /** + * @see _.first + * @param whereValue "_.where" style callback value + **/ + head(whereValue: W): LoDashArrayWrapper; + + /** + * @see _.first + **/ + take(): T; + + /** + * @see _.first + * @param n The number of elements to return. + **/ + take(n: number): LoDashArrayWrapper; + + /** + * @see _.first + * @param callback The function called per element. + * @param [thisArg] The this binding of callback. + **/ + take( + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.first + * @param pluckValue "_.pluck" style callback value + **/ + take(pluckValue: string): LoDashArrayWrapper; + + /** + * @see _.first + * @param whereValue "_.where" style callback value + **/ + take(whereValue: W): LoDashArrayWrapper; + } + //_.flatten interface LoDashStatic { /** @@ -1750,6 +1848,106 @@ declare module _ { whereValue?: W): T[]; } + interface LoDashArrayWrapper { + /** + * @see _.uniq + **/ + uniq(isSorted?: boolean): LoDashArrayWrapper; + + /** + * @see _.uniq + **/ + uniq( + isSorted: boolean, + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.uniq + **/ + uniq( + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.uniq + * @param pluckValue _.pluck style callback + **/ + uniq( + isSorted: boolean, + pluckValue: string): LoDashArrayWrapper; + + /** + * @see _.uniq + * @param pluckValue _.pluck style callback + **/ + uniq(pluckValue: string): LoDashArrayWrapper; + + /** + * @see _.uniq + * @param whereValue _.where style callback + **/ + uniq( + isSorted: boolean, + whereValue: W): LoDashArrayWrapper; + + /** + * @see _.uniq + * @param whereValue _.where style callback + **/ + uniq( + whereValue: W): LoDashArrayWrapper; + + /** + * @see _.uniq + **/ + unique(isSorted?: boolean): LoDashArrayWrapper; + + /** + * @see _.uniq + **/ + unique( + isSorted: boolean, + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.uniq + **/ + unique( + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.uniq + * @param pluckValue _.pluck style callback + **/ + unique( + isSorted: boolean, + pluckValue: string): LoDashArrayWrapper; + + /** + * @see _.uniq + * @param pluckValue _.pluck style callback + **/ + unique(pluckValue: string): LoDashArrayWrapper; + + /** + * @see _.uniq + * @param whereValue _.where style callback + **/ + unique( + isSorted: boolean, + whereValue: W): LoDashArrayWrapper; + + /** + * @see _.uniq + * @param whereValue _.where style callback + **/ + unique( + whereValue: W): LoDashArrayWrapper; + } + //_.without interface LoDashStatic { /** @@ -2741,6 +2939,14 @@ declare module _ { callback: ObjectIterator, thisArg?: any): Dictionary; + /** + * @see _.each + **/ + forEach( + object: T, + callback: ObjectIterator, + thisArg?: any): T + /** * @see _.forEach **/ @@ -2767,6 +2973,14 @@ declare module _ { object: Dictionary, callback: ObjectIterator, thisArg?: any): Dictionary; + + /** + * @see _.each + **/ + each( + object: T, + callback: ObjectIterator, + thisArg?: any): T } interface LoDashArrayWrapper { @@ -2955,6 +3169,30 @@ declare module _ { groupBy( collection: List, whereValue: W): Dictionary; + + /** + * @see _.groupBy + **/ + groupBy( + collection: Dictionary, + callback?: ListIterator, + thisArg?: any): Dictionary; + + /** + * @see _.groupBy + * @param pluckValue _.pluck style callback + **/ + groupBy( + collection: Dictionary, + pluckValue: string): Dictionary; + + /** + * @see _.groupBy + * @param whereValue _.where style callback + **/ + groupBy( + collection: Dictionary, + whereValue: W): Dictionary; } interface LoDashArrayWrapper { @@ -2963,19 +3201,40 @@ declare module _ { **/ groupBy( callback: ListIterator, - thisArg?: any): _.LoDashObjectWrapper>; + thisArg?: any): _.LoDashObjectWrapper<_.Dictionary>; /** * @see _.groupBy **/ groupBy( - pluckValue: string): _.LoDashObjectWrapper>; + pluckValue: string): _.LoDashObjectWrapper<_.Dictionary>; /** * @see _.groupBy **/ groupBy( - whereValue: W): _.LoDashObjectWrapper>; + whereValue: W): _.LoDashObjectWrapper<_.Dictionary>; + } + + interface LoDashObjectWrapper { + /** + * @see _.groupBy + **/ + groupBy( + callback: ListIterator, + thisArg?: any): _.LoDashObjectWrapper<_.Dictionary>; + + /** + * @see _.groupBy + **/ + groupBy( + pluckValue: string): _.LoDashObjectWrapper<_.Dictionary>; + + /** + * @see _.groupBy + **/ + groupBy( + whereValue: W): _.LoDashObjectWrapper<_.Dictionary>; } //_.indexBy @@ -3444,6 +3703,22 @@ declare module _ { property: string): any[]; } + interface LoDashArrayWrapper { + /** + * @see _.pluck + **/ + pluck( + property: string): LoDashArrayWrapper; + } + + interface LoDashObjectWrapper { + /** + * @see _.pluck + **/ + pluck( + property: string): LoDashArrayWrapper; + } + //_.reduce interface LoDashStatic { /** @@ -3609,6 +3884,100 @@ declare module _ { thisArg?: any): TResult; } + interface LoDashArrayWrapper { + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + inject( + callback: MemoIterator, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + inject( + callback: MemoIterator, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + foldl( + callback: MemoIterator, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + foldl( + callback: MemoIterator, + thisArg?: any): TResult; + } + + interface LoDashObjectWrapper { + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + inject( + callback: MemoIterator, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + inject( + callback: MemoIterator, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + foldl( + callback: MemoIterator, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + foldl( + callback: MemoIterator, + thisArg?: any): TResult; + } + //_.reduceRight interface LoDashStatic { /** @@ -3806,6 +4175,27 @@ declare module _ { whereValue: W): T[]; } + interface LoDashArrayWrapper { + /** + * @see _.reject + **/ + reject( + callback: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.reject + * @param pluckValue _.pluck style callback + **/ + reject(pluckValue: string): LoDashArrayWrapper; + + /** + * @see _.reject + * @param whereValue _.where style callback + **/ + reject(whereValue: W): LoDashArrayWrapper; + } + //_.sample interface LoDashStatic { /** @@ -3933,6 +4323,14 @@ declare module _ { callback?: ListIterator, thisArg?: any): boolean; + /** + * @see _.some + **/ + some( + collection: {}, + callback?: ListIterator<{}, boolean>, + thisArg?: any): boolean; + /** * @see _.some * @param pluckValue _.pluck style callback @@ -4005,6 +4403,14 @@ declare module _ { callback?: ListIterator, thisArg?: any): boolean; + /** + * @see _.some + **/ + any( + collection: {}, + callback?: ListIterator<{}, boolean>, + thisArg?: any): boolean; + /** * @see _.some * @param pluckValue _.pluck style callback @@ -4118,6 +4524,27 @@ declare module _ { whereValue: W): T[]; } + interface LoDashArrayWrapper { + /** + * @see _.sortBy + **/ + sortBy( + callback?: ListIterator, + thisArg?: any): LoDashArrayWrapper; + + /** + * @see _.sortBy + * @param pluckValue _.pluck style callback + **/ + sortBy(pluckValue: string): LoDashArrayWrapper; + + /** + * @see _.sortBy + * @param whereValue _.where style callback + **/ + sortBy(whereValue: W): LoDashArrayWrapper; + } + //_.toArray interface LoDashStatic { /** @@ -4138,6 +4565,20 @@ declare module _ { toArray(collection: Dictionary): T[]; } + interface LoDashArrayWrapper { + /** + * @see _.toArray + **/ + toArray(): LoDashArrayWrapper; + } + + interface LoDashObjectWrapper { + /** + * @see _.toArray + **/ + toArray(): LoDashArrayWrapper; + } + //_.where interface LoDashStatic { /** @@ -4166,6 +4607,13 @@ declare module _ { properties: U): T[]; } + interface LoDashArrayWrapper { + /** + * @see _.where + **/ + where(properties: U): LoDashArrayWrapper; + } + /************* * Functions * *************/ @@ -5280,6 +5728,13 @@ declare module _ { keys(object: any): string[]; } + interface LoDashObjectWrapper { + /** + * @see _.keys + **/ + keys(): LoDashArrayWrapper + } + //_.mapValues interface LoDashStatic { /** @@ -5391,6 +5846,27 @@ declare module _ { thisArg?: any): Omitted; } + interface LoDashObjectWrapper { + /** + * @see _.omit + **/ + omit( + ...keys: string[]): LoDashObjectWrapper; + + /** + * @see _.omit + **/ + omit( + keys: string[]): LoDashObjectWrapper; + + /** + * @see _.omit + **/ + omit( + callback: ObjectIterator, + thisArg?: any): LoDashObjectWrapper; + } + //_.pairs interface LoDashStatic { /** @@ -5402,6 +5878,13 @@ declare module _ { pairs(object: any): any[][]; } + interface LoDashObjectWrapper { + /** + * @see _.pairs + **/ + pairs(): LoDashArrayWrapper; + } + //_.picks interface LoDashStatic { /** diff --git a/mapbox/mapbox-tests.ts b/mapbox/mapbox-tests.ts new file mode 100644 index 000000000..0caebb042 --- /dev/null +++ b/mapbox/mapbox-tests.ts @@ -0,0 +1,41 @@ +/// + +var mapboxTiles = L.tileLayer('https://{s}.tiles.mapbox.com/v3/examples.map-i87786ca/{z}/{x}/{y}.png', { + attribution: 'Terms & Feedback' +}); + +var map = L.map('map').addLayer(mapboxTiles).setView(new L.LatLng([42.3610, -71.0587]), 15); + +var coordinates = document.getElementById('coordinates'); + +var marker = L.marker(new L.LatLng([0, 0]), { + icon: L.mapbox.marker.icon({ + 'marker-color': '#f86767' + }), + draggable: true +}).addTo(map); + +// every time the marker is dragged, update the coordinates container +marker.on('dragend', function() { + var m = marker.getLatLng(); + coordinates.innerHTML = 'Latitude: ' + m.lat + '
    Longitude: ' + m.lng; +}); + +// Build a marker from a simple GeoJSON object: +var marker2 = L.mapbox.featureLayer({ + type: 'Feature', + geometry: { + type: 'Point', + coordinates: [-73.9840, 40.7271] + }, + properties: { + title: 'Hello world!', + 'marker-color': '#f86767' + } +}).addTo(map); + +// Iterate over the featureLayer we've called "marker" +// and open its popup instead of clicking to trigger it. +marker2.eachLayer(function(marker: L.Marker) { + marker.openPopup(); +}); \ No newline at end of file diff --git a/mapbox/mapbox.d.ts b/mapbox/mapbox.d.ts new file mode 100644 index 000000000..cf2da20b5 --- /dev/null +++ b/mapbox/mapbox.d.ts @@ -0,0 +1,452 @@ +// Type definitions for Mapbox 1.6.3 +// Project: https://www.mapbox.com/mapbox.js/ +// Definitions by: Maxime Fabre +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +////////////////////////////////////////////////////////////////////// +///////////////////////////// MAP OBJECT ///////////////////////////// +////////////////////////////////////////////////////////////////////// + +// Map +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + + /** + * Create and automatically configure a map with layers, markers, and interactivity. + */ + function map(element: string, id: string, options?: MapOptions): L.mapbox.Map; + function map(element: string, tilejson: any, options?: MapOptions): L.mapbox.Map; + + interface MapOptions extends L.MapOptions { + featureLayer? : FeatureLayerOptions; + gridLayer? : any; + tileLayer? : TileLayerOptions; + infoControl? : ControlOptions; + legendControl? : ControlOptions; + shareControl? : ShareControlOptions; + } + + interface FilterFunction { + (feature: any): boolean; + } + + interface Map extends L.Map { + tileLayer : L.mapbox.TileLayer; + gridLayer : L.mapbox.GridLayer; + featureLayer : L.mapbox.FeatureLayer; + + gridControl : L.mapbox.GridControl; + infoControl : L.mapbox.InfoControl; + legendControl : L.mapbox.LegendControl; + shareControl : L.mapbox.ShareControl; + + addLayer(layer: any): any; + getTileJSON(): any; + + } + +} + +////////////////////////////////////////////////////////////////////// +/////////////////////////////// LAYERS /////////////////////////////// +////////////////////////////////////////////////////////////////////// + +// TileLayer +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + + /** + * You can add a tiled layer to your map with L.mapbox.tileLayer(), a simple interface to layers from Mapbox and elsewhere. + */ + function tileLayer(id: string, options?: TileLayerOptions): L.mapbox.TileLayer; + function tileLayer(tilejson: any, options?: TileLayerOptions): L.mapbox.TileLayer; + + interface TileLayerOptions extends L.TileLayerOptions { + retinaVersion?: string; + } + + interface TileLayer extends L.TileLayer { + + /** + * Returns this layer's TileJSON object which determines its tile source, zoom bounds and other metadata. + */ + getTileJSON(): any; + + /** + * Set the image format of tiles in this layer. You can use lower-quality tiles in order to load maps faster + */ + setFormat(format: string): TileLayer; + + } + +} + +// GridLayer +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + + /** + * An L.mapbox.gridLayer loads UTFGrid tiles of interactivity into your map, which you can easily access with L.mapbox.gridControl. + */ + function gridLayer(id: string): L.mapbox.GridLayer; + function gridLayer(tilejson: any): L.mapbox.GridLayer; + + interface GridLayer { + + active(): boolean; + addTo(map: L.mapbox.Map): any; + onAdd(map: L.mapbox.Map): any; + onRemove(): any; + + /** + * Bind an event handler to a given event on this L.mapbox.gridLayer instance. GridLayers expose a number of useful events that give you access to UTFGrid data as the user interacts with the map. + */ + on(event: string, handler: Function, context?: any): any; + + /** + * Returns this layer's TileJSON object which determines its tile source, zoom bounds and other metadata. + */ + getTileJSON(): any; + + /** + * Load data for a given latitude, longitude point on the map, and call the callback function with that data, if any. + */ + getData(latlng: L.LatLng, callback: Function): any; + + } + +} + +// FeatureLayer +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + + /** + * L.mapbox.featureLayer provides an easy way to integrate GeoJSON from Mapbox and elsewhere into your map. + */ + function featureLayer(): L.mapbox.FeatureLayer; + function featureLayer(id: string, options?: FeatureLayerOptions): L.mapbox.FeatureLayer; + function featureLayer(geojson: any, options?: FeatureLayerOptions): L.mapbox.FeatureLayer; + + interface FeatureLayerOptions { + filter? : FilterFunction; + sanitizer? : (template: string) => string; + } + + interface FeatureLayer extends L.FeatureGroup { + + /** + * Load GeoJSON data for this layer from the URL given by url. + */ + loadURL(url: string): any; + + /** + * Load marker GeoJSON data from a map with the given id on Mapbox. + */ + loadID(id: string): any; + + /** + * Sets the filter function for this data layer. + */ + setFilter(filter: FilterFunction): any; + + /** + * Gets the filter function for this data layer. + */ + getFilter(): FilterFunction; + + /** + * Set the contents of a markers layer: run the provided features through + * the filter function and then through the factory function to create + * elements for the map. If the layer already has features, they are + * replaced with the new features. An empty array will clear the + * layer of all features. + */ + setGeoJSON(geojson: any): L.mapbox.FeatureLayer; + + /** + * Get the contents of this layer as GeoJSON data. + */ + getGeoJSON(): any; + + } + +} + +////////////////////////////////////////////////////////////////////// +////////////////////////////// GEOCODING ///////////////////////////// +////////////////////////////////////////////////////////////////////// + +// Geocoder +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + + /** + * A low-level interface to geocoding, useful for more complex uses and reverse-geocoding. + */ + function geocoder(id: string): L.mapbox.Geocoder; + + interface Geocoder { + + getURL(): string; + setURL(url: string): any; + setID(id: string): any; + setTileJSON(tilejson: any): any; + queryURL(url: string): string; + + /** + * Queries the geocoder with a query string, and returns its result, if any. + */ + query(queryString: string, callback: Function): any; + + /** + * Queries the geocoder with a location, and returns its result, if any. + */ + reverseQuery(location: any, callback: Function): any; + + } +} + +////////////////////////////////////////////////////////////////////// +//////////////////////////////// CONTROLS //////////////////////////// +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + interface ControlOptions extends L.ControlOptions { + sanitizer?: (template: string) => string; + } +} + +// InfoControl +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + + /** + * A map control that shows a toggleable info container. If set, attribution is auto-detected from active layers and added to the info container. + */ + function infoControl(options?: ControlOptions): InfoControl; + + interface InfoControl extends L.Control { + + onAdd(map: L.mapbox.Map): any; + onRemove(map: L.mapbox.Map): any; + + /** + * Adds an info string to infoControl. + */ + addInfo(info: string): any; + + /** + * Removes an info string from infoControl + */ + removeInfo(info: string): any; + + } + +} + +// LegendControl +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + + /** + * A map control that shows legends added to maps in Mapbox. + * Legends are auto-detected from active layers. + */ + function legendControl(options?: ControlOptions): LegendControl; + + interface LegendControl extends L.Control { + + onAdd(map: L.mapbox.Map): any; + + /** + * Adds a legend to the legendControl. + */ + addLegend(legend: string): any; + + /** + * Removes a legend from the legendControl. + */ + removeLegend(legend: string): any; + + } + +} + +// GridControl +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + + /** + * Interaction is what we call interactive parts of maps that are created with + * the powerful tooltips & regions system in TileMill. Under the hood, it's powered by the open UTFGrid specification. + */ + function gridControl(layer: string, options?: GridControlOptions): GridControl; + + interface GridControlOptions extends ControlOptions { + template? : string; + follow? : boolean; + pinnable? : boolean; + touchTeaser? : boolean; + location? : boolean; + } + + interface GridControl extends L.Control { + + onAdd(map: L.mapbox.Map): any; + onRemove(map: L.mapbox.Map): any; + + /** + * If a tooltip is currently shown by the gridControl, hide and close it. + */ + hide(): any; + + /** + * Change the Mustache template used to transform the UTFGrid data in the map's interactivity into HTML for display. + */ + setTemplate(template: string): any; + + } + +} + +// GeocoderControl +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + + /** + * Adds geocoder functionality as well as a UI element to a map. This uses the Mapbox Geocoding API. + */ + function geocoderControl(id: string, options?: GeocoderControlOptions): GeocoderControl; + + interface GeocoderControlOptions extends L.ControlOptions { + keepOpen?: boolean; + } + + interface GeocoderControl { + + getURL(): string; + onAdd(map: L.mapbox.Map): any; + + + /** + * Set the url used for geocoding. + */ + setURL(url: string): any; + + /** + * Set the map id used for geocoding. + */ + setID(id: string): any; + + /** + * Set the TileJSON used for geocoding. + */ + setTileJSON(tilejson: any): any; + + /** + * Bind a listener to an event emitted by the geocoder control. Supported additional events are + */ + on(event: string, callback: Function): any; + + } + +} + +// ShareControl +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + + /** + * Adds a "Share" button to the map, which can be used to share the map to Twitter or Facebook, or generate HTML for a map embed. + */ + function shareControl(id: string, options?: ShareControlOptions): ShareControl; + + interface ShareControlOptions extends L.ControlOptions { + url?: string; + } + + interface ShareControl extends L.Control { + + onAdd(map: L.mapbox.Map): any; + + } + +} + +////////////////////////////////////////////////////////////////////// +////////////////////////////// MARKERS /////////////////////////////// +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox.marker { + + /** + * A core icon generator used in L.mapbox.marker.style + */ + function icon(feature: any): L.Icon; + + /** + * An icon generator for use in conjunction with pointToLayer to generate markers from the Mapbox Markers API and support the simplestyle-spec for features. + */ + function style(feature: any, latlng: any): L.Marker; + +} + +////////////////////////////////////////////////////////////////////// +////////////////////////////// SIMPLESTYLE /////////////////////////// +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox.simplestyle { + + /** + * Given a GeoJSON Feature with optional simplestyle-spec properties, return an options object formatted to be used as Leaflet Path options. + */ + function style(feature: any): L.PathOptions; + +} + +////////////////////////////////////////////////////////////////////// +/////////////////////////////// UTILITY ////////////////////////////// +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + + /** + * A HTML sanitization function, with the same effect as the default value of the sanitizer option of L.mapbox.featureLayer, L.mapbox.gridControl, and L.mapbox.legendControl. + */ + function sanitize(text: string): string; + + /** + * A mustache template rendering function, as used by the templating feature provided by L.mapbox.gridControl. + */ + function template(template: string, data?: any): string; + +} + +////////////////////////////////////////////////////////////////////// +///////////////////////////// CONFIGURATION ////////////////////////// +////////////////////////////////////////////////////////////////////// + +declare module L.mapbox { + export class config { + + static FORCE_HTTPS: boolean; + + static HTTP_URLS: string[]; + + static HTTPS_URLS: string[]; + + } +} diff --git a/marionette/marionette.d.ts b/marionette/marionette.d.ts index 7a52d7453..96672ca3f 100644 --- a/marionette/marionette.d.ts +++ b/marionette/marionette.d.ts @@ -1,8 +1,6 @@ // Type definitions for Marionette // Project: https://github.com/marionettejs/ -// Definitions by: Zeeshan Hamid -// Definitions by: Natan Vivo -// Definitions by: Sven Tschui +// Definitions by: Zeeshan Hamid , Natan Vivo , Sven Tschui // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/mathjax/mathjax.d.ts b/mathjax/mathjax.d.ts index 08b1950bf..65c10e3ad 100644 --- a/mathjax/mathjax.d.ts +++ b/mathjax/mathjax.d.ts @@ -1,7 +1,7 @@ // Type definitions for MathJax // Project: https://github.com/mathjax/MathJax // Definitions by: Roland Zwaga -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped // These are slightly preliminary and can use some more strong typing here and there. Please feel free to improve. declare var MathJax:jax.IMathJax; @@ -1697,4 +1697,4 @@ declare module jax { /*Indicates whether the mathematics has changed so that its output needs to be updated.*/ needsUpdate():boolean; } -} \ No newline at end of file +} diff --git a/microsoft-ajax/microsoft.ajax-tests.ts b/microsoft-ajax/microsoft.ajax-tests.ts index f29b3f3bf..763c1e7fb 100644 --- a/microsoft-ajax/microsoft.ajax-tests.ts +++ b/microsoft-ajax/microsoft.ajax-tests.ts @@ -269,8 +269,8 @@ function Sys_CancelEventArgs_Tests() { } var ActivateAlertDiv = function (visString: string, msg: string) { - var adiv = $get(divElem); - var aspan = $get(messageElem); + var adiv = $get(divElem); + var aspan = $get(messageElem); adiv.style.visibility = visString; aspan.innerHTML = msg; } @@ -338,20 +338,20 @@ function Sys_Component_Tests() { function Sys_UI_Key_Tests() { - var backspace = Sys.UI.Key.backspace; - var del = Sys.UI.Key.del; - var down = Sys.UI.Key.down; - var end = Sys.UI.Key.end; - var pageDown = Sys.UI.Key.pageDown; - var pageUp = Sys.UI.Key.pageUp; - var home = Sys.UI.Key.home; - var enter = Sys.UI.Key.enter; - var esc = Sys.UI.Key.esc; - var tab = Sys.UI.Key.tab; - var key = Sys.UI.Key.up; - var left = Sys.UI.Key.left; - var right = Sys.UI.Key.right; - var space = Sys.UI.Key.space; + var backspace: number = Sys.UI.Key.backspace; + var del: number = Sys.UI.Key.del; + var down: number = Sys.UI.Key.down; + var end: number = Sys.UI.Key.end; + var pageDown: number = Sys.UI.Key.pageDown; + var pageUp: number = Sys.UI.Key.pageUp; + var home: number = Sys.UI.Key.home; + var enter: number = Sys.UI.Key.enter; + var esc: number = Sys.UI.Key.esc; + var tab: number = Sys.UI.Key.tab; + var key: number = Sys.UI.Key.up; + var left: number = Sys.UI.Key.left; + var right: number = Sys.UI.Key.right; + var space: number = Sys.UI.Key.space; } @@ -372,6 +372,117 @@ function Sys_UI_Control_Tests() { a.dispose(); } +function Sy_UI_Point_Tests() { + + var elementRef: Sys.UI.DomElement; + var result: string; + // Get the location of the element + var elementLoc = Sys.UI.DomElement.getLocation(elementRef); + result += "Before move - Label1 location (x,y) = (" + + elementLoc.x + "," + elementLoc.y + ")
    "; + // Move the element + Sys.UI.DomElement.setLocation(elementRef, 100, elementLoc.y); + elementLoc = Sys.UI.DomElement.getLocation(elementRef); + result += "After move - Label1 location (x,y) = (" + + elementLoc.x + "," + elementLoc.y + ")
    "; + +} + +function Sys_UI_DomEvent_Tests() { + + var object: any; + + Sys.UI.DomEvent.addHandler(object, "eventName", () => { }); + Sys.UI.DomEvent.addHandler(object, "eventName", () => { }, true); + + Sys.UI.DomEvent.addHandlers(object, object, object, true); + Sys.UI.DomEvent.removeHandler(object, "eventName", () => { }); + Sys.UI.DomEvent.clearHandlers(object); + + var domEvent = new Sys.UI.DomEvent(object); + var altKey: boolean = domEvent.altKey; + var mouseButton: Sys.UI.MouseButton = domEvent.button; + var charCode: number = domEvent.charCode; + var clientX: number = domEvent.clientX; + var ctrlKey: boolean = domEvent.ctrlKey; + var screenX: number = domEvent.screenX; + var screenY: number = domEvent.screenY; + var target: any = domEvent.target; + var shiftKey: boolean = domEvent.shiftKey; + var type: string = domEvent.type; +} + +function Sys_UI_DomElement_Tests() { + + // Add CSS class + Sys.UI.DomElement.addCssClass($get("Button1"), "redBackgroundColor"); + + var elementRef: Sys.UI.DomElement = $get("Label1"); + var elementBounds = Sys.UI.DomElement.getBounds(elementRef); + var toggleCssClassMethod = () => {}; + var removeCssClassMethod = () => {}; + var containsClass = Sys.UI.DomElement.containsCssClass(elementRef, "class-name"); + + // Add handler using the getElementById method + $addHandler(Sys.UI.DomElement.getElementById("Button1"), "click", toggleCssClassMethod); + // Add handler using the shortcut to the getElementById method + $addHandler($get("Button2"), "click", removeCssClassMethod); + + Sys.UI.DomElement.toggleCssClass($get("id"), "redBackgroundColor"); + + + // Add handlers using the $get shortcut to the + // Sys.UI.DomElement.getElementById method + $addHandler($get("Button1"), "click", toggleVisible); + $addHandler($get("Button2"), "click", toggleVisibilityMode); + + // This method is called when Button2 is clicked. + function toggleVisible() { + var anElement = $get("Label1"); + if (Sys.UI.DomElement.getVisible(anElement)) { + Sys.UI.DomElement.setVisible(anElement, false); + } + else { + Sys.UI.DomElement.setVisible(anElement, true); + } + } + + // This method is called when Button1 is clicked. + function toggleVisibilityMode() { + + var anElement = $get("Label1"); + + var visMode = Sys.UI.DomElement.getVisibilityMode(anElement); + + var status = visMode; + + if (visMode === 0) { + Sys.UI.DomElement.setVisibilityMode(anElement, Sys.UI.VisibilityMode.collapse); + if (document.all) { + anElement.innerText = + "Label1 VisibilityMode: Sys.UI.VisibilityMode.collapse"; + } + else { + //Firefox + anElement.textContent = + "Label1 VisibilityMode: Sys.UI.VisibilityMode.collapse"; + } + } + else { + Sys.UI.DomElement.setVisibilityMode(anElement, Sys.UI.VisibilityMode.hide); + if (document.all) { + anElement.innerText = "Label1 VisibilityMode: Sys.UI.VisibilityMode.hide"; + } + else { + //Firefox + anElement.textContent = "Label1 VisibilityMode: Sys.UI.VisibilityMode.hide"; + } + } + } + + +} + function Sys_Debug_Tests() { var condition = true; @@ -519,22 +630,52 @@ function Sys_Net_WebRequestManager_Tests() { function Sys_WebForms_PageRequestManager_Tests() { - var pageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); + var pageRequestManager: Sys.WebForms.PageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); - var eventArgs = pageRequestManager.Empty; + var beginRequestHandler = (sender: any, args: Sys.WebForms.BeginRequestEventArgs) => { + var postBackElement: HTMLElement = args.get_postBackElement(); + var webRequest: Sys.Net.WebRequest = args.get_request(); + var updatePanelsToUpdate: string[] = args.get_updatePanelsToUpdate(); + var empty: Sys.EventArgs = args.Empty; + } + var endRequestHandler = (sender: any, args: Sys.WebForms.EndRequestEventArgs) => { + var dataItems: any = args.get_dataItems(); + var error: Error = args.get_error(); + var errorHandled: boolean = args.get_errorHandled(); + var webRequestExecutor: Sys.Net.WebRequestExecutor = args.get_response(); + args.set_errorHandled(true); - var handler = (sender: any, args: any) => { } + } + var initializeRequestHandler = (sender: any, args: Sys.WebForms.InitializeRequestEventArgs) => { + var postBackElement: HTMLElement = args.get_postBackElement(); + var webRequestExecutor: Sys.Net.WebRequestExecutor = args.get_request(); + var updatePanelsToUpdate: string[] = args.get_updatePanelsToUpdate(); + var empty: Sys.EventArgs = args.Empty; + } + var pageLoadedRequestHandler = (sender: any, args: Sys.WebForms.PageLoadedEventArgs) => { + var dataItems: any = args.get_dataItems(); + var panelsCreated: HTMLDivElement[] = args.get_panelsCreated(); + var panelsUpdated: HTMLDivElement[] = args.get_panelsUpdated(); + var empty: Sys.EventArgs = args.Empty; + } + var pageLoadingRequestHandler = (sender: any, args: Sys.WebForms.PageLoadingEventArgs) => { + var dataItems: any = args.get_dataItems(); + var panelsDeleted: HTMLDivElement[] = args.get_panelsDeleted(); + var panelsUpdating = args.get_panelsUpdating(); + var empty: Sys.EventArgs = args.Empty; + } - var isInAsyncPostBack = pageRequestManager.get_isInAsyncPostBack(); + + var isInAsyncPostBack: boolean = pageRequestManager.get_isInAsyncPostBack(); - pageRequestManager.add_beginRequest(handler); - pageRequestManager.add_endRequest(handler); - pageRequestManager.add_initializeRequest(handler); - pageRequestManager.add_pageLoading(handler); - pageRequestManager.add_pageLoaded(handler); - pageRequestManager.remove_beginRequest(handler); - pageRequestManager.remove_pageLoaded(handler); - pageRequestManager.remove_pageLoading(handler); + pageRequestManager.add_beginRequest(beginRequestHandler); + pageRequestManager.add_endRequest(endRequestHandler); + pageRequestManager.add_initializeRequest(initializeRequestHandler); + pageRequestManager.add_pageLoading(pageLoadingRequestHandler); + pageRequestManager.add_pageLoaded(pageLoadedRequestHandler); + pageRequestManager.remove_beginRequest(beginRequestHandler); + pageRequestManager.remove_pageLoaded(pageLoadedRequestHandler); + pageRequestManager.remove_pageLoading(pageLoadingRequestHandler); pageRequestManager.beginAsyncPostBack(); pageRequestManager.abortPostBack(); pageRequestManager.dispose(); @@ -542,19 +683,19 @@ function Sys_WebForms_PageRequestManager_Tests() { function Sys_WebForms_EndRequestEventArgs_Tests() { - var pageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); + var pageRequestManager: Sys.WebForms.PageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); var handler = (sender: any, args: Sys.WebForms.EndRequestEventArgs) => { - var error = args.get_error(); - var message = error.message; - var name = error.name; - var response = args.get_response(); - var dataItems = args.get_dataItems(); - var eventArgs = args.Empty; + var error: Error = args.get_error(); + var message: string = error.message; + var name: string = error.name; + var response: Sys.Net.WebRequestExecutor = args.get_response(); + var dataItems: any = args.get_dataItems(); + var eventArgs: Sys.EventArgs = args.Empty; args.set_errorHandled(true); - var errorHandled = args.get_errorHandled(); + var errorHandled: boolean = args.get_errorHandled(); } pageRequestManager.add_endRequest(handler); diff --git a/microsoft-ajax/microsoft.ajax.d.ts b/microsoft-ajax/microsoft.ajax.d.ts index 5dda0ae6c..1c8968f44 100644 --- a/microsoft-ajax/microsoft.ajax.d.ts +++ b/microsoft-ajax/microsoft.ajax.d.ts @@ -326,7 +326,6 @@ interface Date { parseInvariant(value: string, ...formats: string[]): string; } - declare module MicrosoftAjaxBaseTypeExtensions { /** @@ -909,7 +908,7 @@ declare function $find(id: string, parent?: HTMLElement): Sys.Component; * @param handler The event handler to add. * @param autoRemove (Optional) A boolean value that determines whether the handler should be removed automatically when the element is disposed. */ -declare function $addHandler(element: Element, eventName: string, handler: Function, autoRemove?: boolean): void; +declare function $addHandler(element: Sys.UI.DomElement, eventName: string, handler: Function, autoRemove?: boolean): void; /** * Provides a shortcut to the addHandlers method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class. @@ -919,7 +918,7 @@ declare function $addHandler(element: Element, eventName: string, handler: Funct * @param handlerOwner (Optional) The object instance that is the context for the delegates that should be created from the handlers. * @param autoRemove (Optional) A boolean value that determines whether the handler should be removed automatically when the element is disposed. */ -declare function $addHandlers(element: Element, events: any, handlerOwner?: any, autoRemove?: boolean): void; +declare function $addHandlers(element: Sys.UI.DomElement, events: any, handlerOwner?: any, autoRemove?: boolean): void; /** * Provides a shortcut to the clearHandlers method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class. @@ -927,7 +926,7 @@ declare function $addHandlers(element: Element, events: any, handlerOwner?: any, * @see {@link http://msdn.microsoft.com/en-us/library/bb310959(v=vs.100).aspx} * @param The DOM element that exposes the events. */ -declare function $clearHandlers(element: Element): void; +declare function $clearHandlers(element: Sys.UI.DomElement): void; /** * Provides a shortcut to the getElementById method of the Sys.UI.DomElement class. This member is static and can be invoked without creating an instance of the class. @@ -937,9 +936,11 @@ declare function $clearHandlers(element: Element): void; * @param element * The parent element to search. The default is the document element. * @return -* The element +* The Sys.UI.DomElement */ -declare function $get(id: string, element?: Element): HTMLElement; +declare function $get(id: string): any; // Examples use HTMLElement and DomElement +declare function $get(id: string, element?: HTMLElement): HTMLElement; +declare function $get(id: string, element?: Sys.UI.DomElement): Sys.UI.DomElement; /** * Provides a shortcut to the removeHandler method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class. @@ -948,7 +949,9 @@ declare function $get(id: string, element?: Element): HTMLElement; * @param eventName The name of the DOM event. * @param handler The event handler to remove. */ -declare function $removeHandler(element: Element, eventName: string, handler: Function): void; +declare function $removeHandler(element: any, eventName: string, handler: Function): void; +declare function $removeHandler(element: HTMLElement, eventName: string, handler: Function): void; +declare function $removeHandler(element: Sys.UI.DomElement, eventName: string, handler: Function): void; //#endregion @@ -1384,7 +1387,7 @@ declare module Sys { * @param displayCaller * (Optional) true to indicate that the name of the function that is calling assert should be displayed in the message. The default is false. */ - static assert(condition: boolean, message?: string, displayCaller?: boolean): void; + static assert(condition: boolean, message?: string, displayCaller?: boolean): void; /** * Clears all trace messages from the trace console. */ @@ -2250,7 +2253,7 @@ declare module Sys { * @see {@link http://msdn.microsoft.com/en-us/library/bb310823(v=vs.100).aspx} */ // Cannot create definitions for generated proxy classes. - + /** * Contains information about a Web request that is ready to be sent to the current Sys.Net.WebRequestExecutor instance. * This class represents the type for the second parameter of the callback function added by the add_invokingRequest method. @@ -2259,7 +2262,7 @@ declare module Sys { * @see {@link http://msdn.microsoft.com/en-us/library/bb397488(v=vs.100).aspx} */ class NetWorkRequestEventArgs { - + //#region Constructors /** @@ -2536,7 +2539,7 @@ declare module Sys { set_defaultTimeout(value: number): void; //#endregion - + } export var WebRequestManager: IWebRequestManager; @@ -3122,10 +3125,184 @@ declare module Sys { } /** * Defines static methods and properties that provide helper APIs for manipulating and inspecting DOM elements. + * @see {@link http://msdn.microsoft.com/en-us/library/bb383788(v=vs.100).aspx} */ - class DomElement { - // todo + interface DomElement { + + //#region Constructors + + /** + * Initializes a new instance of the Sys.UI.DomElement class. + */ + constructor(): void; + + //#endregion + + //#region Methods + + /** + * Adds a CSS class to a DOM element if the class is not already part of the DOM element. This member is static and can be invoked without creating an instance of the class. + * If the element does not support a CSS class, no change is made to the element. + * @param element + * The Sys.UI.DomElement object to add the CSS class to. + * @param className + * The name of the CSS class to add. + */ + addCssClass(element: Sys.UI.DomElement, className: string): void; + /** + * Gets a value that indicates whether the DOM element contains the specified CSS class. This member is static and can be invoked without creating an instance of the class. + * @param element + * The Sys.UI.DomElement object to test for the CSS class. + * @param className + * The name of the CSS class to test for. + * @return + * true if the element contains the specified CSS class; otherwise, false. + */ + containsCssClass(element: Sys.UI.DomElement, className: string): boolean; + /** + * Gets a set of integer coordinates that represent the position, width, and height of a DOM element. This member is static and can be invoked without creating an instance of the class. + * + * @param element + * The Sys.UI.DomElement instance to get the coordinates of. + * @return + * An object of the JavaScript type Object that contains the x-coordinate and y-coordinate of the upper-left corner, the width, and the height of the element in pixels. + */ + getBounds(element: Sys.UI.DomElement): Object; + /** + * @param id + * The ID of the element to find. + * @param element + * (optional) The parent element to search in. The default is the document element. + */ + getElementById(id: string): Sys.UI.DomElement; + getElementById(id: string, element?: Sys.UI.DomElement): Sys.UI.DomElement; + getElementById(id: string, element?: HTMLElement): HTMLElement; + getElementById(id: string, element: any): any; + /** + * Gets the absolute position of a DOM element relative to the upper-left corner of the owner frame or window. This member is static and can be invoked without creating an instance of the class. * + * @param element + * The target element. * + * @return + * An object of the JavaScript type Object that contains the x-coordinate and y-coordinate of the element in pixels. + */ + getLocation(element: Sys.UI.DomElement): Sys.UI.Point; + getLocation(element: any): Object; + /* + * Returns a value that represents the layout characteristics of a DOM element when it is hidden by invoking the Sys.UI.DomElement.setVisible method. This member is static and can be invoked without creating an instance of the class. + * @param element + * The target DOM element. + * @return + * A Sys.UI.VisibilityMode enumeration value that indicates the layout characteristics of element when it is hidden by invoking the setVisible method. + */ + getVisibilityMode(element: Sys.UI.DomElement): Sys.UI.VisibilityMode; + getVisibilityMode(element: any): Sys.UI.VisibilityMode; + /** + * Gets a value that indicates whether a DOM element is currently visible on the Web page. This member is static and can be invoked without creating an instance of the class. + * @param element + * The target DOM element. + * @return + * true if element is visible on the Web page; otherwise, false + */ + getVisible(element: any): boolean; + /** + * Determines whether the specified object is a DOM element. + * @param obj + * An object + * @return + * true if the object is a DOM element; otherwise, false. + */ + isDomElement(obj: any): boolean; + /** + * Raises a bubble event. A bubble event causes an event to be raised and then propagated up the control hierarchy until it is handled. + * @param source + * The DOM element that triggers the event. + * @param args + * The event arguments + */ + raiseBubbleEvent(source: Sys.UI.DomElement, args: EventArgs): void; + raiseBubbleEvent(source: any, args: any): void; + /** + * Removes a CSS class from a DOM element. This member is static and can be invoked without creating an instance of the class. If the element does not include a CSS class, no change is made to the element. + * @param element + * The Sys.UI.DomElement object to remove the CSS class from. + * @param className + * The name of the CSS class to remove. + */ + removeCssClass(element: Sys.UI.DomElement, className: string): void; + removeCssClass(element: HTMLElement, className: string): void; + removeCssClass(element: any, className: string): void; + /** + * Returns the element that has either the specified ID in the specified container, or is the specified element itself. + * The resolveElement method is used to verify that an ID or an object can be resolved as an element. * + * @param elementOrElementId + * The element to resolve, or the ID of the element to resolve. This parameter can be null. + * @param containerElement + * (Optional) The specified container. + * @return + * A DOM element. + */ + resolveElement(elementOrElementId: Sys.UI.DomElement, containerElement?: Sys.UI.DomElement): Sys.UI.DomElement; + resolveElement(elementOrElementId: HTMLElement, containerElement?: HTMLElement): HTMLElement; + resolveElement(elementOrElementId: string): any; + /** + * Sets the position of a DOM element. This member is static and can be invoked without creating an instance of the class. + * he left and top style attributes (upper-left corner) of an element specify the relative position of an element. + * The actual position will depend on the offsetParent property of the target element and the positioning mode of the element. * + * @param element The target element. + * @param x The x-coordinate in pixels. + * @param y The y-coordinate in pixels. + */ + setLocation(element: Sys.UI.DomElement, x: number, y: number): void; + setLocation(element: HTMLElement, x: number, y: number): void; + setLocation(element: any, x: number, y: number): void; + /** + * Sets the layout characteristics of a DOM element when it is hidden by invoking the Sys.UI.DomElement.setVisible method. + * This member is static and can be invoked without creating an instance of the class. + * + * Use the setVisibilityMode method to set the layout characteristics of a DOM element when it is hidden by invoking the Sys.UI.DomElement.setVisible method. + * For example, if value is set to Sys.UI.VisibilityMode.collapse, the element uses no space on the page when the setVisible method is called to hide the element. + * + * @param element + * The target DOM element. + * @param value + * A Sys.UI.VisibilityMode enumeration value. + */ + setVisibilityMode(element: Sys.UI.DomElement, value: Sys.UI.VisibilityMode): void; + /** + * Sets a DOM element to be visible or hidden. This member is static and can be invoked without creating an instance of the class. + * + * Use the setVisible method to set a DOM element as visible or hidden on the Web page. + * If you invoke this method with value set to false for an element whose visibility mode is set to "hide," the element will not be visible. + * However, it will occupy space on the page. If the element's visibility mode is set to "collapse," the element will occupy no space in the page. + * For more information about how to set the layout characteristics of hidden DOM elements, see Sys.UI.DomElement setVisibilityMode Method. + * + * @param element + * The target DOM element. + * @param value + * true to make element visible on the Web page; false to hide element. + */ + setVisible(element: Sys.UI.DomElement, value: boolean): void; + setVisible(element: HTMLElement, value: boolean): void; + setVisible(element: any, value: boolean): void; + /** + * Toggles a CSS class in a DOM element. This member is static and can be invoked without creating an instance of the class. + * Use the toggleCssClass method to hide a CSS class of an element if it is shown, or to show a CSS class of an element if it is hidden. + * + * @param element + * The Sys.UI.DomElement object to toggle. + * @param className + * The name of the CSS class to toggle. + */ + toggleCssClass(element: Sys.UI.DomElement, className: string): void; + toggleCssClass(element: HTMLElement, className: string): void; + toggleCssClass(element: any, className: string): void; + + //#endregion + } + + var DomElement: Sys.UI.DomElement; + /** * Provides cross-browser access to DOM event properties and helper APIs that are used to attach handlers to DOM element events. * @see {@link http://msdn.microsoft.com/en-us/library/bb310935(v=vs.100).aspx} @@ -3244,49 +3421,60 @@ declare module Sys { */ charCode: number; /** - * + * Gets the x-coordinate of the mouse pointer's position relative to the client area of the browser window, excluding window scroll bars. + * @return An integer that represents the x-coordinate in pixels. */ - clientX: any; // todo + clientX: number; /** - * + * Gets the y-coordinate of the mouse pointer's position relative to the client area of the browser window, excluding window scroll bars. + * @return An integer that represents the y-coordinate in pixels. */ - clientY: any; // todo + clientY: number; /** - * + * Gets a Boolean value that indicates the state of the CTRL key when the associated event occurred. + * @return true if the CTRL key was pressed when the event occurred; otherwise, false. */ - ctrlKey: any; // todo + ctrlKey: boolean; /** - * + * Gets the key code of the key that raised the keyUp or keyDown event. + * @return An integer value that represents the key code of the key that was pressed to raise the keyUp or keyDown event. */ - keyCode: any; // todo + keyCode: number; /** - * + * Gets the x-coordinate of the mouse pointer's position relative to the object that raised the event. + * @return An integer that represents the x-coordinate in pixels. */ - offsetX: any; // todo + offsetX: number; /** - * + * Gets the y-coordinate of the mouse pointer's position relative to the object that raised the event. + * @return An integer that represents the y-coordinate in pixels. */ - offsetY: any; // todo + offsetY: number; /** - * + * Gets the x-coordinate of the mouse pointer's position relative to the user's screen. + * @return An integer that represents the x-coordinate in pixels. */ - screenX: any; // todo + screenX: number; /** - * + * Gets the y-coordinate of the mouse pointer's position relative to the user's screen. + * @return An integer that represents the y-coordinate in pixels. */ - screenY: any; // todo + screenY: number; /** - * + * Gets a Boolean value that indicates the state of the SHIFT key when the associated event occurred. + * @return true if the SHIFT key was pressed when the event occurred; otherwise, false. */ - shiftKey: any; // todo + shiftKey: boolean; /** - * + * Gets the object that the event acted on. + * @return An object that represents the target that the event acted on. */ - target: any; // todo + target: any; /** - * + * Gets the name of the event that was raised. + * @return A string that represents the name of the event that was raised. */ - type: any; // todo + type: string; //#endregion } @@ -3359,16 +3547,52 @@ declare module Sys { // todo } /** - * Creates an object that contains a set of integer coordinates that represent a position. + * Creates an object that contains a set of integer coordinates that represent a position. The getLocation method of the Sys.UI.DomElement class returns a Point object. + * @see {@link http://msdn.microsoft.com/en-us/library/bb383992(v=vs.100).aspx} * */ class Point { - // todo + + //#region Constructors + + /** + * Creates an object that contains a set of integer coordinates that represent a position. + * @param x The number of pixels between the location and the left edge of the parent frame. + * @param y The number of pixels between the location and the top edge of the parent frame. + */ + constructor(x: number, y: number); + + //#endregion + + //#region Fields + + /** + * Gets the x-coordinate of a Sys.UI.Point object in pixels. This property is read-only. + * @return A number that represents the x-coordinate of the Point object in pixels. + */ + x: number; + + /** + * Gets the y-coordinate of a Sys.UI.Point object in pixels. This property is read-only. + * @return A number that represents the y-coordinate of the Point object in pixels. + */ + y: number; + + //#endregion + } /** * Describes the layout of a DOM element in the page when the element's visible property is set to false. + * @see {@link http://msdn.microsoft.com/en-us/library/bb397498(v=vs.100).aspx} */ enum VisibilityMode { - // todo + /** + * The element is not visible, but it occupies space on the page. + */ + hide, + /** + * The element is not visible, and the space it occupies is collapsed. + */ + collapse } } @@ -3622,7 +3846,7 @@ declare module Sys { * Manages client partial-page updates of server UpdatePanel controls. In addition, defines properties, events, and methods that can be used to customize a Web page with client script. * @see {@link http://msdn.microsoft.com/en-us/library/bb311028(v=vs.100).aspx} */ - class PageRequestManager extends EventArgs { + class PageRequestManager { //#region Constructors @@ -3640,7 +3864,7 @@ declare module Sys { * @param beginRequestHandler * The name of the handler method that will be called. */ - add_beginRequest(beginRequestHandler: (sender: any, args: any) => void): void; + add_beginRequest(beginRequestHandler: (sender: any, args: BeginRequestEventArgs) => void): void; /** * Raised before the processing of an asynchronous postback starts and the postback request is sent to the server. * @param beginRequestHandler @@ -3664,37 +3888,37 @@ declare module Sys { * @param initializeRequestHandler * The name of the handler method that will be called. */ - add_initializeRequest(initializeRequestHandler: (sender: any, args: any) => void): void; + add_initializeRequest(initializeRequestHandler: (sender: any, args: InitializeRequestEventArgs) => void): void; /** * Raised during the initialization of the asynchronous postback. * @param initializeRequestHandler * The name of the handler method that will be called. */ - remove_initializeRequest(initializeRequestHandler: (sender: any, args: any) => void): void; + remove_initializeRequest(initializeRequestHandler: (sender: any, args: InitializeRequestEventArgs) => void): void; /** * Raised after all content on the page is refreshed as a result of either a synchronous or an asynchronous postback. * @param pageLoadedHandler * The name of the handler method that will be called. */ - add_pageLoaded(pageLoadedHandler: (sender: any, args: any) => void): void; + add_pageLoaded(pageLoadedHandler: (sender: any, args: PageLoadedEventArgs) => void): void; /** * Raised after all content on the page is refreshed as a result of either a synchronous or an asynchronous postback. * @param pageLoadedHandler * The name of the handler method that will be called. */ - remove_pageLoaded(pageLoadedHandler: (sender: any, args: any) => void): void; + remove_pageLoaded(pageLoadedHandler: (sender: any, args: PageLoadedEventArgs) => void): void; /** * Raised after the response from the server to an asynchronous postback is received but before any content on the page is updated. * @param pageLoadedHandler * The name of the handler method that will be called. */ - add_pageLoading(pageLoadingHandler: (sender: any, args: any) => void): void; + add_pageLoading(pageLoadingHandler: (sender: any, args: PageLoadingEventArgs) => void): void; /** * Raised after the response from the server to an asynchronous postback is received but before any content on the page is updated. * @param pageLoadedHandler * The name of the handler method that will be called. */ - remove_pageLoading(pageLoadingHandler: (sender: any, args: any) => void): void; + remove_pageLoading(pageLoadingHandler: (sender: any, args: PageLoadingEventArgs) => void): void; //#endregion diff --git a/microsoft-live-connect/microsoft-live-connect.d.ts b/microsoft-live-connect/microsoft-live-connect.d.ts index 04ff3ef79..d012f3195 100644 --- a/microsoft-live-connect/microsoft-live-connect.d.ts +++ b/microsoft-live-connect/microsoft-live-connect.d.ts @@ -1,9 +1,11 @@ -/// -// Type definitions for Microsoft Live Connect v5.0. +// Type definitions for Microsoft Live Connect v5.0 // Project: http://msdn.microsoft.com/en-us/library/live/hh243643.aspx // Definitions by: John Vilk // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// +/// + declare module Microsoft.Live { //#region REST Object Information @@ -632,8 +634,8 @@ declare module Microsoft.Live { /** * A value that specifies whether the event is publicly visible. Valid * values are: - * - publicthe event is visible to anyone who can view the calendar. - * - private"the event is visible only to the event owner. + * - public�the event is visible to anyone who can view the calendar. + * - private"�the event is visible only to the event owner. * @default "public" */ visibility: string; @@ -694,8 +696,8 @@ declare module Microsoft.Live { /** * A value that specifies whether the event is publicly visible. Valid * values are: - * - publicthe event is visible to anyone who can view the calendar. - * - private"the event is visible only to the event owner. + * - public�the event is visible to anyone who can view the calendar. + * - private"�the event is visible only to the event owner. * @default "public" */ visibility?: string; @@ -766,8 +768,8 @@ declare module Microsoft.Live { /** * A value that specifies whether the event is publicly visible. Valid * values are: - * - publicthe event is visible to anyone who can view the calendar. - * - private"the event is visible only to the event owner. + * - public�the event is visible to anyone who can view the calendar. + * - private"�the event is visible only to the event owner. * @default "public" */ visibility: string; @@ -1040,10 +1042,10 @@ declare module Microsoft.Live { source: string; /** * The type of this image of this particular size. Valid values are: - * full (maximum size: 2048 2048 pixels) - * - normal (maximum size 800 800 pixels) - * - album (maximum size 176 176 pixels) - * - small (maximum size 96 96 pixels) + * full (maximum size: 2048 � 2048 pixels) + * - normal (maximum size 800 � 800 pixels) + * - album (maximum size 176 � 176 pixels) + * - small (maximum size 96 � 96 pixels) */ type: string; } diff --git a/mixpanel/mixpanel-tests.ts b/mixpanel/mixpanel-tests.ts new file mode 100644 index 000000000..a9cf296c3 --- /dev/null +++ b/mixpanel/mixpanel-tests.ts @@ -0,0 +1,70 @@ +/// +function mixpanel_base() +{ + mixpanel.init("new token", { your: "config" }, "library_name"); + + mixpanel.push(['register', { a: 'b' }]); + + mixpanel.disable(['my_event']); + + mixpanel.track("Registered", {"Gender": "Male", "Age": 21}); + + mixpanel.track_links("#nav", "Clicked Nav Link"); + + mixpanel.track_forms("#register", "Created Account"); + + mixpanel.register({device: 'android', version: '4.0.1'}); + + mixpanel.register_once({device: 'android', version: '4.0.1'}); + + mixpanel.unregister('device'); + + mixpanel.identify('234234sdfdsf'); + + mixpanel.get_distinct_id(); + + mixpanel.alias('w3erwfsdf', '234234sdfdsf'); + + mixpanel.set_config({test: true}); + + mixpanel.get_config(); + + mixpanel.get_property('device'); +} + +function mixpanel_people() +{ + mixpanel.people.set('gender', 'm'); + mixpanel.people.set({ + 'Company': 'Acme', + 'Plan': 'Premium', + 'Upgrade date': new Date() + }); + + mixpanel.people.set_once('First Login Date', new Date()); + mixpanel.people.set_once({ + 'First Login Date': new Date(), + 'Starting Plan': 'Premium' + }); + + mixpanel.people.increment('page_views', 1); + mixpanel.people.increment('page_views'); + mixpanel.people.increment('credits_left', -1); + mixpanel.people.increment({ + counter1: 1, + counter2: 1 + }); + + mixpanel.people.append('pages_visited', 'homepage'); + mixpanel.people.append({ + list1: 'bob', + list2: 123 + }); + + mixpanel.people.track_charge(50); + mixpanel.people.track_charge(30.50, {'$time': new Date('jan 1 2012')}); + + mixpanel.people.clear_charges(); + + mixpanel.people.delete_user(); +} diff --git a/mixpanel/mixpanel.d.ts b/mixpanel/mixpanel.d.ts new file mode 100644 index 000000000..03596a8aa --- /dev/null +++ b/mixpanel/mixpanel.d.ts @@ -0,0 +1,72 @@ +// Type definitions for Mixpanel +// Project: https://mixpanel.com/ +// https://github.com/mixpanel/mixpanel-js +// Definitions by: Knut Eirik Leira Hjelle +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface Mixpanel +{ + people:Mixpanel.People; + + init(token:string, config:{[index:string]:any}, libraryName:string):Mixpanel; + + push(item:any[]):void; + + disable(events?:string[]):void; + + track(eventName:string, params?:{[index:string]:any}, callback?:() => void):void; + + track_links(querySelector:string, eventName:string, params?:{[index:string]:any}):void; + + track_forms(querySelector:string, eventName:string, params?:{[index:string]:any}):void; + + register(params:{[index:string]:any}, days?:number):void; + + register_once(params:{[index:string]:any}, defaultValue?:string, days?:number):void; + + unregister(propertyName:string):void; + + identify(id:string):void; + + get_distinct_id():string; + + alias(alias:string, currentId?:string):void; + + set_config(config:{[index:string]:any}):void; + + get_config():{[index:string]:any}; + + get_property(propertyName:string):any; +} + +declare module Mixpanel +{ + interface People + { + set(keys:{[index:string]:any}, callback?:() => void):void; + + set(key:string, value:any, callback?:() => void):void; + + set_once(keys:{[index:string]:any}, callback?:() => void):void; + + set_once(key:string, value:any, callback?:() => void):void; + + increment(key:string):void; + + increment(keys:{[index:string]:number}):void; + + increment(key:string, value:number):void; + + append(keys:{[index:string]:any}):void; + + append(key:string, value:any):void; + + track_charge(amount:number, params?:{[index:string]:any}, callback?:() => void):void; + + clear_charges():void; + + delete_user():void; + } +} + +declare var mixpanel:Mixpanel; diff --git a/mocha/mocha.d.ts b/mocha/mocha.d.ts index ce0f15b38..64255a7ba 100644 --- a/mocha/mocha.d.ts +++ b/mocha/mocha.d.ts @@ -1,7 +1,7 @@ // Type definitions for mocha 1.17.1 // Project: http://visionmedia.github.io/mocha/ -// Definitions by: Kazi Manzur Rashid and otiai10 -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions by: Kazi Manzur Rashid , otiai10 +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface Mocha { // Setup mocha with the given setting options. diff --git a/modernizr/modernizr.d.ts b/modernizr/modernizr.d.ts index 686f40e71..5827bbf9e 100644 --- a/modernizr/modernizr.d.ts +++ b/modernizr/modernizr.d.ts @@ -1,6 +1,6 @@ // Type definitions for Modernizr 2.6.2 // Project: http://modernizr.com/ -// Definitions by: Boris Yankov and Theodore Brown +// Definitions by: Boris Yankov , Theodore Brown // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/moment/moment-tests.ts b/moment/moment-tests.ts index 1c8b7c82c..d0dd0bda2 100644 --- a/moment/moment-tests.ts +++ b/moment/moment-tests.ts @@ -78,6 +78,13 @@ m2.add('hours', 24).hours(); var duration = moment.duration({'days': 1}); moment([2012, 0, 31]).add(duration); +moment().add('seconds', 1); +moment().add('seconds', '1'); +moment().add(1, 'seconds'); + +moment().add('1', 'seconds'); +moment().add('seconds', '1'); + moment().subtract('days', 7); moment().seconds(30); diff --git a/moment/moment.d.ts b/moment/moment.d.ts index f997026fd..f14c7d4be 100644 --- a/moment/moment.d.ts +++ b/moment/moment.d.ts @@ -1,9 +1,7 @@ // Type definitions for Moment.js 2.5.0 // Project: https://github.com/timrwood/moment -// Definitions by: Michael Lakerveld -// Definitions by: Aaron King (2.4.0) -// Definitions by: Hiroki Horiuchi (2.5.0) -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions by: Michael Lakerveld , Aaron King , Hiroki Horiuchi +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface MomentInput { years?: number; @@ -62,14 +60,45 @@ interface Moment { fromNow(withoutSuffix?: boolean): string; - startOf(soort: string): Moment; - endOf(soort: string): Moment; + startOf(unitOfTime: string): Moment; + endOf(unitOfTime: string): Moment; - add(input: MomentInput): Moment; - add(soort: string, aantal: number): Moment; + /** + * Mutates the original moment by adding time. + * + * @param unitOfTime the key of what time you want to add (eg "years" / "hours" etc) + * @param amount the amount you want to add + */ + add(unitOfTime: string, amount: number): Moment; + /** + * Mutates the original moment by adding time. + * + * @param amount the amount you want to add + * @param unitOfTime the key of what time you want to add (eg "years" / "hours" etc) + */ + add(amount: number, unitOfTime: string): Moment; + /** + * Mutates the original moment by adding time. + * + * @param unitOfTime the key of what time you want to add (eg "years" / "hours" etc) + * @param amount the amount you want to add + */ + add(unitOfTime: string, amount: string): Moment; + /** + * Mutates the original moment by adding time. + * + * @param objectLiteral an object literal that describes multiple different keys at the same time {days:7,months:1} + */ + add(objectLiteral: MomentInput): Moment; + /** + * Mutates the original moment by adding time. + * + * @param duration a length of time + */ add(duration: Duration): Moment; + subtract(input: MomentInput): Moment; - subtract(soort: string, aantal: number): Moment; + subtract(unitOfTime: string, amount: number): Moment; calendar(): string; clone(): Moment; @@ -125,8 +154,8 @@ interface Moment { from(date: number[]): string; diff(b: Moment): number; - diff(b: Moment, soort: string): number; - diff(b: Moment, soort: string, round: boolean): number; + diff(b: Moment, unitOfTime: string): number; + diff(b: Moment, unitOfTime: string, round: boolean): number; toDate(): Date; toISOString(): string; @@ -293,7 +322,7 @@ interface MomentStatic { ordinal: (num: number) => string; duration(milliseconds: Number): Duration; - duration(num: Number, soort: string): Duration; + duration(num: Number, unitOfTime: string): Duration; duration(input: MomentInput): Duration; duration(object: any): Duration; duration(): Duration; diff --git a/mousetrap/mousetrap.d.ts b/mousetrap/mousetrap.d.ts index d2ae42aa6..dee352b42 100644 --- a/mousetrap/mousetrap.d.ts +++ b/mousetrap/mousetrap.d.ts @@ -1,6 +1,6 @@ // Type definitions for Mousetrap 1.2.2 // Project: http://craig.is/killing/mice -// Definitions by: Dániel Tar https://github.com/qcz +// Definitions by: Dániel Tar // Definitions: https://github.com/borisyankov/DefinitelyTyped interface ExtendedKeyboardEvent extends KeyboardEvent { diff --git a/moviedb/moviedb-tests.ts b/moviedb/moviedb-tests.ts new file mode 100644 index 000000000..4e75b629c --- /dev/null +++ b/moviedb/moviedb-tests.ts @@ -0,0 +1,28 @@ + +/// + +import moviedb = require('moviedb'); + +export class TmbdMovieScanner { + movieDb: MovieDB.IMovieDB; + + constructor() { + this.movieDb = moviedb('YOUR API KEY'); + + // For testing purposes + this.movieDb.searchMovie({ query: "Aliens" }, (err, movies) => { + if (err) { + console.log('Error: ' + err); + return; + } + console.log(movies); + }); + this.movieDb.movieInfo({ id: 666 }, (err, curMovie) => { + if (err) { + console.log('Error: ' + err); + return; + } + console.log(curMovie.overview); + }); + } +} \ No newline at end of file diff --git a/moviedb/moviedb.d.ts b/moviedb/moviedb.d.ts new file mode 100644 index 000000000..c8ed37727 --- /dev/null +++ b/moviedb/moviedb.d.ts @@ -0,0 +1,94 @@ +// Type definitions for MovieDB +// Project: https://github.com/danzajdband/moviedb +// Definitions by: Basarat Ali Syed +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// Ghost module for Types +declare module MovieDB { + export interface IMovieDB { + searchMovie(params: SearchOptions, callback: (err: any, movies: SearchResults) => void): void; + movieInfo(options: InfoOptions, callback: (err: any, curMovie: Movie) => void): void; + + // More methods TBD: + // https://github.com/danzajdband/moviedb#available-methods + } + + export interface SearchOptions { + query: string; + } + + export interface InfoOptions { + id: number; + } + + export interface SearchResults { + page: number; + results: SearchResult[]; + total_Pages: number; + total_results: number; + } + + export interface SearchResult { + adult: boolean; + backdrop_path: string; + id: number; + original_title: string; + release_date: Date; + poster_path: string; + popularity: number; + title: string; + vote_average: number; + vote_count: number; + } + + export interface Movie { + adult: boolean; + backdrop_path: string; + belongs_to_collection: any; + budget: number; + genres: Genre[]; + homepage: string; + id: number; + imdb_id: number; + original_title: string; + overview: string; + popularity: number; + poster_path: string; + production_companies: ProductionCompany[]; + production_countries: ProductionCountry[]; + release_date: Date; + revenue: number; + runtime: number; + spoken_languages: SpokenLanguage[]; + status: string; + tagline: string; + title: string; + vote_average: number; + vote_count: number; + } + + export interface Genre { + id: number; + name: string; + } + + export interface ProductionCompany { + id: number; + name: string; + } + + export interface ProductionCountry { + iso_3166_1: number; + name: string; + } + + export interface SpokenLanguage { + iso_639_1: number; + name: string; + } +} + +declare module 'moviedb' { + function apiKeyAcceptor(key: string): MovieDB.IMovieDB; + export = apiKeyAcceptor; +} \ No newline at end of file diff --git a/ncp/ncp-tests.ts b/ncp/ncp-tests.ts new file mode 100644 index 000000000..f1ce04c21 --- /dev/null +++ b/ncp/ncp-tests.ts @@ -0,0 +1,32 @@ +/// + +import ncp = require('ncp'); +import stream = require('stream'); + +var opts: ncp.Options; +opts = {}; +opts = { + filter: /abc/ +}; +opts = { + transform: (read: NodeJS.ReadableStream, write: NodeJS.WritableStream) => { + + } +}; +opts = { + clobber: false +}; +opts = { + stopOnErr: false +}; +opts = { + errs: new stream.Writable() +}; + +ncp.ncp('foo', 'bar', (err: Error) => { + +}); + +ncp.ncp('foo', 'bar', opts, (err: Error) => { + +}); diff --git a/ncp/ncp.d.ts b/ncp/ncp.d.ts new file mode 100644 index 000000000..206d3a18e --- /dev/null +++ b/ncp/ncp.d.ts @@ -0,0 +1,19 @@ +// Type definitions for ncp v0.5.1 +// Project: https://github.com/AvianFlu/ncp +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'ncp' { + function ncp (source: string, destination: string, callback: (err: Error) => void): void; + function ncp (source: string, destination: string, options: Options, callback: (err: Error) => void): void; + + interface Options { + filter? : RegExp; + transform? : (read: NodeJS.ReadableStream, write: NodeJS.WritableStream) => void; + clobber? : boolean; + stopOnErr? : boolean; + errs? : NodeJS.WritableStream; + } +} diff --git a/ng-grid/ng-grid.d.ts b/ng-grid/ng-grid.d.ts index 7aa8f8716..3bb3b2daa 100644 --- a/ng-grid/ng-grid.d.ts +++ b/ng-grid/ng-grid.d.ts @@ -1,7 +1,7 @@ // Type definitions for ng-grid // Project: http://angular-ui.github.io/ng-grid/ -// Definitions by: Ken Smith and Roland Zwaga and Kent Cooper -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions by: Ken Smith , Roland Zwaga , Kent Cooper +// Definitions: https://github.com/borisyankov/DefinitelyTyped // These are very definitely preliminary. Please feel free to improve. diff --git a/nock/nock-tests.ts b/nock/nock-tests.ts index b3b68dd20..f3c166aa1 100644 --- a/nock/nock-tests.ts +++ b/nock/nock-tests.ts @@ -7,6 +7,7 @@ var str: string; var bool: boolean; var data: string; var num: number; +var obj: {}; var value: any; var regex: RegExp; var options: nock.Options; @@ -29,7 +30,9 @@ inst = inst.intercept(str, str, str, value); inst = inst.reply(num); inst = inst.reply(num, str); + inst = inst.reply(num, str, headers); +inst = inst.reply(num, obj, headers); inst = inst.reply(num, (uri: string, body: string) => { return str; }); diff --git a/nock/nock.d.ts b/nock/nock.d.ts index 9c8aaac2e..40b728d49 100644 --- a/nock/nock.d.ts +++ b/nock/nock.d.ts @@ -23,6 +23,7 @@ declare module "nock" { intercept(path: string, verb: string, body?: string, options?: any): Scope; reply(responseCode: number, body?: string, headers?: Object): Scope; + reply(responseCode: number, body?: Object, headers?: Object): Scope; reply(responseCode: number, callback: (uri: string, body: string) => string, headers?: Object): Scope; replyWithFile(responseCode: number, fileName: string): Scope; diff --git a/node-ffi/node-ffi-buffer.d.ts b/node-ffi/node-ffi-buffer.d.ts new file mode 100644 index 000000000..5203a2d9e --- /dev/null +++ b/node-ffi/node-ffi-buffer.d.ts @@ -0,0 +1,59 @@ +// DefinitelyTyped: partial + +interface Buffer { + /** Shorthand for `ref.address`. */ + address(): number; + /** Shorthand for `ref.deref`. */ + deref(): any; + /** Shorthand for `ref.isNull`. */ + isNull(): boolean; + /** Shorthand for `ref.readCString`. */ + readCString(offset?: number): string; + /** Shorthand for `ref.readInt64BE`. */ + readInt64BE(offset?: number): string; + /** Shorthand for `ref.readInt64LE`. */ + readInt64LE(offset?: number): string; + /** Shorthand for `ref.readObject`. */ + readObject(offset?: number): string; + /** Shorthand for `ref.readPointer`. */ + readPointer(offset?: number): string; + /** Shorthand for `ref.readUInt64BE`. */ + readUInt64BE(offset?: number): string; + /** Shorthand for `ref.readUInt64LE`. */ + readUInt64LE(offset?: number): string; + /** Shorthand for `ref.ref`. */ + ref(): Buffer; + /** Shorthand for `ref.reinterpret`. */ + reinterpret(size: number, offset?: number): Buffer; + /** Shorthand for `ref.reinterpretUntilZeros`. */ + reinterpretUntilZeros(size: number, offset?: number): Buffer; + /** Shorthand for `ref.writeCString`. */ + writeCString(offset: number, string: string, encoding?: string): void; + /** Shorthand for `ref.writeInt64BE`. */ + writeInt64BE(offset: number, input: number): any; + /** Shorthand for `ref.writeInt64BE`. */ + writeInt64BE(offset: number, input: string): any; + /** Shorthand for `ref.writeInt64LE`. */ + writeInt64LE(offset: number, input: number): any; + /** Shorthand for `ref.writeInt64LE`. */ + writeInt64LE(offset: number, input: string): any; + /** Shorthand for `ref.writeObject`. */ + writeObject(offset: number, object: Object): void; + /** Shorthand for `ref.writePointer`. */ + writePointer(offset: number, pointer: Buffer): void; + /** Shorthand for `ref.writeUInt64BE`. */ + writeUInt64BE(offset: number, input: number): any; + /** Shorthand for `ref.writeUInt64BE`. */ + writeUInt64BE(offset: number, input: string): any; + /** Shorthand for `ref.writeUInt64LE`. */ + writeUInt64LE(offset: number, input: number): any; + /** Shorthand for `ref.writeUInt64LE`. */ + writeUInt64LE(offset: number, input: string): any; + + /** + * Generate string for inspecting. + * String includes the hex-encoded memory address of the Buffer instance. + * @override + */ + inspect(): string; +} diff --git a/node-ffi/node-ffi-tests.ts b/node-ffi/node-ffi-tests.ts index 383470503..ff9698bfd 100644 --- a/node-ffi/node-ffi-tests.ts +++ b/node-ffi/node-ffi-tests.ts @@ -1,5 +1,10 @@ /// +/// +/// +/// +/// + import ffi = require('ffi'); import ref = require('ref'); import Struct = require('ref-struct'); diff --git a/node-ffi/node-ffi.d.ts b/node-ffi/node-ffi.d.ts index e5ee74621..49d6069d4 100644 --- a/node-ffi/node-ffi.d.ts +++ b/node-ffi/node-ffi.d.ts @@ -1,9 +1,12 @@ -// Type definitions for node-ffi, ref, ref-array, ref-struct and ref-union +// Type definitions for node-ffi // Project: https://github.com/rbranson/node-ffi // Definitions by: Paul Loyd // Definitions: https://github.com/borisyankov/DefinitelyTyped /// +/// +/// +/// declare module "ffi" { import ref = require('ref'); @@ -190,405 +193,3 @@ declare module "ffi" { uint32: ref.Type; short: ref.Type; }; } - -declare module "ref" { - export interface Type { - /** The size in bytes required to hold this datatype. */ - size: number; - /** The current level of indirection of the buffer. */ - indirection: number; - /** To invoke when `ref.get` is invoked on a buffer of this type. */ - get(buffer: Buffer, offset: number): any; - /** To invoke when `ref.set` is invoked on a buffer of this type. */ - set(buffer: Buffer, offset: number, value: any): void; - /** The name to use during debugging for this datatype. */ - name?: string; - /** The alignment of this datatype when placed inside a struct. */ - alignment?: number; - } - - /** A Buffer that references the C NULL pointer. */ - export var NULL: Buffer; - /** A pointer-sized buffer pointing to NULL. */ - export var NULL_POINTER: Buffer; - /** Get the memory address of buffer. */ - export function address(buffer: Buffer): number; - /** Allocate the memory with the given value written to it. */ - export function alloc(type: Type, value?: any): Buffer; - /** Allocate the memory with the given value written to it. */ - export function alloc(type: string, value?: any): Buffer; - - /** - * Allocate the memory with the given string written to it with the given - * encoding (defaults to utf8). The buffer is 1 byte longer than the - * string itself, and is NULL terminated. - */ - export function allocCString(string: string, encoding?: string): Buffer; - - /** Coerce a type.*/ - export function coerceType(type: Type): Type; - /** Coerce a type. String are looked up from the ref.types object. */ - export function coerceType(type: string): Type; - - /** - * Get value after dereferencing buffer. - * That is, first it checks the indirection count of buffer's type, and - * if it's greater than 1 then it merely returns another Buffer, but with - * one level less indirection. - */ - export function deref(buffer: Buffer): any; - - /** Create clone of the type, with decremented indirection level by 1. */ - export function derefType(type: Type): Type; - /** Create clone of the type, with decremented indirection level by 1. */ - export function derefType(type: string): Type; - /** Represents the native endianness of the processor ("LE" or "BE"). */ - export var endianness: string; - /** Check the indirection level and return a dereferenced when necessary. */ - export function get(buffer: Buffer, offset?: number, type?: Type): any; - /** Check the indirection level and return a dereferenced when necessary. */ - export function get(buffer: Buffer, offset?: number, type?: string): any; - /** Get type of the buffer. Create a default type when none exists. */ - export function getType(buffer: Buffer): Type; - /** Check the NULL. */ - export function isNull(buffer: Buffer): boolean; - /** Read C string until the first NULL. */ - export function readCString(buffer: Buffer, offset?: number): string; - - /** - * Read a big-endian signed 64-bit int. - * If there is losing precision, then return a string, otherwise a number. - * @return {number|string} - */ - export function readInt64BE(buffer: Buffer, offset?: number): any; - - /** - * Read a little-endian signed 64-bit int. - * If there is losing precision, then return a string, otherwise a number. - * @return {number|string} - */ - export function readInt64LE(buffer: Buffer, offset?: number): any; - - /** Read a JS Object that has previously been written. */ - export function readObject(buffer: Buffer, offset?: number): Object; - /** Read data from the pointer. */ - export function readPointer(buffer: Buffer, offset?: number, - length?: number): Buffer; - /** - * Read a big-endian unsigned 64-bit int. - * If there is losing precision, then return a string, otherwise a number. - * @return {number|string} - */ - export function readUInt64BE(buffer: Buffer, offset?: number): any; - - /** - * Read a little-endian unsigned 64-bit int. - * If there is losing precision, then return a string, otherwise a number. - * @return {number|string} - */ - export function readUInt64LE(buffer: Buffer, offset?: number): any; - - /** Create pointer to buffer. */ - export function ref(buffer: Buffer): Buffer; - /** Create clone of the type, with incremented indirection level by 1. */ - export function refType(type: Type): Type; - /** Create clone of the type, with incremented indirection level by 1. */ - export function refType(type: string): Type; - - /** - * Create buffer with the specified size, with the same address as source. - * This function "attaches" source to the returned buffer to prevent it from - * being garbage collected. - */ - export function reinterpret(buffer: Buffer, size: number, - offset?: number): Buffer; - /** - * Scan past the boundary of the buffer's length until it finds size number - * of aligned NULL bytes. - */ - export function reinterpretUntilZeros(buffer: Buffer, size: number, - offset?: number): Buffer; - - /** Write pointer if the indirection is 1, otherwise write value. */ - export function set(buffer: Buffer, offset: number, value: any, type?: Type): void; - /** Write pointer if the indirection is 1, otherwise write value. */ - export function set(buffer: Buffer, offset: number, value: any, type?: string): void; - /** Write the string as a NULL terminated. Default encoding is utf8. */ - export function writeCString(buffer: Buffer, offset: number, - string: string, encoding?: string): void; - /** Write a big-endian signed 64-bit int. */ - export function writeInt64BE(buffer: Buffer, offset: number, input: number): void; - /** Write a big-endian signed 64-bit int. */ - export function writeInt64BE(buffer: Buffer, offset: number, input: string): void; - /** Write a little-endian signed 64-bit int. */ - export function writeInt64LE(buffer: Buffer, offset: number, input: number): void; - /** Write a little-endian signed 64-bit int. */ - export function writeInt64LE(buffer: Buffer, offset: number, input: string): void; - - /** - * Write the JS Object. This function "attaches" object to buffer to prevent - * it from being garbage collected. - */ - export function writeObject(buffer: Buffer, offset: number, object: Object): void; - - /** - * Write the memory address of pointer to buffer at the specified offset. This - * function "attaches" object to buffer to prevent it from being garbage collected. - */ - export function writePointer(buffer: Buffer, offset: number, - pointer: Buffer): void; - - /** Write a little-endian unsigned 64-bit int. */ - export function writeUInt64BE(buffer: Buffer, offset: number, input: number): void; - /** Write a little-endian unsigned 64-bit int. */ - export function writeUInt64BE(buffer: Buffer, offset: number, input: string): void; - - /** - * Attach object to buffer such. - * It prevents object from being garbage collected until buffer does. - */ - export function _attach(buffer: Buffer, object: Object): void; - - /** Same as ref.reinterpret, except that this version does not attach buffer. */ - export function _reinterpret(buffer: Buffer, size: number, - offset?: number): Buffer; - /** Same as ref.reinterpretUntilZeros, except that this version does not attach buffer. */ - export function _reinterpretUntilZeros(buffer: Buffer, size: number, - offset?: number): Buffer; - /** Same as ref.writePointer, except that this version does not attach pointer. */ - export function _writePointer(buffer: Buffer, offset: number, - pointer: Buffer): void; - /** Same as ref.writeObject, except that this version does not attach object. */ - export function _writeObject(buffer: Buffer, offset: number, object: Object): void; - - /** Default types. */ - export var types: { - void: Type; int64: Type; ushort: Type; - int: Type; uint64: Type; float: Type; - uint: Type; long: Type; double: Type; - int8: Type; ulong: Type; Object: Type; - uint8: Type; longlong: Type; CString: Type; - int16: Type; ulonglong: Type; bool: Type; - uint16: Type; char: Type; byte: Type; - int32: Type; uchar: Type; size_t: Type; - uint32: Type; short: Type; - }; -} - -interface Buffer { - /** Shorthand for `ref.address`. */ - address(): number; - /** Shorthand for `ref.deref`. */ - deref(): any; - /** Shorthand for `ref.isNull`. */ - isNull(): boolean; - /** Shorthand for `ref.readCString`. */ - readCString(offset?: number): string; - /** Shorthand for `ref.readInt64BE`. */ - readInt64BE(offset?: number): string; - /** Shorthand for `ref.readInt64LE`. */ - readInt64LE(offset?: number): string; - /** Shorthand for `ref.readObject`. */ - readObject(offset?: number): string; - /** Shorthand for `ref.readPointer`. */ - readPointer(offset?: number): string; - /** Shorthand for `ref.readUInt64BE`. */ - readUInt64BE(offset?: number): string; - /** Shorthand for `ref.readUInt64LE`. */ - readUInt64LE(offset?: number): string; - /** Shorthand for `ref.ref`. */ - ref(): Buffer; - /** Shorthand for `ref.reinterpret`. */ - reinterpret(size: number, offset?: number): Buffer; - /** Shorthand for `ref.reinterpretUntilZeros`. */ - reinterpretUntilZeros(size: number, offset?: number): Buffer; - /** Shorthand for `ref.writeCString`. */ - writeCString(offset: number, string: string, encoding?: string): void; - /** Shorthand for `ref.writeInt64BE`. */ - writeInt64BE(offset: number, input: number): any; - /** Shorthand for `ref.writeInt64BE`. */ - writeInt64BE(offset: number, input: string): any; - /** Shorthand for `ref.writeInt64LE`. */ - writeInt64LE(offset: number, input: number): any; - /** Shorthand for `ref.writeInt64LE`. */ - writeInt64LE(offset: number, input: string): any; - /** Shorthand for `ref.writeObject`. */ - writeObject(offset: number, object: Object): void; - /** Shorthand for `ref.writePointer`. */ - writePointer(offset: number, pointer: Buffer): void; - /** Shorthand for `ref.writeUInt64BE`. */ - writeUInt64BE(offset: number, input: number): any; - /** Shorthand for `ref.writeUInt64BE`. */ - writeUInt64BE(offset: number, input: string): any; - /** Shorthand for `ref.writeUInt64LE`. */ - writeUInt64LE(offset: number, input: number): any; - /** Shorthand for `ref.writeUInt64LE`. */ - writeUInt64LE(offset: number, input: string): any; - - /** - * Generate string for inspecting. - * String includes the hex-encoded memory address of the Buffer instance. - * @override - */ - inspect(): string; -} - -declare module "ref-array" { - import ref = require('ref'); - - interface ArrayType extends ref.Type { - BYTES_PER_ELEMENT: number; - fixedLength: number; - /** The reference to the base type. */ - type: ref.Type; - - /** - * Accepts a Buffer instance that should be an already-populated with data - * for the ArrayType. The "length" of the Array is determined by searching - * through the buffer's contents until an aligned NULL pointer is encountered. - */ - untilZeros(buffer: Buffer): { [i: number]: T; length: number; toArray(): T[]; - toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; - - new (length?: number): { [i: number]: T; length: number; toArray(): T[]; - toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; - new (data: number[], length?: number): { [i: number]: T; length: number; toArray(): T[]; - toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; - new (data: Buffer, length?: number): { [i: number]: T; length: number; toArray(): T[]; - toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; - (length?: number): { [i: number]: T; length: number; toArray(): T[]; - toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; - (data: number[], length?: number): { [i: number]: T; length: number; toArray(): T[]; - toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; - (data: Buffer, length?: number): { [i: number]: T; length: number; toArray(): T[]; - toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; - } - - /** - * The array type meta-constructor. - * The returned constructor's API is highly influenced by the WebGL - * TypedArray API. - */ - var ArrayType: { - new (type: ref.Type, length?: number): ArrayType; - new (type: string, length?: number): ArrayType; - (type: ref.Type, length?: number): ArrayType; - (type: string, length?: number): ArrayType; - }; - - export = ArrayType; -} - -declare module "ref-struct" { - import ref = require('ref'); - - /** - * This is the `constructor` of the Struct type that gets returned. - * - * Invoke it with `new` to create a new Buffer instance backing the struct. - * Pass it an existing Buffer instance to use that as the backing buffer. - * Pass in an Object containing the struct fields to auto-populate the - * struct with the data. - * - * @constructor - */ - interface StructType extends ref.Type { - /** Pass it an existing Buffer instance to use that as the backing buffer. */ - new (arg: Buffer, data?: {}): any; - new (data?: {}): any; - /** Pass it an existing Buffer instance to use that as the backing buffer. */ - (arg: Buffer, data?: {}): any; - (data?: {}): any; - - fields: {[key: string]: {type: ref.Type}}; - - /** - * Adds a new field to the struct instance with the given name and type. - * Note that this function will throw an Error if any instances of the struct - * type have already been created, therefore this function must be called at the - * beginning, before any instances are created. - */ - defineProperty(name: string, type: ref.Type): void; - - /** - * Adds a new field to the struct instance with the given name and type. - * Note that this function will throw an Error if any instances of the struct - * type have already been created, therefore this function must be called at the - * beginning, before any instances are created. - */ - defineProperty(name: string, type: string): void; - - /** - * Custom for struct type instances. - * @override - */ - toString(): string; - } - - /** The struct type meta-constructor. */ - var StructType: { - new (fields?: {}): StructType; - new (fields?: any[]): StructType; - (fields?: {}): StructType; - (fields?: any[]): StructType; - } - - export = StructType; -} - -declare module "ref-union" { - import ref = require('ref'); - - /** - * This is the `constructor` of the Struct type that gets returned. - * - * Invoke it with `new` to create a new Buffer instance backing the union. - * Pass it an existing Buffer instance to use that as the backing buffer. - * Pass in an Object containing the union fields to auto-populate the - * union with the data. - * - * @constructor - */ - interface UnionType extends ref.Type { - /** Pass it an existing Buffer instance to use that as the backing buffer. */ - new (arg: Buffer, data?: {}): any; - new (data?: {}): any; - /** Pass it an existing Buffer instance to use that as the backing buffer. */ - (arg: Buffer, data?: {}): any; - (data?: {}): any; - - fields: {[key: string]: {type: ref.Type}}; - - /** - * Adds a new field to the union instance with the given name and type. - * Note that this function will throw an Error if any instances of the union - * type have already been created, therefore this function must be called at the - * beginning, before any instances are created. - */ - defineProperty(name: string, type: ref.Type): void; - - /** - * Adds a new field to the union instance with the given name and type. - * Note that this function will throw an Error if any instances of the union - * type have already been created, therefore this function must be called at the - * beginning, before any instances are created. - */ - defineProperty(name: string, type: string): void; - - /** - * Custom for union type instances. - * @override - */ - toString(): string; - } - - /** The union type meta-constructor. */ - var UnionType: { - new (fields?: {}): UnionType; - new (fields?: any[]): UnionType; - (fields?: {}): UnionType; - (fields?: any[]): UnionType; - } - - export = UnionType; -} diff --git a/node/node-0.8.8.d.ts b/node/node-0.8.8.d.ts index 7a1abbae3..f236faa89 100644 --- a/node/node-0.8.8.d.ts +++ b/node/node-0.8.8.d.ts @@ -1,5 +1,6 @@ // Type definitions for Node.js v0.8.8 // Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript // Definitions: https://github.com/borisyankov/DefinitelyTyped /************************************************ diff --git a/node/node.d.ts b/node/node.d.ts index 5f169c8c8..4eb3e5eae 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1,5 +1,6 @@ // Type definitions for Node.js v0.10.1 // Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript , DefinitelyTyped // Definitions: https://github.com/borisyankov/DefinitelyTyped /************************************************ @@ -67,7 +68,7 @@ declare var Buffer: { isBuffer(obj: any): boolean; byteLength(string: string, encoding?: string): number; concat(list: Buffer[], totalLength?: number): Buffer; -} +}; /************************************************ * * @@ -868,9 +869,13 @@ declare module "fs" { export function openSync(path: string, flags: string, mode?: number): number; export function openSync(path: string, flags: string, mode?: string): number; export function utimes(path: string, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function utimes(path: string, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; export function utimesSync(path: string, atime: number, mtime: number): void; + export function utimesSync(path: string, atime: Date, mtime: Date): void; export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; export function futimesSync(fd: number, atime: number, mtime: number): void; + export function futimesSync(fd: number, atime: Date, mtime: Date): void; export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; export function fsyncSync(fd: number): void; export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; @@ -1240,14 +1245,14 @@ declare module "assert" { (block: Function, error: Function, message?: string): void; (block: Function, error: RegExp, message?: string): void; (block: Function, error: (err: any) => boolean, message?: string): void; - } + }; export var doesNotThrow: { (block: Function, message?: string): void; (block: Function, error: Function, message?: string): void; (block: Function, error: RegExp, message?: string): void; (block: Function, error: (err: any) => boolean, message?: string): void; - } + }; export function ifError(value: any): void; } diff --git a/nodemailer/nodemailer-tests.ts.tscparams b/nodemailer/nodemailer-tests.ts.tscparams deleted file mode 100644 index e16c76dff..000000000 --- a/nodemailer/nodemailer-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" diff --git a/nodemailer/nodemailer.d.ts b/nodemailer/nodemailer.d.ts index 7d77a58ae..c95aee99f 100644 --- a/nodemailer/nodemailer.d.ts +++ b/nodemailer/nodemailer.d.ts @@ -17,8 +17,8 @@ declare class Transport { options: Object; transportType: string; sendMailWithTransport(emailMessage: MailComposer, callback?: (err: Error) => any): any; - useDKIM(dkim: DKIMOptions); - close(callback?: (err: Error) => any); + useDKIM(dkim: DKIMOptions): void; + close(callback?: (err: Error) => any): any; sendMail(message: MailComposer, callback?: (err: Error) => any): any; send_mail(message:MailComposer, callback?: (err: Error) => any): any; } diff --git a/nodemailer/nodemailer.d.ts.tscparams b/nodemailer/nodemailer.d.ts.tscparams deleted file mode 100644 index e16c76dff..000000000 --- a/nodemailer/nodemailer.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" diff --git a/parsimmon/parsimmon-tests.ts b/parsimmon/parsimmon-tests.ts index 16d1510b5..3f8019891 100644 --- a/parsimmon/parsimmon-tests.ts +++ b/parsimmon/parsimmon-tests.ts @@ -3,6 +3,7 @@ import P = require('parsimmon'); import Parser = P.Parser; import Mark = P.Mark; +import Result = P.Result; // -- -- -- -- -- -- -- -- -- -- -- -- -- @@ -17,6 +18,7 @@ class Bar { // -- -- -- -- -- -- -- -- -- -- -- -- -- var str: string; +var bool: boolean; var num: number; var regex: RegExp; @@ -50,11 +52,25 @@ var fooMarkPar: Parser>; // -- -- -- -- -- -- -- -- -- -- -- -- -- -foo = fooPar.parse(str); +var fooResult: Result; + +bool = fooResult.status; +foo = fooResult.value; +str = fooResult.expected; +num = fooResult.index; + +// -- -- -- -- -- -- -- -- -- -- -- -- -- + +fooResult = fooPar.parse(str); fooPar = fooPar.or(fooPar); anyPar = fooPar.or(barPar); +barPar = fooPar.chain((f) => { + foo = f; + return barPar; +}); + barPar = fooPar.then((f) => { foo = f; return barPar; @@ -82,6 +98,8 @@ fooArrPar = fooPar.atLeast(num); fooMarkPar = fooPar.mark(); +fooPar = fooPar.desc(str); + // -- -- -- -- -- -- -- -- -- -- -- -- -- strPar = P.string(str); @@ -92,6 +110,10 @@ fooPar = P.succeed(foo); fooArrPar = P.seq(fooPar, fooPar); anyArrPar = P.seq(barPar, fooPar, numPar); +fooPar = P.alt(fooPar, fooPar); +anyPar = P.alt(barPar, fooPar, numPar); + + fooPar = P.lazy(() => { return fooPar; }); @@ -112,5 +134,5 @@ strPar = P.optWhitespace; strPar = P.any; strPar = P.all; -strPar = P.eof; -numPar = P.index; \ No newline at end of file +voidPar = P.eof; +numPar = P.index; diff --git a/parsimmon/parsimmon.d.ts b/parsimmon/parsimmon.d.ts index 435ea285a..719e9c937 100644 --- a/parsimmon/parsimmon.d.ts +++ b/parsimmon/parsimmon.d.ts @@ -1,5 +1,5 @@ -// Type definitions for Parsimmon 0.3.0 -// Project: https://github.com/jayferd/parsimmon +// Type definitions for Parsimmon 0.5.0 +// Project: https://github.com/jneen/parsimmon // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -14,16 +14,27 @@ declare module 'parsimmon' { value: T; } + export interface Result { + status: boolean; + value?: T; + expected?: string; + index?: number; + } + export interface Parser { /* parse the string */ - parse(input: string): T; + parse(input: string): Result; /* returns a new parser which tries parser, and if it fails uses otherParser. */ or(otherParser: Parser): Parser; or(otherParser: Parser): Parser; + /* + returns a new parser which tries parser, and on success calls the given function with the result of the parse, which is expected to return another parser, which will be tried next + */ + chain(next: (result: T) => Parser): Parser; /* returns a new parser which tries parser, and on success calls the given function with the result of the parse, which is expected to return another parser. */ @@ -65,9 +76,11 @@ declare module 'parsimmon' { */ atLeast(n: number): Parser; /* - yields an object with start, value, and end keys, where value is the original value yielded by the parser, and start and end are the indices in the stream that contain the parsed text. + returns a new parser whose failure message is the passed description. */ mark(): Parser>; + + desc(description: string): Parser; } /* is a parser that expects to find "my-string", and will yield the same. @@ -87,12 +100,20 @@ declare module 'parsimmon' { /* accepts a variable number of parsers that it expects to find in order, yielding an array of the results. */ + export function seq(...parsers: Parser[]): Parser; export function seq(...parsers: Parser[]): Parser; + /* + accepts a variable number of parsers, and yields the value of the first one that succeeds, backtracking in between. + */ + export function alt(...parsers: Parser[]): Parser; + export function alt(...parsers: Parser[]): Parser; + /* accepts a function that returns a parser, which is evaluated the first time the parser is used. This is useful for referencing parsers that haven't yet been defined. */ export function lazy(f: () => Parser): Parser; + export function lazy(description: string, f: () => Parser): Parser; /* fail paring with a message @@ -135,7 +156,7 @@ declare module 'parsimmon' { /* expects the end of the stream. */ - export var eof: Parser; + export var eof: Parser; /* is a parser that yields the current index of the parse. */ diff --git a/passport-facebook/passport-facebook.d.ts b/passport-facebook/passport-facebook.d.ts index 47c9b68bb..76a3041a9 100644 --- a/passport-facebook/passport-facebook.d.ts +++ b/passport-facebook/passport-facebook.d.ts @@ -1,5 +1,5 @@ // Type definitions for passport-facebook 1.0.3 -// Project: https://github.com/jaredhanson/passport-facebook +// Project: https://github.com/jaredhanson/passport-facebook // Definitions by: James Roland Cabresos // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -24,4 +24,4 @@ declare module 'passport-facebook' { name: string; authenticate:(req: express.Request, options?: Object) => void; } -} \ No newline at end of file +} diff --git a/passport/passport.d.ts b/passport/passport.d.ts index cd86228f6..6ce6089b7 100644 --- a/passport/passport.d.ts +++ b/passport/passport.d.ts @@ -1,7 +1,7 @@ // Type definitions for Passport v0.2.0 // Project: http://passportjs.org // Definitions by: Horiuchi_H -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/phantomjs/phantomjs.d.ts b/phantomjs/phantomjs.d.ts index 58e202ac8..3682024b6 100644 --- a/phantomjs/phantomjs.d.ts +++ b/phantomjs/phantomjs.d.ts @@ -1,6 +1,6 @@ // Type definitions for PhantomJS v1.9.0 API // Project: https://github.com/ariya/phantomjs/wiki/API-Reference -// Definitions by: Jed Hunsaker and Mike Keesey +// Definitions by: Jed Hunsaker , Mike Keesey // Definitions: https://github.com/borisyankov/DefinitelyTyped declare function require(module: string): any; diff --git a/promises-a-plus/promises-a-plus.d.ts b/promises-a-plus/promises-a-plus.d.ts index 7a3bee776..808995dc9 100644 --- a/promises-a-plus/promises-a-plus.d.ts +++ b/promises-a-plus/promises-a-plus.d.ts @@ -1,3 +1,8 @@ +// Type definitions for promises-a-plus +// Project: http://promisesaplus.com/ +// Definitions by: Igor Oleinikov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + declare module PromisesAPlus { interface PromiseCtor { (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): Thenable; diff --git a/pubsubjs/pubsub.d.ts b/pubsubjs/pubsub.d.ts index 40158c79b..e24c901a4 100644 --- a/pubsubjs/pubsub.d.ts +++ b/pubsubjs/pubsub.d.ts @@ -1,4 +1,4 @@ -// Type definitions for PubSubJS 1.3.5 +// Type definitions for PubSubJS 1.3.5 // Project: https://github.com/mroderick/PubSubJS // Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/purl/purl.d.ts b/purl/purl.d.ts index e937a68f4..00312595e 100644 --- a/purl/purl.d.ts +++ b/purl/purl.d.ts @@ -48,3 +48,7 @@ declare function purl(): purl.Url; * @param someUrl the url to be parsed */ declare function purl(someUrl: string): purl.Url; + +declare module "purl" { + export = purl; +} diff --git a/q-io/Q-io.d.ts b/q-io/Q-io.d.ts index 9c3963376..1e16e3c33 100644 --- a/q-io/Q-io.d.ts +++ b/q-io/Q-io.d.ts @@ -1,7 +1,7 @@ // Type definitions for Q-io -// Project:https://github.com/kriskowal/q-io -// Definitions by:Bart van der Schoor -// Definitions:https://github.com/borisyankov/DefinitelyTyped +// Project: https://github.com/kriskowal/q-io +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// /// diff --git a/q/Q-tests.ts b/q/Q-tests.ts index 6b69fb228..48a3224bc 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -26,7 +26,7 @@ Q.delay("asdf", 1000).then(x => x.length); var eventualAdd = Q.promised((a?: number, b?: number) => a + b); eventualAdd(Q(1), Q(2)).then(x => x.toExponential()); -var eventually = function (eventually) { +var eventually = function (eventually: any) { return Q.delay(eventually, 1000); }; @@ -38,7 +38,7 @@ Q.when(x, function (x) { Q.all([ eventually(10), eventually(20) -]).spread(function (x, y) { +]).spread(function (x: any, y: any) { console.log(x, y); }); @@ -97,7 +97,7 @@ Q.when(Q(8), num => num + "!").then(str => str.split(',')); declare function saveToDisk(): Q.Promise; declare function saveToCloud(): Q.Promise; -Q.allSettled([saveToDisk(), saveToCloud()]).spread(function (disk, cloud) { +Q.allSettled([saveToDisk(), saveToCloud()]).spread(function (disk: any, cloud: any) { console.log("saved to disk:", disk.state === "fulfilled"); console.log("saved to cloud:", cloud.state === "fulfilled"); @@ -110,8 +110,31 @@ Q.allSettled([saveToDisk(), saveToCloud()]).spread(function (disk, cloud) { }).done(); var nodeStyle = (input: string, cb: Function) => { - cb(null, input); + cb(null, input); }; Q.nfapply(nodeStyle, ["foo"]).done((result: string) => {}); Q.nfcall(nodeStyle, "foo").done((result: string) => {}); +Q.denodeify(nodeStyle)('foo').done((result: string) => {}); +Q.nfbind(nodeStyle)('foo').done((result: string) => {}); + + +class Repo { + private items: any[] = [ + { name: 'Max', cute: false }, + { name: 'Annie', cute: true } + ]; + + find(options: any): Q.Promise { + var result = this.items; + + for (var key in options) { + result = result.filter(i => i[key] == options[key]); + } + + return Q(result); + } +} + +var kitty = new Repo(); +Q.nbind(kitty.find, kitty)({ cute: true }).done((kitties: any[]) => {}); \ No newline at end of file diff --git a/q/Q-tests.ts.tscparams b/q/Q-tests.ts.tscparams deleted file mode 100644 index e16c76dff..000000000 --- a/q/Q-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" diff --git a/q/Q.d.ts b/q/Q.d.ts index 65b2b8223..8e9696be5 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -1,6 +1,6 @@ // Type definitions for Q // Project: https://github.com/kriskowal/q -// Definitions by: Barrie Nemetchek, Andrew Gaspar, John Reilly +// Definitions by: Barrie Nemetchek , Andrew Gaspar , John Reilly // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -207,6 +207,8 @@ declare module Q { export function invoke(obj: any, functionName: string, ...args: any[]): Promise; export function mcall(obj: any, functionName: string, ...args: any[]): Promise; + export function denodeify(nodeFunction: Function, ...args: any[]): (...args: any[]) => Promise; + export function nbind(nodeFunction: Function, thisArg: any, ...args: any[]): (...args: any[]) => Promise; export function nfbind(nodeFunction: Function, ...args: any[]): (...args: any[]) => Promise; export function nfcall(nodeFunction: Function, ...args: any[]): Promise; export function nfapply(nodeFunction: Function, args: any[]): Promise; diff --git a/qunit/qunit.d.ts b/qunit/qunit.d.ts index 68d0163b6..5628feaa6 100644 --- a/qunit/qunit.d.ts +++ b/qunit/qunit.d.ts @@ -1,7 +1,7 @@ // Type definitions for QUnit 1.10 // Project: http://qunitjs.com/ // Definitions by: Diullei Gomes -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface DoneCallbackObject { @@ -720,4 +720,4 @@ declare function equiv(a: any, b: any): any; declare var raises: any; /* QUNIT */ -declare var QUnit: QUnitStatic; \ No newline at end of file +declare var QUnit: QUnitStatic; diff --git a/raphael/raphael.d.ts b/raphael/raphael.d.ts index fc0b26292..e57aa3954 100644 --- a/raphael/raphael.d.ts +++ b/raphael/raphael.d.ts @@ -1,7 +1,7 @@ // Type definitions for Raphael 2.1 // Project: http://raphaeljs.com -// Definitions by: https://github.com/CheCoxshall -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions by: CheCoxshall +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface BoundingBox { diff --git a/ref-array/ref-array.d.ts b/ref-array/ref-array.d.ts new file mode 100644 index 000000000..4066e0d65 --- /dev/null +++ b/ref-array/ref-array.d.ts @@ -0,0 +1,53 @@ +// Type definitions for ref-array +// Project: https://github.com/TooTallNate/ref-array +// Definitions by: Paul Loyd +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "ref-array" { + import ref = require('ref'); + + interface ArrayType extends ref.Type { + BYTES_PER_ELEMENT: number; + fixedLength: number; + /** The reference to the base type. */ + type: ref.Type; + + /** + * Accepts a Buffer instance that should be an already-populated with data + * for the ArrayType. The "length" of the Array is determined by searching + * through the buffer's contents until an aligned NULL pointer is encountered. + */ + untilZeros(buffer: Buffer): { [i: number]: T; length: number; toArray(): T[]; + toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; + + new (length?: number): { [i: number]: T; length: number; toArray(): T[]; + toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; + new (data: number[], length?: number): { [i: number]: T; length: number; toArray(): T[]; + toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; + new (data: Buffer, length?: number): { [i: number]: T; length: number; toArray(): T[]; + toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; + (length?: number): { [i: number]: T; length: number; toArray(): T[]; + toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; + (data: number[], length?: number): { [i: number]: T; length: number; toArray(): T[]; + toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; + (data: Buffer, length?: number): { [i: number]: T; length: number; toArray(): T[]; + toJSON(): T[]; inspect(): string; buffer: Buffer; ref(): Buffer; }; + } + + /** + * The array type meta-constructor. + * The returned constructor's API is highly influenced by the WebGL + * TypedArray API. + */ + var ArrayType: { + new (type: ref.Type, length?: number): ArrayType; + new (type: string, length?: number): ArrayType; + (type: ref.Type, length?: number): ArrayType; + (type: string, length?: number): ArrayType; + }; + +export = ArrayType; +} diff --git a/ref-struct/ref-struct.d.ts b/ref-struct/ref-struct.d.ts new file mode 100644 index 000000000..7c2019655 --- /dev/null +++ b/ref-struct/ref-struct.d.ts @@ -0,0 +1,64 @@ +// Type definitions for ref-union +// Project: https://github.com/TooTallNate/ref-struct +// Definitions by: Paul Loyd +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "ref-struct" { + import ref = require('ref'); + + /** + * This is the `constructor` of the Struct type that gets returned. + * + * Invoke it with `new` to create a new Buffer instance backing the struct. + * Pass it an existing Buffer instance to use that as the backing buffer. + * Pass in an Object containing the struct fields to auto-populate the + * struct with the data. + * + * @constructor + */ + interface StructType extends ref.Type { + /** Pass it an existing Buffer instance to use that as the backing buffer. */ + new (arg: Buffer, data?: {}): any; + new (data?: {}): any; + /** Pass it an existing Buffer instance to use that as the backing buffer. */ + (arg: Buffer, data?: {}): any; + (data?: {}): any; + + fields: {[key: string]: {type: ref.Type}}; + + /** + * Adds a new field to the struct instance with the given name and type. + * Note that this function will throw an Error if any instances of the struct + * type have already been created, therefore this function must be called at the + * beginning, before any instances are created. + */ + defineProperty(name: string, type: ref.Type): void; + + /** + * Adds a new field to the struct instance with the given name and type. + * Note that this function will throw an Error if any instances of the struct + * type have already been created, therefore this function must be called at the + * beginning, before any instances are created. + */ + defineProperty(name: string, type: string): void; + + /** + * Custom for struct type instances. + * @override + */ + toString(): string; + } + + /** The struct type meta-constructor. */ + var StructType: { + new (fields?: {}): StructType; + new (fields?: any[]): StructType; + (fields?: {}): StructType; + (fields?: any[]): StructType; + } + +export = StructType; +} diff --git a/ref-union/ref-union.d.ts b/ref-union/ref-union.d.ts new file mode 100644 index 000000000..23dbdae39 --- /dev/null +++ b/ref-union/ref-union.d.ts @@ -0,0 +1,64 @@ +// Type definitions for ref-union +// Project: https://github.com/TooTallNate/ref-union +// Definitions by: Paul Loyd +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "ref-union" { + import ref = require('ref'); + + /** + * This is the `constructor` of the Struct type that gets returned. + * + * Invoke it with `new` to create a new Buffer instance backing the union. + * Pass it an existing Buffer instance to use that as the backing buffer. + * Pass in an Object containing the union fields to auto-populate the + * union with the data. + * + * @constructor + */ + interface UnionType extends ref.Type { + /** Pass it an existing Buffer instance to use that as the backing buffer. */ + new (arg: Buffer, data?: {}): any; + new (data?: {}): any; + /** Pass it an existing Buffer instance to use that as the backing buffer. */ + (arg: Buffer, data?: {}): any; + (data?: {}): any; + + fields: {[key: string]: {type: ref.Type}}; + + /** + * Adds a new field to the union instance with the given name and type. + * Note that this function will throw an Error if any instances of the union + * type have already been created, therefore this function must be called at the + * beginning, before any instances are created. + */ + defineProperty(name: string, type: ref.Type): void; + + /** + * Adds a new field to the union instance with the given name and type. + * Note that this function will throw an Error if any instances of the union + * type have already been created, therefore this function must be called at the + * beginning, before any instances are created. + */ + defineProperty(name: string, type: string): void; + + /** + * Custom for union type instances. + * @override + */ + toString(): string; + } + + /** The union type meta-constructor. */ + var UnionType: { + new (fields?: {}): UnionType; + new (fields?: any[]): UnionType; + (fields?: {}): UnionType; + (fields?: any[]): UnionType; + } + +export = UnionType; +} diff --git a/ref/ref.d.ts b/ref/ref.d.ts new file mode 100644 index 000000000..86e7840be --- /dev/null +++ b/ref/ref.d.ts @@ -0,0 +1,190 @@ +// Type definitions for ref-union +// Project: https://github.com/TooTallNate/ref +// Definitions by: Paul Loyd +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "ref" { + export interface Type { + /** The size in bytes required to hold this datatype. */ + size: number; + /** The current level of indirection of the buffer. */ + indirection: number; + /** To invoke when `ref.get` is invoked on a buffer of this type. */ + get(buffer: Buffer, offset: number): any; + /** To invoke when `ref.set` is invoked on a buffer of this type. */ + set(buffer: Buffer, offset: number, value: any): void; + /** The name to use during debugging for this datatype. */ + name?: string; + /** The alignment of this datatype when placed inside a struct. */ + alignment?: number; + } + + /** A Buffer that references the C NULL pointer. */ + export var NULL: Buffer; + /** A pointer-sized buffer pointing to NULL. */ + export var NULL_POINTER: Buffer; + /** Get the memory address of buffer. */ + export function address(buffer: Buffer): number; + /** Allocate the memory with the given value written to it. */ + export function alloc(type: Type, value?: any): Buffer; + /** Allocate the memory with the given value written to it. */ + export function alloc(type: string, value?: any): Buffer; + + /** + * Allocate the memory with the given string written to it with the given + * encoding (defaults to utf8). The buffer is 1 byte longer than the + * string itself, and is NULL terminated. + */ + export function allocCString(string: string, encoding?: string): Buffer; + + /** Coerce a type.*/ + export function coerceType(type: Type): Type; + /** Coerce a type. String are looked up from the ref.types object. */ + export function coerceType(type: string): Type; + + /** + * Get value after dereferencing buffer. + * That is, first it checks the indirection count of buffer's type, and + * if it's greater than 1 then it merely returns another Buffer, but with + * one level less indirection. + */ + export function deref(buffer: Buffer): any; + + /** Create clone of the type, with decremented indirection level by 1. */ + export function derefType(type: Type): Type; + /** Create clone of the type, with decremented indirection level by 1. */ + export function derefType(type: string): Type; + /** Represents the native endianness of the processor ("LE" or "BE"). */ + export var endianness: string; + /** Check the indirection level and return a dereferenced when necessary. */ + export function get(buffer: Buffer, offset?: number, type?: Type): any; + /** Check the indirection level and return a dereferenced when necessary. */ + export function get(buffer: Buffer, offset?: number, type?: string): any; + /** Get type of the buffer. Create a default type when none exists. */ + export function getType(buffer: Buffer): Type; + /** Check the NULL. */ + export function isNull(buffer: Buffer): boolean; + /** Read C string until the first NULL. */ + export function readCString(buffer: Buffer, offset?: number): string; + + /** + * Read a big-endian signed 64-bit int. + * If there is losing precision, then return a string, otherwise a number. + * @return {number|string} + */ + export function readInt64BE(buffer: Buffer, offset?: number): any; + + /** + * Read a little-endian signed 64-bit int. + * If there is losing precision, then return a string, otherwise a number. + * @return {number|string} + */ + export function readInt64LE(buffer: Buffer, offset?: number): any; + + /** Read a JS Object that has previously been written. */ + export function readObject(buffer: Buffer, offset?: number): Object; + /** Read data from the pointer. */ + export function readPointer(buffer: Buffer, offset?: number, + length?: number): Buffer; + /** + * Read a big-endian unsigned 64-bit int. + * If there is losing precision, then return a string, otherwise a number. + * @return {number|string} + */ + export function readUInt64BE(buffer: Buffer, offset?: number): any; + + /** + * Read a little-endian unsigned 64-bit int. + * If there is losing precision, then return a string, otherwise a number. + * @return {number|string} + */ + export function readUInt64LE(buffer: Buffer, offset?: number): any; + + /** Create pointer to buffer. */ + export function ref(buffer: Buffer): Buffer; + /** Create clone of the type, with incremented indirection level by 1. */ + export function refType(type: Type): Type; + /** Create clone of the type, with incremented indirection level by 1. */ + export function refType(type: string): Type; + + /** + * Create buffer with the specified size, with the same address as source. + * This function "attaches" source to the returned buffer to prevent it from + * being garbage collected. + */ + export function reinterpret(buffer: Buffer, size: number, + offset?: number): Buffer; + /** + * Scan past the boundary of the buffer's length until it finds size number + * of aligned NULL bytes. + */ + export function reinterpretUntilZeros(buffer: Buffer, size: number, + offset?: number): Buffer; + + /** Write pointer if the indirection is 1, otherwise write value. */ + export function set(buffer: Buffer, offset: number, value: any, type?: Type): void; + /** Write pointer if the indirection is 1, otherwise write value. */ + export function set(buffer: Buffer, offset: number, value: any, type?: string): void; + /** Write the string as a NULL terminated. Default encoding is utf8. */ + export function writeCString(buffer: Buffer, offset: number, + string: string, encoding?: string): void; + /** Write a big-endian signed 64-bit int. */ + export function writeInt64BE(buffer: Buffer, offset: number, input: number): void; + /** Write a big-endian signed 64-bit int. */ + export function writeInt64BE(buffer: Buffer, offset: number, input: string): void; + /** Write a little-endian signed 64-bit int. */ + export function writeInt64LE(buffer: Buffer, offset: number, input: number): void; + /** Write a little-endian signed 64-bit int. */ + export function writeInt64LE(buffer: Buffer, offset: number, input: string): void; + + /** + * Write the JS Object. This function "attaches" object to buffer to prevent + * it from being garbage collected. + */ + export function writeObject(buffer: Buffer, offset: number, object: Object): void; + + /** + * Write the memory address of pointer to buffer at the specified offset. This + * function "attaches" object to buffer to prevent it from being garbage collected. + */ + export function writePointer(buffer: Buffer, offset: number, + pointer: Buffer): void; + + /** Write a little-endian unsigned 64-bit int. */ + export function writeUInt64BE(buffer: Buffer, offset: number, input: number): void; + /** Write a little-endian unsigned 64-bit int. */ + export function writeUInt64BE(buffer: Buffer, offset: number, input: string): void; + + /** + * Attach object to buffer such. + * It prevents object from being garbage collected until buffer does. + */ + export function _attach(buffer: Buffer, object: Object): void; + + /** Same as ref.reinterpret, except that this version does not attach buffer. */ + export function _reinterpret(buffer: Buffer, size: number, + offset?: number): Buffer; + /** Same as ref.reinterpretUntilZeros, except that this version does not attach buffer. */ + export function _reinterpretUntilZeros(buffer: Buffer, size: number, + offset?: number): Buffer; + /** Same as ref.writePointer, except that this version does not attach pointer. */ + export function _writePointer(buffer: Buffer, offset: number, + pointer: Buffer): void; + /** Same as ref.writeObject, except that this version does not attach object. */ + export function _writeObject(buffer: Buffer, offset: number, object: Object): void; + + /** Default types. */ + export var types: { + void: Type; int64: Type; ushort: Type; + int: Type; uint64: Type; float: Type; + uint: Type; long: Type; double: Type; + int8: Type; ulong: Type; Object: Type; + uint8: Type; longlong: Type; CString: Type; + int16: Type; ulonglong: Type; bool: Type; + uint16: Type; char: Type; byte: Type; + int32: Type; uchar: Type; size_t: Type; + uint32: Type; short: Type; + }; +} diff --git a/requirejs/require.d.ts b/requirejs/require.d.ts index 6b2cc125f..8623de8d6 100644 --- a/requirejs/require.d.ts +++ b/requirejs/require.d.ts @@ -262,6 +262,18 @@ interface Require { **/ toUrl(module: string): string; + /** + * Returns true if the module has already been loaded and defined. + * @param module Module to check + **/ + defined(module: string): boolean; + + /** + * Returns true if the module has already been requested or is in the process of loading and should be available at some point. + * @param module Module to check + **/ + specified(module: string): boolean; + /** * On Error override * @param err diff --git a/reveal/reveal-tests.ts.tscparams b/reveal/reveal-tests.ts.tscparams deleted file mode 100644 index e16c76dff..000000000 --- a/reveal/reveal-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" diff --git a/reveal/reveal.d.ts b/reveal/reveal.d.ts index bfe56bf0b..14393d650 100644 --- a/reveal/reveal.d.ts +++ b/reveal/reveal.d.ts @@ -10,7 +10,7 @@ interface RevealStatic { configure:(diff:RevealOptions)=>void; // Navigation - slide(h:number, v:number, f?:number, o?:number); + slide(h:number, v:number, f?:number, o?:number):void; left():void; right():void; up():void; diff --git a/reveal/reveal.d.ts.tscparams b/reveal/reveal.d.ts.tscparams deleted file mode 100644 index e16c76dff..000000000 --- a/reveal/reveal.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ -"" diff --git a/riotjs/riotjs-render.d.ts b/riotjs/riotjs-render.d.ts index fe6cf84dc..b2b044d93 100644 --- a/riotjs/riotjs-render.d.ts +++ b/riotjs/riotjs-render.d.ts @@ -1,4 +1,4 @@ -// Type definitions for riot.js (ext/render.js) +// Type definitions for riot.js // Project: https://github.com/moot/riotjs // Definitions by: vvakame // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rtree/rtree-tests.ts b/rtree/rtree-tests.ts new file mode 100644 index 000000000..67d35a4e6 --- /dev/null +++ b/rtree/rtree-tests.ts @@ -0,0 +1,13 @@ +/// + +var myRTree = RTree(5); +var el = "test"; + +myRTree.insert({x: 0, y: 0, w: 1, h: 1}, el); + +var intersections = myRTree.search({x: 0.5, y: 0.5, w: 1, h: 1}); + +intersections = myRTree.remove({x: 0.5, y: 0.5, w: 1, h: 1}, "notTest!"); + +intersections = myRTree.remove({x: 0.5, y: 0.5, w: 1, h: 1}); + diff --git a/rtree/rtree.d.ts b/rtree/rtree.d.ts new file mode 100644 index 000000000..fa6276c6e --- /dev/null +++ b/rtree/rtree.d.ts @@ -0,0 +1,25 @@ +// Type definitions for rtree 1.4.0 +// Project: https://github.com/leaflet-extras/RTree +// Definitions by: Omede Firouz +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface Rectangle { + x: number; + y: number; + w: number; + h: number; +} + +interface RTreeStatic { + insert(bounds: Rectangle, element: Object): boolean; + remove(area: Rectangle, element?: Object): any[]; + geoJSON(geoJSON: any): void; + bbox(arg1: any, arg2?: any, arg3?: number, arg4?: number): any[]; + search(area: Rectangle, return_node?: boolean, return_array?: any[]): any[]; +} + +interface RTreeFactory { + (max_node_width?: number): RTreeStatic; +} + +declare var RTree: RTreeFactory; diff --git a/rx.js/rx-lite.d.ts b/rx.js/rx-lite.d.ts index 3bbdc2faa..ad30b6e94 100644 --- a/rx.js/rx-lite.d.ts +++ b/rx.js/rx-lite.d.ts @@ -1,4 +1,6 @@ -// This file contains common part of defintions for rx.d.ts and rx.lite.d.ts +// DefinitelyTyped: partial + +// This file contains common part of defintions for rx.d.ts and rx.lite.d.ts // Do not include the file separately. declare module Rx { @@ -227,6 +229,11 @@ declare module Rx { concat(sources: IPromise[]): Observable; concatAll(): T; concatObservable(): T; // alias for concatAll + concatMap(selector: (value: T, index: number) => Observable, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat + concatMap(selector: (value: T, index: number) => IPromise, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat + concatMap(selector: (value: T, index: number) => Observable): Observable; // alias for selectConcat + concatMap(selector: (value: T, index: number) => IPromise): Observable; // alias for selectConcat + concatMap(sequence: Observable): Observable; // alias for selectConcat merge(maxConcurrent: number): T; merge(other: Observable): Observable; merge(other: IPromise): Observable; @@ -293,6 +300,12 @@ declare module Rx { flatMap(other: Observable): Observable; // alias for selectMany flatMap(other: IPromise): Observable; // alias for selectMany + selectConcat(selector: (value: T, index: number) => Observable, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; + selectConcat(selector: (value: T, index: number) => IPromise, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; + selectConcat(selector: (value: T, index: number) => Observable): Observable; + selectConcat(selector: (value: T, index: number) => IPromise): Observable; + selectConcat(sequence: Observable): Observable; + /** * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. @@ -342,9 +355,9 @@ declare module Rx { } interface ObservableStatic { - create(subscribe: (observer: Observer) => void): Observable; - create(subscribe: (observer: Observer) => () => void): Observable; create(subscribe: (observer: Observer) => IDisposable): Observable; + create(subscribe: (observer: Observer) => () => void): Observable; + create(subscribe: (observer: Observer) => void): Observable; createWithDisposable(subscribe: (observer: Observer) => IDisposable): Observable; defer(observableFactory: () => Observable): Observable; defer(observableFactory: () => IPromise): Observable; diff --git a/rx.js/rx.aggregates.d.ts b/rx.js/rx.aggregates.d.ts index eb80475b1..4ab7355ed 100644 --- a/rx.js/rx.aggregates.d.ts +++ b/rx.js/rx.aggregates.d.ts @@ -1,7 +1,6 @@ -// Type definitions for RxJS-Aggregates v2.2.24 +// Type definitions for RxJS-Aggregates v2.2.25 // Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy -// Definitions by: Igor Oleinikov +// Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -56,3 +55,7 @@ declare module Rx { findIndex(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; } } + +declare module "rx.aggregates" { + export = Rx; +} \ No newline at end of file diff --git a/rx.js/rx.all.ts b/rx.js/rx.all.ts index 7180cc292..608605fae 100644 --- a/rx.js/rx.all.ts +++ b/rx.js/rx.all.ts @@ -1,7 +1,6 @@ -// Type definitions for RxJS-All v2.2.24 +// Type definitions for RxJS-All v2.2.25 // Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy -// Definitions by: Igor Oleinikov +// Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -14,4 +13,8 @@ /// /// /// -/// \ No newline at end of file +/// + +declare module "rx.all" { + export = Rx; +} \ No newline at end of file diff --git a/rx.js/rx.async-lite.d.ts b/rx.js/rx.async-lite.d.ts index ce0f96778..be13320c2 100644 --- a/rx.js/rx.async-lite.d.ts +++ b/rx.js/rx.async-lite.d.ts @@ -1,3 +1,5 @@ +// DefinitelyTyped: partial + // This file contains common part of defintions for rx.async.d.ts and rx.lite.d.ts // Do not include the file separately. diff --git a/rx.js/rx.async.d.ts b/rx.js/rx.async.d.ts index f25a64774..14823b948 100644 --- a/rx.js/rx.async.d.ts +++ b/rx.js/rx.async.d.ts @@ -1,7 +1,6 @@ -// Type definitions for RxJS-Async v2.2.24 +// Type definitions for RxJS-Async v2.2.25 // Project: http://rx.codeplex.com/ -// Definitions by: zoetrope -// Definitions by: Igor Oleinikov +// Definitions by: zoetrope , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -38,3 +37,7 @@ declare module Rx { toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; } } + +declare module "rx.async" { + export = Rx; +} \ No newline at end of file diff --git a/rx.js/rx.backpressure-lite.d.ts b/rx.js/rx.backpressure-lite.d.ts index 420a568f3..d1c244195 100644 --- a/rx.js/rx.backpressure-lite.d.ts +++ b/rx.js/rx.backpressure-lite.d.ts @@ -1,4 +1,6 @@ -// This file contains common part of defintions for rx.backpressure.d.ts and rx.lite.d.ts +// DefinitelyTyped: partial + +// This file contains common part of defintions for rx.backpressure.d.ts and rx.lite.d.ts // Do not include the file separately. /// diff --git a/rx.js/rx.backpressure.d.ts b/rx.js/rx.backpressure.d.ts index 0580be7eb..5f5013fe1 100644 --- a/rx.js/rx.backpressure.d.ts +++ b/rx.js/rx.backpressure.d.ts @@ -1,7 +1,11 @@ -// Type definitions for RxJS-BackPressure v2.2.24 +// Type definitions for RxJS-BackPressure v2.2.25 // Project: http://rx.codeplex.com/ // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// /// + +declare module "rx.backpressure" { + export = Rx; +} \ No newline at end of file diff --git a/rx.js/rx.binding-lite.d.ts b/rx.js/rx.binding-lite.d.ts index 1e5d95eaf..e1120e109 100644 --- a/rx.js/rx.binding-lite.d.ts +++ b/rx.js/rx.binding-lite.d.ts @@ -1,3 +1,5 @@ +// DefinitelyTyped: partial + // This file contains common part of defintions for rx.binding.d.ts and rx.lite.d.ts // Do not include the file separately. diff --git a/rx.js/rx.binding.d.ts b/rx.js/rx.binding.d.ts index c74bcf232..cf089e43f 100644 --- a/rx.js/rx.binding.d.ts +++ b/rx.js/rx.binding.d.ts @@ -1,7 +1,6 @@ -// Type definitions for RxJS-Binding v2.2.24 +// Type definitions for RxJS-Binding v2.2.25 // Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy -// Definitions by: Igor Oleinikov +// Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -12,3 +11,7 @@ declare module Rx { replayWhileObserved(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; } } + +declare module "rx.binding" { + export = Rx; +} \ No newline at end of file diff --git a/rx.js/rx.coincidence-lite.d.ts b/rx.js/rx.coincidence-lite.d.ts index 8dee43a0c..801e42168 100644 --- a/rx.js/rx.coincidence-lite.d.ts +++ b/rx.js/rx.coincidence-lite.d.ts @@ -1,3 +1,5 @@ +// DefinitelyTyped: partial + // This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts // Do not include the file separately. diff --git a/rx.js/rx.coincidence.d.ts b/rx.js/rx.coincidence.d.ts index 578586741..af7acd4de 100644 --- a/rx.js/rx.coincidence.d.ts +++ b/rx.js/rx.coincidence.d.ts @@ -1,7 +1,6 @@ -// Type definitions for RxJS-Coincidence v2.2.24 +// Type definitions for RxJS-Coincidence v2.2.25 // Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy -// Definitions by: Igor Oleinikov +// Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -31,3 +30,7 @@ declare module Rx { buffer(bufferOpenings: Observable, bufferClosingSelector: () => Observable): Observable; } } + +declare module "rx.coincidence" { + export = Rx; +} \ No newline at end of file diff --git a/rx.js/rx.d.ts b/rx.js/rx.d.ts index 768adbd99..967b5aefa 100644 --- a/rx.js/rx.d.ts +++ b/rx.js/rx.d.ts @@ -1,7 +1,6 @@ -// Type definitions for RxJS v2.2.24 +// Type definitions for RxJS v2.2.25 // Project: http://rx.codeplex.com/ -// Definitions by: gsino -// Definitions by: Igor Oleinikov +// Definitions by: gsino , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/rx.js/rx.experimental.d.ts b/rx.js/rx.experimental.d.ts index 60d9b9be4..885630be2 100644 --- a/rx.js/rx.experimental.d.ts +++ b/rx.js/rx.experimental.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Experimental v2.2.24 +// Type definitions for RxJS-Experimental v2.2.25 // Project: https://github.com/Reactive-Extensions/RxJS/ // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -315,3 +315,7 @@ declare module Rx { forkJoin(...args: IPromise[]): Observable; } } + +declare module "rx.experimental" { + export = Rx; +} \ No newline at end of file diff --git a/rx.js/rx.joinpatterns.d.ts b/rx.js/rx.joinpatterns.d.ts index 82a7891f8..9d0d7244f 100644 --- a/rx.js/rx.joinpatterns.d.ts +++ b/rx.js/rx.joinpatterns.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Join v2.2.24 +// Type definitions for RxJS-Join v2.2.25 // Project: http://rx.codeplex.com/ // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -54,3 +54,7 @@ declare module Rx { when(plan: Plan): Observable; } } + +declare module "rx.joinpatterns" { + export = Rx; +} \ No newline at end of file diff --git a/rx.js/rx.jquery.d.ts b/rx.js/rx.jquery.d.ts index f2dcb284a..75202142e 100644 --- a/rx.js/rx.jquery.d.ts +++ b/rx.js/rx.jquery.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bridging RxJS with jQuery. +// Type definitions for RxJS-jQuery // Project: https://github.com/Reactive-Extensions/RxJS-jQuery/ // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.lite.d.ts b/rx.js/rx.lite.d.ts index cb91342ea..ddffc4a16 100644 --- a/rx.js/rx.lite.d.ts +++ b/rx.js/rx.lite.d.ts @@ -1,7 +1,6 @@ -// Type definitions for RxJS-Lite v2.2.20 +// Type definitions for RxJS-Lite v2.2.25 // Project: http://rx.codeplex.com/ -// Definitions by: gsino -// Definitions by: Igor Oleinikov +// Definitions by: gsino , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -49,3 +48,7 @@ declare module Rx { shareReplay(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; // same as replayWhileObserved in rx.binding.d.ts } } + +declare module "rx.lite" { + export = Rx; +} \ No newline at end of file diff --git a/rx.js/rx.testing.d.ts b/rx.js/rx.testing.d.ts index 725f61feb..393061625 100644 --- a/rx.js/rx.testing.d.ts +++ b/rx.js/rx.testing.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Testing v2.2.24 +// Type definitions for RxJS-Testing v2.2.25 // Project: https://github.com/Reactive-Extensions/RxJS/ // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -56,3 +56,7 @@ declare module Rx { export var MockObserver: MockObserverStatic; } + +declare module "rx.testing" { + export = Rx; +} \ No newline at end of file diff --git a/rx.js/rx.time-lite.d.ts b/rx.js/rx.time-lite.d.ts index 36a07a825..a5b102827 100644 --- a/rx.js/rx.time-lite.d.ts +++ b/rx.js/rx.time-lite.d.ts @@ -1,3 +1,5 @@ +// DefinitelyTyped: partial + // This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts // Do not include the file separately. diff --git a/rx.js/rx.time.d.ts b/rx.js/rx.time.d.ts index 048429074..ae2408e85 100644 --- a/rx.js/rx.time.d.ts +++ b/rx.js/rx.time.d.ts @@ -1,7 +1,6 @@ -// Type definitions for RxJS-Time v2.2.24 +// Type definitions for RxJS-Time v2.2.25 // Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy -// Definitions by: Igor Oleinikov +// Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -30,3 +29,7 @@ declare module Rx { scheduler?: IScheduler): Observable; } } + +declare module "rx.time" { + export = Rx; +} \ No newline at end of file diff --git a/rx.js/rx.virtualtime.d.ts b/rx.js/rx.virtualtime.d.ts index 328042e36..04de75e94 100644 --- a/rx.js/rx.virtualtime.d.ts +++ b/rx.js/rx.virtualtime.d.ts @@ -1,7 +1,6 @@ -// Type definitions for RxJS-VirtualTime v2.2.24 +// Type definitions for RxJS-VirtualTime v2.2.25 // Project: http://rx.codeplex.com/ -// Definitions by: gsino -// Definitions by: Igor Oleinikov +// Definitions by: gsino , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -34,3 +33,7 @@ declare module Rx { constructor(initialClock: number, comparer: (first: number, second: number) => number); } } + +declare module "rx.virtualtime" { + export = Rx; +} \ No newline at end of file diff --git a/sammyjs/sammyjs.d.ts b/sammyjs/sammyjs.d.ts index 136362fbf..dc41cbf6f 100644 --- a/sammyjs/sammyjs.d.ts +++ b/sammyjs/sammyjs.d.ts @@ -1,7 +1,6 @@ // Type definitions for Sammy.js // Project: http://sammyjs.org/ -// Definitions by: Boris Yankov -// Definitions by: Oisin Grehan +// Definitions by: Boris Yankov , Oisin Grehan // Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/scroller/easyscroller.d.ts b/scroller/easyscroller.d.ts index edc3c55d6..fc0418a57 100644 --- a/scroller/easyscroller.d.ts +++ b/scroller/easyscroller.d.ts @@ -1,6 +1,6 @@ // Type definitions for Zynga EasyScroller // Project: https://github.com/zynga/scroller -// Definitions by: Boris Yankov https://github.com/borisyankov +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -12,4 +12,4 @@ declare class EasyScroller { render(): void; reflow(): void; bindEvents(): void; -} \ No newline at end of file +} diff --git a/scroller/scroller.d.ts b/scroller/scroller.d.ts index 842aa8ee0..09cbbc291 100644 --- a/scroller/scroller.d.ts +++ b/scroller/scroller.d.ts @@ -1,6 +1,6 @@ // Type definitions for Zynga Scroller // Project: https://github.com/zynga/scroller -// Definitions by: Boris Yankov https://github.com/borisyankov +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -47,4 +47,4 @@ declare class Scroller { doTouchStart(touches: any[], timeStamp: number): void; doTouchMove(touches: any[], timeStamp: number, scale?: number): void; doTouchEnd(timeStamp: number): void; -} \ No newline at end of file +} diff --git a/sharepoint/SharePoint.d.ts b/sharepoint/SharePoint.d.ts index b0417fd33..1f7a2feaf 100644 --- a/sharepoint/SharePoint.d.ts +++ b/sharepoint/SharePoint.d.ts @@ -3,8 +3,6 @@ // Definitions by: Stanislav Vyshchepan , Andrey Markeev // Definitions: https://github.com/borisyankov/DefinitelyTyped - - declare module Sys { export class EventArgs { static Empty: Sys.EventArgs; @@ -154,6 +152,7 @@ declare var $get: { (id: string): HTMLElement; }; declare var $addHandler: { (element: HTMLElement, eventName: string, handler: (e: Event) => void): void; }; declare var $removeHandler: { (element: HTMLElement, eventName: string, handler: (e: Event) => void): void; }; + declare module SP { export class SOD { static execute(fileName: string, functionName: string, ...args: any[]): void; @@ -172,9 +171,108 @@ declare module SP { static get_ribbonImagePrefetchEnabled(): boolean; static set_ribbonImagePrefetchEnabled(value: boolean): void; - - } + + export enum ListLevelPermissionMask { + viewListItems,//: 1, + insertListItems,//: 2, + editListItems,//: 4, + deleteListItems,//: 8, + approveItems,//: 16, + openItems,//: 32, + viewVersions,//: 64, + deleteVersions,//: 128, + breakCheckout,//: 256, + managePersonalViews,//: 512, + manageLists//: 2048 + } + + export class HtmlBuilder { + constructor(); + addAttribute(name: string, value: string): void; + addCssClass(cssClassName: string): void; + addCommunitiesCssClass(cssClassName: string): void; + renderBeginTag(tagName: string): void; + renderEndTag(): void; + write(s: string): void; + writeEncoded(s: string): void; + toString(): string; + } + + export class ScriptHelpers { + static disableWebpartSelection(context: SPClientTemplates.RenderContext): void; + static getDocumentQueryPairs(): { [index: string]: string; }; + static getFieldFromSchema(schema: SPClientTemplates.ListSchema, fieldName: string): SPClientTemplates.FieldSchema; + static getLayoutsPageUrl(pageName: string, webServerRelativeUrl: string): string; + static getListLevelPermissionMask(jsonItem: string): number; + static getTextAreaElementValue(textAreaElement: HTMLTextAreaElement): string; + static getUrlQueryPairs(docUrl: string): { [index: string]: string; }; + static getUserFieldProperty(item: ListItem, fieldName: string, propertyName: string): any; + static hasPermission(listPermissionMask: number, listPermission: ListLevelPermissionMask): boolean; + static newGuid(): SP.Guid; + static isNullOrEmptyString(str: string): boolean; + static isNullOrUndefined(obj: any): boolean; + static isNullOrUndefinedOrEmpty(str: string): boolean; + static isUndefined(obj: any): boolean; + static replaceOrAddQueryString(url: string, key: string, value: string): string; + static removeHtml(str: string): string; + static removeStyleChildren(element: HTMLElement); + static removeHtmlAndTrimStringWithEllipsis(str: string, maxLength: number): string; + static setTextAreaElementValue(textAreaElement: HTMLTextAreaElement, newValue: string): void; + static truncateToInt(n: number): number; + static urlCombine(path1: string, path2: string): string; + static resizeImageToSquareLength(imgElement: HTMLImageElement, squareLength: number): void; + } + + + export class PageContextInfo { + static get_siteServerRelativeUrl(): string; + static get_webServerRelativeUrl(): string; + static get_webAbsoluteUrl(): string; + static get_serverRequestPath(): string; + static get_siteAbsoluteUrl(): string; + static get_webTitle(): string; + static get_tenantAppVersion(): string; + static get_webLogoUrl(): string; + static get_webLanguage(): number; + static get_currentLanguage(): number; + static get_pageItemId(): number; + static get_pageListId(): string; + static get_webPermMasks(): { High: number; Low: number; }; + static get_currentCultureName(): string; + static get_currentUICultureName(): string; + static get_clientServerTimeDelta(): number; + static get_userLoginName(): string; + static get_webTemplate(): string; + get_pagePersonalizationScope(): string; + } + + export class ContextPermissions { + has(perm: number): boolean; + hasPermissions(high: number, low: number): boolean; + fromJson(json: { High: number; Low: number; }): void; + } + + export module ListOperation { + export module ViewOperation { + export function getSelectedView(): string; + export function navigateUp(viewId: string): void; + export function refreshView(viewId: string): void; + } + export module Selection { + export function selectListItem(iid: string, bSelect: boolean); + export function getSelectedItems(): { id: number; fsObjType: FileSystemObjectType; }[]; + export function getSelectedList(): string; + export function getSelectedView(): string; + export function navigateUp(viewId: string): void; + export function deselectAllListItems(iid: string); + } + export module Overrides { + export function overrideDeleteConfirmation(listId: string, overrideText:string):void; + } + } + + } /** Register function to rerun on partial update in MDS-enabled site.*/ @@ -229,6 +327,143 @@ declare function AddEvtHandler(element: HTMLElement, event: string, func: EventL /** Gets query string parameter */ declare function GetUrlKeyValue(key: string): string; + +declare class AjaxNavigate { + update(url:string, updateParts:Object, fullNavigate:boolean, anchorName:string):void; + add_navigate(handler: Function): void; + remove_navigate(handler:Function):void; + submit(formToSubmit:HTMLFormElement):void; + getParam(paramName:string):string; + getSavedFormAction():string; + get_href(): string; + get_hash(): string; + get_search():string; + convertMDSURLtoRegularURL(mdsPath:string):string; +} + +declare var ajaxNavigate: AjaxNavigate; + +declare class Browseris { + firefox: boolean; + firefox36up: boolean; + firefox3up: boolean; + firefox4up: boolean; + ie: boolean; + ie55up: boolean; + ie5up: boolean; + ie7down: boolean; + ie8down: boolean; + ie9down: boolean; + ie8standard: boolean; + ie8standardUp: boolean; + ie9standardUp: boolean; + ipad: boolean; + windowsphone: boolean; + chrome: boolean; + chrome7up: boolean; + chrome8up: boolean; + chrome9up: boolean; + iever: boolean; + mac: boolean; + major: boolean; + msTouch: boolean; + isTouch: boolean; + nav: boolean; + nav6: boolean; + nav6up: boolean; + nav7up: boolean; + osver: boolean; + safari: boolean; + safari125up: boolean; + safari3up: boolean; + verIEFull: boolean; + w3c: boolean; + webKit: boolean; + win: boolean; + win8AppHost: boolean; + win32: boolean; + win64bit: boolean; + winnt: boolean; + armProcessor: boolean +} + +declare var browseris: Browseris; + +interface ContextInfo extends SPClientTemplates.RenderContext { + AllowGridMode: boolean; + BasePermissions: any; + BaseViewID: any; + CascadeDeleteWarningMessage: string; + ContentTypesEnabled: boolean; + CurrentSelectedItems: boolean; + CurrentUserId: number; + EnableMinorVersions: boolean; + ExternalDataList: boolean; + HasRelatedCascadeLists: boolean; + HttpPath: string; + HttpRoot: string; + LastSelectableRowIdx: number; + LastSelectedItemIID: number; + LastRowIndexSelected: number; + RowFocusTimerID: number; + ListData: any;// SPClientTemplates.ListData_InView | SPClientTemplates.ListData_InForm + ListSchema: SPClientTemplates.ListSchema; + ModerationStatus: number; + PortalUrl: string; + RecycleBinEnabled: number; + SelectAllCbx: HTMLElement; + SendToLocationName: string; + SendToLocationUrl: string; + StateInitDone: boolean; + TableCbxFocusHandler: Function; + TableMouseoverHandler: Function; + TotalListItems: number; + WorkflowsAssociated: boolean; + clvp: any; + ctxId: number; + ctxType: any; + dictSel: any; + displayFormUrl: string; + editFormUrl: string; + imagesPath: string; + inGridMode: boolean; + inGridFullRender: boolean; + isForceCheckout: boolean; + isModerated: boolean; + isPortalTemplate: boolean; + isVersions: boolean; + isWebEditorPreview: boolean; + leavingGridMode: boolean; + loadingAsyncData: boolean; + listBaseType: number; + listName: string; + listTemplate: string; + listUrlDir: string; + newFormUrl: string; + onRefreshFailed: Function; + overrideDeleteConfirmation: string; + overrideFilterQstring: string; + recursiveView: boolean; + rootFolderForDisplay: string; + serverUrl: string; + verEnabled: boolean; + view: string; + queryString: string; + IsClientRendering: boolean; + wpq: string; + rootFolder: string; + IsAppWeb: boolean; + NewWOPIDocumentEnabled: boolean; + NewWOPIDocumentUrl: string; + AllowCreateFolder: boolean; + CanShareLinkForNewDocument: boolean; + noGroupCollapse: boolean; + SiteTemplateId: number; + ExcludeFromOfflineClient: boolean; + +} + +declare function GetCurrentCtx():ContextInfo; declare module SP { export enum RequestExecutorErrors { requestAbortedOrTimedout, @@ -246,8 +481,8 @@ declare module SP { set_formDigestHandlingEnabled(value: boolean): void; get_iFrameSourceUrl(): string; set_iFrameSourceUrl(value: string): void; - executeAsync(requestInfo: RequestInfo): void; - attemptLogin(returnUrl: string, success: (response: ResponseInfo) => void, error?: (response: ResponseInfo, error: RequestExecutorErrors, statusText: string) => void): void; + executeAsync(requestInfo:RequestInfo): void; + attemptLogin(returnUrl:string, success: (response: ResponseInfo) => void , error?: (response: ResponseInfo, error: RequestExecutorErrors, statusText: string) => void): void; } export interface RequestInfo { @@ -287,12 +522,13 @@ declare module SP { createWebRequestExecutor(): ProxyWebRequestExecutor; } } -interface MQuery { +interface MQuery +{ (selector: string, context?: any): MQueryResultSetElements; (element: HTMLElement): MQueryResultSetElements; (object: MQueryResultSetElements): MQueryResultSetElements; (object: MQueryResultSet): MQueryResultSet; - (object: T): MQueryResultSet; + (object: T): MQueryResultSet; (elementArray: HTMLElement[]): MQueryResultSetElements; (array: T[]): MQueryResultSet; (): MQueryResultSet; @@ -321,7 +557,7 @@ interface MQuery { isObject(obj: any): boolean; isEmptyObject(obj: any): boolean; - ready(callback: () => void): void; + ready(callback: () => void ): void; contains(container: HTMLElement, contained: HTMLElement): boolean; proxy(fn: (...args: any[]) => any, context: any, ...args: any[]): Function; @@ -363,7 +599,7 @@ interface MQuery { hasData(element: HTMLElement): boolean; } -interface MQueryResultSetElements extends MQueryResultSet { +interface MQueryResultSetElements extends MQueryResultSet{ append(node: HTMLElement): MQueryResultSetElements; append(mQuerySet: MQueryResultSetElements): MQueryResultSetElements; append(html: string): MQueryResultSetElements; @@ -471,26 +707,26 @@ interface MQueryResultSetElements extends MQueryResultSet { submit(): MQueryResultSetElements; submit(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements; unload(): MQueryResultSetElements; - unload(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements; + unload(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements; } -interface MQueryResultSet { +interface MQueryResultSet { [index: number]: T; contains(contained: T): boolean; - + filter(fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): MQueryResultSet; - filter(fn: (elementOfArray: T) => boolean, context?: any): MQueryResultSet; + filter(fn: (elementOfArray: T) => boolean, context?: any): MQueryResultSet; every(fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean; every(fn: (elementOfArray: T) => boolean, context?: any): boolean; - + some(fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean; some(fn: (elementOfArray: T) => boolean, context?: any): boolean; - + map(callback: (elementOfArray: T, indexInArray: number) => any): MQueryResultSet; map(callback: (elementOfArray: T) => any): MQueryResultSet; - + forEach(fn: (elementOfArray: T, indexInArray: number) => void, context?: any): void; forEach(fn: (elementOfArray: T) => void, context?: any): void; @@ -579,12 +815,12 @@ declare class CalloutAction { render(): void; isEnabled(): boolean; isVisible(): boolean; - set(options: CalloutActionOptions): void; + set (options: CalloutActionOptions): void; } declare class Callout { /** Sets options for the callout. Not all options can be changed for the callout after its creation. */ - set(options: CalloutOptions); + set (options: CalloutOptions); /** Adds event handler to the callout. @param eventName one of the following: "opened", "opening", "closing", "closed" */ addEventCallback(eventName: string, callback: (callout: Callout) => void); @@ -867,17 +1103,26 @@ declare module SPClientTemplates { PictureOnly: boolean; PictureSize: string; } - /** Represents field schema in Grid mode and on list forms. - Consider casting objects of this type to more specific field types, e.g. FieldSchemaInForm_Lookup */ - export interface FieldSchema_InForm { + + export interface FieldSchema { /** Specifies if the field can be edited while list view is in the Grid mode */ AllowGridEditing: boolean; + /** String representation of the field type, e.g. "Lookup". Same as SPField.TypeAsString */ + FieldType: string; + /** Internal name of the field */ + Name: string; + /** For OOTB fields, returns the type of field. For "UserMulti" returns "User", for "LookupMulti" returns "Lookup". + For custom field types, returns base type of the field. */ + Type: string; + } + +/** Represents field schema in Grid mode and on list forms. + Consider casting objects of this type to more specific field types, e.g. FieldSchemaInForm_Lookup */ + export interface FieldSchema_InForm extends FieldSchema { /** Description for this field. */ Description: string; /** Direction of the reading order for the field. */ Direction: string; - /** String representation of the field type, e.g. "Lookup". Same as SPField.TypeAsString */ - FieldType: string; /** Indicates whether the field is hidden */ Hidden: boolean; /** Guid of the field */ @@ -885,8 +1130,6 @@ declare module SPClientTemplates { /** Specifies Input Method Editor (IME) mode bias to use for the field. The IME enables conversion of keystrokes between languages when one writing system has more characters than can be encoded for the given keyboard. */ IMEMode: any; - /** Internal name of the field */ - Name: string; /** Specifies if the field is read only */ ReadOnlyField: boolean; /** Specifies wherever field requires values */ @@ -894,13 +1137,16 @@ declare module SPClientTemplates { RestrictedMode: boolean; /** Title of the field */ Title: string; - /** For OOTB fields, returns the type of field. For "UserMulti" returns "User", for "LookupMulti" returns "Lookup". - For custom field types, returns base type of the field. */ - Type: string; /** If SPFarm.Local.UseMinWidthForHtmlPicker is true, UseMinWidth will be set to true. Undefined in other cases. */ UseMinWidth: boolean; } - export interface ListSchema_InForm { + + export interface ListSchema { + Field: FieldSchema[]; + } + + + export interface ListSchema_InForm extends ListSchema { Field: FieldSchema_InForm[]; } export interface ListData_InForm { @@ -945,9 +1191,7 @@ declare module SPClientTemplates { DefaultRender: string; } /** Represents field schema in a list view. */ - export interface FieldSchema_InView { - /** Either "TRUE" or "FALSE" */ - AllowGridEditing: string; + export interface FieldSchema_InView extends FieldSchema { /** Either "TRUE" or "FALSE" */ CalloutMenu: string; ClassInfo: string; // e.g. "Menu" @@ -957,8 +1201,6 @@ declare module SPClientTemplates { Explicit: string; fieldRenderer: any; FieldTitle: string; - /** Represents SPField.TypeAsString, e.g. "Computed", "UserMulti", etc. */ - FieldType: string; /** Indicates whether the field can be filtered. Either "TRUE" or "FALSE" */ Filterable: string; /** Set to "TRUE" for fields that comply to the following Xpath query: @@ -971,16 +1213,14 @@ declare module SPClientTemplates { /** Specifies if the field contains list item menu. Corresponds to ViewFields/FieldRef/@ListItemMenu attribute. Either "TRUE" or "FALSE" and might be missing. */ listItemMenu: string; - Name: string; RealFieldName: string; /** Either "TRUE" or "FALSE" */ ReadOnly: string; ResultType: string; /** Indicates whether the field can be sorted. Either "TRUE" or "FALSE" */ Sortable: string; - Type: string; } - export interface ListSchema_InView { + export interface ListSchema_InView extends ListSchema { /** Key-value object that represents all aggregations defined for the view. Key specifies the field internal name, and value specifies the type of the aggregation. */ Aggregate: { [name: string]: string; }; @@ -992,7 +1232,6 @@ declare module SPClientTemplates { /** Either "0" or "1" */ EffectivePresenceEnabled: string; /** If in grid mode (context.inGridMode == true), cast to FieldSchema_InForm[], otherwise cast to FieldSchema_InView[] */ - Field: any[]; FieldSortParam: string; Filter: any; /** Either "0" or "1" */ @@ -1180,26 +1419,26 @@ declare module SPClientTemplates { } export interface RenderContext { - BaseViewID: number; - ControlMode: ClientControlMode; - CurrentCultureName: string; - CurrentLanguage: number; - CurrentSelectedItems: any; - CurrentUICultureName: string; - ListTemplateType: number; - OnPostRender: any; - OnPreRender: any; - onRefreshFailed: any; - RenderBody: (renderContext: RenderContext) => string; - RenderFieldByName: (renderContext: RenderContext, fieldName: string) => string; - RenderFields: (renderContext: RenderContext) => string; - RenderFooter: (renderContext: RenderContext) => string; - RenderGroups: (renderContext: RenderContext) => string; - RenderHeader: (renderContext: RenderContext) => string; - RenderItems: (renderContext: RenderContext) => string; - RenderView: (renderContext: RenderContext) => string; - SiteClientTag: string; - Templates: TemplateOverrides; + BaseViewID?: number; + ControlMode?: ClientControlMode; + CurrentCultureName?: string; + CurrentLanguage?: number; + CurrentSelectedItems?: any; + CurrentUICultureName?: string; + ListTemplateType?: number; + OnPostRender?: any; + OnPreRender?: any; + onRefreshFailed?: any; + RenderBody?: (renderContext: RenderContext) => string; + RenderFieldByName?: (renderContext: RenderContext, fieldName: string) => string; + RenderFields?: (renderContext: RenderContext) => string; + RenderFooter?: (renderContext: RenderContext) => string; + RenderGroups?: (renderContext: RenderContext) => string; + RenderHeader?: (renderContext: RenderContext) => string; + RenderItems?: (renderContext: RenderContext) => string; + RenderView?: (renderContext: RenderContext) => string; + SiteClientTag?: string; + Templates?: Templates; } export interface SingleTemplateCallback { @@ -1214,6 +1453,12 @@ declare module SPClientTemplates { /** Must return null in order to fall back to a more common template or to a system default template */ (renderContext: RenderContext): string; } + + export interface FieldCallback { + /** Must return null in order to fall back to a more common template or to a system default template */ + (renderContext: RenderContext): string; + } + export interface FieldInFormCallback { /** Must return null in order to fall back to a more common template or to a system default template */ (renderContext: RenderContext_FieldInForm): string; @@ -1234,6 +1479,27 @@ declare module SPClientTemplates { View?: FieldInViewCallback; } + export interface FieldTemplates { + [fieldInternalName: string]: FieldCallback; + } + + export interface Templates { + View?: (renderContext: any) => string; // TODO: determine appropriate context type and purpose of this template + Body?: (renderContext: any) => string; // TODO: determine appropriate context type and purpose of this template + /** Defines templates for rendering groups (aggregations). */ + Group?: GroupCallback; + /** Defines templates for list items rendering. */ + Item?: ItemCallback; + /** Defines template for rendering list view header. + Can be either string or SingleTemplateCallback */ + Header?: SingleTemplateCallback; + /** Defines template for rendering list view footer. + Can be either string or SingleTemplateCallback */ + Footer?: SingleTemplateCallback; + /** Defines templates for fields rendering. The field is specified by it's internal name. */ + Fields?: FieldTemplates; + } + export interface FieldTemplateMap { [fieldInternalName: string]: FieldTemplateOverrides; } @@ -1276,6 +1542,7 @@ declare module SPClientTemplates { } export class TemplateManager { static RegisterTemplateOverrides(renderCtx: TemplateOverridesOptions): void; + static GetTemplates(renderCtx: any): Templates; } export interface ClientUserValue { @@ -1349,13 +1616,13 @@ declare module SPClientTemplates { EnableVesioning: boolean; Id: string; }; - registerInitCallback(fieldname: string, callback: () => void): void; - registerFocusCallback(fieldname: string, callback: () => void): void; - registerValidationErrorCallback(fieldname: string, callback: (error: any) => void): void; + registerInitCallback(fieldname: string, callback: () => void ): void; + registerFocusCallback(fieldname: string, callback: () => void ): void; + registerValidationErrorCallback(fieldname: string, callback: (error: any) => void ): void; registerGetValueCallback(fieldname: string, callback: () => any): void; updateControlValue(fieldname: string, value: any): void; registerClientValidator(fieldname: string, validator: SPClientForms.ClientValidation.ValidatorSet): void; - registerHasValueChangedCallback(fieldname: string, callback: (eventArg?: any) => void); + registerHasValueChangedCallback(fieldname: string, callback: (eventArg?: any) => void ); } } @@ -1434,23 +1701,23 @@ declare module SPAnimation { GetDataIndex(attributeId: Attribute): number } - export class Object { - constructor(animationID: ID, delay: number, element: HTMLElement, finalState: State, finishFunc?: (data: any) => void, data?: any); - constructor(animationID: ID, delay: number, element: HTMLElement[], finalState: State, finishFunc?: (data: any) => void, data?: any); + export class Object{ + constructor(animationID: ID, delay: number, element: HTMLElement, finalState: State, finishFunc?: (data: any) => void , data?: any); + constructor(animationID: ID, delay: number, element: HTMLElement[], finalState: State, finishFunc?: (data: any) => void , data?: any); RunAnimation(): void; } } -declare module SPAnimationUtility { +declare module SPAnimationUtility{ export class BasicAnimator { - static FadeIn(element: HTMLElement, finishFunc?: (data: any) => void, data?: any): void; - static FadeOut(element: HTMLElement, finishFunc?: (data: any) => void, data?: any): void; - static Move(element: HTMLElement, posX: number, posY: number, finishFunc?: (data: any) => void, data?: any): void; - static StrikeThrough(element: HTMLElement, strikeThroughWidth: number, finishFunc?: (data: any) => void, data?: any): void; - static Resize(element: HTMLElement, newHeight: number, newWidth: number, finishFunc?: (data: any) => void, data?: any): void; - static CommonResize(element: HTMLElement, newHeight: number, newWidth: number, finishFunc: (data: any) => void, data: any, animationId: SPAnimation.ID): void; - static QuickResize(element: HTMLElement, newHeight: number, newWidth: number, finishFunc?: (data: any) => void, data?: any): void; - static ResizeContainerAndFillContent(element: HTMLElement, newHeight: number, newWidth: number, finishFunc: () => void, fAddToEnd: boolean): void; + static FadeIn(element: HTMLElement, finishFunc?: (data: any) => void , data?: any): void; + static FadeOut (element: HTMLElement, finishFunc?: (data: any) => void , data?: any): void; + static Move(element: HTMLElement, posX:number, posY:number, finishFunc?: (data: any) => void , data?: any): void; + static StrikeThrough(element: HTMLElement, strikeThroughWidth: number, finishFunc?: (data: any) => void , data?: any): void; + static Resize(element: HTMLElement, newHeight: number, newWidth: number, finishFunc?: (data: any) => void , data?: any): void; + static CommonResize(element: HTMLElement, newHeight: number, newWidth: number, finishFunc: (data: any) => void , data: any, animationId:SPAnimation.ID): void; + static QuickResize(element: HTMLElement, newHeight: number, newWidth: number, finishFunc?: (data: any) => void , data?: any): void; + static ResizeContainerAndFillContent(element: HTMLElement, newHeight: number, newWidth: number, finishFunc: () => void , fAddToEnd: boolean): void; static GetWindowScrollPosition(): { x: number; y: number; }; static GetLeftOffset(element: HTMLElement): number; static GetTopOffset(element: HTMLElement): number; @@ -1702,13 +1969,13 @@ declare module SP { get_expectedContentType(): string; set_expectedContentType(value: string): void; post(body: string): void; - get(): void; - static doPost(url: string, body: string, expectedContentType: string, succeededHandler: (sender: any, args: SP.PageRequestSucceededEventArgs) => void, failedHandler: (sender: any, args: SP.PageRequestFailedEventArgs) => void): void; - static doGet(url: string, expectedContentType: string, succeededHandler: (sender: any, args: SP.PageRequestSucceededEventArgs) => void, failedHandler: (sender: any, args: SP.PageRequestFailedEventArgs) => void): void; - add_succeeded(value: (sender: any, args: SP.PageRequestSucceededEventArgs) => void): void; - remove_succeeded(value: (sender: any, args: SP.PageRequestSucceededEventArgs) => void): void; - add_failed(value: (sender: any, args: SP.PageRequestFailedEventArgs) => void): void; - remove_failed(value: (sender: any, args: SP.PageRequestFailedEventArgs) => void): void; + get (): void; + static doPost(url: string, body: string, expectedContentType: string, succeededHandler: (sender: any, args: SP.PageRequestSucceededEventArgs) => void , failedHandler: (sender: any, args: SP.PageRequestFailedEventArgs) => void ): void; + static doGet(url: string, expectedContentType: string, succeededHandler: (sender: any, args: SP.PageRequestSucceededEventArgs) => void , failedHandler: (sender: any, args: SP.PageRequestFailedEventArgs) => void ): void; + add_succeeded(value: (sender: any, args: SP.PageRequestSucceededEventArgs) => void ): void; + remove_succeeded(value: (sender: any, args: SP.PageRequestSucceededEventArgs) => void ): void; + add_failed(value: (sender: any, args: SP.PageRequestFailedEventArgs) => void ): void; + remove_failed(value: (sender: any, args: SP.PageRequestFailedEventArgs) => void ): void; constructor(); } export class ResResources { @@ -1962,10 +2229,10 @@ declare module SP { export class ClientRequest { static get_nextSequenceId(): number; get_webRequest(): Sys.Net.WebRequest; - add_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void): void; - remove_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void): void; - add_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void): void; - remove_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void): void; + add_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void ): void; + remove_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void ): void; + add_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void ): void; + remove_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void ): void; get_navigateWhenServerRedirect(): boolean; set_navigateWhenServerRedirect(value: boolean): void; } @@ -2000,18 +2267,18 @@ declare module SP { set_webRequestExecutorFactory(value: SP.IWebRequestExecutorFactory): void; get_pendingRequest(): SP.ClientRequest; get_hasPendingRequest(): boolean; - add_executingWebRequest(value: (sender: any, args: SP.WebRequestEventArgs) => void): void; - remove_executingWebRequest(value: (sender: any, args: SP.WebRequestEventArgs) => void): void; - add_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void): void; - remove_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void): void; - add_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void): void; - remove_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void): void; - add_beginningRequest(value: (sender: any, args: SP.ClientRequestEventArgs) => void): void; - remove_beginningRequest(value: (sender: any, args: SP.ClientRequestEventArgs) => void): void; + add_executingWebRequest(value: (sender: any, args: SP.WebRequestEventArgs) => void ): void; + remove_executingWebRequest(value: (sender: any, args: SP.WebRequestEventArgs) => void ): void; + add_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void ): void; + remove_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void ): void; + add_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void ): void; + remove_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void ): void; + add_beginningRequest(value: (sender: any, args: SP.ClientRequestEventArgs) => void ): void; + remove_beginningRequest(value: (sender: any, args: SP.ClientRequestEventArgs) => void ): void; get_requestTimeout(): number; set_requestTimeout(value: number): void; - executeQueryAsync(succeededCallback: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void, failedCallback: (sender: any, args: SP.ClientRequestFailedEventArgs) => void): void; - executeQueryAsync(succeededCallback: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void): void; + executeQueryAsync(succeededCallback: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void , failedCallback: (sender: any, args: SP.ClientRequestFailedEventArgs) => void ): void; + executeQueryAsync(succeededCallback: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void ): void; executeQueryAsync(): void; get_staticObjects(): any; castTo(obj: SP.ClientObject, type: any): SP.ClientObject; @@ -2390,7 +2657,7 @@ declare module SP { constructor(); } export class BasePermissions extends SP.ClientValueObject { - set(perm: SP.PermissionKind): void; + set (perm: SP.PermissionKind): void; clear(perm: SP.PermissionKind): void; clearAll(): void; has(perm: SP.PermissionKind): boolean; @@ -3719,7 +3986,7 @@ declare module SP { choiceField, minMaxField, textField, - } + } /** Represents an item or row in a list. */ export class ListItem extends SP.SecurableObject { get_fieldValues(): any; @@ -4153,7 +4420,7 @@ declare module SP { get_value(): string; static newObject(context: SP.ClientRuntimeContext): SP.RequestVariable; append(value: string): void; - set(value: string): void; + set (value: string): void; } export class RoleAssignment extends SP.ClientObject { get_member(): SP.Principal; @@ -4846,8 +5113,8 @@ declare module SP { set_moreColorsPicker(value: SP.Application.UI.MoreColorsPicker): void; } export class ThemeWebPage extends Sys.UI.Control { - add_themeDisplayUpdated(value: (sender: any, e: Sys.EventArgs) => void): void; - remove_themeDisplayUpdated(value: (sender: any, e: Sys.EventArgs) => void): void; + add_themeDisplayUpdated(value: (sender: any, e: Sys.EventArgs) => void ): void; + remove_themeDisplayUpdated(value: (sender: any, e: Sys.EventArgs) => void ): void; constructor(e: HTMLElement); initialize(): void; dispose(): void; @@ -5033,11 +5300,11 @@ declare module Microsoft.SharePoint.Client.Search { getQuerySuggestionsWithResults: (iNumberOfQuerySuggestions: number, - iNumberOfResultSuggestions: number, - fPreQuerySuggestions: boolean, - fHitHighlighting: boolean, - fCapitalizeFirstLetters: boolean, - fPrefixMatchAllTerms: boolean) => QuerySuggestionResults; + iNumberOfResultSuggestions: number, + fPreQuerySuggestions: boolean, + fHitHighlighting: boolean, + fCapitalizeFirstLetters: boolean, + fPrefixMatchAllTerms: boolean) => QuerySuggestionResults; } @@ -5083,15 +5350,15 @@ declare module Microsoft.SharePoint.Client.Search { executeQuery: (query: Query) => SP.JsonObjectResult; executeQueries: (queryIds: string[], queries: Query[], handleExceptions: boolean) => SP.JsonObjectResult; recordPageClick: ( - pageInfo: string, - clickType: string, - blockType: number, - clickedResultId: string, - subResultIndex: number, - immediacySourceId: string, - immediacyQueryString: string, - immediacyTitle: string, - immediacyUrl: string) => void; + pageInfo: string, + clickType: string, + blockType: number, + clickedResultId: string, + subResultIndex: number, + immediacySourceId: string, + immediacyQueryString: string, + immediacyTitle: string, + immediacyUrl: string) => void; exportPopularQueries: (web: SP.Web, sourceId: SP.Guid) => SP.JsonObjectResult; } @@ -5212,7 +5479,7 @@ declare module Microsoft.SharePoint.Client.Search { itemAt: (index: number) => Sort; get_item: (index: number) => Sort; get_childItemType: () => Object; - add: (property: Sort) => void; + add: (strProperty: string, sortDirection: SortDirection) => void; clear: () => void; } @@ -5397,14 +5664,14 @@ declare module Microsoft.SharePoint.Client.Search { export class DocumentCrawlLog extends SP.ClientObject { constructor(context: SP.ClientContext, site: SP.Site); getCrawledUrls: (getCountOnly: boolean, - maxRows: { High: number; Low: number; }, - queryString: string, - isLike: boolean, - contentSourceID: number, - errorLevel: number, - errorID: number, - startDateTime: Date, - endDateTime: Date) => SP.JsonObjectResult; + maxRows: { High: number; Low: number; }, + queryString: string, + isLike: boolean, + contentSourceID: number, + errorLevel: number, + errorID: number, + startDateTime: Date, + endDateTime: Date) => SP.JsonObjectResult; } export class SearchObjectOwner extends SP.ClientObject { @@ -6062,7 +6329,7 @@ declare module SP { /** Provides access to social feeds. It provides methods to create posts, delete posts, read posts, and perform other operations on posts. */ export class SocialFeedManager extends SP.ClientObject { - constructor(); + constructor(context: SP.ClientRuntimeContext); /** Returns the current user */ get_owner(): SocialActor; /** Specifies the URI of the personal site portal. */ @@ -6138,7 +6405,7 @@ declare module SP { set_newerThan(value: string): string; get_olderThan(): string; set_olderThan(value: string): string; - get_sortOrder(): SocialFeedSortOrder; + get_sortOrder():SocialFeedSortOrder; set_sortOrder(value: SocialFeedSortOrder): SocialFeedSortOrder; } @@ -6547,7 +6814,7 @@ declare module SP { get_isReused(): boolean; get_isRoot(): boolean; get_isSourceTerm(): boolean; - get_labels: LabelCollection; + get_labels(): LabelCollection; get_localCustomProperties(): { [key: string]: string; }; get_mergedTermIds(): SP.Guid[]; get_parent(): Term; @@ -6807,7 +7074,7 @@ declare module SP { get_selectedEntities(): any; set_selectedEntities(value: any): void; get_callback(): (sender: any, e: Sys.EventArgs) => void; - set_callback(value: (sender: any, e: Sys.EventArgs) => void): void; + set_callback(value: (sender: any, e: Sys.EventArgs) => void ): void; get_scopeKey(): string; get_componentType(): SP.UI.ApplicationPages.SelectorType; revertTo(ent: SP.UI.ApplicationPages.ResolveEntity): void; @@ -6825,7 +7092,7 @@ declare module SP { static instance(): SP.UI.ApplicationPages.CalendarSelector; registerSelector(selector: SP.UI.ApplicationPages.ISelectorComponent): void; getSelector(type: SP.UI.ApplicationPages.SelectorType, scopeKey: string): SP.UI.ApplicationPages.ISelectorComponent; - addHandler(scopeKey: string, people: boolean, resource: boolean, handler: (sender: any, selection: SP.UI.ApplicationPages.SelectorSelectionEventArgs) => void): void; + addHandler(scopeKey: string, people: boolean, resource: boolean, handler: (sender: any, selection: SP.UI.ApplicationPages.SelectorSelectionEventArgs) => void ): void; revertTo(scopeKey: string, ent: SP.UI.ApplicationPages.ResolveEntity): void; removeEntity(scopeKey: string, ent: SP.UI.ApplicationPages.ResolveEntity): void; constructor(); @@ -6837,7 +7104,7 @@ declare module SP { get_selectedEntities(): any; set_selectedEntities(value: any): void; get_callback(): (sender: any, e: Sys.EventArgs) => void; - set_callback(value: (sender: any, e: Sys.EventArgs) => void): void; + set_callback(value: (sender: any, e: Sys.EventArgs) => void ): void; revertTo(ent: SP.UI.ApplicationPages.ResolveEntity): void; removeEntity(ent: SP.UI.ApplicationPages.ResolveEntity): void; setEntity(ent: SP.UI.ApplicationPages.ResolveEntity): void; @@ -6952,39 +7219,27 @@ declare module SP { get_textElement(): HTMLElement; constructor(); } - export class Notify { - static addNotification(strHtml: string, bSticky: boolean): string; - static removeNotification(nid: string): void; - constructor(); - } - export enum ContainerID { - Basic, - Status, - } - export enum EventID { - OnShow, - OnHide, - OnDisplayNotification, - OnRemoveNotification, - OnNotificationCountChanged, - } - export class SPNotification { - constructor(containerId: SP.UI.ContainerID, strHtml: string, bSticky: boolean, strTooltip: string, onclickHandler: () => void, extraData: any); - constructor(containerId: SP.UI.ContainerID, strHtml: string, bSticky: boolean, strTooltip: string, onclickHandler: () => void); - constructor(containerId: SP.UI.ContainerID, strHtml: string, bSticky: boolean, strTooltip: string); - constructor(containerId: SP.UI.ContainerID, strHtml: string, bSticky: boolean); - constructor(containerId: SP.UI.ContainerID, strHtml: string); - get_id(): string; - Show(bNoAnimate: boolean): void; - Hide(bNoAnimate: boolean): void; - } - export class SPNotificationContainer { - constructor(id: number, element: any, layer: number, notificationLimit: number); - constructor(id: number, element: any, layer: number); - Clear(): void; - GetCount(): number; - SetEventHandler(eventId: SP.UI.EventID, eventHandler: any): void; + + export module Notify { + export function addNotification(strHtml: string, bSticky: boolean): string; + export function removeNotification(nid: string): void; + export function showLoadingNotification(bSticky: boolean): string; + + + export class Notification { + constructor(containerId: SPNotifications.ContainerID, strHtml: string, bSticky?: boolean, strTooltip?: string, onclickHandler?: () => void, extraData?: SPStatusNotificationData); + get_id(): string; + Show(bNoAnimate: boolean): void; + Hide(bNoAnimate: boolean): void; + } + export class NotificationContainer { + constructor(id: number, element: any, layer: number, notificationLimit?: number); + Clear(): void; + GetCount(): number; + SetEventHandler(eventId: SPNotifications.EventID, eventHandler: any): void; + } } + export class Status { static addStatus(strTitle: string, strHtml: string, atBegining: boolean): string; static appendStatus(sid: string, strTitle: string, strHtml: string): string; @@ -6994,9 +7249,10 @@ declare module SP { static removeAllStatus(hide: boolean): void; constructor(); } - export class Workspace { - static add_resized(handler: () => void): void; - static remove_resized(handler: () => void): void; + + export module Workspace { + export function add_resized(handler: () => void): void; + export function remove_resized(handler: () => void): void; } export class Menu { static create(id: string): SP.UI.Menu; @@ -7139,9 +7395,122 @@ declare module SP { close(dialogResult: SP.UI.DialogResult): void; } + + export class Command { + constructor(name: string, displayName: string); + get_displayName(): string; + set_displayName(value: string): string; + + get_tooltip(): string; + set_tooltip(value: string): string; + + get_isEnabled(): boolean; + set_isEnabled(value: boolean): boolean; + + get_href(): string; + get_name(): string; + get_elementIDPrefix(): string; + set_elementIDPrefix(value: string): string; + + get_linkElement():HTMLAnchorElement; + + get_isDropDownCommand(): boolean; + set_isDropDownCommand(value: boolean): boolean; + + attachEvents(): void; + render(builder: HtmlBuilder): void; + + + /**Should override*/ + onClick(): void; + + } + + + export class CommandBar { + constructor(); + get_commands():Command[]; + get_dropDownThreshold(): number; + set_dropDownThreshold(value: number): number; + get_elementID(): string; + get_overrideClass(): string; + set_overrideClass(value: string): string; + addCommand(action:Command):void; + insertCommand(action: Command, position:number): void; + render(builder: HtmlBuilder): void; + attachEvents(): void; + findCommandByName(name:string):Command; + } + + + export class PagingControl { + constructor(id: string); + render(innerContent:string): string; + postRender():void; + get_innerContent():HTMLSpanElement; + get_innerContentClass():string; + setButtonState(buttonId:number, state:number):void; + getButtonState(buttonId: number): number; + onWindowResized(): void; + + /**Should override*/ + onPrev(): void; + onNext(): void; + + static ButtonIDs: { + prev: number; + next: number; + } + + static ButtonState: { + hidden: number + disabled: number; + enabled: number; + } + } + + export module UIUtility { + export function generateRandomElementId(): string; + export function cancelEvent(evt: Event): void; + export function clearChildNodes(elem: HTMLElement): void; + export function hideElement(elem: HTMLElement): void; + export function showElement(elem: HTMLElement): void; + export function insertBefore(elem: HTMLElement, targetElement: HTMLElement): void; + export function insertAfter(elem: HTMLElement, targetElement: HTMLElement): void; + export function removeNode(elem: HTMLElement): void; + export function calculateOffsetLeft(elem: HTMLElement): number; + export function calculateOffsetTop(elem: HTMLElement): number; + export function createHtmlInputText(text: string): HTMLInputElement; + export function createHtmlInputCheck(isChecked: boolean): HTMLInputElement; + export function setInnerText(elem: HTMLElement, value: string): void; + export function getInnerText(elem: HTMLElement): string; + export function isTextNode(elem: HTMLElement): boolean; + export function isSvgNode(elem: HTMLElement): boolean; + export function isNodeOfType(elem: HTMLElement, tagNames: string[]): boolean; + export function focusValidOnThisNode(elem: HTMLElement): boolean; + } } } +declare module SPNotifications { + + export enum ContainerID { + Basic, + Status, + } + export enum EventID { + OnShow, + OnHide, + OnDisplayNotification, + OnRemoveNotification, + OnNotificationCountChanged, + } +} + +declare class SPStatusNotificationData { + constructor(text: string, subText: string, imageUrl: string, sip: string); +} + declare module SP { export module UI { export module Controls { @@ -7804,8 +8173,20 @@ declare module SP { /** Same as get_url() */ toString(): string; } - } + export class LocUtility { + static getLocalizedCountValue(locText:string, intervals:string, count:number):string; + } + + export class VersionUtility { + static get_layoutsLatestVersionRelativeUrl():string; + static get_layoutsLatestVersionUrl(): string; + static getLayoutsPageUrl(pageName:string): string; + static getImageUrl(imageName:string): string; + } + + } + export module DateTimeUtil { export class SimpleDate { construction(year: number, month: number, day: number, era: number); @@ -8684,12 +9065,338 @@ declare module SP { } } } -declare class SPClientAutoFill { - static MenuOptionType: { + +declare module SP { + export module CompliancePolicy { + export enum SPContainerType { + site,//: 0, + web,//: 1, + list//: 2 + } + + export class SPContainerId extends ClientObject { + constructor(context: ClientRuntimeContext, objectPath: ObjectPath); + static createFromList(context: ClientRuntimeContext, list: List): SPContainerId; + static createFromWeb(context: ClientRuntimeContext, web: Web): SPContainerId; + static createFromSite(context: ClientRuntimeContext, site: Site): SPContainerId; + static create(context: ClientRuntimeContext, containerId): SPContainerId; + + get_containerType(): ContentType; + set_containerType(value: ContentType): ContentType; + + get_listId(): SP.Guid; + set_listId(value: SP.Guid): SP.Guid; + + get_siteId(): SP.Guid; + set_siteId(value: SP.Guid): SP.Guid; + + get_siteUrl(): string; + set_siteUrl(value: string): string; + + get_tenantId(): SP.Guid; + set_tenantId(value: SP.Guid): SP.Guid; + + get_title(): string; + set_title(value: string): string; + + get_version(): any; + set_version(value: any): any; + + get_webId(): SP.Guid; + set_webId(value: SP.Guid): SP.Guid; + + serialize(): SP.StringResult; + } + + export class SPPolicyAssociation extends ClientObject { + constructor(context: ClientRuntimeContext, objectPath: ObjectPath); + + get_allowOverride(): boolean; + set_allowOverride(value: boolean): boolean; + + get_comment(): string; + set_comment(value: string): string; + + get_defaultPolicyDefinitionConfigId(): any[]; + set_defaultPolicyDefinitionConfigId(value: any[]): any[]; + + get_description(): string; + set_description(value: string): string; + + get_identity(): boolean; + set_identity(value: boolean): boolean; + + get_name(): string; + set_name(value: string): string; + + get_policyApplyStatus(): any; + set_policyApplyStatus(value: any): any; + + get_policyDefinitionConfigIds(): any[]; + set_policyDefinitionConfigIds(value: any[]): any[]; + + get_scope(): any; + set_scope(value: any): any; + + get_source(): any; + set_source(value: any): any; + + get_version(): any; + set_version(value: any): any; + + get_whenAppliedUTC(): Date; + set_whenAppliedUTC(value: Date): Date; + + get_whenChangedUTC(): Date; + set_whenChangedUTC(value: Date): Date; + + get_whenCreatedUTC(): Date; + set_whenCreatedUTC(value: Date): Date; + } + + export class SPPolicyBinding extends ClientObject { + constructor(context: ClientRuntimeContext, objectPath: ObjectPath); + + get_identity(): any; + set_identity(value: any): any; + + get_isExempt(): boolean; + set_isExempt(value: boolean): boolean; + + get_mode(): any; + set_mode(value: any): any; + + get_name(): string; + set_name(value: string): string; + + get_policyApplyStatus(): any; + set_policyApplyStatus(value: any): any; + + get_policyAssociationConfigId(): any; + set_policyAssociationConfigId(value: any): any; + + get_policyDefinitionConfigId(): any; + set_policyDefinitionConfigId(value: any): any; + + get_policyRuleConfigId(): any; + set_policyRuleConfigId(value: any): any; + + get_scope(): any; + set_scope(value: any): any; + + get_source(): any; + set_source(value: any): any; + + get_version(): any; + set_version(value: any): any; + + get_whenAppliedUTC(): Date; + set_whenAppliedUTC(value: Date): Date; + + get_whenChangedUTC(): Date; + set_whenChangedUTC(value: Date): Date; + + get_whenCreatedUTC(): Date; + set_whenCreatedUTC(value: Date): Date; + } + + export class SPPolicyDefinition extends ClientObject { + constructor(context: ClientRuntimeContext, objectPath: ObjectPath); + + get_comment(): string; + set_comment(value: string): string; + + get_createdBy(): any; + set_createdBy(value: any): any; + + get_defaultPolicyRuleConfigId + set_defaultPolicyRuleConfigId + + get_description(): string; + set_description(value: string): string; + + get_enabled(): boolean; + set_enabled(value: boolean): boolean; + + get_identity(): any; + set_identity(value: any): any; + + get_lastModifiedBy(): any; + set_lastModifiedBy(value: any): any; + + get_name(): string; + set_name(value: string): string; + + get_mode(): any; + set_mode(value: any): any; + + get_scenario(): any; + set_scenario(value: any): any; + + get_source(): any; + set_source(value: any): any; + + get_version(): any; + set_version(value: any): any; + + get_whenChangedUTC(): Date; + set_whenChangedUTC(value: Date): Date; + + get_whenCreatedUTC(): Date; + set_whenCreatedUTC(value: Date): Date; + + + } + + export class SPPolicyRule extends ClientObject { + constructor(context: ClientRuntimeContext, objectPath: ObjectPath); + + get_comment(): string; + set_comment(value: string): string; + + get_createdBy(): any; + set_createdBy(value: any): any; + + get_description(): string; + set_description(value: string): string; + + get_enabled(): boolean; + set_enabled(value: boolean): boolean; + get_identity(): any; + set_identity(value: any): any; + + get_lastModifiedBy(): any; + set_lastModifiedBy(value: any): any; + + get_mode(): any; + set_mode(value: any): any; + + get_name(): string; + set_name(value: string): string; + + get_policyDefinitionConfigId(): any; + set_policyDefinitionConfigId(value: any): any; + + get_priority(): any; + set_priority(value: any): any; + + get_ruleBlob(): any; + set_ruleBlob(value: any): any; + + get_whenChangedUTC(): Date; + set_whenChangedUTC(value: Date): Date; + + get_whenCreatedUTC(): Date; + set_whenCreatedUTC(value: Date): Date; + } + + export class SPPolicyStore extends ClientObject { + constructor(context: ClientRuntimeContext, web: Web); + + static createPolicyDefinition(context: ClientRuntimeContext): SPPolicyDefinition; + static createPolicyBinding(context: ClientRuntimeContext):SPPolicyBinding; + static createPolicyAssociation(context: ClientRuntimeContext):SPPolicyAssociation; + static createPolicyRule(context: ClientRuntimeContext): SPPolicyRule; + + + updatePolicyRule(policyRule:SPPolicyRule):void; + + getPolicyRule(policyRuleId:any, throwIfNull:boolean):SPPolicyRule; + + deletePolicyRule(policyRuleId: any);void; + + notifyUnifiedPolicySync(notificationId, syncSvcUrl:string, changeInfos, syncNow:boolean, fullSyncForTenant):void; + + updatePolicyDefinition(policyDefinition:SPPolicyDefinition):void; + + getPolicyDefinition(policyDefinitionId):SPPolicyDefinition; + + deletePolicyDefinition(policyDefinitionId):void; + + getPolicyDefinitions(scenario): ClientObjectList; + + updatePolicyBinding(policyBinding:SPPolicyBinding):void; + + getPolicyBinding(policyBindingId): SPPolicyBinding; + + deletePolicyBinding(policyBindingId): void; + + updatePolicyAssociation(policyAssociation: SPPolicyAssociation): void; + + getPolicyAssociation(policyAssociationId): SPPolicyAssociation; + + getPolicyAssociationForContainer(containerId: SPContainerId): SPPolicyAssociation; + + deletePolicyAssociation(policyAssociationId): void; + } + + export class SPPolicyStoreProxy extends ClientObject { + constructor(context: ClientRuntimeContext, web: Web); + + get_policyStoreUrl(): string; + } + + } + + export module Discovery { + + export enum ExportStatus { + notStarted,//: 0, + started,//: 1, + complete,//: 2, + failed//: 3 + } + + export class Case extends ClientObject { + constructor(context: ClientRuntimeContext, web: Web); + getExportContent(sourceIds: number[]): SP.StringResult; + } + export class Export extends ClientObject { + constructor(context: ClientRuntimeContext, item: ListItem); + get_status(): ExportStatus; + set_status(value: ExportStatus): ExportStatus; + update(): void; + getExportContent(): SP.StringResult; + } + } + + export module InformationPolicy { + export class ProjectPolicy extends SP.ClientObject { + constructor(context: ClientRuntimeContext, objectPath: ObjectPath); + get_description(): string; + + get_emailBody(): string; + set_emailBody(value: string): string; + + get_emailBodyWithTeamMailbox(): string; + set_emailBodyWithTeamMailbox(value: string): string; + + get_emailSubject(): string; + set_emailSubject(value: string): string; + + get_name(): string; + savePolicy(): void; + + + static getProjectPolicies(context: ClientRuntimeContext, web: Web): ClientObjectList; + static getCurrentlyAppliedProject(context: ClientRuntimeContext, web: Web): ProjectPolicy; + static applyProjectPolicy(context: ClientRuntimeContext, web: Web, projectPolicy: ProjectPolicy): void; + static openProject(context: ClientRuntimeContext, web: Web): void; + static closeProject(context: ClientRuntimeContext, web: Web): void; + static postponeProject(context: ClientRuntimeContext, web: Web): void; + static doesProjectHavePolicy(context: ClientRuntimeContext, web: Web): SP.BooleanResult; + static isProjectClosed(context: ClientRuntimeContext, web: Web): SP.BooleanResult; + static getProjectCloseDate(context: ClientRuntimeContext, web: Web): SP.DateTimeResult; + static getProjectExpirationDate(context: ClientRuntimeContext, web: Web): SP.DateTimeResult; + } + } +} +declare class SPClientAutoFill{ + static MenuOptionType : { Option: number; Footer: number; Separator: number; - Loading: number; + Loading:number; } static KeyProperty: string; //= 'AutoFillKey'; @@ -8702,7 +9409,7 @@ declare class SPClientAutoFill { static GetAutoFillObjFromContainer(elmChild: HTMLElement): SPClientAutoFill; static GetAutoFillMenuItemFromOption(elmChild: HTMLElement): HTMLElement; - constructor(elmTextId: string, elmContainerId: string, fnPopulateAutoFill: (targetElement: HTMLInputElement) => void); + constructor(elmTextId: string, elmContainerId: string, fnPopulateAutoFill: (targetElement: HTMLInputElement) => void ); public TextElementId: string; public AutoFillContainerId: string; public AutoFillMenuId: string; @@ -8713,16 +9420,16 @@ declare class SPClientAutoFill { public AutoFillCallbackTimeoutID: string; public FuncOnAutoFillClose: (elmTextId: string, ojData: ISPClientAutoFillData) => void; public FuncPopulateAutoFill: (targetElement: HTMLElement) => void; - public AllOptionData: { [key: string]: ISPClientAutoFillData }; + public AllOptionData: { [key:string]: ISPClientAutoFillData }; - PopulateAutoFill(jsonObjSuggestions: ISPClientAutoFillData[], fnOnAutoFillCloseFuncName: (elmTextId: string, objData: ISPClientAutoFillData) => void): void; + PopulateAutoFill(jsonObjSuggestions: ISPClientAutoFillData[], fnOnAutoFillCloseFuncName: (elmTextId: string, objData:ISPClientAutoFillData) => void ): void; IsAutoFillOpen(): boolean; SetAutoFillHeight(): void; - SelectAutoFillOption(elemOption: HTMLElement): void; - FocusAutoFill(): void; + SelectAutoFillOption(elemOption:HTMLElement): void; + FocusAutoFill() :void; BlurAutoFill(): void; CloseAutoFill(ojData: ISPClientAutoFillData): void; - UpdateAutoFillMenuFocus(bMoveNextLink: boolean): void; + UpdateAutoFillMenuFocus(bMoveNextLink:boolean): void; UpdateAutoFillPosition(): void; } @@ -8894,4 +9601,160 @@ declare module Microsoft { } } } +/** Available only in SharePoint Online*/ +declare module Define { + export function loadScript(url: string, successCallback: () => void, errCallback: () => void); + /** Loads script from _layouts/15/[req].js */ + export function require(req: string, callback: Function): void; + /** Loads script from _layouts/15/[req].js */ + export function require(req: string[], callback: Function): void; + export function define(name: string, deps: string[], def: Function): void; +} + +/** Available only in SharePoint Online*/ +declare module Verify { + export function ArgumentType(arg: string, expected: any); +} + + +/** Available only in SharePoint Online*/ +declare module BrowserStorage { + export var local: CachedStorage; + export var session: CachedStorage; + + /** Available only in SharePoint Online*/ + interface CachedStorage { + getItem(key: string): string; + setItem(key: string, value: string); + removeItem(key: string): void; + clead(): void; + length: number; + } +} + +/** Available only in SharePoint Online*/ +declare module BrowserDetection { + export var browseris: Browseris; +} + +/** Available only in SharePoint Online*/ +declare module CSSUtil { + export function HasClass(elem: HTMLElement, className: string): boolean; + export function AddClass(elem: HTMLElement, className: string): void; + export function RemoveClass(elem: HTMLElement, className: string): void; + export function pxToFloat(pxString: string): number; + export function pxToNum(px: string): number; + export function numToPx(n: number): string; + export function getCurrentEltStyleByNames(elem: HTMLElement, styleNames: string[]): string; + export function getCurrentStyle(elem: HTMLElement, cssStyle: string): string; + export function getCurrentStyleCorrect(element: HTMLElement, camelStyleName: string, dashStyleName: string): string; + export function getOpacity(element: HTMLElement): number; + export function setOpacity(element: HTMLElement, value: number): void; +} + +/** Available only in SharePoint Online*/ +declare module DOM { + export var rightToLeft: boolean; + export function cancelDefault(evt: Event): void; + export function AbsLeft(el: HTMLElement): number; + export function AbsTop(el: HTMLElement): number; + export function CancelEvent(evt: Event): void; + export function GetElementsByName(nae: string): NodeList; + export function GetEventCoords(evt: Event): { x: number; y: number; }; + export function GetEventSrcElement(evt: Event): HTMLElement; + export function GetInnerText(el: HTMLElement): string; + export function PreventDefaultNavigation(evt: Event): void; + export function SetEvent(eventName: string, eventFunc: Function, el: HTMLElement); +} + +/** Available only in SharePoint Online*/ +declare module Encoding { + export function EncodeScriptQuote(str: string): string; + export function HtmlEncode(str: string): string; + export function HtmlDecode(str: string): string; + export function AttrQuote(str: string): string; + export function ScriptEncode(str: string): string; + export function ScriptEncodeWithQuote(str: string): string; + export function CanonicalizeUrlEncodingCase(str: string): string; +} + +/** Available only in SharePoint Online*/ +declare module IE8Support { + export function arrayIndexOf(array: T[], item: T, startIdx?: number): number; + export function attachDOMContentLoaded(handler: Function): void; + export function getComputedStyle(domObj: HTMLElement, camelStyleName: string, dashStyleName: string): string; + export function stopPropagation(evt: Event): void; +} + +/** Available only in SharePoint Online*/ +declare module StringUtil { + export function BuildParam(stPattern: string, ...params: any[]); + export function ApplyStringTemplate(str: string, ...params: any[]); +} + +/** Available only in SharePoint Online*/ +declare module TypeUtil { + export function IsArray(value: any): boolean; + export function IsNullOrUndefined(value: any): boolean; +} + +/** Available only in SharePoint Online*/ +declare module Nav { + export var ajaxNavigate: AjaxNavigate; + export function convertRegularURLtoMDSURL(webUrl: string, fullPath: string): string; + export function isMDSUrl(url: string): boolean; + export function isPageUrlValid(url: string): boolean; + export function isPortalTemplatePage(url: string): boolean; + export function getAjaxLocationWindow(): string; + export function getSource(defaultSource?: string): string; + export function getUrlKeyValue(keyName: string, bNoDecode: boolean, url: string, bCaseInsensitive: boolean): string; + export function getWindowLocationNoHash(hre: string): string; + export function goToHistoryLink(el: HTMLAnchorElement, strVersion: string): void; + export function getGoToLinkUrl(el: HTMLAnchorElement): string; + export function goToLink(el: HTMLAnchorElement): void; + export function goToLinkOrDialogNewWindow(el: HTMLAnchorElement): void; + export function goToDiscussion(url: string): void; + export function onClickHook(evt: Event, topElm: HTMLElement): void; + export function pageUrlValidation(url: string, alertString: string): string; + export function parseHash(hash: string): Object; + export function navigate(url: string): void; + export function removeMDSQueryParametersFromUrl(url: string): string; + export function urlFromHashBag(hashObject: Object): string; + export function wantsNewTab(evt: Event): boolean; +} + +/** Available only in SharePoint Online*/ +declare module URI_Encoding { + export function encodeURIComponent(str: string, bAsUrl?: boolean, bForFilterQuery?: boolean, bForCallback?: boolean): string; + export function escapeUrlForCallback(str: string): string; +} + +interface IListItem { + ID: number; + ContentTypeId: string; +} + +/** Available only in SharePoint Online*/ +declare module ListModule { + export module Util { + export function createViewEditUrl(renderCtx: SPClientTemplates.RenderContext, listItem: IListItem, useEditFormUrl?: boolean, appendSource?: boolean): string; + export function createItemPropertiesTitle(renderCtx: SPClientTemplates.RenderContext, listItem: IListItem): string; + export function clearSelectedItemsDict(context: any): void; + export function ctxInitItemState(context: any): void; + export function getAttributeFromItemTable(itemTableParam: HTMLElement, strAttributeName: string, strAttributeOldName: string): string + export function getSelectedItemsDict(context: any): any; + export function removeOnlyPagingArgs(url: string): string; + export function removePagingArgs(url: string): string; + export function showAttachmentRows(): void; + } +} + +/** Available only in SharePoint Online*/ +declare module SPThemeUtils { + export function ApplyCurrentTheme(): void; + export function WithCurrentTheme(resultCallback: Function): void; + export function UseClientSideTheming(): boolean; + export function Suspend(): void; +} + diff --git a/should/should.d.ts b/should/should.d.ts index 13eca9ccf..8b4c21fc1 100644 --- a/should/should.d.ts +++ b/should/should.d.ts @@ -1,6 +1,6 @@ // Type definitions for should.js 3.1.2 // Project: https://github.com/visionmedia/should.js -// Definitions by: Alex Varju and Maxime LUCE (1.3+) +// Definitions by: Alex Varju , Maxime LUCE // Definitions: https://github.com/borisyankov/DefinitelyTyped interface Object { diff --git a/signalr/signalr.d.ts b/signalr/signalr.d.ts index 6519f7051..2c6b0f266 100644 --- a/signalr/signalr.d.ts +++ b/signalr/signalr.d.ts @@ -1,7 +1,6 @@ // Type definitions for SignalR 1.0 // Project: http://www.asp.net/signalr -// Definitions by: Boris Yankov -// Modified by: T. Michael Keesey +// Definitions by: Boris Yankov , T. Michael Keesey // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/sinon-chai/sinon-chai.d.ts b/sinon-chai/sinon-chai.d.ts index fefeb1af6..f8166d4d6 100644 --- a/sinon-chai/sinon-chai.d.ts +++ b/sinon-chai/sinon-chai.d.ts @@ -1,7 +1,7 @@ // Type definitions for sinon-chai 2.4.0 // Project: https://github.com/domenic/sinon-chai // Definitions by: Kazi Manzur Rashid -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// diff --git a/sinon/sinon.d.ts b/sinon/sinon.d.ts index eb62a286e..4b8656661 100644 --- a/sinon/sinon.d.ts +++ b/sinon/sinon.d.ts @@ -1,7 +1,7 @@ // Type definitions for Sinon 1.8.1 // Project: http://sinonjs.org/ // Definitions by: William Sears -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface SinonSpyCallApi { // Properties @@ -101,6 +101,10 @@ interface SinonStub extends SinonSpy { callsArgOnAsync(index: number, context: any): SinonStub; callsArgWithAsync(index: number, ...args: any[]): SinonStub; callsArgOnWithAsync(index: number, context: any, ...args: any[]): SinonStub; + onCall(n: number): SinonStub; + onFirstCall(): SinonStub; + onSecondCall(): SinonStub; + onThirdCall(): SinonStub; yields(...args: any[]): SinonStub; yieldsOn(context: any, ...args: any[]): SinonStub; yieldsTo(property: string, ...args: any[]): SinonStub; diff --git a/slickgrid/SlickGrid.d.ts b/slickgrid/SlickGrid.d.ts index b7810f467..9e66b9647 100644 --- a/slickgrid/SlickGrid.d.ts +++ b/slickgrid/SlickGrid.d.ts @@ -689,8 +689,8 @@ declare module Slick { topPanelHeight?: number; } - export interface DataProvider { - getItem(index: number): SlickData; + export interface DataProvider { + getItem(index: number): T; getLength(): number; } @@ -705,7 +705,7 @@ declare module Slick { * The grid also provides two helper methods to simplify development - getSelectedRows() and setSelectedRows(rowsArray), as well as an onSelectedRowsChanged event. * SlickGrid includes two pre-made selection models - Slick.CellSelectionModel and Slick.RowSelectionModel, but you can easily write a custom one. **/ - export class SelectionModel { + export class SelectionModel { /** * An initializer function that will be called with an instance of the grid whenever a selection model is registered with setSelectionModel. The selection model can use this to initialize its state and subscribe to grid events. **/ @@ -740,12 +740,12 @@ declare module Slick { options: GridOptions); constructor( container: string, - data: DataProvider, + data: DataProvider, columns: Column[], options: GridOptions); constructor( container: HTMLElement, - data: DataProvider, + data: DataProvider, columns: Column[], options: GridOptions); @@ -779,11 +779,18 @@ declare module Slick { /** * Sets a new source for databinding and removes all rendered rows. Note that this doesn't render the new rows - you can follow it with a call to render() to do that. - * @param newData New databinding source. This can either be a regular JavaScript array or a custom object exposing getItem(index) and getLength() functions. + * @param newData New databinding source using a regular JavaScript array.. * @param scrollToTop If true, the grid will reset the vertical scroll position to the top of the grid. **/ public setData(newData: T[], scrollToTop: boolean): void; + /** + * Sets a new source for databinding and removes all rendered rows. Note that this doesn't render the new rows - you can follow it with a call to render() to do that. + * @param newData New databinding source using a custom object exposing getItem(index) and getLength() functions. + * @param scrollToTop If true, the grid will reset the vertical scroll position to the top of the grid. + **/ + public setData(newData: DataProvider, scrollToTop: boolean): void; + /** * Returns the size of the databinding source. * @return @@ -1478,7 +1485,7 @@ declare module Slick { * Item -> Data by index * Row -> Data by row **/ - export class DataView implements DataProvider { + export class DataView implements DataProvider { constructor(options?: DataViewOptions); @@ -1548,7 +1555,7 @@ declare module Slick { public syncGridCellCssStyles(grid: Grid, key: string): void; public getLength(): number; - public getItem(index: number): SlickData; + public getItem(index: number): T; public getItemMetadata(): void; public onRowCountChanged: Slick.Event; diff --git a/slickgrid/slick.headerbuttons.d.ts b/slickgrid/slick.headerbuttons.d.ts index ab160ea83..613203f43 100644 --- a/slickgrid/slick.headerbuttons.d.ts +++ b/slickgrid/slick.headerbuttons.d.ts @@ -8,7 +8,7 @@ declare module Slick { export interface Column { - header: Header; + header?: Header; } export interface Header { diff --git a/smoothie/smoothie.d.ts b/smoothie/smoothie.d.ts index aae781d51..18f0cc0a5 100644 --- a/smoothie/smoothie.d.ts +++ b/smoothie/smoothie.d.ts @@ -1,7 +1,6 @@ // Type definitions for Smoothie Charts 1.21 // Project: https://github.com/joewalnes/smoothie -// Definitions by: Drew Noakes -// Mike H. Hawley +// Definitions by: Drew Noakes , Mike H. Hawley // Definitions: https://github.com/borisyankov/DefinitelyTyped/smoothie // NOTE this reference is here to make the DefinitelyTyped `npm test` suite pass and diff --git a/sockjs-node/sockjs-node-tests.ts b/sockjs-node/sockjs-node-tests.ts new file mode 100644 index 000000000..25e5b496a --- /dev/null +++ b/sockjs-node/sockjs-node-tests.ts @@ -0,0 +1,44 @@ +/// +import sockjs = require("sockjs"); +import http = require("http"); +import stream = require("stream"); + +var server: sockjs.Server, + serverOptions: sockjs.ServerOptions = {}; + +// createServer method +server = sockjs.createServer(); +server = sockjs.createServer(serverOptions); + +// installHandlers method +var httpServer: http.Server = http.createServer(); +server.installHandlers(httpServer); +server.installHandlers(httpServer, serverOptions); + +// serverOptions +serverOptions.sockjs_url = 'http://cdn.sockjs.org/sockjs-0.3.min.js'; +serverOptions.prefix = '/prefix'; +serverOptions.response_limit = 128000; +serverOptions.websocket = true; + +serverOptions.jsessionid = true; +serverOptions.jsessionid = () => true; + +serverOptions.log = (severity, message) => { }; +serverOptions.heartbeat_delay = 25000; +serverOptions.disconnect_delay = 5000; + +// Connection +var connection: sockjs.Connection; + +// on('connection') passes a sockJS connection +server.on('connection', (conn) => { + connection = conn; + conn = connection; +}); + +// connection is a ReadWriteStream +var connectionAsReadWrite: NodeJS.ReadWriteStream = connection; + +connection.on('data', (message: string) => { }); +connection.on('close', () => { }); diff --git a/sockjs-node/sockjs-node.d.ts b/sockjs-node/sockjs-node.d.ts new file mode 100644 index 000000000..99e4663b7 --- /dev/null +++ b/sockjs-node/sockjs-node.d.ts @@ -0,0 +1,56 @@ +// Type definitions for sockjs-node 0.3.x +// Project: https://github.com/sockjs/sockjs-node +// Definitions by: Phil McCloghry-Laing +// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "sockjs" { + import http = require('http'); + + export interface ServerOptions { + sockjs_url?: string; + prefix?: string; + response_limit?: number; + websocket?: boolean; + jsessionid?: any; + log?: (severity: string, message: string) => void; + heartbeat_delay?: number; + disconnect_delay?: number; + } + + export function createServer(options?: ServerOptions): Server; + + export interface Server extends NodeJS.EventEmitter { + installHandlers(server: http.Server, options?: ServerOptions): any; + + on(event: 'connection', listener: (conn: Connection) => any): Server; + on(event: string, listener: Function): Server; + } + + export interface Connection extends NodeJS.ReadWriteStream { + remoteAddress: string; + remotePort: number; + address: { + [key: string]: { + address: string; + port: number; + }; + }; + headers: { + [key: string]: string; + }; + url: string; + pathname: string; + prefix: string; + protocol: string; + readyState: number; + + close(code?: string, reason?: string): boolean; + destroy(): void; + + on(event: 'data', listener: (message: string) => any): Connection; + on(event: 'close', listener: () => void): Connection; + on(event: string, listener: Function): Connection; + } +} diff --git a/sockjs/sockjs.d.ts b/sockjs/sockjs.d.ts index 7a4316ad6..3f823a5ee 100644 --- a/sockjs/sockjs.d.ts +++ b/sockjs/sockjs.d.ts @@ -1,7 +1,7 @@ // Type definitions for SockJS 0.3.x // Project: https://github.com/sockjs/sockjs-client // Definitions by: Emil Ivanov -// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface SockJSSimpleEvent { type: string; @@ -36,10 +36,17 @@ interface SockJS extends EventTarget { declare var SockJS: { prototype: SockJS; - new (url: string, options?: { - debug: boolean; - devel: boolean; - protocols_whitelist: string[]; - }): SockJS; - -} \ No newline at end of file + new (url: string, _reserved: any, options?: { + debug?: boolean; + devel?: boolean; + protocols_whitelist?: string[]; + server?: string; + rtt?: number; + rto?: number; + info?: { + websocket?: boolean; + cookie_needed?: boolean; + null_origin?: boolean; + }; + }): SockJS; +}; \ No newline at end of file diff --git a/spin/spin.d.ts b/spin/spin.d.ts index c7ceac2b6..02a0e7cd2 100644 --- a/spin/spin.d.ts +++ b/spin/spin.d.ts @@ -1,6 +1,6 @@ // Type definitions for Spin.js 1.3.1 // Project: http://fgnass.github.com/spin.js/ -// Definitions by: Boris Yankov and Theodore Brown +// Definitions by: Boris Yankov , Theodore Brown // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/state-machine/state-machine.d.ts b/state-machine/state-machine.d.ts index c5c9c83bf..67f7012b1 100644 --- a/state-machine/state-machine.d.ts +++ b/state-machine/state-machine.d.ts @@ -1,8 +1,6 @@ // Type definitions for Finite State Machine 2.2 // Project: https://github.com/jakesgordon/javascript-state-machine -// Definitions by: Boris Yankov -// Definitions by: Maarten Docter (2013/01/22) -// Definitions by: William Sears (2013/01/25) +// Definitions by: Boris Yankov , Maarten Docter , William Sears // Definitions: https://github.com/borisyankov/DefinitelyTyped interface StateMachineErrorCallback { diff --git a/stream-to-array/stream-to-array.d.ts b/stream-to-array/stream-to-array.d.ts index 4fd48acdf..45239bbb1 100644 --- a/stream-to-array/stream-to-array.d.ts +++ b/stream-to-array/stream-to-array.d.ts @@ -1,3 +1,9 @@ +// Type definitions for stream-to-array +// Project: https://github.com/stream-utils/stream-to-array +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + /// declare module 'stream-to-array' { diff --git a/svgjs.draggable/svgjs.draggable.d.ts b/svgjs.draggable/svgjs.draggable.d.ts index 76837f58e..8a64868c5 100644 --- a/svgjs.draggable/svgjs.draggable.d.ts +++ b/svgjs.draggable/svgjs.draggable.d.ts @@ -1,3 +1,9 @@ +// Type definitions for svgjs.draggable +// Project: http://www.svgjs.com/ +// Definitions by: Luigi Trabacchin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + declare module svgjs { export module draggable { export interface DragDelta { diff --git a/test-module/test-addon.ts b/test-module/test-addon.ts deleted file mode 100644 index 14c5ba0d6..000000000 --- a/test-module/test-addon.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// - -declare module 'test-addon' { - export function addon(): Such; -} diff --git a/test-module/test-module.d.ts b/test-module/test-module.d.ts deleted file mode 100644 index 294e7ea43..000000000 --- a/test-module/test-module.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -interface Such { - amaze(): void; - much(): void; -} -declare module 'test-module' { - export function wow(): Such; -} diff --git a/threejs/three.d.ts b/threejs/three.d.ts index 906774181..748900166 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -1,4 +1,4 @@ -// Type definitions for three.js -- r67 +// Type definitions for three.js r67 // Project: http://mrdoob.github.com/three.js/ // Definitions by: Kon , Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/timelinejs/timelinejs-tests.ts b/timelinejs/timelinejs-tests.ts new file mode 100644 index 000000000..da6aef966 --- /dev/null +++ b/timelinejs/timelinejs-tests.ts @@ -0,0 +1,41 @@ +/** + * Created by Roland on 6/15/2014. + */ +/// + +var timelineSource:knightlab.ITimelineModel = { + timeline: { + headline: 'Test Headline', + type: 'default', + text: 'Test Text', + asset: { + media: 'http://www.vertex42.com/ExcelArticles/Images/timeline/Timeline-for-Benjamin-Franklin.gif', + credit: 'http://www.vertex42.com', + caption: 'Test Caption' + }, + date: [ + { + startDate: '2011,12,09', + endDate: '2011,12,10', + headline: 'Test Date Headline', + text: 'Test test test test' + }, + { + startDate: '2012,12,09', + endDate: '2012,12,10', + headline: 'Test Date Headline 2', + text: 'Test2 test2 test2 test2' + } + ] + } +}; + +var source:knightlab.ITimeLineConfiguration = { + width: '100%', + height: '100%', + type: 'timeline', + embed_id: 'test', + source: timelineSource +}; + +createStoryJS(source); \ No newline at end of file diff --git a/timelinejs/timelinejs.d.ts b/timelinejs/timelinejs.d.ts new file mode 100644 index 000000000..6101b93aa --- /dev/null +++ b/timelinejs/timelinejs.d.ts @@ -0,0 +1,136 @@ +// Type definitions for timelinejs +// Project: https://github.com/NUKnightLab/TimelineJS +// Definitions by: Roland Zwaga +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare function createStoryJS(config:knightlab.ITimeLineConfiguration):void; + +declare module knightlab { + + export interface ITimeLineConfiguration { + width: string; + height: string; + /* + * path to json/ or link to googlespreadsheet + * source Should be either the path to the JSON resource to load, or a JavaScript object corresponding to the + * Timeline model. + * + * Here is an example using a data object: + * + * var dataObject = {timeline: {headline: "Headline", type: ... }} + * createStoryJS({ + * type: 'timeline', + * width: '800', + * height: '600', + * source: dataObject, + * embed_id: 'my-timeline' + * }); + * If source is a string, we will try to automatically recognize resources that are Twitter searches, Google + * Spreadsheets or Storify stories. Failing that, we assume the source is either JSON or JSONP. If string + * matches on .jsonp, we will treat it as JSONP, otherwise, we will append ?callback=onJSONP_Data. + */ + source: any; + type?: string; + /* + * Optional use a different div id for embed + */ + embed_id?: string; + /* + * Optional start at latest date + */ + start_at_end?: boolean; + /* + * Optional start at specific slide + */ + start_at_slide?: string; + /* + * Optional tweak the default zoom level + */ + start_zoom_adjust?: string; + /* + * Optional location bar hashes + */ + hash_bookmark?: boolean; + /* + * Optional font + */ + font?: string; + /* + * Optional debug to console + */ + debug?: boolean; + /* + * Optional language + */ + lang?: string; + /* + * Optional path to css + */ + css?: string; + /* + * Optional path to js + */ + js?: string; + /* + * required in order to use maptype + */ + gmap_key?: string; + /* + * Stamen Maps: + * toner + * toner-lines + * toner-labels + * watercolor + * sterrain + * + * Google Maps: + * ROADMAP + * TERRAIN + * HYBRID + * SATELLITE + * + * OpenStreetMap: + * osm + */ + maptype?: string; + } + + export interface ITimelineModel { + timeline:ITimeLine; + } + + export interface ITimeLine { + headline?:string; + type?:string; + text?:string; + asset?:ITimeLineAsset; + date?:ITimelineDate[]; + era?:ITimelineEra[]; + } + + export interface ITimeLineAsset { + media:string; + thumbnail?:string; + credit:string; + caption:string; + } + + export interface ITimelineDate extends ITimelineEra { + classname?:string; + asset?:ITimeLineAsset; + } + + export interface ITimelineEra { + /* + * format example: 2011,12,10 + */ + startDate:string; + /* + * format example: 2011,12,10 + */ + endDate:string; + headline:string; + text:string; + tag?:string; + } +} \ No newline at end of file diff --git a/type-detect/type-detect-tests.ts b/type-detect/type-detect-tests.ts new file mode 100644 index 000000000..b747de2b9 --- /dev/null +++ b/type-detect/type-detect-tests.ts @@ -0,0 +1,20 @@ +/// + +import td = require('type-detect'); + +var str: string; +var bool: boolean; +var x: any; + +str = td(123); + +var lib: td.Library = new td.Library(); + +lib.define(str, /aa/); +lib.define(str, (val) => { + return bool; +}); +str = lib.of(x); +bool = lib.test(x, str); + + diff --git a/type-detect/type-detect.d.ts b/type-detect/type-detect.d.ts new file mode 100644 index 000000000..be3189671 --- /dev/null +++ b/type-detect/type-detect.d.ts @@ -0,0 +1,18 @@ +// Type definitions for type-detect v0.1.2 +// Project: https://github.com/chaijs/type-detect +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'type-detect' { + function type(val: any): string; + + module type { + export class Library { + of(val: any): string; + define (type: string, test: RegExp): void; + define (type: string, test: (val: any) => boolean): void; + test (val: any, type: string): boolean; + } + } + export = type; +} diff --git a/typescript-services/typescriptServices-tests.ts b/typescript-services/typescriptServices-tests.ts new file mode 100644 index 000000000..ab0da7a09 --- /dev/null +++ b/typescript-services/typescriptServices-tests.ts @@ -0,0 +1,8 @@ +/// + +import ts = require('typescript-services'); + +// formatter: +var snapshot = ts.SimpleText.fromString('var foo = 123;'); +var formatter = new ts.Services.Formatting.TextSnapshot(snapshot); +console.log(formatter); diff --git a/typescript-services/typescriptServices.d.ts b/typescript-services/typescriptServices.d.ts new file mode 100644 index 000000000..18bef7b3d --- /dev/null +++ b/typescript-services/typescriptServices.d.ts @@ -0,0 +1,9320 @@ +// Type definitions for TypeScript-Services +// Project: https://www.npmjs.org/package/typescript-services +// Definitions by: Basarat Ali Syed +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module TypeScript { + var DiagnosticCode: { + error_TS_0_1: string; + warning_TS_0_1: string; + Unrecognized_escape_sequence: string; + Unexpected_character_0: string; + Missing_close_quote_character: string; + Identifier_expected: string; + _0_keyword_expected: string; + _0_expected: string; + Identifier_expected_0_is_a_keyword: string; + Automatic_semicolon_insertion_not_allowed: string; + Unexpected_token_0_expected: string; + Trailing_separator_not_allowed: string; + AsteriskSlash_expected: string; + public_or_private_modifier_must_precede_static: string; + Unexpected_token: string; + Catch_clause_parameter_cannot_have_a_type_annotation: string; + Rest_parameter_must_be_last_in_list: string; + Parameter_cannot_have_question_mark_and_initializer: string; + Required_parameter_cannot_follow_optional_parameter: string; + Index_signatures_cannot_have_rest_parameters: string; + Index_signature_parameter_cannot_have_accessibility_modifiers: string; + Index_signature_parameter_cannot_have_a_question_mark: string; + Index_signature_parameter_cannot_have_an_initializer: string; + Index_signature_must_have_a_type_annotation: string; + Index_signature_parameter_must_have_a_type_annotation: string; + Index_signature_parameter_type_must_be_string_or_number: string; + extends_clause_already_seen: string; + extends_clause_must_precede_implements_clause: string; + Classes_can_only_extend_a_single_class: string; + implements_clause_already_seen: string; + Accessibility_modifier_already_seen: string; + _0_modifier_must_precede_1_modifier: string; + _0_modifier_already_seen: string; + _0_modifier_cannot_appear_on_a_class_element: string; + Interface_declaration_cannot_have_implements_clause: string; + super_invocation_cannot_have_type_arguments: string; + Only_ambient_modules_can_use_quoted_names: string; + Statements_are_not_allowed_in_ambient_contexts: string; + Implementations_are_not_allowed_in_ambient_contexts: string; + declare_modifier_not_allowed_for_code_already_in_an_ambient_context: string; + Initializers_are_not_allowed_in_ambient_contexts: string; + Parameter_property_declarations_can_only_be_used_in_a_non_ambient_constructor_declaration: string; + Function_implementation_expected: string; + Constructor_implementation_expected: string; + Function_overload_name_must_be_0: string; + _0_modifier_cannot_appear_on_a_module_element: string; + declare_modifier_cannot_appear_on_an_interface_declaration: string; + declare_modifier_required_for_top_level_element: string; + Rest_parameter_cannot_be_optional: string; + Rest_parameter_cannot_have_an_initializer: string; + set_accessor_must_have_one_and_only_one_parameter: string; + set_accessor_parameter_cannot_be_optional: string; + set_accessor_parameter_cannot_have_an_initializer: string; + set_accessor_cannot_have_rest_parameter: string; + get_accessor_cannot_have_parameters: string; + Modifiers_cannot_appear_here: string; + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: string; + Class_name_cannot_be_0: string; + Interface_name_cannot_be_0: string; + Enum_name_cannot_be_0: string; + Module_name_cannot_be_0: string; + Enum_member_must_have_initializer: string; + Export_assignment_cannot_be_used_in_internal_modules: string; + Export_assignment_not_allowed_in_module_with_exported_element: string; + Module_cannot_have_multiple_export_assignments: string; + Ambient_enum_elements_can_only_have_integer_literal_initializers: string; + module_class_interface_enum_import_or_statement: string; + constructor_function_accessor_or_variable: string; + statement: string; + case_or_default_clause: string; + identifier: string; + call_construct_index_property_or_function_signature: string; + expression: string; + type_name: string; + property_or_accessor: string; + parameter: string; + type: string; + type_parameter: string; + declare_modifier_not_allowed_on_import_declaration: string; + Function_overload_must_be_static: string; + Function_overload_must_not_be_static: string; + Parameter_property_declarations_cannot_be_used_in_a_constructor_overload: string; + Invalid_reference_directive_syntax: string; + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: string; + Accessors_are_not_allowed_in_ambient_contexts: string; + _0_modifier_cannot_appear_on_a_constructor_declaration: string; + _0_modifier_cannot_appear_on_a_parameter: string; + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: string; + Type_parameters_cannot_appear_on_a_constructor_declaration: string; + Type_annotation_cannot_appear_on_a_constructor_declaration: string; + Duplicate_identifier_0: string; + The_name_0_does_not_exist_in_the_current_scope: string; + The_name_0_does_not_refer_to_a_value: string; + super_can_only_be_used_inside_a_class_instance_method: string; + The_left_hand_side_of_an_assignment_expression_must_be_a_variable_property_or_indexer: string; + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: string; + Value_of_type_0_is_not_callable: string; + Value_of_type_0_is_not_newable: string; + Value_of_type_0_is_not_indexable_by_type_1: string; + Operator_0_cannot_be_applied_to_types_1_and_2: string; + Operator_0_cannot_be_applied_to_types_1_and_2_3: string; + Cannot_convert_0_to_1: string; + Cannot_convert_0_to_1_NL_2: string; + Expected_var_class_interface_or_module: string; + Operator_0_cannot_be_applied_to_type_1: string; + Getter_0_already_declared: string; + Setter_0_already_declared: string; + Exported_class_0_extends_private_class_1: string; + Exported_class_0_implements_private_interface_1: string; + Exported_interface_0_extends_private_interface_1: string; + Exported_class_0_extends_class_from_inaccessible_module_1: string; + Exported_class_0_implements_interface_from_inaccessible_module_1: string; + Exported_interface_0_extends_interface_from_inaccessible_module_1: string; + Public_static_property_0_of_exported_class_has_or_is_using_private_type_1: string; + Public_property_0_of_exported_class_has_or_is_using_private_type_1: string; + Property_0_of_exported_interface_has_or_is_using_private_type_1: string; + Exported_variable_0_has_or_is_using_private_type_1: string; + Public_static_property_0_of_exported_class_is_using_inaccessible_module_1: string; + Public_property_0_of_exported_class_is_using_inaccessible_module_1: string; + Property_0_of_exported_interface_is_using_inaccessible_module_1: string; + Exported_variable_0_is_using_inaccessible_module_1: string; + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_type_1: string; + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_type_1: string; + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_type_1: string; + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: string; + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: string; + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: string; + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: string; + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: string; + Parameter_0_of_exported_function_has_or_is_using_private_type_1: string; + Parameter_0_of_constructor_from_exported_class_is_using_inaccessible_module_1: string; + Parameter_0_of_public_static_property_setter_from_exported_class_is_using_inaccessible_module_1: string; + Parameter_0_of_public_property_setter_from_exported_class_is_using_inaccessible_module_1: string; + Parameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: string; + Parameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: string; + Parameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: string; + Parameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: string; + Parameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: string; + Parameter_0_of_exported_function_is_using_inaccessible_module_1: string; + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_type_0: string; + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_type_0: string; + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_0: string; + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_type_0: string; + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_type_0: string; + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_type_0: string; + Return_type_of_public_method_from_exported_class_has_or_is_using_private_type_0: string; + Return_type_of_method_from_exported_interface_has_or_is_using_private_type_0: string; + Return_type_of_exported_function_has_or_is_using_private_type_0: string; + Return_type_of_public_static_property_getter_from_exported_class_is_using_inaccessible_module_0: string; + Return_type_of_public_property_getter_from_exported_class_is_using_inaccessible_module_0: string; + Return_type_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_0: string; + Return_type_of_call_signature_from_exported_interface_is_using_inaccessible_module_0: string; + Return_type_of_index_signature_from_exported_interface_is_using_inaccessible_module_0: string; + Return_type_of_public_static_method_from_exported_class_is_using_inaccessible_module_0: string; + Return_type_of_public_method_from_exported_class_is_using_inaccessible_module_0: string; + Return_type_of_method_from_exported_interface_is_using_inaccessible_module_0: string; + Return_type_of_exported_function_is_using_inaccessible_module_0: string; + new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: string; + A_parameter_list_must_follow_a_generic_type_argument_list_expected: string; + Multiple_constructor_implementations_are_not_allowed: string; + Unable_to_resolve_external_module_0: string; + Module_cannot_be_aliased_to_a_non_module_type: string; + A_class_may_only_extend_another_class: string; + A_class_may_only_implement_another_class_or_interface: string; + An_interface_may_only_extend_another_class_or_interface: string; + Unable_to_resolve_type: string; + Unable_to_resolve_type_of_0: string; + Unable_to_resolve_type_parameter_constraint: string; + Type_parameter_constraint_cannot_be_a_primitive_type: string; + Supplied_parameters_do_not_match_any_signature_of_call_target: string; + Supplied_parameters_do_not_match_any_signature_of_call_target_NL_0: string; + Invalid_new_expression: string; + Call_signatures_used_in_a_new_expression_must_have_a_void_return_type: string; + Could_not_select_overload_for_new_expression: string; + Type_0_does_not_satisfy_the_constraint_1_for_type_parameter_2: string; + Could_not_select_overload_for_call_expression: string; + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: string; + Calls_to_super_are_only_valid_inside_a_class: string; + Generic_type_0_requires_1_type_argument_s: string; + Type_of_array_literal_cannot_be_determined_Best_common_type_could_not_be_found_for_array_elements: string; + Could_not_find_enclosing_symbol_for_dotted_name_0: string; + The_property_0_does_not_exist_on_value_of_type_1: string; + Could_not_find_symbol_0: string; + get_and_set_accessor_must_have_the_same_type: string; + this_cannot_be_referenced_in_current_location: string; + Static_members_cannot_reference_class_type_parameters: string; + Class_0_is_recursively_referenced_as_a_base_type_of_itself: string; + Interface_0_is_recursively_referenced_as_a_base_type_of_itself: string; + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: string; + super_cannot_be_referenced_in_non_derived_classes: string; + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: string; + Constructors_for_derived_classes_must_contain_a_super_call: string; + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: string; + _0_1_is_inaccessible: string; + this_cannot_be_referenced_within_module_bodies: string; + Invalid_expression_types_not_known_to_support_the_addition_operator: string; + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: string; + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: string; + The_type_of_a_unary_arithmetic_operation_operand_must_be_of_type_any_number_or_an_enum_type: string; + Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation: string; + Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any: string; + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: string; + The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: string; + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: string; + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: string; + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: string; + Setters_cannot_return_a_value: string; + Tried_to_query_type_of_uninitialized_module_0: string; + Tried_to_set_variable_type_to_uninitialized_module_type_0: string; + Type_0_does_not_have_type_parameters: string; + Getters_must_return_a_value: string; + Getter_and_setter_accessors_do_not_agree_in_visibility: string; + Invalid_left_hand_side_of_assignment_expression: string; + Function_declared_a_non_void_return_type_but_has_no_return_expression: string; + Cannot_resolve_return_type_reference: string; + Constructors_cannot_have_a_return_type_of_void: string; + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: string; + All_symbols_within_a_with_block_will_be_resolved_to_any: string; + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: string; + Class_0_declares_interface_1_but_does_not_implement_it_NL_2: string; + Class_0_declares_class_1_as_an_interface_but_does_not_implement_it_NL_2: string; + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: string; + this_cannot_be_referenced_in_static_initializers_in_a_class_body: string; + Class_0_cannot_extend_class_1_NL_2: string; + Interface_0_cannot_extend_class_1_NL_2: string; + Interface_0_cannot_extend_interface_1_NL_2: string; + Duplicate_overload_signature_for_0: string; + Duplicate_constructor_overload_signature: string; + Duplicate_overload_call_signature: string; + Duplicate_overload_construct_signature: string; + Overload_signature_is_not_compatible_with_function_definition: string; + Overload_signature_is_not_compatible_with_function_definition_NL_0: string; + Overload_signatures_must_all_be_public_or_private: string; + Overload_signatures_must_all_be_exported_or_not_exported: string; + Overload_signatures_must_all_be_ambient_or_non_ambient: string; + Overload_signatures_must_all_be_optional_or_required: string; + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: string; + this_cannot_be_referenced_in_constructor_arguments: string; + Instance_member_cannot_be_accessed_off_a_class: string; + Untyped_function_calls_may_not_accept_type_arguments: string; + Non_generic_functions_may_not_accept_type_arguments: string; + A_generic_type_may_not_reference_itself_with_a_wrapped_form_of_its_own_type_parameters: string; + Rest_parameters_must_be_array_types: string; + Overload_signature_implementation_cannot_use_specialized_type: string; + Export_assignments_may_only_be_used_at_the_top_level_of_external_modules: string; + Export_assignments_may_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: string; + Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: string; + Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1: string; + Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1_NL_2: string; + All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0: string; + All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0_NL_1: string; + All_named_properties_must_be_assignable_to_string_indexer_type_0: string; + All_named_properties_must_be_assignable_to_string_indexer_type_0_NL_1: string; + Generic_type_references_must_include_all_type_arguments: string; + Default_arguments_are_only_allowed_in_implementation: string; + Overloads_cannot_differ_only_by_return_type: string; + Function_expression_declared_a_non_void_return_type_but_has_no_return_expression: string; + Import_declaration_referencing_identifier_from_internal_module_can_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: string; + Could_not_find_symbol_0_in_module_1: string; + Unable_to_resolve_module_reference_0: string; + Could_not_find_module_0_in_module_1: string; + Exported_import_declaration_0_is_assigned_value_with_type_that_has_or_is_using_private_type_1: string; + Exported_import_declaration_0_is_assigned_value_with_type_that_is_using_inaccessible_module_1: string; + Exported_import_declaration_0_is_assigned_type_that_has_or_is_using_private_type_1: string; + Exported_import_declaration_0_is_assigned_type_that_is_using_inaccessible_module_1: string; + Exported_import_declaration_0_is_assigned_container_that_is_or_is_using_inaccessible_module_1: string; + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_1: string; + Internal_module_reference_0_in_import_declaration_does_not_reference_module_instance_for_1: string; + Module_0_cannot_merge_with_previous_declaration_of_1_in_a_different_file_2: string; + Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3: string; + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: string; + Ambient_external_module_declaration_cannot_be_reopened: string; + All_declarations_of_merged_declaration_0_must_be_exported_or_not_exported: string; + super_cannot_be_referenced_in_constructor_arguments: string; + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: string; + Ambient_external_module_declaration_must_be_defined_in_global_context: string; + Ambient_external_module_declaration_cannot_specify_relative_module_name: string; + Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: string; + Could_not_find_the_best_common_type_of_types_of_all_return_statement_expressions: string; + Import_declaration_cannot_refer_to_external_module_reference_when_noResolve_option_is_set: string; + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: string; + continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: string; + break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: string; + Jump_target_not_found: string; + Jump_target_cannot_cross_function_boundary: string; + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: string; + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: string; + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: string; + TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: string; + TypeParameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: string; + TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: string; + TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: string; + TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: string; + TypeParameter_0_of_exported_function_has_or_is_using_private_type_1: string; + TypeParameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: string; + TypeParameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: string; + TypeParameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: string; + TypeParameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: string; + TypeParameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: string; + TypeParameter_0_of_exported_function_is_using_inaccessible_module_1: string; + TypeParameter_0_of_exported_class_has_or_is_using_private_type_1: string; + TypeParameter_0_of_exported_interface_has_or_is_using_private_type_1: string; + TypeParameter_0_of_exported_class_is_using_inaccessible_module_1: string; + TypeParameter_0_of_exported_interface_is_using_inaccessible_module_1: string; + Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: string; + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: string; + Type_of_conditional_0_must_be_identical_to_1_or_2: string; + Type_of_conditional_0_must_be_identical_to_1_2_or_3: string; + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: string; + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: string; + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: string; + Parameter_0_cannot_be_referenced_in_its_initializer: string; + Duplicate_string_index_signature: string; + Duplicate_number_index_signature: string; + All_declarations_of_an_interface_must_have_identical_type_parameters: string; + Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: string; + Type_0_is_missing_property_1_from_type_2: string; + Types_of_property_0_of_types_1_and_2_are_incompatible: string; + Types_of_property_0_of_types_1_and_2_are_incompatible_NL_3: string; + Property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: string; + Property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: string; + Types_0_and_1_define_property_2_as_private: string; + Call_signatures_of_types_0_and_1_are_incompatible: string; + Call_signatures_of_types_0_and_1_are_incompatible_NL_2: string; + Type_0_requires_a_call_signature_but_type_1_lacks_one: string; + Construct_signatures_of_types_0_and_1_are_incompatible: string; + Construct_signatures_of_types_0_and_1_are_incompatible_NL_2: string; + Type_0_requires_a_construct_signature_but_type_1_lacks_one: string; + Index_signatures_of_types_0_and_1_are_incompatible: string; + Index_signatures_of_types_0_and_1_are_incompatible_NL_2: string; + Call_signature_expects_0_or_fewer_parameters: string; + Could_not_apply_type_0_to_argument_1_which_is_of_type_2: string; + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: string; + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: string; + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: string; + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: string; + Types_of_static_property_0_of_class_1_and_class_2_are_incompatible: string; + Types_of_static_property_0_of_class_1_and_class_2_are_incompatible_NL_3: string; + Type_reference_cannot_refer_to_container_0: string; + Type_reference_must_refer_to_type: string; + In_enums_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_the_first_enum_element: string; + _0_overload_s: string; + Variable_declaration_cannot_have_the_same_name_as_an_import_declaration: string; + Signature_expected_0_type_arguments_got_1_instead: string; + Property_0_defined_as_optional_in_type_1_but_is_required_in_type_2: string; + Types_0_and_1_originating_in_infinitely_expanding_type_reference_do_not_refer_to_same_named_type: string; + Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments: string; + Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments_NL_2: string; + Named_properties_0_of_types_1_and_2_are_not_identical: string; + Types_of_string_indexer_of_types_0_and_1_are_not_identical: string; + Types_of_number_indexer_of_types_0_and_1_are_not_identical: string; + Type_of_number_indexer_in_type_0_is_not_assignable_to_string_indexer_type_in_type_1_NL_2: string; + Type_of_property_0_in_type_1_is_not_assignable_to_string_indexer_type_in_type_2_NL_3: string; + Type_of_property_0_in_type_1_is_not_assignable_to_number_indexer_type_in_type_2_NL_3: string; + Static_property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: string; + Static_property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: string; + Types_0_and_1_define_static_property_2_as_private: string; + Current_host_does_not_support_0_option: string; + ECMAScript_target_version_0_not_supported_Specify_a_valid_target_version_1_default_or_2: string; + Module_code_generation_0_not_supported: string; + Could_not_find_file_0: string; + A_file_cannot_have_a_reference_to_itself: string; + Cannot_resolve_referenced_file_0: string; + Cannot_find_the_common_subdirectory_path_for_the_input_files: string; + Emit_Error_0: string; + Cannot_read_file_0_1: string; + Unsupported_file_encoding: string; + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: string; + Unsupported_locale_0: string; + Execution_Failed_NL: string; + Invalid_call_to_up: string; + Invalid_call_to_down: string; + Base64_value_0_finished_with_a_continuation_bit: string; + Unknown_option_0: string; + Expected_0_arguments_to_message_got_1_instead: string; + Expected_the_message_0_to_have_1_arguments_but_it_had_2: string; + Could_not_delete_file_0: string; + Could_not_create_directory_0: string; + Error_while_executing_file_0: string; + Cannot_compile_external_modules_unless_the_module_flag_is_provided: string; + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: string; + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: string; + Options_mapRoot_and_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: string; + Option_0_specified_without_1: string; + codepage_option_not_supported_on_current_platform: string; + Concatenate_and_emit_output_to_single_file: string; + Generates_corresponding_0_file: string; + Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: string; + Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: string; + Watch_input_files: string; + Redirect_output_structure_to_the_directory: string; + Do_not_emit_comments_to_output: string; + Skip_resolution_and_preprocessing: string; + Specify_ECMAScript_target_version_0_default_or_1: string; + Specify_module_code_generation_0_or_1: string; + Print_this_message: string; + Print_the_compiler_s_version_0: string; + Allow_use_of_deprecated_0_keyword_when_referencing_an_external_module: string; + Specify_locale_for_errors_and_messages_For_example_0_or_1: string; + Syntax_0: string; + options: string; + file1: string; + Examples: string; + Options: string; + Insert_command_line_options_and_files_from_a_file: string; + Version_0: string; + Use_the_0_flag_to_see_options: string; + NL_Recompiling_0: string; + STRING: string; + KIND: string; + file2: string; + VERSION: string; + LOCATION: string; + DIRECTORY: string; + NUMBER: string; + Specify_the_codepage_to_use_when_opening_source_files: string; + Additional_locations: string; + This_version_of_the_Javascript_runtime_does_not_support_the_0_function: string; + Unknown_rule: string; + Invalid_line_number_0: string; + Warn_on_expressions_and_declarations_with_an_implied_any_type: string; + Variable_0_implicitly_has_an_any_type: string; + Parameter_0_of_1_implicitly_has_an_any_type: string; + Parameter_0_of_function_type_implicitly_has_an_any_type: string; + Member_0_of_object_type_implicitly_has_an_any_type: string; + new_expression_which_lacks_a_constructor_signature_implicitly_has_an_any_type: string; + _0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: string; + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: string; + Parameter_0_of_lambda_function_implicitly_has_an_any_type: string; + Constructor_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: string; + Lambda_Function_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: string; + Array_Literal_implicitly_has_an_any_type_from_widening: string; + _0_which_lacks_get_accessor_and_parameter_type_annotation_on_set_accessor_implicitly_has_an_any_type: string; + Index_signature_of_object_type_implicitly_has_an_any_type: string; + Object_literal_s_property_0_implicitly_has_an_any_type_from_widening: string; + }; +} +declare module TypeScript { + class ArrayUtilities { + static isArray(value: any): boolean; + static sequenceEquals(array1: T[], array2: T[], equals: (v1: T, v2: T) => boolean): boolean; + static contains(array: T[], value: T): boolean; + static groupBy(array: T[], func: (v: T) => string): any; + static distinct(array: T[], equalsFn?: (a: T, b: T) => boolean): T[]; + static min(array: T[], func: (v: T) => number): number; + static max(array: T[], func: (v: T) => number): number; + static last(array: T[]): T; + static lastOrDefault(array: T[], predicate: (v: T, index: number) => boolean): T; + static firstOrDefault(array: T[], func: (v: T, index: number) => boolean): T; + static first(array: T[], func?: (v: T, index: number) => boolean): T; + static sum(array: T[], func: (v: T) => number): number; + static select(values: T[], func: (v: T) => S): S[]; + static where(values: T[], func: (v: T) => boolean): T[]; + static any(array: T[], func: (v: T) => boolean): boolean; + static all(array: T[], func: (v: T) => boolean): boolean; + static binarySearch(array: number[], value: number): number; + static createArray(length: number, defaultValue: any): T[]; + static grow(array: T[], length: number, defaultValue: T): void; + static copy(sourceArray: T[], sourceIndex: number, destinationArray: T[], destinationIndex: number, length: number): void; + static indexOf(array: T[], predicate: (v: T) => boolean): number; + } +} +declare module TypeScript { + interface IBitVector { + valueAt(index: number): boolean; + setValueAt(index: number, value: boolean): void; + release(): void; + } + module BitVector { + function getBitVector(allowUndefinedValues: boolean): IBitVector; + } +} +declare module TypeScript { + interface IBitMatrix { + valueAt(x: number, y: number): boolean; + setValueAt(x: number, y: number, value: boolean): void; + release(): void; + } + module BitMatrix { + function getBitMatrix(allowUndefinedValues: boolean): IBitMatrix; + } +} +declare module TypeScript { + enum Constants { + Max31BitInteger = 1073741823, + Min31BitInteger = -1073741824, + } +} +declare module TypeScript { + enum AssertionLevel { + None = 0, + Normal = 1, + Aggressive = 2, + VeryAggressive = 3, + } + class Debug { + private static currentAssertionLevel; + static shouldAssert(level: AssertionLevel): boolean; + static assert(expression: any, message?: string, verboseDebugInfo?: () => string): void; + static fail(message?: string): void; + } +} +declare module TypeScript { + var LocalizedDiagnosticMessages: IIndexable; + class Location { + private _fileName; + private _lineMap; + private _start; + private _length; + constructor(fileName: string, lineMap: LineMap, start: number, length: number); + public fileName(): string; + public lineMap(): LineMap; + public line(): number; + public character(): number; + public start(): number; + public length(): number; + static equals(location1: Location, location2: Location): boolean; + } + class Diagnostic extends Location { + private _diagnosticKey; + private _arguments; + private _additionalLocations; + constructor(fileName: string, lineMap: LineMap, start: number, length: number, diagnosticKey: string, _arguments?: any[], additionalLocations?: Location[]); + public toJSON(key: any): any; + public diagnosticKey(): string; + public arguments(): any[]; + public text(): string; + public message(): string; + public additionalLocations(): Location[]; + static equals(diagnostic1: Diagnostic, diagnostic2: Diagnostic): boolean; + public info(): DiagnosticInfo; + } + function newLine(): string; + function getLocalizedText(diagnosticKey: string, args: any[]): string; + function getDiagnosticMessage(diagnosticKey: string, args: any[]): string; +} +declare module TypeScript { + interface DiagnosticInfo { + category: DiagnosticCategory; + message: string; + code: number; + } +} +declare module TypeScript { + class Errors { + static argument(argument: string, message?: string): Error; + static argumentOutOfRange(argument: string): Error; + static argumentNull(argument: string): Error; + static abstract(): Error; + static notYetImplemented(): Error; + static invalidOperation(message?: string): Error; + } +} +declare module TypeScript { + class Hash { + private static FNV_BASE; + private static FNV_PRIME; + private static computeFnv1aCharArrayHashCode(text, start, len); + static computeSimple31BitCharArrayHashCode(key: number[], start: number, len: number): number; + static computeSimple31BitStringHashCode(key: string): number; + static computeMurmur2StringHashCode(key: string, seed: number): number; + private static primes; + static getPrime(min: number): number; + static expandPrime(oldSize: number): number; + static combine(value: number, currentHash: number): number; + } +} +declare module TypeScript.Collections { + var DefaultHashTableCapacity: number; + class HashTable { + private hash; + private entries; + private count; + constructor(capacity: number, hash: (k: TKey) => number); + public set(key: TKey, value: TValue): void; + public add(key: TKey, value: TValue): void; + public containsKey(key: TKey): boolean; + public get(key: TKey): TValue; + private computeHashCode(key); + private addOrSet(key, value, throwOnExistingEntry); + private findEntry(key, hashCode); + private addEntry(key, value, hashCode); + private grow(); + } + function createHashTable(capacity?: number, hash?: (k: TKey) => number): HashTable; + function identityHashCode(value: any): number; +} +declare class Enumerator { + public atEnd(): boolean; + public moveNext(): boolean; + public item(): any; + constructor(o: any); +} +declare module TypeScript { + var nodeMakeDirectoryTime: number; + var nodeCreateBufferTime: number; + var nodeWriteFileSyncTime: number; + enum ByteOrderMark { + None = 0, + Utf8 = 1, + Utf16BigEndian = 2, + Utf16LittleEndian = 3, + } + class FileInformation { + public contents: string; + public byteOrderMark: ByteOrderMark; + constructor(contents: string, byteOrderMark: ByteOrderMark); + } + interface IEnvironment { + supportsCodePage(): boolean; + readFile(path: string, codepage: number): FileInformation; + writeFile(path: string, contents: string, writeByteOrderMark: boolean): void; + deleteFile(path: string): void; + fileExists(path: string): boolean; + directoryExists(path: string): boolean; + listFiles(path: string, re?: RegExp, options?: { + recursive?: boolean; + }): string[]; + arguments: string[]; + standardOut: ITextWriter; + currentDirectory(): string; + newLine: string; + } + var Environment: IEnvironment; +} +declare module TypeScript { + interface IIndexable { + [s: string]: T; + } +} +declare module TypeScript { + module IntegerUtilities { + function integerDivide(numerator: number, denominator: number): number; + function integerMultiplyLow32Bits(n1: number, n2: number): number; + function integerMultiplyHigh32Bits(n1: number, n2: number): number; + function isInteger(text: string): boolean; + function isHexInteger(text: string): boolean; + } +} +declare module TypeScript { + interface Iterator { + moveNext(): boolean; + current(): T; + } +} +declare module TypeScript { + interface ILineAndCharacter { + line: number; + character: number; + } +} +declare module TypeScript { + class LineMap { + private _computeLineStarts; + private length; + static empty: LineMap; + private _lineStarts; + constructor(_computeLineStarts: () => number[], length: number); + public toJSON(key: any): { + lineStarts: number[]; + length: number; + }; + public equals(other: LineMap): boolean; + public lineStarts(): number[]; + public lineCount(): number; + public getPosition(line: number, character: number): number; + public getLineNumberFromPosition(position: number): number; + public getLineStartPosition(lineNumber: number): number; + public fillLineAndCharacterFromPosition(position: number, lineAndCharacter: ILineAndCharacter): void; + public getLineAndCharacterFromPosition(position: number): LineAndCharacter; + } +} +declare module TypeScript { + class LineAndCharacter { + private _line; + private _character; + constructor(line: number, character: number); + public line(): number; + public character(): number; + } +} +declare module TypeScript { + class MathPrototype { + static max(a: number, b: number): number; + static min(a: number, b: number): number; + } +} +declare module TypeScript.Collections { + var DefaultStringTableCapacity: number; + class StringTable { + private entries; + private count; + constructor(capacity: number); + public addCharArray(key: number[], start: number, len: number): string; + private findCharArrayEntry(key, start, len, hashCode); + private addEntry(text, hashCode); + private grow(); + private static textCharArrayEquals(text, array, start, length); + } + var DefaultStringTable: StringTable; +} +declare module TypeScript { + class StringUtilities { + static isString(value: any): boolean; + static fromCharCodeArray(array: number[]): string; + static endsWith(string: string, value: string): boolean; + static startsWith(string: string, value: string): boolean; + static copyTo(source: string, sourceIndex: number, destination: number[], destinationIndex: number, count: number): void; + static repeat(value: string, count: number): string; + static stringEquals(val1: string, val2: string): boolean; + } +} +declare module TypeScript { + class Timer { + public startTime: number; + public time: number; + public start(): void; + public end(): void; + } +} +declare module TypeScript { + enum DiagnosticCategory { + Warning = 0, + Error = 1, + Message = 2, + NoPrefix = 3, + } +} +declare module TypeScript { + var diagnosticInformationMap: IIndexable; +} +declare module TypeScript { + enum CharacterCodes { + nullCharacter = 0, + maxAsciiCharacter = 127, + lineFeed = 10, + carriageReturn = 13, + lineSeparator = 8232, + paragraphSeparator = 8233, + nextLine = 133, + space = 32, + nonBreakingSpace = 160, + enQuad = 8192, + emQuad = 8193, + enSpace = 8194, + emSpace = 8195, + threePerEmSpace = 8196, + fourPerEmSpace = 8197, + sixPerEmSpace = 8198, + figureSpace = 8199, + punctuationSpace = 8200, + thinSpace = 8201, + hairSpace = 8202, + zeroWidthSpace = 8203, + narrowNoBreakSpace = 8239, + ideographicSpace = 12288, + _ = 95, + $ = 36, + _0 = 48, + _7 = 55, + _9 = 57, + a = 97, + b = 98, + c = 99, + d = 100, + e = 101, + f = 102, + g = 103, + h = 104, + i = 105, + k = 107, + l = 108, + m = 109, + n = 110, + o = 111, + p = 112, + q = 113, + r = 114, + s = 115, + t = 116, + u = 117, + v = 118, + w = 119, + x = 120, + y = 121, + z = 122, + A = 65, + E = 69, + F = 70, + X = 88, + Z = 90, + ampersand = 38, + asterisk = 42, + at = 64, + backslash = 92, + bar = 124, + caret = 94, + closeBrace = 125, + closeBracket = 93, + closeParen = 41, + colon = 58, + comma = 44, + dot = 46, + doubleQuote = 34, + equals = 61, + exclamation = 33, + greaterThan = 62, + lessThan = 60, + minus = 45, + openBrace = 123, + openBracket = 91, + openParen = 40, + percent = 37, + plus = 43, + question = 63, + semicolon = 59, + singleQuote = 39, + slash = 47, + tilde = 126, + backspace = 8, + formFeed = 12, + byteOrderMark = 65279, + tab = 9, + verticalTab = 11, + } +} +declare module TypeScript { + interface IScriptSnapshot { + getText(start: number, end: number): string; + getLength(): number; + getLineStartPositions(): number[]; + getTextChangeRangeSinceVersion(scriptVersion: number): TextChangeRange; + } + module ScriptSnapshot { + function fromString(text: string): IScriptSnapshot; + } +} +declare module TypeScript { + interface ISimpleText { + length(): number; + copyTo(sourceIndex: number, destination: number[], destinationIndex: number, count: number): void; + substr(start: number, length: number, intern: boolean): string; + subText(span: TextSpan): ISimpleText; + charCodeAt(index: number): number; + lineMap(): LineMap; + } + interface IText extends ISimpleText { + lineCount(): number; + lines(): ITextLine[]; + charCodeAt(position: number): number; + getLineFromLineNumber(lineNumber: number): ITextLine; + getLineFromPosition(position: number): ITextLine; + getLineNumberFromPosition(position: number): number; + getLinePosition(position: number): LineAndCharacter; + toString(span?: TextSpan): string; + } +} +declare module TypeScript { + interface ITextLine { + start(): number; + end(): number; + endIncludingLineBreak(): number; + extent(): TextSpan; + extentIncludingLineBreak(): TextSpan; + toString(): string; + lineNumber(): number; + } +} +declare module TypeScript { + module LineMap1 { + function fromSimpleText(text: ISimpleText): LineMap; + function fromScriptSnapshot(scriptSnapshot: IScriptSnapshot): LineMap; + function fromString(text: string): LineMap; + } +} +declare module TypeScript.TextFactory { + function createText(value: string): IText; +} +declare module TypeScript.SimpleText { + function fromString(value: string): ISimpleText; + function fromScriptSnapshot(scriptSnapshot: IScriptSnapshot): ISimpleText; +} +declare module TypeScript.TextUtilities { + interface ICharacterSequence { + charCodeAt(index: number): number; + length: number; + } + function parseLineStarts(text: ICharacterSequence): number[]; + function getLengthOfLineBreakSlow(text: ICharacterSequence, index: number, c: number): number; + function getLengthOfLineBreak(text: ICharacterSequence, index: number): number; + function isAnyLineBreakCharacter(c: number): boolean; +} +declare module TypeScript { + class TextSpan { + private _start; + private _length; + constructor(start: number, length: number); + public start(): number; + public length(): number; + public end(): number; + public isEmpty(): boolean; + public containsPosition(position: number): boolean; + public containsTextSpan(span: TextSpan): boolean; + public overlapsWith(span: TextSpan): boolean; + public overlap(span: TextSpan): TextSpan; + public intersectsWithTextSpan(span: TextSpan): boolean; + public intersectsWith(start: number, length: number): boolean; + public intersectsWithPosition(position: number): boolean; + public intersection(span: TextSpan): TextSpan; + static fromBounds(start: number, end: number): TextSpan; + } +} +declare module TypeScript { + class TextChangeRange { + static unchanged: TextChangeRange; + private _span; + private _newLength; + constructor(span: TextSpan, newLength: number); + public span(): TextSpan; + public newLength(): number; + public newSpan(): TextSpan; + public isUnchanged(): boolean; + static collapseChangesFromSingleVersion(changes: TextChangeRange[]): TextChangeRange; + static collapseChangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange; + } +} +declare module TypeScript { + class CharacterInfo { + static isDecimalDigit(c: number): boolean; + static isOctalDigit(c: number): boolean; + static isHexDigit(c: number): boolean; + static hexValue(c: number): number; + static isWhitespace(ch: number): boolean; + static isLineTerminator(ch: number): boolean; + } +} +declare module TypeScript { + enum SyntaxConstants { + TriviaNewLineMask = 1, + TriviaCommentMask = 2, + TriviaFullWidthShift = 2, + NodeDataComputed = 1, + NodeIncrementallyUnusableMask = 2, + NodeParsedInStrictModeMask = 4, + NodeFullWidthShift = 3, + IsVariableWidthKeyword = -2147483648, + } +} +declare class FormattingOptions { + public useTabs: boolean; + public spacesPerTab: number; + public indentSpaces: number; + public newLineCharacter: string; + constructor(useTabs: boolean, spacesPerTab: number, indentSpaces: number, newLineCharacter: string); + static defaultOptions: FormattingOptions; +} +declare module TypeScript.Indentation { + function columnForEndOfToken(token: ISyntaxToken, syntaxInformationMap: SyntaxInformationMap, options: FormattingOptions): number; + function columnForStartOfToken(token: ISyntaxToken, syntaxInformationMap: SyntaxInformationMap, options: FormattingOptions): number; + function columnForStartOfFirstTokenInLineContainingToken(token: ISyntaxToken, syntaxInformationMap: SyntaxInformationMap, options: FormattingOptions): number; + function columnForPositionInString(input: string, position: number, options: FormattingOptions): number; + function indentationString(column: number, options: FormattingOptions): string; + function indentationTrivia(column: number, options: FormattingOptions): ISyntaxTrivia; + function firstNonWhitespacePosition(value: string): number; +} +declare module TypeScript { + enum LanguageVersion { + EcmaScript3 = 0, + EcmaScript5 = 1, + } +} +declare module TypeScript { + class ParseOptions { + private _languageVersion; + private _allowAutomaticSemicolonInsertion; + constructor(languageVersion: LanguageVersion, allowAutomaticSemicolonInsertion: boolean); + public toJSON(key: any): { + allowAutomaticSemicolonInsertion: boolean; + }; + public languageVersion(): LanguageVersion; + public allowAutomaticSemicolonInsertion(): boolean; + } +} +declare module TypeScript { + class PositionedElement { + private _parent; + private _element; + private _fullStart; + constructor(parent: PositionedElement, element: ISyntaxElement, fullStart: number); + static create(parent: PositionedElement, element: ISyntaxElement, fullStart: number): PositionedElement; + public parent(): PositionedElement; + public parentElement(): ISyntaxElement; + public element(): ISyntaxElement; + public kind(): SyntaxKind; + public childIndex(child: ISyntaxElement): number; + public childCount(): number; + public childAt(index: number): PositionedElement; + public childStart(child: ISyntaxElement): number; + public childEnd(child: ISyntaxElement): number; + public childStartAt(index: number): number; + public childEndAt(index: number): number; + public getPositionedChild(child: ISyntaxElement): PositionedElement; + public fullStart(): number; + public fullEnd(): number; + public fullWidth(): number; + public start(): number; + public end(): number; + public root(): PositionedNode; + public containingNode(): PositionedNode; + } + class PositionedNodeOrToken extends PositionedElement { + constructor(parent: PositionedElement, nodeOrToken: ISyntaxNodeOrToken, fullStart: number); + public nodeOrToken(): ISyntaxNodeOrToken; + } + class PositionedNode extends PositionedNodeOrToken { + constructor(parent: PositionedElement, node: SyntaxNode, fullStart: number); + public node(): SyntaxNode; + } + class PositionedToken extends PositionedNodeOrToken { + constructor(parent: PositionedElement, token: ISyntaxToken, fullStart: number); + public token(): ISyntaxToken; + public previousToken(includeSkippedTokens?: boolean): PositionedToken; + public nextToken(includeSkippedTokens?: boolean): PositionedToken; + } + class PositionedList extends PositionedElement { + constructor(parent: PositionedElement, list: ISyntaxList, fullStart: number); + public list(): ISyntaxList; + } + class PositionedSeparatedList extends PositionedElement { + constructor(parent: PositionedElement, list: ISeparatedSyntaxList, fullStart: number); + public list(): ISeparatedSyntaxList; + } + class PositionedSkippedToken extends PositionedToken { + private _parentToken; + constructor(parentToken: PositionedToken, token: ISyntaxToken, fullStart: number); + public parentToken(): PositionedToken; + public previousToken(includeSkippedTokens?: boolean): PositionedToken; + public nextToken(includeSkippedTokens?: boolean): PositionedToken; + } +} +declare module TypeScript { + enum SyntaxKind { + None = 0, + List = 1, + SeparatedList = 2, + TriviaList = 3, + WhitespaceTrivia = 4, + NewLineTrivia = 5, + MultiLineCommentTrivia = 6, + SingleLineCommentTrivia = 7, + SkippedTokenTrivia = 8, + ErrorToken = 9, + EndOfFileToken = 10, + IdentifierName = 11, + RegularExpressionLiteral = 12, + NumericLiteral = 13, + StringLiteral = 14, + BreakKeyword = 15, + CaseKeyword = 16, + CatchKeyword = 17, + ContinueKeyword = 18, + DebuggerKeyword = 19, + DefaultKeyword = 20, + DeleteKeyword = 21, + DoKeyword = 22, + ElseKeyword = 23, + FalseKeyword = 24, + FinallyKeyword = 25, + ForKeyword = 26, + FunctionKeyword = 27, + IfKeyword = 28, + InKeyword = 29, + InstanceOfKeyword = 30, + NewKeyword = 31, + NullKeyword = 32, + ReturnKeyword = 33, + SwitchKeyword = 34, + ThisKeyword = 35, + ThrowKeyword = 36, + TrueKeyword = 37, + TryKeyword = 38, + TypeOfKeyword = 39, + VarKeyword = 40, + VoidKeyword = 41, + WhileKeyword = 42, + WithKeyword = 43, + ClassKeyword = 44, + ConstKeyword = 45, + EnumKeyword = 46, + ExportKeyword = 47, + ExtendsKeyword = 48, + ImportKeyword = 49, + SuperKeyword = 50, + ImplementsKeyword = 51, + InterfaceKeyword = 52, + LetKeyword = 53, + PackageKeyword = 54, + PrivateKeyword = 55, + ProtectedKeyword = 56, + PublicKeyword = 57, + StaticKeyword = 58, + YieldKeyword = 59, + AnyKeyword = 60, + BooleanKeyword = 61, + ConstructorKeyword = 62, + DeclareKeyword = 63, + GetKeyword = 64, + ModuleKeyword = 65, + RequireKeyword = 66, + NumberKeyword = 67, + SetKeyword = 68, + StringKeyword = 69, + OpenBraceToken = 70, + CloseBraceToken = 71, + OpenParenToken = 72, + CloseParenToken = 73, + OpenBracketToken = 74, + CloseBracketToken = 75, + DotToken = 76, + DotDotDotToken = 77, + SemicolonToken = 78, + CommaToken = 79, + LessThanToken = 80, + GreaterThanToken = 81, + LessThanEqualsToken = 82, + GreaterThanEqualsToken = 83, + EqualsEqualsToken = 84, + EqualsGreaterThanToken = 85, + ExclamationEqualsToken = 86, + EqualsEqualsEqualsToken = 87, + ExclamationEqualsEqualsToken = 88, + PlusToken = 89, + MinusToken = 90, + AsteriskToken = 91, + PercentToken = 92, + PlusPlusToken = 93, + MinusMinusToken = 94, + LessThanLessThanToken = 95, + GreaterThanGreaterThanToken = 96, + GreaterThanGreaterThanGreaterThanToken = 97, + AmpersandToken = 98, + BarToken = 99, + CaretToken = 100, + ExclamationToken = 101, + TildeToken = 102, + AmpersandAmpersandToken = 103, + BarBarToken = 104, + QuestionToken = 105, + ColonToken = 106, + EqualsToken = 107, + PlusEqualsToken = 108, + MinusEqualsToken = 109, + AsteriskEqualsToken = 110, + PercentEqualsToken = 111, + LessThanLessThanEqualsToken = 112, + GreaterThanGreaterThanEqualsToken = 113, + GreaterThanGreaterThanGreaterThanEqualsToken = 114, + AmpersandEqualsToken = 115, + BarEqualsToken = 116, + CaretEqualsToken = 117, + SlashToken = 118, + SlashEqualsToken = 119, + SourceUnit = 120, + QualifiedName = 121, + ObjectType = 122, + FunctionType = 123, + ArrayType = 124, + ConstructorType = 125, + GenericType = 126, + TypeQuery = 127, + InterfaceDeclaration = 128, + FunctionDeclaration = 129, + ModuleDeclaration = 130, + ClassDeclaration = 131, + EnumDeclaration = 132, + ImportDeclaration = 133, + ExportAssignment = 134, + MemberFunctionDeclaration = 135, + MemberVariableDeclaration = 136, + ConstructorDeclaration = 137, + IndexMemberDeclaration = 138, + GetAccessor = 139, + SetAccessor = 140, + PropertySignature = 141, + CallSignature = 142, + ConstructSignature = 143, + IndexSignature = 144, + MethodSignature = 145, + Block = 146, + IfStatement = 147, + VariableStatement = 148, + ExpressionStatement = 149, + ReturnStatement = 150, + SwitchStatement = 151, + BreakStatement = 152, + ContinueStatement = 153, + ForStatement = 154, + ForInStatement = 155, + EmptyStatement = 156, + ThrowStatement = 157, + WhileStatement = 158, + TryStatement = 159, + LabeledStatement = 160, + DoStatement = 161, + DebuggerStatement = 162, + WithStatement = 163, + PlusExpression = 164, + NegateExpression = 165, + BitwiseNotExpression = 166, + LogicalNotExpression = 167, + PreIncrementExpression = 168, + PreDecrementExpression = 169, + DeleteExpression = 170, + TypeOfExpression = 171, + VoidExpression = 172, + CommaExpression = 173, + AssignmentExpression = 174, + AddAssignmentExpression = 175, + SubtractAssignmentExpression = 176, + MultiplyAssignmentExpression = 177, + DivideAssignmentExpression = 178, + ModuloAssignmentExpression = 179, + AndAssignmentExpression = 180, + ExclusiveOrAssignmentExpression = 181, + OrAssignmentExpression = 182, + LeftShiftAssignmentExpression = 183, + SignedRightShiftAssignmentExpression = 184, + UnsignedRightShiftAssignmentExpression = 185, + ConditionalExpression = 186, + LogicalOrExpression = 187, + LogicalAndExpression = 188, + BitwiseOrExpression = 189, + BitwiseExclusiveOrExpression = 190, + BitwiseAndExpression = 191, + EqualsWithTypeConversionExpression = 192, + NotEqualsWithTypeConversionExpression = 193, + EqualsExpression = 194, + NotEqualsExpression = 195, + LessThanExpression = 196, + GreaterThanExpression = 197, + LessThanOrEqualExpression = 198, + GreaterThanOrEqualExpression = 199, + InstanceOfExpression = 200, + InExpression = 201, + LeftShiftExpression = 202, + SignedRightShiftExpression = 203, + UnsignedRightShiftExpression = 204, + MultiplyExpression = 205, + DivideExpression = 206, + ModuloExpression = 207, + AddExpression = 208, + SubtractExpression = 209, + PostIncrementExpression = 210, + PostDecrementExpression = 211, + MemberAccessExpression = 212, + InvocationExpression = 213, + ArrayLiteralExpression = 214, + ObjectLiteralExpression = 215, + ObjectCreationExpression = 216, + ParenthesizedExpression = 217, + ParenthesizedArrowFunctionExpression = 218, + SimpleArrowFunctionExpression = 219, + CastExpression = 220, + ElementAccessExpression = 221, + FunctionExpression = 222, + OmittedExpression = 223, + VariableDeclaration = 224, + VariableDeclarator = 225, + ArgumentList = 226, + ParameterList = 227, + TypeArgumentList = 228, + TypeParameterList = 229, + ExtendsHeritageClause = 230, + ImplementsHeritageClause = 231, + EqualsValueClause = 232, + CaseSwitchClause = 233, + DefaultSwitchClause = 234, + ElseClause = 235, + CatchClause = 236, + FinallyClause = 237, + TypeParameter = 238, + Constraint = 239, + SimplePropertyAssignment = 240, + FunctionPropertyAssignment = 241, + Parameter = 242, + EnumElement = 243, + TypeAnnotation = 244, + ExternalModuleReference = 245, + ModuleNameModuleReference = 246, + Last = 246, + FirstStandardKeyword = 15, + LastStandardKeyword = 43, + FirstFutureReservedKeyword = 44, + LastFutureReservedKeyword = 50, + FirstFutureReservedStrictKeyword = 51, + LastFutureReservedStrictKeyword = 59, + FirstTypeScriptKeyword = 60, + LastTypeScriptKeyword = 69, + FirstKeyword = 15, + LastKeyword = 69, + FirstToken = 9, + LastToken = 119, + FirstPunctuation = 70, + LastPunctuation = 119, + FirstFixedWidth = 15, + LastFixedWidth = 119, + FirstTrivia = 4, + LastTrivia = 8, + } +} +declare module TypeScript.SyntaxFacts { + function getTokenKind(text: string): SyntaxKind; + function getText(kind: SyntaxKind): string; + function isTokenKind(kind: SyntaxKind): boolean; + function isAnyKeyword(kind: SyntaxKind): boolean; + function isStandardKeyword(kind: SyntaxKind): boolean; + function isFutureReservedKeyword(kind: SyntaxKind): boolean; + function isFutureReservedStrictKeyword(kind: SyntaxKind): boolean; + function isAnyPunctuation(kind: SyntaxKind): boolean; + function isPrefixUnaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean; + function isBinaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean; + function getPrefixUnaryExpressionFromOperatorToken(tokenKind: SyntaxKind): SyntaxKind; + function getPostfixUnaryExpressionFromOperatorToken(tokenKind: SyntaxKind): SyntaxKind; + function getBinaryExpressionFromOperatorToken(tokenKind: SyntaxKind): SyntaxKind; + function getOperatorTokenFromBinaryExpression(tokenKind: SyntaxKind): SyntaxKind; + function isAnyDivideToken(kind: SyntaxKind): boolean; + function isAnyDivideOrRegularExpressionToken(kind: SyntaxKind): boolean; +} +declare module TypeScript { + class Scanner implements ISlidingWindowSource { + private slidingWindow; + private fileName; + private text; + private _languageVersion; + constructor(fileName: string, text: ISimpleText, languageVersion: LanguageVersion, window?: number[]); + public languageVersion(): LanguageVersion; + public fetchMoreItems(argument: any, sourceIndex: number, window: number[], destinationIndex: number, spaceAvailable: number): number; + private currentCharCode(); + public absoluteIndex(): number; + public setAbsoluteIndex(index: number): void; + public scan(diagnostics: Diagnostic[], allowRegularExpression: boolean): ISyntaxToken; + private createToken(fullStart, leadingTriviaInfo, start, kind, end, fullEnd, trailingTriviaInfo, isVariableWidthKeyword); + private static triviaWindow; + static scanTrivia(text: ISimpleText, start: number, length: number, isTrailing: boolean): ISyntaxTriviaList; + private scanTrivia(underlyingText, underlyingTextStart, isTrailing); + private scanTriviaInfo(diagnostics, isTrailing); + private isNewLineCharacter(ch); + private scanWhitespaceTrivia(underlyingText, underlyingTextStart); + private scanSingleLineCommentTrivia(underlyingText, underlyingTextStart); + private scanSingleLineCommentTriviaLength(); + private scanMultiLineCommentTrivia(underlyingText, underlyingTextStart); + private scanMultiLineCommentTriviaLength(diagnostics); + private scanLineTerminatorSequenceTrivia(ch); + private scanLineTerminatorSequenceLength(ch); + private scanSyntaxToken(diagnostics, allowRegularExpression); + private isIdentifierStart(interpretedChar); + private isIdentifierPart(interpretedChar); + private tryFastScanIdentifierOrKeyword(firstCharacter); + private slowScanIdentifierOrKeyword(diagnostics); + private scanNumericLiteral(diagnostics); + private isOctalNumericLiteral(); + private scanOctalNumericLiteral(diagnostics); + private scanDecimalDigits(); + private scanDecimalNumericLiteral(); + private scanHexNumericLiteral(); + private isHexNumericLiteral(); + private advanceAndSetTokenKind(kind); + private scanLessThanToken(); + private scanBarToken(); + private scanCaretToken(); + private scanAmpersandToken(); + private scanPercentToken(); + private scanMinusToken(); + private scanPlusToken(); + private scanAsteriskToken(); + private scanEqualsToken(); + private isDotPrefixedNumericLiteral(); + private scanDotToken(diagnostics); + private scanSlashToken(allowRegularExpression); + private tryScanRegularExpressionToken(); + private scanExclamationToken(); + private scanDefaultCharacter(character, diagnostics); + private getErrorMessageText(text); + private skipEscapeSequence(diagnostics); + private scanStringLiteral(diagnostics); + private isUnicodeEscape(character); + private peekCharOrUnicodeEscape(); + private peekUnicodeOrHexEscape(); + private scanCharOrUnicodeEscape(errors); + private scanUnicodeOrHexEscape(errors); + public substring(start: number, end: number, intern: boolean): string; + private createIllegalEscapeDiagnostic(start, end); + static isValidIdentifier(text: ISimpleText, languageVersion: LanguageVersion): boolean; + } +} +declare module TypeScript { + class ScannerUtilities { + static identifierKind(array: number[], startIndex: number, length: number): SyntaxKind; + } +} +declare module TypeScript { + interface ISeparatedSyntaxList extends ISyntaxElement { + childAt(index: number): ISyntaxNodeOrToken; + toArray(): ISyntaxNodeOrToken[]; + toNonSeparatorArray(): ISyntaxNodeOrToken[]; + separatorCount(): number; + separatorAt(index: number): ISyntaxToken; + nonSeparatorCount(): number; + nonSeparatorAt(index: number): ISyntaxNodeOrToken; + insertChildrenInto(array: ISyntaxElement[], index: number): void; + } +} +declare module TypeScript.Syntax { + var emptySeparatedList: ISeparatedSyntaxList; + function separatedList(nodes: ISyntaxNodeOrToken[]): ISeparatedSyntaxList; +} +declare module TypeScript { + interface ISlidingWindowSource { + fetchMoreItems(argument: any, sourceIndex: number, window: any[], destinationIndex: number, spaceAvailable: number): number; + } + class SlidingWindow { + private source; + public window: any[]; + private defaultValue; + private sourceLength; + public windowCount: number; + public windowAbsoluteStartIndex: number; + public currentRelativeItemIndex: number; + private _pinCount; + private firstPinnedAbsoluteIndex; + constructor(source: ISlidingWindowSource, window: any[], defaultValue: any, sourceLength?: number); + private windowAbsoluteEndIndex(); + private addMoreItemsToWindow(argument); + private tryShiftOrGrowWindow(); + public absoluteIndex(): number; + public isAtEndOfSource(): boolean; + public getAndPinAbsoluteIndex(): number; + public releaseAndUnpinAbsoluteIndex(absoluteIndex: number): void; + public rewindToPinnedIndex(absoluteIndex: number): void; + public currentItem(argument: any): any; + public peekItemN(n: number): any; + public moveToNextItem(): void; + public disgardAllItemsFromCurrentIndexOnwards(): void; + public setAbsoluteIndex(absoluteIndex: number): void; + public pinCount(): number; + } +} +declare module TypeScript { +} +declare module TypeScript.Syntax { + function emptySourceUnit(): SourceUnitSyntax; + function getStandaloneExpression(positionedToken: PositionedToken): PositionedNodeOrToken; + function isInModuleOrTypeContext(positionedToken: PositionedToken): boolean; + function isInTypeOnlyContext(positionedToken: PositionedToken): boolean; + function childOffset(parent: ISyntaxElement, child: ISyntaxElement): number; + function childOffsetAt(parent: ISyntaxElement, index: number): number; + function childIndex(parent: ISyntaxElement, child: ISyntaxElement): number; + function nodeStructuralEquals(node1: SyntaxNode, node2: SyntaxNode): boolean; + function nodeOrTokenStructuralEquals(node1: ISyntaxNodeOrToken, node2: ISyntaxNodeOrToken): boolean; + function tokenStructuralEquals(token1: ISyntaxToken, token2: ISyntaxToken): boolean; + function triviaListStructuralEquals(triviaList1: ISyntaxTriviaList, triviaList2: ISyntaxTriviaList): boolean; + function triviaStructuralEquals(trivia1: ISyntaxTrivia, trivia2: ISyntaxTrivia): boolean; + function listStructuralEquals(list1: ISyntaxList, list2: ISyntaxList): boolean; + function separatedListStructuralEquals(list1: ISeparatedSyntaxList, list2: ISeparatedSyntaxList): boolean; + function elementStructuralEquals(element1: ISyntaxElement, element2: ISyntaxElement): boolean; + function identifierName(text: string, info?: ITokenInfo): ISyntaxToken; + function trueExpression(): IUnaryExpressionSyntax; + function falseExpression(): IUnaryExpressionSyntax; + function numericLiteralExpression(text: string): IUnaryExpressionSyntax; + function stringLiteralExpression(text: string): IUnaryExpressionSyntax; + function isSuperInvocationExpression(node: IExpressionSyntax): boolean; + function isSuperInvocationExpressionStatement(node: SyntaxNode): boolean; + function isSuperMemberAccessExpression(node: IExpressionSyntax): boolean; + function isSuperMemberAccessInvocationExpression(node: SyntaxNode): boolean; + function assignmentExpression(left: IExpressionSyntax, token: ISyntaxToken, right: IExpressionSyntax): BinaryExpressionSyntax; + function nodeHasSkippedOrMissingTokens(node: SyntaxNode): boolean; + function isUnterminatedStringLiteral(token: ISyntaxToken): boolean; + function isUnterminatedMultilineCommentTrivia(trivia: ISyntaxTrivia): boolean; + function isEntirelyInsideCommentTrivia(trivia: ISyntaxTrivia, fullStart: number, position: number): boolean; + function isEntirelyInsideComment(sourceUnit: SourceUnitSyntax, position: number): boolean; + function isEntirelyInStringOrRegularExpressionLiteral(sourceUnit: SourceUnitSyntax, position: number): boolean; + function findSkippedTokenInLeadingTriviaList(positionedToken: PositionedToken, position: number): PositionedSkippedToken; + function findSkippedTokenInTrailingTriviaList(positionedToken: PositionedToken, position: number): PositionedSkippedToken; + function findSkippedTokenInPositionedToken(positionedToken: PositionedToken, position: number): PositionedSkippedToken; + function findSkippedTokenOnLeft(positionedToken: PositionedToken, position: number): PositionedSkippedToken; + function getAncestorOfKind(positionedToken: PositionedElement, kind: SyntaxKind): PositionedElement; + function hasAncestorOfKind(positionedToken: PositionedElement, kind: SyntaxKind): boolean; + function isIntegerLiteral(expression: IExpressionSyntax): boolean; +} +declare module TypeScript { + interface ISyntaxElement { + kind(): SyntaxKind; + isNode(): boolean; + isToken(): boolean; + isList(): boolean; + isSeparatedList(): boolean; + childCount(): number; + childAt(index: number): ISyntaxElement; + isTypeScriptSpecific(): boolean; + isIncrementallyUnusable(): boolean; + fullWidth(): number; + width(): number; + fullText(): string; + leadingTrivia(): ISyntaxTriviaList; + trailingTrivia(): ISyntaxTriviaList; + leadingTriviaWidth(): number; + trailingTriviaWidth(): number; + firstToken(): ISyntaxToken; + lastToken(): ISyntaxToken; + collectTextElements(elements: string[]): void; + } + interface ISyntaxNode extends ISyntaxNodeOrToken { + } + interface IModuleReferenceSyntax extends ISyntaxNode { + isModuleReference(): boolean; + } + interface IModuleElementSyntax extends ISyntaxNode { + } + interface IStatementSyntax extends IModuleElementSyntax { + isStatement(): boolean; + } + interface IIterationStatementSyntax extends IStatementSyntax { + isIterationStatement(): boolean; + } + interface ITypeMemberSyntax extends ISyntaxNode { + } + interface IClassElementSyntax extends ISyntaxNode { + } + interface IMemberDeclarationSyntax extends IClassElementSyntax { + } + interface IPropertyAssignmentSyntax extends IClassElementSyntax { + } + interface ISwitchClauseSyntax extends ISyntaxNode { + isSwitchClause(): boolean; + statements: ISyntaxList; + } + interface IExpressionSyntax extends ISyntaxNodeOrToken { + isExpression(): boolean; + withLeadingTrivia(trivia: ISyntaxTriviaList): IExpressionSyntax; + withTrailingTrivia(trivia: ISyntaxTriviaList): IExpressionSyntax; + } + interface IUnaryExpressionSyntax extends IExpressionSyntax { + isUnaryExpression(): boolean; + } + interface IArrowFunctionExpressionSyntax extends IUnaryExpressionSyntax { + isArrowFunctionExpression(): boolean; + equalsGreaterThanToken: ISyntaxToken; + block: BlockSyntax; + expression: IExpressionSyntax; + } + interface IPostfixExpressionSyntax extends IUnaryExpressionSyntax { + isPostfixExpression(): boolean; + } + interface IMemberExpressionSyntax extends IPostfixExpressionSyntax { + isMemberExpression(): boolean; + } + interface IPrimaryExpressionSyntax extends IMemberExpressionSyntax { + isPrimaryExpression(): boolean; + } + interface ITypeSyntax extends ISyntaxNodeOrToken { + } + interface INameSyntax extends ITypeSyntax { + } +} +declare module TypeScript.Syntax { + interface IFactory { + sourceUnit(moduleElements: ISyntaxList, endOfFileToken: ISyntaxToken): SourceUnitSyntax; + externalModuleReference(requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken): ExternalModuleReferenceSyntax; + moduleNameModuleReference(moduleName: INameSyntax): ModuleNameModuleReferenceSyntax; + importDeclaration(modifiers: ISyntaxList, importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken): ImportDeclarationSyntax; + exportAssignment(exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ExportAssignmentSyntax; + classDeclaration(modifiers: ISyntaxList, classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: ISyntaxList, openBraceToken: ISyntaxToken, classElements: ISyntaxList, closeBraceToken: ISyntaxToken): ClassDeclarationSyntax; + interfaceDeclaration(modifiers: ISyntaxList, interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: ISyntaxList, body: ObjectTypeSyntax): InterfaceDeclarationSyntax; + heritageClause(kind: SyntaxKind, extendsOrImplementsKeyword: ISyntaxToken, typeNames: ISeparatedSyntaxList): HeritageClauseSyntax; + moduleDeclaration(modifiers: ISyntaxList, moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: ISyntaxList, closeBraceToken: ISyntaxToken): ModuleDeclarationSyntax; + functionDeclaration(modifiers: ISyntaxList, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): FunctionDeclarationSyntax; + variableStatement(modifiers: ISyntaxList, variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken): VariableStatementSyntax; + variableDeclaration(varKeyword: ISyntaxToken, variableDeclarators: ISeparatedSyntaxList): VariableDeclarationSyntax; + variableDeclarator(propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): VariableDeclaratorSyntax; + equalsValueClause(equalsToken: ISyntaxToken, value: IExpressionSyntax): EqualsValueClauseSyntax; + prefixUnaryExpression(kind: SyntaxKind, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax): PrefixUnaryExpressionSyntax; + arrayLiteralExpression(openBracketToken: ISyntaxToken, expressions: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax; + omittedExpression(): OmittedExpressionSyntax; + parenthesizedExpression(openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken): ParenthesizedExpressionSyntax; + simpleArrowFunctionExpression(identifier: ISyntaxToken, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): SimpleArrowFunctionExpressionSyntax; + parenthesizedArrowFunctionExpression(callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): ParenthesizedArrowFunctionExpressionSyntax; + qualifiedName(left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken): QualifiedNameSyntax; + typeArgumentList(lessThanToken: ISyntaxToken, typeArguments: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeArgumentListSyntax; + constructorType(newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): ConstructorTypeSyntax; + functionType(typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): FunctionTypeSyntax; + objectType(openBraceToken: ISyntaxToken, typeMembers: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectTypeSyntax; + arrayType(type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken): ArrayTypeSyntax; + genericType(name: INameSyntax, typeArgumentList: TypeArgumentListSyntax): GenericTypeSyntax; + typeQuery(typeOfKeyword: ISyntaxToken, name: INameSyntax): TypeQuerySyntax; + typeAnnotation(colonToken: ISyntaxToken, type: ITypeSyntax): TypeAnnotationSyntax; + block(openBraceToken: ISyntaxToken, statements: ISyntaxList, closeBraceToken: ISyntaxToken): BlockSyntax; + parameter(dotDotDotToken: ISyntaxToken, modifiers: ISyntaxList, identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): ParameterSyntax; + memberAccessExpression(expression: IExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken): MemberAccessExpressionSyntax; + postfixUnaryExpression(kind: SyntaxKind, operand: IMemberExpressionSyntax, operatorToken: ISyntaxToken): PostfixUnaryExpressionSyntax; + elementAccessExpression(expression: IExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ElementAccessExpressionSyntax; + invocationExpression(expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): InvocationExpressionSyntax; + argumentList(typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, arguments: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ArgumentListSyntax; + binaryExpression(kind: SyntaxKind, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax): BinaryExpressionSyntax; + conditionalExpression(condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax): ConditionalExpressionSyntax; + constructSignature(newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax): ConstructSignatureSyntax; + methodSignature(propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax; + indexSignature(openBracketToken: ISyntaxToken, parameter: ParameterSyntax, closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): IndexSignatureSyntax; + propertySignature(propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): PropertySignatureSyntax; + callSignature(typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax): CallSignatureSyntax; + parameterList(openParenToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ParameterListSyntax; + typeParameterList(lessThanToken: ISyntaxToken, typeParameters: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeParameterListSyntax; + typeParameter(identifier: ISyntaxToken, constraint: ConstraintSyntax): TypeParameterSyntax; + constraint(extendsKeyword: ISyntaxToken, type: ITypeSyntax): ConstraintSyntax; + elseClause(elseKeyword: ISyntaxToken, statement: IStatementSyntax): ElseClauseSyntax; + ifStatement(ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax): IfStatementSyntax; + expressionStatement(expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ExpressionStatementSyntax; + constructorDeclaration(modifiers: ISyntaxList, constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): ConstructorDeclarationSyntax; + memberFunctionDeclaration(modifiers: ISyntaxList, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): MemberFunctionDeclarationSyntax; + getAccessor(modifiers: ISyntaxList, getKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax, block: BlockSyntax): GetAccessorSyntax; + setAccessor(modifiers: ISyntaxList, setKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, block: BlockSyntax): SetAccessorSyntax; + memberVariableDeclaration(modifiers: ISyntaxList, variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken): MemberVariableDeclarationSyntax; + indexMemberDeclaration(modifiers: ISyntaxList, indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken): IndexMemberDeclarationSyntax; + throwStatement(throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ThrowStatementSyntax; + returnStatement(returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ReturnStatementSyntax; + objectCreationExpression(newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): ObjectCreationExpressionSyntax; + switchStatement(switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISyntaxList, closeBraceToken: ISyntaxToken): SwitchStatementSyntax; + caseSwitchClause(caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: ISyntaxList): CaseSwitchClauseSyntax; + defaultSwitchClause(defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: ISyntaxList): DefaultSwitchClauseSyntax; + breakStatement(breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): BreakStatementSyntax; + continueStatement(continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ContinueStatementSyntax; + forStatement(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForStatementSyntax; + forInStatement(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForInStatementSyntax; + whileStatement(whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WhileStatementSyntax; + withStatement(withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WithStatementSyntax; + enumDeclaration(modifiers: ISyntaxList, enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): EnumDeclarationSyntax; + enumElement(propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax): EnumElementSyntax; + castExpression(lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax): CastExpressionSyntax; + objectLiteralExpression(openBraceToken: ISyntaxToken, propertyAssignments: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax; + simplePropertyAssignment(propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax; + functionPropertyAssignment(propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionPropertyAssignmentSyntax; + functionExpression(functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionExpressionSyntax; + emptyStatement(semicolonToken: ISyntaxToken): EmptyStatementSyntax; + tryStatement(tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax): TryStatementSyntax; + catchClause(catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax): CatchClauseSyntax; + finallyClause(finallyKeyword: ISyntaxToken, block: BlockSyntax): FinallyClauseSyntax; + labeledStatement(identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax): LabeledStatementSyntax; + doStatement(doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken): DoStatementSyntax; + typeOfExpression(typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): TypeOfExpressionSyntax; + deleteExpression(deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): DeleteExpressionSyntax; + voidExpression(voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): VoidExpressionSyntax; + debuggerStatement(debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken): DebuggerStatementSyntax; + } + class NormalModeFactory implements IFactory { + public sourceUnit(moduleElements: ISyntaxList, endOfFileToken: ISyntaxToken): SourceUnitSyntax; + public externalModuleReference(requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken): ExternalModuleReferenceSyntax; + public moduleNameModuleReference(moduleName: INameSyntax): ModuleNameModuleReferenceSyntax; + public importDeclaration(modifiers: ISyntaxList, importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken): ImportDeclarationSyntax; + public exportAssignment(exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ExportAssignmentSyntax; + public classDeclaration(modifiers: ISyntaxList, classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: ISyntaxList, openBraceToken: ISyntaxToken, classElements: ISyntaxList, closeBraceToken: ISyntaxToken): ClassDeclarationSyntax; + public interfaceDeclaration(modifiers: ISyntaxList, interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: ISyntaxList, body: ObjectTypeSyntax): InterfaceDeclarationSyntax; + public heritageClause(kind: SyntaxKind, extendsOrImplementsKeyword: ISyntaxToken, typeNames: ISeparatedSyntaxList): HeritageClauseSyntax; + public moduleDeclaration(modifiers: ISyntaxList, moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: ISyntaxList, closeBraceToken: ISyntaxToken): ModuleDeclarationSyntax; + public functionDeclaration(modifiers: ISyntaxList, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): FunctionDeclarationSyntax; + public variableStatement(modifiers: ISyntaxList, variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken): VariableStatementSyntax; + public variableDeclaration(varKeyword: ISyntaxToken, variableDeclarators: ISeparatedSyntaxList): VariableDeclarationSyntax; + public variableDeclarator(propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): VariableDeclaratorSyntax; + public equalsValueClause(equalsToken: ISyntaxToken, value: IExpressionSyntax): EqualsValueClauseSyntax; + public prefixUnaryExpression(kind: SyntaxKind, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax): PrefixUnaryExpressionSyntax; + public arrayLiteralExpression(openBracketToken: ISyntaxToken, expressions: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax; + public omittedExpression(): OmittedExpressionSyntax; + public parenthesizedExpression(openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken): ParenthesizedExpressionSyntax; + public simpleArrowFunctionExpression(identifier: ISyntaxToken, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): SimpleArrowFunctionExpressionSyntax; + public parenthesizedArrowFunctionExpression(callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): ParenthesizedArrowFunctionExpressionSyntax; + public qualifiedName(left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken): QualifiedNameSyntax; + public typeArgumentList(lessThanToken: ISyntaxToken, typeArguments: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeArgumentListSyntax; + public constructorType(newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): ConstructorTypeSyntax; + public functionType(typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): FunctionTypeSyntax; + public objectType(openBraceToken: ISyntaxToken, typeMembers: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectTypeSyntax; + public arrayType(type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken): ArrayTypeSyntax; + public genericType(name: INameSyntax, typeArgumentList: TypeArgumentListSyntax): GenericTypeSyntax; + public typeQuery(typeOfKeyword: ISyntaxToken, name: INameSyntax): TypeQuerySyntax; + public typeAnnotation(colonToken: ISyntaxToken, type: ITypeSyntax): TypeAnnotationSyntax; + public block(openBraceToken: ISyntaxToken, statements: ISyntaxList, closeBraceToken: ISyntaxToken): BlockSyntax; + public parameter(dotDotDotToken: ISyntaxToken, modifiers: ISyntaxList, identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): ParameterSyntax; + public memberAccessExpression(expression: IExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken): MemberAccessExpressionSyntax; + public postfixUnaryExpression(kind: SyntaxKind, operand: IMemberExpressionSyntax, operatorToken: ISyntaxToken): PostfixUnaryExpressionSyntax; + public elementAccessExpression(expression: IExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ElementAccessExpressionSyntax; + public invocationExpression(expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): InvocationExpressionSyntax; + public argumentList(typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ArgumentListSyntax; + public binaryExpression(kind: SyntaxKind, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax): BinaryExpressionSyntax; + public conditionalExpression(condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax): ConditionalExpressionSyntax; + public constructSignature(newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax): ConstructSignatureSyntax; + public methodSignature(propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax; + public indexSignature(openBracketToken: ISyntaxToken, parameter: ParameterSyntax, closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): IndexSignatureSyntax; + public propertySignature(propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): PropertySignatureSyntax; + public callSignature(typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax): CallSignatureSyntax; + public parameterList(openParenToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ParameterListSyntax; + public typeParameterList(lessThanToken: ISyntaxToken, typeParameters: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeParameterListSyntax; + public typeParameter(identifier: ISyntaxToken, constraint: ConstraintSyntax): TypeParameterSyntax; + public constraint(extendsKeyword: ISyntaxToken, type: ITypeSyntax): ConstraintSyntax; + public elseClause(elseKeyword: ISyntaxToken, statement: IStatementSyntax): ElseClauseSyntax; + public ifStatement(ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax): IfStatementSyntax; + public expressionStatement(expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ExpressionStatementSyntax; + public constructorDeclaration(modifiers: ISyntaxList, constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): ConstructorDeclarationSyntax; + public memberFunctionDeclaration(modifiers: ISyntaxList, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): MemberFunctionDeclarationSyntax; + public getAccessor(modifiers: ISyntaxList, getKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax, block: BlockSyntax): GetAccessorSyntax; + public setAccessor(modifiers: ISyntaxList, setKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, block: BlockSyntax): SetAccessorSyntax; + public memberVariableDeclaration(modifiers: ISyntaxList, variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken): MemberVariableDeclarationSyntax; + public indexMemberDeclaration(modifiers: ISyntaxList, indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken): IndexMemberDeclarationSyntax; + public throwStatement(throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ThrowStatementSyntax; + public returnStatement(returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ReturnStatementSyntax; + public objectCreationExpression(newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): ObjectCreationExpressionSyntax; + public switchStatement(switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISyntaxList, closeBraceToken: ISyntaxToken): SwitchStatementSyntax; + public caseSwitchClause(caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: ISyntaxList): CaseSwitchClauseSyntax; + public defaultSwitchClause(defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: ISyntaxList): DefaultSwitchClauseSyntax; + public breakStatement(breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): BreakStatementSyntax; + public continueStatement(continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ContinueStatementSyntax; + public forStatement(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForStatementSyntax; + public forInStatement(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForInStatementSyntax; + public whileStatement(whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WhileStatementSyntax; + public withStatement(withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WithStatementSyntax; + public enumDeclaration(modifiers: ISyntaxList, enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): EnumDeclarationSyntax; + public enumElement(propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax): EnumElementSyntax; + public castExpression(lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax): CastExpressionSyntax; + public objectLiteralExpression(openBraceToken: ISyntaxToken, propertyAssignments: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax; + public simplePropertyAssignment(propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax; + public functionPropertyAssignment(propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionPropertyAssignmentSyntax; + public functionExpression(functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionExpressionSyntax; + public emptyStatement(semicolonToken: ISyntaxToken): EmptyStatementSyntax; + public tryStatement(tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax): TryStatementSyntax; + public catchClause(catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax): CatchClauseSyntax; + public finallyClause(finallyKeyword: ISyntaxToken, block: BlockSyntax): FinallyClauseSyntax; + public labeledStatement(identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax): LabeledStatementSyntax; + public doStatement(doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken): DoStatementSyntax; + public typeOfExpression(typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): TypeOfExpressionSyntax; + public deleteExpression(deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): DeleteExpressionSyntax; + public voidExpression(voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): VoidExpressionSyntax; + public debuggerStatement(debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken): DebuggerStatementSyntax; + } + class StrictModeFactory implements IFactory { + public sourceUnit(moduleElements: ISyntaxList, endOfFileToken: ISyntaxToken): SourceUnitSyntax; + public externalModuleReference(requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken): ExternalModuleReferenceSyntax; + public moduleNameModuleReference(moduleName: INameSyntax): ModuleNameModuleReferenceSyntax; + public importDeclaration(modifiers: ISyntaxList, importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken): ImportDeclarationSyntax; + public exportAssignment(exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ExportAssignmentSyntax; + public classDeclaration(modifiers: ISyntaxList, classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: ISyntaxList, openBraceToken: ISyntaxToken, classElements: ISyntaxList, closeBraceToken: ISyntaxToken): ClassDeclarationSyntax; + public interfaceDeclaration(modifiers: ISyntaxList, interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: ISyntaxList, body: ObjectTypeSyntax): InterfaceDeclarationSyntax; + public heritageClause(kind: SyntaxKind, extendsOrImplementsKeyword: ISyntaxToken, typeNames: ISeparatedSyntaxList): HeritageClauseSyntax; + public moduleDeclaration(modifiers: ISyntaxList, moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: ISyntaxList, closeBraceToken: ISyntaxToken): ModuleDeclarationSyntax; + public functionDeclaration(modifiers: ISyntaxList, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): FunctionDeclarationSyntax; + public variableStatement(modifiers: ISyntaxList, variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken): VariableStatementSyntax; + public variableDeclaration(varKeyword: ISyntaxToken, variableDeclarators: ISeparatedSyntaxList): VariableDeclarationSyntax; + public variableDeclarator(propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): VariableDeclaratorSyntax; + public equalsValueClause(equalsToken: ISyntaxToken, value: IExpressionSyntax): EqualsValueClauseSyntax; + public prefixUnaryExpression(kind: SyntaxKind, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax): PrefixUnaryExpressionSyntax; + public arrayLiteralExpression(openBracketToken: ISyntaxToken, expressions: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax; + public omittedExpression(): OmittedExpressionSyntax; + public parenthesizedExpression(openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken): ParenthesizedExpressionSyntax; + public simpleArrowFunctionExpression(identifier: ISyntaxToken, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): SimpleArrowFunctionExpressionSyntax; + public parenthesizedArrowFunctionExpression(callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): ParenthesizedArrowFunctionExpressionSyntax; + public qualifiedName(left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken): QualifiedNameSyntax; + public typeArgumentList(lessThanToken: ISyntaxToken, typeArguments: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeArgumentListSyntax; + public constructorType(newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): ConstructorTypeSyntax; + public functionType(typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): FunctionTypeSyntax; + public objectType(openBraceToken: ISyntaxToken, typeMembers: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectTypeSyntax; + public arrayType(type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken): ArrayTypeSyntax; + public genericType(name: INameSyntax, typeArgumentList: TypeArgumentListSyntax): GenericTypeSyntax; + public typeQuery(typeOfKeyword: ISyntaxToken, name: INameSyntax): TypeQuerySyntax; + public typeAnnotation(colonToken: ISyntaxToken, type: ITypeSyntax): TypeAnnotationSyntax; + public block(openBraceToken: ISyntaxToken, statements: ISyntaxList, closeBraceToken: ISyntaxToken): BlockSyntax; + public parameter(dotDotDotToken: ISyntaxToken, modifiers: ISyntaxList, identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): ParameterSyntax; + public memberAccessExpression(expression: IExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken): MemberAccessExpressionSyntax; + public postfixUnaryExpression(kind: SyntaxKind, operand: IMemberExpressionSyntax, operatorToken: ISyntaxToken): PostfixUnaryExpressionSyntax; + public elementAccessExpression(expression: IExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ElementAccessExpressionSyntax; + public invocationExpression(expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): InvocationExpressionSyntax; + public argumentList(typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ArgumentListSyntax; + public binaryExpression(kind: SyntaxKind, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax): BinaryExpressionSyntax; + public conditionalExpression(condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax): ConditionalExpressionSyntax; + public constructSignature(newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax): ConstructSignatureSyntax; + public methodSignature(propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax; + public indexSignature(openBracketToken: ISyntaxToken, parameter: ParameterSyntax, closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): IndexSignatureSyntax; + public propertySignature(propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): PropertySignatureSyntax; + public callSignature(typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax): CallSignatureSyntax; + public parameterList(openParenToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ParameterListSyntax; + public typeParameterList(lessThanToken: ISyntaxToken, typeParameters: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeParameterListSyntax; + public typeParameter(identifier: ISyntaxToken, constraint: ConstraintSyntax): TypeParameterSyntax; + public constraint(extendsKeyword: ISyntaxToken, type: ITypeSyntax): ConstraintSyntax; + public elseClause(elseKeyword: ISyntaxToken, statement: IStatementSyntax): ElseClauseSyntax; + public ifStatement(ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax): IfStatementSyntax; + public expressionStatement(expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ExpressionStatementSyntax; + public constructorDeclaration(modifiers: ISyntaxList, constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): ConstructorDeclarationSyntax; + public memberFunctionDeclaration(modifiers: ISyntaxList, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): MemberFunctionDeclarationSyntax; + public getAccessor(modifiers: ISyntaxList, getKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax, block: BlockSyntax): GetAccessorSyntax; + public setAccessor(modifiers: ISyntaxList, setKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, block: BlockSyntax): SetAccessorSyntax; + public memberVariableDeclaration(modifiers: ISyntaxList, variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken): MemberVariableDeclarationSyntax; + public indexMemberDeclaration(modifiers: ISyntaxList, indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken): IndexMemberDeclarationSyntax; + public throwStatement(throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ThrowStatementSyntax; + public returnStatement(returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ReturnStatementSyntax; + public objectCreationExpression(newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): ObjectCreationExpressionSyntax; + public switchStatement(switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISyntaxList, closeBraceToken: ISyntaxToken): SwitchStatementSyntax; + public caseSwitchClause(caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: ISyntaxList): CaseSwitchClauseSyntax; + public defaultSwitchClause(defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: ISyntaxList): DefaultSwitchClauseSyntax; + public breakStatement(breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): BreakStatementSyntax; + public continueStatement(continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ContinueStatementSyntax; + public forStatement(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForStatementSyntax; + public forInStatement(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForInStatementSyntax; + public whileStatement(whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WhileStatementSyntax; + public withStatement(withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WithStatementSyntax; + public enumDeclaration(modifiers: ISyntaxList, enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): EnumDeclarationSyntax; + public enumElement(propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax): EnumElementSyntax; + public castExpression(lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax): CastExpressionSyntax; + public objectLiteralExpression(openBraceToken: ISyntaxToken, propertyAssignments: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax; + public simplePropertyAssignment(propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax; + public functionPropertyAssignment(propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionPropertyAssignmentSyntax; + public functionExpression(functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionExpressionSyntax; + public emptyStatement(semicolonToken: ISyntaxToken): EmptyStatementSyntax; + public tryStatement(tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax): TryStatementSyntax; + public catchClause(catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax): CatchClauseSyntax; + public finallyClause(finallyKeyword: ISyntaxToken, block: BlockSyntax): FinallyClauseSyntax; + public labeledStatement(identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax): LabeledStatementSyntax; + public doStatement(doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken): DoStatementSyntax; + public typeOfExpression(typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): TypeOfExpressionSyntax; + public deleteExpression(deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): DeleteExpressionSyntax; + public voidExpression(voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): VoidExpressionSyntax; + public debuggerStatement(debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken): DebuggerStatementSyntax; + } + var normalModeFactory: IFactory; + var strictModeFactory: IFactory; +} +declare module TypeScript.SyntaxFacts { + function isDirectivePrologueElement(node: ISyntaxNodeOrToken): boolean; + function isUseStrictDirective(node: ISyntaxNodeOrToken): boolean; + function isIdentifierNameOrAnyKeyword(token: ISyntaxToken): boolean; +} +declare module TypeScript { + interface ISyntaxList extends ISyntaxElement { + childAt(index: number): ISyntaxNodeOrToken; + toArray(): ISyntaxNodeOrToken[]; + insertChildrenInto(array: ISyntaxElement[], index: number): void; + } +} +declare module TypeScript.Syntax { + class EmptySyntaxList implements ISyntaxList { + public kind(): SyntaxKind; + public isNode(): boolean; + public isToken(): boolean; + public isList(): boolean; + public isSeparatedList(): boolean; + public toJSON(key: any): any; + public childCount(): number; + public childAt(index: number): ISyntaxNodeOrToken; + public toArray(): ISyntaxNodeOrToken[]; + public collectTextElements(elements: string[]): void; + public firstToken(): ISyntaxToken; + public lastToken(): ISyntaxToken; + public fullWidth(): number; + public width(): number; + public leadingTrivia(): ISyntaxTriviaList; + public trailingTrivia(): ISyntaxTriviaList; + public leadingTriviaWidth(): number; + public trailingTriviaWidth(): number; + public fullText(): string; + public isTypeScriptSpecific(): boolean; + public isIncrementallyUnusable(): boolean; + public findTokenInternal(parent: PositionedElement, position: number, fullStart: number): PositionedToken; + public insertChildrenInto(array: ISyntaxElement[], index: number): void; + } + var emptyList: ISyntaxList; + function list(nodes: ISyntaxNodeOrToken[]): ISyntaxList; +} +declare module TypeScript { + class SyntaxNode implements ISyntaxNodeOrToken { + private _data; + constructor(parsedInStrictMode: boolean); + public isNode(): boolean; + public isToken(): boolean; + public isList(): boolean; + public isSeparatedList(): boolean; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public firstToken(): ISyntaxToken; + public lastToken(): ISyntaxToken; + public insertChildrenInto(array: ISyntaxElement[], index: number): void; + public leadingTrivia(): ISyntaxTriviaList; + public trailingTrivia(): ISyntaxTriviaList; + public toJSON(key: any): any; + public accept(visitor: ISyntaxVisitor): any; + public fullText(): string; + public collectTextElements(elements: string[]): void; + public replaceToken(token1: ISyntaxToken, token2: ISyntaxToken): SyntaxNode; + public withLeadingTrivia(trivia: ISyntaxTriviaList): SyntaxNode; + public withTrailingTrivia(trivia: ISyntaxTriviaList): SyntaxNode; + public hasLeadingTrivia(): boolean; + public hasTrailingTrivia(): boolean; + public isTypeScriptSpecific(): boolean; + public isIncrementallyUnusable(): boolean; + public parsedInStrictMode(): boolean; + public fullWidth(): number; + private computeData(); + private data(); + public findToken(position: number, includeSkippedTokens?: boolean): PositionedToken; + private tryGetEndOfFileAt(position); + private findTokenInternal(parent, position, fullStart); + public findTokenOnLeft(position: number, includeSkippedTokens?: boolean): PositionedToken; + public findCompleteTokenOnLeft(position: number, includeSkippedTokens?: boolean): PositionedToken; + public isModuleElement(): boolean; + public isClassElement(): boolean; + public isTypeMember(): boolean; + public isStatement(): boolean; + public isExpression(): boolean; + public isSwitchClause(): boolean; + public structuralEquals(node: SyntaxNode): boolean; + public width(): number; + public leadingTriviaWidth(): number; + public trailingTriviaWidth(): number; + } +} +declare module TypeScript { + interface ISyntaxNodeOrToken extends ISyntaxElement { + withLeadingTrivia(leadingTrivia: ISyntaxTriviaList): ISyntaxNodeOrToken; + withTrailingTrivia(trailingTrivia: ISyntaxTriviaList): ISyntaxNodeOrToken; + accept(visitor: ISyntaxVisitor): any; + } +} +declare module TypeScript { + class SourceUnitSyntax extends SyntaxNode { + public moduleElements: ISyntaxList; + public endOfFileToken: ISyntaxToken; + constructor(moduleElements: ISyntaxList, endOfFileToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(moduleElements: ISyntaxList, endOfFileToken: ISyntaxToken): SourceUnitSyntax; + static create(endOfFileToken: ISyntaxToken): SourceUnitSyntax; + static create1(endOfFileToken: ISyntaxToken): SourceUnitSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): SourceUnitSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): SourceUnitSyntax; + public withModuleElements(moduleElements: ISyntaxList): SourceUnitSyntax; + public withModuleElement(moduleElement: IModuleElementSyntax): SourceUnitSyntax; + public withEndOfFileToken(endOfFileToken: ISyntaxToken): SourceUnitSyntax; + public isTypeScriptSpecific(): boolean; + } + class ExternalModuleReferenceSyntax extends SyntaxNode implements IModuleReferenceSyntax { + public requireKeyword: ISyntaxToken; + public openParenToken: ISyntaxToken; + public stringLiteral: ISyntaxToken; + public closeParenToken: ISyntaxToken; + constructor(requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isModuleReference(): boolean; + public update(requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken): ExternalModuleReferenceSyntax; + static create1(stringLiteral: ISyntaxToken): ExternalModuleReferenceSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ExternalModuleReferenceSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ExternalModuleReferenceSyntax; + public withRequireKeyword(requireKeyword: ISyntaxToken): ExternalModuleReferenceSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): ExternalModuleReferenceSyntax; + public withStringLiteral(stringLiteral: ISyntaxToken): ExternalModuleReferenceSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): ExternalModuleReferenceSyntax; + public isTypeScriptSpecific(): boolean; + } + class ModuleNameModuleReferenceSyntax extends SyntaxNode implements IModuleReferenceSyntax { + public moduleName: INameSyntax; + constructor(moduleName: INameSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isModuleReference(): boolean; + public update(moduleName: INameSyntax): ModuleNameModuleReferenceSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ModuleNameModuleReferenceSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ModuleNameModuleReferenceSyntax; + public withModuleName(moduleName: INameSyntax): ModuleNameModuleReferenceSyntax; + public isTypeScriptSpecific(): boolean; + } + class ImportDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { + public modifiers: ISyntaxList; + public importKeyword: ISyntaxToken; + public identifier: ISyntaxToken; + public equalsToken: ISyntaxToken; + public moduleReference: IModuleReferenceSyntax; + public semicolonToken: ISyntaxToken; + constructor(modifiers: ISyntaxList, importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isModuleElement(): boolean; + public update(modifiers: ISyntaxList, importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken): ImportDeclarationSyntax; + static create(importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken): ImportDeclarationSyntax; + static create1(identifier: ISyntaxToken, moduleReference: IModuleReferenceSyntax): ImportDeclarationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ImportDeclarationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ImportDeclarationSyntax; + public withModifiers(modifiers: ISyntaxList): ImportDeclarationSyntax; + public withModifier(modifier: ISyntaxToken): ImportDeclarationSyntax; + public withImportKeyword(importKeyword: ISyntaxToken): ImportDeclarationSyntax; + public withIdentifier(identifier: ISyntaxToken): ImportDeclarationSyntax; + public withEqualsToken(equalsToken: ISyntaxToken): ImportDeclarationSyntax; + public withModuleReference(moduleReference: IModuleReferenceSyntax): ImportDeclarationSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): ImportDeclarationSyntax; + public isTypeScriptSpecific(): boolean; + } + class ExportAssignmentSyntax extends SyntaxNode implements IModuleElementSyntax { + public exportKeyword: ISyntaxToken; + public equalsToken: ISyntaxToken; + public identifier: ISyntaxToken; + public semicolonToken: ISyntaxToken; + constructor(exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isModuleElement(): boolean; + public update(exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ExportAssignmentSyntax; + static create1(identifier: ISyntaxToken): ExportAssignmentSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ExportAssignmentSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ExportAssignmentSyntax; + public withExportKeyword(exportKeyword: ISyntaxToken): ExportAssignmentSyntax; + public withEqualsToken(equalsToken: ISyntaxToken): ExportAssignmentSyntax; + public withIdentifier(identifier: ISyntaxToken): ExportAssignmentSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): ExportAssignmentSyntax; + public isTypeScriptSpecific(): boolean; + } + class ClassDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { + public modifiers: ISyntaxList; + public classKeyword: ISyntaxToken; + public identifier: ISyntaxToken; + public typeParameterList: TypeParameterListSyntax; + public heritageClauses: ISyntaxList; + public openBraceToken: ISyntaxToken; + public classElements: ISyntaxList; + public closeBraceToken: ISyntaxToken; + constructor(modifiers: ISyntaxList, classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: ISyntaxList, openBraceToken: ISyntaxToken, classElements: ISyntaxList, closeBraceToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isModuleElement(): boolean; + public update(modifiers: ISyntaxList, classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: ISyntaxList, openBraceToken: ISyntaxToken, classElements: ISyntaxList, closeBraceToken: ISyntaxToken): ClassDeclarationSyntax; + static create(classKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, closeBraceToken: ISyntaxToken): ClassDeclarationSyntax; + static create1(identifier: ISyntaxToken): ClassDeclarationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ClassDeclarationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ClassDeclarationSyntax; + public withModifiers(modifiers: ISyntaxList): ClassDeclarationSyntax; + public withModifier(modifier: ISyntaxToken): ClassDeclarationSyntax; + public withClassKeyword(classKeyword: ISyntaxToken): ClassDeclarationSyntax; + public withIdentifier(identifier: ISyntaxToken): ClassDeclarationSyntax; + public withTypeParameterList(typeParameterList: TypeParameterListSyntax): ClassDeclarationSyntax; + public withHeritageClauses(heritageClauses: ISyntaxList): ClassDeclarationSyntax; + public withHeritageClause(heritageClause: HeritageClauseSyntax): ClassDeclarationSyntax; + public withOpenBraceToken(openBraceToken: ISyntaxToken): ClassDeclarationSyntax; + public withClassElements(classElements: ISyntaxList): ClassDeclarationSyntax; + public withClassElement(classElement: IClassElementSyntax): ClassDeclarationSyntax; + public withCloseBraceToken(closeBraceToken: ISyntaxToken): ClassDeclarationSyntax; + public isTypeScriptSpecific(): boolean; + } + class InterfaceDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { + public modifiers: ISyntaxList; + public interfaceKeyword: ISyntaxToken; + public identifier: ISyntaxToken; + public typeParameterList: TypeParameterListSyntax; + public heritageClauses: ISyntaxList; + public body: ObjectTypeSyntax; + constructor(modifiers: ISyntaxList, interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: ISyntaxList, body: ObjectTypeSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isModuleElement(): boolean; + public update(modifiers: ISyntaxList, interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: ISyntaxList, body: ObjectTypeSyntax): InterfaceDeclarationSyntax; + static create(interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, body: ObjectTypeSyntax): InterfaceDeclarationSyntax; + static create1(identifier: ISyntaxToken): InterfaceDeclarationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): InterfaceDeclarationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): InterfaceDeclarationSyntax; + public withModifiers(modifiers: ISyntaxList): InterfaceDeclarationSyntax; + public withModifier(modifier: ISyntaxToken): InterfaceDeclarationSyntax; + public withInterfaceKeyword(interfaceKeyword: ISyntaxToken): InterfaceDeclarationSyntax; + public withIdentifier(identifier: ISyntaxToken): InterfaceDeclarationSyntax; + public withTypeParameterList(typeParameterList: TypeParameterListSyntax): InterfaceDeclarationSyntax; + public withHeritageClauses(heritageClauses: ISyntaxList): InterfaceDeclarationSyntax; + public withHeritageClause(heritageClause: HeritageClauseSyntax): InterfaceDeclarationSyntax; + public withBody(body: ObjectTypeSyntax): InterfaceDeclarationSyntax; + public isTypeScriptSpecific(): boolean; + } + class HeritageClauseSyntax extends SyntaxNode { + public extendsOrImplementsKeyword: ISyntaxToken; + public typeNames: ISeparatedSyntaxList; + private _kind; + constructor(kind: SyntaxKind, extendsOrImplementsKeyword: ISyntaxToken, typeNames: ISeparatedSyntaxList, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public kind(): SyntaxKind; + public update(kind: SyntaxKind, extendsOrImplementsKeyword: ISyntaxToken, typeNames: ISeparatedSyntaxList): HeritageClauseSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): HeritageClauseSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): HeritageClauseSyntax; + public withKind(kind: SyntaxKind): HeritageClauseSyntax; + public withExtendsOrImplementsKeyword(extendsOrImplementsKeyword: ISyntaxToken): HeritageClauseSyntax; + public withTypeNames(typeNames: ISeparatedSyntaxList): HeritageClauseSyntax; + public withTypeName(typeName: INameSyntax): HeritageClauseSyntax; + public isTypeScriptSpecific(): boolean; + } + class ModuleDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { + public modifiers: ISyntaxList; + public moduleKeyword: ISyntaxToken; + public name: INameSyntax; + public stringLiteral: ISyntaxToken; + public openBraceToken: ISyntaxToken; + public moduleElements: ISyntaxList; + public closeBraceToken: ISyntaxToken; + constructor(modifiers: ISyntaxList, moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: ISyntaxList, closeBraceToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isModuleElement(): boolean; + public update(modifiers: ISyntaxList, moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: ISyntaxList, closeBraceToken: ISyntaxToken): ModuleDeclarationSyntax; + static create(moduleKeyword: ISyntaxToken, openBraceToken: ISyntaxToken, closeBraceToken: ISyntaxToken): ModuleDeclarationSyntax; + static create1(): ModuleDeclarationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ModuleDeclarationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ModuleDeclarationSyntax; + public withModifiers(modifiers: ISyntaxList): ModuleDeclarationSyntax; + public withModifier(modifier: ISyntaxToken): ModuleDeclarationSyntax; + public withModuleKeyword(moduleKeyword: ISyntaxToken): ModuleDeclarationSyntax; + public withName(name: INameSyntax): ModuleDeclarationSyntax; + public withStringLiteral(stringLiteral: ISyntaxToken): ModuleDeclarationSyntax; + public withOpenBraceToken(openBraceToken: ISyntaxToken): ModuleDeclarationSyntax; + public withModuleElements(moduleElements: ISyntaxList): ModuleDeclarationSyntax; + public withModuleElement(moduleElement: IModuleElementSyntax): ModuleDeclarationSyntax; + public withCloseBraceToken(closeBraceToken: ISyntaxToken): ModuleDeclarationSyntax; + public isTypeScriptSpecific(): boolean; + } + class FunctionDeclarationSyntax extends SyntaxNode implements IStatementSyntax { + public modifiers: ISyntaxList; + public functionKeyword: ISyntaxToken; + public identifier: ISyntaxToken; + public callSignature: CallSignatureSyntax; + public block: BlockSyntax; + public semicolonToken: ISyntaxToken; + constructor(modifiers: ISyntaxList, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(modifiers: ISyntaxList, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): FunctionDeclarationSyntax; + static create(functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax): FunctionDeclarationSyntax; + static create1(identifier: ISyntaxToken): FunctionDeclarationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): FunctionDeclarationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): FunctionDeclarationSyntax; + public withModifiers(modifiers: ISyntaxList): FunctionDeclarationSyntax; + public withModifier(modifier: ISyntaxToken): FunctionDeclarationSyntax; + public withFunctionKeyword(functionKeyword: ISyntaxToken): FunctionDeclarationSyntax; + public withIdentifier(identifier: ISyntaxToken): FunctionDeclarationSyntax; + public withCallSignature(callSignature: CallSignatureSyntax): FunctionDeclarationSyntax; + public withBlock(block: BlockSyntax): FunctionDeclarationSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): FunctionDeclarationSyntax; + public isTypeScriptSpecific(): boolean; + } + class VariableStatementSyntax extends SyntaxNode implements IStatementSyntax { + public modifiers: ISyntaxList; + public variableDeclaration: VariableDeclarationSyntax; + public semicolonToken: ISyntaxToken; + constructor(modifiers: ISyntaxList, variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(modifiers: ISyntaxList, variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken): VariableStatementSyntax; + static create(variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken): VariableStatementSyntax; + static create1(variableDeclaration: VariableDeclarationSyntax): VariableStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): VariableStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): VariableStatementSyntax; + public withModifiers(modifiers: ISyntaxList): VariableStatementSyntax; + public withModifier(modifier: ISyntaxToken): VariableStatementSyntax; + public withVariableDeclaration(variableDeclaration: VariableDeclarationSyntax): VariableStatementSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): VariableStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class VariableDeclarationSyntax extends SyntaxNode { + public varKeyword: ISyntaxToken; + public variableDeclarators: ISeparatedSyntaxList; + constructor(varKeyword: ISyntaxToken, variableDeclarators: ISeparatedSyntaxList, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(varKeyword: ISyntaxToken, variableDeclarators: ISeparatedSyntaxList): VariableDeclarationSyntax; + static create1(variableDeclarators: ISeparatedSyntaxList): VariableDeclarationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): VariableDeclarationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): VariableDeclarationSyntax; + public withVarKeyword(varKeyword: ISyntaxToken): VariableDeclarationSyntax; + public withVariableDeclarators(variableDeclarators: ISeparatedSyntaxList): VariableDeclarationSyntax; + public withVariableDeclarator(variableDeclarator: VariableDeclaratorSyntax): VariableDeclarationSyntax; + public isTypeScriptSpecific(): boolean; + } + class VariableDeclaratorSyntax extends SyntaxNode { + public propertyName: ISyntaxToken; + public typeAnnotation: TypeAnnotationSyntax; + public equalsValueClause: EqualsValueClauseSyntax; + constructor(propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): VariableDeclaratorSyntax; + static create(propertyName: ISyntaxToken): VariableDeclaratorSyntax; + static create1(propertyName: ISyntaxToken): VariableDeclaratorSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): VariableDeclaratorSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): VariableDeclaratorSyntax; + public withPropertyName(propertyName: ISyntaxToken): VariableDeclaratorSyntax; + public withTypeAnnotation(typeAnnotation: TypeAnnotationSyntax): VariableDeclaratorSyntax; + public withEqualsValueClause(equalsValueClause: EqualsValueClauseSyntax): VariableDeclaratorSyntax; + public isTypeScriptSpecific(): boolean; + } + class EqualsValueClauseSyntax extends SyntaxNode { + public equalsToken: ISyntaxToken; + public value: IExpressionSyntax; + constructor(equalsToken: ISyntaxToken, value: IExpressionSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(equalsToken: ISyntaxToken, value: IExpressionSyntax): EqualsValueClauseSyntax; + static create1(value: IExpressionSyntax): EqualsValueClauseSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): EqualsValueClauseSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): EqualsValueClauseSyntax; + public withEqualsToken(equalsToken: ISyntaxToken): EqualsValueClauseSyntax; + public withValue(value: IExpressionSyntax): EqualsValueClauseSyntax; + public isTypeScriptSpecific(): boolean; + } + class PrefixUnaryExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { + public operatorToken: ISyntaxToken; + public operand: IUnaryExpressionSyntax; + private _kind; + constructor(kind: SyntaxKind, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public kind(): SyntaxKind; + public update(kind: SyntaxKind, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax): PrefixUnaryExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): PrefixUnaryExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): PrefixUnaryExpressionSyntax; + public withKind(kind: SyntaxKind): PrefixUnaryExpressionSyntax; + public withOperatorToken(operatorToken: ISyntaxToken): PrefixUnaryExpressionSyntax; + public withOperand(operand: IUnaryExpressionSyntax): PrefixUnaryExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class ArrayLiteralExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { + public openBracketToken: ISyntaxToken; + public expressions: ISeparatedSyntaxList; + public closeBracketToken: ISyntaxToken; + constructor(openBracketToken: ISyntaxToken, expressions: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(openBracketToken: ISyntaxToken, expressions: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax; + static create(openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax; + static create1(): ArrayLiteralExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ArrayLiteralExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ArrayLiteralExpressionSyntax; + public withOpenBracketToken(openBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax; + public withExpressions(expressions: ISeparatedSyntaxList): ArrayLiteralExpressionSyntax; + public withExpression(expression: IExpressionSyntax): ArrayLiteralExpressionSyntax; + public withCloseBracketToken(closeBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class OmittedExpressionSyntax extends SyntaxNode implements IExpressionSyntax { + constructor(parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isExpression(): boolean; + public update(): OmittedExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): OmittedExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): OmittedExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class ParenthesizedExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { + public openParenToken: ISyntaxToken; + public expression: IExpressionSyntax; + public closeParenToken: ISyntaxToken; + constructor(openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken): ParenthesizedExpressionSyntax; + static create1(expression: IExpressionSyntax): ParenthesizedExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ParenthesizedExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ParenthesizedExpressionSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): ParenthesizedExpressionSyntax; + public withExpression(expression: IExpressionSyntax): ParenthesizedExpressionSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): ParenthesizedExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class SimpleArrowFunctionExpressionSyntax extends SyntaxNode implements IArrowFunctionExpressionSyntax { + public identifier: ISyntaxToken; + public equalsGreaterThanToken: ISyntaxToken; + public block: BlockSyntax; + public expression: IExpressionSyntax; + constructor(identifier: ISyntaxToken, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isArrowFunctionExpression(): boolean; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(identifier: ISyntaxToken, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): SimpleArrowFunctionExpressionSyntax; + static create(identifier: ISyntaxToken, equalsGreaterThanToken: ISyntaxToken): SimpleArrowFunctionExpressionSyntax; + static create1(identifier: ISyntaxToken): SimpleArrowFunctionExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): SimpleArrowFunctionExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): SimpleArrowFunctionExpressionSyntax; + public withIdentifier(identifier: ISyntaxToken): SimpleArrowFunctionExpressionSyntax; + public withEqualsGreaterThanToken(equalsGreaterThanToken: ISyntaxToken): SimpleArrowFunctionExpressionSyntax; + public withBlock(block: BlockSyntax): SimpleArrowFunctionExpressionSyntax; + public withExpression(expression: IExpressionSyntax): SimpleArrowFunctionExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class ParenthesizedArrowFunctionExpressionSyntax extends SyntaxNode implements IArrowFunctionExpressionSyntax { + public callSignature: CallSignatureSyntax; + public equalsGreaterThanToken: ISyntaxToken; + public block: BlockSyntax; + public expression: IExpressionSyntax; + constructor(callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isArrowFunctionExpression(): boolean; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): ParenthesizedArrowFunctionExpressionSyntax; + static create(callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken): ParenthesizedArrowFunctionExpressionSyntax; + static create1(): ParenthesizedArrowFunctionExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ParenthesizedArrowFunctionExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ParenthesizedArrowFunctionExpressionSyntax; + public withCallSignature(callSignature: CallSignatureSyntax): ParenthesizedArrowFunctionExpressionSyntax; + public withEqualsGreaterThanToken(equalsGreaterThanToken: ISyntaxToken): ParenthesizedArrowFunctionExpressionSyntax; + public withBlock(block: BlockSyntax): ParenthesizedArrowFunctionExpressionSyntax; + public withExpression(expression: IExpressionSyntax): ParenthesizedArrowFunctionExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class QualifiedNameSyntax extends SyntaxNode implements INameSyntax { + public left: INameSyntax; + public dotToken: ISyntaxToken; + public right: ISyntaxToken; + constructor(left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isName(): boolean; + public isType(): boolean; + public update(left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken): QualifiedNameSyntax; + static create1(left: INameSyntax, right: ISyntaxToken): QualifiedNameSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): QualifiedNameSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): QualifiedNameSyntax; + public withLeft(left: INameSyntax): QualifiedNameSyntax; + public withDotToken(dotToken: ISyntaxToken): QualifiedNameSyntax; + public withRight(right: ISyntaxToken): QualifiedNameSyntax; + public isTypeScriptSpecific(): boolean; + } + class TypeArgumentListSyntax extends SyntaxNode { + public lessThanToken: ISyntaxToken; + public typeArguments: ISeparatedSyntaxList; + public greaterThanToken: ISyntaxToken; + constructor(lessThanToken: ISyntaxToken, typeArguments: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(lessThanToken: ISyntaxToken, typeArguments: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeArgumentListSyntax; + static create(lessThanToken: ISyntaxToken, greaterThanToken: ISyntaxToken): TypeArgumentListSyntax; + static create1(): TypeArgumentListSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): TypeArgumentListSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): TypeArgumentListSyntax; + public withLessThanToken(lessThanToken: ISyntaxToken): TypeArgumentListSyntax; + public withTypeArguments(typeArguments: ISeparatedSyntaxList): TypeArgumentListSyntax; + public withTypeArgument(typeArgument: ITypeSyntax): TypeArgumentListSyntax; + public withGreaterThanToken(greaterThanToken: ISyntaxToken): TypeArgumentListSyntax; + public isTypeScriptSpecific(): boolean; + } + class ConstructorTypeSyntax extends SyntaxNode implements ITypeSyntax { + public newKeyword: ISyntaxToken; + public typeParameterList: TypeParameterListSyntax; + public parameterList: ParameterListSyntax; + public equalsGreaterThanToken: ISyntaxToken; + public type: ITypeSyntax; + constructor(newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isType(): boolean; + public update(newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): ConstructorTypeSyntax; + static create(newKeyword: ISyntaxToken, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): ConstructorTypeSyntax; + static create1(type: ITypeSyntax): ConstructorTypeSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ConstructorTypeSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ConstructorTypeSyntax; + public withNewKeyword(newKeyword: ISyntaxToken): ConstructorTypeSyntax; + public withTypeParameterList(typeParameterList: TypeParameterListSyntax): ConstructorTypeSyntax; + public withParameterList(parameterList: ParameterListSyntax): ConstructorTypeSyntax; + public withEqualsGreaterThanToken(equalsGreaterThanToken: ISyntaxToken): ConstructorTypeSyntax; + public withType(type: ITypeSyntax): ConstructorTypeSyntax; + public isTypeScriptSpecific(): boolean; + } + class FunctionTypeSyntax extends SyntaxNode implements ITypeSyntax { + public typeParameterList: TypeParameterListSyntax; + public parameterList: ParameterListSyntax; + public equalsGreaterThanToken: ISyntaxToken; + public type: ITypeSyntax; + constructor(typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isType(): boolean; + public update(typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): FunctionTypeSyntax; + static create(parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): FunctionTypeSyntax; + static create1(type: ITypeSyntax): FunctionTypeSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): FunctionTypeSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): FunctionTypeSyntax; + public withTypeParameterList(typeParameterList: TypeParameterListSyntax): FunctionTypeSyntax; + public withParameterList(parameterList: ParameterListSyntax): FunctionTypeSyntax; + public withEqualsGreaterThanToken(equalsGreaterThanToken: ISyntaxToken): FunctionTypeSyntax; + public withType(type: ITypeSyntax): FunctionTypeSyntax; + public isTypeScriptSpecific(): boolean; + } + class ObjectTypeSyntax extends SyntaxNode implements ITypeSyntax { + public openBraceToken: ISyntaxToken; + public typeMembers: ISeparatedSyntaxList; + public closeBraceToken: ISyntaxToken; + constructor(openBraceToken: ISyntaxToken, typeMembers: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isType(): boolean; + public update(openBraceToken: ISyntaxToken, typeMembers: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectTypeSyntax; + static create(openBraceToken: ISyntaxToken, closeBraceToken: ISyntaxToken): ObjectTypeSyntax; + static create1(): ObjectTypeSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ObjectTypeSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ObjectTypeSyntax; + public withOpenBraceToken(openBraceToken: ISyntaxToken): ObjectTypeSyntax; + public withTypeMembers(typeMembers: ISeparatedSyntaxList): ObjectTypeSyntax; + public withTypeMember(typeMember: ITypeMemberSyntax): ObjectTypeSyntax; + public withCloseBraceToken(closeBraceToken: ISyntaxToken): ObjectTypeSyntax; + public isTypeScriptSpecific(): boolean; + } + class ArrayTypeSyntax extends SyntaxNode implements ITypeSyntax { + public type: ITypeSyntax; + public openBracketToken: ISyntaxToken; + public closeBracketToken: ISyntaxToken; + constructor(type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isType(): boolean; + public update(type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken): ArrayTypeSyntax; + static create1(type: ITypeSyntax): ArrayTypeSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ArrayTypeSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ArrayTypeSyntax; + public withType(type: ITypeSyntax): ArrayTypeSyntax; + public withOpenBracketToken(openBracketToken: ISyntaxToken): ArrayTypeSyntax; + public withCloseBracketToken(closeBracketToken: ISyntaxToken): ArrayTypeSyntax; + public isTypeScriptSpecific(): boolean; + } + class GenericTypeSyntax extends SyntaxNode implements ITypeSyntax { + public name: INameSyntax; + public typeArgumentList: TypeArgumentListSyntax; + constructor(name: INameSyntax, typeArgumentList: TypeArgumentListSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isType(): boolean; + public update(name: INameSyntax, typeArgumentList: TypeArgumentListSyntax): GenericTypeSyntax; + static create1(name: INameSyntax): GenericTypeSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): GenericTypeSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): GenericTypeSyntax; + public withName(name: INameSyntax): GenericTypeSyntax; + public withTypeArgumentList(typeArgumentList: TypeArgumentListSyntax): GenericTypeSyntax; + public isTypeScriptSpecific(): boolean; + } + class TypeQuerySyntax extends SyntaxNode implements ITypeSyntax { + public typeOfKeyword: ISyntaxToken; + public name: INameSyntax; + constructor(typeOfKeyword: ISyntaxToken, name: INameSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isType(): boolean; + public update(typeOfKeyword: ISyntaxToken, name: INameSyntax): TypeQuerySyntax; + static create1(name: INameSyntax): TypeQuerySyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): TypeQuerySyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): TypeQuerySyntax; + public withTypeOfKeyword(typeOfKeyword: ISyntaxToken): TypeQuerySyntax; + public withName(name: INameSyntax): TypeQuerySyntax; + public isTypeScriptSpecific(): boolean; + } + class TypeAnnotationSyntax extends SyntaxNode { + public colonToken: ISyntaxToken; + public type: ITypeSyntax; + constructor(colonToken: ISyntaxToken, type: ITypeSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(colonToken: ISyntaxToken, type: ITypeSyntax): TypeAnnotationSyntax; + static create1(type: ITypeSyntax): TypeAnnotationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): TypeAnnotationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): TypeAnnotationSyntax; + public withColonToken(colonToken: ISyntaxToken): TypeAnnotationSyntax; + public withType(type: ITypeSyntax): TypeAnnotationSyntax; + public isTypeScriptSpecific(): boolean; + } + class BlockSyntax extends SyntaxNode implements IStatementSyntax { + public openBraceToken: ISyntaxToken; + public statements: ISyntaxList; + public closeBraceToken: ISyntaxToken; + constructor(openBraceToken: ISyntaxToken, statements: ISyntaxList, closeBraceToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(openBraceToken: ISyntaxToken, statements: ISyntaxList, closeBraceToken: ISyntaxToken): BlockSyntax; + static create(openBraceToken: ISyntaxToken, closeBraceToken: ISyntaxToken): BlockSyntax; + static create1(): BlockSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): BlockSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): BlockSyntax; + public withOpenBraceToken(openBraceToken: ISyntaxToken): BlockSyntax; + public withStatements(statements: ISyntaxList): BlockSyntax; + public withStatement(statement: IStatementSyntax): BlockSyntax; + public withCloseBraceToken(closeBraceToken: ISyntaxToken): BlockSyntax; + public isTypeScriptSpecific(): boolean; + } + class ParameterSyntax extends SyntaxNode { + public dotDotDotToken: ISyntaxToken; + public modifiers: ISyntaxList; + public identifier: ISyntaxToken; + public questionToken: ISyntaxToken; + public typeAnnotation: TypeAnnotationSyntax; + public equalsValueClause: EqualsValueClauseSyntax; + constructor(dotDotDotToken: ISyntaxToken, modifiers: ISyntaxList, identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(dotDotDotToken: ISyntaxToken, modifiers: ISyntaxList, identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): ParameterSyntax; + static create(identifier: ISyntaxToken): ParameterSyntax; + static create1(identifier: ISyntaxToken): ParameterSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ParameterSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ParameterSyntax; + public withDotDotDotToken(dotDotDotToken: ISyntaxToken): ParameterSyntax; + public withModifiers(modifiers: ISyntaxList): ParameterSyntax; + public withModifier(modifier: ISyntaxToken): ParameterSyntax; + public withIdentifier(identifier: ISyntaxToken): ParameterSyntax; + public withQuestionToken(questionToken: ISyntaxToken): ParameterSyntax; + public withTypeAnnotation(typeAnnotation: TypeAnnotationSyntax): ParameterSyntax; + public withEqualsValueClause(equalsValueClause: EqualsValueClauseSyntax): ParameterSyntax; + public isTypeScriptSpecific(): boolean; + } + class MemberAccessExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax { + public expression: IExpressionSyntax; + public dotToken: ISyntaxToken; + public name: ISyntaxToken; + constructor(expression: IExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(expression: IExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken): MemberAccessExpressionSyntax; + static create1(expression: IExpressionSyntax, name: ISyntaxToken): MemberAccessExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): MemberAccessExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): MemberAccessExpressionSyntax; + public withExpression(expression: IExpressionSyntax): MemberAccessExpressionSyntax; + public withDotToken(dotToken: ISyntaxToken): MemberAccessExpressionSyntax; + public withName(name: ISyntaxToken): MemberAccessExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class PostfixUnaryExpressionSyntax extends SyntaxNode implements IPostfixExpressionSyntax { + public operand: IMemberExpressionSyntax; + public operatorToken: ISyntaxToken; + private _kind; + constructor(kind: SyntaxKind, operand: IMemberExpressionSyntax, operatorToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public kind(): SyntaxKind; + public update(kind: SyntaxKind, operand: IMemberExpressionSyntax, operatorToken: ISyntaxToken): PostfixUnaryExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): PostfixUnaryExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): PostfixUnaryExpressionSyntax; + public withKind(kind: SyntaxKind): PostfixUnaryExpressionSyntax; + public withOperand(operand: IMemberExpressionSyntax): PostfixUnaryExpressionSyntax; + public withOperatorToken(operatorToken: ISyntaxToken): PostfixUnaryExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class ElementAccessExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax { + public expression: IExpressionSyntax; + public openBracketToken: ISyntaxToken; + public argumentExpression: IExpressionSyntax; + public closeBracketToken: ISyntaxToken; + constructor(expression: IExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(expression: IExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ElementAccessExpressionSyntax; + static create1(expression: IExpressionSyntax, argumentExpression: IExpressionSyntax): ElementAccessExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ElementAccessExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ElementAccessExpressionSyntax; + public withExpression(expression: IExpressionSyntax): ElementAccessExpressionSyntax; + public withOpenBracketToken(openBracketToken: ISyntaxToken): ElementAccessExpressionSyntax; + public withArgumentExpression(argumentExpression: IExpressionSyntax): ElementAccessExpressionSyntax; + public withCloseBracketToken(closeBracketToken: ISyntaxToken): ElementAccessExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class InvocationExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax { + public expression: IMemberExpressionSyntax; + public argumentList: ArgumentListSyntax; + constructor(expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): InvocationExpressionSyntax; + static create1(expression: IMemberExpressionSyntax): InvocationExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): InvocationExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): InvocationExpressionSyntax; + public withExpression(expression: IMemberExpressionSyntax): InvocationExpressionSyntax; + public withArgumentList(argumentList: ArgumentListSyntax): InvocationExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class ArgumentListSyntax extends SyntaxNode { + public typeArgumentList: TypeArgumentListSyntax; + public openParenToken: ISyntaxToken; + public closeParenToken: ISyntaxToken; + public arguments: ISeparatedSyntaxList; + constructor(typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: ISeparatedSyntaxList, closeParenToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ArgumentListSyntax; + static create(openParenToken: ISyntaxToken, closeParenToken: ISyntaxToken): ArgumentListSyntax; + static create1(): ArgumentListSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ArgumentListSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ArgumentListSyntax; + public withTypeArgumentList(typeArgumentList: TypeArgumentListSyntax): ArgumentListSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): ArgumentListSyntax; + public withArguments(_arguments: ISeparatedSyntaxList): ArgumentListSyntax; + public withArgument(_argument: IExpressionSyntax): ArgumentListSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): ArgumentListSyntax; + public isTypeScriptSpecific(): boolean; + } + class BinaryExpressionSyntax extends SyntaxNode implements IExpressionSyntax { + public left: IExpressionSyntax; + public operatorToken: ISyntaxToken; + public right: IExpressionSyntax; + private _kind; + constructor(kind: SyntaxKind, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isExpression(): boolean; + public kind(): SyntaxKind; + public update(kind: SyntaxKind, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax): BinaryExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): BinaryExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): BinaryExpressionSyntax; + public withKind(kind: SyntaxKind): BinaryExpressionSyntax; + public withLeft(left: IExpressionSyntax): BinaryExpressionSyntax; + public withOperatorToken(operatorToken: ISyntaxToken): BinaryExpressionSyntax; + public withRight(right: IExpressionSyntax): BinaryExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class ConditionalExpressionSyntax extends SyntaxNode implements IExpressionSyntax { + public condition: IExpressionSyntax; + public questionToken: ISyntaxToken; + public whenTrue: IExpressionSyntax; + public colonToken: ISyntaxToken; + public whenFalse: IExpressionSyntax; + constructor(condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isExpression(): boolean; + public update(condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax): ConditionalExpressionSyntax; + static create1(condition: IExpressionSyntax, whenTrue: IExpressionSyntax, whenFalse: IExpressionSyntax): ConditionalExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ConditionalExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ConditionalExpressionSyntax; + public withCondition(condition: IExpressionSyntax): ConditionalExpressionSyntax; + public withQuestionToken(questionToken: ISyntaxToken): ConditionalExpressionSyntax; + public withWhenTrue(whenTrue: IExpressionSyntax): ConditionalExpressionSyntax; + public withColonToken(colonToken: ISyntaxToken): ConditionalExpressionSyntax; + public withWhenFalse(whenFalse: IExpressionSyntax): ConditionalExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class ConstructSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { + public newKeyword: ISyntaxToken; + public callSignature: CallSignatureSyntax; + constructor(newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isTypeMember(): boolean; + public update(newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax): ConstructSignatureSyntax; + static create1(): ConstructSignatureSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ConstructSignatureSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ConstructSignatureSyntax; + public withNewKeyword(newKeyword: ISyntaxToken): ConstructSignatureSyntax; + public withCallSignature(callSignature: CallSignatureSyntax): ConstructSignatureSyntax; + public isTypeScriptSpecific(): boolean; + } + class MethodSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { + public propertyName: ISyntaxToken; + public questionToken: ISyntaxToken; + public callSignature: CallSignatureSyntax; + constructor(propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isTypeMember(): boolean; + public update(propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax; + static create(propertyName: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax; + static create1(propertyName: ISyntaxToken): MethodSignatureSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): MethodSignatureSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): MethodSignatureSyntax; + public withPropertyName(propertyName: ISyntaxToken): MethodSignatureSyntax; + public withQuestionToken(questionToken: ISyntaxToken): MethodSignatureSyntax; + public withCallSignature(callSignature: CallSignatureSyntax): MethodSignatureSyntax; + public isTypeScriptSpecific(): boolean; + } + class IndexSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { + public openBracketToken: ISyntaxToken; + public parameter: ParameterSyntax; + public closeBracketToken: ISyntaxToken; + public typeAnnotation: TypeAnnotationSyntax; + constructor(openBracketToken: ISyntaxToken, parameter: ParameterSyntax, closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isTypeMember(): boolean; + public update(openBracketToken: ISyntaxToken, parameter: ParameterSyntax, closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): IndexSignatureSyntax; + static create(openBracketToken: ISyntaxToken, parameter: ParameterSyntax, closeBracketToken: ISyntaxToken): IndexSignatureSyntax; + static create1(parameter: ParameterSyntax): IndexSignatureSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): IndexSignatureSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): IndexSignatureSyntax; + public withOpenBracketToken(openBracketToken: ISyntaxToken): IndexSignatureSyntax; + public withParameter(parameter: ParameterSyntax): IndexSignatureSyntax; + public withCloseBracketToken(closeBracketToken: ISyntaxToken): IndexSignatureSyntax; + public withTypeAnnotation(typeAnnotation: TypeAnnotationSyntax): IndexSignatureSyntax; + public isTypeScriptSpecific(): boolean; + } + class PropertySignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { + public propertyName: ISyntaxToken; + public questionToken: ISyntaxToken; + public typeAnnotation: TypeAnnotationSyntax; + constructor(propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isTypeMember(): boolean; + public update(propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): PropertySignatureSyntax; + static create(propertyName: ISyntaxToken): PropertySignatureSyntax; + static create1(propertyName: ISyntaxToken): PropertySignatureSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): PropertySignatureSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): PropertySignatureSyntax; + public withPropertyName(propertyName: ISyntaxToken): PropertySignatureSyntax; + public withQuestionToken(questionToken: ISyntaxToken): PropertySignatureSyntax; + public withTypeAnnotation(typeAnnotation: TypeAnnotationSyntax): PropertySignatureSyntax; + public isTypeScriptSpecific(): boolean; + } + class CallSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { + public typeParameterList: TypeParameterListSyntax; + public parameterList: ParameterListSyntax; + public typeAnnotation: TypeAnnotationSyntax; + constructor(typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isTypeMember(): boolean; + public update(typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax): CallSignatureSyntax; + static create(parameterList: ParameterListSyntax): CallSignatureSyntax; + static create1(): CallSignatureSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): CallSignatureSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): CallSignatureSyntax; + public withTypeParameterList(typeParameterList: TypeParameterListSyntax): CallSignatureSyntax; + public withParameterList(parameterList: ParameterListSyntax): CallSignatureSyntax; + public withTypeAnnotation(typeAnnotation: TypeAnnotationSyntax): CallSignatureSyntax; + public isTypeScriptSpecific(): boolean; + } + class ParameterListSyntax extends SyntaxNode { + public openParenToken: ISyntaxToken; + public parameters: ISeparatedSyntaxList; + public closeParenToken: ISyntaxToken; + constructor(openParenToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeParenToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(openParenToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ParameterListSyntax; + static create(openParenToken: ISyntaxToken, closeParenToken: ISyntaxToken): ParameterListSyntax; + static create1(): ParameterListSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ParameterListSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ParameterListSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): ParameterListSyntax; + public withParameters(parameters: ISeparatedSyntaxList): ParameterListSyntax; + public withParameter(parameter: ParameterSyntax): ParameterListSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): ParameterListSyntax; + public isTypeScriptSpecific(): boolean; + } + class TypeParameterListSyntax extends SyntaxNode { + public lessThanToken: ISyntaxToken; + public typeParameters: ISeparatedSyntaxList; + public greaterThanToken: ISyntaxToken; + constructor(lessThanToken: ISyntaxToken, typeParameters: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(lessThanToken: ISyntaxToken, typeParameters: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeParameterListSyntax; + static create(lessThanToken: ISyntaxToken, greaterThanToken: ISyntaxToken): TypeParameterListSyntax; + static create1(): TypeParameterListSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): TypeParameterListSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): TypeParameterListSyntax; + public withLessThanToken(lessThanToken: ISyntaxToken): TypeParameterListSyntax; + public withTypeParameters(typeParameters: ISeparatedSyntaxList): TypeParameterListSyntax; + public withTypeParameter(typeParameter: TypeParameterSyntax): TypeParameterListSyntax; + public withGreaterThanToken(greaterThanToken: ISyntaxToken): TypeParameterListSyntax; + public isTypeScriptSpecific(): boolean; + } + class TypeParameterSyntax extends SyntaxNode { + public identifier: ISyntaxToken; + public constraint: ConstraintSyntax; + constructor(identifier: ISyntaxToken, constraint: ConstraintSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(identifier: ISyntaxToken, constraint: ConstraintSyntax): TypeParameterSyntax; + static create(identifier: ISyntaxToken): TypeParameterSyntax; + static create1(identifier: ISyntaxToken): TypeParameterSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): TypeParameterSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): TypeParameterSyntax; + public withIdentifier(identifier: ISyntaxToken): TypeParameterSyntax; + public withConstraint(constraint: ConstraintSyntax): TypeParameterSyntax; + public isTypeScriptSpecific(): boolean; + } + class ConstraintSyntax extends SyntaxNode { + public extendsKeyword: ISyntaxToken; + public type: ITypeSyntax; + constructor(extendsKeyword: ISyntaxToken, type: ITypeSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(extendsKeyword: ISyntaxToken, type: ITypeSyntax): ConstraintSyntax; + static create1(type: ITypeSyntax): ConstraintSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ConstraintSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ConstraintSyntax; + public withExtendsKeyword(extendsKeyword: ISyntaxToken): ConstraintSyntax; + public withType(type: ITypeSyntax): ConstraintSyntax; + public isTypeScriptSpecific(): boolean; + } + class ElseClauseSyntax extends SyntaxNode { + public elseKeyword: ISyntaxToken; + public statement: IStatementSyntax; + constructor(elseKeyword: ISyntaxToken, statement: IStatementSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(elseKeyword: ISyntaxToken, statement: IStatementSyntax): ElseClauseSyntax; + static create1(statement: IStatementSyntax): ElseClauseSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ElseClauseSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ElseClauseSyntax; + public withElseKeyword(elseKeyword: ISyntaxToken): ElseClauseSyntax; + public withStatement(statement: IStatementSyntax): ElseClauseSyntax; + public isTypeScriptSpecific(): boolean; + } + class IfStatementSyntax extends SyntaxNode implements IStatementSyntax { + public ifKeyword: ISyntaxToken; + public openParenToken: ISyntaxToken; + public condition: IExpressionSyntax; + public closeParenToken: ISyntaxToken; + public statement: IStatementSyntax; + public elseClause: ElseClauseSyntax; + constructor(ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax): IfStatementSyntax; + static create(ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): IfStatementSyntax; + static create1(condition: IExpressionSyntax, statement: IStatementSyntax): IfStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): IfStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): IfStatementSyntax; + public withIfKeyword(ifKeyword: ISyntaxToken): IfStatementSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): IfStatementSyntax; + public withCondition(condition: IExpressionSyntax): IfStatementSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): IfStatementSyntax; + public withStatement(statement: IStatementSyntax): IfStatementSyntax; + public withElseClause(elseClause: ElseClauseSyntax): IfStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class ExpressionStatementSyntax extends SyntaxNode implements IStatementSyntax { + public expression: IExpressionSyntax; + public semicolonToken: ISyntaxToken; + constructor(expression: IExpressionSyntax, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ExpressionStatementSyntax; + static create1(expression: IExpressionSyntax): ExpressionStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ExpressionStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ExpressionStatementSyntax; + public withExpression(expression: IExpressionSyntax): ExpressionStatementSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): ExpressionStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class ConstructorDeclarationSyntax extends SyntaxNode implements IClassElementSyntax { + public modifiers: ISyntaxList; + public constructorKeyword: ISyntaxToken; + public callSignature: CallSignatureSyntax; + public block: BlockSyntax; + public semicolonToken: ISyntaxToken; + constructor(modifiers: ISyntaxList, constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isClassElement(): boolean; + public update(modifiers: ISyntaxList, constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): ConstructorDeclarationSyntax; + static create(constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax): ConstructorDeclarationSyntax; + static create1(): ConstructorDeclarationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ConstructorDeclarationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ConstructorDeclarationSyntax; + public withModifiers(modifiers: ISyntaxList): ConstructorDeclarationSyntax; + public withModifier(modifier: ISyntaxToken): ConstructorDeclarationSyntax; + public withConstructorKeyword(constructorKeyword: ISyntaxToken): ConstructorDeclarationSyntax; + public withCallSignature(callSignature: CallSignatureSyntax): ConstructorDeclarationSyntax; + public withBlock(block: BlockSyntax): ConstructorDeclarationSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): ConstructorDeclarationSyntax; + public isTypeScriptSpecific(): boolean; + } + class MemberFunctionDeclarationSyntax extends SyntaxNode implements IMemberDeclarationSyntax { + public modifiers: ISyntaxList; + public propertyName: ISyntaxToken; + public callSignature: CallSignatureSyntax; + public block: BlockSyntax; + public semicolonToken: ISyntaxToken; + constructor(modifiers: ISyntaxList, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isMemberDeclaration(): boolean; + public isClassElement(): boolean; + public update(modifiers: ISyntaxList, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): MemberFunctionDeclarationSyntax; + static create(propertyName: ISyntaxToken, callSignature: CallSignatureSyntax): MemberFunctionDeclarationSyntax; + static create1(propertyName: ISyntaxToken): MemberFunctionDeclarationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): MemberFunctionDeclarationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): MemberFunctionDeclarationSyntax; + public withModifiers(modifiers: ISyntaxList): MemberFunctionDeclarationSyntax; + public withModifier(modifier: ISyntaxToken): MemberFunctionDeclarationSyntax; + public withPropertyName(propertyName: ISyntaxToken): MemberFunctionDeclarationSyntax; + public withCallSignature(callSignature: CallSignatureSyntax): MemberFunctionDeclarationSyntax; + public withBlock(block: BlockSyntax): MemberFunctionDeclarationSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): MemberFunctionDeclarationSyntax; + public isTypeScriptSpecific(): boolean; + } + class GetAccessorSyntax extends SyntaxNode implements IMemberDeclarationSyntax, IPropertyAssignmentSyntax { + public modifiers: ISyntaxList; + public getKeyword: ISyntaxToken; + public propertyName: ISyntaxToken; + public parameterList: ParameterListSyntax; + public typeAnnotation: TypeAnnotationSyntax; + public block: BlockSyntax; + constructor(modifiers: ISyntaxList, getKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax, block: BlockSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isMemberDeclaration(): boolean; + public isPropertyAssignment(): boolean; + public isClassElement(): boolean; + public update(modifiers: ISyntaxList, getKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax, block: BlockSyntax): GetAccessorSyntax; + static create(getKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, block: BlockSyntax): GetAccessorSyntax; + static create1(propertyName: ISyntaxToken): GetAccessorSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): GetAccessorSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): GetAccessorSyntax; + public withModifiers(modifiers: ISyntaxList): GetAccessorSyntax; + public withModifier(modifier: ISyntaxToken): GetAccessorSyntax; + public withGetKeyword(getKeyword: ISyntaxToken): GetAccessorSyntax; + public withPropertyName(propertyName: ISyntaxToken): GetAccessorSyntax; + public withParameterList(parameterList: ParameterListSyntax): GetAccessorSyntax; + public withTypeAnnotation(typeAnnotation: TypeAnnotationSyntax): GetAccessorSyntax; + public withBlock(block: BlockSyntax): GetAccessorSyntax; + public isTypeScriptSpecific(): boolean; + } + class SetAccessorSyntax extends SyntaxNode implements IMemberDeclarationSyntax, IPropertyAssignmentSyntax { + public modifiers: ISyntaxList; + public setKeyword: ISyntaxToken; + public propertyName: ISyntaxToken; + public parameterList: ParameterListSyntax; + public block: BlockSyntax; + constructor(modifiers: ISyntaxList, setKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, block: BlockSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isMemberDeclaration(): boolean; + public isPropertyAssignment(): boolean; + public isClassElement(): boolean; + public update(modifiers: ISyntaxList, setKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, block: BlockSyntax): SetAccessorSyntax; + static create(setKeyword: ISyntaxToken, propertyName: ISyntaxToken, parameterList: ParameterListSyntax, block: BlockSyntax): SetAccessorSyntax; + static create1(propertyName: ISyntaxToken): SetAccessorSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): SetAccessorSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): SetAccessorSyntax; + public withModifiers(modifiers: ISyntaxList): SetAccessorSyntax; + public withModifier(modifier: ISyntaxToken): SetAccessorSyntax; + public withSetKeyword(setKeyword: ISyntaxToken): SetAccessorSyntax; + public withPropertyName(propertyName: ISyntaxToken): SetAccessorSyntax; + public withParameterList(parameterList: ParameterListSyntax): SetAccessorSyntax; + public withBlock(block: BlockSyntax): SetAccessorSyntax; + public isTypeScriptSpecific(): boolean; + } + class MemberVariableDeclarationSyntax extends SyntaxNode implements IMemberDeclarationSyntax { + public modifiers: ISyntaxList; + public variableDeclarator: VariableDeclaratorSyntax; + public semicolonToken: ISyntaxToken; + constructor(modifiers: ISyntaxList, variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isMemberDeclaration(): boolean; + public isClassElement(): boolean; + public update(modifiers: ISyntaxList, variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken): MemberVariableDeclarationSyntax; + static create(variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken): MemberVariableDeclarationSyntax; + static create1(variableDeclarator: VariableDeclaratorSyntax): MemberVariableDeclarationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): MemberVariableDeclarationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): MemberVariableDeclarationSyntax; + public withModifiers(modifiers: ISyntaxList): MemberVariableDeclarationSyntax; + public withModifier(modifier: ISyntaxToken): MemberVariableDeclarationSyntax; + public withVariableDeclarator(variableDeclarator: VariableDeclaratorSyntax): MemberVariableDeclarationSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): MemberVariableDeclarationSyntax; + public isTypeScriptSpecific(): boolean; + } + class IndexMemberDeclarationSyntax extends SyntaxNode implements IClassElementSyntax { + public modifiers: ISyntaxList; + public indexSignature: IndexSignatureSyntax; + public semicolonToken: ISyntaxToken; + constructor(modifiers: ISyntaxList, indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isClassElement(): boolean; + public update(modifiers: ISyntaxList, indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken): IndexMemberDeclarationSyntax; + static create(indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken): IndexMemberDeclarationSyntax; + static create1(indexSignature: IndexSignatureSyntax): IndexMemberDeclarationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): IndexMemberDeclarationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): IndexMemberDeclarationSyntax; + public withModifiers(modifiers: ISyntaxList): IndexMemberDeclarationSyntax; + public withModifier(modifier: ISyntaxToken): IndexMemberDeclarationSyntax; + public withIndexSignature(indexSignature: IndexSignatureSyntax): IndexMemberDeclarationSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): IndexMemberDeclarationSyntax; + public isTypeScriptSpecific(): boolean; + } + class ThrowStatementSyntax extends SyntaxNode implements IStatementSyntax { + public throwKeyword: ISyntaxToken; + public expression: IExpressionSyntax; + public semicolonToken: ISyntaxToken; + constructor(throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ThrowStatementSyntax; + static create1(expression: IExpressionSyntax): ThrowStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ThrowStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ThrowStatementSyntax; + public withThrowKeyword(throwKeyword: ISyntaxToken): ThrowStatementSyntax; + public withExpression(expression: IExpressionSyntax): ThrowStatementSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): ThrowStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class ReturnStatementSyntax extends SyntaxNode implements IStatementSyntax { + public returnKeyword: ISyntaxToken; + public expression: IExpressionSyntax; + public semicolonToken: ISyntaxToken; + constructor(returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ReturnStatementSyntax; + static create(returnKeyword: ISyntaxToken, semicolonToken: ISyntaxToken): ReturnStatementSyntax; + static create1(): ReturnStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ReturnStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ReturnStatementSyntax; + public withReturnKeyword(returnKeyword: ISyntaxToken): ReturnStatementSyntax; + public withExpression(expression: IExpressionSyntax): ReturnStatementSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): ReturnStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class ObjectCreationExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax { + public newKeyword: ISyntaxToken; + public expression: IMemberExpressionSyntax; + public argumentList: ArgumentListSyntax; + constructor(newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): ObjectCreationExpressionSyntax; + static create(newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax): ObjectCreationExpressionSyntax; + static create1(expression: IMemberExpressionSyntax): ObjectCreationExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ObjectCreationExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ObjectCreationExpressionSyntax; + public withNewKeyword(newKeyword: ISyntaxToken): ObjectCreationExpressionSyntax; + public withExpression(expression: IMemberExpressionSyntax): ObjectCreationExpressionSyntax; + public withArgumentList(argumentList: ArgumentListSyntax): ObjectCreationExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class SwitchStatementSyntax extends SyntaxNode implements IStatementSyntax { + public switchKeyword: ISyntaxToken; + public openParenToken: ISyntaxToken; + public expression: IExpressionSyntax; + public closeParenToken: ISyntaxToken; + public openBraceToken: ISyntaxToken; + public switchClauses: ISyntaxList; + public closeBraceToken: ISyntaxToken; + constructor(switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISyntaxList, closeBraceToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISyntaxList, closeBraceToken: ISyntaxToken): SwitchStatementSyntax; + static create(switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, closeBraceToken: ISyntaxToken): SwitchStatementSyntax; + static create1(expression: IExpressionSyntax): SwitchStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): SwitchStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): SwitchStatementSyntax; + public withSwitchKeyword(switchKeyword: ISyntaxToken): SwitchStatementSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): SwitchStatementSyntax; + public withExpression(expression: IExpressionSyntax): SwitchStatementSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): SwitchStatementSyntax; + public withOpenBraceToken(openBraceToken: ISyntaxToken): SwitchStatementSyntax; + public withSwitchClauses(switchClauses: ISyntaxList): SwitchStatementSyntax; + public withSwitchClause(switchClause: ISwitchClauseSyntax): SwitchStatementSyntax; + public withCloseBraceToken(closeBraceToken: ISyntaxToken): SwitchStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class CaseSwitchClauseSyntax extends SyntaxNode implements ISwitchClauseSyntax { + public caseKeyword: ISyntaxToken; + public expression: IExpressionSyntax; + public colonToken: ISyntaxToken; + public statements: ISyntaxList; + constructor(caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: ISyntaxList, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isSwitchClause(): boolean; + public update(caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: ISyntaxList): CaseSwitchClauseSyntax; + static create(caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken): CaseSwitchClauseSyntax; + static create1(expression: IExpressionSyntax): CaseSwitchClauseSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): CaseSwitchClauseSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): CaseSwitchClauseSyntax; + public withCaseKeyword(caseKeyword: ISyntaxToken): CaseSwitchClauseSyntax; + public withExpression(expression: IExpressionSyntax): CaseSwitchClauseSyntax; + public withColonToken(colonToken: ISyntaxToken): CaseSwitchClauseSyntax; + public withStatements(statements: ISyntaxList): CaseSwitchClauseSyntax; + public withStatement(statement: IStatementSyntax): CaseSwitchClauseSyntax; + public isTypeScriptSpecific(): boolean; + } + class DefaultSwitchClauseSyntax extends SyntaxNode implements ISwitchClauseSyntax { + public defaultKeyword: ISyntaxToken; + public colonToken: ISyntaxToken; + public statements: ISyntaxList; + constructor(defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: ISyntaxList, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isSwitchClause(): boolean; + public update(defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: ISyntaxList): DefaultSwitchClauseSyntax; + static create(defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken): DefaultSwitchClauseSyntax; + static create1(): DefaultSwitchClauseSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): DefaultSwitchClauseSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): DefaultSwitchClauseSyntax; + public withDefaultKeyword(defaultKeyword: ISyntaxToken): DefaultSwitchClauseSyntax; + public withColonToken(colonToken: ISyntaxToken): DefaultSwitchClauseSyntax; + public withStatements(statements: ISyntaxList): DefaultSwitchClauseSyntax; + public withStatement(statement: IStatementSyntax): DefaultSwitchClauseSyntax; + public isTypeScriptSpecific(): boolean; + } + class BreakStatementSyntax extends SyntaxNode implements IStatementSyntax { + public breakKeyword: ISyntaxToken; + public identifier: ISyntaxToken; + public semicolonToken: ISyntaxToken; + constructor(breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): BreakStatementSyntax; + static create(breakKeyword: ISyntaxToken, semicolonToken: ISyntaxToken): BreakStatementSyntax; + static create1(): BreakStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): BreakStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): BreakStatementSyntax; + public withBreakKeyword(breakKeyword: ISyntaxToken): BreakStatementSyntax; + public withIdentifier(identifier: ISyntaxToken): BreakStatementSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): BreakStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class ContinueStatementSyntax extends SyntaxNode implements IStatementSyntax { + public continueKeyword: ISyntaxToken; + public identifier: ISyntaxToken; + public semicolonToken: ISyntaxToken; + constructor(continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ContinueStatementSyntax; + static create(continueKeyword: ISyntaxToken, semicolonToken: ISyntaxToken): ContinueStatementSyntax; + static create1(): ContinueStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ContinueStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ContinueStatementSyntax; + public withContinueKeyword(continueKeyword: ISyntaxToken): ContinueStatementSyntax; + public withIdentifier(identifier: ISyntaxToken): ContinueStatementSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): ContinueStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class ForStatementSyntax extends SyntaxNode implements IIterationStatementSyntax { + public forKeyword: ISyntaxToken; + public openParenToken: ISyntaxToken; + public variableDeclaration: VariableDeclarationSyntax; + public initializer: IExpressionSyntax; + public firstSemicolonToken: ISyntaxToken; + public condition: IExpressionSyntax; + public secondSemicolonToken: ISyntaxToken; + public incrementor: IExpressionSyntax; + public closeParenToken: ISyntaxToken; + public statement: IStatementSyntax; + constructor(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isIterationStatement(): boolean; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForStatementSyntax; + static create(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, firstSemicolonToken: ISyntaxToken, secondSemicolonToken: ISyntaxToken, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForStatementSyntax; + static create1(statement: IStatementSyntax): ForStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ForStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ForStatementSyntax; + public withForKeyword(forKeyword: ISyntaxToken): ForStatementSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): ForStatementSyntax; + public withVariableDeclaration(variableDeclaration: VariableDeclarationSyntax): ForStatementSyntax; + public withInitializer(initializer: IExpressionSyntax): ForStatementSyntax; + public withFirstSemicolonToken(firstSemicolonToken: ISyntaxToken): ForStatementSyntax; + public withCondition(condition: IExpressionSyntax): ForStatementSyntax; + public withSecondSemicolonToken(secondSemicolonToken: ISyntaxToken): ForStatementSyntax; + public withIncrementor(incrementor: IExpressionSyntax): ForStatementSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): ForStatementSyntax; + public withStatement(statement: IStatementSyntax): ForStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class ForInStatementSyntax extends SyntaxNode implements IIterationStatementSyntax { + public forKeyword: ISyntaxToken; + public openParenToken: ISyntaxToken; + public variableDeclaration: VariableDeclarationSyntax; + public left: IExpressionSyntax; + public inKeyword: ISyntaxToken; + public expression: IExpressionSyntax; + public closeParenToken: ISyntaxToken; + public statement: IStatementSyntax; + constructor(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isIterationStatement(): boolean; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForInStatementSyntax; + static create(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForInStatementSyntax; + static create1(expression: IExpressionSyntax, statement: IStatementSyntax): ForInStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ForInStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ForInStatementSyntax; + public withForKeyword(forKeyword: ISyntaxToken): ForInStatementSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): ForInStatementSyntax; + public withVariableDeclaration(variableDeclaration: VariableDeclarationSyntax): ForInStatementSyntax; + public withLeft(left: IExpressionSyntax): ForInStatementSyntax; + public withInKeyword(inKeyword: ISyntaxToken): ForInStatementSyntax; + public withExpression(expression: IExpressionSyntax): ForInStatementSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): ForInStatementSyntax; + public withStatement(statement: IStatementSyntax): ForInStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class WhileStatementSyntax extends SyntaxNode implements IIterationStatementSyntax { + public whileKeyword: ISyntaxToken; + public openParenToken: ISyntaxToken; + public condition: IExpressionSyntax; + public closeParenToken: ISyntaxToken; + public statement: IStatementSyntax; + constructor(whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isIterationStatement(): boolean; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WhileStatementSyntax; + static create1(condition: IExpressionSyntax, statement: IStatementSyntax): WhileStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): WhileStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): WhileStatementSyntax; + public withWhileKeyword(whileKeyword: ISyntaxToken): WhileStatementSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): WhileStatementSyntax; + public withCondition(condition: IExpressionSyntax): WhileStatementSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): WhileStatementSyntax; + public withStatement(statement: IStatementSyntax): WhileStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class WithStatementSyntax extends SyntaxNode implements IStatementSyntax { + public withKeyword: ISyntaxToken; + public openParenToken: ISyntaxToken; + public condition: IExpressionSyntax; + public closeParenToken: ISyntaxToken; + public statement: IStatementSyntax; + constructor(withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WithStatementSyntax; + static create1(condition: IExpressionSyntax, statement: IStatementSyntax): WithStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): WithStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): WithStatementSyntax; + public withWithKeyword(withKeyword: ISyntaxToken): WithStatementSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): WithStatementSyntax; + public withCondition(condition: IExpressionSyntax): WithStatementSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): WithStatementSyntax; + public withStatement(statement: IStatementSyntax): WithStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class EnumDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { + public modifiers: ISyntaxList; + public enumKeyword: ISyntaxToken; + public identifier: ISyntaxToken; + public openBraceToken: ISyntaxToken; + public enumElements: ISeparatedSyntaxList; + public closeBraceToken: ISyntaxToken; + constructor(modifiers: ISyntaxList, enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isModuleElement(): boolean; + public update(modifiers: ISyntaxList, enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): EnumDeclarationSyntax; + static create(enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, closeBraceToken: ISyntaxToken): EnumDeclarationSyntax; + static create1(identifier: ISyntaxToken): EnumDeclarationSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): EnumDeclarationSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): EnumDeclarationSyntax; + public withModifiers(modifiers: ISyntaxList): EnumDeclarationSyntax; + public withModifier(modifier: ISyntaxToken): EnumDeclarationSyntax; + public withEnumKeyword(enumKeyword: ISyntaxToken): EnumDeclarationSyntax; + public withIdentifier(identifier: ISyntaxToken): EnumDeclarationSyntax; + public withOpenBraceToken(openBraceToken: ISyntaxToken): EnumDeclarationSyntax; + public withEnumElements(enumElements: ISeparatedSyntaxList): EnumDeclarationSyntax; + public withEnumElement(enumElement: EnumElementSyntax): EnumDeclarationSyntax; + public withCloseBraceToken(closeBraceToken: ISyntaxToken): EnumDeclarationSyntax; + public isTypeScriptSpecific(): boolean; + } + class EnumElementSyntax extends SyntaxNode { + public propertyName: ISyntaxToken; + public equalsValueClause: EqualsValueClauseSyntax; + constructor(propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax): EnumElementSyntax; + static create(propertyName: ISyntaxToken): EnumElementSyntax; + static create1(propertyName: ISyntaxToken): EnumElementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): EnumElementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): EnumElementSyntax; + public withPropertyName(propertyName: ISyntaxToken): EnumElementSyntax; + public withEqualsValueClause(equalsValueClause: EqualsValueClauseSyntax): EnumElementSyntax; + public isTypeScriptSpecific(): boolean; + } + class CastExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { + public lessThanToken: ISyntaxToken; + public type: ITypeSyntax; + public greaterThanToken: ISyntaxToken; + public expression: IUnaryExpressionSyntax; + constructor(lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax): CastExpressionSyntax; + static create1(type: ITypeSyntax, expression: IUnaryExpressionSyntax): CastExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): CastExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): CastExpressionSyntax; + public withLessThanToken(lessThanToken: ISyntaxToken): CastExpressionSyntax; + public withType(type: ITypeSyntax): CastExpressionSyntax; + public withGreaterThanToken(greaterThanToken: ISyntaxToken): CastExpressionSyntax; + public withExpression(expression: IUnaryExpressionSyntax): CastExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class ObjectLiteralExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { + public openBraceToken: ISyntaxToken; + public propertyAssignments: ISeparatedSyntaxList; + public closeBraceToken: ISyntaxToken; + constructor(openBraceToken: ISyntaxToken, propertyAssignments: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(openBraceToken: ISyntaxToken, propertyAssignments: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax; + static create(openBraceToken: ISyntaxToken, closeBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax; + static create1(): ObjectLiteralExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): ObjectLiteralExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): ObjectLiteralExpressionSyntax; + public withOpenBraceToken(openBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax; + public withPropertyAssignments(propertyAssignments: ISeparatedSyntaxList): ObjectLiteralExpressionSyntax; + public withPropertyAssignment(propertyAssignment: IPropertyAssignmentSyntax): ObjectLiteralExpressionSyntax; + public withCloseBraceToken(closeBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class SimplePropertyAssignmentSyntax extends SyntaxNode implements IPropertyAssignmentSyntax { + public propertyName: ISyntaxToken; + public colonToken: ISyntaxToken; + public expression: IExpressionSyntax; + constructor(propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isPropertyAssignment(): boolean; + public update(propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax; + static create1(propertyName: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): SimplePropertyAssignmentSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): SimplePropertyAssignmentSyntax; + public withPropertyName(propertyName: ISyntaxToken): SimplePropertyAssignmentSyntax; + public withColonToken(colonToken: ISyntaxToken): SimplePropertyAssignmentSyntax; + public withExpression(expression: IExpressionSyntax): SimplePropertyAssignmentSyntax; + public isTypeScriptSpecific(): boolean; + } + class FunctionPropertyAssignmentSyntax extends SyntaxNode implements IPropertyAssignmentSyntax { + public propertyName: ISyntaxToken; + public callSignature: CallSignatureSyntax; + public block: BlockSyntax; + constructor(propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isPropertyAssignment(): boolean; + public update(propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionPropertyAssignmentSyntax; + static create1(propertyName: ISyntaxToken): FunctionPropertyAssignmentSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): FunctionPropertyAssignmentSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): FunctionPropertyAssignmentSyntax; + public withPropertyName(propertyName: ISyntaxToken): FunctionPropertyAssignmentSyntax; + public withCallSignature(callSignature: CallSignatureSyntax): FunctionPropertyAssignmentSyntax; + public withBlock(block: BlockSyntax): FunctionPropertyAssignmentSyntax; + public isTypeScriptSpecific(): boolean; + } + class FunctionExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { + public functionKeyword: ISyntaxToken; + public identifier: ISyntaxToken; + public callSignature: CallSignatureSyntax; + public block: BlockSyntax; + constructor(functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionExpressionSyntax; + static create(functionKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionExpressionSyntax; + static create1(): FunctionExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): FunctionExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): FunctionExpressionSyntax; + public withFunctionKeyword(functionKeyword: ISyntaxToken): FunctionExpressionSyntax; + public withIdentifier(identifier: ISyntaxToken): FunctionExpressionSyntax; + public withCallSignature(callSignature: CallSignatureSyntax): FunctionExpressionSyntax; + public withBlock(block: BlockSyntax): FunctionExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class EmptyStatementSyntax extends SyntaxNode implements IStatementSyntax { + public semicolonToken: ISyntaxToken; + constructor(semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(semicolonToken: ISyntaxToken): EmptyStatementSyntax; + static create1(): EmptyStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): EmptyStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): EmptyStatementSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): EmptyStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class TryStatementSyntax extends SyntaxNode implements IStatementSyntax { + public tryKeyword: ISyntaxToken; + public block: BlockSyntax; + public catchClause: CatchClauseSyntax; + public finallyClause: FinallyClauseSyntax; + constructor(tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax): TryStatementSyntax; + static create(tryKeyword: ISyntaxToken, block: BlockSyntax): TryStatementSyntax; + static create1(): TryStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): TryStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): TryStatementSyntax; + public withTryKeyword(tryKeyword: ISyntaxToken): TryStatementSyntax; + public withBlock(block: BlockSyntax): TryStatementSyntax; + public withCatchClause(catchClause: CatchClauseSyntax): TryStatementSyntax; + public withFinallyClause(finallyClause: FinallyClauseSyntax): TryStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class CatchClauseSyntax extends SyntaxNode { + public catchKeyword: ISyntaxToken; + public openParenToken: ISyntaxToken; + public identifier: ISyntaxToken; + public typeAnnotation: TypeAnnotationSyntax; + public closeParenToken: ISyntaxToken; + public block: BlockSyntax; + constructor(catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax): CatchClauseSyntax; + static create(catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, closeParenToken: ISyntaxToken, block: BlockSyntax): CatchClauseSyntax; + static create1(identifier: ISyntaxToken): CatchClauseSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): CatchClauseSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): CatchClauseSyntax; + public withCatchKeyword(catchKeyword: ISyntaxToken): CatchClauseSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): CatchClauseSyntax; + public withIdentifier(identifier: ISyntaxToken): CatchClauseSyntax; + public withTypeAnnotation(typeAnnotation: TypeAnnotationSyntax): CatchClauseSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): CatchClauseSyntax; + public withBlock(block: BlockSyntax): CatchClauseSyntax; + public isTypeScriptSpecific(): boolean; + } + class FinallyClauseSyntax extends SyntaxNode { + public finallyKeyword: ISyntaxToken; + public block: BlockSyntax; + constructor(finallyKeyword: ISyntaxToken, block: BlockSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public update(finallyKeyword: ISyntaxToken, block: BlockSyntax): FinallyClauseSyntax; + static create1(): FinallyClauseSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): FinallyClauseSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): FinallyClauseSyntax; + public withFinallyKeyword(finallyKeyword: ISyntaxToken): FinallyClauseSyntax; + public withBlock(block: BlockSyntax): FinallyClauseSyntax; + public isTypeScriptSpecific(): boolean; + } + class LabeledStatementSyntax extends SyntaxNode implements IStatementSyntax { + public identifier: ISyntaxToken; + public colonToken: ISyntaxToken; + public statement: IStatementSyntax; + constructor(identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax): LabeledStatementSyntax; + static create1(identifier: ISyntaxToken, statement: IStatementSyntax): LabeledStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): LabeledStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): LabeledStatementSyntax; + public withIdentifier(identifier: ISyntaxToken): LabeledStatementSyntax; + public withColonToken(colonToken: ISyntaxToken): LabeledStatementSyntax; + public withStatement(statement: IStatementSyntax): LabeledStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class DoStatementSyntax extends SyntaxNode implements IIterationStatementSyntax { + public doKeyword: ISyntaxToken; + public statement: IStatementSyntax; + public whileKeyword: ISyntaxToken; + public openParenToken: ISyntaxToken; + public condition: IExpressionSyntax; + public closeParenToken: ISyntaxToken; + public semicolonToken: ISyntaxToken; + constructor(doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isIterationStatement(): boolean; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken): DoStatementSyntax; + static create1(statement: IStatementSyntax, condition: IExpressionSyntax): DoStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): DoStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): DoStatementSyntax; + public withDoKeyword(doKeyword: ISyntaxToken): DoStatementSyntax; + public withStatement(statement: IStatementSyntax): DoStatementSyntax; + public withWhileKeyword(whileKeyword: ISyntaxToken): DoStatementSyntax; + public withOpenParenToken(openParenToken: ISyntaxToken): DoStatementSyntax; + public withCondition(condition: IExpressionSyntax): DoStatementSyntax; + public withCloseParenToken(closeParenToken: ISyntaxToken): DoStatementSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): DoStatementSyntax; + public isTypeScriptSpecific(): boolean; + } + class TypeOfExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { + public typeOfKeyword: ISyntaxToken; + public expression: IUnaryExpressionSyntax; + constructor(typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): TypeOfExpressionSyntax; + static create1(expression: IUnaryExpressionSyntax): TypeOfExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): TypeOfExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): TypeOfExpressionSyntax; + public withTypeOfKeyword(typeOfKeyword: ISyntaxToken): TypeOfExpressionSyntax; + public withExpression(expression: IUnaryExpressionSyntax): TypeOfExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class DeleteExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { + public deleteKeyword: ISyntaxToken; + public expression: IUnaryExpressionSyntax; + constructor(deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): DeleteExpressionSyntax; + static create1(expression: IUnaryExpressionSyntax): DeleteExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): DeleteExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): DeleteExpressionSyntax; + public withDeleteKeyword(deleteKeyword: ISyntaxToken): DeleteExpressionSyntax; + public withExpression(expression: IUnaryExpressionSyntax): DeleteExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class VoidExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { + public voidKeyword: ISyntaxToken; + public expression: IUnaryExpressionSyntax; + constructor(voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isUnaryExpression(): boolean; + public isExpression(): boolean; + public update(voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): VoidExpressionSyntax; + static create1(expression: IUnaryExpressionSyntax): VoidExpressionSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): VoidExpressionSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): VoidExpressionSyntax; + public withVoidKeyword(voidKeyword: ISyntaxToken): VoidExpressionSyntax; + public withExpression(expression: IUnaryExpressionSyntax): VoidExpressionSyntax; + public isTypeScriptSpecific(): boolean; + } + class DebuggerStatementSyntax extends SyntaxNode implements IStatementSyntax { + public debuggerKeyword: ISyntaxToken; + public semicolonToken: ISyntaxToken; + constructor(debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken, parsedInStrictMode: boolean); + public accept(visitor: ISyntaxVisitor): any; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(slot: number): ISyntaxElement; + public isStatement(): boolean; + public isModuleElement(): boolean; + public update(debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken): DebuggerStatementSyntax; + static create1(): DebuggerStatementSyntax; + public withLeadingTrivia(trivia: ISyntaxTriviaList): DebuggerStatementSyntax; + public withTrailingTrivia(trivia: ISyntaxTriviaList): DebuggerStatementSyntax; + public withDebuggerKeyword(debuggerKeyword: ISyntaxToken): DebuggerStatementSyntax; + public withSemicolonToken(semicolonToken: ISyntaxToken): DebuggerStatementSyntax; + public isTypeScriptSpecific(): boolean; + } +} +declare module TypeScript { + class SyntaxRewriter implements ISyntaxVisitor { + public visitToken(token: ISyntaxToken): ISyntaxToken; + public visitNode(node: SyntaxNode): SyntaxNode; + public visitNodeOrToken(node: ISyntaxNodeOrToken): ISyntaxNodeOrToken; + public visitList(list: ISyntaxList): ISyntaxList; + public visitSeparatedList(list: ISeparatedSyntaxList): ISeparatedSyntaxList; + public visitSourceUnit(node: SourceUnitSyntax): any; + public visitExternalModuleReference(node: ExternalModuleReferenceSyntax): any; + public visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): any; + public visitImportDeclaration(node: ImportDeclarationSyntax): any; + public visitExportAssignment(node: ExportAssignmentSyntax): any; + public visitClassDeclaration(node: ClassDeclarationSyntax): any; + public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): any; + public visitHeritageClause(node: HeritageClauseSyntax): any; + public visitModuleDeclaration(node: ModuleDeclarationSyntax): any; + public visitFunctionDeclaration(node: FunctionDeclarationSyntax): any; + public visitVariableStatement(node: VariableStatementSyntax): any; + public visitVariableDeclaration(node: VariableDeclarationSyntax): any; + public visitVariableDeclarator(node: VariableDeclaratorSyntax): any; + public visitEqualsValueClause(node: EqualsValueClauseSyntax): any; + public visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): any; + public visitArrayLiteralExpression(node: ArrayLiteralExpressionSyntax): any; + public visitOmittedExpression(node: OmittedExpressionSyntax): any; + public visitParenthesizedExpression(node: ParenthesizedExpressionSyntax): any; + public visitSimpleArrowFunctionExpression(node: SimpleArrowFunctionExpressionSyntax): any; + public visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): any; + public visitQualifiedName(node: QualifiedNameSyntax): any; + public visitTypeArgumentList(node: TypeArgumentListSyntax): any; + public visitConstructorType(node: ConstructorTypeSyntax): any; + public visitFunctionType(node: FunctionTypeSyntax): any; + public visitObjectType(node: ObjectTypeSyntax): any; + public visitArrayType(node: ArrayTypeSyntax): any; + public visitGenericType(node: GenericTypeSyntax): any; + public visitTypeQuery(node: TypeQuerySyntax): any; + public visitTypeAnnotation(node: TypeAnnotationSyntax): any; + public visitBlock(node: BlockSyntax): any; + public visitParameter(node: ParameterSyntax): any; + public visitMemberAccessExpression(node: MemberAccessExpressionSyntax): any; + public visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): any; + public visitElementAccessExpression(node: ElementAccessExpressionSyntax): any; + public visitInvocationExpression(node: InvocationExpressionSyntax): any; + public visitArgumentList(node: ArgumentListSyntax): any; + public visitBinaryExpression(node: BinaryExpressionSyntax): any; + public visitConditionalExpression(node: ConditionalExpressionSyntax): any; + public visitConstructSignature(node: ConstructSignatureSyntax): any; + public visitMethodSignature(node: MethodSignatureSyntax): any; + public visitIndexSignature(node: IndexSignatureSyntax): any; + public visitPropertySignature(node: PropertySignatureSyntax): any; + public visitCallSignature(node: CallSignatureSyntax): any; + public visitParameterList(node: ParameterListSyntax): any; + public visitTypeParameterList(node: TypeParameterListSyntax): any; + public visitTypeParameter(node: TypeParameterSyntax): any; + public visitConstraint(node: ConstraintSyntax): any; + public visitElseClause(node: ElseClauseSyntax): any; + public visitIfStatement(node: IfStatementSyntax): any; + public visitExpressionStatement(node: ExpressionStatementSyntax): any; + public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): any; + public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): any; + public visitGetAccessor(node: GetAccessorSyntax): any; + public visitSetAccessor(node: SetAccessorSyntax): any; + public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): any; + public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): any; + public visitThrowStatement(node: ThrowStatementSyntax): any; + public visitReturnStatement(node: ReturnStatementSyntax): any; + public visitObjectCreationExpression(node: ObjectCreationExpressionSyntax): any; + public visitSwitchStatement(node: SwitchStatementSyntax): any; + public visitCaseSwitchClause(node: CaseSwitchClauseSyntax): any; + public visitDefaultSwitchClause(node: DefaultSwitchClauseSyntax): any; + public visitBreakStatement(node: BreakStatementSyntax): any; + public visitContinueStatement(node: ContinueStatementSyntax): any; + public visitForStatement(node: ForStatementSyntax): any; + public visitForInStatement(node: ForInStatementSyntax): any; + public visitWhileStatement(node: WhileStatementSyntax): any; + public visitWithStatement(node: WithStatementSyntax): any; + public visitEnumDeclaration(node: EnumDeclarationSyntax): any; + public visitEnumElement(node: EnumElementSyntax): any; + public visitCastExpression(node: CastExpressionSyntax): any; + public visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): any; + public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): any; + public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): any; + public visitFunctionExpression(node: FunctionExpressionSyntax): any; + public visitEmptyStatement(node: EmptyStatementSyntax): any; + public visitTryStatement(node: TryStatementSyntax): any; + public visitCatchClause(node: CatchClauseSyntax): any; + public visitFinallyClause(node: FinallyClauseSyntax): any; + public visitLabeledStatement(node: LabeledStatementSyntax): any; + public visitDoStatement(node: DoStatementSyntax): any; + public visitTypeOfExpression(node: TypeOfExpressionSyntax): any; + public visitDeleteExpression(node: DeleteExpressionSyntax): any; + public visitVoidExpression(node: VoidExpressionSyntax): any; + public visitDebuggerStatement(node: DebuggerStatementSyntax): any; + } +} +declare module TypeScript { + class SyntaxDedenter extends SyntaxRewriter { + private dedentationAmount; + private minimumIndent; + private options; + private lastTriviaWasNewLine; + constructor(dedentFirstToken: boolean, dedentationAmount: number, minimumIndent: number, options: FormattingOptions); + private abort(); + private isAborted(); + public visitToken(token: ISyntaxToken): ISyntaxToken; + private dedentTriviaList(triviaList); + private dedentSegment(segment, hasFollowingNewLineTrivia); + private dedentWhitespace(trivia, hasFollowingNewLineTrivia); + private dedentMultiLineComment(trivia); + static dedentNode(node: ISyntaxNode, dedentFirstToken: boolean, dedentAmount: number, minimumIndent: number, options: FormattingOptions): ISyntaxNode; + } +} +declare module TypeScript { + class SyntaxIndenter extends SyntaxRewriter { + private indentationAmount; + private options; + private lastTriviaWasNewLine; + private indentationTrivia; + constructor(indentFirstToken: boolean, indentationAmount: number, options: FormattingOptions); + public visitToken(token: ISyntaxToken): ISyntaxToken; + public indentTriviaList(triviaList: ISyntaxTriviaList): ISyntaxTriviaList; + private indentSegment(segment); + private indentWhitespace(trivia, indentThisTrivia, result); + private indentSingleLineOrSkippedText(trivia, indentThisTrivia, result); + private indentMultiLineComment(trivia, indentThisTrivia, result); + static indentNode(node: ISyntaxNode, indentFirstToken: boolean, indentAmount: number, options: FormattingOptions): SyntaxNode; + static indentNodes(nodes: SyntaxNode[], indentFirstToken: boolean, indentAmount: number, options: FormattingOptions): SyntaxNode[]; + } +} +declare module TypeScript.Syntax { + class VariableWidthTokenWithNoTrivia implements ISyntaxToken { + private _fullText; + public tokenKind: SyntaxKind; + constructor(fullText: string, kind: SyntaxKind); + public clone(): ISyntaxToken; + public isNode(): boolean; + public isToken(): boolean; + public isList(): boolean; + public isSeparatedList(): boolean; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(index: number): ISyntaxElement; + public fullWidth(): number; + public width(): number; + public text(): string; + public fullText(): string; + public value(): any; + public valueText(): string; + public hasLeadingTrivia(): boolean; + public hasLeadingComment(): boolean; + public hasLeadingNewLine(): boolean; + public hasLeadingSkippedText(): boolean; + public leadingTriviaWidth(): number; + public leadingTrivia(): ISyntaxTriviaList; + public hasTrailingTrivia(): boolean; + public hasTrailingComment(): boolean; + public hasTrailingNewLine(): boolean; + public hasTrailingSkippedText(): boolean; + public trailingTriviaWidth(): number; + public trailingTrivia(): ISyntaxTriviaList; + public hasSkippedToken(): boolean; + public toJSON(key: any): any; + public firstToken(): ISyntaxToken; + public lastToken(): ISyntaxToken; + public isTypeScriptSpecific(): boolean; + public isIncrementallyUnusable(): boolean; + public accept(visitor: ISyntaxVisitor): any; + private realize(); + public collectTextElements(elements: string[]): void; + private findTokenInternal(parent, position, fullStart); + public withLeadingTrivia(leadingTrivia: ISyntaxTriviaList): ISyntaxToken; + public withTrailingTrivia(trailingTrivia: ISyntaxTriviaList): ISyntaxToken; + public isExpression(): boolean; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + } + class VariableWidthTokenWithLeadingTrivia implements ISyntaxToken { + private _fullText; + public tokenKind: SyntaxKind; + private _leadingTriviaInfo; + constructor(fullText: string, kind: SyntaxKind, leadingTriviaInfo: number); + public clone(): ISyntaxToken; + public isNode(): boolean; + public isToken(): boolean; + public isList(): boolean; + public isSeparatedList(): boolean; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(index: number): ISyntaxElement; + public fullWidth(): number; + public width(): number; + public text(): string; + public fullText(): string; + public value(): any; + public valueText(): string; + public hasLeadingTrivia(): boolean; + public hasLeadingComment(): boolean; + public hasLeadingNewLine(): boolean; + public hasLeadingSkippedText(): boolean; + public leadingTriviaWidth(): number; + public leadingTrivia(): ISyntaxTriviaList; + public hasTrailingTrivia(): boolean; + public hasTrailingComment(): boolean; + public hasTrailingNewLine(): boolean; + public hasTrailingSkippedText(): boolean; + public trailingTriviaWidth(): number; + public trailingTrivia(): ISyntaxTriviaList; + public hasSkippedToken(): boolean; + public toJSON(key: any): any; + public firstToken(): ISyntaxToken; + public lastToken(): ISyntaxToken; + public isTypeScriptSpecific(): boolean; + public isIncrementallyUnusable(): boolean; + public accept(visitor: ISyntaxVisitor): any; + private realize(); + public collectTextElements(elements: string[]): void; + private findTokenInternal(parent, position, fullStart); + public withLeadingTrivia(leadingTrivia: ISyntaxTriviaList): ISyntaxToken; + public withTrailingTrivia(trailingTrivia: ISyntaxTriviaList): ISyntaxToken; + public isExpression(): boolean; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + } + class VariableWidthTokenWithTrailingTrivia implements ISyntaxToken { + private _fullText; + public tokenKind: SyntaxKind; + private _trailingTriviaInfo; + constructor(fullText: string, kind: SyntaxKind, trailingTriviaInfo: number); + public clone(): ISyntaxToken; + public isNode(): boolean; + public isToken(): boolean; + public isList(): boolean; + public isSeparatedList(): boolean; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(index: number): ISyntaxElement; + public fullWidth(): number; + public width(): number; + public text(): string; + public fullText(): string; + public value(): any; + public valueText(): string; + public hasLeadingTrivia(): boolean; + public hasLeadingComment(): boolean; + public hasLeadingNewLine(): boolean; + public hasLeadingSkippedText(): boolean; + public leadingTriviaWidth(): number; + public leadingTrivia(): ISyntaxTriviaList; + public hasTrailingTrivia(): boolean; + public hasTrailingComment(): boolean; + public hasTrailingNewLine(): boolean; + public hasTrailingSkippedText(): boolean; + public trailingTriviaWidth(): number; + public trailingTrivia(): ISyntaxTriviaList; + public hasSkippedToken(): boolean; + public toJSON(key: any): any; + public firstToken(): ISyntaxToken; + public lastToken(): ISyntaxToken; + public isTypeScriptSpecific(): boolean; + public isIncrementallyUnusable(): boolean; + public accept(visitor: ISyntaxVisitor): any; + private realize(); + public collectTextElements(elements: string[]): void; + private findTokenInternal(parent, position, fullStart); + public withLeadingTrivia(leadingTrivia: ISyntaxTriviaList): ISyntaxToken; + public withTrailingTrivia(trailingTrivia: ISyntaxTriviaList): ISyntaxToken; + public isExpression(): boolean; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + } + class VariableWidthTokenWithLeadingAndTrailingTrivia implements ISyntaxToken { + private _fullText; + public tokenKind: SyntaxKind; + private _leadingTriviaInfo; + private _trailingTriviaInfo; + constructor(fullText: string, kind: SyntaxKind, leadingTriviaInfo: number, trailingTriviaInfo: number); + public clone(): ISyntaxToken; + public isNode(): boolean; + public isToken(): boolean; + public isList(): boolean; + public isSeparatedList(): boolean; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(index: number): ISyntaxElement; + public fullWidth(): number; + public width(): number; + public text(): string; + public fullText(): string; + public value(): any; + public valueText(): string; + public hasLeadingTrivia(): boolean; + public hasLeadingComment(): boolean; + public hasLeadingNewLine(): boolean; + public hasLeadingSkippedText(): boolean; + public leadingTriviaWidth(): number; + public leadingTrivia(): ISyntaxTriviaList; + public hasTrailingTrivia(): boolean; + public hasTrailingComment(): boolean; + public hasTrailingNewLine(): boolean; + public hasTrailingSkippedText(): boolean; + public trailingTriviaWidth(): number; + public trailingTrivia(): ISyntaxTriviaList; + public hasSkippedToken(): boolean; + public toJSON(key: any): any; + public firstToken(): ISyntaxToken; + public lastToken(): ISyntaxToken; + public isTypeScriptSpecific(): boolean; + public isIncrementallyUnusable(): boolean; + public accept(visitor: ISyntaxVisitor): any; + private realize(); + public collectTextElements(elements: string[]): void; + private findTokenInternal(parent, position, fullStart); + public withLeadingTrivia(leadingTrivia: ISyntaxTriviaList): ISyntaxToken; + public withTrailingTrivia(trailingTrivia: ISyntaxTriviaList): ISyntaxToken; + public isExpression(): boolean; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + } + class FixedWidthTokenWithNoTrivia implements ISyntaxToken { + public tokenKind: SyntaxKind; + constructor(kind: SyntaxKind); + public clone(): ISyntaxToken; + public isNode(): boolean; + public isToken(): boolean; + public isList(): boolean; + public isSeparatedList(): boolean; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(index: number): ISyntaxElement; + public fullWidth(): number; + public width(): number; + public text(): string; + public fullText(): string; + public value(): any; + public valueText(): string; + public hasLeadingTrivia(): boolean; + public hasLeadingComment(): boolean; + public hasLeadingNewLine(): boolean; + public hasLeadingSkippedText(): boolean; + public leadingTriviaWidth(): number; + public leadingTrivia(): ISyntaxTriviaList; + public hasTrailingTrivia(): boolean; + public hasTrailingComment(): boolean; + public hasTrailingNewLine(): boolean; + public hasTrailingSkippedText(): boolean; + public trailingTriviaWidth(): number; + public trailingTrivia(): ISyntaxTriviaList; + public hasSkippedToken(): boolean; + public toJSON(key: any): any; + public firstToken(): ISyntaxToken; + public lastToken(): ISyntaxToken; + public isTypeScriptSpecific(): boolean; + public isIncrementallyUnusable(): boolean; + public accept(visitor: ISyntaxVisitor): any; + private realize(); + public collectTextElements(elements: string[]): void; + private findTokenInternal(parent, position, fullStart); + public withLeadingTrivia(leadingTrivia: ISyntaxTriviaList): ISyntaxToken; + public withTrailingTrivia(trailingTrivia: ISyntaxTriviaList): ISyntaxToken; + public isExpression(): boolean; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + } + class FixedWidthTokenWithLeadingTrivia implements ISyntaxToken { + private _fullText; + public tokenKind: SyntaxKind; + private _leadingTriviaInfo; + constructor(fullText: string, kind: SyntaxKind, leadingTriviaInfo: number); + public clone(): ISyntaxToken; + public isNode(): boolean; + public isToken(): boolean; + public isList(): boolean; + public isSeparatedList(): boolean; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(index: number): ISyntaxElement; + public fullWidth(): number; + public width(): number; + public text(): string; + public fullText(): string; + public value(): any; + public valueText(): string; + public hasLeadingTrivia(): boolean; + public hasLeadingComment(): boolean; + public hasLeadingNewLine(): boolean; + public hasLeadingSkippedText(): boolean; + public leadingTriviaWidth(): number; + public leadingTrivia(): ISyntaxTriviaList; + public hasTrailingTrivia(): boolean; + public hasTrailingComment(): boolean; + public hasTrailingNewLine(): boolean; + public hasTrailingSkippedText(): boolean; + public trailingTriviaWidth(): number; + public trailingTrivia(): ISyntaxTriviaList; + public hasSkippedToken(): boolean; + public toJSON(key: any): any; + public firstToken(): ISyntaxToken; + public lastToken(): ISyntaxToken; + public isTypeScriptSpecific(): boolean; + public isIncrementallyUnusable(): boolean; + public accept(visitor: ISyntaxVisitor): any; + private realize(); + public collectTextElements(elements: string[]): void; + private findTokenInternal(parent, position, fullStart); + public withLeadingTrivia(leadingTrivia: ISyntaxTriviaList): ISyntaxToken; + public withTrailingTrivia(trailingTrivia: ISyntaxTriviaList): ISyntaxToken; + public isExpression(): boolean; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + } + class FixedWidthTokenWithTrailingTrivia implements ISyntaxToken { + private _fullText; + public tokenKind: SyntaxKind; + private _trailingTriviaInfo; + constructor(fullText: string, kind: SyntaxKind, trailingTriviaInfo: number); + public clone(): ISyntaxToken; + public isNode(): boolean; + public isToken(): boolean; + public isList(): boolean; + public isSeparatedList(): boolean; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(index: number): ISyntaxElement; + public fullWidth(): number; + public width(): number; + public text(): string; + public fullText(): string; + public value(): any; + public valueText(): string; + public hasLeadingTrivia(): boolean; + public hasLeadingComment(): boolean; + public hasLeadingNewLine(): boolean; + public hasLeadingSkippedText(): boolean; + public leadingTriviaWidth(): number; + public leadingTrivia(): ISyntaxTriviaList; + public hasTrailingTrivia(): boolean; + public hasTrailingComment(): boolean; + public hasTrailingNewLine(): boolean; + public hasTrailingSkippedText(): boolean; + public trailingTriviaWidth(): number; + public trailingTrivia(): ISyntaxTriviaList; + public hasSkippedToken(): boolean; + public toJSON(key: any): any; + public firstToken(): ISyntaxToken; + public lastToken(): ISyntaxToken; + public isTypeScriptSpecific(): boolean; + public isIncrementallyUnusable(): boolean; + public accept(visitor: ISyntaxVisitor): any; + private realize(); + public collectTextElements(elements: string[]): void; + private findTokenInternal(parent, position, fullStart); + public withLeadingTrivia(leadingTrivia: ISyntaxTriviaList): ISyntaxToken; + public withTrailingTrivia(trailingTrivia: ISyntaxTriviaList): ISyntaxToken; + public isExpression(): boolean; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + } + class FixedWidthTokenWithLeadingAndTrailingTrivia implements ISyntaxToken { + private _fullText; + public tokenKind: SyntaxKind; + private _leadingTriviaInfo; + private _trailingTriviaInfo; + constructor(fullText: string, kind: SyntaxKind, leadingTriviaInfo: number, trailingTriviaInfo: number); + public clone(): ISyntaxToken; + public isNode(): boolean; + public isToken(): boolean; + public isList(): boolean; + public isSeparatedList(): boolean; + public kind(): SyntaxKind; + public childCount(): number; + public childAt(index: number): ISyntaxElement; + public fullWidth(): number; + public width(): number; + public text(): string; + public fullText(): string; + public value(): any; + public valueText(): string; + public hasLeadingTrivia(): boolean; + public hasLeadingComment(): boolean; + public hasLeadingNewLine(): boolean; + public hasLeadingSkippedText(): boolean; + public leadingTriviaWidth(): number; + public leadingTrivia(): ISyntaxTriviaList; + public hasTrailingTrivia(): boolean; + public hasTrailingComment(): boolean; + public hasTrailingNewLine(): boolean; + public hasTrailingSkippedText(): boolean; + public trailingTriviaWidth(): number; + public trailingTrivia(): ISyntaxTriviaList; + public hasSkippedToken(): boolean; + public toJSON(key: any): any; + public firstToken(): ISyntaxToken; + public lastToken(): ISyntaxToken; + public isTypeScriptSpecific(): boolean; + public isIncrementallyUnusable(): boolean; + public accept(visitor: ISyntaxVisitor): any; + private realize(); + public collectTextElements(elements: string[]): void; + private findTokenInternal(parent, position, fullStart); + public withLeadingTrivia(leadingTrivia: ISyntaxTriviaList): ISyntaxToken; + public withTrailingTrivia(trailingTrivia: ISyntaxTriviaList): ISyntaxToken; + public isExpression(): boolean; + public isPrimaryExpression(): boolean; + public isMemberExpression(): boolean; + public isPostfixExpression(): boolean; + public isUnaryExpression(): boolean; + } +} +declare module TypeScript { + interface ISyntaxToken extends ISyntaxNodeOrToken, INameSyntax, IPrimaryExpressionSyntax { + tokenKind: SyntaxKind; + text(): string; + value(): any; + valueText(): string; + hasLeadingTrivia(): boolean; + hasLeadingComment(): boolean; + hasLeadingNewLine(): boolean; + hasLeadingSkippedText(): boolean; + hasTrailingTrivia(): boolean; + hasTrailingComment(): boolean; + hasTrailingNewLine(): boolean; + hasTrailingSkippedText(): boolean; + hasSkippedToken(): boolean; + leadingTrivia(): ISyntaxTriviaList; + trailingTrivia(): ISyntaxTriviaList; + withLeadingTrivia(leadingTrivia: ISyntaxTriviaList): ISyntaxToken; + withTrailingTrivia(trailingTrivia: ISyntaxTriviaList): ISyntaxToken; + clone(): ISyntaxToken; + } + interface ITokenInfo { + leadingTrivia?: ISyntaxTrivia[]; + text?: string; + trailingTrivia?: ISyntaxTrivia[]; + } +} +declare module TypeScript.Syntax { + function isExpression(token: ISyntaxToken): boolean; + function realizeToken(token: ISyntaxToken): ISyntaxToken; + function convertToIdentifierName(token: ISyntaxToken): ISyntaxToken; + function tokenToJSON(token: ISyntaxToken): any; + function value(token: ISyntaxToken): any; + function massageEscapes(text: string): string; + function valueText(token: ISyntaxToken): string; + function emptyToken(kind: SyntaxKind): ISyntaxToken; + function token(kind: SyntaxKind, info?: ITokenInfo): ISyntaxToken; + function identifier(text: string, info?: ITokenInfo): ISyntaxToken; +} +declare module TypeScript { + class SyntaxTokenReplacer extends SyntaxRewriter { + private token1; + private token2; + constructor(token1: ISyntaxToken, token2: ISyntaxToken); + public visitToken(token: ISyntaxToken): ISyntaxToken; + public visitNode(node: SyntaxNode): SyntaxNode; + public visitList(list: ISyntaxList): ISyntaxList; + public visitSeparatedList(list: ISeparatedSyntaxList): ISeparatedSyntaxList; + } +} +declare module TypeScript { + interface ISyntaxTrivia { + kind(): SyntaxKind; + isWhitespace(): boolean; + isComment(): boolean; + isNewLine(): boolean; + isSkippedToken(): boolean; + fullWidth(): number; + fullText(): string; + skippedToken(): ISyntaxToken; + } +} +declare module TypeScript.Syntax { + function deferredTrivia(kind: SyntaxKind, text: ISimpleText, fullStart: number, fullWidth: number): ISyntaxTrivia; + function trivia(kind: SyntaxKind, text: string): ISyntaxTrivia; + function skippedTokenTrivia(token: ISyntaxToken): ISyntaxTrivia; + function spaces(count: number): ISyntaxTrivia; + function whitespace(text: string): ISyntaxTrivia; + function multiLineComment(text: string): ISyntaxTrivia; + function singleLineComment(text: string): ISyntaxTrivia; + var spaceTrivia: ISyntaxTrivia; + var lineFeedTrivia: ISyntaxTrivia; + var carriageReturnTrivia: ISyntaxTrivia; + var carriageReturnLineFeedTrivia: ISyntaxTrivia; + function splitMultiLineCommentTriviaIntoMultipleLines(trivia: ISyntaxTrivia): string[]; +} +declare module TypeScript { + interface ISyntaxTriviaList { + count(): number; + syntaxTriviaAt(index: number): ISyntaxTrivia; + fullWidth(): number; + fullText(): string; + hasComment(): boolean; + hasNewLine(): boolean; + hasSkippedToken(): boolean; + last(): ISyntaxTrivia; + toArray(): ISyntaxTrivia[]; + concat(trivia: ISyntaxTriviaList): ISyntaxTriviaList; + collectTextElements(elements: string[]): void; + } +} +declare module TypeScript.Syntax { + var emptyTriviaList: ISyntaxTriviaList; + function triviaList(trivia: ISyntaxTrivia[]): ISyntaxTriviaList; + var spaceTriviaList: ISyntaxTriviaList; +} +declare module TypeScript { + class SyntaxUtilities { + static isAngleBracket(positionedElement: PositionedElement): boolean; + static getToken(list: ISyntaxList, kind: SyntaxKind): ISyntaxToken; + static containsToken(list: ISyntaxList, kind: SyntaxKind): boolean; + static hasExportKeyword(moduleElement: IModuleElementSyntax): boolean; + static getExportKeyword(moduleElement: IModuleElementSyntax): ISyntaxToken; + static isAmbientDeclarationSyntax(positionNode: PositionedNode): boolean; + } +} +declare module TypeScript { + interface ISyntaxVisitor { + visitToken(token: ISyntaxToken): any; + visitSourceUnit(node: SourceUnitSyntax): any; + visitExternalModuleReference(node: ExternalModuleReferenceSyntax): any; + visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): any; + visitImportDeclaration(node: ImportDeclarationSyntax): any; + visitExportAssignment(node: ExportAssignmentSyntax): any; + visitClassDeclaration(node: ClassDeclarationSyntax): any; + visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): any; + visitHeritageClause(node: HeritageClauseSyntax): any; + visitModuleDeclaration(node: ModuleDeclarationSyntax): any; + visitFunctionDeclaration(node: FunctionDeclarationSyntax): any; + visitVariableStatement(node: VariableStatementSyntax): any; + visitVariableDeclaration(node: VariableDeclarationSyntax): any; + visitVariableDeclarator(node: VariableDeclaratorSyntax): any; + visitEqualsValueClause(node: EqualsValueClauseSyntax): any; + visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): any; + visitArrayLiteralExpression(node: ArrayLiteralExpressionSyntax): any; + visitOmittedExpression(node: OmittedExpressionSyntax): any; + visitParenthesizedExpression(node: ParenthesizedExpressionSyntax): any; + visitSimpleArrowFunctionExpression(node: SimpleArrowFunctionExpressionSyntax): any; + visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): any; + visitQualifiedName(node: QualifiedNameSyntax): any; + visitTypeArgumentList(node: TypeArgumentListSyntax): any; + visitConstructorType(node: ConstructorTypeSyntax): any; + visitFunctionType(node: FunctionTypeSyntax): any; + visitObjectType(node: ObjectTypeSyntax): any; + visitArrayType(node: ArrayTypeSyntax): any; + visitGenericType(node: GenericTypeSyntax): any; + visitTypeQuery(node: TypeQuerySyntax): any; + visitTypeAnnotation(node: TypeAnnotationSyntax): any; + visitBlock(node: BlockSyntax): any; + visitParameter(node: ParameterSyntax): any; + visitMemberAccessExpression(node: MemberAccessExpressionSyntax): any; + visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): any; + visitElementAccessExpression(node: ElementAccessExpressionSyntax): any; + visitInvocationExpression(node: InvocationExpressionSyntax): any; + visitArgumentList(node: ArgumentListSyntax): any; + visitBinaryExpression(node: BinaryExpressionSyntax): any; + visitConditionalExpression(node: ConditionalExpressionSyntax): any; + visitConstructSignature(node: ConstructSignatureSyntax): any; + visitMethodSignature(node: MethodSignatureSyntax): any; + visitIndexSignature(node: IndexSignatureSyntax): any; + visitPropertySignature(node: PropertySignatureSyntax): any; + visitCallSignature(node: CallSignatureSyntax): any; + visitParameterList(node: ParameterListSyntax): any; + visitTypeParameterList(node: TypeParameterListSyntax): any; + visitTypeParameter(node: TypeParameterSyntax): any; + visitConstraint(node: ConstraintSyntax): any; + visitElseClause(node: ElseClauseSyntax): any; + visitIfStatement(node: IfStatementSyntax): any; + visitExpressionStatement(node: ExpressionStatementSyntax): any; + visitConstructorDeclaration(node: ConstructorDeclarationSyntax): any; + visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): any; + visitGetAccessor(node: GetAccessorSyntax): any; + visitSetAccessor(node: SetAccessorSyntax): any; + visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): any; + visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): any; + visitThrowStatement(node: ThrowStatementSyntax): any; + visitReturnStatement(node: ReturnStatementSyntax): any; + visitObjectCreationExpression(node: ObjectCreationExpressionSyntax): any; + visitSwitchStatement(node: SwitchStatementSyntax): any; + visitCaseSwitchClause(node: CaseSwitchClauseSyntax): any; + visitDefaultSwitchClause(node: DefaultSwitchClauseSyntax): any; + visitBreakStatement(node: BreakStatementSyntax): any; + visitContinueStatement(node: ContinueStatementSyntax): any; + visitForStatement(node: ForStatementSyntax): any; + visitForInStatement(node: ForInStatementSyntax): any; + visitWhileStatement(node: WhileStatementSyntax): any; + visitWithStatement(node: WithStatementSyntax): any; + visitEnumDeclaration(node: EnumDeclarationSyntax): any; + visitEnumElement(node: EnumElementSyntax): any; + visitCastExpression(node: CastExpressionSyntax): any; + visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): any; + visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): any; + visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): any; + visitFunctionExpression(node: FunctionExpressionSyntax): any; + visitEmptyStatement(node: EmptyStatementSyntax): any; + visitTryStatement(node: TryStatementSyntax): any; + visitCatchClause(node: CatchClauseSyntax): any; + visitFinallyClause(node: FinallyClauseSyntax): any; + visitLabeledStatement(node: LabeledStatementSyntax): any; + visitDoStatement(node: DoStatementSyntax): any; + visitTypeOfExpression(node: TypeOfExpressionSyntax): any; + visitDeleteExpression(node: DeleteExpressionSyntax): any; + visitVoidExpression(node: VoidExpressionSyntax): any; + visitDebuggerStatement(node: DebuggerStatementSyntax): any; + } + class SyntaxVisitor implements ISyntaxVisitor { + public defaultVisit(node: ISyntaxNodeOrToken): any; + public visitToken(token: ISyntaxToken): any; + public visitSourceUnit(node: SourceUnitSyntax): any; + public visitExternalModuleReference(node: ExternalModuleReferenceSyntax): any; + public visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): any; + public visitImportDeclaration(node: ImportDeclarationSyntax): any; + public visitExportAssignment(node: ExportAssignmentSyntax): any; + public visitClassDeclaration(node: ClassDeclarationSyntax): any; + public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): any; + public visitHeritageClause(node: HeritageClauseSyntax): any; + public visitModuleDeclaration(node: ModuleDeclarationSyntax): any; + public visitFunctionDeclaration(node: FunctionDeclarationSyntax): any; + public visitVariableStatement(node: VariableStatementSyntax): any; + public visitVariableDeclaration(node: VariableDeclarationSyntax): any; + public visitVariableDeclarator(node: VariableDeclaratorSyntax): any; + public visitEqualsValueClause(node: EqualsValueClauseSyntax): any; + public visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): any; + public visitArrayLiteralExpression(node: ArrayLiteralExpressionSyntax): any; + public visitOmittedExpression(node: OmittedExpressionSyntax): any; + public visitParenthesizedExpression(node: ParenthesizedExpressionSyntax): any; + public visitSimpleArrowFunctionExpression(node: SimpleArrowFunctionExpressionSyntax): any; + public visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): any; + public visitQualifiedName(node: QualifiedNameSyntax): any; + public visitTypeArgumentList(node: TypeArgumentListSyntax): any; + public visitConstructorType(node: ConstructorTypeSyntax): any; + public visitFunctionType(node: FunctionTypeSyntax): any; + public visitObjectType(node: ObjectTypeSyntax): any; + public visitArrayType(node: ArrayTypeSyntax): any; + public visitGenericType(node: GenericTypeSyntax): any; + public visitTypeQuery(node: TypeQuerySyntax): any; + public visitTypeAnnotation(node: TypeAnnotationSyntax): any; + public visitBlock(node: BlockSyntax): any; + public visitParameter(node: ParameterSyntax): any; + public visitMemberAccessExpression(node: MemberAccessExpressionSyntax): any; + public visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): any; + public visitElementAccessExpression(node: ElementAccessExpressionSyntax): any; + public visitInvocationExpression(node: InvocationExpressionSyntax): any; + public visitArgumentList(node: ArgumentListSyntax): any; + public visitBinaryExpression(node: BinaryExpressionSyntax): any; + public visitConditionalExpression(node: ConditionalExpressionSyntax): any; + public visitConstructSignature(node: ConstructSignatureSyntax): any; + public visitMethodSignature(node: MethodSignatureSyntax): any; + public visitIndexSignature(node: IndexSignatureSyntax): any; + public visitPropertySignature(node: PropertySignatureSyntax): any; + public visitCallSignature(node: CallSignatureSyntax): any; + public visitParameterList(node: ParameterListSyntax): any; + public visitTypeParameterList(node: TypeParameterListSyntax): any; + public visitTypeParameter(node: TypeParameterSyntax): any; + public visitConstraint(node: ConstraintSyntax): any; + public visitElseClause(node: ElseClauseSyntax): any; + public visitIfStatement(node: IfStatementSyntax): any; + public visitExpressionStatement(node: ExpressionStatementSyntax): any; + public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): any; + public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): any; + public visitGetAccessor(node: GetAccessorSyntax): any; + public visitSetAccessor(node: SetAccessorSyntax): any; + public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): any; + public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): any; + public visitThrowStatement(node: ThrowStatementSyntax): any; + public visitReturnStatement(node: ReturnStatementSyntax): any; + public visitObjectCreationExpression(node: ObjectCreationExpressionSyntax): any; + public visitSwitchStatement(node: SwitchStatementSyntax): any; + public visitCaseSwitchClause(node: CaseSwitchClauseSyntax): any; + public visitDefaultSwitchClause(node: DefaultSwitchClauseSyntax): any; + public visitBreakStatement(node: BreakStatementSyntax): any; + public visitContinueStatement(node: ContinueStatementSyntax): any; + public visitForStatement(node: ForStatementSyntax): any; + public visitForInStatement(node: ForInStatementSyntax): any; + public visitWhileStatement(node: WhileStatementSyntax): any; + public visitWithStatement(node: WithStatementSyntax): any; + public visitEnumDeclaration(node: EnumDeclarationSyntax): any; + public visitEnumElement(node: EnumElementSyntax): any; + public visitCastExpression(node: CastExpressionSyntax): any; + public visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): any; + public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): any; + public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): any; + public visitFunctionExpression(node: FunctionExpressionSyntax): any; + public visitEmptyStatement(node: EmptyStatementSyntax): any; + public visitTryStatement(node: TryStatementSyntax): any; + public visitCatchClause(node: CatchClauseSyntax): any; + public visitFinallyClause(node: FinallyClauseSyntax): any; + public visitLabeledStatement(node: LabeledStatementSyntax): any; + public visitDoStatement(node: DoStatementSyntax): any; + public visitTypeOfExpression(node: TypeOfExpressionSyntax): any; + public visitDeleteExpression(node: DeleteExpressionSyntax): any; + public visitVoidExpression(node: VoidExpressionSyntax): any; + public visitDebuggerStatement(node: DebuggerStatementSyntax): any; + } +} +declare module TypeScript { + class SyntaxWalker implements ISyntaxVisitor { + public visitToken(token: ISyntaxToken): void; + public visitNode(node: SyntaxNode): void; + public visitNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void; + private visitOptionalToken(token); + public visitOptionalNode(node: SyntaxNode): void; + public visitOptionalNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void; + public visitList(list: ISyntaxList): void; + public visitSeparatedList(list: ISeparatedSyntaxList): void; + public visitSourceUnit(node: SourceUnitSyntax): void; + public visitExternalModuleReference(node: ExternalModuleReferenceSyntax): void; + public visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): void; + public visitImportDeclaration(node: ImportDeclarationSyntax): void; + public visitExportAssignment(node: ExportAssignmentSyntax): void; + public visitClassDeclaration(node: ClassDeclarationSyntax): void; + public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): void; + public visitHeritageClause(node: HeritageClauseSyntax): void; + public visitModuleDeclaration(node: ModuleDeclarationSyntax): void; + public visitFunctionDeclaration(node: FunctionDeclarationSyntax): void; + public visitVariableStatement(node: VariableStatementSyntax): void; + public visitVariableDeclaration(node: VariableDeclarationSyntax): void; + public visitVariableDeclarator(node: VariableDeclaratorSyntax): void; + public visitEqualsValueClause(node: EqualsValueClauseSyntax): void; + public visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): void; + public visitArrayLiteralExpression(node: ArrayLiteralExpressionSyntax): void; + public visitOmittedExpression(node: OmittedExpressionSyntax): void; + public visitParenthesizedExpression(node: ParenthesizedExpressionSyntax): void; + public visitSimpleArrowFunctionExpression(node: SimpleArrowFunctionExpressionSyntax): void; + public visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): void; + public visitQualifiedName(node: QualifiedNameSyntax): void; + public visitTypeArgumentList(node: TypeArgumentListSyntax): void; + public visitConstructorType(node: ConstructorTypeSyntax): void; + public visitFunctionType(node: FunctionTypeSyntax): void; + public visitObjectType(node: ObjectTypeSyntax): void; + public visitArrayType(node: ArrayTypeSyntax): void; + public visitGenericType(node: GenericTypeSyntax): void; + public visitTypeQuery(node: TypeQuerySyntax): void; + public visitTypeAnnotation(node: TypeAnnotationSyntax): void; + public visitBlock(node: BlockSyntax): void; + public visitParameter(node: ParameterSyntax): void; + public visitMemberAccessExpression(node: MemberAccessExpressionSyntax): void; + public visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): void; + public visitElementAccessExpression(node: ElementAccessExpressionSyntax): void; + public visitInvocationExpression(node: InvocationExpressionSyntax): void; + public visitArgumentList(node: ArgumentListSyntax): void; + public visitBinaryExpression(node: BinaryExpressionSyntax): void; + public visitConditionalExpression(node: ConditionalExpressionSyntax): void; + public visitConstructSignature(node: ConstructSignatureSyntax): void; + public visitMethodSignature(node: MethodSignatureSyntax): void; + public visitIndexSignature(node: IndexSignatureSyntax): void; + public visitPropertySignature(node: PropertySignatureSyntax): void; + public visitCallSignature(node: CallSignatureSyntax): void; + public visitParameterList(node: ParameterListSyntax): void; + public visitTypeParameterList(node: TypeParameterListSyntax): void; + public visitTypeParameter(node: TypeParameterSyntax): void; + public visitConstraint(node: ConstraintSyntax): void; + public visitElseClause(node: ElseClauseSyntax): void; + public visitIfStatement(node: IfStatementSyntax): void; + public visitExpressionStatement(node: ExpressionStatementSyntax): void; + public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): void; + public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void; + public visitGetAccessor(node: GetAccessorSyntax): void; + public visitSetAccessor(node: SetAccessorSyntax): void; + public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): void; + public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): void; + public visitThrowStatement(node: ThrowStatementSyntax): void; + public visitReturnStatement(node: ReturnStatementSyntax): void; + public visitObjectCreationExpression(node: ObjectCreationExpressionSyntax): void; + public visitSwitchStatement(node: SwitchStatementSyntax): void; + public visitCaseSwitchClause(node: CaseSwitchClauseSyntax): void; + public visitDefaultSwitchClause(node: DefaultSwitchClauseSyntax): void; + public visitBreakStatement(node: BreakStatementSyntax): void; + public visitContinueStatement(node: ContinueStatementSyntax): void; + public visitForStatement(node: ForStatementSyntax): void; + public visitForInStatement(node: ForInStatementSyntax): void; + public visitWhileStatement(node: WhileStatementSyntax): void; + public visitWithStatement(node: WithStatementSyntax): void; + public visitEnumDeclaration(node: EnumDeclarationSyntax): void; + public visitEnumElement(node: EnumElementSyntax): void; + public visitCastExpression(node: CastExpressionSyntax): void; + public visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): void; + public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void; + public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void; + public visitFunctionExpression(node: FunctionExpressionSyntax): void; + public visitEmptyStatement(node: EmptyStatementSyntax): void; + public visitTryStatement(node: TryStatementSyntax): void; + public visitCatchClause(node: CatchClauseSyntax): void; + public visitFinallyClause(node: FinallyClauseSyntax): void; + public visitLabeledStatement(node: LabeledStatementSyntax): void; + public visitDoStatement(node: DoStatementSyntax): void; + public visitTypeOfExpression(node: TypeOfExpressionSyntax): void; + public visitDeleteExpression(node: DeleteExpressionSyntax): void; + public visitVoidExpression(node: VoidExpressionSyntax): void; + public visitDebuggerStatement(node: DebuggerStatementSyntax): void; + } +} +declare module TypeScript { + class PositionTrackingWalker extends SyntaxWalker { + private _position; + public visitToken(token: ISyntaxToken): void; + public position(): number; + public skip(element: ISyntaxElement): void; + } +} +declare module TypeScript { + interface ITokenInformation { + previousToken: ISyntaxToken; + nextToken: ISyntaxToken; + } + class SyntaxInformationMap extends SyntaxWalker { + private trackParents; + private trackPreviousToken; + private tokenToInformation; + private elementToPosition; + private _previousToken; + private _previousTokenInformation; + private _currentPosition; + private _elementToParent; + private _parentStack; + constructor(trackParents: boolean, trackPreviousToken: boolean); + static create(node: SyntaxNode, trackParents: boolean, trackPreviousToken: boolean): SyntaxInformationMap; + public visitNode(node: SyntaxNode): void; + public visitToken(token: ISyntaxToken): void; + public parent(element: ISyntaxElement): SyntaxNode; + public fullStart(element: ISyntaxElement): number; + public start(element: ISyntaxElement): number; + public end(element: ISyntaxElement): number; + public previousToken(token: ISyntaxToken): ISyntaxToken; + public tokenInformation(token: ISyntaxToken): ITokenInformation; + public firstTokenInLineContainingToken(token: ISyntaxToken): ISyntaxToken; + public isFirstTokenInLine(token: ISyntaxToken): boolean; + private isFirstTokenInLineWorker(information); + } +} +declare module TypeScript { + class SyntaxNodeInvariantsChecker extends SyntaxWalker { + private tokenTable; + static checkInvariants(node: SyntaxNode): void; + public visitToken(token: ISyntaxToken): void; + } +} +declare module TypeScript { + class DepthLimitedWalker extends PositionTrackingWalker { + private _depth; + private _maximumDepth; + constructor(maximumDepth: number); + public visitNode(node: SyntaxNode): void; + } +} +declare module TypeScript.Parser { + function parse(fileName: string, text: ISimpleText, isDeclaration: boolean, options: ParseOptions): SyntaxTree; + function incrementalParse(oldSyntaxTree: SyntaxTree, textChangeRange: TextChangeRange, newText: ISimpleText): SyntaxTree; +} +declare module TypeScript { + class SyntaxTree { + private _sourceUnit; + private _isDeclaration; + private _parserDiagnostics; + private _allDiagnostics; + private _fileName; + private _lineMap; + private _parseOptions; + constructor(sourceUnit: SourceUnitSyntax, isDeclaration: boolean, diagnostics: Diagnostic[], fileName: string, lineMap: LineMap, parseOtions: ParseOptions); + public toJSON(key: any): any; + public sourceUnit(): SourceUnitSyntax; + public isDeclaration(): boolean; + private computeDiagnostics(); + public diagnostics(): Diagnostic[]; + public fileName(): string; + public lineMap(): LineMap; + public parseOptions(): ParseOptions; + public structuralEquals(tree: SyntaxTree): boolean; + } +} +declare module TypeScript { + class Unicode { + static unicodeES3IdentifierStart: number[]; + static unicodeES3IdentifierPart: number[]; + static unicodeES5IdentifierStart: number[]; + static unicodeES5IdentifierPart: number[]; + static lookupInUnicodeMap(code: number, map: number[]): boolean; + static isIdentifierStart(code: number, languageVersion: LanguageVersion): boolean; + static isIdentifierPart(code: number, languageVersion: LanguageVersion): boolean; + } +} +declare module TypeScript { + module CompilerDiagnostics { + var debug: boolean; + interface IDiagnosticWriter { + Alert(output: string): void; + } + var diagnosticWriter: IDiagnosticWriter; + var analysisPass: number; + function Alert(output: string): void; + function debugPrint(s: string): void; + function assert(condition: boolean, s: string): void; + } + interface ILogger { + information(): boolean; + debug(): boolean; + warning(): boolean; + error(): boolean; + fatal(): boolean; + log(s: string): void; + } + class NullLogger implements ILogger { + public information(): boolean; + public debug(): boolean; + public warning(): boolean; + public error(): boolean; + public fatal(): boolean; + public log(s: string): void; + } + function timeFunction(logger: ILogger, funcDescription: string, func: () => any): any; +} +declare module TypeScript { + class Document { + private _compiler; + private _semanticInfoChain; + public fileName: string; + public referencedFiles: string[]; + private _scriptSnapshot; + public byteOrderMark: ByteOrderMark; + public version: number; + public isOpen: boolean; + private _syntaxTree; + private _topLevelDecl; + private _diagnostics; + private _bloomFilter; + private _sourceUnit; + private _lineMap; + private _declASTMap; + private _astDeclMap; + private _amdDependencies; + private _externalModuleIndicatorSpan; + constructor(_compiler: TypeScriptCompiler, _semanticInfoChain: SemanticInfoChain, fileName: string, referencedFiles: string[], _scriptSnapshot: IScriptSnapshot, byteOrderMark: ByteOrderMark, version: number, isOpen: boolean, _syntaxTree: SyntaxTree, _topLevelDecl: PullDecl); + public invalidate(): void; + public isDeclareFile(): boolean; + private cacheSyntaxTreeInfo(syntaxTree); + private getAmdDependency(comment); + private getImplicitImportSpan(sourceUnitLeadingTrivia); + private getImplicitImportSpanWorker(trivia, position); + private getTopLevelImportOrExportSpan(node); + public sourceUnit(): SourceUnit; + public diagnostics(): Diagnostic[]; + public lineMap(): LineMap; + public isExternalModule(): boolean; + public externalModuleIndicatorSpan(): TextSpan; + public amdDependencies(): string[]; + public syntaxTree(): SyntaxTree; + public bloomFilter(): BloomFilter; + public emitToOwnOutputFile(): boolean; + public update(scriptSnapshot: IScriptSnapshot, version: number, isOpen: boolean, textChangeRange: TextChangeRange): Document; + static create(compiler: TypeScriptCompiler, semanticInfoChain: SemanticInfoChain, fileName: string, scriptSnapshot: IScriptSnapshot, byteOrderMark: ByteOrderMark, version: number, isOpen: boolean, referencedFiles: string[]): Document; + public topLevelDecl(): PullDecl; + public _getDeclForAST(ast: AST): PullDecl; + public getEnclosingDecl(ast: AST): PullDecl; + public _setDeclForAST(ast: AST, decl: PullDecl): void; + public _getASTForDecl(decl: PullDecl): AST; + public _setASTForDecl(decl: PullDecl, ast: AST): void; + } +} +declare module TypeScript { + function hasFlag(val: number, flag: number): boolean; + enum TypeRelationshipFlags { + SuccessfulComparison = 0, + RequiredPropertyIsMissing = 2, + IncompatibleSignatures = 4, + SourceSignatureHasTooManyParameters = 3, + IncompatibleReturnTypes = 16, + IncompatiblePropertyTypes = 32, + IncompatibleParameterTypes = 64, + InconsistantPropertyAccesibility = 128, + } + enum ModuleGenTarget { + Unspecified = 0, + Synchronous = 1, + Asynchronous = 2, + } +} +declare module TypeScript { + function createIntrinsicsObject(): IIndexable; + interface IHashTable { + getAllKeys(): string[]; + add(key: string, data: T): boolean; + addOrUpdate(key: string, data: T): boolean; + map(fn: (k: string, value: T, context: any) => void, context: any): void; + every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + count(): number; + lookup(key: string): T; + } + class StringHashTable implements IHashTable { + private itemCount; + private table; + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public count(): number; + public lookup(key: string): T; + public remove(key: string): void; + } + class IdentiferNameHashTable extends StringHashTable { + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: any, context: any) => void, context: any): boolean; + public lookup(key: string): T; + } +} +declare module TypeScript { + interface IParameters { + length: number; + lastParameterIsRest(): boolean; + ast: AST; + astAt(index: number): AST; + identifierAt(index: number): Identifier; + typeAt(index: number): AST; + initializerAt(index: number): EqualsValueClause; + isOptionalAt(index: number): boolean; + } +} +declare module TypeScript.ASTHelpers { + function scriptIsElided(sourceUnit: SourceUnit): boolean; + function moduleIsElided(declaration: ModuleDeclaration): boolean; + function enumIsElided(declaration: EnumDeclaration): boolean; + function isValidAstNode(ast: IASTSpan): boolean; + function getAstAtPosition(script: AST, pos: number, useTrailingTriviaAsLimChar?: boolean, forceInclusive?: boolean): AST; + function getExtendsHeritageClause(clauses: ISyntaxList2): HeritageClause; + function getImplementsHeritageClause(clauses: ISyntaxList2): HeritageClause; + function isCallExpression(ast: AST): boolean; + function isCallExpressionTarget(ast: AST): boolean; + function isDeclarationASTOrDeclarationNameAST(ast: AST): boolean; + function getEnclosingParameterForInitializer(ast: AST): Parameter; + function getEnclosingMemberVariableDeclaration(ast: AST): MemberVariableDeclaration; + function isNameOfFunction(ast: AST): boolean; + function isNameOfMemberFunction(ast: AST): boolean; + function isNameOfMemberAccessExpression(ast: AST): boolean; + function isRightSideOfQualifiedName(ast: AST): boolean; + function parentIsModuleDeclaration(ast: AST): boolean; + function parametersFromIdentifier(id: Identifier): IParameters; + function parametersFromParameter(parameter: Parameter): IParameters; + function parametersFromParameterList(list: ParameterList): IParameters; + function isDeclarationAST(ast: AST): boolean; + function docComments(ast: AST): Comment[]; + function getParameterList(ast: AST): ParameterList; + function getType(ast: AST): AST; + function getVariableDeclaratorModifiers(variableDeclarator: VariableDeclarator): PullElementFlags[]; + function isIntegerLiteralAST(expression: AST): boolean; + function getEnclosingModuleDeclaration(ast: AST): ModuleDeclaration; + function getModuleDeclarationFromNameAST(ast: AST): ModuleDeclaration; + function isLastNameOfModule(ast: ModuleDeclaration, astName: AST): boolean; + function getNameOfIdenfierOrQualifiedName(name: AST): string; + function getModuleNames(name: AST, result?: Identifier[]): Identifier[]; +} +declare module TypeScript { + class AstWalkOptions { + public goChildren: boolean; + public stopWalking: boolean; + } + interface IAstWalker { + options: AstWalkOptions; + state: any; + } + class AstWalkerFactory { + public walk(ast: AST, pre: (ast: AST, walker: IAstWalker) => void, post?: (ast: AST, walker: IAstWalker) => void, state?: any): void; + public simpleWalk(ast: AST, pre: (ast: AST, state: any) => void, post?: (ast: AST, state: any) => void, state?: any): void; + } + function getAstWalkerFactory(): AstWalkerFactory; +} +declare module TypeScript { + class Base64VLQFormat { + static encode(inValue: number): string; + static decode(inString: string): { + value: number; + rest: string; + }; + } +} +declare module TypeScript { + class SourceMapPosition { + public sourceLine: number; + public sourceColumn: number; + public emittedLine: number; + public emittedColumn: number; + } + class SourceMapping { + public start: SourceMapPosition; + public end: SourceMapPosition; + public nameIndex: number; + public childMappings: SourceMapping[]; + } + class SourceMapEntry { + public emittedFile: string; + public emittedLine: number; + public emittedColumn: number; + public sourceFile: string; + public sourceLine: number; + public sourceColumn: number; + public sourceName: string; + constructor(emittedFile: string, emittedLine: number, emittedColumn: number, sourceFile: string, sourceLine: number, sourceColumn: number, sourceName: string); + } + class SourceMapper { + private jsFile; + private sourceMapOut; + static MapFileExtension: string; + private jsFileName; + private sourceMapPath; + private sourceMapDirectory; + private sourceRoot; + public names: string[]; + private mappingLevel; + private tsFilePaths; + private allSourceMappings; + public currentMappings: SourceMapping[][]; + public currentNameIndex: number[]; + private sourceMapEntries; + constructor(jsFile: TextWriter, sourceMapOut: TextWriter, document: Document, jsFilePath: string, emitOptions: EmitOptions, resolvePath: (path: string) => string); + public getOutputFile(): OutputFile; + public increaseMappingLevel(ast: IASTSpan): void; + public decreaseMappingLevel(ast: IASTSpan): void; + public setNewSourceFile(document: Document, emitOptions: EmitOptions): void; + private setSourceMapOptions(document, jsFilePath, emitOptions, resolvePath); + private setNewSourceFilePath(document, emitOptions); + public emitSourceMapping(): void; + } +} +declare module TypeScript { + enum EmitContainer { + Prog = 0, + Module = 1, + DynamicModule = 2, + Class = 3, + Constructor = 4, + Function = 5, + Args = 6, + Interface = 7, + } + class EmitState { + public column: number; + public line: number; + public container: EmitContainer; + constructor(); + } + class EmitOptions { + public resolvePath: (path: string) => string; + private _diagnostic; + private _settings; + private _commonDirectoryPath; + private _sharedOutputFile; + private _sourceRootDirectory; + private _sourceMapRootDirectory; + private _outputDirectory; + public diagnostic(): Diagnostic; + public commonDirectoryPath(): string; + public sharedOutputFile(): string; + public sourceRootDirectory(): string; + public sourceMapRootDirectory(): string; + public outputDirectory(): string; + public compilationSettings(): ImmutableCompilationSettings; + constructor(compiler: TypeScriptCompiler, resolvePath: (path: string) => string); + private determineCommonDirectoryPath(compiler); + } + class Indenter { + static indentStep: number; + static indentStepString: string; + static indentStrings: string[]; + public indentAmt: number; + public increaseIndent(): void; + public decreaseIndent(): void; + public getIndent(): string; + } + function lastParameterIsRest(parameterList: ParameterList): boolean; + class Emitter { + public emittingFileName: string; + public outfile: TextWriter; + public emitOptions: EmitOptions; + private semanticInfoChain; + public globalThisCapturePrologueEmitted: boolean; + public extendsPrologueEmitted: boolean; + public thisClassNode: ClassDeclaration; + public inArrowFunction: boolean; + public moduleName: string; + public emitState: EmitState; + public indenter: Indenter; + public sourceMapper: SourceMapper; + public captureThisStmtString: string; + private currentVariableDeclaration; + private declStack; + private exportAssignment; + private inWithBlock; + public document: Document; + private detachedCommentsElement; + constructor(emittingFileName: string, outfile: TextWriter, emitOptions: EmitOptions, semanticInfoChain: SemanticInfoChain); + private pushDecl(decl); + private popDecl(decl); + private getEnclosingDecl(); + public setExportAssignment(exportAssignment: ExportAssignment): void; + public getExportAssignment(): ExportAssignment; + public setDocument(document: Document): void; + public shouldEmitImportDeclaration(importDeclAST: ImportDeclaration): boolean; + public emitImportDeclaration(importDeclAST: ImportDeclaration): void; + public createSourceMapper(document: Document, jsFileName: string, jsFile: TextWriter, sourceMapOut: TextWriter, resolvePath: (path: string) => string): void; + public setSourceMapperNewSourceFile(document: Document): void; + private updateLineAndColumn(s); + public writeToOutputWithSourceMapRecord(s: string, astSpan: IASTSpan): void; + public writeToOutput(s: string): void; + public writeLineToOutput(s: string, force?: boolean): void; + public writeCaptureThisStatement(ast: AST): void; + public setContainer(c: number): number; + private getIndentString(); + public emitIndent(): void; + public emitComment(comment: Comment, trailing: boolean, first: boolean): void; + public emitComments(ast: AST, pre: boolean, onlyPinnedOrTripleSlashComments?: boolean): void; + private isPinnedOrTripleSlash(comment); + public emitCommentsArray(comments: Comment[], trailing: boolean): void; + public emitObjectLiteralExpression(objectLiteral: ObjectLiteralExpression): void; + public emitArrayLiteralExpression(arrayLiteral: ArrayLiteralExpression): void; + public emitObjectCreationExpression(objectCreationExpression: ObjectCreationExpression): void; + public getConstantDecl(dotExpr: MemberAccessExpression): PullEnumElementDecl; + public tryEmitConstant(dotExpr: MemberAccessExpression): boolean; + public emitInvocationExpression(callNode: InvocationExpression): void; + private emitParameterList(list); + private emitFunctionParameters(parameters); + private emitFunctionBodyStatements(name, funcDecl, parameterList, block, bodyExpression); + private emitDefaultValueAssignments(parameters); + private emitRestParameterInitializer(parameters); + private getImportDecls(fileName); + public getModuleImportAndDependencyList(sourceUnit: SourceUnit): { + importList: string; + dependencyList: string; + }; + public shouldCaptureThis(ast: AST): boolean; + public emitEnum(moduleDecl: EnumDeclaration): void; + private getModuleDeclToVerifyChildNameCollision(moduleDecl, changeNameIfAnyDeclarationInContext); + private hasChildNameCollision(moduleName, parentDecl); + private getModuleName(moduleDecl, changeNameIfAnyDeclarationInContext?); + private emitModuleDeclarationWorker(moduleDecl); + public emitSingleModuleDeclaration(moduleDecl: ModuleDeclaration, moduleName: IASTToken): void; + public emitEnumElement(varDecl: EnumElement): void; + public emitElementAccessExpression(expression: ElementAccessExpression): void; + public emitSimpleArrowFunctionExpression(arrowFunction: SimpleArrowFunctionExpression): void; + public emitParenthesizedArrowFunctionExpression(arrowFunction: ParenthesizedArrowFunctionExpression): void; + private emitAnyArrowFunctionExpression(arrowFunction, funcName, parameters, block, expression); + public emitConstructor(funcDecl: ConstructorDeclaration): void; + public emitGetAccessor(accessor: GetAccessor): void; + public emitSetAccessor(accessor: SetAccessor): void; + public emitFunctionExpression(funcDecl: FunctionExpression): void; + public emitFunction(funcDecl: FunctionDeclaration): void; + public emitAmbientVarDecl(varDecl: VariableDeclarator): void; + public emitVarDeclVar(): void; + public emitVariableDeclaration(declaration: VariableDeclaration): void; + private emitMemberVariableDeclaration(varDecl); + public emitVariableDeclarator(varDecl: VariableDeclarator): void; + private symbolIsUsedInItsEnclosingContainer(symbol, dynamic?); + private shouldQualifySymbolNameWithParentName(symbol); + private getSymbolForEmit(ast); + public emitName(name: Identifier, addThis: boolean): void; + public recordSourceMappingNameStart(name: string): void; + public recordSourceMappingNameEnd(): void; + public recordSourceMappingStart(ast: IASTSpan): void; + public recordSourceMappingEnd(ast: IASTSpan): void; + public getOutputFiles(): OutputFile[]; + private emitParameterPropertyAndMemberVariableAssignments(); + private isOnSameLine(pos1, pos2); + private emitCommaSeparatedList(parent, list, buffer, preserveNewLines); + public emitList(list: ISyntaxList2, useNewLineSeparator?: boolean, startInclusive?: number, endExclusive?: number): void; + public emitSeparatedList(list: ISeparatedSyntaxList2, useNewLineSeparator?: boolean, startInclusive?: number, endExclusive?: number): void; + private isDirectivePrologueElement(node); + public emitSpaceBetweenConstructs(node1: AST, node2: AST): void; + private getDetachedComments(element); + private emitPossibleCopyrightHeaders(script); + private emitDetachedComments(list); + public emitScriptElements(sourceUnit: SourceUnit): void; + public emitConstructorStatements(funcDecl: ConstructorDeclaration): void; + public emitJavascript(ast: AST, startLine: boolean): void; + public emitAccessorMemberDeclaration(funcDecl: AST, name: IASTToken, className: string, isProto: boolean): void; + private emitAccessorBody(funcDecl, parameterList, block); + public emitClass(classDecl: ClassDeclaration): void; + private emitClassMembers(classDecl); + private emitClassMemberFunctionDeclaration(classDecl, funcDecl); + private requiresExtendsBlock(moduleElements); + public emitPrologue(sourceUnit: SourceUnit): void; + public emitThis(): void; + public emitBlockOrStatement(node: AST): void; + public emitLiteralExpression(expression: LiteralExpression): void; + public emitThisExpression(expression: ThisExpression): void; + public emitSuperExpression(expression: SuperExpression): void; + public emitParenthesizedExpression(parenthesizedExpression: ParenthesizedExpression): void; + public emitCastExpression(expression: CastExpression): void; + public emitPrefixUnaryExpression(expression: PrefixUnaryExpression): void; + public emitPostfixUnaryExpression(expression: PostfixUnaryExpression): void; + public emitTypeOfExpression(expression: TypeOfExpression): void; + public emitDeleteExpression(expression: DeleteExpression): void; + public emitVoidExpression(expression: VoidExpression): void; + private canEmitDottedNameMemberAccessExpression(expression); + private emitDottedNameMemberAccessExpression(expression); + private emitDottedNameMemberAccessExpressionRecurse(expression); + public emitMemberAccessExpression(expression: MemberAccessExpression): void; + public emitQualifiedName(name: QualifiedName): void; + public emitBinaryExpression(expression: BinaryExpression): void; + public emitSimplePropertyAssignment(property: SimplePropertyAssignment): void; + public emitFunctionPropertyAssignment(funcProp: FunctionPropertyAssignment): void; + public emitConditionalExpression(expression: ConditionalExpression): void; + public emitThrowStatement(statement: ThrowStatement): void; + public emitExpressionStatement(statement: ExpressionStatement): void; + public emitLabeledStatement(statement: LabeledStatement): void; + public emitBlock(block: Block): void; + public emitBreakStatement(jump: BreakStatement): void; + public emitContinueStatement(jump: ContinueStatement): void; + public emitWhileStatement(statement: WhileStatement): void; + public emitDoStatement(statement: DoStatement): void; + public emitIfStatement(statement: IfStatement): void; + public emitElseClause(elseClause: ElseClause): void; + public emitReturnStatement(statement: ReturnStatement): void; + public emitForInStatement(statement: ForInStatement): void; + public emitForStatement(statement: ForStatement): void; + public emitWithStatement(statement: WithStatement): void; + public emitSwitchStatement(statement: SwitchStatement): void; + public emitCaseSwitchClause(clause: CaseSwitchClause): void; + private emitSwitchClauseBody(body); + public emitDefaultSwitchClause(clause: DefaultSwitchClause): void; + public emitTryStatement(statement: TryStatement): void; + public emitCatchClause(clause: CatchClause): void; + public emitFinallyClause(clause: FinallyClause): void; + public emitDebuggerStatement(statement: DebuggerStatement): void; + public emitNumericLiteral(literal: NumericLiteral): void; + public emitRegularExpressionLiteral(literal: RegularExpressionLiteral): void; + public emitStringLiteral(literal: StringLiteral): void; + public emitEqualsValueClause(clause: EqualsValueClause): void; + public emitParameter(parameter: Parameter): void; + public emitConstructorDeclaration(declaration: ConstructorDeclaration): void; + public shouldEmitFunctionDeclaration(declaration: FunctionDeclaration): boolean; + public emitFunctionDeclaration(declaration: FunctionDeclaration): void; + private emitSourceUnit(sourceUnit); + public shouldEmitEnumDeclaration(declaration: EnumDeclaration): boolean; + public emitEnumDeclaration(declaration: EnumDeclaration): void; + public shouldEmitModuleDeclaration(declaration: ModuleDeclaration): boolean; + private emitModuleDeclaration(declaration); + public shouldEmitClassDeclaration(declaration: ClassDeclaration): boolean; + public emitClassDeclaration(declaration: ClassDeclaration): void; + public shouldEmitInterfaceDeclaration(declaration: InterfaceDeclaration): boolean; + public emitInterfaceDeclaration(declaration: InterfaceDeclaration): void; + private firstVariableDeclarator(statement); + private isNotAmbientOrHasInitializer(variableStatement); + public shouldEmitVariableStatement(statement: VariableStatement): boolean; + public emitVariableStatement(statement: VariableStatement): void; + public emitGenericType(type: GenericType): void; + private shouldEmit(ast); + private emit(ast); + private emitWorker(ast); + } + function getLastConstructor(classDecl: ClassDeclaration): ConstructorDeclaration; + function getTrimmedTextLines(comment: Comment): string[]; +} +declare module TypeScript { + class MemberName { + public prefix: string; + public suffix: string; + public isString(): boolean; + public isArray(): boolean; + public isMarker(): boolean; + public toString(): string; + static memberNameToString(memberName: MemberName, markerInfo?: number[], markerBaseLength?: number): string; + static create(text: string): MemberName; + static create(entry: MemberName, prefix: string, suffix: string): MemberName; + } + class MemberNameString extends MemberName { + public text: string; + constructor(text: string); + public isString(): boolean; + } + class MemberNameArray extends MemberName { + public delim: string; + public entries: MemberName[]; + public isArray(): boolean; + public add(entry: MemberName): void; + public addAll(entries: MemberName[]): void; + constructor(); + } +} +declare module TypeScript { + function stripStartAndEndQuotes(str: string): string; + function isSingleQuoted(str: string): boolean; + function isDoubleQuoted(str: string): boolean; + function isQuoted(str: string): boolean; + function quoteStr(str: string): string; + function switchToForwardSlashes(path: string): string; + function trimModName(modName: string): string; + function getDeclareFilePath(fname: string): string; + function isTSFile(fname: string): boolean; + function isDTSFile(fname: string): boolean; + function getPrettyName(modPath: string, quote?: boolean, treatAsFileName?: boolean): any; + function getPathComponents(path: string): string[]; + function getRelativePathToFixedPath(fixedModFilePath: string, absoluteModPath: string, isAbsoultePathURL?: boolean): string; + function changePathToDTS(modPath: string): string; + function isRelative(path: string): boolean; + function isRooted(path: string): boolean; + function getRootFilePath(outFname: string): string; + function filePathComponents(fullPath: string): string[]; + function filePath(fullPath: string): string; + function convertToDirectoryPath(dirPath: string): string; + function normalizePath(path: string): string; +} +declare module TypeScript { + interface IFileReference extends ILineAndCharacter { + path: string; + isResident: boolean; + position: number; + length: number; + } +} +declare module TypeScript { + interface IPreProcessedFileInfo { + referencedFiles: IFileReference[]; + importedFiles: IFileReference[]; + diagnostics: Diagnostic[]; + isLibFile: boolean; + } + var tripleSlashReferenceRegExp: RegExp; + function preProcessFile(fileName: string, sourceText: IScriptSnapshot, readImportFiles?: boolean): IPreProcessedFileInfo; + function getParseOptions(settings: ImmutableCompilationSettings): ParseOptions; + function getReferencedFiles(fileName: string, sourceText: IScriptSnapshot): IFileReference[]; +} +declare module TypeScript { + interface IResolvedFile { + path: string; + referencedFiles: string[]; + importedFiles: string[]; + } + interface IReferenceResolverHost { + getScriptSnapshot(fileName: string): IScriptSnapshot; + resolveRelativePath(path: string, directory: string): string; + fileExists(path: string): boolean; + directoryExists(path: string): boolean; + getParentDirectory(path: string): string; + } + class ReferenceResolutionResult { + public resolvedFiles: IResolvedFile[]; + public diagnostics: Diagnostic[]; + public seenNoDefaultLibTag: boolean; + } + class ReferenceResolver { + private useCaseSensitiveFileResolution; + private inputFileNames; + private host; + private visited; + constructor(inputFileNames: string[], host: IReferenceResolverHost, useCaseSensitiveFileResolution: boolean); + static resolve(inputFileNames: string[], host: IReferenceResolverHost, useCaseSensitiveFileResolution: boolean): ReferenceResolutionResult; + public resolveInputFiles(): ReferenceResolutionResult; + private resolveIncludedFile(path, referenceLocation, resolutionResult); + private resolveImportedFile(path, referenceLocation, resolutionResult); + private resolveFile(normalizedPath, resolutionResult); + private getNormalizedFilePath(path, parentFilePath); + private getUniqueFileId(filePath); + private recordVisitedFile(filePath); + private isVisited(filePath); + private isSameFile(filePath1, filePath2); + } +} +declare module TypeScript { + class TextWriter { + private name; + private writeByteOrderMark; + private outputFileType; + private contents; + public onNewLine: boolean; + constructor(name: string, writeByteOrderMark: boolean, outputFileType: OutputFileType); + public Write(s: string): void; + public WriteLine(s: string): void; + public Close(): void; + public getOutputFile(): OutputFile; + } + class DeclarationEmitter { + private emittingFileName; + public document: Document; + private compiler; + private emitOptions; + private semanticInfoChain; + private declFile; + private indenter; + private emittedReferencePaths; + constructor(emittingFileName: string, document: Document, compiler: TypeScriptCompiler, emitOptions: EmitOptions, semanticInfoChain: SemanticInfoChain); + public getOutputFile(): OutputFile; + public emitDeclarations(sourceUnit: SourceUnit): void; + private emitDeclarationsForList(list); + private emitSeparatedList(list); + private emitDeclarationsForAST(ast); + private getIndentString(declIndent?); + private emitIndent(); + private canEmitDeclarations(declAST); + private getDeclFlagsString(pullDecl, typeString); + private emitDeclFlags(declarationAST, typeString); + private emitTypeNamesMember(memberName, emitIndent?); + private emitTypeSignature(ast, type); + private emitComment(comment); + private emitDeclarationComments(ast, endLine?); + private writeDeclarationComments(declComments, endLine?); + private emitTypeOfVariableDeclaratorOrParameter(boundDecl); + private emitPropertySignature(varDecl); + private emitVariableDeclarator(varDecl, isFirstVarInList, isLastVarInList); + private emitClassElementModifiers(modifiers); + private emitDeclarationsForMemberVariableDeclaration(varDecl); + private emitDeclarationsForVariableStatement(variableStatement); + private emitDeclarationsForVariableDeclaration(variableDeclaration); + private emitArgDecl(argDecl, id, isOptional, isPrivate); + private isOverloadedCallSignature(funcDecl); + private emitDeclarationsForConstructorDeclaration(funcDecl); + private emitParameterList(isPrivate, parameterList); + private emitParameters(isPrivate, parameterList); + private emitMemberFunctionDeclaration(funcDecl); + private emitCallSignature(funcDecl); + private emitConstructSignature(funcDecl); + private emitMethodSignature(funcDecl); + private emitDeclarationsForFunctionDeclaration(funcDecl); + private emitIndexMemberDeclaration(funcDecl); + private emitIndexSignature(funcDecl); + private emitBaseList(bases, useExtendsList); + private emitAccessorDeclarationComments(funcDecl); + private emitDeclarationsForGetAccessor(funcDecl); + private emitDeclarationsForSetAccessor(funcDecl); + private emitMemberAccessorDeclaration(funcDecl, modifiers, name); + private emitClassMembersFromConstructorDefinition(funcDecl); + private emitDeclarationsForClassDeclaration(classDecl); + private emitHeritageClauses(clauses); + private emitHeritageClause(clause); + static getEnclosingContainer(ast: AST): AST; + private emitTypeParameters(typeParams, funcSignature?); + private emitDeclarationsForInterfaceDeclaration(interfaceDecl); + private emitDeclarationsForImportDeclaration(importDeclAST); + private emitDeclarationsForEnumDeclaration(moduleDecl); + private emitDeclarationsForModuleDeclaration(moduleDecl); + private emitDeclarationsForExportAssignment(ast); + private resolveScriptReference(document, reference); + private emitReferencePaths(sourceUnit); + private emitDeclarationsForSourceUnit(sourceUnit); + } +} +declare module TypeScript { + class BloomFilter { + private bitArray; + private hashFunctionCount; + static falsePositiveProbability: number; + constructor(expectedCount: number); + static computeM(expectedCount: number): number; + static computeK(expectedCount: number): number; + private computeHash(key, seed); + public addKeys(keys: IIndexable): void; + public add(value: string): void; + public probablyContains(value: string): boolean; + public isEquivalent(filter: BloomFilter): boolean; + static isEquivalent(array1: boolean[], array2: boolean[]): boolean; + } +} +declare module TypeScript { + class IdentifierWalker extends SyntaxWalker { + public list: IIndexable; + constructor(list: IIndexable); + public visitToken(token: ISyntaxToken): void; + } +} +declare module TypeScript { + class CompilationSettings { + public propagateEnumConstants: boolean; + public removeComments: boolean; + public watch: boolean; + public noResolve: boolean; + public allowAutomaticSemicolonInsertion: boolean; + public noImplicitAny: boolean; + public noLib: boolean; + public codeGenTarget: LanguageVersion; + public moduleGenTarget: ModuleGenTarget; + public outFileOption: string; + public outDirOption: string; + public mapSourceFiles: boolean; + public mapRoot: string; + public sourceRoot: string; + public generateDeclarationFiles: boolean; + public useCaseSensitiveFileResolution: boolean; + public gatherDiagnostics: boolean; + public codepage: number; + public createFileLog: boolean; + } + class ImmutableCompilationSettings { + private static _defaultSettings; + private _propagateEnumConstants; + private _removeComments; + private _watch; + private _noResolve; + private _allowAutomaticSemicolonInsertion; + private _noImplicitAny; + private _noLib; + private _codeGenTarget; + private _moduleGenTarget; + private _outFileOption; + private _outDirOption; + private _mapSourceFiles; + private _mapRoot; + private _sourceRoot; + private _generateDeclarationFiles; + private _useCaseSensitiveFileResolution; + private _gatherDiagnostics; + private _codepage; + private _createFileLog; + public propagateEnumConstants(): boolean; + public removeComments(): boolean; + public watch(): boolean; + public noResolve(): boolean; + public allowAutomaticSemicolonInsertion(): boolean; + public noImplicitAny(): boolean; + public noLib(): boolean; + public codeGenTarget(): LanguageVersion; + public moduleGenTarget(): ModuleGenTarget; + public outFileOption(): string; + public outDirOption(): string; + public mapSourceFiles(): boolean; + public mapRoot(): string; + public sourceRoot(): string; + public generateDeclarationFiles(): boolean; + public useCaseSensitiveFileResolution(): boolean; + public gatherDiagnostics(): boolean; + public codepage(): number; + public createFileLog(): boolean; + constructor(propagateEnumConstants: boolean, removeComments: boolean, watch: boolean, noResolve: boolean, allowAutomaticSemicolonInsertion: boolean, noImplicitAny: boolean, noLib: boolean, codeGenTarget: LanguageVersion, moduleGenTarget: ModuleGenTarget, outFileOption: string, outDirOption: string, mapSourceFiles: boolean, mapRoot: string, sourceRoot: string, generateDeclarationFiles: boolean, useCaseSensitiveFileResolution: boolean, gatherDiagnostics: boolean, codepage: number, createFileLog: boolean); + static defaultSettings(): ImmutableCompilationSettings; + static fromCompilationSettings(settings: CompilationSettings): ImmutableCompilationSettings; + public toCompilationSettings(): any; + } +} +declare module TypeScript { + enum PullElementFlags { + None = 0, + Exported = 1, + Private = 2, + Public = 4, + Ambient = 8, + Static = 16, + Optional = 128, + Signature = 2048, + Enum = 4096, + ArrowFunction = 8192, + ClassConstructorVariable = 16384, + InitializedModule = 32768, + InitializedDynamicModule = 65536, + MustCaptureThis = 262144, + DeclaredInAWithBlock = 2097152, + HasReturnStatement = 4194304, + PropertyParameter = 8388608, + IsAnnotatedWithAny = 16777216, + HasDefaultArgs = 33554432, + ConstructorParameter = 67108864, + ImplicitVariable = 118784, + SomeInitializedModule = 102400, + } + function hasModifier(modifiers: PullElementFlags[], flag: PullElementFlags): boolean; + enum PullElementKind { + None = 0, + Global = 0, + Script = 1, + Primitive = 2, + Container = 4, + Class = 8, + Interface = 16, + DynamicModule = 32, + Enum = 64, + TypeAlias = 128, + ObjectLiteral = 256, + Variable = 512, + CatchVariable = 1024, + Parameter = 2048, + Property = 4096, + TypeParameter = 8192, + Function = 16384, + ConstructorMethod = 32768, + Method = 65536, + FunctionExpression = 131072, + GetAccessor = 262144, + SetAccessor = 524288, + CallSignature = 1048576, + ConstructSignature = 2097152, + IndexSignature = 4194304, + ObjectType = 8388608, + FunctionType = 16777216, + ConstructorType = 33554432, + EnumMember = 67108864, + WithBlock = 134217728, + CatchBlock = 268435456, + All = 536869887, + SomeFunction = 1032192, + SomeValue = 68147712, + SomeType = 58728795, + AcceptableAlias = 59753052, + SomeContainer = 164, + SomeSignature = 7340032, + SomeTypeReference = 58720272, + SomeInstantiatableType = 8216, + } +} +declare module TypeScript { + class PullDecl { + public kind: PullElementKind; + public name: string; + private declDisplayName; + public semanticInfoChain: SemanticInfoChain; + public declID: number; + public flags: PullElementFlags; + private declGroups; + private childDecls; + private typeParameters; + private synthesizedValDecl; + private containerDecl; + public childDeclTypeCache: IIndexable; + public childDeclValueCache: IIndexable; + public childDeclNamespaceCache: IIndexable; + public childDeclTypeParameterCache: IIndexable; + constructor(declName: string, displayName: string, kind: PullElementKind, declFlags: PullElementFlags, semanticInfoChain: SemanticInfoChain); + public fileName(): string; + public getParentPath(): PullDecl[]; + public getParentDecl(): PullDecl; + public isExternalModule(): boolean; + public getEnclosingDecl(): PullDecl; + public _getEnclosingDeclFromParentDecl(): PullDecl; + public getDisplayName(): string; + public setSymbol(symbol: PullSymbol): void; + public ensureSymbolIsBound(): void; + public getSymbol(): PullSymbol; + public hasSymbol(): boolean; + public setSignatureSymbol(signatureSymbol: PullSignatureSymbol): void; + public getSignatureSymbol(): PullSignatureSymbol; + public hasSignatureSymbol(): boolean; + public setFlags(flags: PullElementFlags): void; + public setFlag(flags: PullElementFlags): void; + public setValueDecl(valDecl: PullDecl): void; + public getValueDecl(): PullDecl; + public getContainerDecl(): PullDecl; + private getChildDeclCache(declKind); + public addChildDecl(childDecl: PullDecl): void; + public searchChildDecls(declName: string, searchKind: PullElementKind): PullDecl[]; + public getChildDecls(): PullDecl[]; + public getTypeParameters(): PullDecl[]; + public addVariableDeclToGroup(decl: PullDecl): void; + public getVariableDeclGroups(): PullDecl[][]; + public hasBeenBound(): boolean; + public isSynthesized(): boolean; + public ast(): AST; + public isRootDecl(): void; + } + class RootPullDecl extends PullDecl { + private _isExternalModule; + private _fileName; + constructor(name: string, fileName: string, kind: PullElementKind, declFlags: PullElementFlags, semanticInfoChain: SemanticInfoChain, isExternalModule: boolean); + public fileName(): string; + public getParentPath(): PullDecl[]; + public getParentDecl(): PullDecl; + public isExternalModule(): boolean; + public getEnclosingDecl(): RootPullDecl; + public isRootDecl(): boolean; + } + class NormalPullDecl extends PullDecl { + private parentDecl; + public _rootDecl: RootPullDecl; + private parentPath; + constructor(declName: string, displayName: string, kind: PullElementKind, declFlags: PullElementFlags, parentDecl: PullDecl, addToParent?: boolean); + public fileName(): string; + public getParentDecl(): PullDecl; + public getParentPath(): PullDecl[]; + public isExternalModule(): boolean; + public getEnclosingDecl(): PullDecl; + public isRootDecl(): boolean; + } + class PullEnumElementDecl extends NormalPullDecl { + public constantValue: number; + constructor(declName: string, displayName: string, parentDecl: PullDecl); + } + class PullFunctionExpressionDecl extends NormalPullDecl { + private functionExpressionName; + constructor(expressionName: string, declFlags: PullElementFlags, parentDecl: PullDecl, displayName?: string); + public getFunctionExpressionName(): string; + } + class PullSynthesizedDecl extends NormalPullDecl { + constructor(declName: string, displayName: string, kind: PullElementKind, declFlags: PullElementFlags, parentDecl: PullDecl, semanticInfoChain: SemanticInfoChain); + public isSynthesized(): boolean; + public fileName(): string; + } + class PullDeclGroup { + public name: string; + private _decls; + constructor(name: string); + public addDecl(decl: PullDecl): void; + public getDecls(): PullDecl[]; + } +} +declare module TypeScript { + var pullSymbolID: number; + var sentinelEmptyArray: any[]; + class PullSymbol { + public pullSymbolID: number; + public name: string; + public kind: PullElementKind; + private _container; + public type: PullTypeSymbol; + private _declarations; + public isResolved: boolean; + public isOptional: boolean; + public inResolution: boolean; + private isSynthesized; + public isVarArg: boolean; + private rootSymbol; + private _enclosingSignature; + private _docComments; + public isPrinting: boolean; + public isAny(): boolean; + public isType(): boolean; + public isTypeReference(): boolean; + public isSignature(): boolean; + public isArrayNamedTypeReference(): boolean; + public isPrimitive(): boolean; + public isAccessor(): boolean; + public isError(): boolean; + public isInterface(): boolean; + public isMethod(): boolean; + public isProperty(): boolean; + public isAlias(): boolean; + public isContainer(): boolean; + constructor(name: string, declKind: PullElementKind); + private findAliasedTypeSymbols(scopeSymbol, skipScopeSymbolAliasesLookIn?, lookIntoOnlyExportedAlias?, aliasSymbols?, visitedScopeDeclarations?); + public getExternalAliasedSymbols(scopeSymbol: PullSymbol): PullTypeAliasSymbol[]; + static _isExternalModuleReferenceAlias(aliasSymbol: PullTypeAliasSymbol): boolean; + private getExportedInternalAliasSymbol(scopeSymbol); + public getAliasSymbolName(scopeSymbol: PullSymbol, aliasNameGetter: (symbol: PullTypeAliasSymbol) => string, aliasPartsNameGetter: (symbol: PullTypeAliasSymbol) => string, skipInternalAlias?: boolean): string; + public _getResolver(): PullTypeResolver; + public _resolveDeclaredSymbol(): PullSymbol; + public getName(scopeSymbol?: PullSymbol, useConstraintInName?: boolean): string; + public getDisplayName(scopeSymbol?: PullSymbol, useConstraintInName?: boolean, skipInternalAliasName?: boolean): string; + public getIsSpecialized(): boolean; + public getRootSymbol(): PullSymbol; + public setRootSymbol(symbol: PullSymbol): void; + public setIsSynthesized(value?: boolean): void; + public getIsSynthesized(): any; + public setEnclosingSignature(signature: PullSignatureSymbol): void; + public getEnclosingSignature(): PullSignatureSymbol; + public addDeclaration(decl: PullDecl): void; + public getDeclarations(): PullDecl[]; + public hasDeclaration(decl: PullDecl): boolean; + public setContainer(containerSymbol: PullTypeSymbol): void; + public getContainer(): PullTypeSymbol; + public setResolved(): void; + public startResolving(): void; + public setUnresolved(): void; + public anyDeclHasFlag(flag: PullElementFlags): boolean; + public allDeclsHaveFlag(flag: PullElementFlags): boolean; + public pathToRoot(): PullSymbol[]; + private static unqualifiedNameReferencesDifferentSymbolInScope(symbol, scopePath, endScopePathIndex); + private findQualifyingSymbolPathInScopeSymbol(scopeSymbol); + public toString(scopeSymbol?: PullSymbol, useConstraintInName?: boolean): string; + public getNamePartForFullName(): string; + public fullName(scopeSymbol?: PullSymbol): string; + public getScopedName(scopeSymbol?: PullSymbol, skipTypeParametersInName?: boolean, useConstraintInName?: boolean, skipInternalAliasName?: boolean): string; + public getScopedNameEx(scopeSymbol?: PullSymbol, skipTypeParametersInName?: boolean, useConstraintInName?: boolean, getPrettyTypeName?: boolean, getTypeParamMarkerInfo?: boolean, skipInternalAliasName?: boolean): MemberName; + public getTypeName(scopeSymbol?: PullSymbol, getPrettyTypeName?: boolean): string; + public getTypeNameEx(scopeSymbol?: PullSymbol, getPrettyTypeName?: boolean): MemberName; + private getTypeNameForFunctionSignature(prefix, scopeSymbol?, getPrettyTypeName?); + public getNameAndTypeName(scopeSymbol?: PullSymbol): string; + public getNameAndTypeNameEx(scopeSymbol?: PullSymbol): MemberName; + static getTypeParameterString(typars: PullTypeSymbol[], scopeSymbol?: PullSymbol, useContraintInName?: boolean): string; + static getTypeParameterStringEx(typeParameters: PullTypeSymbol[], scopeSymbol?: PullSymbol, getTypeParamMarkerInfo?: boolean, useContraintInName?: boolean): MemberNameArray; + static getIsExternallyVisible(symbol: PullSymbol, fromIsExternallyVisibleSymbol: PullSymbol, inIsExternallyVisibleSymbols: PullSymbol[]): boolean; + public isExternallyVisible(inIsExternallyVisibleSymbols?: PullSymbol[]): boolean; + private getDocCommentsOfDecl(decl); + private getDocCommentArray(symbol); + private static getDefaultConstructorSymbolForDocComments(classSymbol); + private getDocCommentText(comments); + private getDocCommentTextValue(comment); + public docComments(useConstructorAsClass?: boolean): string; + private getParameterDocCommentText(param, fncDocComments); + private cleanJSDocComment(content, spacesToRemove?); + private consumeLeadingSpace(line, startIndex, maxSpacesToRemove?); + private isSpaceChar(line, index); + private cleanDocCommentLine(line, jsDocStyleComment, jsDocLineSpaceToRemove?); + } + interface InstantiableSymbol { + getIsSpecialized(): boolean; + getAllowedToReferenceTypeParameters(): PullTypeParameterSymbol[]; + getTypeParameterArgumentMap(): TypeArgumentMap; + } + class PullSignatureSymbol extends PullSymbol implements InstantiableSymbol { + private _isDefinition; + private _memberTypeParameterNameCache; + private _stringConstantOverload; + public parameters: PullSymbol[]; + public _typeParameters: PullTypeParameterSymbol[]; + public returnType: PullTypeSymbol; + public functionType: PullTypeSymbol; + public hasOptionalParam: boolean; + public nonOptionalParamCount: number; + public hasVarArgs: boolean; + private _allowedToReferenceTypeParameters; + private _instantiationCache; + public hasBeenChecked: boolean; + public inWrapCheck: boolean; + public inWrapInfiniteExpandingReferenceCheck: boolean; + private _wrapsTypeParameterCache; + constructor(kind: PullElementKind, _isDefinition?: boolean); + public isDefinition(): boolean; + public isGeneric(): boolean; + public addParameter(parameter: PullSymbol, isOptional?: boolean): void; + public addTypeParameter(typeParameter: PullTypeParameterSymbol): void; + public addTypeParametersFromReturnType(): void; + public getTypeParameters(): PullTypeParameterSymbol[]; + public findTypeParameter(name: string): PullTypeParameterSymbol; + public getTypeParameterArgumentMap(): TypeArgumentMap; + public getAllowedToReferenceTypeParameters(): PullTypeParameterSymbol[]; + public addSpecialization(specializedVersionOfThisSignature: PullSignatureSymbol, typeArgumentMap: TypeArgumentMap): void; + public getSpecialization(typeArgumentMap: TypeArgumentMap): PullSignatureSymbol; + public isStringConstantOverloadSignature(): boolean; + public getParameterTypeAtIndex(iParam: number): PullTypeSymbol; + static getSignatureTypeMemberName(candidateSignature: PullSignatureSymbol, signatures: PullSignatureSymbol[], scopeSymbol: PullSymbol): MemberNameArray; + static getSignaturesTypeNameEx(signatures: PullSignatureSymbol[], prefix: string, shortform: boolean, brackets: boolean, scopeSymbol?: PullSymbol, getPrettyTypeName?: boolean, candidateSignature?: PullSignatureSymbol): MemberName[]; + public toString(scopeSymbol?: PullSymbol, useConstraintInName?: boolean): string; + public getSignatureTypeNameEx(prefix: string, shortform: boolean, brackets: boolean, scopeSymbol?: PullSymbol, getParamMarkerInfo?: boolean, getTypeParamMarkerInfo?: boolean): MemberNameArray; + public forAllParameterTypes(length: number, predicate: (parameterType: PullTypeSymbol, iterationIndex: number) => boolean): boolean; + public forAllCorrespondingParameterTypesInThisAndOtherSignature(otherSignature: PullSignatureSymbol, predicate: (thisSignatureParameterType: PullTypeSymbol, otherSignatureParameterType: PullTypeSymbol, iterationIndex: number) => boolean): boolean; + public wrapsSomeTypeParameter(typeParameterArgumentMap: TypeArgumentMap): boolean; + public getWrappingTypeParameterID(typeParameterArgumentMap: TypeArgumentMap): number; + public getWrappingTypeParameterIDWorker(typeParameterArgumentMap: TypeArgumentMap): number; + public _wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference(enclosingType: PullTypeSymbol, knownWrapMap: IBitMatrix): boolean; + public _wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceWorker(enclosingType: PullTypeSymbol, knownWrapMap: IBitMatrix): boolean; + } + class PullTypeSymbol extends PullSymbol implements InstantiableSymbol { + private _members; + private _enclosedMemberTypes; + private _enclosedMemberContainers; + private _typeParameters; + private _allowedToReferenceTypeParameters; + private _specializedVersionsOfThisType; + private _arrayVersionOfThisType; + private _implementedTypes; + private _extendedTypes; + private _typesThatExplicitlyImplementThisType; + private _typesThatExtendThisType; + private _callSignatures; + private _allCallSignatures; + private _constructSignatures; + private _allConstructSignatures; + private _indexSignatures; + private _allIndexSignatures; + private _allIndexSignaturesOfAugmentedType; + private _memberNameCache; + private _enclosedTypeNameCache; + private _enclosedContainerCache; + private _typeParameterNameCache; + private _containedNonMemberNameCache; + private _containedNonMemberTypeNameCache; + private _containedNonMemberContainerCache; + private _simpleInstantiationCache; + private _complexInstantiationCache; + private _hasGenericSignature; + private _hasGenericMember; + private _hasBaseTypeConflict; + private _knownBaseTypeCount; + private _associatedContainerTypeSymbol; + private _constructorMethod; + private _hasDefaultConstructor; + private _functionSymbol; + private _inMemberTypeNameEx; + public inSymbolPrivacyCheck: boolean; + public inWrapCheck: boolean; + public inWrapInfiniteExpandingReferenceCheck: boolean; + public typeReference: PullTypeReferenceSymbol; + private _widenedType; + private _wrapsTypeParameterCache; + constructor(name: string, kind: PullElementKind); + private _isArrayNamedTypeReference; + public isArrayNamedTypeReference(): boolean; + private computeIsArrayNamedTypeReference(); + public isType(): boolean; + public isClass(): boolean; + public isFunction(): boolean; + public isConstructor(): boolean; + public isTypeParameter(): boolean; + public isTypeVariable(): boolean; + public isError(): boolean; + public isEnum(): boolean; + public getTypeParameterArgumentMap(): TypeArgumentMap; + public isObject(): boolean; + public isFunctionType(): boolean; + public getKnownBaseTypeCount(): number; + public resetKnownBaseTypeCount(): void; + public incrementKnownBaseCount(): void; + public setHasBaseTypeConflict(): void; + public hasBaseTypeConflict(): boolean; + public hasMembers(): boolean; + public setHasGenericSignature(): void; + public getHasGenericSignature(): boolean; + public setHasGenericMember(): void; + public getHasGenericMember(): boolean; + public setAssociatedContainerType(type: PullTypeSymbol): void; + public getAssociatedContainerType(): PullTypeSymbol; + public getArrayType(): PullTypeSymbol; + public getElementType(): PullTypeSymbol; + public setArrayType(arrayType: PullTypeSymbol): void; + public getFunctionSymbol(): PullSymbol; + public setFunctionSymbol(symbol: PullSymbol): void; + public findContainedNonMember(name: string): PullSymbol; + public findContainedNonMemberType(typeName: string, kind?: PullElementKind): PullTypeSymbol; + public findContainedNonMemberContainer(containerName: string, kind?: PullElementKind): PullTypeSymbol; + public addMember(memberSymbol: PullSymbol): void; + public addEnclosedMemberType(enclosedType: PullTypeSymbol): void; + public addEnclosedMemberContainer(enclosedContainer: PullTypeSymbol): void; + public addEnclosedNonMember(enclosedNonMember: PullSymbol): void; + public addEnclosedNonMemberType(enclosedNonMemberType: PullTypeSymbol): void; + public addEnclosedNonMemberContainer(enclosedNonMemberContainer: PullTypeSymbol): void; + public addTypeParameter(typeParameter: PullTypeParameterSymbol): void; + public getMembers(): PullSymbol[]; + public setHasDefaultConstructor(hasOne?: boolean): void; + public getHasDefaultConstructor(): boolean; + public getConstructorMethod(): PullSymbol; + public setConstructorMethod(constructorMethod: PullSymbol): void; + public getTypeParameters(): PullTypeParameterSymbol[]; + public getAllowedToReferenceTypeParameters(): PullTypeParameterSymbol[]; + public isGeneric(): boolean; + private canUseSimpleInstantiationCache(typeArgumentMap); + private getSimpleInstantiationCacheId(typeArgumentMap); + public addSpecialization(specializedVersionOfThisType: PullTypeSymbol, typeArgumentMap: TypeArgumentMap): void; + public getSpecialization(typeArgumentMap: TypeArgumentMap): PullTypeSymbol; + public getKnownSpecializations(): PullTypeSymbol[]; + public getTypeArguments(): PullTypeSymbol[]; + public getTypeArgumentsOrTypeParameters(): PullTypeSymbol[]; + private addCallOrConstructSignaturePrerequisiteBase(signature); + private addCallSignaturePrerequisite(callSignature); + public appendCallSignature(callSignature: PullSignatureSymbol): void; + public insertCallSignatureAtIndex(callSignature: PullSignatureSymbol, index: number): void; + private addConstructSignaturePrerequisite(constructSignature); + public appendConstructSignature(constructSignature: PullSignatureSymbol): void; + public insertConstructSignatureAtIndex(constructSignature: PullSignatureSymbol, index: number): void; + public addIndexSignature(indexSignature: PullSignatureSymbol): void; + public hasOwnCallSignatures(): boolean; + public getOwnCallSignatures(): PullSignatureSymbol[]; + public getCallSignatures(): PullSignatureSymbol[]; + public hasOwnConstructSignatures(): boolean; + public getOwnDeclaredConstructSignatures(): PullSignatureSymbol[]; + public getConstructSignatures(): PullSignatureSymbol[]; + public hasOwnIndexSignatures(): boolean; + public getOwnIndexSignatures(): PullSignatureSymbol[]; + public getIndexSignatures(): PullSignatureSymbol[]; + public getIndexSignaturesOfAugmentedType(resolver: PullTypeResolver, globalFunctionInterface: PullTypeSymbol, globalObjectInterface: PullTypeSymbol): PullSignatureSymbol[]; + private getBaseClassConstructSignatures(baseType); + private getDefaultClassConstructSignature(); + public addImplementedType(implementedType: PullTypeSymbol): void; + public getImplementedTypes(): PullTypeSymbol[]; + public addExtendedType(extendedType: PullTypeSymbol): void; + public getExtendedTypes(): PullTypeSymbol[]; + public addTypeThatExtendsThisType(type: PullTypeSymbol): void; + public getTypesThatExtendThisType(): PullTypeSymbol[]; + public addTypeThatExplicitlyImplementsThisType(type: PullTypeSymbol): void; + public getTypesThatExplicitlyImplementThisType(): PullTypeSymbol[]; + public hasBase(potentialBase: PullTypeSymbol, visited?: PullSymbol[]): boolean; + public isValidBaseKind(baseType: PullTypeSymbol, isExtendedType: boolean): boolean; + public findMember(name: string, lookInParent: boolean): PullSymbol; + public findNestedType(name: string, kind?: PullElementKind): PullTypeSymbol; + public findNestedContainer(name: string, kind?: PullElementKind): PullTypeSymbol; + public getAllMembers(searchDeclKind: PullElementKind, memberVisiblity: GetAllMembersVisiblity): PullSymbol[]; + public findTypeParameter(name: string): PullTypeParameterSymbol; + public setResolved(): void; + public getNamePartForFullName(): string; + public getScopedName(scopeSymbol?: PullSymbol, skipTypeParametersInName?: boolean, useConstraintInName?: boolean, skipInternalAliasName?: boolean): string; + public isNamedTypeSymbol(): boolean; + public toString(scopeSymbol?: PullSymbol, useConstraintInName?: boolean): string; + public getScopedNameEx(scopeSymbol?: PullSymbol, skipTypeParametersInName?: boolean, useConstraintInName?: boolean, getPrettyTypeName?: boolean, getTypeParamMarkerInfo?: boolean, skipInternalAliasName?: boolean, shouldAllowArrayType?: boolean): MemberName; + public hasOnlyOverloadCallSignatures(): boolean; + public getTypeOfSymbol(): PullSymbol; + private getMemberTypeNameEx(topLevel, scopeSymbol?, getPrettyTypeName?); + public getGenerativeTypeClassification(enclosingType: PullTypeSymbol): GenerativeTypeClassification; + public wrapsSomeTypeParameter(typeParameterArgumentMap: CandidateInferenceInfo[]): boolean; + public wrapsSomeTypeParameter(typeParameterArgumentMap: TypeArgumentMap, skipTypeArgumentCheck?: boolean): boolean; + public getWrappingTypeParameterID(typeParameterArgumentMap: TypeArgumentMap, skipTypeArgumentCheck?: boolean): number; + private getWrappingTypeParameterIDFromSignatures(signatures, typeParameterArgumentMap); + private getWrappingTypeParameterIDWorker(typeParameterArgumentMap, skipTypeArgumentCheck); + public wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference(enclosingType: PullTypeSymbol): boolean; + public _wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse(enclosingType: PullTypeSymbol, knownWrapMap: IBitMatrix): boolean; + private _wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceWorker(enclosingType, knownWrapMap); + private _wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceStructure(enclosingType, knownWrapMap); + public widenedType(resolver: PullTypeResolver, ast: AST, context: PullTypeResolutionContext): PullTypeSymbol; + } + class PullPrimitiveTypeSymbol extends PullTypeSymbol { + constructor(name: string); + public isAny(): boolean; + public isNull(): boolean; + public isUndefined(): boolean; + public isStringConstant(): boolean; + public setUnresolved(): void; + public getDisplayName(): string; + } + class PullStringConstantTypeSymbol extends PullPrimitiveTypeSymbol { + constructor(name: string); + public isStringConstant(): boolean; + } + class PullErrorTypeSymbol extends PullPrimitiveTypeSymbol { + public _anyType: PullTypeSymbol; + constructor(_anyType: PullTypeSymbol, name: string); + public isError(): boolean; + public _getResolver(): PullTypeResolver; + public getName(scopeSymbol?: PullSymbol, useConstraintInName?: boolean): string; + public getDisplayName(scopeSymbol?: PullSymbol, useConstraintInName?: boolean, skipInternalAliasName?: boolean): string; + public toString(scopeSymbol?: PullSymbol, useConstraintInName?: boolean): string; + } + class PullContainerSymbol extends PullTypeSymbol { + public instanceSymbol: PullSymbol; + private assignedValue; + private assignedType; + private assignedContainer; + constructor(name: string, kind: PullElementKind); + public isContainer(): boolean; + public setInstanceSymbol(symbol: PullSymbol): void; + public getInstanceSymbol(): PullSymbol; + public setExportAssignedValueSymbol(symbol: PullSymbol): void; + public getExportAssignedValueSymbol(): PullSymbol; + public setExportAssignedTypeSymbol(type: PullTypeSymbol): void; + public getExportAssignedTypeSymbol(): PullTypeSymbol; + public setExportAssignedContainerSymbol(container: PullContainerSymbol): void; + public getExportAssignedContainerSymbol(): PullContainerSymbol; + public hasExportAssignment(): boolean; + static usedAsSymbol(containerSymbol: PullSymbol, symbol: PullSymbol): boolean; + public getInstanceType(): PullTypeSymbol; + } + class PullTypeAliasSymbol extends PullTypeSymbol { + private _assignedValue; + private _assignedType; + private _assignedContainer; + private _isUsedAsValue; + private _typeUsedExternally; + private _isUsedInExportAlias; + private retrievingExportAssignment; + private linkedAliasSymbols; + constructor(name: string); + public isUsedInExportedAlias(): boolean; + public typeUsedExternally(): boolean; + public isUsedAsValue(): boolean; + public setTypeUsedExternally(): void; + public setIsUsedInExportedAlias(): void; + public addLinkedAliasSymbol(contingentValueSymbol: PullTypeAliasSymbol): void; + public setIsUsedAsValue(): void; + public assignedValue(): PullSymbol; + public assignedType(): PullTypeSymbol; + public assignedContainer(): PullContainerSymbol; + public isAlias(): boolean; + public isContainer(): boolean; + public setAssignedValueSymbol(symbol: PullSymbol): void; + public getExportAssignedValueSymbol(): PullSymbol; + public setAssignedTypeSymbol(type: PullTypeSymbol): void; + public getExportAssignedTypeSymbol(): PullTypeSymbol; + public setAssignedContainerSymbol(container: PullContainerSymbol): void; + public getExportAssignedContainerSymbol(): PullContainerSymbol; + public getMembers(): PullSymbol[]; + public getCallSignatures(): PullSignatureSymbol[]; + public getConstructSignatures(): PullSignatureSymbol[]; + public getIndexSignatures(): PullSignatureSymbol[]; + public findMember(name: string): PullSymbol; + public findNestedType(name: string): PullTypeSymbol; + public findNestedContainer(name: string): PullTypeSymbol; + public getAllMembers(searchDeclKind: PullElementKind, memberVisibility: GetAllMembersVisiblity): PullSymbol[]; + } + class PullTypeParameterSymbol extends PullTypeSymbol { + private _constraint; + constructor(name: string); + public isTypeParameter(): boolean; + public setConstraint(constraintType: PullTypeSymbol): void; + public getConstraint(): PullTypeSymbol; + public getBaseConstraint(semanticInfoChain: SemanticInfoChain): PullTypeSymbol; + private getConstraintRecursively(visitedTypeParameters); + public getDefaultConstraint(semanticInfoChain: SemanticInfoChain): PullTypeSymbol; + public getCallSignatures(): PullSignatureSymbol[]; + public getConstructSignatures(): PullSignatureSymbol[]; + public getIndexSignatures(): PullSignatureSymbol[]; + public isGeneric(): boolean; + public fullName(scopeSymbol?: PullSymbol): string; + public getName(scopeSymbol?: PullSymbol, useConstraintInName?: boolean): string; + public getDisplayName(scopeSymbol?: PullSymbol, useConstraintInName?: boolean, skipInternalAliasName?: boolean): string; + public isExternallyVisible(inIsExternallyVisibleSymbols?: PullSymbol[]): boolean; + } + class PullAccessorSymbol extends PullSymbol { + private _getterSymbol; + private _setterSymbol; + constructor(name: string); + public isAccessor(): boolean; + public setSetter(setter: PullSymbol): void; + public getSetter(): PullSymbol; + public setGetter(getter: PullSymbol): void; + public getGetter(): PullSymbol; + } + function getIDForTypeSubstitutions(instantiatingType: PullTypeSymbol, typeArgumentMap: TypeArgumentMap): string; + function getIDForTypeSubstitutions(instantiatingSignature: PullSignatureSymbol, typeArgumentMap: TypeArgumentMap): string; + enum GetAllMembersVisiblity { + all = 0, + internallyVisible = 1, + externallyVisible = 2, + } +} +declare module TypeScript { + class EnclosingTypeWalkerState { + public _hasSetEnclosingType: boolean; + public _currentSymbols: PullSymbol[]; + static getDefaultEnclosingTypeWalkerState(): EnclosingTypeWalkerState; + static getNonGenericEnclosingTypeWalkerState(): EnclosingTypeWalkerState; + static getGenericEnclosingTypeWalkerState(genericEnclosingType: PullTypeSymbol): EnclosingTypeWalkerState; + } + class PullTypeEnclosingTypeWalker { + private static _defaultEnclosingTypeWalkerState; + private static _nonGenericEnclosingTypeWalkerState; + private enclosingTypeWalkerState; + constructor(); + private setDefaultTypeWalkerState(); + private setNonGenericEnclosingTypeWalkerState(); + private canSymbolOrDeclBeUsedAsEnclosingTypeHelper(name, kind); + private canDeclBeUsedAsEnclosingType(decl); + private canSymbolBeUsedAsEnclosingType(symbol); + public getEnclosingType(): PullTypeSymbol; + public _canWalkStructure(): boolean; + public _getCurrentSymbol(): PullSymbol; + public getGenerativeClassification(): GenerativeTypeClassification; + private _pushSymbol(symbol); + private _popSymbol(); + private setSymbolAsEnclosingType(type); + private _setEnclosingTypeOfParentDecl(decl, setSignature); + public setEnclosingTypeForSymbol(symbol: PullSymbol): EnclosingTypeWalkerState; + public startWalkingType(symbol: PullTypeSymbol): EnclosingTypeWalkerState; + public endWalkingType(stateWhenStartedWalkingTypes: EnclosingTypeWalkerState): void; + public walkMemberType(memberName: string, resolver: PullTypeResolver): void; + public postWalkMemberType(): void; + public walkSignature(kind: PullElementKind, index: number): void; + public postWalkSignature(): void; + public walkTypeArgument(index: number): void; + public postWalkTypeArgument(): void; + public walkTypeParameterConstraint(index: number): void; + public postWalkTypeParameterConstraint(): void; + public walkReturnType(): void; + public postWalkReturnType(): void; + public walkParameterType(iParam: number): void; + public postWalkParameterType(): void; + public getBothKindOfIndexSignatures(resolver: PullTypeResolver, context: PullTypeResolutionContext, includeAugmentedType: boolean): IndexSignatureInfo; + public walkIndexSignatureReturnType(indexSigInfo: IndexSignatureInfo, useStringIndexSignature: boolean, onlySignature?: boolean): void; + public postWalkIndexSignatureReturnType(onlySignature?: boolean): void; + public resetEnclosingTypeWalkerState(): EnclosingTypeWalkerState; + public setEnclosingTypeWalkerState(enclosingTypeWalkerState: EnclosingTypeWalkerState): void; + } +} +declare module TypeScript { + class CandidateInferenceInfo { + public typeParameter: PullTypeParameterSymbol; + public _inferredTypeAfterFixing: PullTypeSymbol; + public inferenceCandidates: PullTypeSymbol[]; + public addCandidate(candidate: PullTypeSymbol): void; + public isFixed(): boolean; + public fixTypeParameter(resolver: PullTypeResolver, context: PullTypeResolutionContext): void; + } + class TypeArgumentInferenceContext { + public resolver: PullTypeResolver; + public context: PullTypeResolutionContext; + public signatureBeingInferred: PullSignatureSymbol; + public inferenceCache: IBitMatrix; + public candidateCache: CandidateInferenceInfo[]; + constructor(resolver: PullTypeResolver, context: PullTypeResolutionContext, signatureBeingInferred: PullSignatureSymbol); + public alreadyRelatingTypes(objectType: PullTypeSymbol, parameterType: PullTypeSymbol): boolean; + public resetRelationshipCache(): void; + public addInferenceRoot(param: PullTypeParameterSymbol): void; + public getInferenceInfo(param: PullTypeParameterSymbol): CandidateInferenceInfo; + public addCandidateForInference(param: PullTypeParameterSymbol, candidate: PullTypeSymbol): void; + public inferTypeArguments(): PullTypeSymbol[]; + public fixTypeParameter(typeParameter: PullTypeParameterSymbol): void; + public _finalizeInferredTypeArguments(): PullTypeSymbol[]; + public isInvocationInferenceContext(): boolean; + } + class InvocationTypeArgumentInferenceContext extends TypeArgumentInferenceContext { + public argumentASTs: ISeparatedSyntaxList2; + constructor(resolver: PullTypeResolver, context: PullTypeResolutionContext, signatureBeingInferred: PullSignatureSymbol, argumentASTs: ISeparatedSyntaxList2); + public isInvocationInferenceContext(): boolean; + public inferTypeArguments(): PullTypeSymbol[]; + } + class ContextualSignatureInstantiationTypeArgumentInferenceContext extends TypeArgumentInferenceContext { + private contextualSignature; + private shouldFixContextualSignatureParameterTypes; + constructor(resolver: PullTypeResolver, context: PullTypeResolutionContext, signatureBeingInferred: PullSignatureSymbol, contextualSignature: PullSignatureSymbol, shouldFixContextualSignatureParameterTypes: boolean); + public isInvocationInferenceContext(): boolean; + public inferTypeArguments(): PullTypeSymbol[]; + } + class PullContextualTypeContext { + public contextualType: PullTypeSymbol; + public provisional: boolean; + public isInferentiallyTyping: boolean; + public typeArgumentInferenceContext: TypeArgumentInferenceContext; + public provisionallyTypedSymbols: PullSymbol[]; + public hasProvisionalErrors: boolean; + private astSymbolMap; + constructor(contextualType: PullTypeSymbol, provisional: boolean, isInferentiallyTyping: boolean, typeArgumentInferenceContext: TypeArgumentInferenceContext); + public recordProvisionallyTypedSymbol(symbol: PullSymbol): void; + public invalidateProvisionallyTypedSymbols(): void; + public setSymbolForAST(ast: AST, symbol: PullSymbol): void; + public getSymbolForAST(ast: AST): PullSymbol; + } + class PullTypeResolutionContext { + private resolver; + public inTypeCheck: boolean; + public fileName: string; + private contextStack; + private typeCheckedNodes; + private enclosingTypeWalker1; + private enclosingTypeWalker2; + constructor(resolver: PullTypeResolver, inTypeCheck?: boolean, fileName?: string); + public setTypeChecked(ast: AST): void; + public canTypeCheckAST(ast: AST): boolean; + private _pushAnyContextualType(type, provisional, isInferentiallyTyping, argContext); + public pushNewContextualType(type: PullTypeSymbol): void; + public propagateContextualType(type: PullTypeSymbol): void; + public pushInferentialType(type: PullTypeSymbol, typeArgumentInferenceContext: TypeArgumentInferenceContext): void; + public pushProvisionalType(type: PullTypeSymbol): void; + public popAnyContextualType(): PullContextualTypeContext; + public hasProvisionalErrors(): boolean; + public getContextualType(): PullTypeSymbol; + public fixAllTypeParametersReferencedByType(type: PullTypeSymbol, resolver: PullTypeResolver, argContext?: TypeArgumentInferenceContext): PullTypeSymbol; + private getCurrentTypeArgumentInferenceContext(); + public isInferentiallyTyping(): boolean; + public inProvisionalResolution(): boolean; + private inBaseTypeResolution; + public isInBaseTypeResolution(): boolean; + public startBaseTypeResolution(): boolean; + public doneBaseTypeResolution(wasInBaseTypeResolution: boolean): void; + public setTypeInContext(symbol: PullSymbol, type: PullTypeSymbol): void; + public postDiagnostic(diagnostic: Diagnostic): void; + public typeCheck(): boolean; + public setSymbolForAST(ast: AST, symbol: PullSymbol): void; + public getSymbolForAST(ast: AST): PullSymbol; + public startWalkingTypes(symbol1: PullTypeSymbol, symbol2: PullTypeSymbol): { + stateWhenStartedWalkingTypes1: EnclosingTypeWalkerState; + stateWhenStartedWalkingTypes2: EnclosingTypeWalkerState; + }; + public endWalkingTypes(statesWhenStartedWalkingTypes: { + stateWhenStartedWalkingTypes1: EnclosingTypeWalkerState; + stateWhenStartedWalkingTypes2: EnclosingTypeWalkerState; + }): void; + public setEnclosingTypeForSymbols(symbol1: PullSymbol, symbol2: PullSymbol): { + enclosingTypeWalkerState1: EnclosingTypeWalkerState; + enclosingTypeWalkerState2: EnclosingTypeWalkerState; + }; + public walkMemberTypes(memberName: string): void; + public postWalkMemberTypes(): void; + public walkSignatures(kind: PullElementKind, index: number, index2?: number): void; + public postWalkSignatures(): void; + public walkTypeParameterConstraints(index: number): void; + public postWalkTypeParameterConstraints(): void; + public walkTypeArgument(index: number): void; + public postWalkTypeArgument(): void; + public walkReturnTypes(): void; + public postWalkReturnTypes(): void; + public walkParameterTypes(iParam: number): void; + public postWalkParameterTypes(): void; + public getBothKindOfIndexSignatures(includeAugmentedType1: boolean, includeAugmentedType2: boolean): { + indexSigs1: IndexSignatureInfo; + indexSigs2: IndexSignatureInfo; + }; + public walkIndexSignatureReturnTypes(indexSigs: { + indexSigs1: IndexSignatureInfo; + indexSigs2: IndexSignatureInfo; + }, useStringIndexSignature1: boolean, useStringIndexSignature2: boolean, onlySignature?: boolean): void; + public postWalkIndexSignatureReturnTypes(onlySignature?: boolean): void; + public swapEnclosingTypeWalkers(): void; + public oneOfClassificationsIsInfinitelyExpanding(): boolean; + public resetEnclosingTypeWalkerStates(): { + enclosingTypeWalkerState1: EnclosingTypeWalkerState; + enclosingTypeWalkerState2: EnclosingTypeWalkerState; + }; + public setEnclosingTypeWalkerStates(enclosingTypeWalkerStates: { + enclosingTypeWalkerState1: EnclosingTypeWalkerState; + enclosingTypeWalkerState2: EnclosingTypeWalkerState; + }): void; + } +} +declare module TypeScript { + interface IPullTypeCollection { + getLength(): number; + getTypeAtIndex(index: number): PullTypeSymbol; + } + class PullAdditionalCallResolutionData { + public targetSymbol: PullSymbol; + public resolvedSignatures: PullSignatureSymbol[]; + public candidateSignature: PullSignatureSymbol; + public actualParametersContextTypeSymbols: PullTypeSymbol[]; + public diagnosticsFromOverloadResolution: Diagnostic[]; + } + class PullAdditionalObjectLiteralResolutionData { + public membersContextTypeSymbols: PullTypeSymbol[]; + } + interface IndexSignatureInfo { + numericSignature: PullSignatureSymbol; + stringSignature: PullSignatureSymbol; + } + class PullTypeResolver { + private compilationSettings; + public semanticInfoChain: SemanticInfoChain; + private _cachedArrayInterfaceType; + private _cachedNumberInterfaceType; + private _cachedStringInterfaceType; + private _cachedBooleanInterfaceType; + private _cachedObjectInterfaceType; + private _cachedFunctionInterfaceType; + private _cachedIArgumentsInterfaceType; + private _cachedRegExpInterfaceType; + private _cachedAnyTypeArgs; + private typeCheckCallBacks; + private postTypeCheckWorkitems; + private _cachedFunctionArgumentsSymbol; + private assignableCache; + private subtypeCache; + private identicalCache; + private inResolvingOtherDeclsWalker; + constructor(compilationSettings: ImmutableCompilationSettings, semanticInfoChain: SemanticInfoChain); + private cachedArrayInterfaceType(); + public getArrayNamedType(): PullTypeSymbol; + private cachedNumberInterfaceType(); + private cachedStringInterfaceType(); + private cachedBooleanInterfaceType(); + private cachedObjectInterfaceType(); + private cachedFunctionInterfaceType(); + private cachedIArgumentsInterfaceType(); + private cachedRegExpInterfaceType(); + private cachedFunctionArgumentsSymbol(); + private getApparentType(type); + private setTypeChecked(ast, context); + private canTypeCheckAST(ast, context); + private setSymbolForAST(ast, symbol, context); + private getSymbolForAST(ast, context); + public getASTForDecl(decl: PullDecl): AST; + public getNewErrorTypeSymbol(name?: string): PullErrorTypeSymbol; + public getEnclosingDecl(decl: PullDecl): PullDecl; + private getExportedMemberSymbol(symbol, parent); + public _getNamedPropertySymbolOfAugmentedType(symbolName: string, parent: PullTypeSymbol): PullSymbol; + private getNamedPropertySymbol(symbolName, declSearchKind, parent); + private getSymbolFromDeclPath(symbolName, declPath, declSearchKind); + private getVisibleDeclsFromDeclPath(declPath, declSearchKind); + private addFilteredDecls(decls, declSearchKind, result); + public getVisibleDecls(enclosingDecl: PullDecl): PullDecl[]; + public getVisibleContextSymbols(enclosingDecl: PullDecl, context: PullTypeResolutionContext): PullSymbol[]; + public getVisibleMembersFromExpression(expression: AST, enclosingDecl: PullDecl, context: PullTypeResolutionContext): PullSymbol[]; + private isAnyOrEquivalent(type); + private resolveExternalModuleReference(idText, currentFileName); + public resolveDeclaredSymbol(symbol: TSymbol, context?: PullTypeResolutionContext): TSymbol; + private resolveDeclaredSymbolWorker(symbol, context); + private resolveOtherDecl(otherDecl, context); + private resolveOtherDeclarations(astName, context); + private resolveSourceUnit(sourceUnit, context); + private typeCheckSourceUnit(sourceUnit, context); + private verifyUniquenessOfImportNamesInSourceUnit(sourceUnit); + private resolveEnumDeclaration(ast, context); + private typeCheckEnumDeclaration(ast, context); + private postTypeCheckEnumDeclaration(ast, context); + private checkInitializersInEnumDeclarations(decl, context); + private resolveModuleDeclaration(ast, context); + private ensureAllSymbolsAreBound(containerSymbol); + private resolveModuleSymbol(containerSymbol, context, moduleDeclAST, moduleDeclNameAST, sourceUnitAST); + private resolveFirstExportAssignmentStatement(moduleElements, context); + private resolveSingleModuleDeclaration(ast, astName, context); + private typeCheckModuleDeclaration(ast, context); + private typeCheckSingleModuleDeclaration(ast, astName, context); + private verifyUniquenessOfImportNamesInModule(decl); + private checkUniquenessOfImportNames(decls, doesNameExistOutside?); + private scanVariableDeclarationGroups(enclosingDecl, firstDeclHandler, subsequentDeclHandler?); + private postTypeCheckModuleDeclaration(ast, context); + private isTypeRefWithoutTypeArgs(term); + public createInstantiatedType(type: PullTypeSymbol, typeArguments: PullTypeSymbol[]): PullTypeSymbol; + private resolveReferenceTypeDeclaration(classOrInterface, name, heritageClauses, context); + private resolveClassDeclaration(classDeclAST, context); + private typeCheckTypeParametersOfTypeDeclaration(classOrInterface, context); + private typeCheckClassDeclaration(classDeclAST, context); + private postTypeCheckClassDeclaration(classDeclAST, context); + private resolveTypeSymbolSignatures(typeSymbol, context); + private resolveInterfaceDeclaration(interfaceDeclAST, context); + private typeCheckInterfaceDeclaration(interfaceDeclAST, context); + private checkInterfaceDeclForIdenticalTypeParameters(interfaceDeclAST, context); + private checkTypeForDuplicateIndexSignatures(enclosingTypeSymbol); + private filterSymbol(symbol, kind, enclosingDecl, context); + private getMemberSymbolOfKind(symbolName, kind, pullTypeSymbol, enclosingDecl, context); + private resolveIdentifierOfInternalModuleReference(importDecl, identifier, moduleSymbol, enclosingDecl, context); + private resolveModuleReference(importDecl, moduleNameExpr, enclosingDecl, context, declPath); + private resolveInternalModuleReference(importStatementAST, context); + private resolveImportDeclaration(importStatementAST, context); + private typeCheckImportDeclaration(importStatementAST, context); + private postTypeCheckImportDeclaration(importStatementAST, context); + private resolveExportAssignmentStatement(exportAssignmentAST, context); + private resolveAnyFunctionTypeSignature(funcDeclAST, typeParameters, parameterList, returnTypeAnnotation, context); + private resolveFunctionTypeSignatureParameter(argDeclAST, signature, enclosingDecl, context); + private resolveFunctionExpressionParameter(argDeclAST, id, typeExpr, equalsValueClause, contextParam, enclosingDecl, context); + private checkNameForCompilerGeneratedDeclarationCollision(astWithName, isDeclaration, name, context); + private hasRestParameterCodeGen(someFunctionDecl); + private checkArgumentsCollides(ast, context); + private checkIndexOfRestArgumentInitializationCollides(ast, isDeclaration, context); + private checkExternalModuleRequireExportsCollides(ast, name, context); + private resolveObjectTypeTypeReference(objectType, context); + private typeCheckObjectTypeTypeReference(objectType, context); + private resolveTypeAnnotation(typeAnnotation, context); + public resolveTypeReference(typeRef: AST, context: PullTypeResolutionContext): PullTypeSymbol; + private getArrayType(elementType); + private computeTypeReferenceSymbol(term, context); + private genericTypeIsUsedWithoutRequiredTypeArguments(typeSymbol, term, context); + private resolveMemberVariableDeclaration(varDecl, context); + private resolvePropertySignature(varDecl, context); + private resolveVariableDeclarator(varDecl, context); + private resolveParameterList(list, context); + private resolveParameter(parameter, context); + private getEnumTypeSymbol(enumElement, context); + private resolveEnumElement(enumElement, context); + private typeCheckEnumElement(enumElement, context); + private resolveEqualsValueClause(clause, isContextuallyTyped, context); + private resolveVariableDeclaratorOrParameterOrEnumElement(varDeclOrParameter, modifiers, name, typeExpr, init, context); + private resolveAndTypeCheckVariableDeclarationTypeExpr(varDeclOrParameter, name, typeExpr, context); + private resolveAndTypeCheckVariableDeclaratorOrParameterInitExpr(varDeclOrParameter, name, typeExpr, init, context, typeExprSymbol); + private typeCheckPropertySignature(varDecl, context); + private typeCheckMemberVariableDeclaration(varDecl, context); + private typeCheckVariableDeclarator(varDecl, context); + private typeCheckParameter(parameter, context); + private typeCheckVariableDeclaratorOrParameterOrEnumElement(varDeclOrParameter, modifiers, name, typeExpr, init, context); + private isForInVariableDeclarator(ast); + private checkSuperCaptureVariableCollides(superAST, isDeclaration, context); + private checkThisCaptureVariableCollides(_thisAST, isDeclaration, context); + private postTypeCheckVariableDeclaratorOrParameter(varDeclOrParameter, context); + private resolveTypeParameterDeclaration(typeParameterAST, context); + private resolveFirstTypeParameterDeclaration(typeParameterSymbol, context); + private typeCheckTypeParameterDeclaration(typeParameterAST, context); + private resolveConstraint(constraint, context); + private resolveFunctionBodyReturnTypes(funcDeclAST, block, bodyExpression, signature, useContextualType, enclosingDecl, context); + private typeCheckConstructorDeclaration(funcDeclAST, context); + private constructorHasSuperCall(constructorDecl); + private typeCheckFunctionExpression(funcDecl, isContextuallyTyped, context); + private typeCheckCallSignature(funcDecl, context); + private typeCheckConstructSignature(funcDecl, context); + private typeCheckMethodSignature(funcDecl, context); + private typeCheckMemberFunctionDeclaration(funcDecl, context); + private containsSingleThrowStatement(block); + private typeCheckAnyFunctionDeclaration(funcDeclAST, isStatic, name, typeParameters, parameters, returnTypeAnnotation, block, context); + private checkThatNonVoidFunctionHasReturnExpressionOrThrowStatement(functionDecl, returnTypeAnnotation, returnTypeSymbol, block, context); + private typeCheckIndexSignature(funcDeclAST, context); + private postTypeCheckFunctionDeclaration(funcDeclAST, context); + private resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, returnTypeAnnotation, context); + private resolveMemberFunctionDeclaration(funcDecl, context); + private resolveCallSignature(funcDecl, context); + private resolveConstructSignature(funcDecl, context); + private resolveMethodSignature(funcDecl, context); + private resolveAnyFunctionDeclaration(funcDecl, context); + private resolveFunctionExpression(funcDecl, isContextuallyTyped, context); + private resolveSimpleArrowFunctionExpression(funcDecl, isContextuallyTyped, context); + private resolveParenthesizedArrowFunctionExpression(funcDecl, isContextuallyTyped, context); + private getEnclosingClassDeclaration(ast); + private resolveConstructorDeclaration(funcDeclAST, context); + private resolveIndexMemberDeclaration(ast, context); + private resolveIndexSignature(funcDeclAST, context); + private resolveFunctionDeclaration(funcDeclAST, isStatic, name, typeParameters, parameterList, returnTypeAnnotation, block, context); + private resolveGetterReturnTypeAnnotation(getterFunctionDeclarationAst, enclosingDecl, context); + private resolveSetterArgumentTypeAnnotation(setterFunctionDeclarationAst, enclosingDecl, context); + private resolveAccessorDeclaration(funcDeclAst, context); + private typeCheckAccessorDeclaration(funcDeclAst, context); + private resolveGetAccessorDeclaration(funcDeclAST, parameters, returnTypeAnnotation, block, setterAnnotatedType, context); + private checkIfGetterAndSetterTypeMatch(funcDeclAST, context); + private typeCheckGetAccessorDeclaration(funcDeclAST, context); + static hasSetAccessorParameterTypeAnnotation(setAccessor: SetAccessor): boolean; + private resolveSetAccessorDeclaration(funcDeclAST, parameterList, context); + private typeCheckSetAccessorDeclaration(funcDeclAST, context); + private resolveList(list, context); + private resolveSeparatedList(list, context); + private resolveVoidExpression(ast, context); + private resolveLogicalOperation(ast, context); + private typeCheckLogicalOperation(binex, context); + private resolveLogicalNotExpression(ast, context); + private resolveUnaryArithmeticOperation(ast, context); + private resolvePostfixUnaryExpression(ast, context); + private isAnyOrNumberOrEnum(type); + private typeCheckUnaryArithmeticOperation(unaryExpression, context); + private typeCheckPostfixUnaryExpression(unaryExpression, context); + private resolveBinaryArithmeticExpression(binaryExpression, context); + private typeCheckBinaryArithmeticExpression(binaryExpression, context); + private resolveTypeOfExpression(ast, context); + private resolveThrowStatement(ast, context); + private resolveDeleteExpression(ast, context); + private resolveInstanceOfExpression(ast, context); + private typeCheckInstanceOfExpression(binaryExpression, context); + private resolveCommaExpression(commaExpression, context); + private resolveInExpression(ast, context); + private typeCheckInExpression(binaryExpression, context); + private resolveForStatement(ast, context); + private resolveForInStatement(forInStatement, context); + private typeCheckForInStatement(forInStatement, context); + private resolveWhileStatement(ast, context); + private typeCheckWhileStatement(ast, context); + private resolveDoStatement(ast, context); + private typeCheckDoStatement(ast, context); + private resolveIfStatement(ast, context); + private typeCheckIfStatement(ast, context); + private resolveElseClause(ast, context); + private typeCheckElseClause(ast, context); + private resolveBlock(ast, context); + private resolveVariableStatement(ast, context); + private resolveVariableDeclarationList(ast, context); + private resolveWithStatement(ast, context); + private typeCheckWithStatement(ast, context); + private resolveTryStatement(ast, context); + private typeCheckTryStatement(ast, context); + private resolveCatchClause(ast, context); + private typeCheckCatchClause(ast, context); + private resolveFinallyClause(ast, context); + private typeCheckFinallyClause(ast, context); + private getEnclosingFunctionDeclaration(ast); + private resolveReturnExpression(expression, enclosingFunction, context); + private typeCheckReturnExpression(expression, expressionType, enclosingFunction, context); + private resolveReturnStatement(returnAST, context); + private resolveSwitchStatement(ast, context); + private typeCheckSwitchStatement(ast, context); + private resolveLabeledStatement(ast, context); + private typeCheckLabeledStatement(ast, context); + private labelIsOnContinuableConstruct(statement); + private resolveContinueStatement(ast, context); + private isIterationStatement(ast); + private isAnyFunctionExpressionOrDeclaration(ast); + private inSwitchStatement(ast); + private inIterationStatement(ast, crossFunctions); + private getEnclosingLabels(ast, breakable, crossFunctions); + private typeCheckContinueStatement(ast, context); + private resolveBreakStatement(ast, context); + private typeCheckBreakStatement(ast, context); + public resolveAST(ast: AST, isContextuallyTyped: boolean, context: PullTypeResolutionContext): PullSymbol; + private resolveExpressionAST(ast, isContextuallyOrInferentiallyTyped, context); + private resolveExpressionWorker(ast, isContextuallyTyped, context); + private typeCheckAST(ast, isContextuallyTyped, context); + private processPostTypeCheckWorkItems(context); + private postTypeCheck(ast, context); + private resolveRegularExpressionLiteral(); + private postTypeCheckNameExpression(nameAST, context); + private typeCheckNameExpression(nameAST, context); + private resolveNameExpression(nameAST, context); + private isInEnumDecl(decl); + private getSomeInnermostFunctionScopeDecl(declPath); + private isFromFunctionScope(nameSymbol, functionScopeDecl); + private findConstructorDeclOfEnclosingType(decl); + private checkNameAsPartOfInitializerExpressionForInstanceMemberVariable(nameAST, nameSymbol, context); + private computeNameExpression(nameAST, context); + private getCurrentParameterIndexForFunction(parameter, funcDecl); + private resolveMemberAccessExpression(dottedNameAST, context); + private resolveDottedNameExpression(dottedNameAST, expression, name, context); + private computeDottedNameExpression(expression, name, context, checkSuperPrivateAndStaticAccess); + private computeDottedNameExpressionFromLHS(lhs, expression, name, context, checkSuperPrivateAndStaticAccess); + private resolveTypeNameExpression(nameAST, context); + private computeTypeNameExpression(nameAST, context); + private isInStaticMemberContext(decl); + private isLeftSideOfQualifiedName(ast); + private resolveGenericTypeReference(genericTypeAST, context); + private resolveQualifiedName(dottedNameAST, context); + private isLastNameOfModuleNameModuleReference(ast); + private computeQualifiedName(dottedNameAST, context); + private shouldContextuallyTypeAnyFunctionExpression(functionExpressionAST, typeParameters, parameters, returnTypeAnnotation, context); + private resolveAnyFunctionExpression(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, isContextuallyTyped, context); + private resolveAnyFunctionExpressionParameters(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, isContextuallyTyped, context); + private typeCheckSimpleArrowFunctionExpression(arrowFunction, isContextuallyTyped, context); + private typeCheckParenthesizedArrowFunctionExpression(arrowFunction, isContextuallyTyped, context); + private typeCheckAnyFunctionExpression(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, isContextuallyTyped, context); + private resolveThisExpression(thisExpression, context); + private inTypeArgumentList(ast); + private inClassExtendsHeritageClause(ast); + private inTypeQuery(ast); + private inArgumentListOfSuperInvocation(ast); + private inConstructorParameterList(ast); + private isFunctionAccessorOrNonArrowFunctionExpression(decl); + private isFunctionOrNonArrowFunctionExpression(decl); + private typeCheckThisExpression(thisExpression, context, enclosingDecl); + private getContextualClassSymbolForEnclosingDecl(ast, enclosingDecl); + private inStaticMemberVariableDeclaration(ast); + private resolveSuperExpression(ast, context); + private typeCheckSuperExpression(ast, context, enclosingDecl); + private resolveSimplePropertyAssignment(propertyAssignment, isContextuallyTyped, context); + private resolveFunctionPropertyAssignment(funcProp, isContextuallyTyped, context); + private typeCheckFunctionPropertyAssignment(funcProp, isContextuallyTyped, context); + public resolveObjectLiteralExpression(expressionAST: ObjectLiteralExpression, isContextuallyTyped: boolean, context: PullTypeResolutionContext, additionalResults?: PullAdditionalObjectLiteralResolutionData): PullSymbol; + private bindObjectLiteralMembers(objectLiteralDeclaration, objectLiteralTypeSymbol, objectLiteralMembers, isUsingExistingSymbol, pullTypeContext); + private resolveObjectLiteralMembers(objectLiteralDeclaration, objectLiteralTypeSymbol, objectLiteralContextualType, objectLiteralMembers, stringIndexerSignature, numericIndexerSignature, allMemberTypes, allNumericMemberTypes, boundMemberSymbols, isUsingExistingSymbol, pullTypeContext, additionalResults?); + private computeObjectLiteralExpression(objectLitAST, isContextuallyTyped, context, additionalResults?); + private getPropertyAssignmentName(propertyAssignment); + private stampObjectLiteralWithIndexSignature(objectLiteralSymbol, indexerTypeCandidates, contextualIndexSignature, context); + private resolveArrayLiteralExpression(arrayLit, isContextuallyTyped, context); + private computeArrayLiteralExpressionSymbol(arrayLit, isContextuallyTyped, context); + private resolveElementAccessExpression(callEx, context); + private typeCheckElementAccessExpression(callEx, context, symbolAndDiagnostic); + private computeElementAccessExpressionSymbolAndDiagnostic(callEx, context); + private getBothKindsOfIndexSignaturesIncludingAugmentedType(enclosingType, context); + private getBothKindsOfIndexSignaturesExcludingAugmentedType(enclosingType, context); + public _getBothKindsOfIndexSignatures(enclosingType: PullTypeSymbol, context: PullTypeResolutionContext, includeAugmentedType: boolean): IndexSignatureInfo; + public _addUnhiddenSignaturesFromBaseType(derivedTypeSignatures: PullSignatureSymbol[], baseTypeSignatures: PullSignatureSymbol[], signaturesBeingAggregated: PullSignatureSymbol[]): void; + private resolveBinaryAdditionOperation(binaryExpression, context); + private bestCommonTypeOfTwoTypes(type1, type2, context); + private bestCommonTypeOfThreeTypes(type1, type2, type3, context); + private resolveLogicalOrExpression(binex, isContextuallyTyped, context); + private resolveLogicalAndExpression(binex, context); + private computeTypeOfConditionalExpression(leftType, rightType, isContextuallyTyped, context); + private resolveConditionalExpression(trinex, isContextuallyTyped, context); + private conditionExpressionTypesAreValid(leftType, rightType, expressionType, isContextuallyTyped, context); + private resolveParenthesizedExpression(ast, context); + private resolveExpressionStatement(ast, context); + public resolveInvocationExpression(callEx: InvocationExpression, context: PullTypeResolutionContext, additionalResults?: PullAdditionalCallResolutionData): PullSymbol; + private typeCheckInvocationExpression(callEx, context); + private computeInvocationExpressionSymbol(callEx, context, additionalResults); + public resolveObjectCreationExpression(callEx: ObjectCreationExpression, context: PullTypeResolutionContext, additionalResults?: PullAdditionalCallResolutionData): PullSymbol; + private typeCheckObjectCreationExpression(callEx, context); + private postOverloadResolutionDiagnostics(diagnostic, additionalResults, context); + private computeObjectCreationExpressionSymbol(callEx, context, additionalResults); + private instantiateSignatureInContext(signatureAToInstantiate, contextualSignatureB, context, shouldFixContextualSignatureParameterTypes); + private resolveCastExpression(assertionExpression, context); + private typeCheckCastExpression(assertionExpression, context, typeAssertionType); + private resolveAssignmentExpression(binaryExpression, context); + private getInstanceTypeForAssignment(lhs, type, context); + public widenType(type: PullTypeSymbol, ast: AST, context: PullTypeResolutionContext): PullTypeSymbol; + private widenArrayType(type, ast, context); + private widenObjectLiteralType(type, ast, context); + private needsToWidenObjectLiteralType(type, ast, context); + public findBestCommonType(collection: IPullTypeCollection, context: PullTypeResolutionContext, comparisonInfo?: TypeComparisonInfo): PullTypeSymbol; + private typeIsBestCommonTypeCandidate(candidateType, collection, context); + private typesAreIdenticalInEnclosingTypes(t1, t2, context); + private typesAreIdenticalWithNewEnclosingTypes(t1, t2, context); + public typesAreIdentical(t1: PullTypeSymbol, t2: PullTypeSymbol, context: PullTypeResolutionContext): boolean; + private typesAreIdenticalWorker(t1, t2, context); + private propertiesAreIdentical(propertySymbol1, propertySymbol2, context); + private propertiesAreIdenticalWithNewEnclosingTypes(type1, type2, property1, property2, context); + private signatureGroupsAreIdentical(sg1, sg2, context); + private typeParametersAreIdentical(tp1, tp2, context); + private typeParametersAreIdenticalWorker(tp1, tp2, context); + private setTypeParameterIdentity(tp1, tp2, val); + public signaturesAreIdenticalWithNewEnclosingTypes(s1: PullSignatureSymbol, s2: PullSignatureSymbol, context: PullTypeResolutionContext, includingReturnType?: boolean): boolean; + private signaturesAreIdentical(s1, s2, context, includingReturnType?); + public signaturesAreIdenticalWorker(s1: PullSignatureSymbol, s2: PullSignatureSymbol, context: PullTypeResolutionContext, includingReturnType?: boolean): boolean; + private signatureTypeParametersParametersAndReturnTypesAreIdentical(s1, s2, context, includingReturnType?); + public signatureReturnTypesAreIdentical(s1: PullSignatureSymbol, s2: PullSignatureSymbol, context: PullTypeResolutionContext): boolean; + private symbolsShareDeclaration(symbol1, symbol2); + private sourceIsSubtypeOfTarget(source, target, ast, context, comparisonInfo?, isComparingInstantiatedSignatures?); + private sourceMembersAreAssignableToTargetMembers(source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures?); + private sourcePropertyIsAssignableToTargetProperty(source, target, sourceProp, targetProp, ast, context, comparisonInfo, isComparingInstantiatedSignatures?); + private sourceCallSignaturesAreAssignableToTargetCallSignatures(source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures?); + private sourceConstructSignaturesAreAssignableToTargetConstructSignatures(source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures?); + private sourceIndexSignaturesAreAssignableToTargetIndexSignatures(source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures?); + private typeIsAssignableToFunction(source, ast, context); + private signatureIsAssignableToTarget(s1, s2, ast, context, comparisonInfo?, isComparingInstantiatedSignatures?); + private sourceIsAssignableToTarget(source, target, ast, context, comparisonInfo?, isComparingInstantiatedSignatures?); + private sourceIsAssignableToTargetWithNewEnclosingTypes(source, target, ast, context, comparisonInfo?, isComparingInstantiatedSignatures?); + private getSymbolForRelationshipCheck(symbol); + private sourceIsRelatableToTargetInEnclosingTypes(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private sourceIsRelatableToTargetWithNewEnclosingTypes(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private sourceIsRelatableToTargetInCache(source, target, comparisonCache, comparisonInfo); + private sourceIsRelatableToTarget(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private isSourceTypeParameterConstrainedToTargetTypeParameter(source, target); + private sourceIsRelatableToTargetWorker(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private sourceMembersAreRelatableToTargetMembers(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private infinitelyExpandingSourceTypeIsRelatableToTargetType(sourceType, targetType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private infinitelyExpandingTypesAreIdentical(sourceType, targetType, context); + private sourcePropertyIsRelatableToTargetProperty(source, target, sourceProp, targetProp, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private sourceCallSignaturesAreRelatableToTargetCallSignatures(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private sourceConstructSignaturesAreRelatableToTargetConstructSignatures(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private sourceIndexSignaturesAreRelatableToTargetIndexSignatures(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private signatureGroupIsRelatableToTarget(source, target, sourceSG, targetSG, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private signatureIsRelatableToTarget(sourceSig, targetSig, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private signatureIsRelatableToTargetWorker(sourceSig, targetSig, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); + private resolveOverloads(application, group, haveTypeArgumentsAtCallSite, context, diagnostics); + private getCallTargetErrorSpanAST(callEx); + private overloadHasCorrectArity(signature, args); + private overloadIsApplicable(signature, args, context, comparisonInfo); + private overloadIsApplicableForArgument(paramType, arg, argIndex, context, comparisonInfo); + private overloadIsApplicableForAnyFunctionExpressionArgument(paramType, arg, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, argIndex, context, comparisonInfo); + private overloadIsApplicableForObjectLiteralArgument(paramType, arg, argIndex, context, comparisonInfo); + private overloadIsApplicableForArrayLiteralArgument(paramType, arg, argIndex, context, comparisonInfo); + private overloadIsApplicableForOtherArgument(paramType, arg, argIndex, context, comparisonInfo); + private overloadIsApplicableForArgumentHelper(paramType, argSym, argumentIndex, comparisonInfo, arg, context); + private inferArgumentTypesForSignature(argContext, comparisonInfo, context); + private typeParametersAreInScopeAtArgumentList(typeParameters, args); + private relateTypeToTypeParametersInEnclosingType(expressionType, parameterType, argContext, context); + public relateTypeToTypeParametersWithNewEnclosingTypes(expressionType: PullTypeSymbol, parameterType: PullTypeSymbol, argContext: TypeArgumentInferenceContext, context: PullTypeResolutionContext): void; + public relateTypeToTypeParameters(expressionType: PullTypeSymbol, parameterType: PullTypeSymbol, argContext: TypeArgumentInferenceContext, context: PullTypeResolutionContext): void; + private relateTypeArgumentsOfTypeToTypeParameters(expressionType, parameterType, argContext, context); + private relateInifinitelyExpandingTypeToTypeParameters(expressionType, parameterType, argContext, context); + private relateFunctionSignatureToTypeParameters(expressionSignature, parameterSignature, argContext, context); + private relateObjectTypeToTypeParameters(objectType, parameterType, argContext, context); + private relateSignatureGroupToTypeParameters(argumentSignatures, parameterSignatures, signatureKind, argContext, context); + private alterPotentialGenericFunctionTypeToInstantiatedFunctionTypeForTypeArgumentInference(expressionSymbol, context); + private isFunctionTypeWithExactlyOneCallSignatureAndNoOtherMembers(type, callSignatureShouldBeGeneric); + public instantiateTypeToAny(typeToSpecialize: PullTypeSymbol, context: PullTypeResolutionContext): PullTypeSymbol; + public instantiateSignatureToAny(signature: PullSignatureSymbol): PullSignatureSymbol; + static globalTypeCheckPhase: number; + static typeCheck(compilationSettings: ImmutableCompilationSettings, semanticInfoChain: SemanticInfoChain, document: Document): void; + private validateVariableDeclarationGroups(enclosingDecl, context); + private typeCheckFunctionOverloads(funcDecl, context, signature?, allSignatures?); + private checkSymbolPrivacy(declSymbol, symbol, privacyErrorReporter); + private checkTypePrivacyOfSignatures(declSymbol, signatures, privacyErrorReporter); + private typeParameterOfTypeDeclarationPrivacyErrorReporter(classOrInterface, typeParameterAST, typeParameter, symbol, context); + private baseListPrivacyErrorReporter(classOrInterface, declSymbol, baseAst, isExtendedType, symbol, context); + private variablePrivacyErrorReporter(declAST, declSymbol, symbol, context); + private checkFunctionTypePrivacy(funcDeclAST, isStatic, typeParameters, parameters, returnTypeAnnotation, block, context); + private functionTypeArgumentArgumentTypePrivacyErrorReporter(declAST, isStatic, typeParameterAST, typeParameter, symbol, context); + private functionArgumentTypePrivacyErrorReporter(declAST, isStatic, parameters, argIndex, paramSymbol, symbol, context); + private functionReturnTypePrivacyErrorReporter(declAST, isStatic, returnTypeAnnotation, block, funcReturnType, symbol, context); + private enclosingClassIsDerived(classDecl); + private isSuperInvocationExpression(ast); + private isSuperInvocationExpressionStatement(node); + private getFirstStatementOfBlockOrNull(block); + private superCallMustBeFirstStatementInConstructor(constructorDecl); + private checkForThisCaptureInArrowFunction(expression); + private typeCheckMembersAgainstIndexer(containerType, containerTypeDecl, context); + private determineRelevantIndexerForMember(member, numberIndexSignature, stringIndexSignature); + private reportErrorThatMemberIsNotSubtypeOfIndexer(member, indexSignature, astForError, context, comparisonInfo); + private typeCheckIfTypeMemberPropertyOkToOverride(typeSymbol, extendedType, typeMember, extendedTypeMember, enclosingDecl, comparisonInfo); + private typeCheckIfTypeExtendsType(classOrInterface, name, typeSymbol, extendedType, enclosingDecl, context); + private typeCheckIfClassImplementsType(classDecl, classSymbol, implementedType, enclosingDecl, context); + private computeValueSymbolFromAST(valueDeclAST, context); + private hasClassTypeSymbolConflictAsValue(baseDeclAST, typeSymbol, enclosingDecl, context); + private typeCheckBase(classOrInterface, name, typeSymbol, baseDeclAST, isExtendedType, enclosingDecl, context); + private typeCheckBases(classOrInterface, name, heritageClauses, typeSymbol, enclosingDecl, context); + private checkTypeCompatibilityBetweenBases(name, typeSymbol, context); + private checkNamedPropertyIdentityBetweenBases(interfaceName, interfaceSymbol, baseTypeSymbol, inheritedMembersMap, context); + private checkIndexSignatureIdentityBetweenBases(interfaceName, interfaceSymbol, baseTypeSymbol, allInheritedSignatures, derivedTypeHasOwnNumberSignature, derivedTypeHasOwnStringSignature, context); + private checkInheritedMembersAgainstInheritedIndexSignatures(interfaceName, interfaceSymbol, inheritedIndexSignatures, inheritedMembers, context); + private checkThatInheritedNumberSignatureIsSubtypeOfInheritedStringSignature(interfaceName, interfaceSymbol, inheritedIndexSignatures, context); + private checkAssignability(ast, source, target, context); + private isReference(ast, astSymbol); + private checkForSuperMemberAccess(expression, name, resolvedName, context); + private getEnclosingDeclForAST(ast); + private getEnclosingSymbolForAST(ast); + private checkForPrivateMemberAccess(name, expressionType, resolvedName, context); + public instantiateType(type: PullTypeSymbol, typeParameterArgumentMap: TypeArgumentMap): PullTypeSymbol; + public instantiateTypeParameter(typeParameter: PullTypeParameterSymbol, typeParameterArgumentMap: TypeArgumentMap): PullTypeParameterSymbol; + public instantiateSignature(signature: PullSignatureSymbol, typeParameterArgumentMap: TypeArgumentMap): PullSignatureSymbol; + } + class TypeComparisonInfo { + public onlyCaptureFirstError: boolean; + public flags: TypeRelationshipFlags; + public message: string; + public stringConstantVal: AST; + private indent; + constructor(sourceComparisonInfo?: TypeComparisonInfo, useSameIndent?: boolean); + private indentString(); + public addMessage(message: string): void; + } + function getPropertyAssignmentNameTextFromIdentifier(identifier: AST): { + actualText: string; + memberName: string; + }; + function isTypesOnlyLocation(ast: AST): boolean; +} +declare module TypeScript { + var declCacheHit: number; + var declCacheMiss: number; + var symbolCacheHit: number; + var symbolCacheMiss: number; + class SemanticInfoChain { + private compiler; + private logger; + private documents; + private fileNameToDocument; + public anyTypeDecl: PullDecl; + public booleanTypeDecl: PullDecl; + public numberTypeDecl: PullDecl; + public stringTypeDecl: PullDecl; + public nullTypeDecl: PullDecl; + public undefinedTypeDecl: PullDecl; + public voidTypeDecl: PullDecl; + public undefinedValueDecl: PullDecl; + public anyTypeSymbol: PullPrimitiveTypeSymbol; + public booleanTypeSymbol: PullPrimitiveTypeSymbol; + public numberTypeSymbol: PullPrimitiveTypeSymbol; + public stringTypeSymbol: PullPrimitiveTypeSymbol; + public nullTypeSymbol: PullPrimitiveTypeSymbol; + public undefinedTypeSymbol: PullPrimitiveTypeSymbol; + public voidTypeSymbol: PullPrimitiveTypeSymbol; + public undefinedValueSymbol: PullSymbol; + public emptyTypeSymbol: PullTypeSymbol; + private astSymbolMap; + private astAliasSymbolMap; + private astCallResolutionDataMap; + private declSymbolMap; + private declSignatureSymbolMap; + private declCache; + private symbolCache; + private fileNameToDiagnostics; + private _binder; + private _resolver; + private _topLevelDecls; + private _fileNames; + constructor(compiler: TypeScriptCompiler, logger: ILogger); + public getDocument(fileName: string): Document; + public lineMap(fileName: string): LineMap; + public fileNames(): string[]; + private bindPrimitiveSymbol(decl, newSymbol); + private addPrimitiveTypeSymbol(decl); + private addPrimitiveValueSymbol(decl, type); + private resetGlobalSymbols(); + public addDocument(document: Document): void; + public removeDocument(fileName: string): void; + private getDeclPathCacheID(declPath, declKind); + public findTopLevelSymbol(name: string, kind: PullElementKind, doNotGoPastThisDecl: PullDecl): PullSymbol; + private findTopLevelSymbolInDecl(topLevelDecl, name, kind, doNotGoPastThisDecl); + public findExternalModule(id: string): PullContainerSymbol; + public findAmbientExternalModuleInGlobalContext(id: string): PullContainerSymbol; + public findDecls(declPath: string[], declKind: PullElementKind): PullDecl[]; + public findDeclsFromPath(declPath: PullDecl[], declKind: PullElementKind): PullDecl[]; + public findSymbol(declPath: string[], declType: PullElementKind): PullSymbol; + public cacheGlobalSymbol(symbol: PullSymbol, kind: PullElementKind): void; + public invalidate(oldSettings?: ImmutableCompilationSettings, newSettings?: ImmutableCompilationSettings): void; + private settingsChangeAffectsSyntax(before, after); + public setSymbolForAST(ast: AST, symbol: PullSymbol): void; + public getSymbolForAST(ast: AST): PullSymbol; + public setAliasSymbolForAST(ast: AST, symbol: PullTypeAliasSymbol): void; + public getAliasSymbolForAST(ast: AST): PullTypeAliasSymbol; + public getCallResolutionDataForAST(ast: AST): PullAdditionalCallResolutionData; + public setCallResolutionDataForAST(ast: AST, callResolutionData: PullAdditionalCallResolutionData): void; + public setSymbolForDecl(decl: PullDecl, symbol: PullSymbol): void; + public getSymbolForDecl(decl: PullDecl): PullSymbol; + public setSignatureSymbolForDecl(decl: PullDecl, signatureSymbol: PullSignatureSymbol): void; + public getSignatureSymbolForDecl(decl: PullDecl): PullSignatureSymbol; + public addDiagnostic(diagnostic: Diagnostic): void; + public getDiagnostics(fileName: string): Diagnostic[]; + public getBinder(): PullSymbolBinder; + public getResolver(): PullTypeResolver; + public addSyntheticIndexSignature(containingDecl: PullDecl, containingSymbol: PullTypeSymbol, ast: AST, indexParamName: string, indexParamType: PullTypeSymbol, returnType: PullTypeSymbol): void; + public getDeclForAST(ast: AST): PullDecl; + public getEnclosingDecl(ast: AST): PullDecl; + public setDeclForAST(ast: AST, decl: PullDecl): void; + public getASTForDecl(decl: PullDecl): AST; + public setASTForDecl(decl: PullDecl, ast: AST): void; + public topLevelDecl(fileName: string): PullDecl; + public topLevelDecls(): PullDecl[]; + public addDiagnosticFromAST(ast: AST, diagnosticKey: string, _arguments?: any[], additionalLocations?: Location[]): void; + public diagnosticFromAST(ast: AST, diagnosticKey: string, _arguments?: any[], additionalLocations?: Location[]): Diagnostic; + public locationFromAST(ast: AST): Location; + public duplicateIdentifierDiagnosticFromAST(ast: AST, identifier: string, additionalLocationAST: AST): Diagnostic; + public addDuplicateIdentifierDiagnosticFromAST(ast: AST, identifier: string, additionalLocationAST: AST): void; + } +} +declare module TypeScript { + module DeclarationCreator { + function create(document: Document, semanticInfoChain: SemanticInfoChain, compilationSettings: ImmutableCompilationSettings): PullDecl; + } +} +declare module TypeScript { + class PullSymbolBinder { + private semanticInfoChain; + private declsBeingBound; + private inBindingOtherDeclsWalker; + constructor(semanticInfoChain: SemanticInfoChain); + private getParent(decl, returnInstanceType?); + private findDeclsInContext(startingDecl, declKind, searchGlobally); + private getExistingSymbol(decl, searchKind, parent); + private checkThatExportsMatch(decl, prevSymbol, reportError?); + private getIndexForInsertingSignatureAtEndOfEnclosingDeclInSignatureList(signature, currentSignatures); + private bindEnumDeclarationToPullSymbol(enumContainerDecl); + private bindEnumIndexerDeclsToPullSymbols(enumContainerSymbol); + private findExistingVariableSymbolForModuleValueDecl(decl); + private bindModuleDeclarationToPullSymbol(moduleContainerDecl); + private bindImportDeclaration(importDeclaration); + private ensurePriorDeclarationsAreBound(container, currentDecl); + private bindClassDeclarationToPullSymbol(classDecl); + private bindInterfaceDeclarationToPullSymbol(interfaceDecl); + private bindObjectTypeDeclarationToPullSymbol(objectDecl); + private bindConstructorTypeDeclarationToPullSymbol(constructorTypeDeclaration); + private bindVariableDeclarationToPullSymbol(variableDeclaration); + private bindCatchVariableToPullSymbol(variableDeclaration); + private bindEnumMemberDeclarationToPullSymbol(propertyDeclaration); + private bindPropertyDeclarationToPullSymbol(propertyDeclaration); + private bindParameterSymbols(functionDeclaration, parameterList, funcType, signatureSymbol); + private bindFunctionDeclarationToPullSymbol(functionDeclaration); + private bindFunctionExpressionToPullSymbol(functionExpressionDeclaration); + private bindFunctionTypeDeclarationToPullSymbol(functionTypeDeclaration); + private bindMethodDeclarationToPullSymbol(methodDeclaration); + private bindStaticPrototypePropertyOfClass(classAST, classTypeSymbol, constructorTypeSymbol); + private bindConstructorDeclarationToPullSymbol(constructorDeclaration); + private bindConstructSignatureDeclarationToPullSymbol(constructSignatureDeclaration); + private bindCallSignatureDeclarationToPullSymbol(callSignatureDeclaration); + private bindIndexSignatureDeclarationToPullSymbol(indexSignatureDeclaration); + private bindGetAccessorDeclarationToPullSymbol(getAccessorDeclaration); + private bindSetAccessorDeclarationToPullSymbol(setAccessorDeclaration); + private getDeclsToBind(decl); + private shouldBindDeclaration(decl); + public bindDeclToPullSymbol(decl: PullDecl): void; + private bindAllDeclsToPullSymbol(askedDecl); + private bindSingleDeclToPullSymbol(decl); + } +} +declare module TypeScript { + module PullHelpers { + function diagnosticFromDecl(decl: PullDecl, diagnosticKey: string, _arguments?: any[], additionalLocations?: Location[]): Diagnostic; + function resolveDeclaredSymbolToUseType(symbol: PullSymbol): void; + interface SignatureInfoForFuncDecl { + signature: PullSignatureSymbol; + allSignatures: PullSignatureSymbol[]; + } + function getSignatureForFuncDecl(functionDecl: PullDecl): { + signature: PullSignatureSymbol; + allSignatures: PullSignatureSymbol[]; + }; + function getAccessorSymbol(getterOrSetter: AST, semanticInfoChain: SemanticInfoChain): PullAccessorSymbol; + function getGetterAndSetterFunction(funcDecl: AST, semanticInfoChain: SemanticInfoChain): { + getter: GetAccessor; + setter: SetAccessor; + }; + function symbolIsEnum(source: PullSymbol): boolean; + function symbolIsModule(symbol: PullSymbol): boolean; + function isNameNumeric(name: string): boolean; + function typeSymbolsAreIdentical(a: PullTypeSymbol, b: PullTypeSymbol): boolean; + function getRootType(type: PullTypeSymbol): PullTypeSymbol; + function isSymbolLocal(symbol: PullSymbol): boolean; + function isExportedSymbolInClodule(symbol: PullSymbol): boolean; + function isSymbolDeclaredInScopeChain(symbol: PullSymbol, scopeSymbol: PullSymbol): boolean; + interface PullTypeSymbolStructureWalker { + memberSymbolWalk(memberSymbol: PullSymbol): boolean; + callSignatureWalk(signatureSymbol: PullSignatureSymbol): boolean; + constructSignatureWalk(signatureSymbol: PullSignatureSymbol): boolean; + indexSignatureWalk(signatureSymbol: PullSignatureSymbol): boolean; + signatureParameterWalk(parameterSymbol: PullSymbol): boolean; + signatureReturnTypeWalk(returnType: PullTypeSymbol): boolean; + } + function walkPullTypeSymbolStructure(typeSymbol: PullTypeSymbol, walker: PullTypeSymbolStructureWalker): void; + class OtherPullDeclsWalker { + private currentlyWalkingOtherDecls; + public walkOtherPullDecls(currentDecl: PullDecl, otherDecls: PullDecl[], callBack: (otherDecl: PullDecl) => void): void; + } + } +} +declare module TypeScript { + class WrapsTypeParameterCache { + private _wrapsTypeParameterCache; + public getWrapsTypeParameter(typeParameterArgumentMap: TypeArgumentMap): number; + public setWrapsTypeParameter(typeParameterArgumentMap: TypeArgumentMap, wrappingTypeParameterID: number): void; + } + module PullInstantiationHelpers { + class MutableTypeArgumentMap { + public typeParameterArgumentMap: TypeArgumentMap; + public createdDuplicateTypeArgumentMap: boolean; + constructor(typeParameterArgumentMap: TypeArgumentMap); + public ensureTypeArgumentCopy(): void; + } + function instantiateTypeArgument(resolver: PullTypeResolver, symbol: InstantiableSymbol, mutableTypeParameterMap: MutableTypeArgumentMap): void; + function cleanUpTypeArgumentMap(symbol: InstantiableSymbol, mutableTypeArgumentMap: MutableTypeArgumentMap): void; + function getAllowedToReferenceTypeParametersFromDecl(decl: PullDecl): PullTypeParameterSymbol[]; + function createTypeParameterArgumentMap(typeParameters: PullTypeParameterSymbol[], typeArguments: PullTypeSymbol[]): TypeArgumentMap; + function updateTypeParameterArgumentMap(typeParameters: PullTypeParameterSymbol[], typeArguments: PullTypeSymbol[], typeParameterArgumentMap: TypeArgumentMap): TypeArgumentMap; + function updateMutableTypeParameterArgumentMap(typeParameters: PullTypeParameterSymbol[], typeArguments: PullTypeSymbol[], mutableMap: MutableTypeArgumentMap): void; + function twoTypesAreInstantiationsOfSameNamedGenericType(type1: PullTypeSymbol, type2: PullTypeSymbol): boolean; + } +} +declare module TypeScript { + var fileResolutionTime: number; + var fileResolutionIOTime: number; + var fileResolutionScanImportsTime: number; + var fileResolutionImportFileSearchTime: number; + var fileResolutionGetDefaultLibraryTime: number; + var sourceCharactersCompiled: number; + var syntaxTreeParseTime: number; + var syntaxDiagnosticsTime: number; + var astTranslationTime: number; + var typeCheckTime: number; + var compilerResolvePathTime: number; + var compilerDirectoryNameTime: number; + var compilerDirectoryExistsTime: number; + var compilerFileExistsTime: number; + var emitTime: number; + var emitWriteFileTime: number; + var declarationEmitTime: number; + var declarationEmitIsExternallyVisibleTime: number; + var declarationEmitTypeSignatureTime: number; + var declarationEmitGetBoundDeclTypeTime: number; + var declarationEmitIsOverloadedCallSignatureTime: number; + var declarationEmitFunctionDeclarationGetSymbolTime: number; + var declarationEmitGetBaseTypeTime: number; + var declarationEmitGetAccessorFunctionTime: number; + var declarationEmitGetTypeParameterSymbolTime: number; + var declarationEmitGetImportDeclarationSymbolTime: number; + var ioHostResolvePathTime: number; + var ioHostDirectoryNameTime: number; + var ioHostCreateDirectoryStructureTime: number; + var ioHostWriteFileTime: number; + interface PullSymbolInfo { + symbol: PullSymbol; + aliasSymbol: PullTypeAliasSymbol; + ast: AST; + enclosingScopeSymbol: PullSymbol; + } + interface PullCallSymbolInfo { + targetSymbol: PullSymbol; + resolvedSignatures: PullSignatureSymbol[]; + candidateSignature: PullSignatureSymbol; + isConstructorCall: boolean; + ast: AST; + enclosingScopeSymbol: PullSymbol; + } + interface PullVisibleSymbolsInfo { + symbols: PullSymbol[]; + enclosingScopeSymbol: PullSymbol; + } + enum EmitOutputResult { + Succeeded = 0, + FailedBecauseOfSyntaxErrors = 1, + FailedBecauseOfCompilerOptionsErrors = 2, + FailedToGenerateDeclarationsBecauseOfSemanticErrors = 3, + } + class EmitOutput { + public outputFiles: OutputFile[]; + public emitOutputResult: EmitOutputResult; + constructor(emitOutputResult?: EmitOutputResult); + } + enum OutputFileType { + JavaScript = 0, + SourceMap = 1, + Declaration = 2, + } + class OutputFile { + public name: string; + public writeByteOrderMark: boolean; + public text: string; + public fileType: OutputFileType; + public sourceMapEntries: SourceMapEntry[]; + constructor(name: string, writeByteOrderMark: boolean, text: string, fileType: OutputFileType, sourceMapEntries?: SourceMapEntry[]); + } + class CompileResult { + public diagnostics: Diagnostic[]; + public outputFiles: OutputFile[]; + static fromDiagnostics(diagnostics: Diagnostic[]): CompileResult; + static fromOutputFiles(outputFiles: OutputFile[]): CompileResult; + } + class TypeScriptCompiler { + public logger: ILogger; + private _settings; + private semanticInfoChain; + constructor(logger?: ILogger, _settings?: ImmutableCompilationSettings); + public compilationSettings(): ImmutableCompilationSettings; + public setCompilationSettings(newSettings: ImmutableCompilationSettings): void; + public getDocument(fileName: string): Document; + public cleanupSemanticCache(): void; + public addFile(fileName: string, scriptSnapshot: IScriptSnapshot, byteOrderMark: ByteOrderMark, version: number, isOpen: boolean, referencedFiles?: string[]): void; + public updateFile(fileName: string, scriptSnapshot: IScriptSnapshot, version: number, isOpen: boolean, textChangeRange: TextChangeRange): void; + public removeFile(fileName: string): void; + public mapOutputFileName(document: Document, emitOptions: EmitOptions, extensionChanger: (fname: string, wholeFileNameReplaced: boolean) => string): string; + private writeByteOrderMarkForDocument(document); + static mapToDTSFileName(fileName: string, wholeFileNameReplaced: boolean): string; + public _shouldEmit(document: Document): boolean; + public _shouldEmitDeclarations(document: Document): boolean; + private emitDocumentDeclarationsWorker(document, emitOptions, declarationEmitter?); + public _emitDocumentDeclarations(document: Document, emitOptions: EmitOptions, onSingleFileEmitComplete: (files: OutputFile) => void, sharedEmitter: DeclarationEmitter): DeclarationEmitter; + public emitAllDeclarations(resolvePath: (path: string) => string): EmitOutput; + public emitDeclarations(fileName: string, resolvePath: (path: string) => string): EmitOutput; + public canEmitDeclarations(fileName: string): boolean; + static mapToFileNameExtension(extension: string, fileName: string, wholeFileNameReplaced: boolean): string; + static mapToJSFileName(fileName: string, wholeFileNameReplaced: boolean): string; + private emitDocumentWorker(document, emitOptions, emitter?); + public _emitDocument(document: Document, emitOptions: EmitOptions, onSingleFileEmitComplete: (files: OutputFile[]) => void, sharedEmitter: Emitter): Emitter; + public emitAll(resolvePath: (path: string) => string): EmitOutput; + public emit(fileName: string, resolvePath: (path: string) => string): EmitOutput; + public compile(resolvePath: (path: string) => string, continueOnDiagnostics?: boolean): Iterator; + public getSyntacticDiagnostics(fileName: string): Diagnostic[]; + private getSyntaxTree(fileName); + private getSourceUnit(fileName); + public getSemanticDiagnostics(fileName: string): Diagnostic[]; + public getCompilerOptionsDiagnostics(resolvePath: (path: string) => string): Diagnostic[]; + public resolveAllFiles(): void; + public getSymbolOfDeclaration(decl: PullDecl): PullSymbol; + private extractResolutionContextFromAST(resolver, ast, document, propagateContextualTypes); + private extractResolutionContextForVariable(inContextuallyTypedAssignment, propagateContextualTypes, resolver, resolutionContext, enclosingDecl, assigningAST, init); + private getASTPath(ast); + public pullGetSymbolInformationFromAST(ast: AST, document: Document): PullSymbolInfo; + public pullGetCallInformationFromAST(ast: AST, document: Document): PullCallSymbolInfo; + public pullGetVisibleMemberSymbolsFromAST(ast: AST, document: Document): PullVisibleSymbolsInfo; + public pullGetVisibleDeclsFromAST(ast: AST, document: Document): PullDecl[]; + public pullGetContextualMembersFromAST(ast: AST, document: Document): PullVisibleSymbolsInfo; + public pullGetDeclInformation(decl: PullDecl, ast: AST, document: Document): PullSymbolInfo; + public topLevelDeclaration(fileName: string): PullDecl; + public getDeclForAST(ast: AST): PullDecl; + public fileNames(): string[]; + public topLevelDecl(fileName: string): PullDecl; + private static getLocationText(location, resolvePath); + static getFullDiagnosticText(diagnostic: Diagnostic, resolvePath: (path: string) => string): string; + } + function compareDataObjects(dst: any, src: any): boolean; +} +declare module TypeScript { + enum GenerativeTypeClassification { + Unknown = 0, + Open = 1, + Closed = 2, + InfinitelyExpanding = 3, + } + interface TypeArgumentMap { + [n: number]: PullTypeSymbol; + } + class PullTypeReferenceSymbol extends PullTypeSymbol { + public referencedTypeSymbol: PullTypeSymbol; + static createTypeReference(type: PullTypeSymbol): PullTypeReferenceSymbol; + constructor(referencedTypeSymbol: PullTypeSymbol); + public isTypeReference(): boolean; + public isResolved: boolean; + public setResolved(): void; + public setUnresolved(): void; + public invalidate(): void; + public ensureReferencedTypeIsResolved(): void; + public getReferencedTypeSymbol(): PullTypeSymbol; + public _getResolver(): PullTypeResolver; + public hasMembers(): boolean; + public setAssociatedContainerType(type: PullTypeSymbol): void; + public getAssociatedContainerType(): PullTypeSymbol; + public getFunctionSymbol(): PullSymbol; + public setFunctionSymbol(symbol: PullSymbol): void; + public addContainedNonMember(nonMember: PullSymbol): void; + public findContainedNonMemberContainer(containerName: string, kind?: PullElementKind): PullTypeSymbol; + public addMember(memberSymbol: PullSymbol): void; + public addEnclosedMemberType(enclosedType: PullTypeSymbol): void; + public addEnclosedMemberContainer(enclosedContainer: PullTypeSymbol): void; + public addEnclosedNonMember(enclosedNonMember: PullSymbol): void; + public addEnclosedNonMemberType(enclosedNonMemberType: PullTypeSymbol): void; + public addEnclosedNonMemberContainer(enclosedNonMemberContainer: PullTypeSymbol): void; + public addTypeParameter(typeParameter: PullTypeParameterSymbol): void; + public addConstructorTypeParameter(typeParameter: PullTypeParameterSymbol): void; + public findContainedNonMember(name: string): PullSymbol; + public findContainedNonMemberType(typeName: string, kind?: PullElementKind): PullTypeSymbol; + public getMembers(): PullSymbol[]; + public setHasDefaultConstructor(hasOne?: boolean): void; + public getHasDefaultConstructor(): boolean; + public getConstructorMethod(): PullSymbol; + public setConstructorMethod(constructorMethod: PullSymbol): void; + public getTypeParameters(): PullTypeParameterSymbol[]; + public isGeneric(): boolean; + public addSpecialization(specializedVersionOfThisType: PullTypeSymbol, substitutingTypes: PullTypeSymbol[]): void; + public getSpecialization(substitutingTypes: PullTypeSymbol[]): PullTypeSymbol; + public getKnownSpecializations(): PullTypeSymbol[]; + public getTypeArguments(): PullTypeSymbol[]; + public getTypeArgumentsOrTypeParameters(): PullTypeSymbol[]; + public appendCallSignature(callSignature: PullSignatureSymbol): void; + public insertCallSignatureAtIndex(callSignature: PullSignatureSymbol, index: number): void; + public appendConstructSignature(callSignature: PullSignatureSymbol): void; + public insertConstructSignatureAtIndex(callSignature: PullSignatureSymbol, index: number): void; + public addIndexSignature(indexSignature: PullSignatureSymbol): void; + public hasOwnCallSignatures(): boolean; + public getCallSignatures(): PullSignatureSymbol[]; + public hasOwnConstructSignatures(): boolean; + public getConstructSignatures(): PullSignatureSymbol[]; + public hasOwnIndexSignatures(): boolean; + public getIndexSignatures(): PullSignatureSymbol[]; + public addImplementedType(implementedType: PullTypeSymbol): void; + public getImplementedTypes(): PullTypeSymbol[]; + public addExtendedType(extendedType: PullTypeSymbol): void; + public getExtendedTypes(): PullTypeSymbol[]; + public addTypeThatExtendsThisType(type: PullTypeSymbol): void; + public getTypesThatExtendThisType(): PullTypeSymbol[]; + public addTypeThatExplicitlyImplementsThisType(type: PullTypeSymbol): void; + public getTypesThatExplicitlyImplementThisType(): PullTypeSymbol[]; + public isValidBaseKind(baseType: PullTypeSymbol, isExtendedType: boolean): boolean; + public findMember(name: string, lookInParent?: boolean): PullSymbol; + public findNestedType(name: string, kind?: PullElementKind): PullTypeSymbol; + public findNestedContainer(name: string, kind?: PullElementKind): PullTypeSymbol; + public getAllMembers(searchDeclKind: PullElementKind, memberVisiblity: GetAllMembersVisiblity): PullSymbol[]; + public findTypeParameter(name: string): PullTypeParameterSymbol; + public hasOnlyOverloadCallSignatures(): boolean; + } + var nSpecializationsCreated: number; + var nSpecializedSignaturesCreated: number; + var nSpecializedTypeParameterCreated: number; + class PullInstantiatedTypeReferenceSymbol extends PullTypeReferenceSymbol { + public referencedTypeSymbol: PullTypeSymbol; + private _typeParameterArgumentMap; + public isInstanceReferenceType: boolean; + private _instantiatedMembers; + private _allInstantiatedMemberNameCache; + private _instantiatedMemberNameCache; + private _instantiatedCallSignatures; + private _instantiatedConstructSignatures; + private _instantiatedIndexSignatures; + private _typeArgumentReferences; + private _instantiatedConstructorMethod; + private _instantiatedAssociatedContainerType; + private _isArray; + public getIsSpecialized(): boolean; + private _generativeTypeClassification; + public getGenerativeTypeClassification(enclosingType: PullTypeSymbol): GenerativeTypeClassification; + public isArrayNamedTypeReference(): boolean; + public getElementType(): PullTypeSymbol; + public getReferencedTypeSymbol(): PullTypeSymbol; + static create(resolver: PullTypeResolver, type: PullTypeSymbol, typeParameterArgumentMap: TypeArgumentMap): PullInstantiatedTypeReferenceSymbol; + constructor(referencedTypeSymbol: PullTypeSymbol, _typeParameterArgumentMap: TypeArgumentMap, isInstanceReferenceType: boolean); + public isGeneric(): boolean; + public getTypeParameterArgumentMap(): TypeArgumentMap; + public getTypeArguments(): PullTypeSymbol[]; + public getTypeArgumentsOrTypeParameters(): PullTypeSymbol[]; + private populateInstantiatedMemberFromReferencedMember(referencedMember); + public getMembers(): PullSymbol[]; + public findMember(name: string, lookInParent?: boolean): PullSymbol; + public getAllMembers(searchDeclKind: PullElementKind, memberVisiblity: GetAllMembersVisiblity): PullSymbol[]; + public getConstructorMethod(): PullSymbol; + public getAssociatedContainerType(): PullTypeSymbol; + public getCallSignatures(): PullSignatureSymbol[]; + public getConstructSignatures(): PullSignatureSymbol[]; + public getIndexSignatures(): PullSignatureSymbol[]; + } + class PullInstantiatedSignatureSymbol extends PullSignatureSymbol { + private _typeParameterArgumentMap; + public getTypeParameterArgumentMap(): TypeArgumentMap; + constructor(rootSignature: PullSignatureSymbol, _typeParameterArgumentMap: TypeArgumentMap); + public getIsSpecialized(): boolean; + public _getResolver(): PullTypeResolver; + public getTypeParameters(): PullTypeParameterSymbol[]; + public getAllowedToReferenceTypeParameters(): PullTypeParameterSymbol[]; + } + class PullInstantiatedTypeParameterSymbol extends PullTypeParameterSymbol { + constructor(rootTypeParameter: PullTypeSymbol, constraintType: PullTypeSymbol); + public _getResolver(): PullTypeResolver; + } +} +declare module TypeScript { + class SyntaxTreeToAstVisitor implements ISyntaxVisitor { + private fileName; + public lineMap: LineMap; + private compilationSettings; + public position: number; + public previousTokenTrailingComments: Comment[]; + constructor(fileName: string, lineMap: LineMap, compilationSettings: ImmutableCompilationSettings); + static visit(syntaxTree: SyntaxTree, fileName: string, compilationSettings: ImmutableCompilationSettings, incrementalAST: boolean): SourceUnit; + public movePast(element: ISyntaxElement): void; + private moveTo(element1, element2); + private setCommentsAndSpan(ast, fullStart, node); + public createTokenSpan(fullStart: number, element: ISyntaxToken): ASTSpan; + public setSpan(span: AST, fullStart: number, element: ISyntaxElement, firstToken?: ISyntaxToken, lastToken?: ISyntaxToken): void; + public setSpanExplicit(span: IASTSpan, start: number, end: number): void; + public visitSyntaxList(node: ISyntaxList): ISyntaxList2; + public visitSeparatedSyntaxList(list: ISeparatedSyntaxList): ISeparatedSyntaxList2; + private convertComment(trivia, commentStartPosition, hasTrailingNewLine); + private convertComments(triviaList, commentStartPosition); + private mergeComments(comments1, comments2); + private convertTokenLeadingComments(token, commentStartPosition); + private convertTokenTrailingComments(token, commentStartPosition); + private convertNodeTrailingComments(node, lastToken, nodeStart); + private visitIdentifier(token); + public visitToken(token: ISyntaxToken): IASTToken; + public visitTokenWorker(token: ISyntaxToken): IASTToken; + public visitSourceUnit(node: SourceUnitSyntax): SourceUnit; + public visitExternalModuleReference(node: ExternalModuleReferenceSyntax): ExternalModuleReference; + public visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): ModuleNameModuleReference; + public visitClassDeclaration(node: ClassDeclarationSyntax): ClassDeclaration; + private visitModifiers(modifiers); + public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): InterfaceDeclaration; + public visitHeritageClause(node: HeritageClauseSyntax): HeritageClause; + public visitModuleDeclaration(node: ModuleDeclarationSyntax): ModuleDeclaration; + public visitFunctionDeclaration(node: FunctionDeclarationSyntax): FunctionDeclaration; + public visitEnumDeclaration(node: EnumDeclarationSyntax): EnumDeclaration; + public visitEnumElement(node: EnumElementSyntax): EnumElement; + public visitImportDeclaration(node: ImportDeclarationSyntax): ImportDeclaration; + public visitExportAssignment(node: ExportAssignmentSyntax): ExportAssignment; + public visitVariableStatement(node: VariableStatementSyntax): VariableStatement; + public visitVariableDeclaration(node: VariableDeclarationSyntax): VariableDeclaration; + public visitVariableDeclarator(node: VariableDeclaratorSyntax): VariableDeclarator; + public visitEqualsValueClause(node: EqualsValueClauseSyntax): EqualsValueClause; + public visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): PrefixUnaryExpression; + public visitArrayLiteralExpression(node: ArrayLiteralExpressionSyntax): ArrayLiteralExpression; + public visitOmittedExpression(node: OmittedExpressionSyntax): OmittedExpression; + public visitParenthesizedExpression(node: ParenthesizedExpressionSyntax): ParenthesizedExpression; + public visitSimpleArrowFunctionExpression(node: SimpleArrowFunctionExpressionSyntax): SimpleArrowFunctionExpression; + public visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): ParenthesizedArrowFunctionExpression; + public visitType(type: ITypeSyntax): AST; + public visitTypeQuery(node: TypeQuerySyntax): TypeQuery; + public visitQualifiedName(node: QualifiedNameSyntax): QualifiedName; + public visitTypeArgumentList(node: TypeArgumentListSyntax): TypeArgumentList; + public visitConstructorType(node: ConstructorTypeSyntax): ConstructorType; + public visitFunctionType(node: FunctionTypeSyntax): FunctionType; + public visitObjectType(node: ObjectTypeSyntax): ObjectType; + public visitArrayType(node: ArrayTypeSyntax): ArrayType; + public visitGenericType(node: GenericTypeSyntax): GenericType; + public visitTypeAnnotation(node: TypeAnnotationSyntax): TypeAnnotation; + public visitBlock(node: BlockSyntax): Block; + public visitParameter(node: ParameterSyntax): Parameter; + public visitMemberAccessExpression(node: MemberAccessExpressionSyntax): MemberAccessExpression; + public visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): PostfixUnaryExpression; + public visitElementAccessExpression(node: ElementAccessExpressionSyntax): ElementAccessExpression; + public visitInvocationExpression(node: InvocationExpressionSyntax): InvocationExpression; + public visitArgumentList(node: ArgumentListSyntax): ArgumentList; + public visitBinaryExpression(node: BinaryExpressionSyntax): BinaryExpression; + public visitConditionalExpression(node: ConditionalExpressionSyntax): ConditionalExpression; + public visitConstructSignature(node: ConstructSignatureSyntax): ConstructSignature; + public visitMethodSignature(node: MethodSignatureSyntax): MethodSignature; + public visitIndexSignature(node: IndexSignatureSyntax): IndexSignature; + public visitPropertySignature(node: PropertySignatureSyntax): PropertySignature; + public visitParameterList(node: ParameterListSyntax): ParameterList; + public visitCallSignature(node: CallSignatureSyntax): CallSignature; + public visitTypeParameterList(node: TypeParameterListSyntax): TypeParameterList; + public visitTypeParameter(node: TypeParameterSyntax): TypeParameter; + public visitConstraint(node: ConstraintSyntax): Constraint; + public visitIfStatement(node: IfStatementSyntax): IfStatement; + public visitElseClause(node: ElseClauseSyntax): ElseClause; + public visitExpressionStatement(node: ExpressionStatementSyntax): ExpressionStatement; + public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): ConstructorDeclaration; + public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): IndexMemberDeclaration; + public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): MemberFunctionDeclaration; + public visitGetAccessor(node: GetAccessorSyntax): GetAccessor; + public visitSetAccessor(node: SetAccessorSyntax): SetAccessor; + public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): MemberVariableDeclaration; + public visitThrowStatement(node: ThrowStatementSyntax): ThrowStatement; + public visitReturnStatement(node: ReturnStatementSyntax): ReturnStatement; + public visitObjectCreationExpression(node: ObjectCreationExpressionSyntax): ObjectCreationExpression; + public visitSwitchStatement(node: SwitchStatementSyntax): SwitchStatement; + public visitCaseSwitchClause(node: CaseSwitchClauseSyntax): CaseSwitchClause; + public visitDefaultSwitchClause(node: DefaultSwitchClauseSyntax): DefaultSwitchClause; + public visitBreakStatement(node: BreakStatementSyntax): BreakStatement; + public visitContinueStatement(node: ContinueStatementSyntax): ContinueStatement; + public visitForStatement(node: ForStatementSyntax): ForStatement; + public visitForInStatement(node: ForInStatementSyntax): ForInStatement; + public visitWhileStatement(node: WhileStatementSyntax): WhileStatement; + public visitWithStatement(node: WithStatementSyntax): WithStatement; + public visitCastExpression(node: CastExpressionSyntax): CastExpression; + public visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): ObjectLiteralExpression; + public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): SimplePropertyAssignment; + public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): FunctionPropertyAssignment; + public visitFunctionExpression(node: FunctionExpressionSyntax): FunctionExpression; + public visitEmptyStatement(node: EmptyStatementSyntax): EmptyStatement; + public visitTryStatement(node: TryStatementSyntax): TryStatement; + public visitCatchClause(node: CatchClauseSyntax): CatchClause; + public visitFinallyClause(node: FinallyClauseSyntax): FinallyClause; + public visitLabeledStatement(node: LabeledStatementSyntax): LabeledStatement; + public visitDoStatement(node: DoStatementSyntax): DoStatement; + public visitTypeOfExpression(node: TypeOfExpressionSyntax): TypeOfExpression; + public visitDeleteExpression(node: DeleteExpressionSyntax): DeleteExpression; + public visitVoidExpression(node: VoidExpressionSyntax): VoidExpression; + public visitDebuggerStatement(node: DebuggerStatementSyntax): DebuggerStatement; + } +} +declare module TypeScript { + interface IASTSpan { + _start: number; + _end: number; + start(): number; + end(): number; + } + class ASTSpan implements IASTSpan { + public _start: number; + public _end: number; + constructor(_start: number, _end: number); + public start(): number; + public end(): number; + } + function structuralEqualsNotIncludingPosition(ast1: AST, ast2: AST): boolean; + function structuralEqualsIncludingPosition(ast1: AST, ast2: AST): boolean; + class AST implements IASTSpan { + public parent: AST; + public _start: number; + public _end: number; + public _trailingTriviaWidth: number; + private _astID; + private _preComments; + private _postComments; + constructor(); + public syntaxID(): number; + public start(): number; + public end(): number; + public trailingTriviaWidth(): number; + public fileName(): string; + public kind(): SyntaxKind; + public preComments(): Comment[]; + public postComments(): Comment[]; + public setPreComments(comments: Comment[]): void; + public setPostComments(comments: Comment[]): void; + public width(): number; + public structuralEquals(ast: AST, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + interface IASTToken extends AST { + text(): string; + valueText(): string; + } + class ISyntaxList2 extends AST { + private _fileName; + private members; + constructor(_fileName: string, members: AST[]); + public childCount(): number; + public childAt(index: number): AST; + public fileName(): string; + public kind(): SyntaxKind; + public firstOrDefault(func: (v: AST, index: number) => boolean): AST; + public lastOrDefault(func: (v: AST, index: number) => boolean): AST; + public any(func: (v: AST) => boolean): boolean; + public structuralEquals(ast: ISyntaxList2, includingPosition: boolean): boolean; + } + class ISeparatedSyntaxList2 extends AST { + private _fileName; + private members; + private _separatorCount; + constructor(_fileName: string, members: AST[], _separatorCount: number); + public nonSeparatorCount(): number; + public separatorCount(): number; + public nonSeparatorAt(index: number): AST; + public nonSeparatorIndexOf(ast: AST): number; + public fileName(): string; + public kind(): SyntaxKind; + public structuralEquals(ast: ISeparatedSyntaxList2, includingPosition: boolean): boolean; + } + class SourceUnit extends AST { + public moduleElements: ISyntaxList2; + public endOfFileTokenLeadingComments: Comment[]; + private _fileName; + constructor(moduleElements: ISyntaxList2, endOfFileTokenLeadingComments: Comment[], _fileName: string); + public fileName(): string; + public kind(): SyntaxKind; + public structuralEquals(ast: SourceUnit, includingPosition: boolean): boolean; + } + class Identifier extends AST implements IASTToken { + private _text; + private _valueText; + constructor(_text: string); + public text(): string; + public valueText(): string; + public kind(): SyntaxKind; + public structuralEquals(ast: Identifier, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class LiteralExpression extends AST { + private _nodeType; + private _text; + private _valueText; + constructor(_nodeType: SyntaxKind, _text: string, _valueText: string); + public text(): string; + public valueText(): string; + public kind(): SyntaxKind; + public structuralEquals(ast: ParenthesizedExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class ThisExpression extends AST implements IASTToken { + private _text; + private _valueText; + constructor(_text: string, _valueText: string); + public text(): string; + public valueText(): string; + public kind(): SyntaxKind; + public structuralEquals(ast: ParenthesizedExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class SuperExpression extends AST implements IASTToken { + private _text; + private _valueText; + constructor(_text: string, _valueText: string); + public text(): string; + public valueText(): string; + public kind(): SyntaxKind; + public structuralEquals(ast: ParenthesizedExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class NumericLiteral extends AST implements IASTToken { + private _value; + private _text; + private _valueText; + constructor(_value: number, _text: string, _valueText: string); + public text(): string; + public valueText(): string; + public value(): any; + public kind(): SyntaxKind; + public structuralEquals(ast: NumericLiteral, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class RegularExpressionLiteral extends AST implements IASTToken { + private _text; + private _valueText; + constructor(_text: string, _valueText: string); + public text(): string; + public valueText(): string; + public kind(): SyntaxKind; + public isExpression(): boolean; + } + class StringLiteral extends AST implements IASTToken { + private _text; + private _valueText; + constructor(_text: string, _valueText: string); + public text(): string; + public valueText(): string; + public kind(): SyntaxKind; + public structuralEquals(ast: StringLiteral, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class TypeAnnotation extends AST { + public type: AST; + constructor(type: AST); + public kind(): SyntaxKind; + } + class BuiltInType extends AST implements IASTToken { + private _nodeType; + private _text; + private _valueText; + constructor(_nodeType: SyntaxKind, _text: string, _valueText: string); + public text(): string; + public valueText(): string; + public kind(): SyntaxKind; + } + class ExternalModuleReference extends AST { + public stringLiteral: StringLiteral; + constructor(stringLiteral: StringLiteral); + public kind(): SyntaxKind; + } + class ModuleNameModuleReference extends AST { + public moduleName: AST; + constructor(moduleName: AST); + public kind(): SyntaxKind; + } + class ImportDeclaration extends AST { + public modifiers: PullElementFlags[]; + public identifier: Identifier; + public moduleReference: AST; + constructor(modifiers: PullElementFlags[], identifier: Identifier, moduleReference: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: ImportDeclaration, includingPosition: boolean): boolean; + } + class ExportAssignment extends AST { + public identifier: Identifier; + constructor(identifier: Identifier); + public kind(): SyntaxKind; + public structuralEquals(ast: ExportAssignment, includingPosition: boolean): boolean; + } + class TypeParameterList extends AST { + public typeParameters: ISeparatedSyntaxList2; + constructor(typeParameters: ISeparatedSyntaxList2); + public kind(): SyntaxKind; + } + class ClassDeclaration extends AST { + public modifiers: PullElementFlags[]; + public identifier: Identifier; + public typeParameterList: TypeParameterList; + public heritageClauses: ISyntaxList2; + public classElements: ISyntaxList2; + public closeBraceToken: ASTSpan; + constructor(modifiers: PullElementFlags[], identifier: Identifier, typeParameterList: TypeParameterList, heritageClauses: ISyntaxList2, classElements: ISyntaxList2, closeBraceToken: ASTSpan); + public kind(): SyntaxKind; + public structuralEquals(ast: ClassDeclaration, includingPosition: boolean): boolean; + } + class InterfaceDeclaration extends AST { + public modifiers: PullElementFlags[]; + public identifier: Identifier; + public typeParameterList: TypeParameterList; + public heritageClauses: ISyntaxList2; + public body: ObjectType; + constructor(modifiers: PullElementFlags[], identifier: Identifier, typeParameterList: TypeParameterList, heritageClauses: ISyntaxList2, body: ObjectType); + public kind(): SyntaxKind; + public structuralEquals(ast: InterfaceDeclaration, includingPosition: boolean): boolean; + } + class HeritageClause extends AST { + private _nodeType; + public typeNames: ISeparatedSyntaxList2; + constructor(_nodeType: SyntaxKind, typeNames: ISeparatedSyntaxList2); + public kind(): SyntaxKind; + public structuralEquals(ast: HeritageClause, includingPosition: boolean): boolean; + } + class ModuleDeclaration extends AST { + public modifiers: PullElementFlags[]; + public name: AST; + public stringLiteral: StringLiteral; + public moduleElements: ISyntaxList2; + public endingToken: ASTSpan; + constructor(modifiers: PullElementFlags[], name: AST, stringLiteral: StringLiteral, moduleElements: ISyntaxList2, endingToken: ASTSpan); + public kind(): SyntaxKind; + public structuralEquals(ast: ModuleDeclaration, includingPosition: boolean): boolean; + } + class FunctionDeclaration extends AST { + public modifiers: PullElementFlags[]; + public identifier: Identifier; + public callSignature: CallSignature; + public block: Block; + constructor(modifiers: PullElementFlags[], identifier: Identifier, callSignature: CallSignature, block: Block); + public kind(): SyntaxKind; + public structuralEquals(ast: FunctionDeclaration, includingPosition: boolean): boolean; + } + class VariableStatement extends AST { + public modifiers: PullElementFlags[]; + public declaration: VariableDeclaration; + constructor(modifiers: PullElementFlags[], declaration: VariableDeclaration); + public kind(): SyntaxKind; + public structuralEquals(ast: VariableStatement, includingPosition: boolean): boolean; + } + class VariableDeclaration extends AST { + public declarators: ISeparatedSyntaxList2; + constructor(declarators: ISeparatedSyntaxList2); + public kind(): SyntaxKind; + public structuralEquals(ast: VariableDeclaration, includingPosition: boolean): boolean; + } + class VariableDeclarator extends AST { + public propertyName: IASTToken; + public typeAnnotation: TypeAnnotation; + public equalsValueClause: EqualsValueClause; + constructor(propertyName: IASTToken, typeAnnotation: TypeAnnotation, equalsValueClause: EqualsValueClause); + public kind(): SyntaxKind; + } + class EqualsValueClause extends AST { + public value: AST; + constructor(value: AST); + public kind(): SyntaxKind; + } + class PrefixUnaryExpression extends AST { + private _nodeType; + public operand: AST; + constructor(_nodeType: SyntaxKind, operand: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: PrefixUnaryExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class ArrayLiteralExpression extends AST { + public expressions: ISeparatedSyntaxList2; + constructor(expressions: ISeparatedSyntaxList2); + public kind(): SyntaxKind; + public structuralEquals(ast: ArrayLiteralExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class OmittedExpression extends AST { + public kind(): SyntaxKind; + public structuralEquals(ast: CatchClause, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class ParenthesizedExpression extends AST { + public openParenTrailingComments: Comment[]; + public expression: AST; + constructor(openParenTrailingComments: Comment[], expression: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: ParenthesizedExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + interface ICallExpression extends IASTSpan { + expression: AST; + argumentList: ArgumentList; + } + class SimpleArrowFunctionExpression extends AST { + public identifier: Identifier; + public block: Block; + public expression: AST; + constructor(identifier: Identifier, block: Block, expression: AST); + public kind(): SyntaxKind; + public isExpression(): boolean; + } + class ParenthesizedArrowFunctionExpression extends AST { + public callSignature: CallSignature; + public block: Block; + public expression: AST; + constructor(callSignature: CallSignature, block: Block, expression: AST); + public kind(): SyntaxKind; + public isExpression(): boolean; + } + class QualifiedName extends AST { + public left: AST; + public right: Identifier; + constructor(left: AST, right: Identifier); + public kind(): SyntaxKind; + public structuralEquals(ast: QualifiedName, includingPosition: boolean): boolean; + } + class ParameterList extends AST { + public openParenTrailingComments: Comment[]; + public parameters: ISeparatedSyntaxList2; + constructor(openParenTrailingComments: Comment[], parameters: ISeparatedSyntaxList2); + public kind(): SyntaxKind; + } + class ConstructorType extends AST { + public typeParameterList: TypeParameterList; + public parameterList: ParameterList; + public type: AST; + constructor(typeParameterList: TypeParameterList, parameterList: ParameterList, type: AST); + public kind(): SyntaxKind; + } + class FunctionType extends AST { + public typeParameterList: TypeParameterList; + public parameterList: ParameterList; + public type: AST; + constructor(typeParameterList: TypeParameterList, parameterList: ParameterList, type: AST); + public kind(): SyntaxKind; + } + class ObjectType extends AST { + public typeMembers: ISeparatedSyntaxList2; + constructor(typeMembers: ISeparatedSyntaxList2); + public kind(): SyntaxKind; + public structuralEquals(ast: ObjectType, includingPosition: boolean): boolean; + } + class ArrayType extends AST { + public type: AST; + constructor(type: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: ArrayType, includingPosition: boolean): boolean; + } + class TypeArgumentList extends AST { + public typeArguments: ISeparatedSyntaxList2; + constructor(typeArguments: ISeparatedSyntaxList2); + public kind(): SyntaxKind; + } + class GenericType extends AST { + public name: AST; + public typeArgumentList: TypeArgumentList; + constructor(name: AST, typeArgumentList: TypeArgumentList); + public kind(): SyntaxKind; + public structuralEquals(ast: GenericType, includingPosition: boolean): boolean; + } + class TypeQuery extends AST { + public name: AST; + constructor(name: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: TypeQuery, includingPosition: boolean): boolean; + } + class Block extends AST { + public statements: ISyntaxList2; + public closeBraceLeadingComments: Comment[]; + public closeBraceToken: IASTSpan; + constructor(statements: ISyntaxList2, closeBraceLeadingComments: Comment[], closeBraceToken: IASTSpan); + public kind(): SyntaxKind; + public structuralEquals(ast: Block, includingPosition: boolean): boolean; + } + class Parameter extends AST { + public dotDotDotToken: ASTSpan; + public modifiers: PullElementFlags[]; + public identifier: Identifier; + public questionToken: ASTSpan; + public typeAnnotation: TypeAnnotation; + public equalsValueClause: EqualsValueClause; + constructor(dotDotDotToken: ASTSpan, modifiers: PullElementFlags[], identifier: Identifier, questionToken: ASTSpan, typeAnnotation: TypeAnnotation, equalsValueClause: EqualsValueClause); + public kind(): SyntaxKind; + } + class MemberAccessExpression extends AST { + public expression: AST; + public name: Identifier; + constructor(expression: AST, name: Identifier); + public kind(): SyntaxKind; + public structuralEquals(ast: MemberAccessExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class PostfixUnaryExpression extends AST { + private _nodeType; + public operand: AST; + constructor(_nodeType: SyntaxKind, operand: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: PostfixUnaryExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class ElementAccessExpression extends AST { + public expression: AST; + public argumentExpression: AST; + constructor(expression: AST, argumentExpression: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: ElementAccessExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class InvocationExpression extends AST implements ICallExpression { + public expression: AST; + public argumentList: ArgumentList; + constructor(expression: AST, argumentList: ArgumentList); + public kind(): SyntaxKind; + public structuralEquals(ast: InvocationExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class ArgumentList extends AST { + public typeArgumentList: TypeArgumentList; + public closeParenToken: ASTSpan; + public arguments: ISeparatedSyntaxList2; + constructor(typeArgumentList: TypeArgumentList, _arguments: ISeparatedSyntaxList2, closeParenToken: ASTSpan); + public kind(): SyntaxKind; + } + class BinaryExpression extends AST { + private _nodeType; + public left: AST; + public right: AST; + constructor(_nodeType: SyntaxKind, left: AST, right: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: BinaryExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class ConditionalExpression extends AST { + public condition: AST; + public whenTrue: AST; + public whenFalse: AST; + constructor(condition: AST, whenTrue: AST, whenFalse: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: ConditionalExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class ConstructSignature extends AST { + public callSignature: CallSignature; + constructor(callSignature: CallSignature); + public kind(): SyntaxKind; + } + class MethodSignature extends AST { + public propertyName: IASTToken; + public questionToken: ASTSpan; + public callSignature: CallSignature; + constructor(propertyName: IASTToken, questionToken: ASTSpan, callSignature: CallSignature); + public kind(): SyntaxKind; + } + class IndexSignature extends AST { + public parameter: Parameter; + public typeAnnotation: TypeAnnotation; + constructor(parameter: Parameter, typeAnnotation: TypeAnnotation); + public kind(): SyntaxKind; + } + class PropertySignature extends AST { + public propertyName: IASTToken; + public questionToken: ASTSpan; + public typeAnnotation: TypeAnnotation; + constructor(propertyName: IASTToken, questionToken: ASTSpan, typeAnnotation: TypeAnnotation); + public kind(): SyntaxKind; + } + class CallSignature extends AST { + public typeParameterList: TypeParameterList; + public parameterList: ParameterList; + public typeAnnotation: TypeAnnotation; + constructor(typeParameterList: TypeParameterList, parameterList: ParameterList, typeAnnotation: TypeAnnotation); + public kind(): SyntaxKind; + } + class TypeParameter extends AST { + public identifier: Identifier; + public constraint: Constraint; + constructor(identifier: Identifier, constraint: Constraint); + public kind(): SyntaxKind; + public structuralEquals(ast: TypeParameter, includingPosition: boolean): boolean; + } + class Constraint extends AST { + public type: AST; + constructor(type: AST); + public kind(): SyntaxKind; + } + class ElseClause extends AST { + public statement: AST; + constructor(statement: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: ElseClause, includingPosition: boolean): boolean; + } + class IfStatement extends AST { + public condition: AST; + public statement: AST; + public elseClause: ElseClause; + constructor(condition: AST, statement: AST, elseClause: ElseClause); + public kind(): SyntaxKind; + public structuralEquals(ast: IfStatement, includingPosition: boolean): boolean; + } + class ExpressionStatement extends AST { + public expression: AST; + constructor(expression: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: ExpressionStatement, includingPosition: boolean): boolean; + } + class ConstructorDeclaration extends AST { + public callSignature: CallSignature; + public block: Block; + constructor(callSignature: CallSignature, block: Block); + public kind(): SyntaxKind; + } + class MemberFunctionDeclaration extends AST { + public modifiers: PullElementFlags[]; + public propertyName: IASTToken; + public callSignature: CallSignature; + public block: Block; + constructor(modifiers: PullElementFlags[], propertyName: IASTToken, callSignature: CallSignature, block: Block); + public kind(): SyntaxKind; + } + class GetAccessor extends AST { + public modifiers: PullElementFlags[]; + public propertyName: IASTToken; + public parameterList: ParameterList; + public typeAnnotation: TypeAnnotation; + public block: Block; + constructor(modifiers: PullElementFlags[], propertyName: IASTToken, parameterList: ParameterList, typeAnnotation: TypeAnnotation, block: Block); + public kind(): SyntaxKind; + } + class SetAccessor extends AST { + public modifiers: PullElementFlags[]; + public propertyName: IASTToken; + public parameterList: ParameterList; + public block: Block; + constructor(modifiers: PullElementFlags[], propertyName: IASTToken, parameterList: ParameterList, block: Block); + public kind(): SyntaxKind; + } + class MemberVariableDeclaration extends AST { + public modifiers: PullElementFlags[]; + public variableDeclarator: VariableDeclarator; + constructor(modifiers: PullElementFlags[], variableDeclarator: VariableDeclarator); + public kind(): SyntaxKind; + } + class IndexMemberDeclaration extends AST { + public indexSignature: IndexSignature; + constructor(indexSignature: IndexSignature); + public kind(): SyntaxKind; + } + class ThrowStatement extends AST { + public expression: AST; + constructor(expression: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: ThrowStatement, includingPosition: boolean): boolean; + } + class ReturnStatement extends AST { + public expression: AST; + constructor(expression: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: ReturnStatement, includingPosition: boolean): boolean; + } + class ObjectCreationExpression extends AST implements ICallExpression { + public expression: AST; + public argumentList: ArgumentList; + constructor(expression: AST, argumentList: ArgumentList); + public kind(): SyntaxKind; + public structuralEquals(ast: ObjectCreationExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class SwitchStatement extends AST { + public expression: AST; + public closeParenToken: ASTSpan; + public switchClauses: ISyntaxList2; + constructor(expression: AST, closeParenToken: ASTSpan, switchClauses: ISyntaxList2); + public kind(): SyntaxKind; + public structuralEquals(ast: SwitchStatement, includingPosition: boolean): boolean; + } + class CaseSwitchClause extends AST { + public expression: AST; + public statements: ISyntaxList2; + constructor(expression: AST, statements: ISyntaxList2); + public kind(): SyntaxKind; + public structuralEquals(ast: CaseSwitchClause, includingPosition: boolean): boolean; + } + class DefaultSwitchClause extends AST { + public statements: ISyntaxList2; + constructor(statements: ISyntaxList2); + public kind(): SyntaxKind; + public structuralEquals(ast: DefaultSwitchClause, includingPosition: boolean): boolean; + } + class BreakStatement extends AST { + public identifier: Identifier; + constructor(identifier: Identifier); + public kind(): SyntaxKind; + public structuralEquals(ast: BreakStatement, includingPosition: boolean): boolean; + } + class ContinueStatement extends AST { + public identifier: Identifier; + constructor(identifier: Identifier); + public kind(): SyntaxKind; + public structuralEquals(ast: ContinueStatement, includingPosition: boolean): boolean; + } + class ForStatement extends AST { + public variableDeclaration: VariableDeclaration; + public initializer: AST; + public condition: AST; + public incrementor: AST; + public statement: AST; + constructor(variableDeclaration: VariableDeclaration, initializer: AST, condition: AST, incrementor: AST, statement: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: ForStatement, includingPosition: boolean): boolean; + } + class ForInStatement extends AST { + public variableDeclaration: VariableDeclaration; + public left: AST; + public expression: AST; + public statement: AST; + constructor(variableDeclaration: VariableDeclaration, left: AST, expression: AST, statement: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: ForInStatement, includingPosition: boolean): boolean; + } + class WhileStatement extends AST { + public condition: AST; + public statement: AST; + constructor(condition: AST, statement: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: WhileStatement, includingPosition: boolean): boolean; + } + class WithStatement extends AST { + public condition: AST; + public statement: AST; + constructor(condition: AST, statement: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: WithStatement, includingPosition: boolean): boolean; + } + class EnumDeclaration extends AST { + public modifiers: PullElementFlags[]; + public identifier: Identifier; + public enumElements: ISeparatedSyntaxList2; + constructor(modifiers: PullElementFlags[], identifier: Identifier, enumElements: ISeparatedSyntaxList2); + public kind(): SyntaxKind; + } + class EnumElement extends AST { + public propertyName: IASTToken; + public equalsValueClause: EqualsValueClause; + constructor(propertyName: IASTToken, equalsValueClause: EqualsValueClause); + public kind(): SyntaxKind; + } + class CastExpression extends AST { + public type: AST; + public expression: AST; + constructor(type: AST, expression: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: CastExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class ObjectLiteralExpression extends AST { + public propertyAssignments: ISeparatedSyntaxList2; + constructor(propertyAssignments: ISeparatedSyntaxList2); + public kind(): SyntaxKind; + public structuralEquals(ast: ObjectLiteralExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class SimplePropertyAssignment extends AST { + public propertyName: Identifier; + public expression: AST; + constructor(propertyName: Identifier, expression: AST); + public kind(): SyntaxKind; + } + class FunctionPropertyAssignment extends AST { + public propertyName: Identifier; + public callSignature: CallSignature; + public block: Block; + constructor(propertyName: Identifier, callSignature: CallSignature, block: Block); + public kind(): SyntaxKind; + } + class FunctionExpression extends AST { + public identifier: Identifier; + public callSignature: CallSignature; + public block: Block; + constructor(identifier: Identifier, callSignature: CallSignature, block: Block); + public kind(): SyntaxKind; + public isExpression(): boolean; + } + class EmptyStatement extends AST { + public kind(): SyntaxKind; + public structuralEquals(ast: CatchClause, includingPosition: boolean): boolean; + } + class TryStatement extends AST { + public block: Block; + public catchClause: CatchClause; + public finallyClause: FinallyClause; + constructor(block: Block, catchClause: CatchClause, finallyClause: FinallyClause); + public kind(): SyntaxKind; + public structuralEquals(ast: TryStatement, includingPosition: boolean): boolean; + } + class CatchClause extends AST { + public identifier: Identifier; + public typeAnnotation: TypeAnnotation; + public block: Block; + constructor(identifier: Identifier, typeAnnotation: TypeAnnotation, block: Block); + public kind(): SyntaxKind; + public structuralEquals(ast: CatchClause, includingPosition: boolean): boolean; + } + class FinallyClause extends AST { + public block: Block; + constructor(block: Block); + public kind(): SyntaxKind; + public structuralEquals(ast: CatchClause, includingPosition: boolean): boolean; + } + class LabeledStatement extends AST { + public identifier: Identifier; + public statement: AST; + constructor(identifier: Identifier, statement: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: LabeledStatement, includingPosition: boolean): boolean; + } + class DoStatement extends AST { + public statement: AST; + public whileKeyword: ASTSpan; + public condition: AST; + constructor(statement: AST, whileKeyword: ASTSpan, condition: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: DoStatement, includingPosition: boolean): boolean; + } + class TypeOfExpression extends AST { + public expression: AST; + constructor(expression: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: TypeOfExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class DeleteExpression extends AST { + public expression: AST; + constructor(expression: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: DeleteExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class VoidExpression extends AST { + public expression: AST; + constructor(expression: AST); + public kind(): SyntaxKind; + public structuralEquals(ast: VoidExpression, includingPosition: boolean): boolean; + public isExpression(): boolean; + } + class DebuggerStatement extends AST { + public kind(): SyntaxKind; + } + class Comment { + private _trivia; + public endsLine: boolean; + public _start: number; + public _end: number; + constructor(_trivia: ISyntaxTrivia, endsLine: boolean, _start: number, _end: number); + public start(): number; + public end(): number; + public fullText(): string; + public kind(): SyntaxKind; + public structuralEquals(ast: Comment, includingPosition: boolean): boolean; + } +} +declare module TypeScript.Services { + enum EndOfLineState { + Start = 0, + InMultiLineCommentTrivia = 1, + InSingleQuoteStringLiteral = 2, + InDoubleQuoteStringLiteral = 3, + } + enum TokenClass { + Punctuation = 0, + Keyword = 1, + Operator = 2, + Comment = 3, + Whitespace = 4, + Identifier = 5, + NumberLiteral = 6, + StringLiteral = 7, + RegExpLiteral = 8, + } + class Classifier { + public host: IClassifierHost; + private scanner; + private characterWindow; + private diagnostics; + constructor(host: IClassifierHost); + public getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult; + private processToken(text, offset, token, result); + private processTriviaList(text, offset, triviaList, result); + private addResult(text, offset, result, length, kind); + private classFromKind(kind); + } + interface IClassifierHost extends ILogger { + } + class ClassificationResult { + public finalLexState: EndOfLineState; + public entries: ClassificationInfo[]; + constructor(); + } + class ClassificationInfo { + public length: number; + public classification: TokenClass; + constructor(length: number, classification: TokenClass); + } +} +declare module TypeScript.Services { + interface ILanguageServicesDiagnostics { + log(content: string): void; + } +} +declare module TypeScript.Services { + interface ILanguageServiceHost extends ILogger, IReferenceResolverHost { + getCompilationSettings(): CompilationSettings; + getScriptFileNames(): string[]; + getScriptVersion(fileName: string): number; + getScriptIsOpen(fileName: string): boolean; + getScriptByteOrderMark(fileName: string): ByteOrderMark; + getScriptSnapshot(fileName: string): IScriptSnapshot; + getDiagnosticsObject(): ILanguageServicesDiagnostics; + getLocalizedDiagnosticMessages(): any; + } + interface ILanguageService { + refresh(): void; + cleanupSemanticCache(): void; + getSyntacticDiagnostics(fileName: string): Diagnostic[]; + getSemanticDiagnostics(fileName: string): Diagnostic[]; + getCompilerOptionsDiagnostics(): Diagnostic[]; + getCompletionsAtPosition(fileName: string, position: number, isMemberCompletion: boolean): CompletionInfo; + getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; + getTypeAtPosition(fileName: string, position: number): TypeInfo; + getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): SpanInfo; + getBreakpointStatementAtPosition(fileName: string, position: number): SpanInfo; + getSignatureAtPosition(fileName: string, position: number): SignatureInfo; + getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; + getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; + getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; + getImplementorsAtPosition(fileName: string, position: number): ReferenceEntry[]; + getNavigateToItems(searchValue: string): NavigateToItem[]; + getScriptLexicalStructure(fileName: string): NavigateToItem[]; + getOutliningRegions(fileName: string): TextSpan[]; + getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; + getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; + getFormattingEditsForRange(fileName: string, minChar: number, limChar: number, options: FormatCodeOptions): TextEdit[]; + getFormattingEditsForDocument(fileName: string, minChar: number, limChar: number, options: FormatCodeOptions): TextEdit[]; + getFormattingEditsOnPaste(fileName: string, minChar: number, limChar: number, options: FormatCodeOptions): TextEdit[]; + getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextEdit[]; + getEmitOutput(fileName: string): EmitOutput; + getSyntaxTree(fileName: string): SyntaxTree; + } + function logInternalError(logger: ILogger, err: Error): void; + class ReferenceEntry { + public fileName: string; + public minChar: number; + public limChar: number; + public isWriteAccess: boolean; + constructor(fileName: string, minChar: number, limChar: number, isWriteAccess: boolean); + } + class NavigateToItem { + public name: string; + public kind: string; + public kindModifiers: string; + public matchKind: string; + public fileName: string; + public minChar: number; + public limChar: number; + public additionalSpans: SpanInfo[]; + public containerName: string; + public containerKind: string; + } + class TextEdit { + public minChar: number; + public limChar: number; + public text: string; + constructor(minChar: number, limChar: number, text: string); + static createInsert(pos: number, text: string): TextEdit; + static createDelete(minChar: number, limChar: number): TextEdit; + static createReplace(minChar: number, limChar: number, text: string): TextEdit; + } + class EditorOptions { + public IndentSize: number; + public TabSize: number; + public NewLineCharacter: string; + public ConvertTabsToSpaces: boolean; + static clone(objectToClone: EditorOptions): EditorOptions; + } + class FormatCodeOptions extends EditorOptions { + public InsertSpaceAfterCommaDelimiter: boolean; + public InsertSpaceAfterSemicolonInForStatements: boolean; + public InsertSpaceBeforeAndAfterBinaryOperators: boolean; + public InsertSpaceAfterKeywordsInControlFlowStatements: boolean; + public InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; + public InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; + public PlaceOpenBraceOnNewLineForFunctions: boolean; + public PlaceOpenBraceOnNewLineForControlBlocks: boolean; + static clone(objectToClone: FormatCodeOptions): FormatCodeOptions; + } + class DefinitionInfo { + public fileName: string; + public minChar: number; + public limChar: number; + public kind: string; + public name: string; + public containerKind: string; + public containerName: string; + constructor(fileName: string, minChar: number, limChar: number, kind: string, name: string, containerKind: string, containerName: string); + } + class TypeInfo { + public memberName: MemberName; + public docComment: string; + public fullSymbolName: string; + public kind: string; + public minChar: number; + public limChar: number; + constructor(memberName: MemberName, docComment: string, fullSymbolName: string, kind: string, minChar: number, limChar: number); + } + class SpanInfo { + public minChar: number; + public limChar: number; + public text: string; + constructor(minChar: number, limChar: number, text?: string); + } + class SignatureInfo { + public actual: ActualSignatureInfo; + public formal: FormalSignatureItemInfo[]; + public activeFormal: number; + } + class FormalSignatureItemInfo { + public signatureInfo: string; + public typeParameters: FormalTypeParameterInfo[]; + public parameters: FormalParameterInfo[]; + public docComment: string; + } + class FormalTypeParameterInfo { + public name: string; + public docComment: string; + public minChar: number; + public limChar: number; + } + class FormalParameterInfo { + public name: string; + public isVariable: boolean; + public docComment: string; + public minChar: number; + public limChar: number; + } + class ActualSignatureInfo { + public parameterMinChar: number; + public parameterLimChar: number; + public currentParameterIsTypeParameter: boolean; + public currentParameter: number; + } + class CompletionInfo { + public maybeInaccurate: boolean; + public isMemberCompletion: boolean; + public entries: CompletionEntry[]; + } + interface CompletionEntry { + name: string; + kind: string; + kindModifiers: string; + } + interface CompletionEntryDetails { + name: string; + kind: string; + kindModifiers: string; + type: string; + fullSymbolName: string; + docComment: string; + } + class ScriptElementKind { + static unknown: string; + static keyword: string; + static scriptElement: string; + static moduleElement: string; + static classElement: string; + static interfaceElement: string; + static enumElement: string; + static variableElement: string; + static localVariableElement: string; + static functionElement: string; + static localFunctionElement: string; + static memberFunctionElement: string; + static memberGetAccessorElement: string; + static memberSetAccessorElement: string; + static memberVariableElement: string; + static constructorImplementationElement: string; + static callSignatureElement: string; + static indexSignatureElement: string; + static constructSignatureElement: string; + static parameterElement: string; + static typeParameterElement: string; + static primitiveType: string; + } + class ScriptElementKindModifier { + static none: string; + static publicMemberModifier: string; + static privateMemberModifier: string; + static exportedModifier: string; + static ambientModifier: string; + static staticModifier: string; + } + class MatchKind { + static none: string; + static exact: string; + static subString: string; + static prefix: string; + } + class DiagnosticCategory { + static none: string; + static error: string; + static warning: string; + static message: string; + } +} +declare module TypeScript.Services.Formatting { + interface ITextSnapshot { + getText(span: TextSpan): string; + getLineNumberFromPosition(position: number): number; + getLineFromPosition(position: number): ITextSnapshotLine; + getLineFromLineNumber(lineNumber: number): ITextSnapshotLine; + } + class TextSnapshot implements ITextSnapshot { + private snapshot; + private lines; + constructor(snapshot: ISimpleText); + public getText(span: TextSpan): string; + public getLineNumberFromPosition(position: number): number; + public getLineFromPosition(position: number): ITextSnapshotLine; + public getLineFromLineNumber(lineNumber: number): ITextSnapshotLine; + private getLineFromLineNumberWorker(lineNumber); + } +} +declare module TypeScript.Services.Formatting { + interface ITextSnapshotLine { + snapshot(): ITextSnapshot; + start(): SnapshotPoint; + startPosition(): number; + end(): SnapshotPoint; + endPosition(): number; + endIncludingLineBreak(): SnapshotPoint; + endIncludingLineBreakPosition(): number; + length(): number; + lineNumber(): number; + getText(): string; + } + class TextSnapshotLine implements ITextSnapshotLine { + private _snapshot; + private _lineNumber; + private _start; + private _end; + private _lineBreak; + constructor(_snapshot: ITextSnapshot, _lineNumber: number, _start: number, _end: number, _lineBreak: string); + public snapshot(): ITextSnapshot; + public start(): SnapshotPoint; + public startPosition(): number; + public end(): SnapshotPoint; + public endPosition(): number; + public endIncludingLineBreak(): SnapshotPoint; + public endIncludingLineBreakPosition(): number; + public length(): number; + public lineNumber(): number; + public getText(): string; + } +} +declare module TypeScript.Services.Formatting { + class SnapshotPoint { + public snapshot: ITextSnapshot; + public position: number; + constructor(snapshot: ITextSnapshot, position: number); + public getContainingLine(): ITextSnapshotLine; + public add(offset: number): SnapshotPoint; + } +} +declare module TypeScript.Services.Formatting { + class FormattingContext { + private snapshot; + public formattingRequestKind: FormattingRequestKind; + public currentTokenSpan: TokenSpan; + public nextTokenSpan: TokenSpan; + public contextNode: IndentationNodeContext; + public currentTokenParent: IndentationNodeContext; + public nextTokenParent: IndentationNodeContext; + private contextNodeAllOnSameLine; + private nextNodeAllOnSameLine; + private tokensAreOnSameLine; + private contextNodeBlockIsOnOneLine; + private nextNodeBlockIsOnOneLine; + constructor(snapshot: ITextSnapshot, formattingRequestKind: FormattingRequestKind); + public updateContext(currentTokenSpan: TokenSpan, currentTokenParent: IndentationNodeContext, nextTokenSpan: TokenSpan, nextTokenParent: IndentationNodeContext, commonParent: IndentationNodeContext): void; + public ContextNodeAllOnSameLine(): boolean; + public NextNodeAllOnSameLine(): boolean; + public TokensAreOnSameLine(): boolean; + public ContextNodeBlockIsOnOneLine(): boolean; + public NextNodeBlockIsOnOneLine(): boolean; + public NodeIsOnOneLine(node: IndentationNodeContext): boolean; + public BlockIsOnOneLine(node: IndentationNodeContext): boolean; + } +} +declare module TypeScript.Services.Formatting { + class FormattingManager { + private syntaxTree; + private snapshot; + private rulesProvider; + private options; + constructor(syntaxTree: SyntaxTree, snapshot: ITextSnapshot, rulesProvider: RulesProvider, editorOptions: EditorOptions); + public formatSelection(minChar: number, limChar: number): TextEdit[]; + public formatDocument(minChar: number, limChar: number): TextEdit[]; + public formatOnPaste(minChar: number, limChar: number): TextEdit[]; + public formatOnSemicolon(caretPosition: number): TextEdit[]; + public formatOnClosingCurlyBrace(caretPosition: number): TextEdit[]; + public formatOnEnter(caretPosition: number): TextEdit[]; + private formatSpan(span, formattingRequestKind); + } +} +declare module TypeScript.Services.Formatting { + enum FormattingRequestKind { + FormatDocument = 0, + FormatSelection = 1, + FormatOnEnter = 2, + FormatOnSemicolon = 3, + FormatOnClosingCurlyBrace = 4, + FormatOnPaste = 5, + } +} +declare module TypeScript.Services.Formatting { + class Rule { + public Descriptor: RuleDescriptor; + public Operation: RuleOperation; + public Flag: RuleFlags; + constructor(Descriptor: RuleDescriptor, Operation: RuleOperation, Flag?: RuleFlags); + public toString(): string; + } +} +declare module TypeScript.Services.Formatting { + enum RuleAction { + Ignore = 0, + Space = 1, + NewLine = 2, + Delete = 3, + } +} +declare module TypeScript.Services.Formatting { + class RuleDescriptor { + public LeftTokenRange: Shared.TokenRange; + public RightTokenRange: Shared.TokenRange; + constructor(LeftTokenRange: Shared.TokenRange, RightTokenRange: Shared.TokenRange); + public toString(): string; + static create1(left: SyntaxKind, right: SyntaxKind): RuleDescriptor; + static create2(left: Shared.TokenRange, right: SyntaxKind): RuleDescriptor; + static create3(left: SyntaxKind, right: Shared.TokenRange): RuleDescriptor; + static create4(left: Shared.TokenRange, right: Shared.TokenRange): RuleDescriptor; + } +} +declare module TypeScript.Services.Formatting { + enum RuleFlags { + None = 0, + CanDeleteNewLines = 1, + } +} +declare module TypeScript.Services.Formatting { + class RuleOperation { + public Context: RuleOperationContext; + public Action: RuleAction; + constructor(); + public toString(): string; + static create1(action: RuleAction): RuleOperation; + static create2(context: RuleOperationContext, action: RuleAction): RuleOperation; + } +} +declare module TypeScript.Services.Formatting { + class RuleOperationContext { + private customContextChecks; + constructor(...funcs: { + (context: FormattingContext): boolean; + }[]); + static Any: RuleOperationContext; + public IsAny(): boolean; + public InContext(context: FormattingContext): boolean; + } +} +declare module TypeScript.Services.Formatting { + class Rules { + public getRuleName(rule: Rule): any; + [name: string]: any; + public IgnoreBeforeComment: Rule; + public IgnoreAfterLineComment: Rule; + public NoSpaceBeforeSemicolon: Rule; + public NoSpaceBeforeColon: Rule; + public NoSpaceBeforeQMark: Rule; + public SpaceAfterColon: Rule; + public SpaceAfterQMark: Rule; + public SpaceAfterSemicolon: Rule; + public SpaceAfterCloseBrace: Rule; + public SpaceBetweenCloseBraceAndElse: Rule; + public SpaceBetweenCloseBraceAndWhile: Rule; + public NoSpaceAfterCloseBrace: Rule; + public NoSpaceBeforeDot: Rule; + public NoSpaceAfterDot: Rule; + public NoSpaceBeforeOpenBracket: Rule; + public NoSpaceAfterOpenBracket: Rule; + public NoSpaceBeforeCloseBracket: Rule; + public NoSpaceAfterCloseBracket: Rule; + public SpaceAfterOpenBrace: Rule; + public SpaceBeforeCloseBrace: Rule; + public NoSpaceBetweenEmptyBraceBrackets: Rule; + public NewLineAfterOpenBraceInBlockContext: Rule; + public NewLineBeforeCloseBraceInBlockContext: Rule; + public NoSpaceAfterUnaryPrefixOperator: Rule; + public NoSpaceAfterUnaryPreincrementOperator: Rule; + public NoSpaceAfterUnaryPredecrementOperator: Rule; + public NoSpaceBeforeUnaryPostincrementOperator: Rule; + public NoSpaceBeforeUnaryPostdecrementOperator: Rule; + public SpaceAfterPostincrementWhenFollowedByAdd: Rule; + public SpaceAfterAddWhenFollowedByUnaryPlus: Rule; + public SpaceAfterAddWhenFollowedByPreincrement: Rule; + public SpaceAfterPostdecrementWhenFollowedBySubtract: Rule; + public SpaceAfterSubtractWhenFollowedByUnaryMinus: Rule; + public SpaceAfterSubtractWhenFollowedByPredecrement: Rule; + public NoSpaceBeforeComma: Rule; + public SpaceAfterCertainKeywords: Rule; + public NoSpaceBeforeOpenParenInFuncCall: Rule; + public SpaceAfterFunctionInFuncDecl: Rule; + public NoSpaceBeforeOpenParenInFuncDecl: Rule; + public SpaceAfterVoidOperator: Rule; + public NoSpaceBetweenReturnAndSemicolon: Rule; + public SpaceBetweenStatements: Rule; + public SpaceAfterTryFinally: Rule; + public SpaceAfterGetSetInMember: Rule; + public SpaceBeforeBinaryKeywordOperator: Rule; + public SpaceAfterBinaryKeywordOperator: Rule; + public NoSpaceAfterConstructor: Rule; + public NoSpaceAfterModuleImport: Rule; + public SpaceAfterCertainTypeScriptKeywords: Rule; + public SpaceBeforeCertainTypeScriptKeywords: Rule; + public SpaceAfterModuleName: Rule; + public SpaceAfterArrow: Rule; + public NoSpaceAfterEllipsis: Rule; + public NoSpaceAfterOptionalParameters: Rule; + public NoSpaceBeforeOpenAngularBracket: Rule; + public NoSpaceBetweenCloseParenAndAngularBracket: Rule; + public NoSpaceAfterOpenAngularBracket: Rule; + public NoSpaceBeforeCloseAngularBracket: Rule; + public NoSpaceAfterCloseAngularBracket: Rule; + public NoSpaceBetweenEmptyInterfaceBraceBrackets: Rule; + public HighPriorityCommonRules: Rule[]; + public LowPriorityCommonRules: Rule[]; + public SpaceAfterComma: Rule; + public NoSpaceAfterComma: Rule; + public SpaceBeforeBinaryOperator: Rule; + public SpaceAfterBinaryOperator: Rule; + public NoSpaceBeforeBinaryOperator: Rule; + public NoSpaceAfterBinaryOperator: Rule; + public SpaceAfterKeywordInControl: Rule; + public NoSpaceAfterKeywordInControl: Rule; + public FunctionOpenBraceLeftTokenRange: Shared.TokenRange; + public SpaceBeforeOpenBraceInFunction: Rule; + public NewLineBeforeOpenBraceInFunction: Rule; + public TypeScriptOpenBraceLeftTokenRange: Shared.TokenRange; + public SpaceBeforeOpenBraceInTypeScriptDeclWithBlock: Rule; + public NewLineBeforeOpenBraceInTypeScriptDeclWithBlock: Rule; + public ControlOpenBraceLeftTokenRange: Shared.TokenRange; + public SpaceBeforeOpenBraceInControl: Rule; + public NewLineBeforeOpenBraceInControl: Rule; + public SpaceAfterSemicolonInFor: Rule; + public NoSpaceAfterSemicolonInFor: Rule; + public SpaceAfterOpenParen: Rule; + public SpaceBeforeCloseParen: Rule; + public NoSpaceBetweenParens: Rule; + public NoSpaceAfterOpenParen: Rule; + public NoSpaceBeforeCloseParen: Rule; + public SpaceAfterAnonymousFunctionKeyword: Rule; + public NoSpaceAfterAnonymousFunctionKeyword: Rule; + constructor(); + static IsForContext(context: FormattingContext): boolean; + static IsNotForContext(context: FormattingContext): boolean; + static IsBinaryOpContext(context: FormattingContext): boolean; + static IsNotBinaryOpContext(context: FormattingContext): boolean; + static IsSameLineTokenOrBeforeMultilineBlockContext(context: FormattingContext): boolean; + static IsBeforeMultilineBlockContext(context: FormattingContext): boolean; + static IsMultilineBlockContext(context: FormattingContext): boolean; + static IsSingleLineBlockContext(context: FormattingContext): boolean; + static IsBlockContext(context: FormattingContext): boolean; + static IsBeforeBlockContext(context: FormattingContext): boolean; + static NodeIsBlockContext(node: IndentationNodeContext): boolean; + static IsFunctionDeclContext(context: FormattingContext): boolean; + static IsTypeScriptDeclWithBlockContext(context: FormattingContext): boolean; + static NodeIsTypeScriptDeclWithBlockContext(node: IndentationNodeContext): boolean; + static IsAfterCodeBlockContext(context: FormattingContext): boolean; + static IsControlDeclContext(context: FormattingContext): boolean; + static IsObjectContext(context: FormattingContext): boolean; + static IsFunctionCallContext(context: FormattingContext): boolean; + static IsNewContext(context: FormattingContext): boolean; + static IsFunctionCallOrNewContext(context: FormattingContext): boolean; + static IsSameLineTokenContext(context: FormattingContext): boolean; + static IsNotFormatOnEnter(context: FormattingContext): boolean; + static IsModuleDeclContext(context: FormattingContext): boolean; + static IsObjectTypeContext(context: FormattingContext): boolean; + static IsTypeArgumentOrParameter(tokenKind: SyntaxKind, parentKind: SyntaxKind): boolean; + static IsTypeArgumentOrParameterContext(context: FormattingContext): boolean; + static IsVoidOpContext(context: FormattingContext): boolean; + } +} +declare module TypeScript.Services.Formatting { + class RulesMap { + public map: RulesBucket[]; + public mapRowLength: number; + constructor(); + static create(rules: Rule[]): RulesMap; + public Initialize(rules: Rule[]): RulesBucket[]; + public FillRules(rules: Rule[], rulesBucketConstructionStateList: RulesBucketConstructionState[]): void; + private GetRuleBucketIndex(row, column); + private FillRule(rule, rulesBucketConstructionStateList); + public GetRule(context: FormattingContext): Rule; + } + enum RulesPosition { + IgnoreRulesSpecific = 0, + IgnoreRulesAny, + ContextRulesSpecific, + ContextRulesAny, + NoContextRulesSpecific, + NoContextRulesAny, + } + class RulesBucketConstructionState { + private rulesInsertionIndexBitmap; + constructor(); + public GetInsertionIndex(maskPosition: RulesPosition): number; + public IncreaseInsertionIndex(maskPosition: RulesPosition): void; + } + class RulesBucket { + private rules; + constructor(); + public Rules(): Rule[]; + public AddRule(rule: Rule, specificTokens: boolean, constructionState: RulesBucketConstructionState[], rulesBucketIndex: number): void; + } +} +declare module TypeScript.Services.Formatting { + class RulesProvider { + private logger; + private globalRules; + private options; + private activeRules; + private rulesMap; + constructor(logger: ILogger); + public getRuleName(rule: Rule): string; + public getRuleByName(name: string): Rule; + public getRulesMap(): RulesMap; + public ensureUpToDate(options: FormatCodeOptions): void; + private createActiveRules(options); + } +} +declare module TypeScript.Services.Formatting { + class TextEditInfo { + public position: number; + public length: number; + public replaceWith: string; + constructor(position: number, length: number, replaceWith: string); + public toString(): string; + } +} +declare module TypeScript.Services.Formatting { + module Shared { + interface ITokenAccess { + GetTokens(): SyntaxKind[]; + Contains(token: SyntaxKind): boolean; + } + class TokenRangeAccess implements ITokenAccess { + private tokens; + constructor(from: SyntaxKind, to: SyntaxKind, except: SyntaxKind[]); + public GetTokens(): SyntaxKind[]; + public Contains(token: SyntaxKind): boolean; + public toString(): string; + } + class TokenValuesAccess implements ITokenAccess { + private tokens; + constructor(tks: SyntaxKind[]); + public GetTokens(): SyntaxKind[]; + public Contains(token: SyntaxKind): boolean; + } + class TokenSingleValueAccess implements ITokenAccess { + public token: SyntaxKind; + constructor(token: SyntaxKind); + public GetTokens(): SyntaxKind[]; + public Contains(tokenValue: SyntaxKind): boolean; + public toString(): string; + } + class TokenAllAccess implements ITokenAccess { + public GetTokens(): SyntaxKind[]; + public Contains(tokenValue: SyntaxKind): boolean; + public toString(): string; + } + class TokenRange { + public tokenAccess: ITokenAccess; + constructor(tokenAccess: ITokenAccess); + static FromToken(token: SyntaxKind): TokenRange; + static FromTokens(tokens: SyntaxKind[]): TokenRange; + static FromRange(f: SyntaxKind, to: SyntaxKind, except?: SyntaxKind[]): TokenRange; + static AllTokens(): TokenRange; + public GetTokens(): SyntaxKind[]; + public Contains(token: SyntaxKind): boolean; + public toString(): string; + static Any: TokenRange; + static AnyIncludingMultilineComments: TokenRange; + static Keywords: TokenRange; + static Operators: TokenRange; + static BinaryOperators: TokenRange; + static BinaryKeywordOperators: TokenRange; + static ReservedKeywords: TokenRange; + static UnaryPrefixOperators: TokenRange; + static UnaryPrefixExpressions: TokenRange; + static UnaryPreincrementExpressions: TokenRange; + static UnaryPostincrementExpressions: TokenRange; + static UnaryPredecrementExpressions: TokenRange; + static UnaryPostdecrementExpressions: TokenRange; + static Comments: TokenRange; + static TypeNames: TokenRange; + } + } +} +declare module TypeScript.Services.Formatting { + class TokenSpan extends TextSpan { + private _kind; + constructor(kind: SyntaxKind, start: number, length: number); + public kind(): SyntaxKind; + } +} +declare module TypeScript.Services.Formatting { + class IndentationNodeContext { + private _node; + private _parent; + private _fullStart; + private _indentationAmount; + private _childIndentationAmountDelta; + private _depth; + private _hasSkippedOrMissingTokenChild; + constructor(parent: IndentationNodeContext, node: SyntaxNode, fullStart: number, indentationAmount: number, childIndentationAmountDelta: number); + public parent(): IndentationNodeContext; + public node(): SyntaxNode; + public fullStart(): number; + public fullWidth(): number; + public start(): number; + public end(): number; + public indentationAmount(): number; + public childIndentationAmountDelta(): number; + public depth(): number; + public kind(): SyntaxKind; + public hasSkippedOrMissingTokenChild(): boolean; + public clone(pool: IndentationNodeContextPool): IndentationNodeContext; + public update(parent: IndentationNodeContext, node: SyntaxNode, fullStart: number, indentationAmount: number, childIndentationAmountDelta: number): void; + } +} +declare module TypeScript.Services.Formatting { + class IndentationNodeContextPool { + private nodes; + public getNode(parent: IndentationNodeContext, node: SyntaxNode, fullStart: number, indentationLevel: number, childIndentationLevelDelta: number): IndentationNodeContext; + public releaseNode(node: IndentationNodeContext, recursive?: boolean): void; + } +} +declare module TypeScript.Services.Formatting { + class IndentationTrackingWalker extends SyntaxWalker { + public options: FormattingOptions; + private _position; + private _parent; + private _textSpan; + private _snapshot; + private _lastTriviaWasNewLine; + private _indentationNodeContextPool; + constructor(textSpan: TextSpan, sourceUnit: SourceUnitSyntax, snapshot: ITextSnapshot, indentFirstToken: boolean, options: FormattingOptions); + public position(): number; + public parent(): IndentationNodeContext; + public textSpan(): TextSpan; + public snapshot(): ITextSnapshot; + public indentationNodeContextPool(): IndentationNodeContextPool; + public forceIndentNextToken(tokenStart: number): void; + public forceSkipIndentingNextToken(tokenStart: number): void; + public indentToken(token: ISyntaxToken, indentationAmount: number, commentIndentationAmount: number): void; + public visitTokenInSpan(token: ISyntaxToken): void; + public visitToken(token: ISyntaxToken): void; + public visitNode(node: SyntaxNode): void; + private getTokenIndentationAmount(token); + private getCommentIndentationAmount(token); + private getNodeIndentation(node, newLineInsertedByFormatting?); + private shouldIndentBlockInParent(parent); + private forceRecomputeIndentationOfParent(tokenStart, newLineAdded); + } +} +declare module TypeScript.Services.Formatting { + class MultipleTokenIndenter extends IndentationTrackingWalker { + private _edits; + constructor(textSpan: TextSpan, sourceUnit: SourceUnitSyntax, snapshot: ITextSnapshot, indentFirstToken: boolean, options: FormattingOptions); + public indentToken(token: ISyntaxToken, indentationAmount: number, commentIndentationAmount: number): void; + public edits(): TextEditInfo[]; + public recordEdit(position: number, length: number, replaceWith: string): void; + private recordIndentationEditsForToken(token, indentationString, commentIndentationString); + private recordIndentationEditsForSingleLineOrSkippedText(trivia, fullStart, indentationString); + private recordIndentationEditsForWhitespace(trivia, fullStart, indentationString); + private recordIndentationEditsForMultiLineComment(trivia, fullStart, indentationString, leadingWhiteSpace, firstLineAlreadyIndented); + private recordIndentationEditsForSegment(segment, fullStart, indentationColumns, whiteSpaceColumnsInFirstSegment); + } +} +declare module TypeScript.Services.Formatting { + class SingleTokenIndenter extends IndentationTrackingWalker { + private indentationAmount; + private indentationPosition; + constructor(indentationPosition: number, sourceUnit: SourceUnitSyntax, snapshot: ITextSnapshot, indentFirstToken: boolean, options: FormattingOptions); + static getIndentationAmount(position: number, sourceUnit: SourceUnitSyntax, snapshot: ITextSnapshot, options: FormattingOptions): number; + public indentToken(token: ISyntaxToken, indentationAmount: number, commentIndentationAmount: number): void; + } +} +declare module TypeScript.Services.Formatting { + class Formatter extends MultipleTokenIndenter { + private previousTokenSpan; + private previousTokenParent; + private scriptHasErrors; + private rulesProvider; + private formattingRequestKind; + private formattingContext; + constructor(textSpan: TextSpan, sourceUnit: SourceUnitSyntax, indentFirstToken: boolean, options: FormattingOptions, snapshot: ITextSnapshot, rulesProvider: RulesProvider, formattingRequestKind: FormattingRequestKind); + static getEdits(textSpan: TextSpan, sourceUnit: SourceUnitSyntax, options: FormattingOptions, indentFirstToken: boolean, snapshot: ITextSnapshot, rulesProvider: RulesProvider, formattingRequestKind: FormattingRequestKind): TextEditInfo[]; + public visitTokenInSpan(token: ISyntaxToken): void; + private processToken(token); + private processTrivia(triviaList, fullStart); + private findCommonParents(parent1, parent2); + private formatPair(t1, t1Parent, t2, t2Parent); + private getLineNumber(span); + private trimWhitespaceInLineRange(startLine, endLine, token?); + private trimWhitespace(line, token?); + private RecordRuleEdits(rule, t1, t2); + } +} +declare var debugObjectHost: any; +declare module TypeScript.Services { + interface ICoreServicesHost { + logger: ILogger; + } + class CoreServices { + public host: ICoreServicesHost; + constructor(host: ICoreServicesHost); + public getPreProcessedFileInfo(fileName: string, sourceText: IScriptSnapshot): IPreProcessedFileInfo; + public getDefaultCompilationSettings(): CompilationSettings; + public dumpMemory(): string; + public getMemoryInfo(): any[]; + public collectGarbage(): void; + } +} +declare module TypeScript.Services { + class SyntaxTreeCache { + private _host; + private _hostCache; + private _currentFileName; + private _currentFileVersion; + private _currentFileSyntaxTree; + private _currentFileScriptSnapshot; + constructor(_host: ILanguageServiceHost); + public getCurrentFileSyntaxTree(fileName: string): SyntaxTree; + private createSyntaxTree(fileName, scriptSnapshot); + private updateSyntaxTree(fileName, scriptSnapshot, previousSyntaxTree, previousFileVersion); + private ensureInvariants(fileName, editRange, incrementalTree, oldScriptSnapshot, newScriptSnapshot); + } + class LanguageServiceCompiler { + private host; + private logger; + private compiler; + private hostCache; + constructor(host: ILanguageServiceHost); + private synchronizeHostData(); + private synchronizeHostDataWorker(); + private tryUpdateFile(compiler, fileName); + public getScriptSnapshot(fileName: string): IScriptSnapshot; + public getCachedHostFileName(fileName: string): string; + public getCachedTopLevelDeclaration(fileName: string): PullDecl; + public compilationSettings(): ImmutableCompilationSettings; + public fileNames(): string[]; + public cleanupSemanticCache(): void; + public getDocument(fileName: string): Document; + public getSyntacticDiagnostics(fileName: string): Diagnostic[]; + public getSemanticDiagnostics(fileName: string): Diagnostic[]; + public getCompilerOptionsDiagnostics(resolvePath: (path: string) => string): Diagnostic[]; + public getSymbolInformationFromAST(ast: AST, document: Document): PullSymbolInfo; + public getCallInformationFromAST(ast: AST, document: Document): PullCallSymbolInfo; + public getVisibleMemberSymbolsFromAST(ast: AST, document: Document): PullVisibleSymbolsInfo; + public getVisibleDeclsFromAST(ast: AST, document: Document): PullDecl[]; + public getContextualMembersFromAST(ast: AST, document: Document): PullVisibleSymbolsInfo; + public pullGetDeclInformation(decl: PullDecl, ast: AST, document: Document): PullSymbolInfo; + public topLevelDeclaration(fileName: string): PullDecl; + public getDeclForAST(ast: AST): PullDecl; + public emit(fileName: string, resolvePath: (path: string) => string): EmitOutput; + public emitDeclarations(fileName: string, resolvePath: (path: string) => string): EmitOutput; + public canEmitDeclarations(fileName: string): boolean; + } +} +declare module TypeScript.Services { + class CompletionHelpers { + private static getSpan(ast); + private static symbolDeclarationIntersectsPosition(symbol, fileName, position); + static filterContextualMembersList(contextualMemberSymbols: PullSymbol[], existingMembers: PullVisibleSymbolsInfo, fileName: string, position: number): PullSymbol[]; + static isCompletionListBlocker(sourceUnit: SourceUnitSyntax, position: number): boolean; + static getContainingObjectLiteralApplicableForCompletion(sourceUnit: SourceUnitSyntax, position: number): PositionedElement; + static isIdentifierDefinitionLocation(sourceUnit: SourceUnitSyntax, position: number): boolean; + static getNonIdentifierCompleteTokenOnLeft(sourceUnit: SourceUnitSyntax, position: number): PositionedToken; + static isRightOfIllegalDot(sourceUnit: SourceUnitSyntax, position: number): boolean; + static getValidCompletionEntryDisplayName(displayName: string): string; + } +} +declare module TypeScript.Services { + class KeywordCompletions { + private static keywords; + private static keywordCompletions; + static getKeywordCompltions(): ResolvedCompletionEntry[]; + } +} +declare module TypeScript.Services { + interface IPartiallyWrittenTypeArgumentListInformation { + genericIdentifer: PositionedToken; + lessThanToken: PositionedToken; + argumentIndex: number; + } + class SignatureInfoHelpers { + static isInPartiallyWrittenTypeArgumentList(syntaxTree: SyntaxTree, position: number): IPartiallyWrittenTypeArgumentListInformation; + static getSignatureInfoFromSignatureSymbol(symbol: PullSymbol, signatures: PullSignatureSymbol[], enclosingScopeSymbol: PullSymbol, compilerState: LanguageServiceCompiler): FormalSignatureItemInfo[]; + static getSignatureInfoFromGenericSymbol(symbol: PullSymbol, enclosingScopeSymbol: PullSymbol, compilerState: LanguageServiceCompiler): FormalSignatureItemInfo[]; + static getActualSignatureInfoFromCallExpression(ast: ICallExpression, caretPosition: number, typeParameterInformation: IPartiallyWrittenTypeArgumentListInformation): ActualSignatureInfo; + static getActualSignatureInfoFromPartiallyWritenGenericExpression(caretPosition: number, typeParameterInformation: IPartiallyWrittenTypeArgumentListInformation): ActualSignatureInfo; + static isSignatureHelpBlocker(sourceUnit: SourceUnitSyntax, position: number): boolean; + static isTargetOfObjectCreationExpression(positionedToken: PositionedToken): boolean; + private static moveBackUpTillMatchingTokenKind(token, tokenKind, matchingTokenKind); + } +} +declare module TypeScript.Services { + interface CachedCompletionEntryDetails extends CompletionEntryDetails { + isResolved(): boolean; + } + class ResolvedCompletionEntry implements CachedCompletionEntryDetails { + public name: string; + public kind: string; + public kindModifiers: string; + public type: string; + public fullSymbolName: string; + public docComment: string; + constructor(name: string, kind: string, kindModifiers: string, type: string, fullSymbolName: string, docComment: string); + public isResolved(): boolean; + } + class DeclReferenceCompletionEntry implements CachedCompletionEntryDetails { + public name: string; + public kind: string; + public kindModifiers: string; + public decl: PullDecl; + public type: string; + public fullSymbolName: string; + public docComment: string; + private hasBeenResolved; + constructor(name: string, kind: string, kindModifiers: string, decl: PullDecl); + public isResolved(): boolean; + public resolve(type: string, fullSymbolName: string, docComments: string): void; + } + class CompletionSession { + public fileName: string; + public position: number; + public entries: IdentiferNameHashTable; + constructor(fileName: string, position: number, entries: IdentiferNameHashTable); + } +} +declare module TypeScript.Services { + class LanguageService implements ILanguageService { + public host: ILanguageServiceHost; + private logger; + private compiler; + private _syntaxTreeCache; + private formattingRulesProvider; + private activeCompletionSession; + constructor(host: ILanguageServiceHost); + public cleanupSemanticCache(): void; + public refresh(): void; + private getSymbolInfoAtPosition(fileName, pos, requireName); + public getReferencesAtPosition(fileName: string, pos: number): ReferenceEntry[]; + private getSymbolScopeAST(symbol, ast); + public getOccurrencesAtPosition(fileName: string, pos: number): ReferenceEntry[]; + private getSingleNodeReferenceAtPosition(fileName, position); + public getImplementorsAtPosition(fileName: string, pos: number): ReferenceEntry[]; + public getOverrides(container: PullTypeSymbol, memberSym: PullSymbol): PullTypeSymbol[]; + private getImplementorsInFile(fileName, symbol); + private getReferencesInFile(fileName, symbol, containingASTOpt); + private isWriteAccess(current); + private isLetterOrDigit(char); + private getPossibleSymbolReferencePositions(fileName, symbolName); + public getSignatureAtPosition(fileName: string, position: number): SignatureInfo; + private getTypeParameterSignatureFromPartiallyWrittenExpression(document, position, genericTypeArgumentListInfo); + public getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; + private addDeclarations(symbolKind, symbolName, containerKind, containerName, declarations, result); + private addDeclaration(symbolKind, symbolName, containerKind, containerName, declaration, result); + private tryAddDefinition(symbolKind, symbolName, containerKind, containerName, declarations, result); + private tryAddSignatures(symbolKind, symbolName, containerKind, containerName, declarations, result); + private tryAddConstructor(symbolKind, symbolName, containerKind, containerName, declarations, result); + public getNavigateToItems(searchValue: string): NavigateToItem[]; + private hasAnyUpperCaseCharacter(s); + private findSearchValueInPullDecl(fileName, declarations, results, searchTerms, parentName?, parentkindName?); + private getScriptElementKindModifiersFromDecl(decl); + private isContainerDeclaration(declaration); + private shouldIncludeDeclarationInNavigationItems(declaration); + public getSyntacticDiagnostics(fileName: string): Diagnostic[]; + public getSemanticDiagnostics(fileName: string): Diagnostic[]; + private _getHostSpecificDiagnosticWithFileName(diagnostic); + public getCompilerOptionsDiagnostics(): Diagnostic[]; + private _getHostFileName(fileName); + public getEmitOutput(fileName: string): EmitOutput; + private getAllSyntacticDiagnostics(); + private getAllSemanticDiagnostics(); + private containErrors(diagnostics); + private getFullNameOfSymbol(symbol, enclosingScopeSymbol); + private getTypeInfoEligiblePath(fileName, position, isConstructorValidPosition); + public getTypeAtPosition(fileName: string, position: number): TypeInfo; + public getCompletionsAtPosition(fileName: string, position: number, isMemberCompletion: boolean): CompletionInfo; + private getCompletionEntriesFromSymbols(symbolInfo, result); + private getCompletionEntriesFromDecls(decls, result); + private getResolvedCompletionEntryDetailsFromSymbol(symbol, enclosingScopeSymbol); + private getCompletionEntriesForKeywords(keywords, result); + public getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; + private tryFindDeclFromPreviousCompilerVersion(invalidatedDecl); + private getModuleOrEnumKind(symbol); + private mapPullElementKind(kind, symbol?, useConstructorAsClass?, varIsFunction?, functionIsConstructor?); + private getScriptElementKindModifiers(symbol); + private getScriptElementKindModifiersFromFlags(flags); + public getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): SpanInfo; + public getBreakpointStatementAtPosition(fileName: string, pos: number): SpanInfo; + public getFormattingEditsForRange(fileName: string, minChar: number, limChar: number, options: FormatCodeOptions): TextEdit[]; + public getFormattingEditsForDocument(fileName: string, minChar: number, limChar: number, options: FormatCodeOptions): TextEdit[]; + public getFormattingEditsOnPaste(fileName: string, minChar: number, limChar: number, options: FormatCodeOptions): TextEdit[]; + public getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextEdit[]; + private getFormattingManager(fileName, options); + public getOutliningRegions(fileName: string): TextSpan[]; + public getIndentationAtPosition(fileName: string, position: number, editorOptions: EditorOptions): number; + public getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; + public getScriptLexicalStructure(fileName: string): NavigateToItem[]; + public getSyntaxTree(fileName: string): SyntaxTree; + } +} +declare module TypeScript.Services { + class FindReferenceHelpers { + static compareSymbolsForLexicalIdentity(firstSymbol: PullSymbol, secondSymbol: PullSymbol): boolean; + private static checkSymbolsForDeclarationEquality(firstSymbol, secondSymbol); + private static declarationsAreSameOrParents(firstDecl, secondDecl); + } +} +declare module TypeScript.Services { + interface IScriptSnapshotShim { + getText(start: number, end: number): string; + getLength(): number; + getLineStartPositions(): string; + getTextChangeRangeSinceVersion(scriptVersion: number): string; + } + interface ILanguageServiceShimHost extends ILogger { + getCompilationSettings(): string; + getScriptFileNames(): string; + getScriptVersion(fileName: string): number; + getScriptIsOpen(fileName: string): boolean; + getScriptByteOrderMark(fileName: string): number; + getScriptSnapshot(fileName: string): IScriptSnapshotShim; + resolveRelativePath(path: string, directory: string): string; + fileExists(path: string): boolean; + directoryExists(path: string): boolean; + getParentDirectory(path: string): string; + getDiagnosticsObject(): ILanguageServicesDiagnostics; + getLocalizedDiagnosticMessages(): string; + } + interface IShimFactory { + registerShim(shim: IShim): void; + unregisterShim(shim: IShim): void; + } + interface IShim { + dispose(dummy: any): void; + } + class ShimBase implements IShim { + private factory; + constructor(factory: IShimFactory); + public dispose(dummy: any): void; + } + interface ILanguageServiceShim extends IShim { + languageService: ILanguageService; + dispose(dummy: any): void; + refresh(throwOnError: boolean): void; + cleanupSemanticCache(): void; + getSyntacticDiagnostics(fileName: string): string; + getSemanticDiagnostics(fileName: string): string; + getCompilerOptionsDiagnostics(): string; + getCompletionsAtPosition(fileName: string, position: number, isMemberCompletion: boolean): string; + getCompletionEntryDetails(fileName: string, position: number, entryName: string): string; + getTypeAtPosition(fileName: string, position: number): string; + getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): string; + getBreakpointStatementAtPosition(fileName: string, position: number): string; + getSignatureAtPosition(fileName: string, position: number): string; + getDefinitionAtPosition(fileName: string, position: number): string; + getReferencesAtPosition(fileName: string, position: number): string; + getOccurrencesAtPosition(fileName: string, position: number): string; + getImplementorsAtPosition(fileName: string, position: number): string; + getNavigateToItems(searchValue: string): string; + getScriptLexicalStructure(fileName: string): string; + getOutliningRegions(fileName: string): string; + getBraceMatchingAtPosition(fileName: string, position: number): string; + getIndentationAtPosition(fileName: string, position: number, options: string): string; + getFormattingEditsForRange(fileName: string, minChar: number, limChar: number, options: string): string; + getFormattingEditsForDocument(fileName: string, minChar: number, limChar: number, options: string): string; + getFormattingEditsOnPaste(fileName: string, minChar: number, limChar: number, options: string): string; + getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: string): string; + getEmitOutput(fileName: string): string; + } + class LanguageServiceShimHostAdapter implements ILanguageServiceHost { + private shimHost; + constructor(shimHost: ILanguageServiceShimHost); + public information(): boolean; + public debug(): boolean; + public warning(): boolean; + public error(): boolean; + public fatal(): boolean; + public log(s: string): void; + public getCompilationSettings(): CompilationSettings; + public getScriptFileNames(): string[]; + public getScriptSnapshot(fileName: string): IScriptSnapshot; + public getScriptVersion(fileName: string): number; + public getScriptIsOpen(fileName: string): boolean; + public getScriptByteOrderMark(fileName: string): ByteOrderMark; + public getDiagnosticsObject(): ILanguageServicesDiagnostics; + public getLocalizedDiagnosticMessages(): any; + public resolveRelativePath(path: string, directory: string): string; + public fileExists(path: string): boolean; + public directoryExists(path: string): boolean; + public getParentDirectory(path: string): string; + } + function simpleForwardCall(logger: ILogger, actionDescription: string, action: () => any): any; + function forwardJSONCall(logger: ILogger, actionDescription: string, action: () => any): string; + class LanguageServiceShim extends ShimBase implements ILanguageServiceShim { + private host; + public languageService: ILanguageService; + private logger; + constructor(factory: IShimFactory, host: ILanguageServiceShimHost, languageService: ILanguageService); + public forwardJSONCall(actionDescription: string, action: () => any): string; + public dispose(dummy: any): void; + public refresh(throwOnError: boolean): void; + public cleanupSemanticCache(): void; + private static realizeDiagnosticCategory(category); + private static realizeDiagnostic(diagnostic); + private realizeDiagnosticWithFileName(diagnostic); + public getSyntacticDiagnostics(fileName: string): string; + public getSemanticDiagnostics(fileName: string): string; + public getCompilerOptionsDiagnostics(): string; + public getTypeAtPosition(fileName: string, position: number): string; + public getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): string; + public getBreakpointStatementAtPosition(fileName: string, position: number): string; + public getSignatureAtPosition(fileName: string, position: number): string; + public getDefinitionAtPosition(fileName: string, position: number): string; + public getBraceMatchingAtPosition(fileName: string, position: number): string; + public getIndentationAtPosition(fileName: string, position: number, options: string): string; + public getReferencesAtPosition(fileName: string, position: number): string; + public getOccurrencesAtPosition(fileName: string, position: number): string; + public getImplementorsAtPosition(fileName: string, position: number): string; + public getCompletionsAtPosition(fileName: string, position: number, isMemberCompletion: boolean): string; + public getCompletionEntryDetails(fileName: string, position: number, entryName: string): string; + public getFormattingEditsForRange(fileName: string, minChar: number, limChar: number, options: string): string; + public getFormattingEditsForDocument(fileName: string, minChar: number, limChar: number, options: string): string; + public getFormattingEditsOnPaste(fileName: string, minChar: number, limChar: number, options: string): string; + public getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: string): string; + public getNavigateToItems(searchValue: string): string; + public getScriptLexicalStructure(fileName: string): string; + public getOutliningRegions(fileName: string): string; + public getEmitOutput(fileName: string): string; + private _navigateToItemsToString(items); + } + class ClassifierShim extends ShimBase { + public host: IClassifierHost; + public classifier: Classifier; + constructor(factory: IShimFactory, host: IClassifierHost); + public getClassificationsForLine(text: string, lexState: EndOfLineState): string; + } + class CoreServicesShim extends ShimBase { + public host: ICoreServicesHost; + public logger: ILogger; + public services: CoreServices; + constructor(factory: IShimFactory, host: ICoreServicesHost); + private forwardJSONCall(actionDescription, action); + public getPreProcessedFileInfo(fileName: string, sourceText: IScriptSnapshot): string; + public getDefaultCompilationSettings(): string; + public dumpMemory(dummy: any): string; + public getMemoryInfo(dummy: any): string; + } +} +declare module TypeScript.Services { + class OutliningElementsCollector extends DepthLimitedWalker { + private static MaximumDepth; + private inObjectLiteralExpression; + private elements; + constructor(); + public visitClassDeclaration(node: ClassDeclarationSyntax): void; + public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): void; + public visitModuleDeclaration(node: ModuleDeclarationSyntax): void; + public visitEnumDeclaration(node: EnumDeclarationSyntax): void; + public visitFunctionDeclaration(node: FunctionDeclarationSyntax): void; + public visitFunctionExpression(node: FunctionExpressionSyntax): void; + public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): void; + public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void; + public visitGetAccessor(node: GetAccessorSyntax): void; + public visitSetAccessor(node: SetAccessorSyntax): void; + public visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): void; + private addOutlineRange(node, startElement, endElement); + static collectElements(node: SourceUnitSyntax): TextSpan[]; + } +} +declare module TypeScript.Services { + class Indenter { + static getIndentation(node: SourceUnitSyntax, soruceText: IScriptSnapshot, position: number, editorOptions: EditorOptions): number; + private static belongsToBracket(sourceText, token, position); + private static isInContainerNode(parent, element); + private static getCustomListIndentation(list, element); + private static getListItemIndentation(list, elementIndex); + } +} +declare module TypeScript.Services.Breakpoints { + function getBreakpointLocation(syntaxTree: SyntaxTree, askedPos: number): SpanInfo; +} +declare module TypeScript.Services { + class GetScriptLexicalStructureWalker extends PositionTrackingWalker { + private fileName; + private nameStack; + private kindStack; + private currentMemberVariableDeclaration; + private currentVariableStatement; + private currentInterfaceDeclaration; + private parentScopes; + private currentScope; + private createScope(); + private pushNewContainerScope(containerName, kind); + private popScope(); + constructor(fileName: string); + private collectItems(items, scope?); + static getListsOfAllScriptLexicalStructure(items: NavigateToItem[], fileName: string, unit: SourceUnitSyntax): void; + private createItem(node, modifiers, kind, name); + private addAdditionalSpan(node, key); + private getKindModifiers(modifiers); + public visitModuleDeclaration(node: ModuleDeclarationSyntax): void; + private visitModuleDeclarationWorker(node, names, nameIndex); + private getModuleNames(node); + private getModuleNamesHelper(name, result); + public visitClassDeclaration(node: ClassDeclarationSyntax): void; + public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): void; + public visitObjectType(node: ObjectTypeSyntax): void; + public visitEnumDeclaration(node: EnumDeclarationSyntax): void; + public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): void; + public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void; + public visitGetAccessor(node: GetAccessorSyntax): void; + public visitSetAccessor(node: SetAccessorSyntax): void; + public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): void; + public visitVariableStatement(node: VariableStatementSyntax): void; + public visitVariableDeclarator(node: VariableDeclaratorSyntax): void; + public visitIndexSignature(node: IndexSignatureSyntax): void; + public visitEnumElement(node: EnumElementSyntax): void; + public visitCallSignature(node: CallSignatureSyntax): void; + public visitConstructSignature(node: ConstructSignatureSyntax): void; + public visitMethodSignature(node: MethodSignatureSyntax): void; + public visitPropertySignature(node: PropertySignatureSyntax): void; + public visitFunctionDeclaration(node: FunctionDeclarationSyntax): void; + public visitBlock(node: BlockSyntax): void; + public visitIfStatement(node: IfStatementSyntax): void; + public visitExpressionStatement(node: ExpressionStatementSyntax): void; + public visitThrowStatement(node: ThrowStatementSyntax): void; + public visitReturnStatement(node: ReturnStatementSyntax): void; + public visitSwitchStatement(node: SwitchStatementSyntax): void; + public visitWithStatement(node: WithStatementSyntax): void; + public visitTryStatement(node: TryStatementSyntax): void; + public visitLabeledStatement(node: LabeledStatementSyntax): void; + } +} +declare module TypeScript.Services { + function copyDataObject(dst: any, src: any): any; + class TypeScriptServicesFactory implements IShimFactory { + private _shims; + public createPullLanguageService(host: ILanguageServiceHost): ILanguageService; + public createLanguageServiceShim(host: ILanguageServiceShimHost): ILanguageServiceShim; + public createClassifier(host: IClassifierHost): Classifier; + public createClassifierShim(host: IClassifierHost): ClassifierShim; + public createCoreServices(host: ICoreServicesHost): CoreServices; + public createCoreServicesShim(host: ICoreServicesHost): CoreServicesShim; + public close(): void; + public registerShim(shim: IShim): void; + public unregisterShim(shim: IShim): void; + } +} +declare module TypeScript.Services { + class BraceMatcher { + static getMatchSpans(syntaxTree: SyntaxTree, position: number): TextSpan[]; + private static getMatchingCloseBrace(currentToken, position, result); + private static getMatchingOpenBrace(currentToken, position, result); + private static getMatchingCloseBraceTokenKind(positionedElement); + private static getMatchingOpenBraceTokenKind(positionedElement); + } +} + +declare module 'typescript-services' { + export = TypeScript; +} \ No newline at end of file diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index 5fa693b00..c9c699326 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -1,7 +1,6 @@ // Type definitions for Underscore 1.6.0 // Project: http://underscorejs.org/ -// Definitions by: Boris Yankov -// Definitions by: Josh Baldwin +// Definitions by: Boris Yankov , Josh Baldwin // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module _ { diff --git a/velocity-animate/velocity-animate-tests.ts b/velocity-animate/velocity-animate-tests.ts new file mode 100644 index 000000000..96400d365 --- /dev/null +++ b/velocity-animate/velocity-animate-tests.ts @@ -0,0 +1,295 @@ +/// + +function basics_arguments() { + var $el: JQuery; + $el.velocity({ + top: 10, + left: 10 + }, { + /* Velocity's default options: */ + duration: 400, + easing: "swing", + queue: "", + begin: null, + progress: null, + complete: null, + loop: false, + delay: false, + display: false, + mobileHA: true + }); + + $el.velocity({ top: 50 }, 1000); + $el.velocity({ top: 50 }, 1000, "swing"); + $el.velocity({ top: 50 }, "swing"); + $el.velocity({ top: 50 }, 1000, function() { alert("Hi"); }); + + $el.velocity({ + properties: { opacity: 1 }, + options: { duration: 500 } + }); +} + +function basics_values() { + var $el: JQuery; + $el.velocity({ + top: 50, // Defaults to the px unit type + left: "50%", + width: "+=5rem", // Add 5rem to the current rem value + height: "*=2" // Double the current height + }); +} + +function options_duration() { + var $el: JQuery; + $el.velocity({ opacity: 1 }, { duration: 1000 }); + $el.velocity({ opacity: 1 }, { duration: "slow" }); +} + +function options_easing() { + var $el: JQuery; + /* Use one of the jQuery UI easings. */ + $el.velocity({ width: 50 }, "easeInSine"); + /* Use a custom bezier curve. */ + $el.velocity({ width: 50 }, [ 0.17, 0.67, 0.83, 0.67 ]); + /* Use spring physics. */ + $el.velocity({ width: 50 }, [ 250, 15 ]); + + $el.velocity({ + borderBottomWidth: [ "2px", "spring" ], // Uses "spring" + width: [ "100px", [ 250, 15 ] ], // Uses custom spring physics + height: "100px" // Defaults to easeInSine + }, { + easing: "easeInSine" // The call's default easing + }); +} + +function options_queue() { + var $el: JQuery; + /* Trigger the first animation: Animate width. */ + $el.velocity({ width: "500px" }, { duration: 10000 }); + /* Trigger the second animation: Animate height. */ + setTimeout(function() { + /* Will run in parallel starting at the 5000ms mark. */ + $el.velocity({ height: "500px" }, { queue: false }); + }, 5000); +} + +function options_complete() { + var $el: JQuery; + $el.velocity({ + opacity: 0 + }, { + /* Logs all the animated divs. */ + complete: function(elements) { console.log(elements); } + }); +} + +function options_begin() { + var $el: JQuery; + $el.velocity({ + opacity: 0 + }, { + /* Logs all the animated divs. */ + begin: function(elements) { console.log(elements); } + }); +} + +function options_progress() { + var $el: JQuery; + var $percentComplete: JQuery; + var $timeRemaining: JQuery; + $el.velocity({ + opacity: 0 + }, { + progress: function(elements, percentComplete, timeRemaining, timeStart) { + $percentComplete.html((percentComplete * 100) + "%"); + $timeRemaining.html(timeRemaining + "ms remaining!"); + } + }); +} + +function options_mobileHA() { + var $el: JQuery; + $el.velocity({ height: "10em" }, { mobileHA: false }); +} + +function options_loop() { + var $el: JQuery; + $el.velocity({ height: "10em" }, { loop: 2 }); +} + +function options_delay() { + var $el: JQuery; + $el.velocity({ + height: "+=10em" + }, { + loop: 4, + /* Wait 100ms before alternating. */ + delay: 100 + }); +} + +function options_display() { + var $el: JQuery; + /* Animate down to zero then set display to "none". */ + $el.velocity({ opacity: 0 }, { display: "none" }); + /* Set display to "block" then animate from opacity:0. */ + $el.velocity({ opacity: 1 }, { display: "block" }); +} + +function command_scroll() { + var $el: JQuery; + $el + .velocity("scroll", { duration: 1500, easing: "spring" }) + .velocity({ opacity: 1 }); + + /* Scroll container to the top of the targeted div. */ + $el.velocity("scroll", { container: $("#container") }); + + /* Scroll the browser to the LEFT edge of the targeted div. */ + $el.velocity("scroll", { axis: "x" }); + + /* Scroll to a position 50 pixels above the div. */ + $el + .velocity("scroll", { duration: 750, offset: -50 }) + /* Then scroll to a position 250 pixels beyond the div. */ + .velocity("scroll", { duration: 750, offset: 250 }); +} + +function command_stop() { + var $el: JQuery; + $el.velocity("stop"); +} + +function command_reverse() { + var $el: JQuery; + $el.velocity("reverse"); + $el.velocity("reverse", { duration: 2000 }); +} + +function command_fadeIn_fadeOut() { + var $el: JQuery; + $el + .velocity("fadeIn", { duration: 1500 }) + .velocity("fadeOut", { delay: 500, duration: 1500 }); +} + +function command_slideDown_slideUp() { + var $el: JQuery; + $el + .velocity("slideDown", { duration: 1500 }) + .velocity("slideUp", { delay: 500, duration: 1500 }); +} + +function feature_transforms() { + var $el: JQuery; + /* Translate to the right and rotate clockwise. */ + $el.velocity({ + translateX: "200px", + rotateZ: "45deg" + }); + + /* Translate to the right and rotate clockwise. */ + $el.velocity({ + translateZ: 0, // Force HA by animating a 3D property + translateX: "200px", + rotateZ: "45deg" + }); +} + +function feature_hooks() { + var $el: JQuery; + $el.velocity({ textShadowBlur: "10px" }); +} + +function feature_colors() { + var $el: JQuery; + $el.velocity({ + /* Animate red to 50% (0.5 * 255). */ + colorRed: "50%", + /* Concurrently animate to a richer blue. */ + colorBlue: "+=50", + /* Fade the text down to 85% opacity. */ + colorAlpha: 0.85 + }); +} + +function feature_sequences() { + var $el: JQuery; + $.Velocity.Sequences.hover = function (element: HTMLElement, options: {duration?: number}) { + var duration = options.duration || 750; + $.Velocity.animate(element, + { + translateY: "-=10px", + }, { + /* Delay is relative to user-adjustable duration. */ + delay: duration * 0.033, + duration: duration, + loop: 3, + easing: "easeInOutSine" + }); + }; + + /* Later on in your code, trigger the sequence: */ + /* Note: As normal, you may optionally pass in options. */ + $el.velocity("hover", { duration: 450 }); + + $.Velocity.Sequences.hover = function (element: HTMLElement, options: {duration?: number}) { + var duration = options.duration || 750; + /* Pre-construct animation maps before chaining. */ + var calls = [ + { + properties: { translateY: "-10px" }, + options: { + delay: duration * 0.033, + duration: duration, + loop: 3, + easing: "easeInOutSine" + } + } + ]; + /* Iteratively chain the calls. */ + $.each(calls, function(i, call) { + $.Velocity.animate( + element, + call.properties, + call.options + ); + }); + }; +} + +function advanced_value_functions() { + var $el: JQuery; + $el.velocity({ + opacity: function() { return Math.random() } + }); + $el.velocity({ + translateX: function(i: number, total: number) { + /* Generate translateX's end value. */ + return (i * 10) + "px"; + } + }); +} + +function advanced_forcefeeding() { + var $el: JQuery; + $el.velocity({ + translateX: [ 500, 0 ], + opacity: [ 0, "easeInSine", 1 ] + }); + $el + .velocity({ translateX: [ 500, 0 ] }) + .velocity({ translateX: 1000 }); +} + +function advanced_utility_function () { + var divs = document.getElementsByTagName("div"); + $.Velocity.animate(divs, { opacity: 0 }, { duration: 1500 }); + $.Velocity.animate({ + elements: divs, + properties: { opacity: 0 }, + options: { duration: 1500 } + }); +} diff --git a/velocity-animate/velocity-animate.d.ts b/velocity-animate/velocity-animate.d.ts new file mode 100644 index 000000000..00c421896 --- /dev/null +++ b/velocity-animate/velocity-animate.d.ts @@ -0,0 +1,52 @@ +// Type definitions for Velocity 0.0.22 +// Project: http://velocityjs.org/ +// Definitions by: Greg Smith +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface JQuery { + velocity(options: {properties: Object; options: jquery.velocity.VelocityOptions}): JQuery; + velocity(properties: Object, options: jquery.velocity.VelocityOptions): JQuery; + velocity(properties: Object, duration?: number, easing?: string, complete?: jquery.velocity.ElementCallback): JQuery; + velocity(properties: Object, duration?: number, easing?: number[], complete?: jquery.velocity.ElementCallback): JQuery; + velocity(properties: Object, duration?: number, complete?: jquery.velocity.ElementCallback): JQuery; + velocity(properties: Object, easing?: string, complete?: jquery.velocity.ElementCallback): JQuery; + velocity(properties: Object, easing?: number[], complete?: jquery.velocity.ElementCallback): JQuery; + velocity(properties: Object, complete?: jquery.velocity.ElementCallback): JQuery; +} + +interface JQueryStatic { + Velocity: jquery.velocity.VelocityStatic; +} + +declare module jquery.velocity { + interface ElementCallback { + (elements: NodeListOf): void; + } + + interface ProgressCallback { + (elements: NodeListOf, percentComplete: number, timeRemaining: number, timeStart: number): void; + } + + interface VelocityStatic { + Sequences: any; + animate(options: {elements: NodeListOf; properties: Object; options: VelocityOptions}): void; + animate(elements: NodeListOf, properties: Object, options: VelocityOptions): void; + animate(element: HTMLElement, properties: Object, options: VelocityOptions): void; + } + + interface VelocityOptions { + queue?: any; + duration?: any; + easing?: any; + begin?: ElementCallback; + complete?: ElementCallback; + progress?: ProgressCallback; + display?: any; + loop?: any; + delay?: any; + mobileHA?: boolean; + _cacheValues?: boolean; + } +} diff --git a/viewporter/viewporter.d.ts b/viewporter/viewporter.d.ts index c0f441c03..1e85cc5f6 100644 --- a/viewporter/viewporter.d.ts +++ b/viewporter/viewporter.d.ts @@ -1,6 +1,6 @@ // Type definitions for Zynga Viewporter v2.1 // Project: https://github.com/zynga/viewporter -// Definitions by: Boris Yankov https://github.com/borisyankov +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped interface Viewporter { @@ -15,4 +15,4 @@ interface Viewporter { refresh(): void; } -declare var viewporter: Viewporter; \ No newline at end of file +declare var viewporter: Viewporter; diff --git a/webaudioapi/waa-20120802.d.ts b/webaudioapi/waa-20120802.d.ts index 64dc65876..a2039bf61 100644 --- a/webaudioapi/waa-20120802.d.ts +++ b/webaudioapi/waa-20120802.d.ts @@ -1,6 +1,6 @@ // Type definitions for Web Audio API // Project: http://www.w3.org/TR/2012/WD-webaudio-20120802/ -// Definitions by: Baruch Berger (https://github.com/bbss) +// Definitions by: Baruch Berger // Definitions: https://github.com/borisyankov/DefinitelyTyped // Conforms to the: http://www.w3.org/TR/2012/WD-webaudio-20120802/ specification diff --git a/webaudioapi/waa-nightly.d.ts b/webaudioapi/waa-nightly.d.ts index 79566f939..0d83c2533 100644 --- a/webaudioapi/waa-nightly.d.ts +++ b/webaudioapi/waa-nightly.d.ts @@ -1,6 +1,6 @@ // Type definitions for Web Audio API (nightly) // Project: http://www.w3.org/TR/2012/WD-webaudio-20120802/ -// Definitions by: Baruch Berger (https://github.com/bbss) +// Definitions by: Baruch Berger // Definitions: https://github.com/borisyankov/DefinitelyTyped // Conforms to the: http://www.w3.org/TR/2012/WD-webaudio-20120802/ specification diff --git a/webrtc/MediaStream.d.ts b/webrtc/MediaStream.d.ts index ddf2200be..f9f549ed0 100644 --- a/webrtc/MediaStream.d.ts +++ b/webrtc/MediaStream.d.ts @@ -6,8 +6,8 @@ // Taken from http://dev.w3.org/2011/webrtc/editor/getusermedia.html interface MediaStreamConstraints { - audio: boolean; - video: boolean; + audio: any; + video: any; } declare var MediaStreamConstraints: { prototype: MediaStreamConstraints; @@ -40,8 +40,8 @@ declare var MediaTrackConstraint: { } interface Navigator { - getUserMedia(constraints: MediaStreamConstraints, successCallback: (stream: any) => void , errorCallback: (error: Error) => void ); - webkitGetUserMedia(constraints: MediaStreamConstraints, successCallback: (stream: any) => void , errorCallback: (error: Error) => void ); + getUserMedia(constraints: MediaStreamConstraints, successCallback: (stream: any) => void, errorCallback: (error: Error) => void); + webkitGetUserMedia(constraints: MediaStreamConstraints, successCallback: (stream: any) => void, errorCallback: (error: Error) => void); } interface EventHandler { (event: Event): void; } @@ -79,6 +79,7 @@ declare var webkitMediaStreamTrackList: { interface MediaStream { label: string; + id: string; getAudioTracks(): MediaStreamTrackList; getVideoTracks(): MediaStreamTrackList; ended: boolean; @@ -99,6 +100,17 @@ declare var webkitMediaStream: { new (trackContainers: MediaStreamTrack[]): MediaStream; } +// an - not defined in source doc. +interface SourceInfo { + label: string; + id: string; + kind: string; + facing: string; +} +declare var SourceInfo: { + prototype: SourceInfo; +} + interface LocalMediaStream extends MediaStream { stop(): void; } @@ -115,12 +127,13 @@ interface MediaStreamTrack { onunmute: (event: Event) => void; onended: (event: Event) => void; } -declare var MediaStramTrack: { +declare var MediaStreamTrack: { prototype: MediaStreamTrack; new (): MediaStreamTrack; LIVE: number; // = 0; MUTED: number; // = 1; ENDED: number; // = 2; + getSources: (callback: (sources: SourceInfo[]) => void) => void; } interface streamURL extends URL { @@ -136,6 +149,7 @@ interface WebkitURL extends streamURL { } declare var webkitURL: { prototype: WebkitURL; - new (): streamURL; + new (): streamURL; createObjectURL(stream: MediaStream): string; } + diff --git a/winjs/winjs.d.ts b/winjs/winjs.d.ts index 2b8e95c35..811e4893f 100644 --- a/winjs/winjs.d.ts +++ b/winjs/winjs.d.ts @@ -18,8301 +18,8294 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -/// - /** * Defines an Element object. **/ interface Element { - winControl: any; // TODO: This should be control? + winControl: any; // TODO: This should be control? } /** * Utility class for easy access to operations on application folders **/ interface IOHelper { - /** - * Instance of the currently wrapped application folder - **/ - folder: Windows.Storage.StorageFolder; + /** + * Determines whether the specified file exists in the folder. + * @param filename The name of the file. + * @returns A promise that completes with a value of either true (if the file exists) or false. + **/ + exists(filename: string): WinJS.Promise; - /** - * Determines whether the specified file exists in the folder. - * @param filename The name of the file. - * @returns A promise that completes with a value of either true (if the file exists) or false. - **/ - exists(filename: string): WinJS.Promise; + /** + * Reads the specified file. If the file doesn't exist, the specified default value is returned. + * @param fileName The file to read from. + * @param def The default value to be returned if the file failed to open. + * @returns A promise that completes with a value that is either the contents of the file, or the specified default value. + **/ + readText(fileName: string, def?: string): WinJS.Promise; - /** - * Reads the specified file. If the file doesn't exist, the specified default value is returned. - * @param fileName The file to read from. - * @param def The default value to be returned if the file failed to open. - * @returns A promise that completes with a value that is either the contents of the file, or the specified default value. - **/ - readText(fileName: string, def?: string): WinJS.Promise; + /** + * Deletes a file from the folder. + * @param fileName The file to be deleted. + * @returns A promise that is fulfilled when the file has been deleted. + **/ + remove(fileName: string): WinJS.Promise; - /** - * Deletes a file from the folder. - * @param fileName The file to be deleted. - * @returns A promise that is fulfilled when the file has been deleted. - **/ - remove(fileName: string): WinJS.Promise; - - /** - * Writes the specified text to the specified file. - * @param fileName The name of the file. - * @param text The content to be written to the file. - * @returns A promise that completes with a value that is the number of characters written. - **/ - writeText(fileName: string, text: string): WinJS.Promise; + /** + * Writes the specified text to the specified file. + * @param fileName The name of the file. + * @param text The content to be written to the file. + * @returns A promise that completes with a value that is the number of characters written. + **/ + writeText(fileName: string, text: string): WinJS.Promise; } /** * Provides application-level functionality, for example activation, storage, and application events. **/ declare module WinJS.Application { - //#region Objects + //#region Objects - /** - * The local storage of the application. - **/ - var local: IOHelper; + /** + * The local storage of the application. + **/ + var local: IOHelper; - /** - * The roaming storage of the application. - **/ - var roaming: IOHelper; + /** + * The roaming storage of the application. + **/ + var roaming: IOHelper; - /** - * The temp storage of the application. - **/ - var temp: IOHelper; + /** + * The temp storage of the application. + **/ + var temp: IOHelper; - /** - * An object used for storing app information that can be used to restore the app's state after it has been suspended and then resumed. Data that can usefully be contained in this object includes the current navigation page or any information the user has added to the input controls on the page. You should not add information about customization (for example colors) or user-defined lists of content. - **/ - var sessionState: any; + /** + * An object used for storing app information that can be used to restore the app's state after it has been suspended and then resumed. Data that can usefully be contained in this object includes the current navigation page or any information the user has added to the input controls on the page. You should not add information about customization (for example colors) or user-defined lists of content. + **/ + var sessionState: any; - //#endregion Objects + //#endregion Objects - //#region Methods + //#region Methods - /** - * Informs the application object that asynchronous work is being performed, and that this event handler should not be considered complete until the promise completes. This function can be set inside the handlers for all WinJS.Application events: onactivated oncheckpoint onerror onloaded onready onsettings onunload. - * @param promise The promise that should complete before processing is complete. - **/ - function setPromise(promise: Promise): void; + /** + * Informs the application object that asynchronous work is being performed, and that this event handler should not be considered complete until the promise completes. This function can be set inside the handlers for all WinJS.Application events: onactivated oncheckpoint onerror onloaded onready onsettings onunload. + * @param promise The promise that should complete before processing is complete. + **/ + function setPromise(promise: Promise): void; - //#endregion Methods + //#endregion Methods - //#region Functions + //#region Functions - /** - * Adds an event listener for application-level events: activated, checkpoint, error, loaded, ready, settings, and unload. - * @param type The type (name) of the event. You can use any of the following:"activated", "checkpoint", "error", "loaded", "ready", "settings", and" unload". - * @param listener The listener to invoke when the event is raised. - * @param capture true to initiate capture, otherwise false. - **/ - function addEventListener(type: string, listener: Function, capture?: boolean): void; + /** + * Adds an event listener for application-level events: activated, checkpoint, error, loaded, ready, settings, and unload. + * @param type The type (name) of the event. You can use any of the following:"activated", "checkpoint", "error", "loaded", "ready", "settings", and" unload". + * @param listener The listener to invoke when the event is raised. + * @param capture true to initiate capture, otherwise false. + **/ + function addEventListener(type: string, listener: Function, capture?: boolean): void; - /** - * Queues a checkpoint event. - **/ - function checkpoint(): void; + /** + * Queues a checkpoint event. + **/ + function checkpoint(): void; - /** - * Queues an event to be processed by the WinJS.Application event queue. - * @param eventRecord The event object is expected to have a type property that is used as the event name when dispatching on the WinJS.Application event queue. The entire object is provided to event listeners in the detail property of the event. - **/ - function queueEvent(eventRecord: any): void; + /** + * Queues an event to be processed by the WinJS.Application event queue. + * @param eventRecord The event object is expected to have a type property that is used as the event name when dispatching on the WinJS.Application event queue. The entire object is provided to event listeners in the detail property of the event. + **/ + function queueEvent(eventRecord: any): void; - /** - * Removes an event listener from the control. - * @param type The type (name) of the event. - * @param listener The listener to remove. - * @param useCapture Specifies whether or not to initiate capture. - **/ - function removeEventListener(type: string, listener: Function, useCapture?: any): void; + /** + * Removes an event listener from the control. + * @param type The type (name) of the event. + * @param listener The listener to remove. + * @param useCapture Specifies whether or not to initiate capture. + **/ + function removeEventListener(type: string, listener: Function, useCapture?: any): void; - /** - * Starts dispatching application events (the activated, checkpoint, error, loaded, ready, settings, and unload events). - **/ - function start(): void; + /** + * Starts dispatching application events (the activated, checkpoint, error, loaded, ready, settings, and unload events). + **/ + function start(): void; - /** - * Stops application event processing and resets WinJS.Application to its initial state. All WinJS.Application event listeners (for the activated, checkpoint, error, loaded, ready, settings, and unload events) are removed. - **/ - function stop(): void; + /** + * Stops application event processing and resets WinJS.Application to its initial state. All WinJS.Application event listeners (for the activated, checkpoint, error, loaded, ready, settings, and unload events) are removed. + **/ + function stop(): void; - //#endregion Functions + //#endregion Functions - //#region Events + //#region Events - /** - * Occurs when WinRT activation has occurred. The name of this event is "activated" (and also "mainwindowactivated"). This event occurs after the loaded event and before the ready event. - * @param eventInfo An object that contains information about the event. For more information about event arguments, see the WinRT event argument classes: WebUICachedFileUpdaterActivatedEventArgs, WebUICameraSettingsActivatedEventArgs, WebUIContactPickerActivatedEventArgs, WebUIDeviceActivatedEventArgs, WebUIFileActivatedEventArgs, WebUIFileOpenPickerActivatedEventArgs, WebUIFileSavePickerActivatedEventArgs, WebUILaunchActivatedEventArgs, WebUIPrintTaskSettingsActivatedEventArgs, WebUIProtocolActivatedEventArgs, WebUISearchActivatedEventArgs, WebUIShareTargetActivatedEventArgs. - **/ - function onactivated(eventInfo: CustomEvent): void; + /** + * Occurs when WinRT activation has occurred. The name of this event is "activated" (and also "mainwindowactivated"). This event occurs after the loaded event and before the ready event. + * @param eventInfo An object that contains information about the event. For more information about event arguments, see the WinRT event argument classes: WebUICachedFileUpdaterActivatedEventArgs, WebUICameraSettingsActivatedEventArgs, WebUIContactPickerActivatedEventArgs, WebUIDeviceActivatedEventArgs, WebUIFileActivatedEventArgs, WebUIFileOpenPickerActivatedEventArgs, WebUIFileSavePickerActivatedEventArgs, WebUILaunchActivatedEventArgs, WebUIPrintTaskSettingsActivatedEventArgs, WebUIProtocolActivatedEventArgs, WebUISearchActivatedEventArgs, WebUIShareTargetActivatedEventArgs. + **/ + function onactivated(eventInfo: CustomEvent): void; - /** - * Occurs when receiving PLM notification or when the checkpoint function is called. - * @param eventInfo An object that contains information about the event. The detail property of this object includes the following subproperties: type, setPromise. - **/ - function oncheckpoint(eventInfo: CustomEvent): void; + /** + * Occurs when receiving PLM notification or when the checkpoint function is called. + * @param eventInfo An object that contains information about the event. The detail property of this object includes the following subproperties: type, setPromise. + **/ + function oncheckpoint(eventInfo: CustomEvent): void; - /** - * Occurs when an unhandled error has been raised. - * @param eventInfo An object that contains information about the event. - **/ - function onerror(eventInfo: CustomEvent): void; + /** + * Occurs when an unhandled error has been raised. + * @param eventInfo An object that contains information about the event. + **/ + function onerror(eventInfo: CustomEvent): void; - /** - * Occurs after the DOMContentLoaded event, which fires after the page has been parsed but before all the resources are loaded. This event occurs before the activated event and the ready event. - * @param eventInfo An object that contains information about the event. The detail property of this object includes the following subproperties: type, setPromise. - **/ - function onloaded(eventInfo: CustomEvent): void; + /** + * Occurs after the DOMContentLoaded event, which fires after the page has been parsed but before all the resources are loaded. This event occurs before the activated event and the ready event. + * @param eventInfo An object that contains information about the event. The detail property of this object includes the following subproperties: type, setPromise. + **/ + function onloaded(eventInfo: CustomEvent): void; - /** - * Occurs when the application is ready. This event occurs after the loaded event and the activated event. - * @param eventInfo An object that contains information about the event. The detail property of this object includes the following sub-properties: type, setPromise. - **/ - function onready(eventInfo: CustomEvent): void; + /** + * Occurs when the application is ready. This event occurs after the loaded event and the activated event. + * @param eventInfo An object that contains information about the event. The detail property of this object includes the following sub-properties: type, setPromise. + **/ + function onready(eventInfo: CustomEvent): void; - /** - * Occurs when the settings charm is invoked. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: type, applicationcommands. - **/ - function onsettings(eventInfo: CustomEvent): void; + /** + * Occurs when the settings charm is invoked. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: type, applicationcommands. + **/ + function onsettings(eventInfo: CustomEvent): void; - /** - * Occurs when the application is about to be unloaded. - * @param eventInfo An object that contains information about the event. The detail property of this object includes the following sub-properties: type, setPromise. - **/ - function onunload(eventInfo: CustomEvent): void; + /** + * Occurs when the application is about to be unloaded. + * @param eventInfo An object that contains information about the event. The detail property of this object includes the following sub-properties: type, setPromise. + **/ + function onunload(eventInfo: CustomEvent): void; - //#endregion Events + //#endregion Events } /** * Provides functionality for data and template binding. **/ declare module WinJS.Binding { - //#region Properties - - /** - * Determines whether or not binding should automatically set the ID of an element. This property should be set to true in apps that use WinJS (WinJS) binding. - **/ - var optimizeBindingReferences: boolean; - - //#endregion Properties - - //#region Objects - - /** - * Allows you to add bindable properties dynamically. - **/ - var dynamicObservableMixin: { - //#region Methods - - /** - * Adds a property with change notification to this object, including a ECMAScript5 property definition. - * @param name The name of the property to add. - * @param value This object is returned. - **/ - addProperty(name: string, value: any): void; - - /** - * Links the specified action to the property specified in the name parameter. This function is invoked when the value of the property may have changed. It is not guaranteed that the action will be called only when a value has actually changed, nor is it guaranteed that the action will be called for every value change. The implementation of this function coalesces change notifications, such that multiple updates to a property value may result in only a single call to the specified action. - * @param name The name of the property to which to bind the action. - * @param action The function to invoke asynchronously when the property may have changed. - * @returns This object is returned. - **/ - bind(name: string, action: any): Function; - - /** - * Gets a property value by name. - * @param name The name of the property to get. - * @returns The value of the property as an observable object. - **/ - getProperty(name: string): any; - - /** - * Notifies listeners that a property value was updated. - * @param name The name of the property that is being updated. - * @param newValue The new value for the property. - * @param oldValue The old value for the property. - * @returns A promise that is completed when the notifications are complete. - **/ - notify(name: string, newValue: string, oldValue: string): Promise; - - /** - * Removes a property value. - * @param name The name of the property to remove. - * @returns This object is returned. - **/ - removeProperty(name: string): any; - - /** - * Updates a property value and notifies any listeners. - * @param name The name of the property to update. - * @param value The new value of the property. - * @returns This object is returned. - **/ - setProperty(name: string, value: any): any; - - /** - * Removes one or more listeners from the notification list for a given property. - * @param name The name of the property to unbind. If this parameter is omitted, all listeners for all events are removed. - * @param action The function to remove from the listener list for the specified property. If this parameter is omitted, all listeners are removed for the specific property. - * @returns This object is returned. - **/ - unbind(name: string, action: Function): any; - - /** - * Updates a property value and notifies any listeners. - * @param name The name of the property to update. - * @param value The new value of the property. - * @returns A promise that completes when the notifications for this property change have been processed. If multiple notifications are coalesced, the promise may be canceled or the value of the promise may be updated. The fulfilled value of the promise is the new value of the property for which the notifications have been completed. - **/ - updateProperty(name: string, value: any): Promise; - - //#endregion Methods - - }; - - /** - * Do not instantiate. A list returned by the createFiltered method. - **/ - class FilteredListProjection extends ListProjection { - //#region Methods - - /** - * Returns a key/data pair for the specified index. - * @param index The index of the value to retrieve. - * @returns An object that has two properties: key and data. - **/ - getItem(index: number): IKeyDataPair; - - /** - * Returns the index of the first occurrence of a key in a list. - * @param key The key to locate in the list. - * @returns The index of the first occurrence of a key in a list, or -1 if not found. - **/ - indexOfKey(key: string): number; - - /** - * Forces the list to send a itemmutated notification to any listeners for the value at the specified index. - * @param index The index of the value that was mutated. - **/ - notifyMutated(index: number): void; - - /** - * Replaces the value at the specified index with a new value. - * @param index The index of the value that was replaced. - * @param newValue The new value. - **/ - setAt(index: number, newValue: T): void; - - //#endregion Methods - - //#region Properties - - /** - * The length of the list. Returns an integer value one higher than the highest element defined in an list. - **/ - length: number; - - //#endregion Properties - - } - - /** - * Do not instantiate. A list of groups. - **/ - class GroupsListProjection extends ListBase { - //#region Methods - - /** - * Gets a key/data pair for the specified index. - * @param index The index of the value to retrieve. - * @returns An object that has two properties: key and data. - **/ - getItem(index: number): IKeyDataPair; - - /** - * Gets a key/data pair for the specified key. - * @param key The key of the value to retrieve. - * @returns An object with two properties: key and data. - **/ - getItemFromKey(key: string): IKeyDataPair; - - /** - * Returns the index of the first occurrence of a key in a list. - * @param key The key to locate in the list. - * @returns The index of the first occurrence of a key in a list, or -1 if not found. - **/ - indexOfKey(key: string): number; - - //#endregion Methods - - //#region Properties - - /** - * The length of the list. Returns an integer value one higher than the highest element defined in an list. - **/ - length: number; - - //#endregion Properties - - } - - /** - * Do not instantiate. Sorts the underlying list by group key and within a group respects the position of the item in the underlying list. Returned by createGrouped. - **/ - class GroupedSortedListProjection extends SortedListProjection { - //#region Properties - - /** - * Gets a List, which is a projection of the groups that were identified in this list. - **/ - groups: GroupsListProjection; - - //#endregion Properties - - } - - /** - * Represents a list of objects that can be accessed by index or by a string key. Provides methods to search, sort, filter, and manipulate the data. - **/ - class List extends ListBaseWithMutators { - //#region Constructors - - /** - * Creates a List object. - * @constructor - * @param list The array containing the elements to initalize the list. - * @param options You can set two Boolean options: binding and proxy. If options.binding is true, the list contains the result of calling as on the element values. If options.proxy is true, the list specified as the first parameter is used as the storage for the List. This option should be used with care, because uncoordinated edits to the data storage may result in errors. - **/ - constructor(list?: T[], options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * Gets a key/data pair for the specified list index. - * @param index The index of value to retrieve. - * @returns An object with .key and .data properties. - **/ - getItem(index: number): IKeyDataPair; - - /** - * Gets a key/data pair for the list item key specified. - * @param key The key of the value to retrieve. - * @returns An object with .key and .data properties. - **/ - getItemFromKey(key: string): IKeyDataPair; - - /** - * Gets the index of the first occurrence of a key in a list. - * @param key The key to locate in the list. - * @returns The index of the first occurrence of a key in a list, or -1 if not found. - **/ - indexOfKey(key: string): number; - - /** - * Moves the value at index to the specified position. - * @param index The original index of the value. - * @param newIndex The index of the value after the move. - **/ - move(index: number, newIndex: number): void; - - /** - * Forces the list to send a itemmutated notification to any listeners for the value at the specified index. - * @param index The index of the value that was mutated. - **/ - notifyMutated(index: number): void; - - /** - * Returns a list with the elements reversed. This method reverses the elements of a list object in place. It does not create a new list object during execution. - **/ - reverse(): void; - - /** - * Replaces the value at the specified index with a new value. - * @param index The index of the value that was replaced. - * @param newValue The new value. - **/ - setAt(index: number, newValue: T): void; - - /** - * Returns a list with the elements sorted. This method sorts the elements of a list object in place. It does not create a new list object during execution. - * @param sortFunction The function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. This function must always return the same results, given the same inputs. The results should not depend on values that are subject to change. You must call notifyMutated each time an item changes. Do not batch change notifications. - **/ - sort(sortFunction: (left: T, right: T) => number): void; - - /** - * Removes elements from a list and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the list from which to start removing elements. - * @param howMany The number of elements to remove. - * @param item The elements to insert into the list in place of the deleted elements. - * @returns The deleted elements. - **/ - splice(start: number, howMany?: number, ...item: T[]): T[]; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the length of the list, which is an integer value one higher than the highest element defined in the list. - **/ - length: number; - - //#endregion Properties - - } - - /** - * Represents a base class for lists. - **/ - class ListBase { - //#region Events - - /** - * An item in the list has changed its value. - * @param eventInfo An object that contains information about the event. The detail contains the following information: index, key, newItem, newValue, oldItem, oldValue. - **/ - onitemchanged(eventInfo: CustomEvent): void; - - /** - * A new item has been inserted into the list. - * @param eventInfo An object that contains information about the event. The detail contains the following information: index, key, value. - **/ - oniteminserted(eventInfo: CustomEvent): void; - - /** - * An item has been changed locations in the list. - * @param eventInfo An object that contains information about the event. The detail contains the following information: index, key, value. - **/ - onitemmoved(eventInfo: CustomEvent): void; - - /** - * An item has been mutated. This event occurs as a result of calling the notifyMutated method. - * @param eventInfo An object that contains information about the event. The detail contains the following information: index, key, value. - **/ - onitemmutated(eventInfo: CustomEvent): void; - - /** - * An item has been removed from the list. - * @param eventInfo An object that contains information about the event. The detail contains the following information: index, key, value. - **/ - onitemremoved(eventInfo: CustomEvent): void; - - /** - * The list has been refreshed. Any references to items in the list may be incorrect. - * @param eventInfo An object that contains information about the event. The detail property of this object is null. - **/ - onreload(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Adds an event listener to the control. - * @param type The type (name) of the event. - * @param listener The listener to invoke when the event gets raised. - * @param useCapture If true, initiates capture, otherwise false. - **/ - addEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Links the specified action to the property specified in the name parameter. This function is invoked when the value of the property may have changed. It is not guaranteed that the action will be called only when a value has actually changed, nor is it guaranteed that the action will be called for every value change. The implementation of this function coalesces change notifications, such that multiple updates to a property value may result in only a single call to the specified action. - * @param name The name of the property to which to bind the action. - * @param action The function to invoke asynchronously when the property may have changed. - * @returns A reference to this observableMixin object. - **/ - bind(name: string, action: Function): any; - - /** - * Returns a new list consisting of a combination of two arrays. - * @param item Additional items to add to the end of the list. - * @returns An array containing the concatenation of the list and any other supplied items. - **/ - concat(...item: T[]): T[]; - - /** - * Creates a live filtered projection over this list. As the list changes, the filtered projection reacts to those changes and may also change. - * @param predicate A function that accepts a single argument. The createFiltered function calls the callback with each element in the list. If the function returns true, that element will be included in the filtered list. This function must always return the same results, given the same inputs. The results should not depend on values that are subject to change. You must call notifyMutated each time an item changes. Do not batch change notifications. - * @returns A filtered projection over the list. - **/ - createFiltered(predicate: (x: T) => boolean): FilteredListProjection; - - /** - * Creates a live grouped projection over this list. As the list changes, the grouped projection reacts to those changes and may also change. The grouped projection sorts all the elements of the list to be in group-contiguous order. The grouped projection also contains a .groups property, which is a List representing the groups that were found in the list. - * @param groupKey A function that accepts a single argument. The function is called with each element in the list, the function should return a string representing the group containing the element. This function must always return the same results, given the same inputs. The results should not depend on values that are subject to change. You must call notifyMutated each time an item changes. Do not batch change notifications. - * @param groupData A function that accepts a single argument. The function is called once, on one element per group. It should return the value that should be set as the data of the .groups list element for this group. The data value usually serves as summary or header information for the group. - * @param groupSorter A function that accepts two arguments. The function is called with pairs of group keys found in the list. It must return one of the following numeric values: negative if the first argument is less than the second (sorted before), zero if the two arguments are equivalent, positive if the first argument is greater than the second (sorted after). - * @returns A grouped projection over the list. - **/ - createGrouped(groupKey: (x: T) => string, groupData: (x: T) => any, groupSorter: (left: string, right: string) => number): GroupedSortedListProjection; - - /** - * Creates a live sorted projection over this list. As the list changes, the sorted projection reacts to those changes and may also change. - * @param sorter A function that accepts two arguments. The function is called with elements in the list. It must return one of the following numeric values: negative if the first argument is less than the second, zero if the two arguments are equivalent, positive if the first argument is greater than the second. This function must always return the same results, given the same inputs. The results should not depend on values that are subject to change. You must call notifyMutated each time an item changes. Do not batch change notifications. - * @returns A sorted projection over the list. - **/ - createSorted(sorter: (left: T, right: T) => number): SortedListProjection; - - /** - * Raises an event of the specified type and with the specified additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Checks whether the specified callback function returns true for all elements in a list. - * @param callback A function that accepts up to three arguments. This function is called for each element in the list until it returns false or the end of the list is reached. - * @param thisArg An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used. - * @returns true if the callback returns true for all elements in the list. - **/ - every(callback: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Returns the elements of a list that meet the condition specified in a callback function. - * @param callback A function that accepts up to three arguments. The function is called for each element in the list. This function must always return the same results, given the same inputs. The results should not depend on values that are subject to change. You must call notifyMutated each time an item changes. Do not batch change notifications. - * @param thisArg An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used. - * @returns An array containing the elements that meet the condition specified in the callback function. - **/ - filter(callback: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; - - /** - * Calls the specified callback function for each element in a list. - * @param callback A function that accepts up to three arguments. The function is called for each element in the list. The arguments are as follows: value, index, array. - * @param thisArg An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used. - **/ - forEach(callback: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - - /** - * Gets the value at the specified index. - * @param index The index of the value to get. - * @returns The value at the specified index. - **/ - getAt(index: number): T; - - /** - * Gets the index of the first occurrence of the specified value in a list. - * @param searchElement The value to locate in the list. - * @param fromIndex The index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - * @returns The index of the first occurrence of a value in a list or -1 if not found. - **/ - indexOf(searchElement: T, fromIndex?: number): number; - - /** - * Returns a string consisting of all the elements of a list separated by the specified separator string. - * @param separator A string used to separate the elements of a list. If this parameter is omitted, the list elements are separated with a comma. - * @returns The elements of a list separated by the specified separator string. - **/ - join(separator: string): string; - - /** - * Gets the index of the last occurrence of the specified value in a list. - * @param searchElement The value to locate in the list. - * @param fromIndex The index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the list. - * @returns The index of the last occurrence of a value in a list, or -1 if not found. - **/ - lastIndexOf(searchElement: T, fromIndex: number): number; - - /** - * Calls the specified callback function on each element of a list, and returns an array that contains the results. - * @param callback A function that accepts up to three arguments. The function is called for each element in the list. - * @param thisArg n object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used. - * @returns An array containing the result of calling the callback function on each element in the list. - **/ - map(callback: (value: T, index: number, array: T[]) => G, thisArg?: any): G[]; - - /** - * Notifies listeners that a property value was updated. - * @param name The name of the property that is being updated. - * @param newValue The new value for the property. - * @param oldValue The old value for the property. - * @returns A promise that is completed when the notifications are complete. - **/ - notify(name: string, newValue: any, oldValue: any): Promise; - - /** - * Forces the list to send a reload notification to any listeners. - **/ - notifyReload(): void; - - /** - * Accumulates a single result by calling the specified callback function for all elements in a list. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callback A function that accepts up to four arguments. These arguments are: previousValue, currentValue, currentIndex, array. The function is called for each element in the list. - * @param initiallValue If initialValue is specified, it is used as the value with which to start the accumulation. The first call to the function provides this value as an argument instead of a list value. - * @returns The return value from the last call to the callback function. - **/ - reduce(callback: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => T, initiallValue?: T): T; - - /** - * Accumulates a single result by calling the specified callback function for all elements in a list, starting with the last member of the list. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callback A function that accepts up to four arguments. These arguments are: previousValue, currentValue, currentIndex, array. The function is called for each element in the list. - * @param initialValue If initialValue is specified, it is used as the value with which to start the accumulation. The first call to the callback function provides this value as an argument instead of a list value. - * @returns The return value from the last call to callback function. - **/ - reduceRight(callback: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => T, initialValue?: T): T; - - /** - * Removes an event listener from the control. - * @param type The type (name) of the event. - * @param listener The listener to remove. - * @param useCapture true if capture is to be initiated, otherwise false. - **/ - removeEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Extracts a section of a list and returns a new list. - * @param begin The index that specifies the beginning of the section. - * @param end The index that specifies the end of the section. - * @returns Returns a section of list. - **/ - slice(begin: number, end: number): T[]; - - /** - * Checks whether the specified callback function returns true for any element of a list. - * @param callback A function that accepts up to three arguments. The function is called for each element in the list until it returns true, or until the end of the list. - * @param thisArg An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used. - * @returns true if callback returns true for any element in the list. - **/ - some(callback: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Removes one or more listeners from the notification list for a given property. - * @param name The name of the property to unbind. If this parameter is omitted, all listeners for all events are removed. - * @param action The function to remove from the listener list for the specified property. If this parameter is omitted, all listeners are removed for the specific property. - * @returns This object is returned. - **/ - unbind(name: string, action: Function): any; - - //#endregion Methods - - //#region Properties - - /** - * Gets the IListDataSource for the list. The only purpose of this property is to adapt a List to the data model that is used by ListView and FlipView. - **/ - dataSource: WinJS.UI.IListDataSource; - - /** - * Indicates that the object is compatibile with declarative processing. - **/ - static supportedForProcessing: boolean; - - //#endregion Properties - } - - /** - * Represents a base class for normal list modifying operations. - **/ - class ListBaseWithMutators extends ListBase { - //#region Methods - - /** - * Removes the last element from a list and returns it. - * @returns The last element from the list. - **/ - pop(): T; - - /** - * Appends new element(s) to a list, and returns the new length of the list. - * @param value The element to insert at the end of the list. - * @returns The new length of the list. - **/ - push(value: T): number; - - /** - * Removes the first element from a list and returns it. - * @returns The first element from the list. - **/ - shift(): T; - - /** - * Appends new element(s) to a list, and returns the new length of the list. - * @param value The element to insert at the start of the list. - * @returns The new length of the list. - **/ - unshift(value: T): number; - - //#endregion Methods - } - - /** - * Represents a base class for list projections. - **/ - class ListProjection extends ListBaseWithMutators { - //#region Methods - - /** - * Disconnects a WinJS.Binding.List projection from its underlying WinJS.Binding.List. It's only important to call this method when the WinJS.Binding.List projection and the WinJS.Binding.List have different lifetimes. (Call this method on the WinJS.Binding.List projection, not the underlying WinJS.Binding.List.) - **/ - dispose(): void; - - /** - * Gets a key/data pair for the specified key. - * @param key The key of the value to retrieve. - * @returns An object with two properties: key and data. - **/ - getItemFromKey(key: string): IKeyDataPair; - - /** - * Moves the value at index to position newIndex. - * @param index The original index of the value. - * @param newIndex The index of the value after the move. - **/ - move(index: number, newIndex: number): void; - - /** - * Removes elements from a list and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the list from which to start removing elements. - * @param howMany The number of elements to remove. - * @param item The elements to insert into the list in place of the deleted elements. - * @returns The deleted elements. - **/ - splice(start: number, howMany?: number, ...item: T[]): T[]; - - //#endregion Methods - } - - /** - * Provides a standard implementation of the bindable contract, as well as a basic storage mechanism that participates in change notification and an asynchronous notification implementation. - **/ - var mixin: { - //#region Methods - - /** - * Adds a property to the object. The property includes change notification and an ECMAScript 5 property definition . - * @param name The name of the property to add. - * @param value The value of the property. - * @returns This object is returned. - **/ - addProperty(name: string, value: any): any; - - /** - * Links the specified action to the property specified in the name parameter. This function is invoked when the value of the property may have changed. It is not guaranteed that the action will be called only when a value has actually changed, nor is it guaranteed that the action will be called for every value change. The implementation of this function coalesces change notifications, such that multiple updates to a property value may result in only a single call to the specified action. - * @param name The name of the property to which to bind the action. - * @param action The function to invoke asynchronously when the property may have changed. - * @returns This object is returned. - **/ - bind(name: string, action: any): Function; - - /** - * Gets a property value by name. - * @param name The name of the property to get. - * @returns The value of the property as an observable object. - **/ - getProperty(name: string): any; - - /** - * Notifies listeners that a property value was updated. - * @param name The name of the property that is being updated. - * @param newValue The new value for the property. - * @param oldValue The old value for the property. - * @returns A promise that is completed when the notifications are complete. - **/ - notify(name: string, newValue: string, oldValue: string): Promise; - - /** - * Removes a property value. - * @param name The name of the property to remove. - * @returns This object is returned. - **/ - removeProperty(name: string): any; - - /** - * Updates a property value and notifies any listeners. - * @param name The name of the property to update. - * @param value The new value of the property. - * @returns This object is returned. - **/ - setProperty(name: string, value: any): any; - - /** - * Removes one or more listeners from the notification list for a given property. - * @param name The name of the property to unbind. If this parameter is omitted, all listeners for all events are removed. - * @param action The function to remove from the listener list for the specified property. If this parameter is omitted, all listeners are removed for the specific property. - * @returns This object is returned. - **/ - unbind(name: string, action: Function): any; - - /** - * Updates a property value and notifies any listeners. - * @param name The name of the property to update. - * @param value The new value of the property. - * @returns A promise that completes when the notifications for this property change have been processed. If multiple notifications are coalesced, the promise may be canceled or the value of the promise may be updated. The fulfilled value of the promise is the new value of the property for which the notifications have been completed. - **/ - updateProperty(name: string, value: any): Promise; - - //#endregion Methods - - }; - - /** - * Provides functions that can make an object observable. - **/ - var observableMixin: { - //#region Methods - - /** - * Links the specified action to the property specified in the name parameter. This function is invoked when the value of the property may have changed. It is not guaranteed that the action will be called only when a value has actually changed, nor is it guaranteed that the action will be called for every value change. The implementation of this function coalesces change notifications, such that multiple updates to a property value may result in only a single call to the specified action. - * @param name The name of the property to which to bind the action. - * @param action The function to invoke asynchronously when the property may have changed. - * @returns A reference to this observableMixin object. - **/ - bind(name: string, action: Function): any; - - /** - * Notifies listeners that a property value was updated. - * @param name The name of the property that is being updated. - * @param newValue The new value for the property. - * @param oldValue The old value for the property. - * @returns A promise that is completed when the notifications are complete. - **/ - notify(name: string, newValue: any, oldValue: any): Promise; - - /** - * Removes one or more listeners from the notification list for a given property. - * @param name The name of the property to unbind. If this parameter is omitted, all listeners for all events are removed. - * @param action The function to remove from the listener list for the specified property. If this parameter is omitted, all listeners are removed for the specific property. - * @returns This object is returned. - **/ - unbind(name: string, action: Function): any; - - //#endregion Methods - - }; - - /** - * Do not instantiate. Returned by the createSorted method. - **/ - class SortedListProjection extends ListProjection { - //#region Methods - - /** - * Returns a key/data pair for the specified index. - * @param index The index of the value to retrieve. - * @returns An object that has two properties: key and data. - **/ - getItem(index: number): IKeyDataPair; - - /** - * Returns the index of the first occurrence of a key. - * @param key The key to locate in the list. - * @returns The index of the first occurrence of a key in a list, or -1 if not found. - **/ - indexOfKey(key: string): number; - - /** - * Forces the list to send a itemmutated notification to any listeners for the value at the specified index. - * @param index The index of the value that was mutated. - **/ - notifyMutated(index: number): void; - - /** - * Replaces the value at the specified index with a new value. - * @param index The index of the value to be replaced. - * @param newValue The new value. - **/ - setAt(index: number, newValue: T): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the length of the list. Returns an integer value one higher than the highest element defined in a list. - **/ - length: number; - - //#endregion Properties - - } - - /** - * Provides a reusable declarative binding element. - **/ - class Template { - //#region Constructors - - /** - * Creates a template that provides a reusable declarative binding element. - * @constructor - * @param element The DOM element to convert to a template. - * @param options If this parameter is supplied, the template is loaded from the URI and the content of the element parameter is ignored. You can add the following options: href. - **/ - constructor(element: HTMLElement, options?: string); - - //#endregion Constructors - - //#region Methods - - render: { - /** - * Binds values from the specified data context to elements that are descendants of the specified root element that have the declarative binding attributes specified (data-win-bind). - * @param dataContext The object to use for default data binding. - * @param container The element to which to add this rendered template. If this parameter is omitted, a new DIV is created. - * @returns A Promise that will be completed after binding has finished. The value is either container or the created DIV. promise that is completed after binding has finished. - **/ - (dataContext: any, container?: HTMLElement): Promise; - - /** - * Renders a template based on the specified URI (static method). - * @param href The URI from which to load the template. - * @param dataContext The object to use for default data binding. - * @param container The element to which to add this rendered template. If this parameter is omitted, a new DIV is created. - * @returns A promise that is completed after binding has finished. The value is either the object in the container parameter or the created DIV. - **/ - value(href: string, dataContext: any, container?: HTMLElement): Promise; - }; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the default binding initializer for the template. - **/ - bindingInitializer: any; - - /** - * Gets or sets a value that specifies whether a debug break is inserted into the first rendering of each template. This property only has an effect when the app is in debug mode. - **/ - debugBreakOnRender: boolean; - - /** - * This property is deprecated and might not be available in future versions of the WinJS. Gets or sets a value that specifies whether optimized template processing has been disabled. - **/ - disableOptimizedProcessing: boolean; - - /** - * Gets the DOM element that is used as the template. - **/ - element: HTMLElement; - - /** - * Gets a value that specifies whether templates should be instantiated without the creation of an additional child element. - **/ - extractChild: boolean; - - /** - * Determines whether the Template contains declarative controls that must be processed separately. This property is always true. The controls that belong to a Template object's children are instantiated when a Template instance is rendered. - **/ - isDeclarativeControlContainer: boolean; - - //#endregion Properties - - } - - //#endregion Objects - - //#region Functions - - /** - * Adds a CSS class from the specified path of the source object to a destination object. - * @param source The source object that has the class to copy. - * @param sourceProperties The path on the source object to the source class. - * @param dest The destination object. - **/ - function addClassOneTime(source: any, sourceProperties: any[], dest: HTMLElement): void; - - /** - * Returns an observable object. This may be an observable proxy for the specified object, an existing proxy, or the specified object itself if it directly supports observation. - * @param data The object to observe. - * @returns The observable object. - **/ - function as(data: U): U; - - /** - * Binds to one or more properties on the observable object or or on child values of that object. - * @param observable The object to bind to. - * @param bindingDescriptor An object literal containing the binding declarations. Binding declarations take the form: { propertyName: (function | bindingDeclaration), ... }. - * @returns An object that contains at least a "cancel" field, which is a function that removes all bindings associated with this bind request. - **/ - function bind(observable: any, bindingDescriptor: any): any; - - /** - * Creates a default binding initializer for binding between a source property and a destination property with the specified converter function that is executed on the value of the source property. - * @param convert The conversion function that takes the source property and produces a value that is set to the destination property. This function must be accessible from the global namespace. - * @returns The binding initializer. - **/ - function converter(convert: Function): Function; - - /** - * Creates a one-way binding between the source object and the destination object. Warning Do not attempt to bind data to the ID of an HTML element. - * @param source The source object. - * @param sourceProperties The path on the source object to the source property. - * @param dest The destination object. - * @param destProperties The path on the destination object to the destination property. - * @returns An object with a cancel method that is used to coalesce bindings. - **/ - function defaultBind(source: any, sourceProperties: any, dest: any, destProperties: any): any; - - /** - * Creates a new constructor function that supports observability with the specified set of properties. - * @param data The object to use as the pattern for defining the set of properties. - * @returns A constructor function with 1 optional argument that is the initial state of the properties. - **/ - function define(data: any): Function; - - /** - * Wraps the specified object so that all its properties are instrumented for binding. This is meant to be used in conjunction with the binding mixin. - * @param shape The specification for the bindable object. - * @returns An object with a set of properties all of which are wired for binding. - **/ - function expandProperties(shape: any): any; - - /** - * Marks a custom initializer function as being compatible with declarative data binding. - * @param customInitializer The custom initializer to be marked as compatible with declarative data binding. - * @returns The input customInitializer. - **/ - function initializer(customInitializer: Function): Function; - - /** - * Notifies listeners that a property value was updated. - * @param name The name of the property that is being updated. - * @param newValue The new value for the property. - * @param oldValue The old value for the property. - * @returns A promise that is completed when the notifications are complete. - **/ - function notify(name: string, newValue: string, oldValue: string): Promise; - - /** - * Sets the destination property to the value of the source property. - * @param source The source object. - * @param sourceProperties The path on the source object to the source property. - * @param dest The destination object. - * @param destProperties The path on the destination object to the destination property. - * @returns An object with a cancel method that is used to coalesce bindings. - **/ - function oneTime(source: any, sourceProperties: any, dest: any, destProperties: any): any; - - /** - * Binds the values of an object to the values of a DOM element that has the data-win-bind attribute. If multiple DOM elements are to be bound, you must set the attribute on all of them. See the example below for details. - * @param rootElement Optional. The element at which to start traversing to find elements to bind to. If this parameter is omitted, the entire document is searched. - * @param dataContext The object that contains the values to which the DOM element should be bound. - * @param skipRoot If true, specifies that only the children of rootElement should be bound, otherwise rootElement should be bound as well. - * @param bindingCache The cached binding data. - * @param defaultInitializer The binding initializer to use in the case that one is not specified in a binding expression. If not provided, the behavior is the same as Binding.defaultBind. - * @returns A Promise that completes when every item that contains the data-win-bind attribute has been processed and the update has started. - **/ - function processAll(rootElement?: Element, dataContext?: any, skipRoot?: boolean, bindingCache?: any, defaultInitializer?: Function): Promise; - - /** - * Creates a one-way binding between the source object and an attribute on the destination element. - * @param source The source object. - * @param sourceProperties The path on the source object to the source property. - * @param dest The destination object. - * @param destProperties The path on the destination object to the destination property. This must be a single name. - * @returns An object with a cancel() method that is used to coalesce bindings. - **/ - function setAttribute(source: any, sourceProperties: any[], dest: Element, destProperties: any[]): any; - - /** - * Sets an attribute on the destination element to the value of the source property. - * @param source The source object. - * @param sourceProperties The path on the source object to the source property. - * @param dest The destination object. - * @param destProperties The path on the destination object to the destination property. This must be a single name. - **/ - function setAttributeOneTime(source: any, sourceProperties: any[], dest: Element, destProperties: any[]): void; - - /** - * Returns the original (non-observable) object is returned if the specified object is an observable proxy, - * @param data The object for which to retrieve the original value. - * @returns If the specified object is an observable proxy, the original object is returned, otherwise the same object is returned. - **/ - function unwrap(data: any): any; - - //#endregion Functions - - //#region Interfaces - - interface IKeyDataPair { - key: string; - data: T; - } - - //#endregion Interfaces + //#region Properties + + /** + * Determines whether or not binding should automatically set the ID of an element. This property should be set to true in apps that use WinJS (WinJS) binding. + **/ + var optimizeBindingReferences: boolean; + + //#endregion Properties + + //#region Objects + + /** + * Allows you to add bindable properties dynamically. + **/ + var dynamicObservableMixin: { + //#region Methods + + /** + * Adds a property with change notification to this object, including a ECMAScript5 property definition. + * @param name The name of the property to add. + * @param value This object is returned. + **/ + addProperty(name: string, value: any): void; + + /** + * Links the specified action to the property specified in the name parameter. This function is invoked when the value of the property may have changed. It is not guaranteed that the action will be called only when a value has actually changed, nor is it guaranteed that the action will be called for every value change. The implementation of this function coalesces change notifications, such that multiple updates to a property value may result in only a single call to the specified action. + * @param name The name of the property to which to bind the action. + * @param action The function to invoke asynchronously when the property may have changed. + * @returns This object is returned. + **/ + bind(name: string, action: any): Function; + + /** + * Gets a property value by name. + * @param name The name of the property to get. + * @returns The value of the property as an observable object. + **/ + getProperty(name: string): any; + + /** + * Notifies listeners that a property value was updated. + * @param name The name of the property that is being updated. + * @param newValue The new value for the property. + * @param oldValue The old value for the property. + * @returns A promise that is completed when the notifications are complete. + **/ + notify(name: string, newValue: string, oldValue: string): Promise; + + /** + * Removes a property value. + * @param name The name of the property to remove. + * @returns This object is returned. + **/ + removeProperty(name: string): any; + + /** + * Updates a property value and notifies any listeners. + * @param name The name of the property to update. + * @param value The new value of the property. + * @returns This object is returned. + **/ + setProperty(name: string, value: any): any; + + /** + * Removes one or more listeners from the notification list for a given property. + * @param name The name of the property to unbind. If this parameter is omitted, all listeners for all events are removed. + * @param action The function to remove from the listener list for the specified property. If this parameter is omitted, all listeners are removed for the specific property. + * @returns This object is returned. + **/ + unbind(name: string, action: Function): any; + + /** + * Updates a property value and notifies any listeners. + * @param name The name of the property to update. + * @param value The new value of the property. + * @returns A promise that completes when the notifications for this property change have been processed. If multiple notifications are coalesced, the promise may be canceled or the value of the promise may be updated. The fulfilled value of the promise is the new value of the property for which the notifications have been completed. + **/ + updateProperty(name: string, value: any): Promise; + + //#endregion Methods + + }; + + /** + * Do not instantiate. A list returned by the createFiltered method. + **/ + class FilteredListProjection extends ListProjection { + //#region Methods + + /** + * Returns a key/data pair for the specified index. + * @param index The index of the value to retrieve. + * @returns An object that has two properties: key and data. + **/ + getItem(index: number): IKeyDataPair; + + /** + * Returns the index of the first occurrence of a key in a list. + * @param key The key to locate in the list. + * @returns The index of the first occurrence of a key in a list, or -1 if not found. + **/ + indexOfKey(key: string): number; + + /** + * Forces the list to send a itemmutated notification to any listeners for the value at the specified index. + * @param index The index of the value that was mutated. + **/ + notifyMutated(index: number): void; + + /** + * Replaces the value at the specified index with a new value. + * @param index The index of the value that was replaced. + * @param newValue The new value. + **/ + setAt(index: number, newValue: T): void; + + //#endregion Methods + + //#region Properties + + /** + * The length of the list. Returns an integer value one higher than the highest element defined in an list. + **/ + length: number; + + //#endregion Properties + + } + + /** + * Do not instantiate. A list of groups. + **/ + class GroupsListProjection extends ListBase { + //#region Methods + + /** + * Gets a key/data pair for the specified index. + * @param index The index of the value to retrieve. + * @returns An object that has two properties: key and data. + **/ + getItem(index: number): IKeyDataPair; + + /** + * Gets a key/data pair for the specified key. + * @param key The key of the value to retrieve. + * @returns An object with two properties: key and data. + **/ + getItemFromKey(key: string): IKeyDataPair; + + /** + * Returns the index of the first occurrence of a key in a list. + * @param key The key to locate in the list. + * @returns The index of the first occurrence of a key in a list, or -1 if not found. + **/ + indexOfKey(key: string): number; + + //#endregion Methods + + //#region Properties + + /** + * The length of the list. Returns an integer value one higher than the highest element defined in an list. + **/ + length: number; + + //#endregion Properties + + } + + /** + * Do not instantiate. Sorts the underlying list by group key and within a group respects the position of the item in the underlying list. Returned by createGrouped. + **/ + class GroupedSortedListProjection extends SortedListProjection { + //#region Properties + + /** + * Gets a List, which is a projection of the groups that were identified in this list. + **/ + groups: GroupsListProjection; + + //#endregion Properties + + } + + /** + * Represents a list of objects that can be accessed by index or by a string key. Provides methods to search, sort, filter, and manipulate the data. + **/ + class List extends ListBaseWithMutators { + //#region Constructors + + /** + * Creates a List object. + * @constructor + * @param list The array containing the elements to initalize the list. + * @param options You can set two Boolean options: binding and proxy. If options.binding is true, the list contains the result of calling as on the element values. If options.proxy is true, the list specified as the first parameter is used as the storage for the List. This option should be used with care, because uncoordinated edits to the data storage may result in errors. + **/ + constructor(list?: T[], options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * Gets a key/data pair for the specified list index. + * @param index The index of value to retrieve. + * @returns An object with .key and .data properties. + **/ + getItem(index: number): IKeyDataPair; + + /** + * Gets a key/data pair for the list item key specified. + * @param key The key of the value to retrieve. + * @returns An object with .key and .data properties. + **/ + getItemFromKey(key: string): IKeyDataPair; + + /** + * Gets the index of the first occurrence of a key in a list. + * @param key The key to locate in the list. + * @returns The index of the first occurrence of a key in a list, or -1 if not found. + **/ + indexOfKey(key: string): number; + + /** + * Moves the value at index to the specified position. + * @param index The original index of the value. + * @param newIndex The index of the value after the move. + **/ + move(index: number, newIndex: number): void; + + /** + * Forces the list to send a itemmutated notification to any listeners for the value at the specified index. + * @param index The index of the value that was mutated. + **/ + notifyMutated(index: number): void; + + /** + * Returns a list with the elements reversed. This method reverses the elements of a list object in place. It does not create a new list object during execution. + **/ + reverse(): void; + + /** + * Replaces the value at the specified index with a new value. + * @param index The index of the value that was replaced. + * @param newValue The new value. + **/ + setAt(index: number, newValue: T): void; + + /** + * Returns a list with the elements sorted. This method sorts the elements of a list object in place. It does not create a new list object during execution. + * @param sortFunction The function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. This function must always return the same results, given the same inputs. The results should not depend on values that are subject to change. You must call notifyMutated each time an item changes. Do not batch change notifications. + **/ + sort(sortFunction: (left: T, right: T) => number): void; + + /** + * Removes elements from a list and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the list from which to start removing elements. + * @param howMany The number of elements to remove. + * @param item The elements to insert into the list in place of the deleted elements. + * @returns The deleted elements. + **/ + splice(start: number, howMany?: number, ...item: T[]): T[]; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the length of the list, which is an integer value one higher than the highest element defined in the list. + **/ + length: number; + + //#endregion Properties + + } + + /** + * Represents a base class for lists. + **/ + class ListBase { + //#region Events + + /** + * An item in the list has changed its value. + * @param eventInfo An object that contains information about the event. The detail contains the following information: index, key, newItem, newValue, oldItem, oldValue. + **/ + onitemchanged(eventInfo: CustomEvent): void; + + /** + * A new item has been inserted into the list. + * @param eventInfo An object that contains information about the event. The detail contains the following information: index, key, value. + **/ + oniteminserted(eventInfo: CustomEvent): void; + + /** + * An item has been changed locations in the list. + * @param eventInfo An object that contains information about the event. The detail contains the following information: index, key, value. + **/ + onitemmoved(eventInfo: CustomEvent): void; + + /** + * An item has been mutated. This event occurs as a result of calling the notifyMutated method. + * @param eventInfo An object that contains information about the event. The detail contains the following information: index, key, value. + **/ + onitemmutated(eventInfo: CustomEvent): void; + + /** + * An item has been removed from the list. + * @param eventInfo An object that contains information about the event. The detail contains the following information: index, key, value. + **/ + onitemremoved(eventInfo: CustomEvent): void; + + /** + * The list has been refreshed. Any references to items in the list may be incorrect. + * @param eventInfo An object that contains information about the event. The detail property of this object is null. + **/ + onreload(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Adds an event listener to the control. + * @param type The type (name) of the event. + * @param listener The listener to invoke when the event gets raised. + * @param useCapture If true, initiates capture, otherwise false. + **/ + addEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Links the specified action to the property specified in the name parameter. This function is invoked when the value of the property may have changed. It is not guaranteed that the action will be called only when a value has actually changed, nor is it guaranteed that the action will be called for every value change. The implementation of this function coalesces change notifications, such that multiple updates to a property value may result in only a single call to the specified action. + * @param name The name of the property to which to bind the action. + * @param action The function to invoke asynchronously when the property may have changed. + * @returns A reference to this observableMixin object. + **/ + bind(name: string, action: Function): any; + + /** + * Returns a new list consisting of a combination of two arrays. + * @param item Additional items to add to the end of the list. + * @returns An array containing the concatenation of the list and any other supplied items. + **/ + concat(...item: T[]): T[]; + + /** + * Creates a live filtered projection over this list. As the list changes, the filtered projection reacts to those changes and may also change. + * @param predicate A function that accepts a single argument. The createFiltered function calls the callback with each element in the list. If the function returns true, that element will be included in the filtered list. This function must always return the same results, given the same inputs. The results should not depend on values that are subject to change. You must call notifyMutated each time an item changes. Do not batch change notifications. + * @returns A filtered projection over the list. + **/ + createFiltered(predicate: (x: T) => boolean): FilteredListProjection; + + /** + * Creates a live grouped projection over this list. As the list changes, the grouped projection reacts to those changes and may also change. The grouped projection sorts all the elements of the list to be in group-contiguous order. The grouped projection also contains a .groups property, which is a List representing the groups that were found in the list. + * @param groupKey A function that accepts a single argument. The function is called with each element in the list, the function should return a string representing the group containing the element. This function must always return the same results, given the same inputs. The results should not depend on values that are subject to change. You must call notifyMutated each time an item changes. Do not batch change notifications. + * @param groupData A function that accepts a single argument. The function is called once, on one element per group. It should return the value that should be set as the data of the .groups list element for this group. The data value usually serves as summary or header information for the group. + * @param groupSorter A function that accepts two arguments. The function is called with pairs of group keys found in the list. It must return one of the following numeric values: negative if the first argument is less than the second (sorted before), zero if the two arguments are equivalent, positive if the first argument is greater than the second (sorted after). + * @returns A grouped projection over the list. + **/ + createGrouped(groupKey: (x: T) => string, groupData: (x: T) => any, groupSorter: (left: string, right: string) => number): GroupedSortedListProjection; + + /** + * Creates a live sorted projection over this list. As the list changes, the sorted projection reacts to those changes and may also change. + * @param sorter A function that accepts two arguments. The function is called with elements in the list. It must return one of the following numeric values: negative if the first argument is less than the second, zero if the two arguments are equivalent, positive if the first argument is greater than the second. This function must always return the same results, given the same inputs. The results should not depend on values that are subject to change. You must call notifyMutated each time an item changes. Do not batch change notifications. + * @returns A sorted projection over the list. + **/ + createSorted(sorter: (left: T, right: T) => number): SortedListProjection; + + /** + * Raises an event of the specified type and with the specified additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Checks whether the specified callback function returns true for all elements in a list. + * @param callback A function that accepts up to three arguments. This function is called for each element in the list until it returns false or the end of the list is reached. + * @param thisArg An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used. + * @returns true if the callback returns true for all elements in the list. + **/ + every(callback: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Returns the elements of a list that meet the condition specified in a callback function. + * @param callback A function that accepts up to three arguments. The function is called for each element in the list. This function must always return the same results, given the same inputs. The results should not depend on values that are subject to change. You must call notifyMutated each time an item changes. Do not batch change notifications. + * @param thisArg An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used. + * @returns An array containing the elements that meet the condition specified in the callback function. + **/ + filter(callback: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; + + /** + * Calls the specified callback function for each element in a list. + * @param callback A function that accepts up to three arguments. The function is called for each element in the list. The arguments are as follows: value, index, array. + * @param thisArg An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used. + **/ + forEach(callback: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + + /** + * Gets the value at the specified index. + * @param index The index of the value to get. + * @returns The value at the specified index. + **/ + getAt(index: number): T; + + /** + * Gets the index of the first occurrence of the specified value in a list. + * @param searchElement The value to locate in the list. + * @param fromIndex The index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + * @returns The index of the first occurrence of a value in a list or -1 if not found. + **/ + indexOf(searchElement: T, fromIndex?: number): number; + + /** + * Returns a string consisting of all the elements of a list separated by the specified separator string. + * @param separator A string used to separate the elements of a list. If this parameter is omitted, the list elements are separated with a comma. + * @returns The elements of a list separated by the specified separator string. + **/ + join(separator: string): string; + + /** + * Gets the index of the last occurrence of the specified value in a list. + * @param searchElement The value to locate in the list. + * @param fromIndex The index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the list. + * @returns The index of the last occurrence of a value in a list, or -1 if not found. + **/ + lastIndexOf(searchElement: T, fromIndex: number): number; + + /** + * Calls the specified callback function on each element of a list, and returns an array that contains the results. + * @param callback A function that accepts up to three arguments. The function is called for each element in the list. + * @param thisArg n object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used. + * @returns An array containing the result of calling the callback function on each element in the list. + **/ + map(callback: (value: T, index: number, array: T[]) => G, thisArg?: any): G[]; + + /** + * Notifies listeners that a property value was updated. + * @param name The name of the property that is being updated. + * @param newValue The new value for the property. + * @param oldValue The old value for the property. + * @returns A promise that is completed when the notifications are complete. + **/ + notify(name: string, newValue: any, oldValue: any): Promise; + + /** + * Forces the list to send a reload notification to any listeners. + **/ + notifyReload(): void; + + /** + * Accumulates a single result by calling the specified callback function for all elements in a list. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callback A function that accepts up to four arguments. These arguments are: previousValue, currentValue, currentIndex, array. The function is called for each element in the list. + * @param initiallValue If initialValue is specified, it is used as the value with which to start the accumulation. The first call to the function provides this value as an argument instead of a list value. + * @returns The return value from the last call to the callback function. + **/ + reduce(callback: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => T, initiallValue?: T): T; + + /** + * Accumulates a single result by calling the specified callback function for all elements in a list, starting with the last member of the list. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callback A function that accepts up to four arguments. These arguments are: previousValue, currentValue, currentIndex, array. The function is called for each element in the list. + * @param initialValue If initialValue is specified, it is used as the value with which to start the accumulation. The first call to the callback function provides this value as an argument instead of a list value. + * @returns The return value from the last call to callback function. + **/ + reduceRight(callback: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => T, initialValue?: T): T; + + /** + * Removes an event listener from the control. + * @param type The type (name) of the event. + * @param listener The listener to remove. + * @param useCapture true if capture is to be initiated, otherwise false. + **/ + removeEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Extracts a section of a list and returns a new list. + * @param begin The index that specifies the beginning of the section. + * @param end The index that specifies the end of the section. + * @returns Returns a section of list. + **/ + slice(begin: number, end: number): T[]; + + /** + * Checks whether the specified callback function returns true for any element of a list. + * @param callback A function that accepts up to three arguments. The function is called for each element in the list until it returns true, or until the end of the list. + * @param thisArg An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used. + * @returns true if callback returns true for any element in the list. + **/ + some(callback: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Removes one or more listeners from the notification list for a given property. + * @param name The name of the property to unbind. If this parameter is omitted, all listeners for all events are removed. + * @param action The function to remove from the listener list for the specified property. If this parameter is omitted, all listeners are removed for the specific property. + * @returns This object is returned. + **/ + unbind(name: string, action: Function): any; + + //#endregion Methods + + //#region Properties + + /** + * Gets the IListDataSource for the list. The only purpose of this property is to adapt a List to the data model that is used by ListView and FlipView. + **/ + dataSource: WinJS.UI.IListDataSource; + + /** + * Indicates that the object is compatibile with declarative processing. + **/ + static supportedForProcessing: boolean; + + //#endregion Properties + } + + /** + * Represents a base class for normal list modifying operations. + **/ + class ListBaseWithMutators extends ListBase { + //#region Methods + + /** + * Removes the last element from a list and returns it. + * @returns The last element from the list. + **/ + pop(): T; + + /** + * Appends new element(s) to a list, and returns the new length of the list. + * @param value The element to insert at the end of the list. + * @returns The new length of the list. + **/ + push(value: T): number; + + /** + * Removes the first element from a list and returns it. + * @returns The first element from the list. + **/ + shift(): T; + + /** + * Appends new element(s) to a list, and returns the new length of the list. + * @param value The element to insert at the start of the list. + * @returns The new length of the list. + **/ + unshift(value: T): number; + + //#endregion Methods + } + + /** + * Represents a base class for list projections. + **/ + class ListProjection extends ListBaseWithMutators { + //#region Methods + + /** + * Disconnects a WinJS.Binding.List projection from its underlying WinJS.Binding.List. It's only important to call this method when the WinJS.Binding.List projection and the WinJS.Binding.List have different lifetimes. (Call this method on the WinJS.Binding.List projection, not the underlying WinJS.Binding.List.) + **/ + dispose(): void; + + /** + * Gets a key/data pair for the specified key. + * @param key The key of the value to retrieve. + * @returns An object with two properties: key and data. + **/ + getItemFromKey(key: string): IKeyDataPair; + + /** + * Moves the value at index to position newIndex. + * @param index The original index of the value. + * @param newIndex The index of the value after the move. + **/ + move(index: number, newIndex: number): void; + + /** + * Removes elements from a list and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the list from which to start removing elements. + * @param howMany The number of elements to remove. + * @param item The elements to insert into the list in place of the deleted elements. + * @returns The deleted elements. + **/ + splice(start: number, howMany?: number, ...item: T[]): T[]; + + //#endregion Methods + } + + /** + * Provides a standard implementation of the bindable contract, as well as a basic storage mechanism that participates in change notification and an asynchronous notification implementation. + **/ + var mixin: { + //#region Methods + + /** + * Adds a property to the object. The property includes change notification and an ECMAScript 5 property definition . + * @param name The name of the property to add. + * @param value The value of the property. + * @returns This object is returned. + **/ + addProperty(name: string, value: any): any; + + /** + * Links the specified action to the property specified in the name parameter. This function is invoked when the value of the property may have changed. It is not guaranteed that the action will be called only when a value has actually changed, nor is it guaranteed that the action will be called for every value change. The implementation of this function coalesces change notifications, such that multiple updates to a property value may result in only a single call to the specified action. + * @param name The name of the property to which to bind the action. + * @param action The function to invoke asynchronously when the property may have changed. + * @returns This object is returned. + **/ + bind(name: string, action: any): Function; + + /** + * Gets a property value by name. + * @param name The name of the property to get. + * @returns The value of the property as an observable object. + **/ + getProperty(name: string): any; + + /** + * Notifies listeners that a property value was updated. + * @param name The name of the property that is being updated. + * @param newValue The new value for the property. + * @param oldValue The old value for the property. + * @returns A promise that is completed when the notifications are complete. + **/ + notify(name: string, newValue: string, oldValue: string): Promise; + + /** + * Removes a property value. + * @param name The name of the property to remove. + * @returns This object is returned. + **/ + removeProperty(name: string): any; + + /** + * Updates a property value and notifies any listeners. + * @param name The name of the property to update. + * @param value The new value of the property. + * @returns This object is returned. + **/ + setProperty(name: string, value: any): any; + + /** + * Removes one or more listeners from the notification list for a given property. + * @param name The name of the property to unbind. If this parameter is omitted, all listeners for all events are removed. + * @param action The function to remove from the listener list for the specified property. If this parameter is omitted, all listeners are removed for the specific property. + * @returns This object is returned. + **/ + unbind(name: string, action: Function): any; + + /** + * Updates a property value and notifies any listeners. + * @param name The name of the property to update. + * @param value The new value of the property. + * @returns A promise that completes when the notifications for this property change have been processed. If multiple notifications are coalesced, the promise may be canceled or the value of the promise may be updated. The fulfilled value of the promise is the new value of the property for which the notifications have been completed. + **/ + updateProperty(name: string, value: any): Promise; + + //#endregion Methods + + }; + + /** + * Provides functions that can make an object observable. + **/ + var observableMixin: { + //#region Methods + + /** + * Links the specified action to the property specified in the name parameter. This function is invoked when the value of the property may have changed. It is not guaranteed that the action will be called only when a value has actually changed, nor is it guaranteed that the action will be called for every value change. The implementation of this function coalesces change notifications, such that multiple updates to a property value may result in only a single call to the specified action. + * @param name The name of the property to which to bind the action. + * @param action The function to invoke asynchronously when the property may have changed. + * @returns A reference to this observableMixin object. + **/ + bind(name: string, action: Function): any; + + /** + * Notifies listeners that a property value was updated. + * @param name The name of the property that is being updated. + * @param newValue The new value for the property. + * @param oldValue The old value for the property. + * @returns A promise that is completed when the notifications are complete. + **/ + notify(name: string, newValue: any, oldValue: any): Promise; + + /** + * Removes one or more listeners from the notification list for a given property. + * @param name The name of the property to unbind. If this parameter is omitted, all listeners for all events are removed. + * @param action The function to remove from the listener list for the specified property. If this parameter is omitted, all listeners are removed for the specific property. + * @returns This object is returned. + **/ + unbind(name: string, action: Function): any; + + //#endregion Methods + + }; + + /** + * Do not instantiate. Returned by the createSorted method. + **/ + class SortedListProjection extends ListProjection { + //#region Methods + + /** + * Returns a key/data pair for the specified index. + * @param index The index of the value to retrieve. + * @returns An object that has two properties: key and data. + **/ + getItem(index: number): IKeyDataPair; + + /** + * Returns the index of the first occurrence of a key. + * @param key The key to locate in the list. + * @returns The index of the first occurrence of a key in a list, or -1 if not found. + **/ + indexOfKey(key: string): number; + + /** + * Forces the list to send a itemmutated notification to any listeners for the value at the specified index. + * @param index The index of the value that was mutated. + **/ + notifyMutated(index: number): void; + + /** + * Replaces the value at the specified index with a new value. + * @param index The index of the value to be replaced. + * @param newValue The new value. + **/ + setAt(index: number, newValue: T): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the length of the list. Returns an integer value one higher than the highest element defined in a list. + **/ + length: number; + + //#endregion Properties + + } + + /** + * Provides a reusable declarative binding element. + **/ + class Template { + //#region Constructors + + /** + * Creates a template that provides a reusable declarative binding element. + * @constructor + * @param element The DOM element to convert to a template. + * @param options If this parameter is supplied, the template is loaded from the URI and the content of the element parameter is ignored. You can add the following options: href. + **/ + constructor(element: HTMLElement, options?: string); + + //#endregion Constructors + + //#region Methods + + render: { + /** + * Binds values from the specified data context to elements that are descendants of the specified root element that have the declarative binding attributes specified (data-win-bind). + * @param dataContext The object to use for default data binding. + * @param container The element to which to add this rendered template. If this parameter is omitted, a new DIV is created. + * @returns A Promise that will be completed after binding has finished. The value is either container or the created DIV. promise that is completed after binding has finished. + **/ + (dataContext: any, container?: HTMLElement): Promise; + + /** + * Renders a template based on the specified URI (static method). + * @param href The URI from which to load the template. + * @param dataContext The object to use for default data binding. + * @param container The element to which to add this rendered template. If this parameter is omitted, a new DIV is created. + * @returns A promise that is completed after binding has finished. The value is either the object in the container parameter or the created DIV. + **/ + value(href: string, dataContext: any, container?: HTMLElement): Promise; + }; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the default binding initializer for the template. + **/ + bindingInitializer: any; + + /** + * Gets or sets a value that specifies whether a debug break is inserted into the first rendering of each template. This property only has an effect when the app is in debug mode. + **/ + debugBreakOnRender: boolean; + + /** + * This property is deprecated and might not be available in future versions of the WinJS. Gets or sets a value that specifies whether optimized template processing has been disabled. + **/ + disableOptimizedProcessing: boolean; + + /** + * Gets the DOM element that is used as the template. + **/ + element: HTMLElement; + + /** + * Gets a value that specifies whether templates should be instantiated without the creation of an additional child element. + **/ + extractChild: boolean; + + /** + * Determines whether the Template contains declarative controls that must be processed separately. This property is always true. The controls that belong to a Template object's children are instantiated when a Template instance is rendered. + **/ + isDeclarativeControlContainer: boolean; + + //#endregion Properties + + } + + //#endregion Objects + + //#region Functions + + /** + * Adds a CSS class from the specified path of the source object to a destination object. + * @param source The source object that has the class to copy. + * @param sourceProperties The path on the source object to the source class. + * @param dest The destination object. + **/ + function addClassOneTime(source: any, sourceProperties: any[], dest: HTMLElement): void; + + /** + * Returns an observable object. This may be an observable proxy for the specified object, an existing proxy, or the specified object itself if it directly supports observation. + * @param data The object to observe. + * @returns The observable object. + **/ + function as(data: U): U; + + /** + * Binds to one or more properties on the observable object or or on child values of that object. + * @param observable The object to bind to. + * @param bindingDescriptor An object literal containing the binding declarations. Binding declarations take the form: { propertyName: (function | bindingDeclaration), ... }. + * @returns An object that contains at least a "cancel" field, which is a function that removes all bindings associated with this bind request. + **/ + function bind(observable: any, bindingDescriptor: any): any; + + /** + * Creates a default binding initializer for binding between a source property and a destination property with the specified converter function that is executed on the value of the source property. + * @param convert The conversion function that takes the source property and produces a value that is set to the destination property. This function must be accessible from the global namespace. + * @returns The binding initializer. + **/ + function converter(convert: Function): Function; + + /** + * Creates a one-way binding between the source object and the destination object. Warning Do not attempt to bind data to the ID of an HTML element. + * @param source The source object. + * @param sourceProperties The path on the source object to the source property. + * @param dest The destination object. + * @param destProperties The path on the destination object to the destination property. + * @returns An object with a cancel method that is used to coalesce bindings. + **/ + function defaultBind(source: any, sourceProperties: any, dest: any, destProperties: any): any; + + /** + * Creates a new constructor function that supports observability with the specified set of properties. + * @param data The object to use as the pattern for defining the set of properties. + * @returns A constructor function with 1 optional argument that is the initial state of the properties. + **/ + function define(data: any): Function; + + /** + * Wraps the specified object so that all its properties are instrumented for binding. This is meant to be used in conjunction with the binding mixin. + * @param shape The specification for the bindable object. + * @returns An object with a set of properties all of which are wired for binding. + **/ + function expandProperties(shape: any): any; + + /** + * Marks a custom initializer function as being compatible with declarative data binding. + * @param customInitializer The custom initializer to be marked as compatible with declarative data binding. + * @returns The input customInitializer. + **/ + function initializer(customInitializer: Function): Function; + + /** + * Notifies listeners that a property value was updated. + * @param name The name of the property that is being updated. + * @param newValue The new value for the property. + * @param oldValue The old value for the property. + * @returns A promise that is completed when the notifications are complete. + **/ + function notify(name: string, newValue: string, oldValue: string): Promise; + + /** + * Sets the destination property to the value of the source property. + * @param source The source object. + * @param sourceProperties The path on the source object to the source property. + * @param dest The destination object. + * @param destProperties The path on the destination object to the destination property. + * @returns An object with a cancel method that is used to coalesce bindings. + **/ + function oneTime(source: any, sourceProperties: any, dest: any, destProperties: any): any; + + /** + * Binds the values of an object to the values of a DOM element that has the data-win-bind attribute. If multiple DOM elements are to be bound, you must set the attribute on all of them. See the example below for details. + * @param rootElement Optional. The element at which to start traversing to find elements to bind to. If this parameter is omitted, the entire document is searched. + * @param dataContext The object that contains the values to which the DOM element should be bound. + * @param skipRoot If true, specifies that only the children of rootElement should be bound, otherwise rootElement should be bound as well. + * @param bindingCache The cached binding data. + * @param defaultInitializer The binding initializer to use in the case that one is not specified in a binding expression. If not provided, the behavior is the same as Binding.defaultBind. + * @returns A Promise that completes when every item that contains the data-win-bind attribute has been processed and the update has started. + **/ + function processAll(rootElement?: Element, dataContext?: any, skipRoot?: boolean, bindingCache?: any, defaultInitializer?: Function): Promise; + + /** + * Creates a one-way binding between the source object and an attribute on the destination element. + * @param source The source object. + * @param sourceProperties The path on the source object to the source property. + * @param dest The destination object. + * @param destProperties The path on the destination object to the destination property. This must be a single name. + * @returns An object with a cancel() method that is used to coalesce bindings. + **/ + function setAttribute(source: any, sourceProperties: any[], dest: Element, destProperties: any[]): any; + + /** + * Sets an attribute on the destination element to the value of the source property. + * @param source The source object. + * @param sourceProperties The path on the source object to the source property. + * @param dest The destination object. + * @param destProperties The path on the destination object to the destination property. This must be a single name. + **/ + function setAttributeOneTime(source: any, sourceProperties: any[], dest: Element, destProperties: any[]): void; + + /** + * Returns the original (non-observable) object is returned if the specified object is an observable proxy, + * @param data The object for which to retrieve the original value. + * @returns If the specified object is an observable proxy, the original object is returned, otherwise the same object is returned. + **/ + function unwrap(data: any): any; + + //#endregion Functions + + //#region Interfaces + + interface IKeyDataPair { + key: string; + data: T; + } + + //#endregion Interfaces } /** * Provides helper functions for defining Classes. **/ declare module WinJS.Class { - //#region Functions + //#region Functions - /** - * Defines a class using the given constructor and the specified instance members. - * @param constructor A constructor function that is used to instantiate this type. - * @param instanceMembers The set of instance fields, properties, and methods made available on the type. - * @param staticMembers The set of static fields, properties, and methods made available on the type. - * @returns The newly-defined type. - **/ - function define(constructor: Function, instanceMembers?: any, staticMembers?: any): any; + /** + * Defines a class using the given constructor and the specified instance members. + * @param constructor A constructor function that is used to instantiate this type. + * @param instanceMembers The set of instance fields, properties, and methods made available on the type. + * @param staticMembers The set of static fields, properties, and methods made available on the type. + * @returns The newly-defined type. + **/ + function define(constructor: Function, instanceMembers?: any, staticMembers?: any): any; - /** - * Creates a sub-class based on the specified baseClass parameter, using prototype inheritance. - * @param baseClass The type to inherit from. - * @param constructor A constructor function that is used to instantiate this type. - * @param instanceMembers The set of instance fields, properties, and methods to be made available on the type. - * @param staticMembers The set of static fields, properties, and methods to be made available on the type. - * @returns The newly-defined type. - **/ - function derive(baseClass: any, constructor: Function, instanceMembers?: any, staticMembers?: any): any; + /** + * Creates a sub-class based on the specified baseClass parameter, using prototype inheritance. + * @param baseClass The type to inherit from. + * @param constructor A constructor function that is used to instantiate this type. + * @param instanceMembers The set of instance fields, properties, and methods to be made available on the type. + * @param staticMembers The set of static fields, properties, and methods to be made available on the type. + * @returns The newly-defined type. + **/ + function derive(baseClass: any, constructor: Function, instanceMembers?: any, staticMembers?: any): any; - /** - * Defines a class using the given constructor and the union of the set of instance members specified by all the mixin objects. The mixin parameter list is of variable length. For more information, see Adding functionality with WinJS mixins. - * @param constructor A constructor function that will be used to instantiate this class. - * @param mixin An object declaring the set of instance members. The mixin parameter list is of variable length. - * @returns The newly defined class. - **/ - function mix(constructor: Function, ...mixin: any[]): any; + /** + * Defines a class using the given constructor and the union of the set of instance members specified by all the mixin objects. The mixin parameter list is of variable length. For more information, see Adding functionality with WinJS mixins. + * @param constructor A constructor function that will be used to instantiate this class. + * @param mixin An object declaring the set of instance members. The mixin parameter list is of variable length. + * @returns The newly defined class. + **/ + function mix(constructor: Function, ...mixin: any[]): any; - //#endregion Functions + //#endregion Functions } /** * The WinJS namespace provides special Windows Library for JavaScript functionality, including Promise and xhr. **/ declare module WinJS { - //#region Properties + //#region Properties - /** - * Can be set to show the results of a validation process. - **/ - var validation: boolean; + /** + * Can be set to show the results of a validation process. + **/ + var validation: boolean; - //#endregion Properties + //#endregion Properties - //#region Objects + //#region Objects - /** - * An error object. - **/ - class ErrorFromName { - //#region Constructors + /** + * An error object. + **/ + class ErrorFromName { + //#region Constructors - /** - * Creates an Error object with the specified name and message properties. - * @constructor - * @param name The name of this error. The name is meant to be consumed programmatically and should not be localized. - * @param message The message for this error. The message is meant to be consumed by humans and should be localized. - **/ - constructor(name: string, message?: string); + /** + * Creates an Error object with the specified name and message properties. + * @constructor + * @param name The name of this error. The name is meant to be consumed programmatically and should not be localized. + * @param message The message for this error. The message is meant to be consumed by humans and should be localized. + **/ + constructor(name: string, message?: string); - //#endregion Constructors + //#endregion Constructors - } + } - /** - * Provides a mechanism to schedule work to be done on a value that has not yet been computed. It is an abstraction for managing interactions with asynchronous APIs. For more information about asynchronous programming, see Asynchronous programming. For more information about promises in JavaScript, see Asynchronous programming in JavaScript. For more information about using promises, see the WinJS Promise sample. - **/ - class Promise implements Windows.Foundation.IPromise { - //#region Constructors + /** + * Provides a mechanism to schedule work to be done on a value that has not yet been computed. It is an abstraction for managing interactions with asynchronous APIs. For more information about asynchronous programming, see Asynchronous programming. For more information about promises in JavaScript, see Asynchronous programming in JavaScript. For more information about using promises, see the WinJS Promise sample. + **/ + class Promise { + //#region Constructors - /** - * A promise provides a mechanism to schedule work to be done on a value that has not yet been computed. It is a convenient abstraction for managing interactions with asynchronous APIs. For more information about asynchronous programming, see Asynchronous programming. For more information about promises in JavaScript, see Asynchronous programming in JavaScript. For more information about using promises, see the WinJS Promise sample. - * @constructor - * @param init The function that is called during construction of the Promise that contains the implementation of the operation that the Promise will represent. This can be synchronous or asynchronous, depending on the nature of the operation. Note that placing code within this function does not automatically run it asynchronously; that must be done explicitly with other asynchronous APIs such as setImmediate, setTimeout, requestAnimationFrame, and the Windows Runtime asynchronous APIs. The init function is given three arguments: completeDispatch, errorDispatch, progressDispatch. This parameter is optional. - * @param onCancel The function to call if a consumer of this promise wants to cancel its undone work. Promises are not required to support cancellation. - **/ - constructor(init?: (completeDispatch: any, errorDispatch: any, progressDispatch: any) => void, onCancel?: Function); + /** + * A promise provides a mechanism to schedule work to be done on a value that has not yet been computed. It is a convenient abstraction for managing interactions with asynchronous APIs. For more information about asynchronous programming, see Asynchronous programming. For more information about promises in JavaScript, see Asynchronous programming in JavaScript. For more information about using promises, see the WinJS Promise sample. + * @constructor + * @param init The function that is called during construction of the Promise that contains the implementation of the operation that the Promise will represent. This can be synchronous or asynchronous, depending on the nature of the operation. Note that placing code within this function does not automatically run it asynchronously; that must be done explicitly with other asynchronous APIs such as setImmediate, setTimeout, requestAnimationFrame, and the Windows Runtime asynchronous APIs. The init function is given three arguments: completeDispatch, errorDispatch, progressDispatch. This parameter is optional. + * @param onCancel The function to call if a consumer of this promise wants to cancel its undone work. Promises are not required to support cancellation. + **/ + constructor(init?: (completeDispatch: any, errorDispatch: any, progressDispatch: any) => void, onCancel?: Function); - //#endregion Constructors + //#endregion Constructors - //#region Events + //#region Events - /** - * Occurs when there is an error in processing a promise. - * @param eventInfo An object that contains information about the event. - **/ - onerror(eventInfo: CustomEvent): void; + /** + * Occurs when there is an error in processing a promise. + * @param eventInfo An object that contains information about the event. + **/ + onerror(eventInfo: CustomEvent): void; - //#endregion Events + //#endregion Events - //#region Methods + //#region Methods - /** - * Adds an event listener for the promise. - * @param type The type (name) of the event. - * @param listener The listener to invoke when the event is raised. - * @param capture true to initiate capture, otherwise false. - **/ - addEventListener(type: string, listener: Function, capture?: boolean): void; + /** + * Adds an event listener for the promise. + * @param type The type (name) of the event. + * @param listener The listener to invoke when the event is raised. + * @param capture true to initiate capture, otherwise false. + **/ + addEventListener(type: string, listener: Function, capture?: boolean): void; - /** - * Returns a promise that is fulfilled when one of the input promises has been fulfilled. - * @param value An array that contains Promise objects or objects whose property values include Promise objects. - * @returns A promise that on fulfillment yields the value of the input (complete or error). - **/ - static any(value: Promise[]): Promise; + /** + * Returns a promise that is fulfilled when one of the input promises has been fulfilled. + * @param value An array that contains Promise objects or objects whose property values include Promise objects. + * @returns A promise that on fulfillment yields the value of the input (complete or error). + **/ + static any(value: Promise[]): Promise; - /** - * Returns a promise. If the object is already a Promise it is returned; otherwise the object is wrapped in a Promise. You can use this function when you need to treat a non-Promise object like a Promise, for example when you are calling a function that expects a promise, but already have the value needed rather than needing to get it asynchronously. - * @param value The value to be treated as a Promise. - * @returns The promise. - **/ - static as(value: U): Promise; + /** + * Returns a promise. If the object is already a Promise it is returned; otherwise the object is wrapped in a Promise. You can use this function when you need to treat a non-Promise object like a Promise, for example when you are calling a function that expects a promise, but already have the value needed rather than needing to get it asynchronously. + * @param value The value to be treated as a Promise. + * @returns The promise. + **/ + static as(value: U): Promise; - /** - * Attempts to cancel the fulfillment of a promised value. If the promise hasn't already been fulfilled and cancellation is supported, the promise enters the error state with a value of Error("Canceled"). - **/ - cancel(): void; + /** + * Attempts to cancel the fulfillment of a promised value. If the promise hasn't already been fulfilled and cancellation is supported, the promise enters the error state with a value of Error("Canceled"). + **/ + cancel(): void; - /** - * Raises an event of the specified type and properties. - * @param type The type (name) of the event. - * @param details The set of additional properties to be attached to the event object. - * @returns true if preventDefault was called on the event; otherwise, false. - **/ - dispatchEvent(type: string, details: any): boolean; + /** + * Raises an event of the specified type and properties. + * @param type The type (name) of the event. + * @param details The set of additional properties to be attached to the event object. + * @returns true if preventDefault was called on the event; otherwise, false. + **/ + dispatchEvent(type: string, details: any): boolean; - /** - * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. After the handlers have finished executing, this function throws any error that would have been returned from then as a promise in the error state. For more information about the differences between then and done, see the following topics: Quickstart: using promises in JavaScript How to handle errors when using promises in JavaScript Chaining promises in JavaScript. - * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The fulfilled value is passed as the single argument. If the value is null, the fulfilled value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while executing the function, the promise returned by then moves into the error state. - * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. If it is null, the error is forwarded. The value returned from the function is the fulfilled value of the promise returned by then. - * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. - **/ - done(onComplete?: (value: T) => any, onError?: (error: any) => any, onProgress?: (progress: any) => void): void; + /** + * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. After the handlers have finished executing, this function throws any error that would have been returned from then as a promise in the error state. For more information about the differences between then and done, see the following topics: Quickstart: using promises in JavaScript How to handle errors when using promises in JavaScript Chaining promises in JavaScript. + * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The fulfilled value is passed as the single argument. If the value is null, the fulfilled value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while executing the function, the promise returned by then moves into the error state. + * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. If it is null, the error is forwarded. The value returned from the function is the fulfilled value of the promise returned by then. + * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. + **/ + done(onComplete?: (value: T) => any, onError?: (error: any) => any, onProgress?: (progress: any) => void): void; - /** - * Determines whether a value fulfills the promise contract. - * @param value A value that may be a promise. - * @returns true if the object conforms to the promise contract (has a then function), otherwise false. - **/ - static is(value: any): boolean; + /** + * Determines whether a value fulfills the promise contract. + * @param value A value that may be a promise. + * @returns true if the object conforms to the promise contract (has a then function), otherwise false. + **/ + static is(value: any): boolean; - /** - * Creates a Promise that is fulfilled when all the values are fulfilled. - * @param values An object whose members contain values, some of which may be promises. - * @returns A Promise whose value is an object with the same field names as those of the object in the values parameter, where each field value is the fulfilled value of a promise. - **/ - static join(values: any): Promise; + /** + * Creates a Promise that is fulfilled when all the values are fulfilled. + * @param values An object whose members contain values, some of which may be promises. + * @returns A Promise whose value is an object with the same field names as those of the object in the values parameter, where each field value is the fulfilled value of a promise. + **/ + static join(values: any): Promise; - /** - * Removes an event listener from the control. - * @param eventType The type (name) of the event. - * @param listener The listener to remove. - * @param capture Specifies whether or not to initiate capture. - **/ - removeEventListener(eventType: string, listener: Function, capture?: boolean): void; + /** + * Removes an event listener from the control. + * @param eventType The type (name) of the event. + * @param listener The listener to remove. + * @param capture Specifies whether or not to initiate capture. + **/ + removeEventListener(eventType: string, listener: Function, capture?: boolean): void; - /** - * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. For more information about the differences between then and done, see the following topics: Quickstart: using promises in JavaScript How to handle errors when using promises in JavaScript Chaining promises in JavaScript. - * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The value is passed as the single argument. If the value is null, the value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while this function is being executed, the promise returned by then moves into the error state. - * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. In different cases this object may be of different types, so it is necessary to test the object for the properties you expect. If the error is null, it is forwarded. The value returned from the function becomes the value of the promise returned by the then function. - * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. - * @returns The promise whose value is the result of executing the onComplete function. - **/ - then(onComplete?: (value: T) => Windows.Foundation.IPromise, onError?: (error: any) => Windows.Foundation.IPromise, onProgress?: (progress: any) => void): Windows.Foundation.IPromise; + /** + * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. For more information about the differences between then and done, see the following topics: Quickstart: using promises in JavaScript How to handle errors when using promises in JavaScript Chaining promises in JavaScript. + * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The value is passed as the single argument. If the value is null, the value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while this function is being executed, the promise returned by then moves into the error state. + * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. In different cases this object may be of different types, so it is necessary to test the object for the properties you expect. If the error is null, it is forwarded. The value returned from the function becomes the value of the promise returned by the then function. + * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. + * @returns The promise whose value is the result of executing the onComplete function. + **/ + then(onComplete?: (value: T) => Promise, onError?: (error: any) => Promise, onProgress?: (progress: any) => void): Promise; - /** - * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. For more information about the differences between then and done, see the following topics: Quickstart: using promises in JavaScript How to handle errors when using promises in JavaScript Chaining promises in JavaScript. - * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The value is passed as the single argument. If the value is null, the value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while this function is being executed, the promise returned by then moves into the error state. - * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. In different cases this object may be of different types, so it is necessary to test the object for the properties you expect. If the error is null, it is forwarded. The value returned from the function becomes the value of the promise returned by the then function. - * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. - * @returns The promise whose value is the result of executing the onComplete function. - **/ - then(onComplete?: (value: T) => Windows.Foundation.IPromise, onError?: (error: any) => U, onProgress?: (progress: any) => void): Windows.Foundation.IPromise; + /** + * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. For more information about the differences between then and done, see the following topics: Quickstart: using promises in JavaScript How to handle errors when using promises in JavaScript Chaining promises in JavaScript. + * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The value is passed as the single argument. If the value is null, the value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while this function is being executed, the promise returned by then moves into the error state. + * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. In different cases this object may be of different types, so it is necessary to test the object for the properties you expect. If the error is null, it is forwarded. The value returned from the function becomes the value of the promise returned by the then function. + * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. + * @returns The promise whose value is the result of executing the onComplete function. + **/ + then(onComplete?: (value: T) => Promise, onError?: (error: any) => U, onProgress?: (progress: any) => void): Promise; - /** - * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. For more information about the differences between then and done, see the following topics: Quickstart: using promises in JavaScript How to handle errors when using promises in JavaScript Chaining promises in JavaScript. - * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The value is passed as the single argument. If the value is null, the value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while this function is being executed, the promise returned by then moves into the error state. - * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. In different cases this object may be of different types, so it is necessary to test the object for the properties you expect. If the error is null, it is forwarded. The value returned from the function becomes the value of the promise returned by the then function. - * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. - * @returns The promise whose value is the result of executing the onComplete function. - **/ - then(onComplete?: (value: T) => U, onError?: (error: any) => Windows.Foundation.IPromise, onProgress?: (progress: any) => void): Windows.Foundation.IPromise; + /** + * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. For more information about the differences between then and done, see the following topics: Quickstart: using promises in JavaScript How to handle errors when using promises in JavaScript Chaining promises in JavaScript. + * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The value is passed as the single argument. If the value is null, the value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while this function is being executed, the promise returned by then moves into the error state. + * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. In different cases this object may be of different types, so it is necessary to test the object for the properties you expect. If the error is null, it is forwarded. The value returned from the function becomes the value of the promise returned by the then function. + * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. + * @returns The promise whose value is the result of executing the onComplete function. + **/ + then(onComplete?: (value: T) => U, onError?: (error: any) => Promise, onProgress?: (progress: any) => void): Promise; - /** - * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. For more information about the differences between then and done, see the following topics: Quickstart: using promises in JavaScript How to handle errors when using promises in JavaScript Chaining promises in JavaScript. - * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The value is passed as the single argument. If the value is null, the value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while this function is being executed, the promise returned by then moves into the error state. - * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. In different cases this object may be of different types, so it is necessary to test the object for the properties you expect. If the error is null, it is forwarded. The value returned from the function becomes the value of the promise returned by the then function. - * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. - * @returns The promise whose value is the result of executing the onComplete function. - **/ - then(onComplete?: (value: T) => U, onError?: (error: any) => U, onProgress?: (progress: any) => void): Windows.Foundation.IPromise; + /** + * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. For more information about the differences between then and done, see the following topics: Quickstart: using promises in JavaScript How to handle errors when using promises in JavaScript Chaining promises in JavaScript. + * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The value is passed as the single argument. If the value is null, the value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while this function is being executed, the promise returned by then moves into the error state. + * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. In different cases this object may be of different types, so it is necessary to test the object for the properties you expect. If the error is null, it is forwarded. The value returned from the function becomes the value of the promise returned by the then function. + * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. + * @returns The promise whose value is the result of executing the onComplete function. + **/ + then(onComplete?: (value: T) => U, onError?: (error: any) => U, onProgress?: (progress: any) => void): Promise; - /** - * Performs an operation on all the input promises and returns a promise that has the shape of the input and contains the result of the operation that has been performed on each input. - * @param values A set of values (which could be either an array or an object) of which some or all are promises.. - * @param complete The function to be called if the promise is fulfilled with a value. This function takes a single argument, which is the fulfilled value of the promise. - * @param error The function to be called if the promise is fulfilled with an error. This function takes a single argument, which is the error value of the promise. - * @param progress The function to be called if the promise reports progress. This function takes a single argument, which is the data about the progress of the promise. Promises are not required to support progress. - * @returns A Promise that is the result of calling join on the values parameter. - **/ - static thenEach(values: any, complete?: (value: any) => void, error?: (error: any) => void, progress?: (progress: any) => void): Promise; + /** + * Performs an operation on all the input promises and returns a promise that has the shape of the input and contains the result of the operation that has been performed on each input. + * @param values A set of values (which could be either an array or an object) of which some or all are promises.. + * @param complete The function to be called if the promise is fulfilled with a value. This function takes a single argument, which is the fulfilled value of the promise. + * @param error The function to be called if the promise is fulfilled with an error. This function takes a single argument, which is the error value of the promise. + * @param progress The function to be called if the promise reports progress. This function takes a single argument, which is the data about the progress of the promise. Promises are not required to support progress. + * @returns A Promise that is the result of calling join on the values parameter. + **/ + static thenEach(values: any, complete?: (value: any) => void, error?: (error: any) => void, progress?: (progress: any) => void): Promise; - /** - * This method has two forms: WinJS.Promise.timeout(timeout) and WinJS.Promise.timeout(timeout, promise). WinJS.Promise.timeout(timeout) creates a promise that is completed asynchronously after the specified timeout, essentially wrapping a call to setTimeout within a promise. WinJS.Promise.timeout(timeout, promise) sets a timeout period for completion of the specified promise, automatically canceling the promise if it is not completed within the timeout period. - * @param timeout The timeout period in milliseconds. If this value is zero or not specified, msSetImmediate is called, otherwise setTimeout is called. - * @param promise Optional. A promise that will be canceled if it doesn't complete within the timeout period. - * @returns If the promise parameter is omitted, returns a promise that will be fulfilled after the timeout period. If the promise paramater is provided, the same promise is returned. - **/ - static timeout(timeout: number, promise?: Promise): Promise; + /** + * This method has two forms: WinJS.Promise.timeout(timeout) and WinJS.Promise.timeout(timeout, promise). WinJS.Promise.timeout(timeout) creates a promise that is completed asynchronously after the specified timeout, essentially wrapping a call to setTimeout within a promise. WinJS.Promise.timeout(timeout, promise) sets a timeout period for completion of the specified promise, automatically canceling the promise if it is not completed within the timeout period. + * @param timeout The timeout period in milliseconds. If this value is zero or not specified, msSetImmediate is called, otherwise setTimeout is called. + * @param promise Optional. A promise that will be canceled if it doesn't complete within the timeout period. + * @returns If the promise parameter is omitted, returns a promise that will be fulfilled after the timeout period. If the promise paramater is provided, the same promise is returned. + **/ + static timeout(timeout: number, promise?: Promise): Promise; - /** - * Wraps a non-promise value in a promise. This method is like wrapError, which allows you to produce a Promise in error conditions, in that it allows you to return a Promise in success conditions. - * @param value Some non-promise value to be wrapped in a promise. - * @returns A promise that is successfully fulfilled with the specified value. - **/ - static wrap(value: U): Promise; + /** + * Wraps a non-promise value in a promise. This method is like wrapError, which allows you to produce a Promise in error conditions, in that it allows you to return a Promise in success conditions. + * @param value Some non-promise value to be wrapped in a promise. + * @returns A promise that is successfully fulfilled with the specified value. + **/ + static wrap(value: U): Promise; - /** - * Wraps a non-promise error value in a promise. You can use this function if you need to pass an error to a function that requires a promise. - * @param error A non-promise error value to be wrapped in a promise. - * @returns A promise that is in an error state with the specified value. - **/ - static wrapError(error: U): Promise; + /** + * Wraps a non-promise error value in a promise. You can use this function if you need to pass an error to a function that requires a promise. + * @param error A non-promise error value to be wrapped in a promise. + * @returns A promise that is in an error state with the specified value. + **/ + static wrapError(error: U): Promise; - //#endregion Methods + //#endregion Methods - } + } - //#endregion Objects + //#endregion Objects - //#region Functions + //#region Functions - /** - * You can provide an implementation of this method yourself, or use WinJS.Utilities.startLog to create one that logs to the JavaScript console. - * @param message The message to log. - * @param tags The tag or tags to categorize the message (winjs, winjs controls, etc.). - * @param type The type of message (error, warning, info, etc.). - **/ - function log(message: string, tags: string, type: string): void; + /** + * You can provide an implementation of this method yourself, or use WinJS.Utilities.startLog to create one that logs to the JavaScript console. + * @param message The message to log. + * @param tags The tag or tags to categorize the message (winjs, winjs controls, etc.). + * @param type The type of message (error, warning, info, etc.). + **/ + function log(message: string, tags: string, type: string): void; - /** - * This method has been deprecated. Strict processing is always on; you don't have to call this method to turn it on. - **/ - function strictProcessing(): void; + /** + * This method has been deprecated. Strict processing is always on; you don't have to call this method to turn it on. + **/ + function strictProcessing(): void; - /** - * Wraps calls to XMLHttpRequest in a promise. - * @param options The options that are applied to the XMLHttpRequest object, as follows: type, url, user, password, responseType, headers, data, customRequestInitializer. - * @returns A promise that returns the XMLHttpRequest object when it completes. - **/ - function xhr(options: IXHROptions): Promise; + /** + * Wraps calls to XMLHttpRequest in a promise. + * @param options The options that are applied to the XMLHttpRequest object, as follows: type, url, user, password, responseType, headers, data, customRequestInitializer. + * @returns A promise that returns the XMLHttpRequest object when it completes. + **/ + function xhr(options: IXHROptions): Promise; - //#endregion Functions + //#endregion Functions - //#region Interfaces + //#region Interfaces - interface IXHROptions { - type?: string; - url: string; - user?: string; - password?: string; - headers?: any; - data: any; - responseType?: string; - } + interface IXHROptions { + type?: string; + url: string; + user?: string; + password?: string; + headers?: any; + data: any; + responseType?: string; + } - //#endregion Interfaces + //#endregion Interfaces } /** * Provides helper functions for defining namespaces. For more information, see Organizing your code with WinJS.Namespace. **/ declare module WinJS.Namespace { - //#region Functions + //#region Functions - /** - * Defines a new namespace with the specified name. For more information, see Organizing your code with WinJS.Namespace. - * @param name The name of the namespace. This could be a dot-separated name for nested namespaces. - * @param members The members of the new namespace. - * @returns The newly-defined namespace. - **/ - function define(name?: string, members?: any): any; + /** + * Defines a new namespace with the specified name. For more information, see Organizing your code with WinJS.Namespace. + * @param name The name of the namespace. This could be a dot-separated name for nested namespaces. + * @param members The members of the new namespace. + * @returns The newly-defined namespace. + **/ + function define(name?: string, members?: any): any; - /** - * Defines a new namespace with the specified name under the specified parent namespace. For more information, see Organizing your code with WinJS.Namespace. - * @param parentNamespace The parent namespace. - * @param name The name of the new namespace. - * @param members The members of the new namespace. - * @returns The newly-defined namespace. - **/ - function defineWithParent(parentNamespace?: any, name?: string, members?: any): any; + /** + * Defines a new namespace with the specified name under the specified parent namespace. For more information, see Organizing your code with WinJS.Namespace. + * @param parentNamespace The parent namespace. + * @param name The name of the new namespace. + * @param members The members of the new namespace. + * @returns The newly-defined namespace. + **/ + function defineWithParent(parentNamespace?: any, name?: string, members?: any): any; - //#endregion Functions + //#endregion Functions } /** * Provides functionality for dealing with basic navigation, including the navigation stack. **/ declare module WinJS.Navigation { - //#region Properties + //#region Properties - /** - * Determines whether it is possible to navigate backwards. - **/ - var canGoBack: boolean; + /** + * Determines whether it is possible to navigate backwards. + **/ + var canGoBack: boolean; - /** - * Determines if it is possible to navigate forwards. - **/ - var canGoForward: boolean; + /** + * Determines if it is possible to navigate forwards. + **/ + var canGoForward: boolean; - /** - * Gets or sets the navigation history. - **/ - var history: any; + /** + * Gets or sets the navigation history. + **/ + var history: any; - /** - * Gets or sets the current location. - **/ - var location: string; + /** + * Gets or sets the current location. + **/ + var location: string; - /** - * Gets or sets a user-defined object that represents the state associated with the current location. - **/ - var state: any; + /** + * Gets or sets a user-defined object that represents the state associated with the current location. + **/ + var state: any; - //#endregion Properties + //#endregion Properties - //#region Functions + //#region Functions - /** - * Adds an event listener to the control. - * @param eventType The type (name) of the event. - * @param listener The listener to invoke when the event gets raised. - * @param capture If true, specifies that capture should be initiated, otherwise false. - **/ - function addEventListener(eventType: string, listener: Function, capture?: boolean): void; + /** + * Adds an event listener to the control. + * @param eventType The type (name) of the event. + * @param listener The listener to invoke when the event gets raised. + * @param capture If true, specifies that capture should be initiated, otherwise false. + **/ + function addEventListener(eventType: string, listener: Function, capture?: boolean): void; - /** - * Navigates backwards. - * @param distance The number of entries to go back into the history. - * @returns A promise that is completed with a value that indicates whether or not the navigation was successful. - **/ - function back(distance?: number): Promise; + /** + * Navigates backwards. + * @param distance The number of entries to go back into the history. + * @returns A promise that is completed with a value that indicates whether or not the navigation was successful. + **/ + function back(distance?: number): Promise; - /** - * Navigates forwards. - * @param distance The number of entries to go forward. - * @returns A promise that is completed with a value that indicates whether or not the navigation was successful. - **/ - function forward(distance?: number): Promise; + /** + * Navigates forwards. + * @param distance The number of entries to go forward. + * @returns A promise that is completed with a value that indicates whether or not the navigation was successful. + **/ + function forward(distance?: number): Promise; - /** - * Navigates to a location. - * @param location The location to navigate to. Generally the location is a string containing the URL, but it may be anything. - * @param initialState A user-defined object that represents the navigation state that may be accessed through state. - * @returns A promise that is completed with a value that indicates whether or not the navigation was successful (true if successful, otherwise false). - **/ - function navigate(location: any, initialState?: any): Promise; + /** + * Navigates to a location. + * @param location The location to navigate to. Generally the location is a string containing the URL, but it may be anything. + * @param initialState A user-defined object that represents the navigation state that may be accessed through state. + * @returns A promise that is completed with a value that indicates whether or not the navigation was successful (true if successful, otherwise false). + **/ + function navigate(location: any, initialState?: any): Promise; - /** - * Removes an event listener from the control. - * @param eventType The type (name) of the event. - * @param listener The listener to remove. - * @param useCapture Specifies whether or not to initiate capture. - **/ - function removeEventListener(eventType: string, listener: Function, useCapture?: boolean): void; + /** + * Removes an event listener from the control. + * @param eventType The type (name) of the event. + * @param listener The listener to remove. + * @param useCapture Specifies whether or not to initiate capture. + **/ + function removeEventListener(eventType: string, listener: Function, useCapture?: boolean): void; - //#endregion Functions + //#endregion Functions - //#region Events + //#region Events - /** - * Occurs before navigation. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: location, state. - **/ - function onbeforenavigate(eventInfo: CustomEvent): void; + /** + * Occurs before navigation. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: location, state. + **/ + function onbeforenavigate(eventInfo: CustomEvent): void; - /** - * Occurs after navigation has taken place. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: location, state. - **/ - function onnavigated(eventInfo: CustomEvent): void; + /** + * Occurs after navigation has taken place. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: location, state. + **/ + function onnavigated(eventInfo: CustomEvent): void; - /** - * Occurs when navigation is taking place. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: location, state. - **/ - function onnavigating(eventInfo: CustomEvent): void; + /** + * Occurs when navigation is taking place. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: location, state. + **/ + function onnavigating(eventInfo: CustomEvent): void; - //#endregion Events + //#endregion Events } /** * Provides functions for accessing resources and localizing content. **/ declare module WinJS.Resources { - //#region Functions + //#region Functions - /** - * Registers an event handler for the specified event. Use this method to register for events that are related to resources, such as when the app's language, scale, or contrast changes. - * @param type The name of the event to handle. - * @param listener The listener (event handler function) to associate with the event. - * @param useCapture Set to true to register the listener for the capturing phase; otherwise, set to false to register the listener for the bubbling phase. - **/ - function addEventListener(type: string, listener: Function, useCapture?: boolean): void; + /** + * Registers an event handler for the specified event. Use this method to register for events that are related to resources, such as when the app's language, scale, or contrast changes. + * @param type The name of the event to handle. + * @param listener The listener (event handler function) to associate with the event. + * @param useCapture Set to true to register the listener for the capturing phase; otherwise, set to false to register the listener for the bubbling phase. + **/ + function addEventListener(type: string, listener: Function, useCapture?: boolean): void; - /** - * Raises an event of the specified type and with the specified additional properties. - * @param type The name of the event to raise. - * @param details The set of additional properties to attach to the event object. - **/ - function dispatchEvent(type: string, details: any): void; + /** + * Raises an event of the specified type and with the specified additional properties. + * @param type The name of the event to raise. + * @param details The set of additional properties to attach to the event object. + **/ + function dispatchEvent(type: string, details: any): void; - /** - * Retrieves the resource string that has the specified resource identifier. - * @param resourceId The resource ID of the string to retrieve. - * @returns An object that can contain these properties: value, empty, lang. - **/ - function getString(resourceId: string): { value: string; empty?: boolean; lang?: string; }; + /** + * Retrieves the resource string that has the specified resource identifier. + * @param resourceId The resource ID of the string to retrieve. + * @returns An object that can contain these properties: value, empty, lang. + **/ + function getString(resourceId: string): { value: string; empty?: boolean; lang?: string; }; - /** - * Processes data-win-res attributes on elements and replaces attributes and properties with resource strings. - * @param rootElement The element to process. The element and its child elements will be processed. If an element isn't specified, the entire document is processed. - **/ - function processAll(rootElement?: HTMLElement): void; + /** + * Processes data-win-res attributes on elements and replaces attributes and properties with resource strings. + * @param rootElement The element to process. The element and its child elements will be processed. If an element isn't specified, the entire document is processed. + **/ + function processAll(rootElement?: HTMLElement): void; - /** - * Removes an event listener that the addEventListener method registered. - * @param type The name of the event that the event listener is registered for. - * @param listener The listener (event handler function) to remove. - * @param useCapture Set to true to remove the capturing phase listener; set to false to remove the bubbling phase listener. - **/ - function removeEventListener(type: string, listener: Function, useCapture?: boolean): void; + /** + * Removes an event listener that the addEventListener method registered. + * @param type The name of the event that the event listener is registered for. + * @param listener The listener (event handler function) to remove. + * @param useCapture Set to true to remove the capturing phase listener; set to false to remove the bubbling phase listener. + **/ + function removeEventListener(type: string, listener: Function, useCapture?: boolean): void; - //#endregion Functions + //#endregion Functions - //#region Events + //#region Events - /** - * Occurs when the user changes the system's language or contrast, or the scale of the display, or when the user changes any of the items in the current context's qualifier values list. For more info about the current context's qualifier values list, see the Remarks section. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.qualifier, detail.changed. - **/ - function oncontextchanged(eventInfo: CustomEvent): void; + /** + * Occurs when the user changes the system's language or contrast, or the scale of the display, or when the user changes any of the items in the current context's qualifier values list. For more info about the current context's qualifier values list, see the Remarks section. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.qualifier, detail.changed. + **/ + function oncontextchanged(eventInfo: CustomEvent): void; - //#endregion Events + //#endregion Events } /** * Provides access to the Windows animations. These functions provide developers with the ability to use animations in their custom controls that are consistent with animations used by Windows controls. **/ declare module WinJS.UI.Animation { - //#region Functions + //#region Functions - /** - * Creates an object that performs an animation that adds an item or items to a list. - * @param added Element or elements to add to the list. - * @param affected Element or elements affected by the added items. - * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. - **/ - function createAddToListAnimation(added: any, affected: any): IAnimationMethodResponse; + /** + * Creates an object that performs an animation that adds an item or items to a list. + * @param added Element or elements to add to the list. + * @param affected Element or elements affected by the added items. + * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. + **/ + function createAddToListAnimation(added: any, affected: any): IAnimationMethodResponse; - /** - * Creates an object that performs an animation that adds an item or items to a list of search results. - * @param added Element or elements to add to the list. - * @param affected Element or elements affected by the added items. - * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. - **/ - function createAddToSearchListAnimation(added: any, affected: any): IAnimationMethodResponse; + /** + * Creates an object that performs an animation that adds an item or items to a list of search results. + * @param added Element or elements to add to the list. + * @param affected Element or elements affected by the added items. + * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. + **/ + function createAddToSearchListAnimation(added: any, affected: any): IAnimationMethodResponse; - /** - * Creates an object that performs an animation that collapses a list. - * @param hidden Element or elements hidden as a result of the collapse. - * @param affected Element or elements affected by the hidden items. - * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. - **/ - function createCollapseAnimation(hidden: any, affected: any): IAnimationMethodResponse; + /** + * Creates an object that performs an animation that collapses a list. + * @param hidden Element or elements hidden as a result of the collapse. + * @param affected Element or elements affected by the hidden items. + * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. + **/ + function createCollapseAnimation(hidden: any, affected: any): IAnimationMethodResponse; - /** - * Creates an object that performs an animation that removes an item or items from a list. - * @param deleted Element or elements to delete from the list. - * @param remaining Element or elements affected by the removal of the deleted items. - * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. - **/ - function createDeleteFromListAnimation(deleted: any, remaining: any): IAnimationMethodResponse; + /** + * Creates an object that performs an animation that removes an item or items from a list. + * @param deleted Element or elements to delete from the list. + * @param remaining Element or elements affected by the removal of the deleted items. + * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. + **/ + function createDeleteFromListAnimation(deleted: any, remaining: any): IAnimationMethodResponse; - /** - * Creates an object that performs an animation that removes an item or items from a list of search results. - * @param deleted Element or elements to delete from the list. - * @param remaining Element or elements affected by the removal of the deleted items. - * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. - **/ - function createDeleteFromSearchListAnimation(deleted: any, remaining: any): IAnimationMethodResponse; + /** + * Creates an object that performs an animation that removes an item or items from a list of search results. + * @param deleted Element or elements to delete from the list. + * @param remaining Element or elements affected by the removal of the deleted items. + * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. + **/ + function createDeleteFromSearchListAnimation(deleted: any, remaining: any): IAnimationMethodResponse; - /** - * Creates an object that performs an animation that expands a list. - * @param revealed Element or elements revealed by the expansion. - * @param affected Element or elements affected by the newly revealed items. - * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. - **/ - function createExpandAnimation(revealed: any, affected: any): IAnimationMethodResponse; + /** + * Creates an object that performs an animation that expands a list. + * @param revealed Element or elements revealed by the expansion. + * @param affected Element or elements affected by the newly revealed items. + * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. + **/ + function createExpandAnimation(revealed: any, affected: any): IAnimationMethodResponse; - /** - * Creates an object that performs a peek animation. - * @param element Element or elements involved in the peek. - * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. - **/ - function createPeekAnimation(element: any): IAnimationMethodResponse; + /** + * Creates an object that performs a peek animation. + * @param element Element or elements involved in the peek. + * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise that completes when the animation is finished. + **/ + function createPeekAnimation(element: any): IAnimationMethodResponse; - /** - * Creates an object that performs an animation that moves an item or items. - * @param element Element or elements involved in the reposition. - * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise object that completes when the animation is finished. - **/ - function createRepositionAnimation(element: any): IAnimationMethodResponse; + /** + * Creates an object that performs an animation that moves an item or items. + * @param element Element or elements involved in the reposition. + * @returns An object whose execute method is used to execute the animation. The execute method returns a Promise object that completes when the animation is finished. + **/ + function createRepositionAnimation(element: any): IAnimationMethodResponse; - /** - * Performs an animation that fades an item or items in, fading out existing items that occupy the same space. - * @param incoming Element or elements being faded in. - * @param outgoing Element or elements being replaced. - * @returns An object that completes when the animation has finished. - **/ - function crossFade(incoming: any, outgoing: any): Promise; + /** + * Performs an animation that fades an item or items in, fading out existing items that occupy the same space. + * @param incoming Element or elements being faded in. + * @param outgoing Element or elements being replaced. + * @returns An object that completes when the animation has finished. + **/ + function crossFade(incoming: any, outgoing: any): Promise; - /** - * Performs an animation when a dragged object is moved such that dropping it in that position would move other items. The potentially affected items are animated out of the way to show where the object would be dropped. - * @param target Element or elements that the dragged object would cause to be moved if it were dropped. - * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @returns An object that completes when the animation is finished. - **/ - function dragBetweenEnter(target: any, offset: any): Promise; + /** + * Performs an animation when a dragged object is moved such that dropping it in that position would move other items. The potentially affected items are animated out of the way to show where the object would be dropped. + * @param target Element or elements that the dragged object would cause to be moved if it were dropped. + * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @returns An object that completes when the animation is finished. + **/ + function dragBetweenEnter(target: any, offset: any): Promise; - /** - * Performs an animation when a dragged object is moved away from items that it had previously involved in a dragBetweenEnter animation. The affected objects are animated back to their original positions. - * @param target Element or elements that the dragged object would no longer cause to be displaced, due to its moving away. This should be the same element or element collection passed as the target parameter in the dragBetweenEnter animation. - * @returns An object that completes when the animation is finished. - **/ - function dragBetweenLeave(target: any): Promise; + /** + * Performs an animation when a dragged object is moved away from items that it had previously involved in a dragBetweenEnter animation. The affected objects are animated back to their original positions. + * @param target Element or elements that the dragged object would no longer cause to be displaced, due to its moving away. This should be the same element or element collection passed as the target parameter in the dragBetweenEnter animation. + * @returns An object that completes when the animation is finished. + **/ + function dragBetweenLeave(target: any): Promise; - /** - * Performs an animation when the user finishes dragging an object. - * @param dragSource Element or elements that were dragged. - * @param offset Initial offset from the drop point. The dropped object begins at the offset and animates to its final position at the drop point. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @param affected Element or elements whose position the dropped object affects. Typically, this is all other items in a reorderable list. This should be the same element or element collection passed as the affected parameter in the dragSourceStart animation. - * @returns An object that completes when the animation is finished. - **/ - function dragSourceEnd(dragSource: any, offset: any, affected?: any): Promise; + /** + * Performs an animation when the user finishes dragging an object. + * @param dragSource Element or elements that were dragged. + * @param offset Initial offset from the drop point. The dropped object begins at the offset and animates to its final position at the drop point. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @param affected Element or elements whose position the dropped object affects. Typically, this is all other items in a reorderable list. This should be the same element or element collection passed as the affected parameter in the dragSourceStart animation. + * @returns An object that completes when the animation is finished. + **/ + function dragSourceEnd(dragSource: any, offset: any, affected?: any): Promise; - /** - * Performs an animation when the user begins to drag an object. - * @param dragSource Element or elements being dragged. - * @param affected Element or elements whose position is affected by the movement of the dragged object. Typically, this is all other items in a reorderable list. - * @returns An object that completes when the animation is finished. - **/ - function dragSourceStart(dragSource: any, affected?: any): Promise; + /** + * Performs an animation when the user begins to drag an object. + * @param dragSource Element or elements being dragged. + * @param affected Element or elements whose position is affected by the movement of the dragged object. Typically, this is all other items in a reorderable list. + * @returns An object that completes when the animation is finished. + **/ + function dragSourceStart(dragSource: any, affected?: any): Promise; - /** - * Performs an animation that displays one or more elements on a page. - * @param incoming Element or elements that compose the incoming content. - * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @param options Optional. Set this value to { mechanism: "transition" } to play the animation using CSS transitions instead of the default CSS animations. In some cases this can result in improved performance. - * @returns An object that completes when the animation is finished. - **/ - function enterContent(incoming: any, offset: any, options?: any): Promise; + /** + * Performs an animation that displays one or more elements on a page. + * @param incoming Element or elements that compose the incoming content. + * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @param options Optional. Set this value to { mechanism: "transition" } to play the animation using CSS transitions instead of the default CSS animations. In some cases this can result in improved performance. + * @returns An object that completes when the animation is finished. + **/ + function enterContent(incoming: any, offset: any, options?: any): Promise; - /** - * Performs an animation that shows a new page of content, either when transitioning between pages in a running app or when displaying the first content in a newly launched app. - * @param element Element or an array of elements that represent the content. If element refers to an array of elements, the elements enter in array order. - * @param offset An initial offset where the element or elements begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @returns An object that completes when the animation is finished. - **/ - function enterPage(element: any, offset: any): Promise; + /** + * Performs an animation that shows a new page of content, either when transitioning between pages in a running app or when displaying the first content in a newly launched app. + * @param element Element or an array of elements that represent the content. If element refers to an array of elements, the elements enter in array order. + * @param offset An initial offset where the element or elements begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @returns An object that completes when the animation is finished. + **/ + function enterPage(element: any, offset: any): Promise; - /** - * Performs an animation that hides one or more elements on a page. - * @param outgoing Element or elements that compose the outgoing content. - * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @returns An object that completes when the animation is finished. - **/ - function exitContent(outgoing: any, offset: any): Promise; + /** + * Performs an animation that hides one or more elements on a page. + * @param outgoing Element or elements that compose the outgoing content. + * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @returns An object that completes when the animation is finished. + **/ + function exitContent(outgoing: any, offset: any): Promise; - /** - * Performs an animation that dismisses the current page when transitioning between pages in an app. - * @param outgoing Element or elements that compose the outgoing page. - * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @returns An object that completes when the animation is finished. - **/ - function exitPage(outgoing: any, offset: any): Promise; + /** + * Performs an animation that dismisses the current page when transitioning between pages in an app. + * @param outgoing Element or elements that compose the outgoing page. + * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @returns An object that completes when the animation is finished. + **/ + function exitPage(outgoing: any, offset: any): Promise; - /** - * Performs an animation that fades an item or set of items into view. - * @param shown Element or elements being faded in. - * @returns An object that completes when the animation has finished. Use this object when subsequent actions need this animation to finish before they take place. - **/ - function fadeIn(shown: any): Promise; + /** + * Performs an animation that fades an item or set of items into view. + * @param shown Element or elements being faded in. + * @returns An object that completes when the animation has finished. Use this object when subsequent actions need this animation to finish before they take place. + **/ + function fadeIn(shown: any): Promise; - /** - * Performs an animation that fades an item or set of items out of view. - * @param hidden Element or elements being faded out. - * @returns An object that completes when the animation is finished. - **/ - function fadeOut(hidden: any): Promise; + /** + * Performs an animation that fades an item or set of items out of view. + * @param hidden Element or elements being faded out. + * @returns An object that completes when the animation is finished. + **/ + function fadeOut(hidden: any): Promise; - /** - * Performs an animation that hides edge-based user interface (UI). - * @param element Element or elements that are being hidden. - * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Offsets should be the chosen so that the elements end the animation just off-screen. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @param options Optional. Set this value to { mechanism: "transition" } to play the animation using CSS transitions instead of the default CSS animations. In some cases this can result in improved performance. - * @returns An object that completes when the animation is finished. - **/ - function hideEdgeUI(element: any, offset: any, options?: any): Promise; + /** + * Performs an animation that hides edge-based user interface (UI). + * @param element Element or elements that are being hidden. + * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Offsets should be the chosen so that the elements end the animation just off-screen. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @param options Optional. Set this value to { mechanism: "transition" } to play the animation using CSS transitions instead of the default CSS animations. In some cases this can result in improved performance. + * @returns An object that completes when the animation is finished. + **/ + function hideEdgeUI(element: any, offset: any, options?: any): Promise; - /** - * Performs an animation that hides a panel. - * @param element Element or elements that are being hidden. - * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Offsets should be the chosen so that the elements end the animation just off-screen. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @returns An object that completes when the animation is finished. - **/ - function hidePanel(element: any, offset: any): Promise; + /** + * Performs an animation that hides a panel. + * @param element Element or elements that are being hidden. + * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Offsets should be the chosen so that the elements end the animation just off-screen. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @returns An object that completes when the animation is finished. + **/ + function hidePanel(element: any, offset: any): Promise; - /** - * Performs an animation that removes pop-up user interface (UI). - * @param element Element or elements that are being hidden. - * @returns An object that completes when the animation is finished. - **/ - function hidePopup(element: any): Promise; + /** + * Performs an animation that removes pop-up user interface (UI). + * @param element Element or elements that are being hidden. + * @returns An object that completes when the animation is finished. + **/ + function hidePopup(element: any): Promise; - /** - * Performs an animation when a pointer is pressed on an object. - * @param element Element or elements on which the pointer is pressed. - * @returns An object that completes when the animation is finished. - **/ - function pointerDown(element: any): Promise; + /** + * Performs an animation when a pointer is pressed on an object. + * @param element Element or elements on which the pointer is pressed. + * @returns An object that completes when the animation is finished. + **/ + function pointerDown(element: any): Promise; - /** - * Performs an animation when a pointer is released. - * @param element Element or elements that the pointer was pressed on. - * @returns An object that completes when the animation is finished. - **/ - function pointerUp(element: any): Promise; + /** + * Performs an animation when a pointer is released. + * @param element Element or elements that the pointer was pressed on. + * @returns An object that completes when the animation is finished. + **/ + function pointerUp(element: any): Promise; - /** - * Performs an animation that slides a narrow, edge-based user interface (UI) into view. - * @param element Element or elements that are being shown. - * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Offsets should be the chosen so that the elements begin the animation from just off-screen. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @param options Optional. Set this value to { mechanism: "transition" } to play the animation using CSS transitions instead of the default CSS animations. In some cases this can result in improved performance. - * @returns An object that completes when the animation is finished. - **/ - function showEdgeUI(element: any, offset: any, options?: any): Promise; + /** + * Performs an animation that slides a narrow, edge-based user interface (UI) into view. + * @param element Element or elements that are being shown. + * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Offsets should be the chosen so that the elements begin the animation from just off-screen. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @param options Optional. Set this value to { mechanism: "transition" } to play the animation using CSS transitions instead of the default CSS animations. In some cases this can result in improved performance. + * @returns An object that completes when the animation is finished. + **/ + function showEdgeUI(element: any, offset: any, options?: any): Promise; - /** - * Performs an animation that slides a large panel user interface (UI) into view. - * @param element Element or elements that are being shown. - * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Offsets should be the chosen so that the elements begin the animation from just off-screen. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @returns An object that completes when the animation is finished. - **/ - function showPanel(element: any, offset: any): Promise; + /** + * Performs an animation that slides a large panel user interface (UI) into view. + * @param element Element or elements that are being shown. + * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Offsets should be the chosen so that the elements begin the animation from just off-screen. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @returns An object that completes when the animation is finished. + **/ + function showPanel(element: any, offset: any): Promise; - /** - * Performs an animation that displays a pop-up user interface (UI). - * @param element Element or elements that are being shown. - * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Offsets should be the chosen so that the elements begin the animation from just off-screen. Set this parameter to null to use the recommended default offset. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @returns An object that completes when the animation is finished. - **/ - function showPopup(element: any, offset: any): Promise; + /** + * Performs an animation that displays a pop-up user interface (UI). + * @param element Element or elements that are being shown. + * @param offset Initial offsets where the animated objects begin relative to their final position at the end of the animation. Offsets should be the chosen so that the elements begin the animation from just off-screen. Set this parameter to null to use the recommended default offset. Note When the element parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @returns An object that completes when the animation is finished. + **/ + function showPopup(element: any, offset: any): Promise; - /** - * Performs a deselection animation in response to a swipe interaction. - * @param deselected Element or elements that become unselected. - * @param selection Element or elements that represent the selection, typically a check mark. - * @returns An object that completes when the animation is finished. - **/ - function swipeDeselect(deselected: any, selection: any): Promise; + /** + * Performs a deselection animation in response to a swipe interaction. + * @param deselected Element or elements that become unselected. + * @param selection Element or elements that represent the selection, typically a check mark. + * @returns An object that completes when the animation is finished. + **/ + function swipeDeselect(deselected: any, selection: any): Promise; - /** - * Performs an animation that reveals an item or items in response to a swipe interaction. - * @param target Element or elements being revealed. - * @param offset An initial offset where the animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @returns An object that completes when the animation is finished. - **/ - function swipeReveal(target: any, offset: any): Promise; + /** + * Performs an animation that reveals an item or items in response to a swipe interaction. + * @param target Element or elements being revealed. + * @param offset An initial offset where the animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @returns An object that completes when the animation is finished. + **/ + function swipeReveal(target: any, offset: any): Promise; - /** - * Performs a selection animation in response to a swipe interaction. - * @param selected Element or elements being selected. - * @param selection Element or elements that show that something is selected, typically a check mark. - * @returns An object that completes when the animation is finished. - **/ - function swipeSelect(selected: any, selection: any): Promise; + /** + * Performs a selection animation in response to a swipe interaction. + * @param selected Element or elements being selected. + * @param selection Element or elements that show that something is selected, typically a check mark. + * @returns An object that completes when the animation is finished. + **/ + function swipeSelect(selected: any, selection: any): Promise; - /** - * Performs an animation that updates a badge. - * @param incoming Element or elements that comprise the new badge. - * @param offset Initial offsets where incoming animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. - * @returns An object that completes when the animation is finished. - **/ - function updateBadge(incoming: any, offset: any): Promise; + /** + * Performs an animation that updates a badge. + * @param incoming Element or elements that comprise the new badge. + * @param offset Initial offsets where incoming animated objects begin relative to their final position at the end of the animation. Set this parameter to null to use the recommended default offset. Note When the incoming parameter specifies an array of elements, the offset parameter can specify an offset array with each item specified for its corresponding element array item. If the array of offsets is smaller than the array of elements, the last offset is applied to all remaining elements. + * @returns An object that completes when the animation is finished. + **/ + function updateBadge(incoming: any, offset: any): Promise; - //#endregion Functions + //#endregion Functions - //#region Interfaces + //#region Interfaces - interface IAnimationMethodResponse { - execute(): Promise; - } + interface IAnimationMethodResponse { + execute(): Promise; + } - //#endregion Interfaces + //#endregion Interfaces } /** * Provides controls and objects that manipulate data. **/ declare module WinJS.UI { - //#region Enumerations - - /** - * Specifies an icon that appears in an AppBarCommand object. - **/ - enum AppBarIcon { - previous, - next, - play, - pause, - edit, - save, - clear, - delete, - remove, - add, - cancel, - accept, - more, - redo, - undo, - home, - up, - forward, - right, - back, - left, - favorite, - camera, - settings, - video, - sync, - download, - mail, - find, - help, - upload, - emoji, - twopage, - leavechat, - mailforward, - clock, - send, - crop, - rotatecamera, - people, - closepane, - openpane, - world, - flag, - previewlink, - globe, - trim, - attachcamera, - zoomin, - bookmarks, - document, - protecteddocument, - page, - bullets, - comment, - mail2, - contactinfo, - hangup, - viewall, - mappin, - phone, - videochat, - switch, - contact, - rename, - pin, - musicinfo, - go, - keyboard, - dockleft, - dockright, - dockbottom, - remote, - refresh, - rotate, - shuffle, - list, - shop, - selectall, - orientation, - import, - importall, - browsephotos, - webcam, - pictures, - savelocal, - caption, - stop, - showresults, - volume, - repair, - message, - page2, - calendarday, - calendarweek, - calendar, - characters, - mailreplyall, - read, - link, - accounts, - showbcc, - hidebcc, - cut, - attach, - paste, - filter, - copy, - emoji2, - important, - mailreply, - slideshow, - sort, - manage, - allapps, - disconnectdrive, - mapdrive, - newwindow, - openwith, - contactpresence, - priority, - uploadskydrive, - gototoday, - font, - fontcolor, - contact2, - folder, - audio, - placeholder, - view, - setlockscreen, - settile, - cc, - stopslideshow, - permissions, - highlight, - disableupdates, - unfavorite, - unpin, - openlocal, - mute, - italic, - underline, - bold, - movetofolder, - likedislike, - dislike, - like, - alignright, - aligncenter, - alignleft, - zoom, - zoomout, - openfile, - otheruser, - admin, - street, - map, - clearselection, - fontdecrease, - fontincrease, - fontsize, - cellphone, - reshare, - tag, - repeatone, - repeatall, - outlinestar, - solidstar, - calculator, - directions, - target, - library, - phonebook, - memo, - microphone, - postupdate, - backtowindow, - fullscreen, - newfolder, - calendarreply, - unsyncfolder, - reporthacked, - syncfolder, - blockcontact, - switchapps, - addfriend, - touchpointer, - gotostart, - zerobars, - onebar, - twobars, - threebars, - fourbars, - scan, - preview - } - - /** - * Indicates whether the IListDataAdapter was able to provide a count. - **/ - enum CountResult { - /** - * Indicates no count is available. - **/ - unknown - } - - /** - * Indicates that the IListDataAdapter was unable to provide a count. - **/ - enum CountError { - /** - * An attempt to count items timed out. - **/ - noResponse - } - - /** - * Describes the status of an IListDataSource. - **/ - enum DataSourceStatus { - /** - * The IListDataSource is ready. - **/ - ready, - /** - * The IListDataSource is still loading. - **/ - waiting, - /** - * The IListDataSource failed to load. - **/ - failure - } - - /** - * Specifies the type of error that occurred during an edit operation on a IListDataSource or an IListDataAdapter. - **/ - enum EditError { - /** - * The edit operation timed out. - **/ - noResponse, - /** - * The data source cannot be written to. - **/ - notPermitted, - /** - * The item has changed. - **/ - noLongerMeaningful - } - - /** - * Specifies the type of error encountered when retrieving items from an IListDataAdapter. - **/ - enum FetchError { - /** - * The fetch operation timed out. - **/ - noResponse, - /** - * The specified item could not be located. - **/ - doesNotExist - } - - /** - * Specifies how group headers in a ListView respond to the tap interaction. - **/ - enum GroupHeaderTapBehavior { - /** - * The group is invoked. - **/ - invoke, - /** - * Nothing happens. - **/ - none - } - - /** - * Specifies the position of group headers relative to their items in a ListView. - **/ - enum HeaderPosition { - /** - * Group headers appear to the left of items. - **/ - left, - /** - * Group headers appear above items. - **/ - top - } - - /** - * Specifies that type of animation for which a contentanimating event was raised. - **/ - enum ListViewAnimationType { - /** - * The animation plays when the ListView is first displayed. - **/ - entrance, - /** - * The animation plays when the ListView is changing its content. - **/ - contentTransition - } - - /** - * Describes the type of object in a ListView. - **/ - enum ObjectType { - /** - * The object is a group header in the list. - **/ - groupHeader, - /** - * The object is an item in the list. - **/ - item - } - - /** - * Specifies the orientation of a control. - **/ - enum Orientation { - /** - * A horizontal layout. - **/ - horizontal, - /** - * A vertical layout. - **/ - vertical - } - - /** - * Specifies the selection mode of a ListView. - **/ - enum SelectionMode { - /** - * Items cannot be selected. - **/ - none, - /** - * A single item may be selected. - **/ - single, - /** - * Multiple items may be selected. Clicking additional items adds them to the selection. - **/ - multi - } - - /** - * Specifies whether elements are selected when the user performs a swipe interaction. - **/ - enum SwipeBehavior { - /** - * The swipe interaction selects the elements touched by the swipe. - **/ - select, - /** - * The swipe interaction does not change which elements are selected. - **/ - none - } - - /** - * Specifies how items in a ListView respond to the tap interaction. - **/ - enum TapBehavior { - /** - * The item is selected and invoked. - **/ - directSelect, - /** - * The item is selected if was not already selected, and its deselected if it was already selected. - **/ - toggleSelect, - /** - * The item is invoked but not selected. - **/ - invokeOnly, - /** - * Nothing happens. - **/ - none - } - - //#endregion Enumerations - - //#region Interfaces - - /** - * Contains items that were requested from an IListDataAdapter and provides some information about those items. - **/ - interface IFetchResult { - //#region Properties - - /** - * Gets or sets the index of the requested item in the IListDataAdapter object's data source. - **/ - absoluteIndex: number; - - /** - * Gets or sets a value that indicates whether this IFetchResult contains the last items at the end of the IListDataAdapter object's data source. - **/ - atEnd: boolean; - - /** - * Gets or sets a value that indicates whether this IFetchResult contains the first items at the beginning of the IListDataAdapter object's data source. - **/ - atStart: boolean; - - /** - * Gets or sets the items returned by the fetch operation. - **/ - items: T[]; - - /** - * Gets or sets the location of the requested item within the items array. - **/ - offset: number; - - /** - * Gets or sets the number of items in the IListDataAdapter object's underlying data source. - **/ - totalCount: number; - - //#endregion Properties - - } - - /** - * Represents an item in a list. - **/ - interface IItem { - //#region Properties - - /** - * Gets or sets the item's data. - **/ - data: T; - - /** - * Gets the group key for the item. This property is only available for items that belong to a grouped data source. - **/ - groupKey: string; - - /** - * Gets the temporary ID of the item. - **/ - handle: string; - - /** - * Gets the item's index in the IListDataSource. - **/ - index: number; - - /** - * Gets or sets the key the identifies the item. - **/ - key: string; - - //#endregion Properties - - } - - /** - * Provides a mechanism for retrieving IItem objects asynchronously. - **/ - interface IItemPromise { - //#region Events - - /** - * Occurs when there is an error in processing. - * @param eventInfo An object that contains information about the event. - **/ - onerror(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Attempts to cancel the fulfillment of a promised value. If the promise hasn't already been fulfilled and cancellation is supported, the promise enters the error state with a value of Error("Canceled"). - **/ - cancel(): void; - - /** - * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. After the handlers have finished executing, this function throws any error that would have been returned from then as a promise in the error state. - * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The fulfilled value is passed as the single argument. If the value is null, the fulfilled value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while executing the function, the promise returned by then moves into the error state. - * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. If it is null, the error is forwarded. The value returned from the function is the fulfilled value of the promise returned by then. - * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. - **/ - done(onComplete: (item: T) => void, onError?: (error: Error) => void, onProgress?: (progressData: any) => void): void; - - /** - * Stops change notification tracking for the IItem that fulfills this IItemPromise. - **/ - release(): void; - - /** - * Begins change notification tracking for the IItem that fulfills this IItemPromise. - **/ - retain(): void; - - /** - * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. - * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The value is passed as the single argument. If the value is null, the value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while this function is being executed, the promise returned by then moves into the error state. - * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. If it is null, the error is forwarded. The value returned from the function becomes the fulfilled value of the promise returned by then. - * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. - * @returns The promise whose value is the result of executing the complete or error function. - **/ - then(onComplete: (item: T) => void, onError?: (error: Error) => void, onProgress?: (progressData: any) => void): IItemPromise; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the temporary ID of the IItem that fulfills this promise. - **/ - handle: string; - - /** - * Gets or sets the index of the IItem contained by this IItemPromise. - **/ - index: number; - - //#endregion Properties - - } - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. Represents a layout for the ListView. - **/ - interface ILayout { - //#region Methods - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param beginScrollPosition The first visible pixel in the ListView. For horizontal layouts, this is the x-coordinate of the pixel. For vertical layouts, this is the y-coordinate. - * @param wholeItem true if the item must be completely visible; otherwise, false if its ok for the item to be partially visible. Promise. - * @returns A Promise for the index of the first visible item at the specified point. - **/ - calculateFirstVisible(beginScrollPosition: number, wholeItem: boolean): Promise; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param endScrollPosition The last visible pixel in the ListView. For horizontal layouts, this is the x-coordinate of the pixel. For vertical layouts, this is the y-coordinate. - * @param wholeItem true if the item must be completely visible; otherwise, false if its ok for the item to be partially visible. Promise. - * @returns A Promise for the index of the last visible item at the specified point. - **/ - calculateLastVisible(endScrollPosition: number, wholeItem: boolean): Promise; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @returns A object that has these properties: animationPromise, newEndIndex. - **/ - endLayout(): any; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param itemIndex The index of the item. - * @returns A Promise that returns an object with these properties: left, top, contentWidth, contentHeight, totalWidth, totalHeight. - **/ - getItemPosition(itemIndex: number): Promise; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param itemIndex The data source index of the current item. - * @param element The element for the current item. - * @param keyPressed The key that was pressed. This function must check for the arrow keys (leftArrow, upArrow, rightArrow, downArrow), pageDown, and pageUp and determine which item the user navigated to. - * @returns A Promise that contains the index of the next item (This item becomes the current item). - **/ - getKeyboardNavigatedItem(itemIndex: number, element: HTMLElement, keyPressed: WinJS.Utilities.Key): Promise; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @returns A Promise that returns an object that has these properties: beginScrollPosition, endScrollPosition. - **/ - getScrollBarRange(): Promise; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param x The x-coordinate to test. - * @param y The y-coordinate to test. - **/ - hitTest(x: number, y: number): void; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param elements The elements that represent the items that were added. - **/ - itemsAdded(elements: HTMLElement[]): void; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - **/ - itemsMoved(): void; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param elements The elements that represent the items that were removed. - **/ - itemsRemoved(elements: HTMLElement[]): void; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param groupIndex The index of the group in the group data source. - * @param element The element to render for the group header. - **/ - layoutHeader(groupIndex: number, element: HTMLElement): void; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param itemIndex The index of the item in the data source. - * @param element The element to render for the item. - **/ - layoutItem(itemIndex: number, element: HTMLElement): void; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param element The element that represents a header in the data source. - **/ - prepareHeader(element: HTMLElement): void; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param element An element that represents an item in the data source. - **/ - prepareItem(element: HTMLElement): void; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param element The element being released. - **/ - releaseItem(element: HTMLElement): void; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - **/ - reset(): void; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param site The layout site for the layout. You can use this object to query the hosting ListView for info you might need to lay out items. - **/ - setSite(site: ILayoutSite): void; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - * @param beginScrollPosition The starting pixel of the area to which the items are rendered. - * @param endScrollPosition The last pixel of the area to which the items are rendered. - * @param count The upper bound of the number of items to render. - * @returns A Promise that returns an object that has these properties: beginIndex, endIndex. - **/ - startLayout(beginScrollPosition: number, endScrollPosition: number, count: number): Promise; - - //#endregion Methods - - //#region Properties - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. - **/ - horizontal: boolean; - - //#endregion Properties - - } - - /** - * Represents a layout for the ListView. - **/ - interface ILayout2 { - //#region Methods - - /** - * Called when the ListView finishes a drag operation. - **/ - dragLeave(): void; - - /** - * Called when the ListView initiates a drag operation. - * @param x The x-coordinate of the drag. - * @param y The y-coordinate of the drag. - * @param dragInfo An object that indicates whether the item is selected. - **/ - dragOver(x: number, y: number, dragInfo: number): void; - - /** - * Called when the ListView requests that the ILayout2 execute animations. - **/ - executeAnimations(): void; - - /** - * Determines the next item to receive keyboard focus. - * @param currentItem An object that describes the current item. It has these properties: index, type. - * @param pressedKey The key that was pressed. - * @returns An object that describes the next item that should receive focus. It has these properties: index, type. - **/ - getAdjacent(currentItem: any, pressedKey: WinJS.Utilities.Key): any; - - /** - * Gets the item at the specified hit-test coordinates. These coordinates are absolute coordinates (they are not relative to the layout's content area). - * @param x The x-coordinate to test for. - * @param y The y-coordinate to test for. - * @returns An object that describes the item at the hit test coordinates. It has these properties: type, index. - **/ - hitTest(x: number, y: number): any; - - /** - * Sets the rendering site and specifies whether the layout supports groups. This method is called by the ListView to initialize the layout. - * @param site The rendering site for the layout. - * @param groupsEnabled Set to true if this layout supports groups; set to false if it does not. - **/ - initialize(site: ILayoutSite2, groupsEnabled: boolean): void; - - /** - * Retrieves the indexes of the items in the specified pixel range. - * @param firstPixel The first pixel the range of items falls between. - * @param lastPixel The last pixel the range of items falls between. - **/ - itemsFromRange(firstPixel: number, lastPixel: number): void; - - /** - * Performs a layout pass. - * @param tree A structure representing the layout tree that is returned from the ListView. - * @param changedRange An object that lists the index of the first item in the changed item range. This object has these properties: startIndex. - * @param modifiedItems An object that contains the old and new indexes of the items that have been modified in the tree. - * @param modifiedGroups An object that contains the old and new indexes of the group elements that have been modified in the tree. - * @returns A Promise that executes after layout is complete, or an object that contains two Promise objects: realizedRangeComplete, layoutComplete. - **/ - layout(tree: any, changedRange: any, modifiedItems: any, modifiedGroups: any): any; - - /** - * Called when the ListView requests that the ILayout2 set up animations. - **/ - setupAnimations(): void; - - /** - * Releases resources that were obtained during the call to initialize. - **/ - uninitialize(): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the orientation of the layout. - **/ - orientation: any; - - //#endregion Properties - - } - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayoutSite2 interface. Represents a rendering site for an ILayout. - **/ - interface ILayoutSite { - //#region Properties - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. - **/ - animationsDisabled: boolean; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. - **/ - itemSurface: HTMLElement; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. - **/ - rtl: boolean; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. - **/ - scrollbarPos: number; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. - **/ - surface: HTMLElement; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. - **/ - viewport: HTMLElement; - - /** - * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. - **/ - viewportSize: any; - - //#endregion Properties - - } - - /** - * Represents a rendering site for an ILayout2. - **/ - interface ILayoutSite2 { - //#region Properties - - /** - * Gets the number of groups in the site. - **/ - groupCount: number; - - /** - * Gets the number of items in the site. - **/ - itemCount: Promise; - - /** - * Gets the pixel range of the realization area. - **/ - realizedRange: any; - - /** - * Gets the tree for use by an object that implements the ILayout2 interface. - **/ - tree: any; - - /** - * Gets the pixel range of visible items in the site. - **/ - visibleRange: any; - - //#endregion Properties - - } - - /** - * Retrieves items from a IListDataSource, enumerates the contents of a IListDataSource, and can optionally register for change notifications. - **/ - interface IListBinding { - //#region Methods - - /** - * Retrieves the current item. - * @returns An IItemPromise that contains the current item. If the cursor has moved past the start or end of the list, the promise completes with a value of null. If the current item has been moved or deleted, the promise returns an error. - **/ - current(): IItemPromise>; - - /** - * Gets the first item from the IListDataSource and makes it the current item. - * @returns An IItemPromise that contains the requested IItem. If the list is empty, the promise completes with a value of null. - **/ - first(): IItemPromise>; - - /** - * Retrieves the item from the IListDataSource that has the specified description and makes it the current item. - * @param description A domain-specific description, to be interpreted by the IListDataAdapter, that identifies the item to retrieve. - * @returns An IItemPromise that contains the requested IItem object. If the item wasn't found, the promise completes with a value of null. - **/ - fromDescription(description: string): IItemPromise>; - - /** - * Retrieves the item from the IListDataSource that has the specified index and makes it the current item. - * @param index A value greater than or equal to 0 that is the index of the item to retrieve. - * @returns An IItemPromise that contains the requested IItem. If the item wasn't found, the promise completes with a value of null. - **/ - fromIndex(index: number): IItemPromise>; - - /** - * Retrieves the item from the IListDataSource that has the specified key and makes it the current item. - * @param key The key that identifies the item to retrieve. This value must be a non-empty string. - * @param hints Domain-specific information that provides additional information to the IListDataAdapter to improve retrieval time. - * @returns An IItemPromise that contains the requested IItem. If they item couldn't be found, the promise completes with a value of null. - **/ - fromKey(key: string, hints?: any): IItemPromise>; - - /** - * Makes the specified IItem or IItemPromise the current item. - * @param item The IItem or IItemPromise that will become the current item. - * @returns An IItemPromise that contains the specified item, if it exists. If the specified item is not in the list, the promise completes with a value of null. - **/ - jumpToItem(item: IItem): IItemPromise>; - - /** - * Retrieves the last item in the IListDataSource and makes it the current item. - * @returns An IItemPromise that contains the requested IItem. f the list is empty, the promise completes with a value of null. - **/ - last(): IItemPromise>; - - /** - * Retrieves the item after the current item and makes it the current item. - * @returns An IItemPromise that contains the item after the current item. If the cursor moves past the end of the list, the promise completes with a value of null. - **/ - next(): IItemPromise>; - - /** - * Retrieves the item before the current item and makes it the current item. - * @returns An IItemPromise that contains the item before the current item. If the cursor moves past the start of the list, the promise completes with a value of null. - **/ - previous(): IItemPromise>; - - /** - * Releases resources, stops notifications, and cancels outstanding promises for all tracked items returned by this IListBinding. - **/ - release(): void; - - /** - * Creates a request to stop change notifications for the specified item. The change notifications stop when the number of releaseItem calls matches the number of IIItemPromise.retain calls. - * @param item The IItem or IItemPromise that should stop receiving notifications. - **/ - releaseItem(item: IItem): void; - - //#endregion Methods - - } - - /** - * Accesses data for an IListDataSource. - **/ - interface IListDataAdapter { - //#region Methods - - /** - * Overwrites the data of the specified item. - * @param key The key of the item to overwrite. - * @param newData The new data for the item. - * @param indexHint The index of the item, if known. - * @returns A Promise that returns null or undefined when the operation completes. - **/ - change(key: string, newData: T, indexHint: number): Promise; - - /** - * Gets the number of items in the IListDataAdapter object's data source. - * @returns A Promise that contains the number of items the IListDataAdapter contains, or an approximate value if the actual number is unknown. - **/ - getCount(): Promise; - - /** - * Inserts the specified data after the specified item. - * @param key A key that can be used to retrieve the new data. - * @param data The new data to add to the IListDataAdapter object's data source. - * @param previousKey The key of an item in the IListDataAdapter object's data source. The new data will be inserted after this item. - * @param previousIndexHint The index of the item to insert the new data after, if known. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - insertAfter(key: string, data: T, previousKey: string, previousIndexHint: number): Promise>; - - /** - * Adds the specified key and data to the end of the IListDataAdapter object's data source. - * @param key A key that can be used to retrieve the new data. - * @param data The new data to add to the IListDataAdapter object's data source. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - insertAtEnd(key: string, data: T): Promise>; - - /** - * Adds the specified key and data to the beginning of the IListDataAdapter object's data source. - * @param key A key that can be used to retrieve the new data. - * @param data The new data to add to the IListDataAdapter object's data source. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - insertAtStart(key: string, data: T): Promise>; - - /** - * Inserts the specified data before the specified item. - * @param key A key that can be used to retrieve the new data. - * @param data The new data to add to the IListDataAdapter object's data source. - * @param nextKey The key of an item in the IListDataAdapter object's data source. The new data will be inserted before this item. - * @param nextIndexHint The index of the item to insert the new data before, if known. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - insertBefore(key: string, data: T, nextKey: string, nextIndexHint: number): Promise>; - - /** - * Retrieves the item that matches the specified description and also retrieves the specified number of items before and after the matched item. - * @param description A description of the item to locate. - * @param countBefore The number of items before the matched item to retrieve. - * @param countAfter The number of items after the matched item to retrieve. - * @returns A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered. - **/ - itemsFromDescription(description: string, countBefore: number, countAfter: number): Promise>; - - /** - * Retrieves the specified number of items from the end of the IListDataAdapter object's data source. - * @param count The number of items to retrieve. - * @returns A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered. - **/ - itemsFromEnd(count: number): Promise>; - - /** - * Retrieves the item at the specified index and also retrieves the specified number of items before and after the selected item. - * @param index The index of the item to retrieve. - * @param countBefore The number of items to retrieve from before the selected item. - * @param countAfter The number of items to retrieve from after the selected item. - * @returns A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered. - **/ - itemsFromIndex(index: number, countBefore: number, countAfter: number): Promise>; - - /** - * Retrieves the item that has the specified key and also retrieves the specified number of items before and after the selected item. - * @param key The key of the item to retrieve. - * @param countBefore The number of items to retrieve from before the selected item. - * @param countAfter The number of items to retrieve from after the selected item. - * @returns A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered. - **/ - itemsFromKey(key: string, countBefore: number, countAfter: number): Promise>; - - /** - * Retrieves the specified number of items from the beginning of the IListDataAdapter object's data source. - * @param count The number of items to retrieve. - * @returns A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered. - **/ - itemsFromStart(count: number): Promise>; - - /** - * Returns a string representation of the specified item that can be used for comparisons. - * @param item The item for which to generate a signature. - * @returns The signature representation of the specified item. - **/ - itemSignature(item: IItem): string; - - /** - * Moves the specified item to just after another item. - * @param key A key of the item to move. - * @param previousKey The key of another item. The item to move will be moved to just after this item. - * @param indexHint The index of the item to move, if known. - * @param previousIndexHint The index to move the item after, if known. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - moveAfter(key: string, previousKey: any, indexHint: string, previousIndexHint: number): Promise>; - - /** - * Moves the specified item to just before another item. - * @param key A key of the item to move. - * @param nextKey The key of another item. The item to move will be moved to just before this item. - * @param indexHint The index of the item to move, if known. - * @param nextIndexHint The index to move the item before, if known. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - moveBefore(key: string, nextKey: any, indexHint: string, nextIndexHint: number): Promise>; - - /** - * Moves the specified item to the end of the IListDataAdapter object's data source. - * @param key The key for the item to move. - * @param indexHint The index of the item to move, if known. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - moveToEnd(key: string, indexHint: number): Promise>; - - /** - * Moves the specified item to the beginning of the IListDataAdapter object's data source. - * @param key The key for the item to move. - * @param indexHint The index of the item to move, if known. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - moveToStart(key: string, indexHint: number): Promise>; - - /** - * Removes the specified item from the IListDataAdapter object's data source. - * @param key The key of the item to remove. - * @param data The new data for the item. - * @param indexHint The index of the item. - * @returns A Promise that returns null or undefined when the operation completes. - **/ - remove(key: string, data: T, indexHint: number): Promise; - - /** - * Registers a notification handler. The IListDataAdapter uses the handler to notify listening objects when its data changes. - * @param notificationHandler The notification handler that the IListDataAdapter will use to provide change notifications. . - **/ - setNotificationHandler(notificationHandler: IListDataNotificationHandler): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets a value that specifies whether to use an object's identity to determine if an item has changed. - **/ - compareByIdentity: boolean; - - //#endregion Properties - - } - - /** - * Notifies clients when an IListDataAdapter object's data changes. - **/ - interface IListDataNotificationHandler { - //#region Methods - - /** - * Indicates the start of a notification batch. Objects that are listening for notifications should defer making updates until endNotifications is called. - **/ - beginNotifications(): void; - - /** - * Raises a notification that an item in the IListDataAdapter object's data source has changed. - * @param item The item that changed. - **/ - changed(item: IItem): void; - - /** - * Indicates the end of a notification batch. When the beginNotifications method is called, objects listening for notifications should defer making updates until endNotifications is called. - **/ - endNotifications(): void; - - /** - * Raises a notification that an item has been added to the IListDataAdapter object's data source. - * @param newItem The new item added to the IListDataAdapter object's data source. - * @param previousKey The key of the item that now precedes the new item, or null if the item was inserted at the start of the list. If nextKey is provided, this parameter may be null. - * @param nextKey The key of the item that now follows the new item, or null if the item was inserted at the end of the list. If previousKey is provided, this parameter may be null. - * @param index The index of the new item. - **/ - inserted(newItem: IItem, previousKey: string, nextKey: string, index?: number): void; - - /** - * Indicates that all previous data obtained from the IListDataAdapter is invalid and should be refreshed. - * @returns A Promise that completes when the data has been completely refreshed and all change notifications have been sent. - **/ - invalidateAll(): Promise; - - /** - * Raises a notification that an item was moved within the IListDataAdapter object's data source. - * @param item The item that was moved. - * @param previousKey The key of the item that now precedes the new item, or null if the item was moved to the beginning of the list. If nextKey is provided, this parameter may be null. - * @param nextKey The key of the item that now follows the new item, or null if the item was moved to the end of the list. If previousKey is provided, this parameter may be null. - * @param oldIndex The item's original index. - * @param newIndex The item's new index. - **/ - moved(item: IItem, previousKey: string, nextKey: string, oldIndex?: number, newIndex?: number): void; - - /** - * Reloads data from the IListDataAdapter. - **/ - reload(): void; - - /** - * Raises a notification that an item was removed from the IListDataAdapter object's data source. - * @param key The key of the item that was removed. - * @param index The index of the item that was removed. - **/ - removed(key: string, index?: number): void; - - //#endregion Methods - - } - - /** - * Provides access to a data source and enables you to bind, change, add, remove, and move items in that data source. - **/ - interface IListDataSource { - //#region Events - - /** - * Occurs when the status of the IListDataSource changes. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: status. - **/ - statuschanged(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Notifies the IListDataSource that a sequence of edits is about to begin. The IListDataSource will defer notifications until endEdits is called. - **/ - beginEdits(): void; - - /** - * Overwrites the data of the specified item. - * @param key The key for the item to replace. - * @param newData The new data for the item. - * @returns A Promise that contains the IItem that was updated or an EditError if an error was encountered. - **/ - change(key: string, newData: T): Promise>; - - /** - * Creates an IListBinding that can retrieve items from the IListDataSource, enumerate the contents of the IListDataSource object's data, and optionally register for change notifications. - * @param notificationHandler Enables the IListBinding to register for change notifications for individual items obtained from the IListDataSource. If you omit this parameter, change notifications won't be available. - * @returns The new IListBinding. - **/ - createListBinding(notificationHandler?: IListNotificationHandler): IListBinding; - - /** - * Notifies the IListDataSource that the batch of edits that began with the last beginEdits call has completed. The IListDataSource will submit notifications for any changes that occurred between the beginEdits and endEdits calls as a batch and resume normal change notifications. - **/ - endEdits(): void; - - /** - * Retrieves the number of items in the data source. - * @returns A Promise that provides a Number that is the number of items in the data source. - **/ - getCount(): Promise; - - /** - * Inserts a new item after another item. - * @param key The key that can be used to retrieve the new item, if known. - * @param data The data for the item to add. - * @param previousKey The key for an item in the data source. The new item will be added after this item. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - insertAfter(key: string, data: T, previousKey: string): Promise>; - - /** - * Adds an item to the end of the data source. - * @param key The key that can be used to retrieve the new item, if known. - * @param data The data for the item to add. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - insertAtEnd(key: string, data: T): Promise>; - - /** - * Adds an item to the beginning of the data source. - * @param key The key that can be used to retrieve the new item, if known. - * @param data The data for the item to add. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - insertAtStart(key: string, data: T): Promise>; - - /** - * Inserts an item before another item. - * @param key The key that can be used to retrieve the new item, if known. - * @param data The data for the item to add. - * @param nextKey The key of an item in the data source. The new item will be inserted before this item. - * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. - **/ - insertBefore(key: string, data: T, nextKey: string): Promise>; - - /** - * Indicates that all previous data obtained from the IListDataAdapter is invalid and should be refreshed. - * @returns A Promise that completes when the data has been completely refreshed and all notifications have been sent. - **/ - invalidateAll(): Promise; - - /** - * Retrieves the item that has the specified description. - * @param description Domain-specific information, to be interpreted by the IListDataAdapter, that describes the item to retrieve. - * @returns A Promise that provides an IItem that contains the requested item or a FetchError if an error was encountered. If the item wasn't found, the promise completes with a value of null. - **/ - itemFromDescription(description: any): Promise>; - - /** - * Retrieves the item at the specified index. - * @param index A value that is greater than or equal to zero that is the index of the item to retrieve. - * @returns A Promise that provides an IItem that contains the requested item or a FetchError if an error was encountered. If the item wasn't found, the promise completes with a value of null. - **/ - itemFromIndex(index: number): Promise>; - - /** - * Retrieves the item with the specified key. - * @param key The key of the item to retrieve. It must be a non-empty string. - * @param description Domain-specific information that IListDataAdapter can use to improve the retrieval time. - * @returns A Promise that provides an IItem that contains the requested item or a FetchError if an error was encountered. If the item was not found, the promise completes with a null value. - **/ - itemFromKey(key: string, description?: any): Promise>; - - /** - * Moves an item to just after another item. - * @param key The key that identifies the item to move. - * @param previousKey The key of another item in the data source. The item specified by the key parameter will be moved after this item. - * @returns A Promise that contains the IItem that was moved or an EditError if an error was encountered. - **/ - moveAfter(key: string, previousKey: string): Promise>; - - /** - * Moves an item before another item. - * @param key The key that identifies the item to move. - * @param nextKey The key of another item in the data source. The item specified by the key parameter will be moved before this item. - * @returns A Promise that contains the IItem that was moved or an EditError if an error was encountered. - **/ - moveBefore(key: string, nextKey: string): Promise>; - - /** - * Moves an item to the end of the data source. - * @param key The key that identifies the item to move. - * @returns A Promise that contains the IItem that was moved or an EditError if an error was encountered. - **/ - moveToEnd(key: string): Promise>; - - /** - * Moves the specified item to the beginning of the data source. - * @param key The key that identifies the item to move. - * @returns A Promise that contains the IItem that was moved or an EditError if an error was encountered. - **/ - moveToStart(key: string): Promise>; - - /** - * Removes the specified item from the data source. - * @param key The key that identifies the item to remove. - * @returns A Promise that contains nothing if the operation was successful or an EditError if an error was encountered. - **/ - remove(key: string): Promise>; - - //#endregion Methods - - } - - /** - * Used by an IListBinding to provide change notifications when items in a IListDataSource change. - **/ - interface IListNotificationHandler { - //#region Methods - - /** - * Indicates the start of a notification batch. Objects that are listening for notifications should defer making updates until endNotifications is called. - **/ - beginNotifications(): void; - - /** - * Indicates that an item changed. - * @param newItem The updated item. - * @param oldItem The original item. - **/ - changed(newItem: IItem, oldItem: IItem): void; - - /** - * Indicates that the number of items in the IListDataSource has changed. - * @param newCount The updated count. - * @param oldCount The original count. - **/ - countChanged(newCount: number, oldCount: number): void; - - /** - * Indicates the end of a notification batch. When the beginNotifications method is called, objects listening for notifications should defer making updates until endNotifications is called. - **/ - endNotifications(): void; - - /** - * Indicates that the index of an item changed. - * @param handle The temporary ID of the item. - * @param newIndex The new index. - * @param oldIndex The original index. - **/ - indexChanged(handle: string, newIndex: number, oldIndex: number): void; - - /** - * Indicates that an item was added to the IListDataSource. - * @param itemPromise A promise for the new IItem. - * @param previousHandle The temporary ID of the item that precedes the new item. - * @param nextHandle The temporary ID of the item that follows the new item. - **/ - inserted(itemPromise: IItemPromise, previousHandle: string, nextHandle: string): void; - - /** - * Indicates that an IItemPromise was fulfilled and that the item is now available. - * @param item The fulfilled item. - **/ - itemAvailable(item: IItem): void; - - /** - * Indicates that an item was moved. - * @param item A promise for the IItem that was moved. - * @param previousHandle The temporary ID of the item that now precedes the moved item. - * @param nextHandle The temporary ID of the item that now follows the moved item. - **/ - moved(item: IItemPromise, previousHandle: string, nextHandle: string): void; - - /** - * Indicates that an item was removed. - * @param handle The temporary ID of the item that was removed. - * @param mirage true if the item never actually existed; false if the item was actually present in the IListDataSource. - **/ - removed(handle: string, mirage: boolean): void; - - //#endregion Methods - - } + //#region Enumerations + + /** + * Specifies an icon that appears in an AppBarCommand object. + **/ + enum AppBarIcon { + previous, + next, + play, + pause, + edit, + save, + clear, + delete, + remove, + add, + cancel, + accept, + more, + redo, + undo, + home, + up, + forward, + right, + back, + left, + favorite, + camera, + settings, + video, + sync, + download, + mail, + find, + help, + upload, + emoji, + twopage, + leavechat, + mailforward, + clock, + send, + crop, + rotatecamera, + people, + closepane, + openpane, + world, + flag, + previewlink, + globe, + trim, + attachcamera, + zoomin, + bookmarks, + document, + protecteddocument, + page, + bullets, + comment, + mail2, + contactinfo, + hangup, + viewall, + mappin, + phone, + videochat, + switch, + contact, + rename, + pin, + musicinfo, + go, + keyboard, + dockleft, + dockright, + dockbottom, + remote, + refresh, + rotate, + shuffle, + list, + shop, + selectall, + orientation, + import, + importall, + browsephotos, + webcam, + pictures, + savelocal, + caption, + stop, + showresults, + volume, + repair, + message, + page2, + calendarday, + calendarweek, + calendar, + characters, + mailreplyall, + read, + link, + accounts, + showbcc, + hidebcc, + cut, + attach, + paste, + filter, + copy, + emoji2, + important, + mailreply, + slideshow, + sort, + manage, + allapps, + disconnectdrive, + mapdrive, + newwindow, + openwith, + contactpresence, + priority, + uploadskydrive, + gototoday, + font, + fontcolor, + contact2, + folder, + audio, + placeholder, + view, + setlockscreen, + settile, + cc, + stopslideshow, + permissions, + highlight, + disableupdates, + unfavorite, + unpin, + openlocal, + mute, + italic, + underline, + bold, + movetofolder, + likedislike, + dislike, + like, + alignright, + aligncenter, + alignleft, + zoom, + zoomout, + openfile, + otheruser, + admin, + street, + map, + clearselection, + fontdecrease, + fontincrease, + fontsize, + cellphone, + reshare, + tag, + repeatone, + repeatall, + outlinestar, + solidstar, + calculator, + directions, + target, + library, + phonebook, + memo, + microphone, + postupdate, + backtowindow, + fullscreen, + newfolder, + calendarreply, + unsyncfolder, + reporthacked, + syncfolder, + blockcontact, + switchapps, + addfriend, + touchpointer, + gotostart, + zerobars, + onebar, + twobars, + threebars, + fourbars, + scan, + preview + } + + /** + * Indicates whether the IListDataAdapter was able to provide a count. + **/ + enum CountResult { + /** + * Indicates no count is available. + **/ + unknown + } + + /** + * Indicates that the IListDataAdapter was unable to provide a count. + **/ + enum CountError { + /** + * An attempt to count items timed out. + **/ + noResponse + } + + /** + * Describes the status of an IListDataSource. + **/ + enum DataSourceStatus { + /** + * The IListDataSource is ready. + **/ + ready, + /** + * The IListDataSource is still loading. + **/ + waiting, + /** + * The IListDataSource failed to load. + **/ + failure + } + + /** + * Specifies the type of error that occurred during an edit operation on a IListDataSource or an IListDataAdapter. + **/ + enum EditError { + /** + * The edit operation timed out. + **/ + noResponse, + /** + * The data source cannot be written to. + **/ + notPermitted, + /** + * The item has changed. + **/ + noLongerMeaningful + } + + /** + * Specifies the type of error encountered when retrieving items from an IListDataAdapter. + **/ + enum FetchError { + /** + * The fetch operation timed out. + **/ + noResponse, + /** + * The specified item could not be located. + **/ + doesNotExist + } + + /** + * Specifies how group headers in a ListView respond to the tap interaction. + **/ + enum GroupHeaderTapBehavior { + /** + * The group is invoked. + **/ + invoke, + /** + * Nothing happens. + **/ + none + } + + /** + * Specifies the position of group headers relative to their items in a ListView. + **/ + enum HeaderPosition { + /** + * Group headers appear to the left of items. + **/ + left, + /** + * Group headers appear above items. + **/ + top + } + + /** + * Specifies that type of animation for which a contentanimating event was raised. + **/ + enum ListViewAnimationType { + /** + * The animation plays when the ListView is first displayed. + **/ + entrance, + /** + * The animation plays when the ListView is changing its content. + **/ + contentTransition + } + + /** + * Describes the type of object in a ListView. + **/ + enum ObjectType { + /** + * The object is a group header in the list. + **/ + groupHeader, + /** + * The object is an item in the list. + **/ + item + } + + /** + * Specifies the orientation of a control. + **/ + enum Orientation { + /** + * A horizontal layout. + **/ + horizontal, + /** + * A vertical layout. + **/ + vertical + } + + /** + * Specifies the selection mode of a ListView. + **/ + enum SelectionMode { + /** + * Items cannot be selected. + **/ + none, + /** + * A single item may be selected. + **/ + single, + /** + * Multiple items may be selected. Clicking additional items adds them to the selection. + **/ + multi + } + + /** + * Specifies whether elements are selected when the user performs a swipe interaction. + **/ + enum SwipeBehavior { + /** + * The swipe interaction selects the elements touched by the swipe. + **/ + select, + /** + * The swipe interaction does not change which elements are selected. + **/ + none + } + + /** + * Specifies how items in a ListView respond to the tap interaction. + **/ + enum TapBehavior { + /** + * The item is selected and invoked. + **/ + directSelect, + /** + * The item is selected if was not already selected, and its deselected if it was already selected. + **/ + toggleSelect, + /** + * The item is invoked but not selected. + **/ + invokeOnly, + /** + * Nothing happens. + **/ + none + } + + //#endregion Enumerations + + //#region Interfaces + + /** + * Contains items that were requested from an IListDataAdapter and provides some information about those items. + **/ + interface IFetchResult { + //#region Properties + + /** + * Gets or sets the index of the requested item in the IListDataAdapter object's data source. + **/ + absoluteIndex: number; + + /** + * Gets or sets a value that indicates whether this IFetchResult contains the last items at the end of the IListDataAdapter object's data source. + **/ + atEnd: boolean; + + /** + * Gets or sets a value that indicates whether this IFetchResult contains the first items at the beginning of the IListDataAdapter object's data source. + **/ + atStart: boolean; + + /** + * Gets or sets the items returned by the fetch operation. + **/ + items: T[]; + + /** + * Gets or sets the location of the requested item within the items array. + **/ + offset: number; + + /** + * Gets or sets the number of items in the IListDataAdapter object's underlying data source. + **/ + totalCount: number; + + //#endregion Properties + + } + + /** + * Represents an item in a list. + **/ + interface IItem { + //#region Properties + + /** + * Gets or sets the item's data. + **/ + data: T; + + /** + * Gets the group key for the item. This property is only available for items that belong to a grouped data source. + **/ + groupKey: string; + + /** + * Gets the temporary ID of the item. + **/ + handle: string; + + /** + * Gets the item's index in the IListDataSource. + **/ + index: number; + + /** + * Gets or sets the key the identifies the item. + **/ + key: string; + + //#endregion Properties + + } + + /** + * Provides a mechanism for retrieving IItem objects asynchronously. + **/ + interface IItemPromise { + //#region Events + + /** + * Occurs when there is an error in processing. + * @param eventInfo An object that contains information about the event. + **/ + onerror(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Attempts to cancel the fulfillment of a promised value. If the promise hasn't already been fulfilled and cancellation is supported, the promise enters the error state with a value of Error("Canceled"). + **/ + cancel(): void; + + /** + * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. After the handlers have finished executing, this function throws any error that would have been returned from then as a promise in the error state. + * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The fulfilled value is passed as the single argument. If the value is null, the fulfilled value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while executing the function, the promise returned by then moves into the error state. + * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. If it is null, the error is forwarded. The value returned from the function is the fulfilled value of the promise returned by then. + * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. + **/ + done(onComplete: (item: T) => void, onError?: (error: Error) => void, onProgress?: (progressData: any) => void): void; + + /** + * Stops change notification tracking for the IItem that fulfills this IItemPromise. + **/ + release(): void; + + /** + * Begins change notification tracking for the IItem that fulfills this IItemPromise. + **/ + retain(): void; + + /** + * Allows you to specify the work to be done on the fulfillment of the promised value, the error handling to be performed if the promise fails to fulfill a value, and the handling of progress notifications along the way. + * @param onComplete The function to be called if the promise is fulfilled successfully with a value. The value is passed as the single argument. If the value is null, the value is returned. The value returned from the function becomes the fulfilled value of the promise returned by then. If an exception is thrown while this function is being executed, the promise returned by then moves into the error state. + * @param onError The function to be called if the promise is fulfilled with an error. The error is passed as the single argument. If it is null, the error is forwarded. The value returned from the function becomes the fulfilled value of the promise returned by then. + * @param onProgress The function to be called if the promise reports progress. Data about the progress is passed as the single argument. Promises are not required to support progress. + * @returns The promise whose value is the result of executing the complete or error function. + **/ + then(onComplete: (item: T) => void, onError?: (error: Error) => void, onProgress?: (progressData: any) => void): IItemPromise; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the temporary ID of the IItem that fulfills this promise. + **/ + handle: string; + + /** + * Gets or sets the index of the IItem contained by this IItemPromise. + **/ + index: number; + + //#endregion Properties + + } + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. Represents a layout for the ListView. + **/ + interface ILayout { + //#region Methods + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param beginScrollPosition The first visible pixel in the ListView. For horizontal layouts, this is the x-coordinate of the pixel. For vertical layouts, this is the y-coordinate. + * @param wholeItem true if the item must be completely visible; otherwise, false if its ok for the item to be partially visible. Promise. + * @returns A Promise for the index of the first visible item at the specified point. + **/ + calculateFirstVisible(beginScrollPosition: number, wholeItem: boolean): Promise; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param endScrollPosition The last visible pixel in the ListView. For horizontal layouts, this is the x-coordinate of the pixel. For vertical layouts, this is the y-coordinate. + * @param wholeItem true if the item must be completely visible; otherwise, false if its ok for the item to be partially visible. Promise. + * @returns A Promise for the index of the last visible item at the specified point. + **/ + calculateLastVisible(endScrollPosition: number, wholeItem: boolean): Promise; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @returns A object that has these properties: animationPromise, newEndIndex. + **/ + endLayout(): any; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param itemIndex The index of the item. + * @returns A Promise that returns an object with these properties: left, top, contentWidth, contentHeight, totalWidth, totalHeight. + **/ + getItemPosition(itemIndex: number): Promise; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param itemIndex The data source index of the current item. + * @param element The element for the current item. + * @param keyPressed The key that was pressed. This function must check for the arrow keys (leftArrow, upArrow, rightArrow, downArrow), pageDown, and pageUp and determine which item the user navigated to. + * @returns A Promise that contains the index of the next item (This item becomes the current item). + **/ + getKeyboardNavigatedItem(itemIndex: number, element: HTMLElement, keyPressed: WinJS.Utilities.Key): Promise; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @returns A Promise that returns an object that has these properties: beginScrollPosition, endScrollPosition. + **/ + getScrollBarRange(): Promise; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param x The x-coordinate to test. + * @param y The y-coordinate to test. + **/ + hitTest(x: number, y: number): void; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param elements The elements that represent the items that were added. + **/ + itemsAdded(elements: HTMLElement[]): void; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + **/ + itemsMoved(): void; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param elements The elements that represent the items that were removed. + **/ + itemsRemoved(elements: HTMLElement[]): void; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param groupIndex The index of the group in the group data source. + * @param element The element to render for the group header. + **/ + layoutHeader(groupIndex: number, element: HTMLElement): void; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param itemIndex The index of the item in the data source. + * @param element The element to render for the item. + **/ + layoutItem(itemIndex: number, element: HTMLElement): void; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param element The element that represents a header in the data source. + **/ + prepareHeader(element: HTMLElement): void; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param element An element that represents an item in the data source. + **/ + prepareItem(element: HTMLElement): void; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param element The element being released. + **/ + releaseItem(element: HTMLElement): void; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + **/ + reset(): void; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param site The layout site for the layout. You can use this object to query the hosting ListView for info you might need to lay out items. + **/ + setSite(site: ILayoutSite): void; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + * @param beginScrollPosition The starting pixel of the area to which the items are rendered. + * @param endScrollPosition The last pixel of the area to which the items are rendered. + * @param count The upper bound of the number of items to render. + * @returns A Promise that returns an object that has these properties: beginIndex, endIndex. + **/ + startLayout(beginScrollPosition: number, endScrollPosition: number, count: number): Promise; + + //#endregion Methods + + //#region Properties + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayout2 interface. + **/ + horizontal: boolean; + + //#endregion Properties + + } + + /** + * Represents a layout for the ListView. + **/ + interface ILayout2 { + //#region Methods + + /** + * Called when the ListView finishes a drag operation. + **/ + dragLeave(): void; + + /** + * Called when the ListView initiates a drag operation. + * @param x The x-coordinate of the drag. + * @param y The y-coordinate of the drag. + * @param dragInfo An object that indicates whether the item is selected. + **/ + dragOver(x: number, y: number, dragInfo: number): void; + + /** + * Called when the ListView requests that the ILayout2 execute animations. + **/ + executeAnimations(): void; + + /** + * Determines the next item to receive keyboard focus. + * @param currentItem An object that describes the current item. It has these properties: index, type. + * @param pressedKey The key that was pressed. + * @returns An object that describes the next item that should receive focus. It has these properties: index, type. + **/ + getAdjacent(currentItem: any, pressedKey: WinJS.Utilities.Key): any; + + /** + * Gets the item at the specified hit-test coordinates. These coordinates are absolute coordinates (they are not relative to the layout's content area). + * @param x The x-coordinate to test for. + * @param y The y-coordinate to test for. + * @returns An object that describes the item at the hit test coordinates. It has these properties: type, index. + **/ + hitTest(x: number, y: number): any; + + /** + * Sets the rendering site and specifies whether the layout supports groups. This method is called by the ListView to initialize the layout. + * @param site The rendering site for the layout. + * @param groupsEnabled Set to true if this layout supports groups; set to false if it does not. + **/ + initialize(site: ILayoutSite2, groupsEnabled: boolean): void; + + /** + * Retrieves the indexes of the items in the specified pixel range. + * @param firstPixel The first pixel the range of items falls between. + * @param lastPixel The last pixel the range of items falls between. + **/ + itemsFromRange(firstPixel: number, lastPixel: number): void; + + /** + * Performs a layout pass. + * @param tree A structure representing the layout tree that is returned from the ListView. + * @param changedRange An object that lists the index of the first item in the changed item range. This object has these properties: startIndex. + * @param modifiedItems An object that contains the old and new indexes of the items that have been modified in the tree. + * @param modifiedGroups An object that contains the old and new indexes of the group elements that have been modified in the tree. + * @returns A Promise that executes after layout is complete, or an object that contains two Promise objects: realizedRangeComplete, layoutComplete. + **/ + layout(tree: any, changedRange: any, modifiedItems: any, modifiedGroups: any): any; + + /** + * Called when the ListView requests that the ILayout2 set up animations. + **/ + setupAnimations(): void; + + /** + * Releases resources that were obtained during the call to initialize. + **/ + uninitialize(): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the orientation of the layout. + **/ + orientation: any; + + //#endregion Properties + + } + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use the ILayoutSite2 interface. Represents a rendering site for an ILayout. + **/ + interface ILayoutSite { + //#region Properties + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. + **/ + animationsDisabled: boolean; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. + **/ + itemSurface: HTMLElement; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. + **/ + rtl: boolean; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. + **/ + scrollbarPos: number; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. + **/ + surface: HTMLElement; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. + **/ + viewport: HTMLElement; + + /** + * This API is no longer supported. Starting with the Windows Library for JavaScript 2.0 Preview, use a the ILayoutSite2 interface. + **/ + viewportSize: any; + + //#endregion Properties + + } + + /** + * Represents a rendering site for an ILayout2. + **/ + interface ILayoutSite2 { + //#region Properties + + /** + * Gets the number of groups in the site. + **/ + groupCount: number; + + /** + * Gets the number of items in the site. + **/ + itemCount: Promise; + + /** + * Gets the pixel range of the realization area. + **/ + realizedRange: any; + + /** + * Gets the tree for use by an object that implements the ILayout2 interface. + **/ + tree: any; + + /** + * Gets the pixel range of visible items in the site. + **/ + visibleRange: any; + + //#endregion Properties + + } + + /** + * Retrieves items from a IListDataSource, enumerates the contents of a IListDataSource, and can optionally register for change notifications. + **/ + interface IListBinding { + //#region Methods + + /** + * Retrieves the current item. + * @returns An IItemPromise that contains the current item. If the cursor has moved past the start or end of the list, the promise completes with a value of null. If the current item has been moved or deleted, the promise returns an error. + **/ + current(): IItemPromise>; + + /** + * Gets the first item from the IListDataSource and makes it the current item. + * @returns An IItemPromise that contains the requested IItem. If the list is empty, the promise completes with a value of null. + **/ + first(): IItemPromise>; + + /** + * Retrieves the item from the IListDataSource that has the specified description and makes it the current item. + * @param description A domain-specific description, to be interpreted by the IListDataAdapter, that identifies the item to retrieve. + * @returns An IItemPromise that contains the requested IItem object. If the item wasn't found, the promise completes with a value of null. + **/ + fromDescription(description: string): IItemPromise>; + + /** + * Retrieves the item from the IListDataSource that has the specified index and makes it the current item. + * @param index A value greater than or equal to 0 that is the index of the item to retrieve. + * @returns An IItemPromise that contains the requested IItem. If the item wasn't found, the promise completes with a value of null. + **/ + fromIndex(index: number): IItemPromise>; + + /** + * Retrieves the item from the IListDataSource that has the specified key and makes it the current item. + * @param key The key that identifies the item to retrieve. This value must be a non-empty string. + * @param hints Domain-specific information that provides additional information to the IListDataAdapter to improve retrieval time. + * @returns An IItemPromise that contains the requested IItem. If they item couldn't be found, the promise completes with a value of null. + **/ + fromKey(key: string, hints?: any): IItemPromise>; + + /** + * Makes the specified IItem or IItemPromise the current item. + * @param item The IItem or IItemPromise that will become the current item. + * @returns An IItemPromise that contains the specified item, if it exists. If the specified item is not in the list, the promise completes with a value of null. + **/ + jumpToItem(item: IItem): IItemPromise>; + + /** + * Retrieves the last item in the IListDataSource and makes it the current item. + * @returns An IItemPromise that contains the requested IItem. f the list is empty, the promise completes with a value of null. + **/ + last(): IItemPromise>; + + /** + * Retrieves the item after the current item and makes it the current item. + * @returns An IItemPromise that contains the item after the current item. If the cursor moves past the end of the list, the promise completes with a value of null. + **/ + next(): IItemPromise>; + + /** + * Retrieves the item before the current item and makes it the current item. + * @returns An IItemPromise that contains the item before the current item. If the cursor moves past the start of the list, the promise completes with a value of null. + **/ + previous(): IItemPromise>; + + /** + * Releases resources, stops notifications, and cancels outstanding promises for all tracked items returned by this IListBinding. + **/ + release(): void; + + /** + * Creates a request to stop change notifications for the specified item. The change notifications stop when the number of releaseItem calls matches the number of IIItemPromise.retain calls. + * @param item The IItem or IItemPromise that should stop receiving notifications. + **/ + releaseItem(item: IItem): void; + + //#endregion Methods + + } + + /** + * Accesses data for an IListDataSource. + **/ + interface IListDataAdapter { + //#region Methods + + /** + * Overwrites the data of the specified item. + * @param key The key of the item to overwrite. + * @param newData The new data for the item. + * @param indexHint The index of the item, if known. + * @returns A Promise that returns null or undefined when the operation completes. + **/ + change(key: string, newData: T, indexHint: number): Promise; + + /** + * Gets the number of items in the IListDataAdapter object's data source. + * @returns A Promise that contains the number of items the IListDataAdapter contains, or an approximate value if the actual number is unknown. + **/ + getCount(): Promise; + + /** + * Inserts the specified data after the specified item. + * @param key A key that can be used to retrieve the new data. + * @param data The new data to add to the IListDataAdapter object's data source. + * @param previousKey The key of an item in the IListDataAdapter object's data source. The new data will be inserted after this item. + * @param previousIndexHint The index of the item to insert the new data after, if known. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + insertAfter(key: string, data: T, previousKey: string, previousIndexHint: number): Promise>; + + /** + * Adds the specified key and data to the end of the IListDataAdapter object's data source. + * @param key A key that can be used to retrieve the new data. + * @param data The new data to add to the IListDataAdapter object's data source. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + insertAtEnd(key: string, data: T): Promise>; + + /** + * Adds the specified key and data to the beginning of the IListDataAdapter object's data source. + * @param key A key that can be used to retrieve the new data. + * @param data The new data to add to the IListDataAdapter object's data source. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + insertAtStart(key: string, data: T): Promise>; + + /** + * Inserts the specified data before the specified item. + * @param key A key that can be used to retrieve the new data. + * @param data The new data to add to the IListDataAdapter object's data source. + * @param nextKey The key of an item in the IListDataAdapter object's data source. The new data will be inserted before this item. + * @param nextIndexHint The index of the item to insert the new data before, if known. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + insertBefore(key: string, data: T, nextKey: string, nextIndexHint: number): Promise>; + + /** + * Retrieves the item that matches the specified description and also retrieves the specified number of items before and after the matched item. + * @param description A description of the item to locate. + * @param countBefore The number of items before the matched item to retrieve. + * @param countAfter The number of items after the matched item to retrieve. + * @returns A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered. + **/ + itemsFromDescription(description: string, countBefore: number, countAfter: number): Promise>; + + /** + * Retrieves the specified number of items from the end of the IListDataAdapter object's data source. + * @param count The number of items to retrieve. + * @returns A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered. + **/ + itemsFromEnd(count: number): Promise>; + + /** + * Retrieves the item at the specified index and also retrieves the specified number of items before and after the selected item. + * @param index The index of the item to retrieve. + * @param countBefore The number of items to retrieve from before the selected item. + * @param countAfter The number of items to retrieve from after the selected item. + * @returns A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered. + **/ + itemsFromIndex(index: number, countBefore: number, countAfter: number): Promise>; + + /** + * Retrieves the item that has the specified key and also retrieves the specified number of items before and after the selected item. + * @param key The key of the item to retrieve. + * @param countBefore The number of items to retrieve from before the selected item. + * @param countAfter The number of items to retrieve from after the selected item. + * @returns A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered. + **/ + itemsFromKey(key: string, countBefore: number, countAfter: number): Promise>; + + /** + * Retrieves the specified number of items from the beginning of the IListDataAdapter object's data source. + * @param count The number of items to retrieve. + * @returns A Promise that provides an IFetchResult that contains the selected items or a FetchError if an error was encountered. + **/ + itemsFromStart(count: number): Promise>; + + /** + * Returns a string representation of the specified item that can be used for comparisons. + * @param item The item for which to generate a signature. + * @returns The signature representation of the specified item. + **/ + itemSignature(item: IItem): string; + + /** + * Moves the specified item to just after another item. + * @param key A key of the item to move. + * @param previousKey The key of another item. The item to move will be moved to just after this item. + * @param indexHint The index of the item to move, if known. + * @param previousIndexHint The index to move the item after, if known. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + moveAfter(key: string, previousKey: any, indexHint: string, previousIndexHint: number): Promise>; + + /** + * Moves the specified item to just before another item. + * @param key A key of the item to move. + * @param nextKey The key of another item. The item to move will be moved to just before this item. + * @param indexHint The index of the item to move, if known. + * @param nextIndexHint The index to move the item before, if known. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + moveBefore(key: string, nextKey: any, indexHint: string, nextIndexHint: number): Promise>; + + /** + * Moves the specified item to the end of the IListDataAdapter object's data source. + * @param key The key for the item to move. + * @param indexHint The index of the item to move, if known. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + moveToEnd(key: string, indexHint: number): Promise>; + + /** + * Moves the specified item to the beginning of the IListDataAdapter object's data source. + * @param key The key for the item to move. + * @param indexHint The index of the item to move, if known. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + moveToStart(key: string, indexHint: number): Promise>; + + /** + * Removes the specified item from the IListDataAdapter object's data source. + * @param key The key of the item to remove. + * @param data The new data for the item. + * @param indexHint The index of the item. + * @returns A Promise that returns null or undefined when the operation completes. + **/ + remove(key: string, data: T, indexHint: number): Promise; + + /** + * Registers a notification handler. The IListDataAdapter uses the handler to notify listening objects when its data changes. + * @param notificationHandler The notification handler that the IListDataAdapter will use to provide change notifications. . + **/ + setNotificationHandler(notificationHandler: IListDataNotificationHandler): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets a value that specifies whether to use an object's identity to determine if an item has changed. + **/ + compareByIdentity: boolean; + + //#endregion Properties + + } + + /** + * Notifies clients when an IListDataAdapter object's data changes. + **/ + interface IListDataNotificationHandler { + //#region Methods + + /** + * Indicates the start of a notification batch. Objects that are listening for notifications should defer making updates until endNotifications is called. + **/ + beginNotifications(): void; + + /** + * Raises a notification that an item in the IListDataAdapter object's data source has changed. + * @param item The item that changed. + **/ + changed(item: IItem): void; + + /** + * Indicates the end of a notification batch. When the beginNotifications method is called, objects listening for notifications should defer making updates until endNotifications is called. + **/ + endNotifications(): void; + + /** + * Raises a notification that an item has been added to the IListDataAdapter object's data source. + * @param newItem The new item added to the IListDataAdapter object's data source. + * @param previousKey The key of the item that now precedes the new item, or null if the item was inserted at the start of the list. If nextKey is provided, this parameter may be null. + * @param nextKey The key of the item that now follows the new item, or null if the item was inserted at the end of the list. If previousKey is provided, this parameter may be null. + * @param index The index of the new item. + **/ + inserted(newItem: IItem, previousKey: string, nextKey: string, index?: number): void; + + /** + * Indicates that all previous data obtained from the IListDataAdapter is invalid and should be refreshed. + * @returns A Promise that completes when the data has been completely refreshed and all change notifications have been sent. + **/ + invalidateAll(): Promise; + + /** + * Raises a notification that an item was moved within the IListDataAdapter object's data source. + * @param item The item that was moved. + * @param previousKey The key of the item that now precedes the new item, or null if the item was moved to the beginning of the list. If nextKey is provided, this parameter may be null. + * @param nextKey The key of the item that now follows the new item, or null if the item was moved to the end of the list. If previousKey is provided, this parameter may be null. + * @param oldIndex The item's original index. + * @param newIndex The item's new index. + **/ + moved(item: IItem, previousKey: string, nextKey: string, oldIndex?: number, newIndex?: number): void; + + /** + * Reloads data from the IListDataAdapter. + **/ + reload(): void; + + /** + * Raises a notification that an item was removed from the IListDataAdapter object's data source. + * @param key The key of the item that was removed. + * @param index The index of the item that was removed. + **/ + removed(key: string, index?: number): void; + + //#endregion Methods + + } + + /** + * Provides access to a data source and enables you to bind, change, add, remove, and move items in that data source. + **/ + interface IListDataSource { + //#region Events + + /** + * Occurs when the status of the IListDataSource changes. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: status. + **/ + statuschanged(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Notifies the IListDataSource that a sequence of edits is about to begin. The IListDataSource will defer notifications until endEdits is called. + **/ + beginEdits(): void; + + /** + * Overwrites the data of the specified item. + * @param key The key for the item to replace. + * @param newData The new data for the item. + * @returns A Promise that contains the IItem that was updated or an EditError if an error was encountered. + **/ + change(key: string, newData: T): Promise>; + + /** + * Creates an IListBinding that can retrieve items from the IListDataSource, enumerate the contents of the IListDataSource object's data, and optionally register for change notifications. + * @param notificationHandler Enables the IListBinding to register for change notifications for individual items obtained from the IListDataSource. If you omit this parameter, change notifications won't be available. + * @returns The new IListBinding. + **/ + createListBinding(notificationHandler?: IListNotificationHandler): IListBinding; + + /** + * Notifies the IListDataSource that the batch of edits that began with the last beginEdits call has completed. The IListDataSource will submit notifications for any changes that occurred between the beginEdits and endEdits calls as a batch and resume normal change notifications. + **/ + endEdits(): void; + + /** + * Retrieves the number of items in the data source. + * @returns A Promise that provides a Number that is the number of items in the data source. + **/ + getCount(): Promise; + + /** + * Inserts a new item after another item. + * @param key The key that can be used to retrieve the new item, if known. + * @param data The data for the item to add. + * @param previousKey The key for an item in the data source. The new item will be added after this item. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + insertAfter(key: string, data: T, previousKey: string): Promise>; + + /** + * Adds an item to the end of the data source. + * @param key The key that can be used to retrieve the new item, if known. + * @param data The data for the item to add. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + insertAtEnd(key: string, data: T): Promise>; + + /** + * Adds an item to the beginning of the data source. + * @param key The key that can be used to retrieve the new item, if known. + * @param data The data for the item to add. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + insertAtStart(key: string, data: T): Promise>; + + /** + * Inserts an item before another item. + * @param key The key that can be used to retrieve the new item, if known. + * @param data The data for the item to add. + * @param nextKey The key of an item in the data source. The new item will be inserted before this item. + * @returns A Promise that contains the IItem that was added or an EditError if an error was encountered. + **/ + insertBefore(key: string, data: T, nextKey: string): Promise>; + + /** + * Indicates that all previous data obtained from the IListDataAdapter is invalid and should be refreshed. + * @returns A Promise that completes when the data has been completely refreshed and all notifications have been sent. + **/ + invalidateAll(): Promise; + + /** + * Retrieves the item that has the specified description. + * @param description Domain-specific information, to be interpreted by the IListDataAdapter, that describes the item to retrieve. + * @returns A Promise that provides an IItem that contains the requested item or a FetchError if an error was encountered. If the item wasn't found, the promise completes with a value of null. + **/ + itemFromDescription(description: any): Promise>; + + /** + * Retrieves the item at the specified index. + * @param index A value that is greater than or equal to zero that is the index of the item to retrieve. + * @returns A Promise that provides an IItem that contains the requested item or a FetchError if an error was encountered. If the item wasn't found, the promise completes with a value of null. + **/ + itemFromIndex(index: number): Promise>; + + /** + * Retrieves the item with the specified key. + * @param key The key of the item to retrieve. It must be a non-empty string. + * @param description Domain-specific information that IListDataAdapter can use to improve the retrieval time. + * @returns A Promise that provides an IItem that contains the requested item or a FetchError if an error was encountered. If the item was not found, the promise completes with a null value. + **/ + itemFromKey(key: string, description?: any): Promise>; + + /** + * Moves an item to just after another item. + * @param key The key that identifies the item to move. + * @param previousKey The key of another item in the data source. The item specified by the key parameter will be moved after this item. + * @returns A Promise that contains the IItem that was moved or an EditError if an error was encountered. + **/ + moveAfter(key: string, previousKey: string): Promise>; + + /** + * Moves an item before another item. + * @param key The key that identifies the item to move. + * @param nextKey The key of another item in the data source. The item specified by the key parameter will be moved before this item. + * @returns A Promise that contains the IItem that was moved or an EditError if an error was encountered. + **/ + moveBefore(key: string, nextKey: string): Promise>; + + /** + * Moves an item to the end of the data source. + * @param key The key that identifies the item to move. + * @returns A Promise that contains the IItem that was moved or an EditError if an error was encountered. + **/ + moveToEnd(key: string): Promise>; + + /** + * Moves the specified item to the beginning of the data source. + * @param key The key that identifies the item to move. + * @returns A Promise that contains the IItem that was moved or an EditError if an error was encountered. + **/ + moveToStart(key: string): Promise>; + + /** + * Removes the specified item from the data source. + * @param key The key that identifies the item to remove. + * @returns A Promise that contains nothing if the operation was successful or an EditError if an error was encountered. + **/ + remove(key: string): Promise>; + + //#endregion Methods + + } + + /** + * Used by an IListBinding to provide change notifications when items in a IListDataSource change. + **/ + interface IListNotificationHandler { + //#region Methods + + /** + * Indicates the start of a notification batch. Objects that are listening for notifications should defer making updates until endNotifications is called. + **/ + beginNotifications(): void; + + /** + * Indicates that an item changed. + * @param newItem The updated item. + * @param oldItem The original item. + **/ + changed(newItem: IItem, oldItem: IItem): void; + + /** + * Indicates that the number of items in the IListDataSource has changed. + * @param newCount The updated count. + * @param oldCount The original count. + **/ + countChanged(newCount: number, oldCount: number): void; + + /** + * Indicates the end of a notification batch. When the beginNotifications method is called, objects listening for notifications should defer making updates until endNotifications is called. + **/ + endNotifications(): void; + + /** + * Indicates that the index of an item changed. + * @param handle The temporary ID of the item. + * @param newIndex The new index. + * @param oldIndex The original index. + **/ + indexChanged(handle: string, newIndex: number, oldIndex: number): void; + + /** + * Indicates that an item was added to the IListDataSource. + * @param itemPromise A promise for the new IItem. + * @param previousHandle The temporary ID of the item that precedes the new item. + * @param nextHandle The temporary ID of the item that follows the new item. + **/ + inserted(itemPromise: IItemPromise, previousHandle: string, nextHandle: string): void; + + /** + * Indicates that an IItemPromise was fulfilled and that the item is now available. + * @param item The fulfilled item. + **/ + itemAvailable(item: IItem): void; + + /** + * Indicates that an item was moved. + * @param item A promise for the IItem that was moved. + * @param previousHandle The temporary ID of the item that now precedes the moved item. + * @param nextHandle The temporary ID of the item that now follows the moved item. + **/ + moved(item: IItemPromise, previousHandle: string, nextHandle: string): void; + + /** + * Indicates that an item was removed. + * @param handle The temporary ID of the item that was removed. + * @param mirage true if the item never actually existed; false if the item was actually present in the IListDataSource. + **/ + removed(handle: string, mirage: boolean): void; + + //#endregion Methods + + } /** * Used by ListView's currentItem API **/ interface IListViewItem { /** - * Gets or sets index of the ListView item. - **/ + * Gets or sets index of the ListView item. + **/ index?: number; /** - * Gets or sets key of the ListView item. - **/ + * Gets or sets key of the ListView item. + **/ key?: string; /** - * Gets or sets whether the ListView item is focused. - **/ + * Gets or sets whether the ListView item is focused. + **/ hasFocus?: boolean; /** - * Gets or sets whether the ListView item is focused and is showing its focus visual. - **/ + * Gets or sets whether the ListView item is focused and is showing its focus visual. + **/ showFocus?: boolean; } - /** - * Represents a selection of ListView items. - **/ - interface ISelection { - //#region Methods - - /** - * Adds one or more items to the selection. - * @param items The indexes or keys of the items to add. You can provide different types of objects for the items parameter: you can specify an index, a key, or a range of indexes. It can also be an array that contains one or more of these objects. For more info, see the Remarks section. - * @returns A Promise that is fulfilled when the operation completes. - **/ - add(items: any): Promise; - - /** - * Clears the selection. - * @returns A Promise that is fulfilled when the clear operation completes. - **/ - clear(): Promise; - - /** - * Returns the number of items in the selection. - * @returns The number of items in the selection. - **/ - count(): number; - - /** - * Returns a list of the indexes for the items in the selection. - * @returns The list of indexes for the items in the selection as an array of Number objects. - **/ - getIndices(): number[]; - - /** - * Returns an array that contains the items in the selection. - * @returns A Promise that contains an array of the requested IItem objects. - **/ - getItems(): Promise[]>; - - /** - * Gets an array of the index ranges for the selected items. - * @returns An array that contains an ISelectionRange object for each index range in the selection. - **/ - getRanges(): ISelectionRange[]; - - /** - * Returns a value that indicates whether the selection contains every item in the data source. - * @returns true if the selection contains every item in the data source; otherwise, false. - **/ - isEverything(): boolean; - - /** - * Removes the specified items from the selection. - * @param items The indexes or keys of the items to remove. You can provide different types of objects for the items parameter: you can specify an index, a key, or a range of indexes. It can also be an array that contains one or more of these objects. For more info, see the Remarks section. - * @returns A Promise that is fulfilled when the operation completes. - **/ - remove(items: any): Promise; - - /** - * Adds all the items in the ListView to the selection. - **/ - selectAll(): void; - - /** - * Clears the current selection and replaces it with the specified items. - * @param items The indexes or keys of the items that make up the selection. You can provide different types of objects for the items parameter: you can specify an index, a key, or a range of indexes. It can also be an array that contains one or more of these objects. For more info, see the Remarks section. - * @returns A Promise that is fulfilled when the operation completes. - **/ - set(items: any): Promise; - - //#endregion Methods - - } - - /** - * Represents a range of indexes or keys in an ISelection. - **/ - interface ISelectionRange { - //#region Properties - - /** - * Gets or sets the index of the first item in the range. - **/ - firstIndex: number; - - /** - * Gets or sets the key of the first item in the range. - **/ - firstKey: any; - - /** - * Gets or sets the index of the last item in the range. - **/ - lastIndex: number; - - /** - * Gets or sets of the key of the last item in the range. - **/ - lastKey: any; - - //#endregion Properties - - } - - /** - * Supports semantic zoom functionality by exposing a control as either the zoomed in or the zoomed out view of the SemanticZoom control. - **/ - interface IZoomableView { - //#region Methods - - /** - * Initiates semantic zoom on the custom control. - **/ - beginZoom(): void; - - /** - * Initializes the semantic zoom state for the custom control. - * @param isZoomedOut True if this is the zoomed out view; otherwise false. - * @param isCurrentView True if this is the current view; otherwise false. - * @param triggerZoom The function that manages semantic zoom behavior. Triggers a zoom in or zoom out if the control is the visible control. - * @param prefetchedPages The number of pages of content to pre-fetch for zooming. This value is dependent on the size of the semantic zoom container. More content can be displayed based on the zoom factor and the size of the container. - **/ - configureForZoom(isZoomedOut: boolean, isCurrentView: boolean, triggerZoom: Function, prefetchedPages: number): void; - - /** - * Terminates semantic zoom on the zoomed in or zoomed out child of the custom control. - * @param isCurrentView True if the control is the visible control; otherwise false. - **/ - endZoom(isCurrentView: boolean): void; - - /** - * Retrieves the current item of the zoomed in or zoomed out child of the custom control. - * @returns An object that represents the selected item. This return value must be a Promise for the following: item, position. - **/ - getCurrentItem(): Promise<{ item: T; position: Utilities.IPosition }>; - - /** - * Retrieves the panning axis of the zoomed-in or zoomed-out child of the custom control. - * @returns Identifies the panning axis of the child control. Implementation specific. - **/ - getPanAxis(): string; - - /** - * Manages pointer input for the custom control. - * @param pointerId The ID of the pointer. - **/ - handlePointer(pointerId: string): void; - - /** - * Positions the specified item within the viewport of the child control when panning or zooming begins. - * @param item The object to position within the viewport of the child control. item can be a number, a string, or an object with any number of properties. - * @param position An object that contains the position data of the item relative to the child control. position must be an object with four number properties: left, top, width, and height. These values specify a rectangle that is typically the bounding box of the current item, though the details are up to the control. The units of the position must be in pixels. And the coordinates must be relative to the top-left of the control viewport (which should occupy the same area as the semantic zoom viewport), except when in RTL mode. In RTL mode, return coordinates relative to the top-right off the control viewport. The rectangle is transformed from the coordinate system of one control to that of the other. - **/ - positionItem(item: T, position: Utilities.IPosition): void; - - /** - * Selects the item closest to the specified screen coordinates. - * @param x The x-coordinate in DIPs relative to the upper-left corner of the SemanticZoom viewport. - * @param y The y-coordinate in DIPs relative to the upper-left corner of the SemanticZoom viewport.. - **/ - setCurrentItem(x: number, y: number): void; - - //#endregion Methods - - } - - //#endregion Interfaces - - //#region Objects - - /** - * Represents an application toolbar for displaying commands. - **/ - class AppBar { - //#region Constructors - - /** - * Creates a new AppBar object. - * @constructor - * @param element The DOM element that will host the control. - * @param options The set of properties and values to apply to the new AppBar. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Occurs immediately after the AppBar is hidden. - * @param eventInfo An object that contains information about the event. - **/ - onafterhide(eventInfo: Event): void; - - /** - * Occurs after the AppBar is shown. - * @param eventInfo An object that contains information about the event. - **/ - onaftershow(eventInfo: Event): void; - - /** - * Occurs before the AppBar is hidden. - * @param eventInfo An object that contains information about the event. - **/ - onbeforehide(eventInfo: Event): void; - - /** - * Occurs before a hidden AppBar is shown. - * @param eventInfo An object that contains information about the event. - **/ - onbeforeshow(eventInfo: Event): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param type The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide. - * @param listener The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this AppBar. Call this method when the AppBar is no longer needed. After calling this method, the AppBar becomes unusable. - **/ - dispose(): void; - - /** - * Returns the AppBarCommand object identified by id. - * @param id The element idenitifier (ID) of the command to be returned. - * @returns The command identified by id. If multiple commands have the same ID, returns an array of all the commands matching the ID. - **/ - getCommandById(id: string): AppBarCommand; - - /** - * Hides the AppBar. - **/ - hide(): void; - - /** - * Hides the specified commands of the AppBar. - * @param commands The commands to hide. The array elements may be AppBarCommand objects, or the string identifiers (IDs) of commands. - * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to hide the commands immediately, without animating them; otherwise, false. - **/ - hideCommands(commands: any[], immediate?: boolean): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. - * @param listener The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Shows the AppBar if it is not disabled. - **/ - show(): void; - - /** - * Shows the specified commands of the AppBar. - * @param commands The commands to show. The array elements may be AppBarCommand objects, or the string identifiers (IDs) of commands. - * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the commands immediately, without animating them; otherwise, false. - **/ - showCommands(commands: any[], immediate?: boolean): void; - - /** - * Shows the specified commands of the AppBar while hiding all other commands. - * @param commands The commands to show. The array elements may be AppBarCommand objects, or the string identifiers (IDs) of commands. - * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the specified commands (and hide the others) immediately, without animating them; otherwise, false. - **/ - showOnlyCommands(commands: any[], immediate?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Sets the AppBarCommand objects that appear in the app bar. - **/ - commands: AppBarCommand[]; - - /** - * Gets or sets a value that indicates whether the AppBar is disabled. - **/ - disabled: boolean; - - /** - * Gets the DOM element that hosts the AppBar. - **/ - element: HTMLElement; - - /** - * Gets a value that indicates whether the AppBar is hidden or in the process of becoming hidden. - **/ - hidden: boolean; - - /** - * Gets or sets the layout of the app bar contents. - **/ - layout: string; - - /** - * Gets or sets a value that specifies whether the AppBar appears at the top or bottom of the main view. - **/ - placement: string; - - /** - * Gets or sets a value that indicates whether the AppBar is sticky (won't light dismiss). If not sticky, the app bar dismisses normally when the user touches outside of the appbar. - **/ - sticky: boolean; - - //#endregion Properties - - } - - /** - * Represents a command to be displayed in an app bar. - **/ - class AppBarCommand { - //#region Constructors - - /** - * Creates a new AppBarCommand object. - * @constructor - * @param element The DOM element that will host the control. - * @param options The set of properties and values to apply to the new AppBarCommand. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param type The event type to register. - * @param listener The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Releases resources held by this AppBarCommand. Call this method when the AppBarCommand is no longer needed. After calling this method, the AppBarCommand becomes unusable. - **/ - dispose(): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. - * @param listener The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(type: string, listener: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets a value that indicates whether the AppBarCommand is disabled. - **/ - disabled: boolean; - - /** - * Gets the DOM element that hosts the AppBarCommand. - **/ - element: HTMLElement; - - /** - * Adds an extra CSS class during construction. - **/ - extraClass: string; - - /** - * Gets or sets the HTMLElement with a 'content' type AppBarCommand that should receive focus whenever focus moves by the user pressing HOME or the arrow keys, from the previous AppBarCommand to this AppBarCommand. - **/ - firstElementFocus: HTMLElement; - - /** - * Gets or sets the Flyout object displayed by this command. The specified flyout is shown when the AppBarCommand's button is invoked. - **/ - flyout: Flyout; - - /** - * Gets or sets a value that indicates whether the AppBarCommand is hiding or in the process of becoming hidden. - **/ - hidden: boolean; - - /** - * Gets or sets the icon of the AppBarCommand. - **/ - icon: string; - - /** - * Gets the element identifier (ID) of the command. - **/ - id: string; - - /** - * Gets or sets the label of the command. - **/ - label: string; - - /** - * Gets or sets the HTMLElement with a 'content' type AppBarCommand that should receive focus whenever focus moves by the user pressing END or the arrow keys, from the previous AppBarCommand to this AppBarCommand. - **/ - lastElementFocus: HTMLElement; - - /** - * Gets or sets the function to be invoked when the command is clicked. - **/ - onclick: Function; - - /** - * Gets the section of the app bar that the command is in. - **/ - section: string; - - /** - * Gets or sets the selected state of a toggle button. - **/ - selected: boolean; - - /** - * Gets or sets the tooltip of the command. - **/ - tooltip: string; - - /** - * Gets the type of the command. - **/ - type: string; - - //#endregion Properties - - } - - /** - * Provides backwards navigation in the form of a button. - **/ - class BackButton { - //#region Constructors - - /** - * Creates a new BackButton. - * @constructor - * @param element The DOM element hosts the new BackButton. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this BackButton. Call this method when the BackButton is no longer needed. After calling this method, the BackButton becomes unusable. - **/ - dispose(): void; - - /** - * Checks the current navigation history and updates the value of the control's disabled attribute. - **/ - refresh(): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets the HTML element that hosts this BackButton. - **/ - element: HTMLElement; - - //#endregion Properties - - } - - /** - * Represents a layout for the ListView in which items are arranged in a grid and items can span multiple grid cells. - **/ - class CellSpanningLayout { - //#region Constructors - - /** - * Creates a new CellSpanningLayout. - * @constructor - * @param options An object that contains one or more property/value pairs to apply to the new CellSpanningLayout. Each property of the options object corresponds to one of the object's properties or events. Event names must begin with "on". - **/ - constructor(options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - dragLeave(): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - dragOver(): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - executeAnimations(): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param currentItem An object that describes the current item. It has these properties: index, type. - * @param pressedKey The key that was pressed. - * @returns An object that describes the next item that should receive focus. It has these properties: index, type. - **/ - getAdjacent(currentItem: any, pressedKey: WinJS.Utilities.Key): any; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param x The x-coordinate, or the horizontal position on the screen. - * @param y The y-coordinate, or the vertical position on the screen. - **/ - hitTest(x: number, y: number): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param site The rendering site for the layout. - * @param groupsEnabled Set to true if this layout supports groups; set to false if it does not. - **/ - initialize(site: ILayoutSite2, groupsEnabled: boolean): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param firstPixel The first pixel the range of items falls between. - * @param lastPixel The last pixel the range of items falls between. - **/ - itemsFromRange(firstPixel: number, lastPixel: number): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param tree - * @param changedRange - * @param modifiedItems - * @param modifiedGroups - **/ - layout(tree: ILayoutSite2, changedRange: any, modifiedItems: any, modifiedGroups: any): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - setupAnimations(): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - uninitialize(): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the position of group headers relative to their items. - **/ - groupHeaderPosition: WinJS.UI.HeaderPosition; - - /** - * Gets or sets a function that enables cell-spanning and establishes base cell dimensions. - **/ - groupInfo: Function; - - /** - * Gets or sets a function that returns the width and height of an item, as well as whether it should appear in a new column. Setting this function improves performance because the ListView can allocate space for an item without having to measure it first. - **/ - itemInfo: Function; - - /** - * Gets or set the maximum number of rows or columns, depending on the orientation, to display before content begins to wrap. - **/ - maximumRowsOrColumns: number; - - /** - * This API supports the Windows Library for JavaScript infrastructure and is not intended to be used directly from your code. - **/ - numberOfItemsPerItemsBlock: any; - - /** - * Gets the orientation of the CellSpanningLayout. For a CellSpanningLayout, this property always returns Orientation.horizontal. - **/ - orientation: WinJS.UI.Orientation; - - //#endregion Properties - - } - - /** - * Allows users to pick a date value. - **/ - class DatePicker { - //#region Constructors - - /** - * Initializes a new instance of the DatePicker control. - * @constructor - * @param element The DOM element associated with the DatePicker control. - * @param options The set of options to be applied initially to the DatePicker control. The options are the following: calendar, current, datePattern, disabled, maxYear, minYear, monthPattern, yearPattern. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Occurs when any of the controls are changed by the user. - * @param eventInfo An object that contains information about the event. - **/ - onchange(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Adds an event listener. - * @param type The type (name) of the event. - * @param listener The function that handles the event. - * @param capture If true, specifies that capture should be initiated, otherwise false. - **/ - addEventListener(type: string, listener: Function, capture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this DatePicker. Call this method when the DatePicker is no longer needed. After calling this method, the DatePicker becomes unusable. - **/ - dispose(): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - raiseEvent(type: string, eventProperties: any): boolean; - - /** - * Removes a listener for the specified event. - * @param type The name of the event for which to remove a listener. - * @param listener The listener. - * @param useCapture Optional. The same value that was passed to addEventListener for this listener. It may be omitted if it was omitted when calling addEventListener. - **/ - removeEventListener(type: string, listener: Function, useCapture?: any): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the calendar to use. - **/ - calendar: string; - - /** - * Gets or sets the current date of the DatePicker. You can use either a date string or a Date object to set this property. - **/ - current: Date; - - /** - * Gets or sets the display pattern for the date. The default date pattern is day.integer(2). You can change the date pattern by changing the number of integers displayed. - **/ - datePattern: string; - - /** - * Specifies whether the DatePicker is disabled. - **/ - disabled: boolean; - - /** - * Gets the DOM element for the DatePicker. - **/ - element: HTMLElement; - - /** - * Gets or sets the maximum Gregorian year available for picking. - **/ - maxYear: number; - - /** - * Gets or sets the minimum Gregorian year available for picking. - **/ - minYear: number; - - /** - * Gets or sets the display pattern for the month. The default month pattern is month.abbreviated. You can change the month pattern to the following values: month.full. The full name of the month. month.abbreviated(n). You can use abbreviated with or without specifying the number of letters in the abbreviation. If you do specify the number of letters, the actual length of the month name that appears may vary. month.solo.full. A representation of the month that is suitable for stand-alone display. You can also use month.solo.abbreviated(n). month.integer(n). You can use integer with or without specifying the number of integers. - **/ - monthPattern: string; - - /** - * Gets or sets the display pattern for the year. The default year pattern is year.full. You can change the year pattern to the following values: year.abbreviated(n). You can use abbreviated with or without specifying the number of letters in the abbreviation. - **/ - yearPattern: string; - - //#endregion Properties - - } - - /** - * Adds event-related methods to the control. - **/ - class DOMEventMixin { - //#region Methods - - /** - * Adds an event listener to the control. - * @param type The type (name) of the event. - * @param listener The listener to invoke when the event gets raised. - * @param useCapture true to initiate capture; otherwise, false. - **/ - addEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type, adding the specified additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Removes an event listener from the control. - * @param type The type (name) of the event. - * @param listener The listener to remove. - * @param useCapture true to initiate capture; otherwise, false. - **/ - removeEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Adds the set of declaratively specified options (properties and events) to the specified control. If the name of the options property begins with "on", the property value is a function and the control supports addEventListener. This method calls the addEventListener method on the control. - * @param control The control on which the properties and events are to be applied. - * @param options The set of options that are specified declaratively. - **/ - setOptions(control: any, options: any): void; - - //#endregion Methods - - } - - /** - * Displays a collection, such as a set of photos, one item at a time. - **/ - class FlipView { - //#region Constructors - - /** - * Creates a new FlipView. - * @constructor - * @param element The DOM element that hosts the control. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the pageselected event, add a property named "onpageselected" and set its value to the event handler. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Occurs when the datasource count changes. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: source. - **/ - ondatasourcecountchanged(eventInfo: Event): void; - - /** - * Raised when the FlipView flips to a page and its renderer function completes. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.source. - **/ - onpagecompleted(eventInfo: CustomEvent): void; - - /** - * Raised when the FlipView flips to a page. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.source. - **/ - onpageselected(eventInfo: CustomEvent): void; - - /** - * Occurs when an item becomes invisible or visible. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.source, detail.visible. - **/ - onpagevisibilitychanged(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. For a list of events, see the FlipView object page. - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Returns the number of items in the FlipView control's itemDataSource. - * @returns A Promise that contains the number of items in the list or WinJS.UI.CountResult.unknown if the count is unavailable. - **/ - count(): Promise; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this FlipView. Call this method when the FlipView is no longer needed. After calling this method, the FlipView becomes unusable. - **/ - dispose(): void; - - /** - * Forces the FlipView to update its layout. Use this function when making the FlipView visible again after its style.display property had been set to "none". - **/ - forceLayout(): void; - - /** - * Navigates to the next page. - * @returns true if the FlipView begins navigating to the next page; false if the FlipView is already at the last item or is in the middle of another navigation animation. - **/ - next(): boolean; - - /** - * Navigates to the previous item. - * @returns true if the FlipView begins navigating to the previous page; nfalse if the FlipView is already at the first page or is in the middle of another navigation animation. - **/ - previous(): boolean; - - /** - * Unregisters an event handler for the specified event. - * @param eventName The name of the event. - * @param eventHandler The event handler function to remove. - * @param useCapture Set to true to unregister the event handler for the capturing phase; otherwise, set to false to unregister the event handler for the bubbling phase. - **/ - removeEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Sets custom animations for the FlipView to use when navigating between pages. - * @param animations An object that contains up to three fields, one for each navigation action: next, previous, and jump. Each of those fields must be a function with this signature: function (outgoingPage, incomingPage) Each function must return a WinJS.Promise that completes once the animations are finished. If a field is null or undefined, the FlipView reverts to its default animation for that action. - **/ - setCustomAnimations(animations: any): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the index of the currently displayed page. - **/ - currentPage: number; - - /** - * Gets the HTML element that hosts this FlipView. - **/ - element: HTMLElement; - - /** - * Gets or sets the data source that provides the FlipView with items to display. The FlipView displays one item at a time, on its own page. - **/ - itemDataSource: IListDataSource; - - /** - * Gets or sets the spacing between each item, in pixels. - **/ - itemSpacing: number; - - /** - * Gets or sets a Template or function that defines the HTML for each item's page. - **/ - itemTemplate: any; - - /** - * Gets or sets the orientation of the FlipView, horizontal or vertical. - **/ - orientation: string; - - //#endregion Properties - - } - - /** - * Displays lightweight UI that is either information, or requires user interaction. Unlike a dialog, a Flyout can be light dismissed by clicking or tapping off of it. - **/ - class Flyout { - //#region Constructors - - /** - * Creates a new Flyout object. - * @constructor - * @param element The DOM element that will host the control. - * @param options The set of properties and values to apply to the new Flyout. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Raised immediately after a flyout is fully hidden. - * @param eventInfo An object that contains information about the event. - **/ - onafterhide(eventInfo: Event): void; - - /** - * Raised immediately after a flyout is fully shown. - * @param eventInfo An object that contains information about the event. - **/ - onaftershow(eventInfo: Event): void; - - /** - * Raised just before hiding a flyout. - * @param eventInfo An object that contains information about the event. - **/ - onbeforehide(eventInfo: Event): void; - - /** - * Raised just before showing a flyout. - * @param eventInfo An object that contains information about the event. - **/ - onbeforeshow(eventInfo: Event): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param type The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide. - * @param listener The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Releases resources held by this object. Call this method when the object is no longer needed. After calling this method, the object becomes unusable. - **/ - dispose(): void; - - /** - * Hides the Flyout, if visible, regardless of other states. - **/ - hide(): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. - * @param listener The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Shows the Flyout, if hidden, regardless of other states. - * @param anchor Required. The DOM element to anchor the Flyout. - * @param placement The placement of the Flyout to the anchor: the string literal "top", "bottom", "left", or "right". - * @param alignment For "top" or "bottom" placement, the alignment of the Flyout to the anchor's edge: the string literal "center", "left", or "right". - **/ - show(anchor: HTMLElement, placement: string, alignment: string): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the default alignment to be used for this Flyout. - **/ - alignment: string; - - /** - * Gets or sets the default anchor to be used for this Flyout. - **/ - anchor: HTMLElement; - - /** - * Gets the DOM element that hosts the Flyout. - **/ - element: HTMLElement; - - /** - * Gets a value that indicates whether the Flyout is hidden or in the process of becoming hidden. - **/ - hidden: boolean; - - /** - * Gets or sets the default placement to be used for this Flyout. - **/ - placement: string; - - //#endregion Properties - - } - - /** - * Represents a grid layout for the ListView in which items are arranged in a horizontal grid. - **/ - class GridLayout { - //#region Constructors - - /** - * Creates a new GridLayout object. - * @constructor - * @param options The set of properties and values to apply to the new GridLayout. - **/ - constructor(options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * This method is no longer supported. - * @param beginScrollPosition - * @param wholeItem - **/ - calculateFirstVisible(beginScrollPosition: number, wholeItem: boolean): void; - - /** - * This method is no longer supported. - * @param endScrollPosition - * @param wholeItem - **/ - calculateLastVisible(endScrollPosition: number, wholeItem: boolean): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - dragLeave(): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - dragOver(): void; - - /** - * This method is no longer supported. - **/ - endLayout(): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - executeAnimations(): void; - - /** - * This method is no longer supported. - * @param itemIndex - **/ - getItemPosition(itemIndex: number): void; - - /** - * This method is no longer supported. - * @param itemIndex - * @param element - * @param keyPressed - **/ - getKeyboardNavigatedItem(itemIndex: number, element: any, keyPressed: any): void; - - /** - * This method is no longer supported. - * @param beginScrollPosition - * @param endScrollPosition - **/ - getScrollbarRange(beginScrollPosition: number, endScrollPosition: number): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param x The x-coordinate, or the horizontal position on the screen. - * @param y The y-coordinate, or the vertical position on the screen. - **/ - hitTest(x: number, y: number): void; - - /** - * This method is no longer supported. - **/ - init(): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param site The rendering site for the layout. - * @param groupsEnabled Set to true if this layout supports groups; set to false if it does not. - **/ - initialize(site: ILayoutSite2, groupsEnabled: boolean): void; - - /** - * This method is no longer supported. - * @param elements - **/ - itemsAdded(elements: any): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param firstPixel The first pixel the range of items falls between. - * @param lastPixel The last pixel the range of items falls between. - **/ - itemsFromRange(firstPixel: number, lastPixel: number): void; - - /** - * This method is no longer supported. - **/ - itemsMoved(): void; - - /** - * This method is no longer supported. - * @param elements - **/ - itemsRemoved(elements: any): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param tree - * @param changedRange - * @param modifiedItems - * @param modifiedGroups - **/ - layout(tree: any, changedRange: any, modifiedItems: any, modifiedGroups: any): void; - - /** - * This method is no longer supported. - * @param groupIndex - * @param element A DOM element. - **/ - layoutHeader(groupIndex: number, element: any): void; - - /** - * This method is no longer supported. - * @param itemIndex - * @param element A DOM element. - **/ - layoutItem(itemIndex: number, element: any): void; - - /** - * This method is no longer supported. - * @param element - **/ - prepareHeader(element: HTMLElement): void; - - /** - * This method is no longer supported. - * @param itemIndex - * @param element A DOM element. - **/ - prepareItem(itemIndex: number, element: any): void; - - /** - * This method is no longer supported. - * @param item - * @param newItem - **/ - releaseItem(item: any, newItem: any): void; - - /** - * This method is no longer supported. - **/ - reset(): void; - - /** - * This method is no longer supported. - * @param layoutSite - **/ - setSite(layoutSite: any): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - setupAnimations(): void; - - /** - * This method is no longer supported. - * @param beginScrollPosition - * @param endScrollPositionScrollPosition - **/ - startLayout(beginScrollPosition: number, endScrollPositionScrollPosition: number): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - uninitialize(): void; - - /** - * This method is no longer supported. - * @param count - **/ - updateBackdrop(count: number): void; - - //#endregion Methods - - //#region Properties - - /** - * This property is no longer supported. Starting with Windows Library for JavaScript 2.0, use the .win-listview.win-container.win-backdrop CSS selector. - **/ - backdropColor: string; - - /** - * This property is no longer supported. Starting with Windows Library for JavaScript 2.0, use the .win-listview.win-container.win-backdrop CSS selector. - **/ - disableBackdrop: boolean; - - /** - * Gets or sets the position of group headers. - **/ - groupHeaderPosition: WinJS.UI.HeaderPosition; - - /** - * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use a CellSpanningLayout. - **/ - groupInfo: Function; - - /** - * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use the orientation property instead. - **/ - horizontal: boolean; - - /** - * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use a CellSpanningLayout. - **/ - itemInfo: Function; - - /** - * Gets or set the maximum number of rows or columns, depending on the orientation, to display before content begins to wrap. - **/ - maximumRowsOrColumns: number; - - /** - * This property is no longer supported. Starting with Windows Library for JavaScript 2.0, use the maximumRowsOrColumns property. - **/ - maxRows: number; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - numberOfItemsPerItemsBlock: any; - - /** - * Gets or sets the orientation of the GridLayout. - **/ - orientation: WinJS.UI.Orientation; - - //#endregion Properties - - } - - /** - * Creates a hub navigation pattern consisting of sections that can be navigated to. Each section is defined by a HubSection object. - **/ - class Hub { - //#region Constructors - - /** - * Creates a new Hub control. - * @constructor - * @param element The DOM element that will host the Hub control. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the contentanimating event, add a property named "oncontentanimating" to the options object and set its value to the event handler. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Raised when the Hub is about to play entrance, content transition, insert, or remove animations. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.type, detail.index, detail.section. - **/ - oncontentanimating(eventInfo: CustomEvent): void; - - /** - * Raised when the user clicks on an interactive header. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.index, detail.section. - **/ - onheaderinvoked(eventInfo: CustomEvent): void; - - /** - * Raised when the Hub control's loadingState changes. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: loadingState. - **/ - onloadingstatechanged(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this Hub. Call this method when the Hub is no longer needed. After calling this method, the Hub becomes unusable. - **/ - dispose(): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets the DOM element that hosts the Hub control. - **/ - element: HTMLElement; - - /** - * Gets or sets the Template or templating function that creates the DOM elements for each HubSection header. Your HubSection object should provide strings for HubSection.header property. - **/ - headerTemplate: any; - - /** - * Gets or sets the index of the first HubSection at least partially in view. This property is useful for animating the visible content in the Hub. - **/ - indexOfFirstVisible: number; - - /** - * Gets or sets the index of last HubSection at least partially in view. Used for animating the visible content in the Hub. - **/ - indexOfLastVisible: number; - - /** - * Gets a value that indicates whether the hub is still loading or whether loading is complete. The value changes to complete after all the sections and content inside them has loaded. - **/ - loadingState: string; - - /** - * Gets or sets the orientation of sections within the Hub. - **/ - orientation: Orientation; - - /** - * Gets or sets the distance between the start of the Hub and the current viewable area. - **/ - scrollPosition: number; - - /** - * Gets or sets the index of the first visible HubSection. - **/ - sectionOnScreen: number; - - /** - * Gets or sets the List that contains the HubSection objects that belong to this Hub. - **/ - sections: WinJS.Binding.List; - - /** - * This API supports the SemanticZoom infrastructure and is not intended to be used directly from your code. - **/ - zoomableView: IZoomableView; - - //#endregion Properties - - } - - /** - * Defines a section of a Hub. - **/ - class HubSection { - //#region Constructors - - /** - * Creates a new HubSection. - * @constructor - * @param element The DOM element hosts the new HubSection. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * Releases resources held by this HubSection. Call this method when the HubSection is no longer needed. After calling this method, the HubSection becomes unusable. - **/ - dispose(): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets the DOM element that hosts the HubSection control's content. - **/ - contentElement: HTMLElement; - - /** - * Gets the DOM element that hosts this HubSection. - **/ - element: HTMLElement; - - /** - * Gets or sets the header for this HubSection. - **/ - header: string; - - /** - * Gets a value that specifies whether the header is static. - **/ - isHeaderStatic: boolean; - - //#endregion Properties - - } - - /** - * Enables you to include an HTML page dynamically. As part of the constructor, you must include an option indicating the URI of the page. - **/ - class HtmlControl { - //#region Constructors - - /** - * Initializes a new instance of HtmlControl to define a new page control. - * @constructor - * @param element The element that hosts the HtmlControl. - * @param options The options for configuring the page. The uri option is required in order to specify the source document for the content of the page. Other options are the ones used by the WinJS.Pages.render method. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - } - - /** - * Defines an item that can be pressed, swiped, and dragged. - **/ - class ItemContainer { - //#region Constructors - - /** - * Creates a new ItemContainer. - * @constructor - * @param element The DOM element hosts the new ItemContainer. For the ItemContainer to be accessible, this element must have its role attribute set to "list" or "listbox". If tapBehavior is set to none and selectionDisabled is true, then use the "list" role; otherwise, use the "listbox" role. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Raised when the item is invoked. (You can use the tapBehavior property to specify whether taps and clicks invoke the item.) - * @param eventInfo An object that contains information about the event. - **/ - oninvoked(eventInfo: CustomEvent): void; - - /** - * Raised after the item is selected or deselected. - * @param eventInfo An object that contains information about the event. - **/ - onselectionchanged(eventInfo: CustomEvent): void; - - /** - * Raised just before the current selection changes. - * @param eventInfo An object that contains information about the event. - **/ - onselectionchanging(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this ItemContainer. Call this method when the ItemContainer is no longer needed. After calling this method, the ItemContainer becomes unusable. - **/ - dispose(): void; - - /** - * Forces the ItemContainer to update its layout. Call this function when the reading direction of the app changes after the control has been initialized. - **/ - forceLayout(): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets a value that specifies whether the item can be dragged. - **/ - draggable: boolean; - - /** - * Gets the element that hosts this ItemContainer. - **/ - element: HTMLElement; - - /** - * Gets or sets a value that specifies whether the item is selected. - **/ - selected: boolean; - - /** - * Gets or sets a value that specifies whether selection of this item is disabled. - **/ - selectionDisabled: boolean; - - /** - * Gets or sets how the ItemContainer reacts to the swipe gesture. The swipe gesture can select the swiped items or can have no effect on the current selection. - **/ - swipeBehavior: WinJS.UI.SwipeBehavior; - - /** - * Gets or sets the orientation of swipe gestures. - **/ - swipeOrientation: Orientation; - - /** - * Gets or sets how the ItemContainer reacts when the user taps or clicks an item. - **/ - tapBehavior: TapBehavior; - - //#endregion Properties - - } - - /** - * This object supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - class Layout { - } - - /** - * Represents a layout for the ListView in which items are arranged in a vertical list. - **/ - class ListLayout { - //#region Constructors - - /** - * Creates a new ListLayout. - * @constructor - * @param options An object that contains one or more property/value pairs to apply to the new ListLayout. Each property of the options object corresponds to one of the object's properties or events. Event names must begin with "on". - **/ - constructor(options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * This method is no longer supported. - * @param beginScrollPosition - * @param wholeItem - **/ - calculateFirstVisible(beginScrollPosition: number, wholeItem: boolean): void; - - /** - * This method is no longer supported. - * @param endScrollPosition - * @param wholeItem - **/ - calculateLastVisible(endScrollPosition: number, wholeItem: boolean): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - dragLeave(): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - dragOver(): void; - - /** - * This method is no longer supported. - **/ - endLayout(): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - executeAnimations(): void; - - /** - * This method is no longer supported. - * @param itemIndex - **/ - getItemPosition(itemIndex: number): void; - - /** - * This method is no longer supported. - * @param itemIndex - * @param element - * @param keyPressed - **/ - getKeyboardNavigatedItem(itemIndex: number, element: HTMLElement, keyPressed: any): void; - - /** - * This method is no longer supported. - * @param beginScrollPosition - * @param endScrollPosition - **/ - getScrollbarRange(beginScrollPosition: number, endScrollPosition: number): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param x The x-coordinate, or the horizontal position on the screen. - * @param y The y-coordinate, or the vertical position on the screen. - **/ - hitTest(x: number, y: number): void; - - /** - * This method is no longer supported. - **/ - init(): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - initialize(): void; - - /** - * This method is no longer supported. - * @param elements - **/ - itemsAdded(elements: any): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param firstPixel - * @param lastPixel - **/ - itemsFromRange(firstPixel: number, lastPixel: number): void; - - /** - * This method is no longer supported. - **/ - itemsMoved(): void; - - /** - * This method is no longer supported. - * @param elements - **/ - itemsRemoved(elements: any): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - * @param tree - * @param changedRange - * @param modifiedItems - * @param modifiedGroups - **/ - layout(tree: any, changedRange: any, modifiedItems: any, modifiedGroups: any): void; - - /** - * This method is no longer supported. - * @param groupIndex - * @param element A DOM element. - **/ - layoutHeader(groupIndex: number, element: any): void; - - /** - * This method is no longer supported. - * @param itemIndex - * @param element A DOM element. - **/ - layoutItem(itemIndex: number, element: any): void; - - /** - * This method is no longer supported. - * @param element - **/ - prepareHeader(element: HTMLElement): void; - - /** - * This method is no longer supported. - * @param itemIndex - * @param element A DOM element. - **/ - prepareItem(itemIndex: number, element: any): void; - - /** - * This method is no longer supported. - * @param item - * @param newItem - **/ - releaseItem(item: any, newItem: any): void; - - /** - * This method is no longer supported. - **/ - reset(): void; - - /** - * This method is no longer supported. - * @param layoutSite - **/ - setSite(layoutSite: any): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - setupAnimations(): void; - - /** - * This method is no longer supported. - * @param beginScrollPosition - * @param endScrollPositionScrollPosition - **/ - startLayout(beginScrollPosition: number, endScrollPositionScrollPosition: number): void; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - uninitialize(): void; - - /** - * This method is no longer supported. - * @param count - **/ - updateBackdrop(count: number): void; - - //#endregion Methods - - //#region Properties - - /** - * This property is no longer supported. Starting with Windows Library for JavaScript 2.0, use the .win-listview.win-container.win-backdrop CSS selector. - **/ - backdropColor: string; - - /** - * This property is no longer supported. Starting with Windows Library for JavaScript 2.0, use the .win-listview.win-container.win-backdrop CSS selector. - **/ - disableBackdrop: boolean; - - /** - * Gets or sets the position of group headers. - **/ - groupHeaderPosition: WinJS.UI.HeaderPosition; - - /** - * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use a CellSpanningLayout. - **/ - groupInfo: Function; - - /** - * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use the orientation property instead. - **/ - horizontal: boolean; - - /** - * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use a CellSpanningLayout. - **/ - itemInfo: Function; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - numberOfItemsPerItemsBlock: any; - - /** - * Gets or sets the orientation of the GridLayout. - **/ - orientation: WinJS.UI.Orientation; - - //#endregion Properties - - } - - /** - * Displays data items in a customizable list or grid. - **/ + /** + * Represents a selection of ListView items. + **/ + interface ISelection { + //#region Methods + + /** + * Adds one or more items to the selection. + * @param items The indexes or keys of the items to add. You can provide different types of objects for the items parameter: you can specify an index, a key, or a range of indexes. It can also be an array that contains one or more of these objects. For more info, see the Remarks section. + * @returns A Promise that is fulfilled when the operation completes. + **/ + add(items: any): Promise; + + /** + * Clears the selection. + * @returns A Promise that is fulfilled when the clear operation completes. + **/ + clear(): Promise; + + /** + * Returns the number of items in the selection. + * @returns The number of items in the selection. + **/ + count(): number; + + /** + * Returns a list of the indexes for the items in the selection. + * @returns The list of indexes for the items in the selection as an array of Number objects. + **/ + getIndices(): number[]; + + /** + * Returns an array that contains the items in the selection. + * @returns A Promise that contains an array of the requested IItem objects. + **/ + getItems(): Promise[]>; + + /** + * Gets an array of the index ranges for the selected items. + * @returns An array that contains an ISelectionRange object for each index range in the selection. + **/ + getRanges(): ISelectionRange[]; + + /** + * Returns a value that indicates whether the selection contains every item in the data source. + * @returns true if the selection contains every item in the data source; otherwise, false. + **/ + isEverything(): boolean; + + /** + * Removes the specified items from the selection. + * @param items The indexes or keys of the items to remove. You can provide different types of objects for the items parameter: you can specify an index, a key, or a range of indexes. It can also be an array that contains one or more of these objects. For more info, see the Remarks section. + * @returns A Promise that is fulfilled when the operation completes. + **/ + remove(items: any): Promise; + + /** + * Adds all the items in the ListView to the selection. + **/ + selectAll(): void; + + /** + * Clears the current selection and replaces it with the specified items. + * @param items The indexes or keys of the items that make up the selection. You can provide different types of objects for the items parameter: you can specify an index, a key, or a range of indexes. It can also be an array that contains one or more of these objects. For more info, see the Remarks section. + * @returns A Promise that is fulfilled when the operation completes. + **/ + set(items: any): Promise; + + //#endregion Methods + + } + + /** + * Represents a range of indexes or keys in an ISelection. + **/ + interface ISelectionRange { + //#region Properties + + /** + * Gets or sets the index of the first item in the range. + **/ + firstIndex: number; + + /** + * Gets or sets the key of the first item in the range. + **/ + firstKey: any; + + /** + * Gets or sets the index of the last item in the range. + **/ + lastIndex: number; + + /** + * Gets or sets of the key of the last item in the range. + **/ + lastKey: any; + + //#endregion Properties + + } + + /** + * Supports semantic zoom functionality by exposing a control as either the zoomed in or the zoomed out view of the SemanticZoom control. + **/ + interface IZoomableView { + //#region Methods + + /** + * Initiates semantic zoom on the custom control. + **/ + beginZoom(): void; + + /** + * Initializes the semantic zoom state for the custom control. + * @param isZoomedOut True if this is the zoomed out view; otherwise false. + * @param isCurrentView True if this is the current view; otherwise false. + * @param triggerZoom The function that manages semantic zoom behavior. Triggers a zoom in or zoom out if the control is the visible control. + * @param prefetchedPages The number of pages of content to pre-fetch for zooming. This value is dependent on the size of the semantic zoom container. More content can be displayed based on the zoom factor and the size of the container. + **/ + configureForZoom(isZoomedOut: boolean, isCurrentView: boolean, triggerZoom: Function, prefetchedPages: number): void; + + /** + * Terminates semantic zoom on the zoomed in or zoomed out child of the custom control. + * @param isCurrentView True if the control is the visible control; otherwise false. + **/ + endZoom(isCurrentView: boolean): void; + + /** + * Retrieves the current item of the zoomed in or zoomed out child of the custom control. + * @returns An object that represents the selected item. This return value must be a Promise for the following: item, position. + **/ + getCurrentItem(): Promise<{ item: T; position: Utilities.IPosition }>; + + /** + * Retrieves the panning axis of the zoomed-in or zoomed-out child of the custom control. + * @returns Identifies the panning axis of the child control. Implementation specific. + **/ + getPanAxis(): string; + + /** + * Manages pointer input for the custom control. + * @param pointerId The ID of the pointer. + **/ + handlePointer(pointerId: string): void; + + /** + * Positions the specified item within the viewport of the child control when panning or zooming begins. + * @param item The object to position within the viewport of the child control. item can be a number, a string, or an object with any number of properties. + * @param position An object that contains the position data of the item relative to the child control. position must be an object with four number properties: left, top, width, and height. These values specify a rectangle that is typically the bounding box of the current item, though the details are up to the control. The units of the position must be in pixels. And the coordinates must be relative to the top-left of the control viewport (which should occupy the same area as the semantic zoom viewport), except when in RTL mode. In RTL mode, return coordinates relative to the top-right off the control viewport. The rectangle is transformed from the coordinate system of one control to that of the other. + **/ + positionItem(item: T, position: Utilities.IPosition): void; + + /** + * Selects the item closest to the specified screen coordinates. + * @param x The x-coordinate in DIPs relative to the upper-left corner of the SemanticZoom viewport. + * @param y The y-coordinate in DIPs relative to the upper-left corner of the SemanticZoom viewport.. + **/ + setCurrentItem(x: number, y: number): void; + + //#endregion Methods + + } + + //#endregion Interfaces + + //#region Objects + + /** + * Represents an application toolbar for displaying commands. + **/ + class AppBar { + //#region Constructors + + /** + * Creates a new AppBar object. + * @constructor + * @param element The DOM element that will host the control. + * @param options The set of properties and values to apply to the new AppBar. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Occurs immediately after the AppBar is hidden. + * @param eventInfo An object that contains information about the event. + **/ + onafterhide(eventInfo: Event): void; + + /** + * Occurs after the AppBar is shown. + * @param eventInfo An object that contains information about the event. + **/ + onaftershow(eventInfo: Event): void; + + /** + * Occurs before the AppBar is hidden. + * @param eventInfo An object that contains information about the event. + **/ + onbeforehide(eventInfo: Event): void; + + /** + * Occurs before a hidden AppBar is shown. + * @param eventInfo An object that contains information about the event. + **/ + onbeforeshow(eventInfo: Event): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param type The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide. + * @param listener The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this AppBar. Call this method when the AppBar is no longer needed. After calling this method, the AppBar becomes unusable. + **/ + dispose(): void; + + /** + * Returns the AppBarCommand object identified by id. + * @param id The element idenitifier (ID) of the command to be returned. + * @returns The command identified by id. If multiple commands have the same ID, returns an array of all the commands matching the ID. + **/ + getCommandById(id: string): AppBarCommand; + + /** + * Hides the AppBar. + **/ + hide(): void; + + /** + * Hides the specified commands of the AppBar. + * @param commands The commands to hide. The array elements may be AppBarCommand objects, or the string identifiers (IDs) of commands. + * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to hide the commands immediately, without animating them; otherwise, false. + **/ + hideCommands(commands: any[], immediate?: boolean): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. + * @param listener The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Shows the AppBar if it is not disabled. + **/ + show(): void; + + /** + * Shows the specified commands of the AppBar. + * @param commands The commands to show. The array elements may be AppBarCommand objects, or the string identifiers (IDs) of commands. + * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the commands immediately, without animating them; otherwise, false. + **/ + showCommands(commands: any[], immediate?: boolean): void; + + /** + * Shows the specified commands of the AppBar while hiding all other commands. + * @param commands The commands to show. The array elements may be AppBarCommand objects, or the string identifiers (IDs) of commands. + * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the specified commands (and hide the others) immediately, without animating them; otherwise, false. + **/ + showOnlyCommands(commands: any[], immediate?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Sets the AppBarCommand objects that appear in the app bar. + **/ + commands: AppBarCommand[]; + + /** + * Gets or sets a value that indicates whether the AppBar is disabled. + **/ + disabled: boolean; + + /** + * Gets the DOM element that hosts the AppBar. + **/ + element: HTMLElement; + + /** + * Gets a value that indicates whether the AppBar is hidden or in the process of becoming hidden. + **/ + hidden: boolean; + + /** + * Gets or sets the layout of the app bar contents. + **/ + layout: string; + + /** + * Gets or sets a value that specifies whether the AppBar appears at the top or bottom of the main view. + **/ + placement: string; + + /** + * Gets or sets a value that indicates whether the AppBar is sticky (won't light dismiss). If not sticky, the app bar dismisses normally when the user touches outside of the appbar. + **/ + sticky: boolean; + + //#endregion Properties + + } + + /** + * Represents a command to be displayed in an app bar. + **/ + class AppBarCommand { + //#region Constructors + + /** + * Creates a new AppBarCommand object. + * @constructor + * @param element The DOM element that will host the control. + * @param options The set of properties and values to apply to the new AppBarCommand. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param type The event type to register. + * @param listener The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Releases resources held by this AppBarCommand. Call this method when the AppBarCommand is no longer needed. After calling this method, the AppBarCommand becomes unusable. + **/ + dispose(): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. + * @param listener The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(type: string, listener: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets a value that indicates whether the AppBarCommand is disabled. + **/ + disabled: boolean; + + /** + * Gets the DOM element that hosts the AppBarCommand. + **/ + element: HTMLElement; + + /** + * Adds an extra CSS class during construction. + **/ + extraClass: string; + + /** + * Gets or sets the HTMLElement with a 'content' type AppBarCommand that should receive focus whenever focus moves by the user pressing HOME or the arrow keys, from the previous AppBarCommand to this AppBarCommand. + **/ + firstElementFocus: HTMLElement; + + /** + * Gets or sets the Flyout object displayed by this command. The specified flyout is shown when the AppBarCommand's button is invoked. + **/ + flyout: Flyout; + + /** + * Gets or sets a value that indicates whether the AppBarCommand is hiding or in the process of becoming hidden. + **/ + hidden: boolean; + + /** + * Gets or sets the icon of the AppBarCommand. + **/ + icon: string; + + /** + * Gets the element identifier (ID) of the command. + **/ + id: string; + + /** + * Gets or sets the label of the command. + **/ + label: string; + + /** + * Gets or sets the HTMLElement with a 'content' type AppBarCommand that should receive focus whenever focus moves by the user pressing END or the arrow keys, from the previous AppBarCommand to this AppBarCommand. + **/ + lastElementFocus: HTMLElement; + + /** + * Gets or sets the function to be invoked when the command is clicked. + **/ + onclick: Function; + + /** + * Gets the section of the app bar that the command is in. + **/ + section: string; + + /** + * Gets or sets the selected state of a toggle button. + **/ + selected: boolean; + + /** + * Gets or sets the tooltip of the command. + **/ + tooltip: string; + + /** + * Gets the type of the command. + **/ + type: string; + + //#endregion Properties + + } + + /** + * Provides backwards navigation in the form of a button. + **/ + class BackButton { + //#region Constructors + + /** + * Creates a new BackButton. + * @constructor + * @param element The DOM element hosts the new BackButton. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this BackButton. Call this method when the BackButton is no longer needed. After calling this method, the BackButton becomes unusable. + **/ + dispose(): void; + + /** + * Checks the current navigation history and updates the value of the control's disabled attribute. + **/ + refresh(): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets the HTML element that hosts this BackButton. + **/ + element: HTMLElement; + + //#endregion Properties + + } + + /** + * Represents a layout for the ListView in which items are arranged in a grid and items can span multiple grid cells. + **/ + class CellSpanningLayout { + //#region Constructors + + /** + * Creates a new CellSpanningLayout. + * @constructor + * @param options An object that contains one or more property/value pairs to apply to the new CellSpanningLayout. Each property of the options object corresponds to one of the object's properties or events. Event names must begin with "on". + **/ + constructor(options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + dragLeave(): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + dragOver(): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + executeAnimations(): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param currentItem An object that describes the current item. It has these properties: index, type. + * @param pressedKey The key that was pressed. + * @returns An object that describes the next item that should receive focus. It has these properties: index, type. + **/ + getAdjacent(currentItem: any, pressedKey: WinJS.Utilities.Key): any; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param x The x-coordinate, or the horizontal position on the screen. + * @param y The y-coordinate, or the vertical position on the screen. + **/ + hitTest(x: number, y: number): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param site The rendering site for the layout. + * @param groupsEnabled Set to true if this layout supports groups; set to false if it does not. + **/ + initialize(site: ILayoutSite2, groupsEnabled: boolean): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param firstPixel The first pixel the range of items falls between. + * @param lastPixel The last pixel the range of items falls between. + **/ + itemsFromRange(firstPixel: number, lastPixel: number): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param tree + * @param changedRange + * @param modifiedItems + * @param modifiedGroups + **/ + layout(tree: ILayoutSite2, changedRange: any, modifiedItems: any, modifiedGroups: any): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + setupAnimations(): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + uninitialize(): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the position of group headers relative to their items. + **/ + groupHeaderPosition: WinJS.UI.HeaderPosition; + + /** + * Gets or sets a function that enables cell-spanning and establishes base cell dimensions. + **/ + groupInfo: Function; + + /** + * Gets or sets a function that returns the width and height of an item, as well as whether it should appear in a new column. Setting this function improves performance because the ListView can allocate space for an item without having to measure it first. + **/ + itemInfo: Function; + + /** + * Gets or set the maximum number of rows or columns, depending on the orientation, to display before content begins to wrap. + **/ + maximumRowsOrColumns: number; + + /** + * This API supports the Windows Library for JavaScript infrastructure and is not intended to be used directly from your code. + **/ + numberOfItemsPerItemsBlock: any; + + /** + * Gets the orientation of the CellSpanningLayout. For a CellSpanningLayout, this property always returns Orientation.horizontal. + **/ + orientation: WinJS.UI.Orientation; + + //#endregion Properties + + } + + /** + * Allows users to pick a date value. + **/ + class DatePicker { + //#region Constructors + + /** + * Initializes a new instance of the DatePicker control. + * @constructor + * @param element The DOM element associated with the DatePicker control. + * @param options The set of options to be applied initially to the DatePicker control. The options are the following: calendar, current, datePattern, disabled, maxYear, minYear, monthPattern, yearPattern. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Occurs when any of the controls are changed by the user. + * @param eventInfo An object that contains information about the event. + **/ + onchange(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Adds an event listener. + * @param type The type (name) of the event. + * @param listener The function that handles the event. + * @param capture If true, specifies that capture should be initiated, otherwise false. + **/ + addEventListener(type: string, listener: Function, capture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this DatePicker. Call this method when the DatePicker is no longer needed. After calling this method, the DatePicker becomes unusable. + **/ + dispose(): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + raiseEvent(type: string, eventProperties: any): boolean; + + /** + * Removes a listener for the specified event. + * @param type The name of the event for which to remove a listener. + * @param listener The listener. + * @param useCapture Optional. The same value that was passed to addEventListener for this listener. It may be omitted if it was omitted when calling addEventListener. + **/ + removeEventListener(type: string, listener: Function, useCapture?: any): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the calendar to use. + **/ + calendar: string; + + /** + * Gets or sets the current date of the DatePicker. You can use either a date string or a Date object to set this property. + **/ + current: Date; + + /** + * Gets or sets the display pattern for the date. The default date pattern is day.integer(2). You can change the date pattern by changing the number of integers displayed. + **/ + datePattern: string; + + /** + * Specifies whether the DatePicker is disabled. + **/ + disabled: boolean; + + /** + * Gets the DOM element for the DatePicker. + **/ + element: HTMLElement; + + /** + * Gets or sets the maximum Gregorian year available for picking. + **/ + maxYear: number; + + /** + * Gets or sets the minimum Gregorian year available for picking. + **/ + minYear: number; + + /** + * Gets or sets the display pattern for the month. The default month pattern is month.abbreviated. You can change the month pattern to the following values: month.full. The full name of the month. month.abbreviated(n). You can use abbreviated with or without specifying the number of letters in the abbreviation. If you do specify the number of letters, the actual length of the month name that appears may vary. month.solo.full. A representation of the month that is suitable for stand-alone display. You can also use month.solo.abbreviated(n). month.integer(n). You can use integer with or without specifying the number of integers. + **/ + monthPattern: string; + + /** + * Gets or sets the display pattern for the year. The default year pattern is year.full. You can change the year pattern to the following values: year.abbreviated(n). You can use abbreviated with or without specifying the number of letters in the abbreviation. + **/ + yearPattern: string; + + //#endregion Properties + + } + + /** + * Adds event-related methods to the control. + **/ + class DOMEventMixin { + //#region Methods + + /** + * Adds an event listener to the control. + * @param type The type (name) of the event. + * @param listener The listener to invoke when the event gets raised. + * @param useCapture true to initiate capture; otherwise, false. + **/ + addEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type, adding the specified additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Removes an event listener from the control. + * @param type The type (name) of the event. + * @param listener The listener to remove. + * @param useCapture true to initiate capture; otherwise, false. + **/ + removeEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Adds the set of declaratively specified options (properties and events) to the specified control. If the name of the options property begins with "on", the property value is a function and the control supports addEventListener. This method calls the addEventListener method on the control. + * @param control The control on which the properties and events are to be applied. + * @param options The set of options that are specified declaratively. + **/ + setOptions(control: any, options: any): void; + + //#endregion Methods + + } + + /** + * Displays a collection, such as a set of photos, one item at a time. + **/ + class FlipView { + //#region Constructors + + /** + * Creates a new FlipView. + * @constructor + * @param element The DOM element that hosts the control. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the pageselected event, add a property named "onpageselected" and set its value to the event handler. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Occurs when the datasource count changes. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: source. + **/ + ondatasourcecountchanged(eventInfo: Event): void; + + /** + * Raised when the FlipView flips to a page and its renderer function completes. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.source. + **/ + onpagecompleted(eventInfo: CustomEvent): void; + + /** + * Raised when the FlipView flips to a page. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.source. + **/ + onpageselected(eventInfo: CustomEvent): void; + + /** + * Occurs when an item becomes invisible or visible. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.source, detail.visible. + **/ + onpagevisibilitychanged(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. For a list of events, see the FlipView object page. + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Returns the number of items in the FlipView control's itemDataSource. + * @returns A Promise that contains the number of items in the list or WinJS.UI.CountResult.unknown if the count is unavailable. + **/ + count(): Promise; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this FlipView. Call this method when the FlipView is no longer needed. After calling this method, the FlipView becomes unusable. + **/ + dispose(): void; + + /** + * Forces the FlipView to update its layout. Use this function when making the FlipView visible again after its style.display property had been set to "none". + **/ + forceLayout(): void; + + /** + * Navigates to the next page. + * @returns true if the FlipView begins navigating to the next page; false if the FlipView is already at the last item or is in the middle of another navigation animation. + **/ + next(): boolean; + + /** + * Navigates to the previous item. + * @returns true if the FlipView begins navigating to the previous page; nfalse if the FlipView is already at the first page or is in the middle of another navigation animation. + **/ + previous(): boolean; + + /** + * Unregisters an event handler for the specified event. + * @param eventName The name of the event. + * @param eventHandler The event handler function to remove. + * @param useCapture Set to true to unregister the event handler for the capturing phase; otherwise, set to false to unregister the event handler for the bubbling phase. + **/ + removeEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Sets custom animations for the FlipView to use when navigating between pages. + * @param animations An object that contains up to three fields, one for each navigation action: next, previous, and jump. Each of those fields must be a function with this signature: function (outgoingPage, incomingPage) Each function must return a WinJS.Promise that completes once the animations are finished. If a field is null or undefined, the FlipView reverts to its default animation for that action. + **/ + setCustomAnimations(animations: any): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the index of the currently displayed page. + **/ + currentPage: number; + + /** + * Gets the HTML element that hosts this FlipView. + **/ + element: HTMLElement; + + /** + * Gets or sets the data source that provides the FlipView with items to display. The FlipView displays one item at a time, on its own page. + **/ + itemDataSource: IListDataSource; + + /** + * Gets or sets the spacing between each item, in pixels. + **/ + itemSpacing: number; + + /** + * Gets or sets a Template or function that defines the HTML for each item's page. + **/ + itemTemplate: any; + + /** + * Gets or sets the orientation of the FlipView, horizontal or vertical. + **/ + orientation: string; + + //#endregion Properties + + } + + /** + * Displays lightweight UI that is either information, or requires user interaction. Unlike a dialog, a Flyout can be light dismissed by clicking or tapping off of it. + **/ + class Flyout { + //#region Constructors + + /** + * Creates a new Flyout object. + * @constructor + * @param element The DOM element that will host the control. + * @param options The set of properties and values to apply to the new Flyout. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Raised immediately after a flyout is fully hidden. + * @param eventInfo An object that contains information about the event. + **/ + onafterhide(eventInfo: Event): void; + + /** + * Raised immediately after a flyout is fully shown. + * @param eventInfo An object that contains information about the event. + **/ + onaftershow(eventInfo: Event): void; + + /** + * Raised just before hiding a flyout. + * @param eventInfo An object that contains information about the event. + **/ + onbeforehide(eventInfo: Event): void; + + /** + * Raised just before showing a flyout. + * @param eventInfo An object that contains information about the event. + **/ + onbeforeshow(eventInfo: Event): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param type The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide. + * @param listener The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Releases resources held by this object. Call this method when the object is no longer needed. After calling this method, the object becomes unusable. + **/ + dispose(): void; + + /** + * Hides the Flyout, if visible, regardless of other states. + **/ + hide(): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. + * @param listener The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Shows the Flyout, if hidden, regardless of other states. + * @param anchor Required. The DOM element to anchor the Flyout. + * @param placement The placement of the Flyout to the anchor: the string literal "top", "bottom", "left", or "right". + * @param alignment For "top" or "bottom" placement, the alignment of the Flyout to the anchor's edge: the string literal "center", "left", or "right". + **/ + show(anchor: HTMLElement, placement: string, alignment: string): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the default alignment to be used for this Flyout. + **/ + alignment: string; + + /** + * Gets or sets the default anchor to be used for this Flyout. + **/ + anchor: HTMLElement; + + /** + * Gets the DOM element that hosts the Flyout. + **/ + element: HTMLElement; + + /** + * Gets a value that indicates whether the Flyout is hidden or in the process of becoming hidden. + **/ + hidden: boolean; + + /** + * Gets or sets the default placement to be used for this Flyout. + **/ + placement: string; + + //#endregion Properties + + } + + /** + * Represents a grid layout for the ListView in which items are arranged in a horizontal grid. + **/ + class GridLayout { + //#region Constructors + + /** + * Creates a new GridLayout object. + * @constructor + * @param options The set of properties and values to apply to the new GridLayout. + **/ + constructor(options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * This method is no longer supported. + * @param beginScrollPosition + * @param wholeItem + **/ + calculateFirstVisible(beginScrollPosition: number, wholeItem: boolean): void; + + /** + * This method is no longer supported. + * @param endScrollPosition + * @param wholeItem + **/ + calculateLastVisible(endScrollPosition: number, wholeItem: boolean): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + dragLeave(): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + dragOver(): void; + + /** + * This method is no longer supported. + **/ + endLayout(): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + executeAnimations(): void; + + /** + * This method is no longer supported. + * @param itemIndex + **/ + getItemPosition(itemIndex: number): void; + + /** + * This method is no longer supported. + * @param itemIndex + * @param element + * @param keyPressed + **/ + getKeyboardNavigatedItem(itemIndex: number, element: any, keyPressed: any): void; + + /** + * This method is no longer supported. + * @param beginScrollPosition + * @param endScrollPosition + **/ + getScrollbarRange(beginScrollPosition: number, endScrollPosition: number): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param x The x-coordinate, or the horizontal position on the screen. + * @param y The y-coordinate, or the vertical position on the screen. + **/ + hitTest(x: number, y: number): void; + + /** + * This method is no longer supported. + **/ + init(): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param site The rendering site for the layout. + * @param groupsEnabled Set to true if this layout supports groups; set to false if it does not. + **/ + initialize(site: ILayoutSite2, groupsEnabled: boolean): void; + + /** + * This method is no longer supported. + * @param elements + **/ + itemsAdded(elements: any): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param firstPixel The first pixel the range of items falls between. + * @param lastPixel The last pixel the range of items falls between. + **/ + itemsFromRange(firstPixel: number, lastPixel: number): void; + + /** + * This method is no longer supported. + **/ + itemsMoved(): void; + + /** + * This method is no longer supported. + * @param elements + **/ + itemsRemoved(elements: any): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param tree + * @param changedRange + * @param modifiedItems + * @param modifiedGroups + **/ + layout(tree: any, changedRange: any, modifiedItems: any, modifiedGroups: any): void; + + /** + * This method is no longer supported. + * @param groupIndex + * @param element A DOM element. + **/ + layoutHeader(groupIndex: number, element: any): void; + + /** + * This method is no longer supported. + * @param itemIndex + * @param element A DOM element. + **/ + layoutItem(itemIndex: number, element: any): void; + + /** + * This method is no longer supported. + * @param element + **/ + prepareHeader(element: HTMLElement): void; + + /** + * This method is no longer supported. + * @param itemIndex + * @param element A DOM element. + **/ + prepareItem(itemIndex: number, element: any): void; + + /** + * This method is no longer supported. + * @param item + * @param newItem + **/ + releaseItem(item: any, newItem: any): void; + + /** + * This method is no longer supported. + **/ + reset(): void; + + /** + * This method is no longer supported. + * @param layoutSite + **/ + setSite(layoutSite: any): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + setupAnimations(): void; + + /** + * This method is no longer supported. + * @param beginScrollPosition + * @param endScrollPositionScrollPosition + **/ + startLayout(beginScrollPosition: number, endScrollPositionScrollPosition: number): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + uninitialize(): void; + + /** + * This method is no longer supported. + * @param count + **/ + updateBackdrop(count: number): void; + + //#endregion Methods + + //#region Properties + + /** + * This property is no longer supported. Starting with Windows Library for JavaScript 2.0, use the .win-listview.win-container.win-backdrop CSS selector. + **/ + backdropColor: string; + + /** + * This property is no longer supported. Starting with Windows Library for JavaScript 2.0, use the .win-listview.win-container.win-backdrop CSS selector. + **/ + disableBackdrop: boolean; + + /** + * Gets or sets the position of group headers. + **/ + groupHeaderPosition: WinJS.UI.HeaderPosition; + + /** + * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use a CellSpanningLayout. + **/ + groupInfo: Function; + + /** + * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use the orientation property instead. + **/ + horizontal: boolean; + + /** + * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use a CellSpanningLayout. + **/ + itemInfo: Function; + + /** + * Gets or set the maximum number of rows or columns, depending on the orientation, to display before content begins to wrap. + **/ + maximumRowsOrColumns: number; + + /** + * This property is no longer supported. Starting with Windows Library for JavaScript 2.0, use the maximumRowsOrColumns property. + **/ + maxRows: number; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + numberOfItemsPerItemsBlock: any; + + /** + * Gets or sets the orientation of the GridLayout. + **/ + orientation: WinJS.UI.Orientation; + + //#endregion Properties + + } + + /** + * Creates a hub navigation pattern consisting of sections that can be navigated to. Each section is defined by a HubSection object. + **/ + class Hub { + //#region Constructors + + /** + * Creates a new Hub control. + * @constructor + * @param element The DOM element that will host the Hub control. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the contentanimating event, add a property named "oncontentanimating" to the options object and set its value to the event handler. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Raised when the Hub is about to play entrance, content transition, insert, or remove animations. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.type, detail.index, detail.section. + **/ + oncontentanimating(eventInfo: CustomEvent): void; + + /** + * Raised when the user clicks on an interactive header. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.index, detail.section. + **/ + onheaderinvoked(eventInfo: CustomEvent): void; + + /** + * Raised when the Hub control's loadingState changes. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: loadingState. + **/ + onloadingstatechanged(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this Hub. Call this method when the Hub is no longer needed. After calling this method, the Hub becomes unusable. + **/ + dispose(): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets the DOM element that hosts the Hub control. + **/ + element: HTMLElement; + + /** + * Gets or sets the Template or templating function that creates the DOM elements for each HubSection header. Your HubSection object should provide strings for HubSection.header property. + **/ + headerTemplate: any; + + /** + * Gets or sets the index of the first HubSection at least partially in view. This property is useful for animating the visible content in the Hub. + **/ + indexOfFirstVisible: number; + + /** + * Gets or sets the index of last HubSection at least partially in view. Used for animating the visible content in the Hub. + **/ + indexOfLastVisible: number; + + /** + * Gets a value that indicates whether the hub is still loading or whether loading is complete. The value changes to complete after all the sections and content inside them has loaded. + **/ + loadingState: string; + + /** + * Gets or sets the orientation of sections within the Hub. + **/ + orientation: Orientation; + + /** + * Gets or sets the distance between the start of the Hub and the current viewable area. + **/ + scrollPosition: number; + + /** + * Gets or sets the index of the first visible HubSection. + **/ + sectionOnScreen: number; + + /** + * Gets or sets the List that contains the HubSection objects that belong to this Hub. + **/ + sections: WinJS.Binding.List; + + /** + * This API supports the SemanticZoom infrastructure and is not intended to be used directly from your code. + **/ + zoomableView: IZoomableView; + + //#endregion Properties + + } + + /** + * Defines a section of a Hub. + **/ + class HubSection { + //#region Constructors + + /** + * Creates a new HubSection. + * @constructor + * @param element The DOM element hosts the new HubSection. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * Releases resources held by this HubSection. Call this method when the HubSection is no longer needed. After calling this method, the HubSection becomes unusable. + **/ + dispose(): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets the DOM element that hosts the HubSection control's content. + **/ + contentElement: HTMLElement; + + /** + * Gets the DOM element that hosts this HubSection. + **/ + element: HTMLElement; + + /** + * Gets or sets the header for this HubSection. + **/ + header: string; + + /** + * Gets a value that specifies whether the header is static. + **/ + isHeaderStatic: boolean; + + //#endregion Properties + + } + + /** + * Enables you to include an HTML page dynamically. As part of the constructor, you must include an option indicating the URI of the page. + **/ + class HtmlControl { + //#region Constructors + + /** + * Initializes a new instance of HtmlControl to define a new page control. + * @constructor + * @param element The element that hosts the HtmlControl. + * @param options The options for configuring the page. The uri option is required in order to specify the source document for the content of the page. Other options are the ones used by the WinJS.Pages.render method. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + } + + /** + * Defines an item that can be pressed, swiped, and dragged. + **/ + class ItemContainer { + //#region Constructors + + /** + * Creates a new ItemContainer. + * @constructor + * @param element The DOM element hosts the new ItemContainer. For the ItemContainer to be accessible, this element must have its role attribute set to "list" or "listbox". If tapBehavior is set to none and selectionDisabled is true, then use the "list" role; otherwise, use the "listbox" role. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Raised when the item is invoked. (You can use the tapBehavior property to specify whether taps and clicks invoke the item.) + * @param eventInfo An object that contains information about the event. + **/ + oninvoked(eventInfo: CustomEvent): void; + + /** + * Raised after the item is selected or deselected. + * @param eventInfo An object that contains information about the event. + **/ + onselectionchanged(eventInfo: CustomEvent): void; + + /** + * Raised just before the current selection changes. + * @param eventInfo An object that contains information about the event. + **/ + onselectionchanging(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this ItemContainer. Call this method when the ItemContainer is no longer needed. After calling this method, the ItemContainer becomes unusable. + **/ + dispose(): void; + + /** + * Forces the ItemContainer to update its layout. Call this function when the reading direction of the app changes after the control has been initialized. + **/ + forceLayout(): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets a value that specifies whether the item can be dragged. + **/ + draggable: boolean; + + /** + * Gets the element that hosts this ItemContainer. + **/ + element: HTMLElement; + + /** + * Gets or sets a value that specifies whether the item is selected. + **/ + selected: boolean; + + /** + * Gets or sets a value that specifies whether selection of this item is disabled. + **/ + selectionDisabled: boolean; + + /** + * Gets or sets how the ItemContainer reacts to the swipe gesture. The swipe gesture can select the swiped items or can have no effect on the current selection. + **/ + swipeBehavior: WinJS.UI.SwipeBehavior; + + /** + * Gets or sets the orientation of swipe gestures. + **/ + swipeOrientation: Orientation; + + /** + * Gets or sets how the ItemContainer reacts when the user taps or clicks an item. + **/ + tapBehavior: TapBehavior; + + //#endregion Properties + + } + + /** + * This object supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + class Layout { + } + + /** + * Represents a layout for the ListView in which items are arranged in a vertical list. + **/ + class ListLayout { + //#region Constructors + + /** + * Creates a new ListLayout. + * @constructor + * @param options An object that contains one or more property/value pairs to apply to the new ListLayout. Each property of the options object corresponds to one of the object's properties or events. Event names must begin with "on". + **/ + constructor(options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * This method is no longer supported. + * @param beginScrollPosition + * @param wholeItem + **/ + calculateFirstVisible(beginScrollPosition: number, wholeItem: boolean): void; + + /** + * This method is no longer supported. + * @param endScrollPosition + * @param wholeItem + **/ + calculateLastVisible(endScrollPosition: number, wholeItem: boolean): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + dragLeave(): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + dragOver(): void; + + /** + * This method is no longer supported. + **/ + endLayout(): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + executeAnimations(): void; + + /** + * This method is no longer supported. + * @param itemIndex + **/ + getItemPosition(itemIndex: number): void; + + /** + * This method is no longer supported. + * @param itemIndex + * @param element + * @param keyPressed + **/ + getKeyboardNavigatedItem(itemIndex: number, element: HTMLElement, keyPressed: any): void; + + /** + * This method is no longer supported. + * @param beginScrollPosition + * @param endScrollPosition + **/ + getScrollbarRange(beginScrollPosition: number, endScrollPosition: number): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param x The x-coordinate, or the horizontal position on the screen. + * @param y The y-coordinate, or the vertical position on the screen. + **/ + hitTest(x: number, y: number): void; + + /** + * This method is no longer supported. + **/ + init(): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + initialize(): void; + + /** + * This method is no longer supported. + * @param elements + **/ + itemsAdded(elements: any): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param firstPixel + * @param lastPixel + **/ + itemsFromRange(firstPixel: number, lastPixel: number): void; + + /** + * This method is no longer supported. + **/ + itemsMoved(): void; + + /** + * This method is no longer supported. + * @param elements + **/ + itemsRemoved(elements: any): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + * @param tree + * @param changedRange + * @param modifiedItems + * @param modifiedGroups + **/ + layout(tree: any, changedRange: any, modifiedItems: any, modifiedGroups: any): void; + + /** + * This method is no longer supported. + * @param groupIndex + * @param element A DOM element. + **/ + layoutHeader(groupIndex: number, element: any): void; + + /** + * This method is no longer supported. + * @param itemIndex + * @param element A DOM element. + **/ + layoutItem(itemIndex: number, element: any): void; + + /** + * This method is no longer supported. + * @param element + **/ + prepareHeader(element: HTMLElement): void; + + /** + * This method is no longer supported. + * @param itemIndex + * @param element A DOM element. + **/ + prepareItem(itemIndex: number, element: any): void; + + /** + * This method is no longer supported. + * @param item + * @param newItem + **/ + releaseItem(item: any, newItem: any): void; + + /** + * This method is no longer supported. + **/ + reset(): void; + + /** + * This method is no longer supported. + * @param layoutSite + **/ + setSite(layoutSite: any): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + setupAnimations(): void; + + /** + * This method is no longer supported. + * @param beginScrollPosition + * @param endScrollPositionScrollPosition + **/ + startLayout(beginScrollPosition: number, endScrollPositionScrollPosition: number): void; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + uninitialize(): void; + + /** + * This method is no longer supported. + * @param count + **/ + updateBackdrop(count: number): void; + + //#endregion Methods + + //#region Properties + + /** + * This property is no longer supported. Starting with Windows Library for JavaScript 2.0, use the .win-listview.win-container.win-backdrop CSS selector. + **/ + backdropColor: string; + + /** + * This property is no longer supported. Starting with Windows Library for JavaScript 2.0, use the .win-listview.win-container.win-backdrop CSS selector. + **/ + disableBackdrop: boolean; + + /** + * Gets or sets the position of group headers. + **/ + groupHeaderPosition: WinJS.UI.HeaderPosition; + + /** + * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use a CellSpanningLayout. + **/ + groupInfo: Function; + + /** + * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use the orientation property instead. + **/ + horizontal: boolean; + + /** + * This property is no longer supported. Starting with the Windows Library for JavaScript 2.0, use a CellSpanningLayout. + **/ + itemInfo: Function; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + numberOfItemsPerItemsBlock: any; + + /** + * Gets or sets the orientation of the GridLayout. + **/ + orientation: WinJS.UI.Orientation; + + //#endregion Properties + + } + + /** + * Displays data items in a customizable list or grid. + **/ class ListView { - //#region Constructors + //#region Constructors - /** - * Creates a new ListView. - * @constructor - * @param element The DOM element that hosts the ListView control. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the selectionchanged event, add a property named "onselectionchanged" to the options object and set its value to the event handler. - **/ - constructor(element?: HTMLElement, options?: any); + /** + * Creates a new ListView. + * @constructor + * @param element The DOM element that hosts the ListView control. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the selectionchanged event, add a property named "onselectionchanged" to the options object and set its value to the event handler. + **/ + constructor(element?: HTMLElement, options?: any); - //#endregion Constructors + //#endregion Constructors - //#region Events + //#region Events - /** - * Occurs when the ListView is about to play an entrance or contentTransition animation. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.type, detail.setPromise. - **/ - oncontentanimating(eventInfo: CustomEvent): void; + /** + * Occurs when the ListView is about to play an entrance or contentTransition animation. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.type, detail.setPromise. + **/ + oncontentanimating(eventInfo: CustomEvent): void; - /** - * Raised when the user taps or clicks a group header. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.groupHeaderIndex, detail.groupHeaderPromise. - **/ - ongroupheaderinvoked(eventInfo: CustomEvent): void; + /** + * Raised when the user taps or clicks a group header. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.groupHeaderIndex, detail.groupHeaderPromise. + **/ + ongroupheaderinvoked(eventInfo: CustomEvent): void; - /** - * Raised when the ListView is a drop target and the onitemdragenter has been disabled. This is raised every time the cursor is moved between a new pair of items. If you call preventDefault on this event, then the ListView does not move the items slightly above/below the cursor to provide visual feedback for a drop. - * @param eventInfo An object that contains information about the event. The detail property of this object contains additional information about the event. - **/ - onitemdragbetween(eventInfo: CustomEvent): void; + /** + * Raised when the ListView is a drop target and the onitemdragenter has been disabled. This is raised every time the cursor is moved between a new pair of items. If you call preventDefault on this event, then the ListView does not move the items slightly above/below the cursor to provide visual feedback for a drop. + * @param eventInfo An object that contains information about the event. The detail property of this object contains additional information about the event. + **/ + onitemdragbetween(eventInfo: CustomEvent): void; - /** - * Raised when the user is dragging an item from the ListView and the datasource changes while the user is dragging. - * @param eventInfo An object that contains information about the event. The detail property of this object contains additional information about the event. - **/ - onitemdragchanged(eventInfo: CustomEvent): void; + /** + * Raised when the user is dragging an item from the ListView and the datasource changes while the user is dragging. + * @param eventInfo An object that contains information about the event. The detail property of this object contains additional information about the event. + **/ + onitemdragchanged(eventInfo: CustomEvent): void; - /** - * Raised when an item is dropped onto the ListView as the result of a drag operation. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.dataTransfer, detail.index, detail.insertAfterIndex. - **/ - onitemdragdrop(eventInfo: CustomEvent): void; + /** + * Raised when an item is dropped onto the ListView as the result of a drag operation. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.dataTransfer, detail.index, detail.insertAfterIndex. + **/ + onitemdragdrop(eventInfo: CustomEvent): void; - /** - * Raised when the user drops an item dragged from a ListView. - * @param eventInfo An object that contains information about the event. - **/ - onitemdragend(eventInfo: CustomEvent): void; + /** + * Raised when the user drops an item dragged from a ListView. + * @param eventInfo An object that contains information about the event. + **/ + onitemdragend(eventInfo: CustomEvent): void; - /** - * Raised when an dragged item enters the bounds of the ListView control. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.dataTransfer. - **/ - onitemdragenter(eventInfo: CustomEvent): void; + /** + * Raised when an dragged item enters the bounds of the ListView control. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.dataTransfer. + **/ + onitemdragenter(eventInfo: CustomEvent): void; - /** - * Raised when a draggable item leaves the bounds of a ListView control. - * @param eventInfo An object that contains information about the event. - **/ - onitemdragleave(eventInfo: CustomEvent): void; + /** + * Raised when a draggable item leaves the bounds of a ListView control. + * @param eventInfo An object that contains information about the event. + **/ + onitemdragleave(eventInfo: CustomEvent): void; - /** - * Raised when the user begins to drag an item from a ListView control. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.dataTransfer, detail.dragInfo. - **/ - onitemdragstart(eventInfo: CustomEvent): void; + /** + * Raised when the user begins to drag an item from a ListView control. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.dataTransfer, detail.dragInfo. + **/ + onitemdragstart(eventInfo: CustomEvent): void; - /** - * Occurs when the user taps or clicks an item. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.itemIndex. - **/ - oniteminvoked(eventInfo: CustomEvent): void; + /** + * Occurs when the user taps or clicks an item. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.itemIndex. + **/ + oniteminvoked(eventInfo: CustomEvent): void; - /** - * Raised when the focused item changes. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.oldFocus, detail.oldNewFocus. - **/ - onkeyboardnavigating(eventInfo: CustomEvent): void; + /** + * Raised when the focused item changes. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.oldFocus, detail.oldNewFocus. + **/ + onkeyboardnavigating(eventInfo: CustomEvent): void; - /** - * Occurs when the ListView control's loadingState changes. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.scrolling. - **/ - onloadingstatechanged(eventInfo: CustomEvent): void; + /** + * Occurs when the ListView control's loadingState changes. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.scrolling. + **/ + onloadingstatechanged(eventInfo: CustomEvent): void; - /** - * Occurs after the current selection changes. - * @param eventInfo An object that contains information about the event. The detail property of this object is null. To obtain the selected items, use the ListView.selection property. - **/ - onselectionchanged(eventInfo: CustomEvent): void; + /** + * Occurs after the current selection changes. + * @param eventInfo An object that contains information about the event. The detail property of this object is null. To obtain the selected items, use the ListView.selection property. + **/ + onselectionchanged(eventInfo: CustomEvent): void; - /** - * Occurs just before the current selection changes. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.newSelection, detail.preventTapBehavior. - **/ - onselectionchanging(eventInfo: CustomEvent): void; + /** + * Occurs just before the current selection changes. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.newSelection, detail.preventTapBehavior. + **/ + onselectionchanging(eventInfo: CustomEvent): void; - //#endregion Events + //#endregion Events - //#region Methods + //#region Methods - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. See the ListView object page for a list of events. Note that you drop the "on" when specifying the event name for the addEventListener method. For example, instead of specifying "onselectionchange", you specify "selectionchange". - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. See the ListView object page for a list of events. Note that you drop the "on" when specifying the event name for the addEventListener method. For example, instead of specifying "onselectionchange", you specify "selectionchange". + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; - /** - * Releases resources held by this object. Call this method when the object is no longer needed. After calling this method, the object becomes unusable. - **/ - dispose(): void; + /** + * Releases resources held by this object. Call this method when the object is no longer needed. After calling this method, the object becomes unusable. + **/ + dispose(): void; - /** - * Returns the DOM element that represents the item at the specified index. - * @param itemIndex The index of the item. - * @returns The DOM element that represents the item at the specified index. - **/ - elementFromIndex(itemIndex: number): HTMLElement; + /** + * Returns the DOM element that represents the item at the specified index. + * @param itemIndex The index of the item. + * @returns The DOM element that represents the item at the specified index. + **/ + elementFromIndex(itemIndex: number): HTMLElement; - /** - * Makes the item at the specified index visible. If necessary, the ListView will scroll to the item. - * @param itemIndex The index of the item to scroll into view. - **/ - ensureVisible(itemIndex: number): void; + /** + * Makes the item at the specified index visible. If necessary, the ListView will scroll to the item. + * @param itemIndex The index of the item to scroll into view. + **/ + ensureVisible(itemIndex: number): void; - /** - * Forces the ListView to update its layout. Use this function when making the ListView visible again after its style.display property had been set to "none". - **/ - forceLayout(): void; + /** + * Forces the ListView to update its layout. Use this function when making the ListView visible again after its style.display property had been set to "none". + **/ + forceLayout(): void; - /** - * Returns the index of the item that the specified DOM element displays. - * @param element The DOM element that displays the item. - * @returns The index of the item displayed by element. - **/ - indexOfElement(element: HTMLElement): number; + /** + * Returns the index of the item that the specified DOM element displays. + * @param element The DOM element that displays the item. + * @returns The index of the item displayed by element. + **/ + indexOfElement(element: HTMLElement): number; - /** - * Loads the next set of pages if the ListView control's loadingBehavior is set to "incremental" (otherwise, it does nothing). The number of pages to be loaded is determined by the pagesToLoad property. - **/ - loadMorePages(): void; + /** + * Loads the next set of pages if the ListView control's loadingBehavior is set to "incremental" (otherwise, it does nothing). The number of pages to be loaded is determined by the pagesToLoad property. + **/ + loadMorePages(): void; - /** - * Repositions all the visible items in the ListView to adjust for items whose sizes have changed. Most apps won’t ever need to call this method. For more info, see the Remarks section. - **/ - recalculateItemPosition(): void; + /** + * Repositions all the visible items in the ListView to adjust for items whose sizes have changed. Most apps won’t ever need to call this method. For more info, see the Remarks section. + **/ + recalculateItemPosition(): void; - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; /** * Triggers the ListView disposal service manually. **/ static triggerDispose(): void; - //#endregion Methods + //#endregion Methods - //#region Properties + //#region Properties - /** - * Gets or sets a value that indicates whether the next set of pages is automatically loaded when the user scrolls beyond the number of pages specified by the pagesToLoadThreshold property. - **/ - automaticallyLoadPages: boolean; + /** + * Gets or sets a value that indicates whether the next set of pages is automatically loaded when the user scrolls beyond the number of pages specified by the pagesToLoadThreshold property. + **/ + automaticallyLoadPages: boolean; /** * Gets or sets an IListViewItem that indicates which item should have keyboard focus and the focus state of that item. **/ currentItem: IListViewItem; - /** - * Gets the HTML element that hosts this ListView. - **/ - element: HTMLElement; - - /** - * Gets or sets the data source that contains the groups for the items in the itemDataSource. - **/ - groupDataSource: IListDataSource; - - /** - * Gets or sets how the ListView reacts when the user taps or clicks a group header. - **/ - groupHeaderTapBehavior: GroupHeaderTapBehavior; - - /** - * Gets or sets the Template or function that creates the DOM elements for each group header in the groupDataSource. Each group header can contain multiple elements, but it must have a single root element. - **/ - groupHeaderTemplate: any; - - /** - * Gets or sets the first visible item. - **/ - indexOfFirstVisible: number; - - /** - * Gets the index of the last visible item in the ListView. - **/ - indexOfLastVisible: number; - - /** - * Gets or sets the data source that provides the ListView with items. - **/ - itemDataSource: IListDataSource; - - /** - * Go Gets or sets a value that specifies whether items can be dragged. When this is set to true the ListView provides built in behaviors related to item dragging. - **/ - itemsDraggable: boolean; - - /** - * Gets or sets whether the ListView control's items can be reordered within itself by dragging and dropping. - **/ - itemsReorderable: boolean; - - /** - * Gets or sets the WinJS.Binding.Template or templating function that creates the DOM elements for each item in the itemDataSource. Each item can contain multiple elements, but it must have a single root element. - **/ - itemTemplate: any; - - /** - * Gets or sets an object that controls the layout of the ListView. - **/ - layout: ILayout2; - - /** - * Gets or sets a value that specifies how the ListView fetches items and adds and removes them to the DOM. Don't change the value of this property after the ListView has begun loading data. - **/ - loadingBehavior: string; - - /** - * Gets a value that indicates whether the ListView is still loading or whether loading is complete. - **/ - loadingState: string; - - /** - * Gets or sets the maximum number of realized items. - **/ - maxDeferredItemCleanup: number; - - /** - * Gets or sets the number of pages to load when the loadingBehavior property is set to "incremental" and the user scrolls beyond the threshold specified by the pagesToLoadThreshold property. - **/ - pagesToLoad: number; - - /** - * Gets or sets the threshold (in pages) for initiating an incremental load. When the last visible item is within the specified number of pages from the end of the loaded portion of the list, and if automaticallyLoadPages is true and loadingBehavior is set to "incremental", the ListView initiates an incremental load. - **/ - pagesToLoadThreshold: number; - - /** - * Gets or sets the function that is called when the ListView discards or recycles the element representation of a group header. - **/ - resetGroupHeader: (header: any, element: HTMLElement) => void; - - /** - * Gets or sets the function that is called when an item is removed, an item is changed, or an item falls outside of the realized range of the ListView. - **/ - resetItem: (item: T, element: HTMLElement) => void; - - /** - * Gets or sets the distance, in pixels, of the start of the viewable area within the viewport. - **/ - scrollPosition: number; - - /** - * Gets an ISelection that contains the range of currently selected items. - **/ - selection: ISelection; - - /** - * Gets or sets the selection mode of the ListView. - **/ - selectionMode: SelectionMode; - - /** - * Gets or sets how the ListView reacts to the swipe gesture. The swipe gesture can select the swiped items or can have no effect on the current selection. - **/ - swipeBehavior: WinJS.UI.SwipeBehavior; - - /** - * Gets or sets how the ListView reacts when the user taps or clicks an item. - **/ - tapBehavior: TapBehavior; - - /** - * Gets a ZoomableView that supports semantic zoom functionality. This API supports the SemanticZoom infrastructure and is not intended to be used directly from your code. - **/ - zoomableView: IZoomableView>; - - //#endregion Properties - - } - - /** - * Represents a menu flyout for displaying commands. - **/ - class Menu { - //#region Constructors - - /** - * Creates a new Menu object. - * @constructor - * @param element The DOM element that will host the control. - * @param options The set of properties and values to apply to the new Menu. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Occurs immediately after the Menu is hidden. - * @param eventInfo An object that contains information about the event. - **/ - onafterhide(eventInfo: Event): void; - - /** - * Occurs after the Menu is shown. - * @param eventInfo An object that contains information about the event. - **/ - onaftershow(eventInfo: Event): void; - - /** - * Occurs before the Menu is hidden. - * @param eventInfo An object that contains information about the event. - **/ - onbeforehide(eventInfo: Event): void; - - /** - * Occurs before a hidden Menu is shown. - * @param eventInfo An object that contains information about the event. - **/ - onbeforeshow(eventInfo: Event): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param type The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide. - * @param listener The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Releases resources held by this Menu. Call this method when the Menu is no longer needed. After calling this method, the Menu becomes unusable. - **/ - dispose(): void; - - /** - * Returns the MenuCommand object identified by id. - * @param id The element identifier (ID) of the command to be returned. - * @returns The command identified by id. - **/ - getCommandById(id: string): MenuCommand; - - /** - * Hides the Menu. - **/ - hide(): void; - - /** - * Hides the specified commands of the Menu. - * @param commands The commands to hide. The array elements may be MenuCommand objects, or the string identifiers (IDs) of commands. - * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to hide the commands immediately, without animating them; otherwise, false. - **/ - hideCommands(commands: any[], immediate: boolean): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. - * @param listener The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Shows the Menu, if hidden, regardless of other states. - * @param anchor Required. The DOM element to anchor the Menu. - * @param placement The placement of the Menu to the anchor: top, bottom, left, or right. - * @param alignment For top or bottom placement, the alignment of the Menu to the anchor's edge: center, left, or right. - **/ - show(anchor: HTMLElement, placement: string, alignment: string): void; - - /** - * Shows the specified commands of the Menu. - * @param commands The commands to show. The array elements may be Menu objects, or the string identifiers (IDs) of commands. - * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the commands immediately, without animating them; otherwise, false. - **/ - showCommands(commands: any[], immediate: boolean): void; - - /** - * Shows the specified commands of the Menu while hiding all other commands. - * @param commands The commands to show. The array elements may be MenuCommand objects, or the string identifiers (IDs) of commands. - * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the specified commands (and hide the others) immediately, without animating them; otherwise, false. - **/ - showOnlyCommands(commands: any[], immediate: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the default alignment to be used for this Menu. - **/ - alignment: string; - - /** - * Gets or sets the default anchor to be used for this Menu. - **/ - anchor: HTMLElement; - - /** - * Sets the MenuCommand objects that appear in the menu. - **/ - commands: MenuCommand[]; - - /** - * Gets the DOM element that hosts the Menu. - **/ - element: HTMLElement; - - /** - * Gets a value that indicates whether the Menu is hidden or in the process of becoming hidden. - **/ - hidden: boolean; - - /** - * Gets or sets the default placement to be used for this Menu. - **/ - placement: string; - - //#endregion Properties - - } - - /** - * Represents a command to be displayed in a Menu object. - **/ - class MenuCommand { - //#region Constructors - - /** - * Creates a new MenuCommand object. - * @constructor - * @param element The DOM element that will host the control. - * @param options The set of properties and values to apply to the new MenuCommand. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param type The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide. - * @param listener The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Disposes this control. - **/ - dispose(): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. - * @param listener The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(type: string, listener: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets a value that indicates whether the MenuCommand is disabled. - **/ - disabled: boolean; - - /** - * Gets the DOM element that hosts the MenuCommand. - **/ - element: HTMLElement; - - /** - * Adds an extra CSS class during construction. - **/ - extraClass: string; - - /** - * Gets or sets the Flyout object displayed by this command. The specified flyout is shown when the MenuCommand's button is invoked. - **/ - flyout: Flyout; - - /** - * Gets a value that indicates whether the MenuCommand is hidden or in the process of becoming hidden. - **/ - hidden: boolean; - - /** - * Gets the element identifier (ID) of the command. - **/ - id: string; - - /** - * Gets or sets the label of the command. - **/ - label: string; - - /** - * Gets or sets the function to be invoked when the command is clicked. - **/ - onclick: Function; - - /** - * Gets or sets the selected state of a toggle button. - **/ - selected: boolean; - - /** - * Gets the type of the command. - **/ - type: string; - - //#endregion Properties - - } - - /** - * Displays navigation commands in a toolbar that the user can show or hide. - **/ - class NavBar { - //#region Constructors - - /** - * Creates a new NavBar. - * @constructor - * @param element The DOM element that will host the new NavBar. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Occurs immediately after the NavBar is hidden. - * @param eventInfo An object that contains information about the event. - **/ - onafterhide(eventInfo: Event): void; - - /** - * Raised after the NavBar is shown. - * @param eventInfo An object that contains information about the event. - **/ - onaftershow(eventInfo: Event): void; - - /** - * Raised just before the NavBar is hidden. - * @param eventInfo An object that contains information about the event. - **/ - onbeforehide(eventInfo: Event): void; - - /** - * Occurs before a hidden NavBar is shown. - * @param eventInfo An object that contains information about the event. - **/ - onbeforeshow(eventInfo: Event): void; - - /** - * Occurs after the NavBar has finished processing its child elements. - * @param eventInfo An object that contains information about the event. - **/ - onchildrenprocessed(eventInfo: Event): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this NavBar. Call this method when the NavBar is no longer needed. After calling this method, the NavBar becomes unusable. - **/ - dispose(): void; - - /** - * Hides the NavBar. - **/ - hide(): void; - - /** - * Hides the specified commands of the NavBar. - * @param commands The commands to hide. The array elements may be NavBarCommand objects, or the string identifiers (IDs) of commands. - * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to hide the commands immediately, without animating them; otherwise, false. - **/ - hideCommands(commands: any[], immediate: boolean): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - /** - * Shows the NavBar if it is not disabled. - **/ - show(): void; - - /** - * Shows the specified commands of the NavBar. - * @param commands The commands to show. The array elements may be NavBarCommand objects, or the string identifiers (IDs) of commands. - * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the commands immediately, without animating them; otherwise, false. - **/ - showCommands(commands: any[], immediate: boolean): void; - - /** - * Shows the specified commands of the NavBar while hiding all other commands. - * @param commands The commands to show. The array elements may be NavBarCommand objects, or the string identifiers (IDs) of commands. - * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the specified commands (and hide the others) immediately, without animating them; otherwise, false. - **/ - showOnlyCommands(commands: any[], immediate: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - commands: AppBarCommand; - - /** - * Gets or sets a value that indicates whether the NavBar is disabled. - **/ - disabled: boolean; - - /** - * Gets the HTML element that hosts this NavBar. - **/ - element: HTMLElement; - - /** - * Gets a value that indicates whether the NavBar is hidden or in the process of becoming hidden. - **/ - hidden: boolean; - - /** - * This API supports the WinJS infrastructure and is not intended to be used directly from your code. - **/ - layout: string; - - /** - * Gets or sets a value that specifies whether the NavBar appears at the top or bottom of the main view. - **/ - placement: string; - - /** - * Gets or sets a value that indicates whether the NavBar is sticky (won't light dismiss). If not sticky, the NavBar dismisses normally when the user touches outside of the NavBar. - **/ - sticky: boolean; - - //#endregion Properties - - } - - /** - * Represents a navigation command in a NavBarContainer. - **/ - class NavBarCommand { - //#region Constructors - - /** - * Creates a new NavBarCommand. - * @constructor - * @param element The DOM element hosts the new NavBarCommand. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this NavBarCommand. Call this method when the NavBarCommand is no longer needed. After calling this method, the NavBarCommand becomes unusable. - **/ - dispose(): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets the HTML element that hosts this NavBarCommand. - **/ - element: HTMLElement; - - /** - * Gets or sets the command's icon. - **/ - icon: string; - - /** - * Gets or sets the label of the command. - **/ - label: string; - - /** - * Get or sets the location to navigate to when this command is invoked. - **/ - location: any; - - /** - * Gets or sets a value that specifies whether to show the split tab stop. - **/ - splitButton: boolean; - - /** - * Gets a value that indicates whether the splitButton is open. - **/ - splitOpened: boolean; - - /** - * Gets or sets a user-defined object that represents the state associated with the command's location. - **/ - state: any; - - /** - * Gets or sets the tooltip of the command. - **/ - tooltip: any; - - //#endregion Properties - - } - - /** - * Contains a group of NavBarCommand objects in a NavBar. - **/ - class NavBarContainer { - //#region Constructors - - /** - * Creates a new NavBarContainer. - * @constructor - * @param element The DOM element hosts the new NavBarContainer. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Occurs when a child NavBarCommand object's click event fires. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.index, detail.navbarcommand, detail.data. - **/ - oninvoked(eventInfo: CustomEvent): void; - - /** - * Occurs when the split button of a child NavBarCommand is opened or closed. A split button is toggled when the user navigates to another page or opens another split button. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.opened, detail.index, detail.navbarcommand, detail.data. - **/ - onsplittoggle(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this NavBarCommand. Call this method when the NavBarCommand is no longer needed. After calling this method, the NavBarCommand becomes unusable. - **/ - dispose(): void; - - /** - * Forces the NavBarContainer to update its layout. Use this function when making the NavBarContainer visible again after you set its style.display property to "none". - **/ - forceLayout(): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the index of the current item. - **/ - currentIndex: number; - - /** - * Gets or sets a WinJS.Binding.List that generates NavBarCommand objects. - **/ - data: WinJS.Binding.List; - - /** - * Gets the HTML element that hosts this NavBarContainer. - **/ - element: HTMLElement; - - /** - * Gets or sets a value that specifies whether NavBarCommand objects in this container use a fixed or dynamic width. - **/ - fixedSize: boolean; - - /** - * Gets or sets a value that specifies whether the NavBarContainer has a horizontal or vertical layout. - **/ - layout: Orientation; - - /** - * Gets or sets a value that specifies how many rows of navigation commands to display on a page. - **/ - maxRows: number; - - /** - * Gets or sets the WinJS.Binding.Template or templating function that creates the DOM elements for each item in the data source. Each item can contain multiple elements, but it must have a single root element. - **/ - template: WinJS.Binding.Template; - - //#endregion Properties - - } - - /** - * Lets the user rate something by clicking an icon that represents a rating. The Rating control can display three types of ratings: an average rating, a tentative rating, and the user's rating. - **/ - class Rating { - //#region Constructors - - /** - * Creates a new Rating. - * @constructor - * @param element The DOM element hosts the new Rating. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the cancel event, add a property named "oncancel" to the options object and set its value to the event handler. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Raised when the user finishes interacting with the rating control without committing a tentative rating. - * @param eventInfo An object that contains information about the event. - **/ - oncancel(eventInfo: Event): void; - - /** - * Raised when the user commits a change to the userRating. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.tentativeRating. - **/ - onchange(eventInfo: CustomEvent): void; - - /** - * Raised when the user is choosing a new tentative Rating. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.tentativeRating. - **/ - onpreviewchange(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Releases resources held by this Rating. Call this method when the Rating is no longer needed. After calling this method, the Rating becomes unusable. - **/ - dispose(): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the average rating. - **/ - averageRating: number; - - /** - * Gets or sets whether the control is disabled. When the control is disabled, the user can't specify a new user rating or modify an existing rating. - **/ - disabled: boolean; - - /** - * Gets the DOM element that hosts the Rating. - **/ - element: HTMLElement; - - /** - * Gets or sets whether control lets the user clear the rating. - **/ - enableClear: boolean; - - /** - * Gets or sets the maximum possible rating value. - **/ - maxRating: number; - - /** - * Gets or sets a set of descriptions to show for rating values in the tooltip. - **/ - tooltipStrings: string[]; - - /** - * Gets or sets the user's rating. - **/ - userRating: number; - - //#endregion Properties - - } - - /** - * Generates HTML from a set of data. Use this control to generate lists of items. - **/ - class Repeater { - //#region Constructors - - /** - * Creates a new Repeater control. - * @constructor - * @param options An object that contains one or more property/value pairs to apply to the new Repeater. Each property of the options object corresponds to one of the object's properties or events. Event names must begin with "on". - **/ - constructor(options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Raised after an item in the Repeater control's data source changes and after the corresponding DOM element has been updated. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.index, detail.key, detail.newElement, detail.newItem, detail.newValue, detail.oldElement, detail.oldItem, detail.oldValue, detail.setPromise. - **/ - onitemchanged(eventInfo: CustomEvent): void; - - /** - * Raised after an item in the Repeater control's data source changes but before the corresponding DOM element has been updated. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.index, detail.key, detail.newElement, detail.newItem, detail.newValue, detail.oldElement, detail.oldItem, detail.oldValue, detail.setPromise. - **/ - onitemchanging(eventInfo: CustomEvent): void; - - /** - * Raised after an item has been added to the Repeater control's data source and after the corresponding DOM element has been added. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.key, detail.value. - **/ - oniteminserted(eventInfo: CustomEvent): void; - - /** - * Raised after an item has been added to the Repeater control's data source but before the corresponding DOM element has been added. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.key, detail.value. - **/ - oniteminserting(eventInfo: CustomEvent): void; - - /** - * Raised after an item has been moved from one index to another in the Repeater control's data source and after the corresponding DOM element has been moved. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.key, detail.oldIndex, detail.newIndex. - **/ - onitemmoved(eventInfo: CustomEvent): void; - - /** - * Raised after an item has been moved from one index to another in the Repeater control's data source but before the corresponding DOM element has been moved. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.key, detail.oldIndex, detail.newIndex. - **/ - onitemmoving(eventInfo: CustomEvent): void; - - /** - * Raised after an item has been moved from one index to another in the Repeater control's data source and after the corresponding DOM element has been moved. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.item, detail.setPromise. - **/ - onitemremoved(eventInfo: CustomEvent): void; - - /** - * Raised after an item has been removed from the Repeater control's data source but before the corresponding DOM element has been removed. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.item, detail.setPromise. - **/ - onitemremoving(eventInfo: CustomEvent): void; - - /** - * Raised when the Repeater has finished loading a new set of data. This event is only fired on construction. This event is only raised when the Repeater is constructed or its data source or template changes. - * @param eventInfo An object that contains information about the event. - **/ - onitemsloaded(eventInfo: CustomEvent): void; - - /** - * Raised after the Repeater control's underlying data has been updated and after the updated HTML has been reloaded. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElements. - **/ - onitemsreloaded(eventInfo: CustomEvent): void; - - /** - * Raised after the Repeater control's underlying data has been updated but before the updated HTML has been reloaded. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElements, detail.setPromise. - **/ - onitemsreloading(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this Repeater. Call this method when the Repeater is no longer needed. After calling this method, the Repeater becomes unusable. - **/ - dispose(): void; - - /** - * Returns the HTML element for the item at the specified index. - * @param index The index of the item. - * @returns The DOM element for the specified item. - **/ - elementFromIndex(index: number): HTMLElement; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the List that provides the Repeater with items to display. - **/ - data: WinJS.Binding.List; - - /** - * Gets the DOM element that hosts the Repeater. - **/ - element: HTMLElement; - - /** - * Gets the number of items in the Repeater control. - **/ - length: number; - - /** - * Gets or sets a WinJS.Binding.Template or custom rendering function that defines the HTML of each item within the Repeater. - **/ - template: WinJS.Binding.Template; - - //#endregion Properties - - } - - /** - * Enables the user to perform search queries and select suggestions. - **/ - class SearchBox { - //#region Constructors - - /** - * Creates a new SearchBox. - * @constructor - * @param element The DOM element hosts the new SearchBox. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Raised when the user or the app changes the queryText. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.language, detail.queryText, detail.linguisticDetails. - **/ - onquerychanged(eventInfo: CustomEvent): void; - - /** - * Raised awhen the user clicks the search glyph or presses Enter. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.language, detail.queryText, detail.linguisticDetails, detail.keyModifiers. - **/ - onquerysubmitted(eventInfo: CustomEvent): void; - - /** - * Raised when the app automatically redirects focus to the search box. This event can only be raised when the focusOnKeyboardInput property is set to true. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.propertyName. - **/ - onreceivingfocusonkeyboardinput(eventInfo: CustomEvent): void; - - /** - * Raised when the user selects a suggested option for the search. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.tag, detail.keyModifiers, detail.storageFile. - **/ - onresultsuggestionschosen(eventInfo: CustomEvent): void; - - /** - * Raised when the system requests search suggestions from this app. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.language, detail.linguisticDetails, detail.queryText, detail.searchSuggestionCollection. - **/ - onsuggestionsrequested(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this SearchBox. Call this method when the SearchBox is no longer needed. After calling this method, the SearchBox becomes unusable. - **/ - dispose(): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - /** - * Specifies whether suggestions based on local files are automatically displayed in the search pane, and defines the criteria that Windows uses to locate and filter these suggestions. - * @param settings The new settings for local content suggestions. - **/ - setLocalContentSuggestionSettings(settings: Windows.ApplicationModel.Search.LocalContentSuggestionSettings): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets whether the first suggestion is chosen when the user presses Enter. - **/ - chooseSuggestionOnEnter: boolean; - - /** - * Gets or sets a value that specifies whether the SearchBox is disabled. If the control is disabled, it won't receive focus. - **/ - disabled: boolean; - - /** - * Gets the DOM element that hosts the SearchBox. - **/ - element: HTMLElement; - - /** - * Gets or sets a value that specifies whether the search box automatically receives focus when the user types into the app window. - **/ - focusOnKeyboardInput: boolean; - - /** - * Gets or sets the placeholder text for the SearchBox. This text is displayed if there is no other text in the input box. - **/ - placeholderText: string; - - /** - * Gets or sets the query text for the SearchBox. - **/ - queryText: string; - - /** - * Gets or sets the search history context. This context is used a secondary key (the app ID is the primary key) for storing search history. - **/ - searchHistoryContext: string; - - /** - * Gets or sets a value that specifies whether search history is disabled. - **/ - searchHistoryDisabled: boolean; - - //#endregion Properties - - } - - /** - * Enables the user to zoom between two different views supplied by two child controls. One child control supplies the zoomed-out view and the other provides the zoomed-in view. - **/ - class SemanticZoom { - //#region Constructors - - /** - * Creates a new SemanticZoom. - * @constructor - * @param element The DOM element that hosts the SemanticZoom. - * @param options An object that contains one or more property/value pairs to apply to the new control. This object can contain these properties: initiallyZoomedOut Boolean, zoomFactor 0.2–0.85. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Occurs when the control zooms in or out. - * @param eventInfo An object that contains information about the event. The detail property of this object is true when the control is zoomed out. Otherwise, it's false. - **/ - onzoomchanged(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this SemanticZoom. Call this method when the SemanticZoom is no longer needed. After calling this method, the SemanticZoom becomes unusable. - **/ - dispose(): void; - - /** - * Forces the SemanticZoom to update its layout. Use this function when making the SemanticZoom visible again after its style.display property had been set to "none". - **/ - forceLayout(): void; - - /** - * Unregisters an event handler for the specified event. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets the DOM element that hosts the SemanticZoom control. - **/ - element: HTMLElement; - - /** - * Gets or a sets a value that specifies whether to display the SemanticZoom zoom out button. - **/ - enableButton: boolean; - - /** - * Determines whether any controls contained in a SemanticZoom should be processed separately. This property is always true, meaning that the SemanticZoom takes care of processing its own controls. - **/ - isDeclarativeControlContainer: boolean; - - /** - * Gets or sets a value that indicates whether SemanticZoom is locked and zooming between views is disabled. - **/ - locked: boolean; - - /** - * Gets or sets a value that indicates whether the control is zoomed out. - **/ - zoomedOut: boolean; - - /** - * Gets or sets a value that specifies how much the scaling the cross-fade animation performs when the SemanticZoom transitions between views. - **/ - zoomFactor: number; - - //#endregion Properties - - } - - /** - * Provides users with fast, in-context access to settings that affect the current Windows Store app. - **/ - class SettingsFlyout { - //#region Constructors - - /** - * Creates a new SettingsFlyout object. - * @constructor - * @param element The DOM element that will host the control. - * @param options The set of properties and values to apply to the new SettingsFlyout. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Raised immediately after the SettingsFlyout is completely hidden. - * @param eventInfo An object that contains information about the event. - **/ - onafterhide(eventInfo: Event): void; - - /** - * Raised immediately after a SettingsFlyout is fully shown. - * @param eventInfo An object that contains information about the event. - **/ - onaftershow(eventInfo: Event): void; - - /** - * Raised just before hiding a SettingsFlyout. - * @param eventInfo An object that contains information about the event. - **/ - onbeforehide(eventInfo: Event): void; - - /** - * Raised just before showing a SettingsFlyout. - * @param eventInfo An object that contains information about the event. - **/ - onbeforeshow(eventInfo: Event): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param type The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide. - * @param listener The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this SettingsFlyout. Call this method when the SettingsFlyout is no longer needed. After calling this method, the SettingsFlyout becomes unusable. - **/ - dispose(): void; - - /** - * Hides the SettingsFlyout, if visible, regardless of other states. - **/ - hide(): void; - - /** - * Loads a fragment of the SettingsFlyout. Your app calls this when the user invokes a settings command and the WinJS.Application.onsettings event occurs. - * @param e An object that contains information about the event, received from the WinJS.Application.onsettings event. The detail property of this object contains the applicationcommands sub-property that you set to an array of settings commands. You then populate the SettingsFlyout with these commands by a call to populateSettings. - **/ - static populateSettings(e: CustomEvent): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. - * @param listener The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Shows the SettingsPane UI, if hidden. - **/ - show(): void; - - /** - * Shows the SettingsPane UI, if hidden, regardless of other state. - **/ - static show(): void; - - /** - * Show the Settings flyout using the Settings element identifier (ID) and the path of the page that contains the Settings element. - * @param id The ID of the Settings element. - * @param path The path of the page that contains the Settings element. - **/ - static showSettings(id: string, path: any): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets the DOM element the SettingsFlyout is attached to. - **/ - element: HTMLElement; - - /** - * Gets whether the SettingsFlyout is hidden. - **/ - hidden: boolean; - - /** - * Gets or sets the settings command Id for the SettingsFlyout control. - **/ - settingsCommandId: string; - - /** - * This property may be unavailable or altered in future versions. Use the CSS width property of the element that has the win-settingsflyout class instead. - **/ - width: string; - - //#endregion Properties - - } - - /** - * A type of IListDataSource that provides read-access to an object that implements the IStorageQueryResultBase interface. A StorageDataSource enables you to query and bind to items in the data source. - **/ - class StorageDataSource { - //#region Constructors - - /** - * Creates a new StorageDataSource object. - * @constructor - * @param query The IStorageQueryResultBase that the StorageDataSource obtains its items from. Instead of IStorageQueryResultBase, you can also pass one of these string values: Music, Pictures, Videos, Documents. - * @param options The set of properties and values to apply to the new StorageDataSource. Properties on this object may include: mode , requestedThumbnailSize , thumbnailOptions , synchronous . - **/ - constructor(query: Windows.Storage.Search.IStorageQueryResultBase, options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * Draws the thumbnail for the specified item to the specified img element. - * @param item The item to retrieve the thumbnail for. - * @param image The img element that will display the thumbnail. - * @returns A Promise that completes when the full-quality thumbnail is visible. - **/ - loadThumbnail(item: IItem, image: HTMLImageElement): Promise; - - //#endregion Methods - - } - - /** - * Prevents a DOM sub-tree from receiving tab navigations and focus. - **/ - class TabContainer { - //#region Constructors - - /** - * Creates a new TabContainer. - * @constructor - * @param element The DOM element that hosts the TabContainer control. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties. - **/ - constructor(element: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * Releases resources held by this TabContainer. Call this method when the TabContainer is no longer needed. After calling this method, the TabContainer becomes unusable. - **/ - dispose(): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the child DOM element that receives tab focus. - **/ - childFocus: HTMLElement; - - /** - * Gets or sets the tab index of this container. - **/ - tabIndex: number; - - //#endregion Properties - - } - - /** - * Allows users to select time values. - **/ - class TimePicker { - //#region Constructors - - /** - * Initializes a new instance of a TimePicker control. - * @constructor - * @param element The DOM element associated with the TimePicker control. - * @param options The set of options to be applied initially to the TimePicker control. The options are the following: clock. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Occurs when any of the controls are changed by the user. - * @param eventInfo An object that contains information about the event. - **/ - onchange(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Adds an event listener. - * @param type The type (name) of the event. - * @param listener The function that handles the event. - * @param capture If true, specifies that capture should be initiated, otherwise false. - **/ - addEventListener(type: string, listener: Function, capture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this TimePicker. Call this method when the TimePicker is no longer needed. After calling this method, the TimePicker becomes unusable. - **/ - dispose(): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - raiseEvent(type: string, eventProperties: any): boolean; - - /** - * Removes a listener for the specified event. - * @param type The name of the event for which to remove a listener. - * @param listener The listener. - * @param useCapture Optional. The same value that was passed to addEventListener for this listener. It may be omitted if it was omitted when calling addEventListener. - **/ - removeEventListener(type: string, listener: Function, useCapture?: any): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the type of clock to display (12HourClock or 24HourClock). It defaults to the user setting. - **/ - clock: string; - - /** - * Gets or sets the current time of the TimePicker. Note that the date value is always July 15, 2011. - **/ - current: Date; - - /** - * Specifies whether the TimePicker is disabled. - **/ - disabled: boolean; - - /** - * Gets the DOM element for the TimePicker. - **/ - element: HTMLElement; - - /** - * Gets or sets the display pattern for the hour. The default hour pattern is hour.integer(2). You can change the hour pattern by changing the number of integers displayed. - **/ - hourPattern: string; - - /** - * Gets or sets the minute increment. For example, 15 specifies that the TimePicker minute control should display only the choices 00, 15, 30, 45. - **/ - minuteIncrement: number; - - /** - * Gets or sets the display pattern for the minute. The default minute pattern is minute.integer(2). You can change the minute pattern by changing the number of integers displayed. - **/ - minutePattern: string; - - /** - * Gets or sets the display pattern for the period. The default period pattern is period.abbreviated(2). You can change the period pattern by changing the number of integers displayed. - **/ - periodPattern: string; - - //#endregion Properties - - } - - /** - * A control that lets the user switch an option between two states: on (checked is set to true) and off (checked is set to false). - **/ - class ToggleSwitch { - //#region Constructors - - /** - * Creates a new ToggleSwitch. - * @constructor - * @param element The DOM that hosts the control. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the change event, add a property named "onchange" to the options object and set its value to the event handler. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Occurs when the ToggleSwitch control is flipped to on (checked == true) or off (checked == false). - * @param eventInfo An object that contains information about the event. - **/ - onchange(eventInfo: Event): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Releases resources held by this ToggleSwitch. Call this method when the ToggleSwitch is no longer needed. After calling this method, the ToggleSwitch becomes unusable. - **/ - dispose(): void; - - /** - * Handles the specified event. - * @param event The event. - **/ - handleEvent(event: any): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - raiseEvent(type: string, eventProperties: any): boolean; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets a value that specifies whether the control is on or off. - **/ - checked: boolean; - - /** - * Gets or sets a value that specifies whether the control is disabled. - **/ - disabled: boolean; - - /** - * Gets the DOM element that hosts the ToggleSwitch. - **/ - element: HTMLElement; - - /** - * Gets or sets the text that displays when the ToggleSwitch is off (checked is set to false). - **/ - labelOff: string; - - /** - * Gets or sets the text that displays when the ToggleSwitch is on (checked is set to true). - **/ - labelOn: string; - - /** - * Gets or sets the main text for the ToggleSwitch control. This text is always displayed, regardless of whether the control is switched on or off. - **/ - title: string; - - //#endregion Properties - - } - - /** - * Displays a tooltip that can contain images and formatting. - **/ - class Tooltip { - //#region Constructors - - /** - * Creates a new Tooltip. - * @constructor - * @param element The DOM element associated that hosts the Tooltip. - * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the opened event, add a property named "onopened" to the options object and set its value to the event handler. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Raised just before the Tooltip is hidden. - * @param eventInfo An object that contains information about the event. - **/ - onbeforeclose(eventInfo: CustomEvent): void; - - /** - * Raised just before the Tooltip appears. - * @param eventInfo An object that contains information about the event. - **/ - onbeforeopen(eventInfo: CustomEvent): void; - - /** - * Raised when the Tooltip is no longer displayed. - * @param eventInfo An object that contains information about the event. - **/ - onclosed(eventInfo: CustomEvent): void; - - /** - * Raised when the Tooltip is shown. - * @param eventInfo An object that contains information about the event. - **/ - onopened(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Adds an event handler for the specified event. - * @param eventName The name of the event to handle. - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Hides the Tooltip. - **/ - close(): void; - - /** - * Releases resources held by this Tooltip. Call this method when the Tooltip is no longer needed. After calling this method, the Tooltip becomes unusable. - **/ - dispose(): void; - - /** - * Shows the Tooltip. - * @param type A value that specifies when to show the Tooltip. The default value is "mousedown". - **/ - open(type?: string): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets or sets the HTML element that is the content of the Tooltip. - **/ - contentElement: HTMLElement; - - /** - * Gets the DOM element that hosts the Tooltip control. - **/ - element: HTMLElement; - - /** - * Gets or appends additional CSS classes to apply to the element that hosts the Tooltip. - **/ - extraClass: string; - - /** - * Gets or sets a value that specifies whether the Tooltip is an infotip, a tooltip that contains a lot of info and should be displayed for longer than a typical Tooltip. - **/ - infotip: boolean; - - /** - * Gets or sets the HTML content of the Tooltip. - **/ - innerHTML: string; - - /** - * Gets or sets the position for the Tooltip relative to its target element: top, bottom, left or right. - **/ - placement: string; - - //#endregion Properties - - } - - /** - * Scales a single child element to fill the available space without resizing it. This control reacts to changes in the size of the container as well as changes in size of the child element. For example, a media query may result in a change in aspect ratio. - **/ - class ViewBox { - //#region Constructors - - /** - * Initializes a new instance of the ViewBox control. - * @constructor - * @param element The DOM element that functions as the scaling box. This element fills 100% of the width and height allotted to it. - * @param options The set of options to be applied initially to the ViewBox control. There are currently no options on this control, and any options included in this parameter are ignored. - **/ - constructor(element?: HTMLElement, options?: any); - - //#endregion Constructors - - //#region Methods - - /** - * Adds an event handler for the specified event. - * @param eventName The name of the event to handle. - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Releases resources held by this ViewBox. Call this method when the ViewBox is no longer needed. After calling this method, the ViewBox becomes unusable. - **/ - dispose(): void; - - /** - * Forces the ViewBox to update its layout. Use this function when making the ViewBox visible again after its style.display property had been set to "none". - **/ - forceLayout(): void; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - //#region Properties - - /** - * Gets the DOM element that functions as the scaling box. - **/ - element: HTMLElement; - - //#endregion Properties - - } - - /** - * Serves as the base class for a custom IListDataSource. - **/ - class VirtualizedDataSource { - //#region Constructors - - /** - * Initializes the VirtualizedDataSource base class of a custom data source. - * @constructor - * @param listDataAdapter The object that supplies data to the VirtualizedDataSource. - * @param options An object that can contain properties that specify additional options for the VirtualizedDataSource. It supports these properties: cacheSize. - **/ - constructor(listDataAdapter: IListDataAdapter, options?: any); - - //#endregion Constructors - - //#region Events - - /** - * Occurs when the status of the VirtualizedDataSource changes. - * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: status. - **/ - statuschanged(eventInfo: CustomEvent): void; - - //#endregion Events - - //#region Methods - - /** - * Registers an event handler for the specified event. - * @param eventName The name of the event to handle. See the VirtualizedDataSource object page for a list of events. Note that you drop the "on" when specifying the event name for the addEventListener method. For example, instead of specifying "onstatuschanged", you specify "statuschanged". - * @param eventHandler The event handler function to associate with the event. - * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. - **/ - addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event, otherwise false. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Removes an event handler that the addEventListener method registered. - * @param eventName The name of the event that the event handler is registered for. See the VirtualizedDataSource object page for a list of events. - * @param eventCallback The event handler function to remove. - * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. - **/ - removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - - //#endregion Methods - - } - - //#endregion Objects - - //#region Functions - - /** - * Returns a new IListDataSource that adds group information to the items of another IListDataSource. - * @param listDataSource The data source for the individual items to group. - * @param groupKey A callback function that accepts a single argument: an item in the IListDataSource. The function is called for each item in the list and must return the group key for that item as a string. - * @param groupData A callback function that accepts a single argument: an item in the IListDataSource. The function is called on one IListDataSource item for each group and must return an object that represents the header of that group. - * @param options An object that can contain properties that specify additional options: groupCountEstimate, batchSize. - * @returns An IListDataSource that contains the items in the original data source and provides additional group information in the form of a "groups" property. The "groups" property returns another IListDataSource that enumerates the different groups in the list. - **/ - function computeDataSourceGroups(listDataSource: IListDataSource, groupKey: Function, groupData: Function, options?: any): IListDataSource; - - /** - * Used to disables all Animations Library and ListView animations. Calling this function does not guarantee that the animations will be disabled, as the determination is made based on several factors. - **/ - function disableAnimations(): void; - - /** - * Used to enable all Animations Library and ListView animations. Calling this function does not guarantee that the animations will be enabled, as the determination is made based on several factors. - **/ - function enableAnimations(): void; - - /** - * Marks a event handler function as being compatible with declarative processing. - * @param handler The handler to be marked as compatible with declarative processing. - * @returns The handler, marked as compatible with declarative processing. - **/ - function eventHandler(handler: any): any; - - /** - * Asynchronously executes a collection of CSS animations on a collection of elements. This is the underlying animation mechanism used by the Animations Library. Apps are encouraged to use the Animations Library to conform with the standard look and feel of the rest of the system, rather than calling this function directly. - * @param element Element or elements to be animated. This parameter can be expressed in several ways: As the special value "undefined", which means that the animation has no target, As a single object, As a JavaScript array (possibly empty), in which each element of the array can be a single element or a JavaScript array of elements., As a NodeList (for example, the result of querySelectorAll), As an HTMLCollection. - * @param animation The animation description or an array of animation descriptions to apply to element. An animation description is a JavaScript object with specific properties, listed below. There are two types of animation descriptions: one for keyframe-based animations and one for explicit animations. These types are distinguished by whether the keyframe property has a defined value. The following properties are required for both types of animation descriptions: property (string), delay (number), duration (number), timing (string). If an animation has a keyframe property with a defined, non-null value, then the animation is a keyframe-based animation. A keyframe-based animation description requires the following property in addition to those mentioned above: keyframe (string). If an animation does not have a keyframe property, or if the value of the property is null or undefined, then the animation is an explicit animation. An explicit animation description requires the following properties in addition to the common properties mentioned above: from, to. The values given in the from and to properties must be valid for the CSS property specified by the property property. For example, if the CSS property is "opacity", then the from and to properties must be numbers between 0 and 1 (inclusive). - * @returns Returns a Promise object that completes when the CSS animation is complete. - **/ - function executeAnimation(element: HTMLElement, animation: any): Promise; - - /** - * Asynchronously executes a collection of CSS transitions on a collection of elements. This is the underlying animation mechanism used by the Animations Library. Apps are encouraged to use the Animations Library to conform with the standard look and feel of the rest of the system, rather than calling this function directly. - * @param element Element or elements on which to perform the transition. This parameter can be expressed in several ways: As the special value "undefined", which means that the transition has no target, As a single object, As a JavaScript array (possibly empty), in which each element of the array can be a single element or a JavaScript array of elements., As a NodeList (for example, the result of querySelectorAll), As an HTMLCollection. - * @param transition The transition description or an array of transition descriptions to apply to element. A transition description is a JavaScript object with these properties: property (string), delay (number), duration (number), timing (string), from (optional), to. The values given in the from and to properties must be valid for the CSS property specified by the property property. For example, if the CSS property is "opacity", then the from and to properties must be numbers between 0 and 1 (inclusive). - * @returns Returns a Promise that completes when the transition is finished. - **/ - function executeTransition(element: HTMLElement, transition: any): Promise; - - /** - * Retrieves the items in the specified index range. - * @param dataSource The data source that contains the items to retrieve. - * @param ranges An array of ISelectionRange objects that have firstIndex and lastIndex values. - * @returns A Promise that contains an array of the requested IItem objects. - **/ - function getItemsFromRanges(dataSource: IListDataSource, ranges: ISelectionRange[]): Promise>; - - /** - * Determines whether the Animations Library and ListView animations will be performed if called. - * @returns Returns true if animations will be performed; otherwise false. - **/ - function isAnimationEnabled(): boolean; - - /** - * Applies declarative control binding to all elements, starting at the specified root element. - * @param rootElement The element at which to start applying the binding. If this parameter is not specified, the binding is applied to the entire document. - * @param skipRoot If true, the elements to be bound skip the specified root element and include only the children. - * @returns A promise that is fulfilled when binding has been applied to all the controls. - **/ - function processAll(rootElement?: Element, skipRoot?: boolean): Promise; - - /** - * Applies declarative control binding to the specified element. - * @param element The element to bind. - * @returns A promise that is fulfilled after the control is activated. The value of the promise is the control that is attached to element. - **/ - function process(element: Element): Promise; - - /** - * Walks the DOM tree from the given element to the root of the document. Whenever a selector scope is encountered, this method performs a lookup within that scope for the specified selector string. The first matching element is returned. - * @param selector The selector string. - * @param element The element to begin walking to the root of the document from. - * @returns The target element, if found. - **/ - function scopedSelect(selector: string, element: HTMLElement): HTMLElement; - - /** - * Given a DOM element and a control, attaches the control to the element. - * @param element Element to associate with the control. - * @param control The control to attach to the element. - **/ - function setControl(element: HTMLElement, control: any): void; - - /** - * Adds the set of declaratively specified options (properties and events) to the specified control. If name of the options property begins with "on", the property value is a function and the control supports addEventListener. setControl calls addEventListener on the control. - * @param control The control on which the properties and events are to be applied. - * @param options The set of options that are specified declaratively. - **/ - function setOptions(control: any, options?: any): void; - - //#endregion Functions + /** + * Gets the HTML element that hosts this ListView. + **/ + element: HTMLElement; + + /** + * Gets or sets the data source that contains the groups for the items in the itemDataSource. + **/ + groupDataSource: IListDataSource; + + /** + * Gets or sets how the ListView reacts when the user taps or clicks a group header. + **/ + groupHeaderTapBehavior: GroupHeaderTapBehavior; + + /** + * Gets or sets the Template or function that creates the DOM elements for each group header in the groupDataSource. Each group header can contain multiple elements, but it must have a single root element. + **/ + groupHeaderTemplate: any; + + /** + * Gets or sets the first visible item. + **/ + indexOfFirstVisible: number; + + /** + * Gets the index of the last visible item in the ListView. + **/ + indexOfLastVisible: number; + + /** + * Gets or sets the data source that provides the ListView with items. + **/ + itemDataSource: IListDataSource; + + /** + * Go Gets or sets a value that specifies whether items can be dragged. When this is set to true the ListView provides built in behaviors related to item dragging. + **/ + itemsDraggable: boolean; + + /** + * Gets or sets whether the ListView control's items can be reordered within itself by dragging and dropping. + **/ + itemsReorderable: boolean; + + /** + * Gets or sets the WinJS.Binding.Template or templating function that creates the DOM elements for each item in the itemDataSource. Each item can contain multiple elements, but it must have a single root element. + **/ + itemTemplate: any; + + /** + * Gets or sets an object that controls the layout of the ListView. + **/ + layout: ILayout2; + + /** + * Gets or sets a value that specifies how the ListView fetches items and adds and removes them to the DOM. Don't change the value of this property after the ListView has begun loading data. + **/ + loadingBehavior: string; + + /** + * Gets a value that indicates whether the ListView is still loading or whether loading is complete. + **/ + loadingState: string; + + /** + * Gets or sets the maximum number of realized items. + **/ + maxDeferredItemCleanup: number; + + /** + * Gets or sets the number of pages to load when the loadingBehavior property is set to "incremental" and the user scrolls beyond the threshold specified by the pagesToLoadThreshold property. + **/ + pagesToLoad: number; + + /** + * Gets or sets the threshold (in pages) for initiating an incremental load. When the last visible item is within the specified number of pages from the end of the loaded portion of the list, and if automaticallyLoadPages is true and loadingBehavior is set to "incremental", the ListView initiates an incremental load. + **/ + pagesToLoadThreshold: number; + + /** + * Gets or sets the function that is called when the ListView discards or recycles the element representation of a group header. + **/ + resetGroupHeader: (header: any, element: HTMLElement) => void; + + /** + * Gets or sets the function that is called when an item is removed, an item is changed, or an item falls outside of the realized range of the ListView. + **/ + resetItem: (item: T, element: HTMLElement) => void; + + /** + * Gets or sets the distance, in pixels, of the start of the viewable area within the viewport. + **/ + scrollPosition: number; + + /** + * Gets an ISelection that contains the range of currently selected items. + **/ + selection: ISelection; + + /** + * Gets or sets the selection mode of the ListView. + **/ + selectionMode: SelectionMode; + + /** + * Gets or sets how the ListView reacts to the swipe gesture. The swipe gesture can select the swiped items or can have no effect on the current selection. + **/ + swipeBehavior: WinJS.UI.SwipeBehavior; + + /** + * Gets or sets how the ListView reacts when the user taps or clicks an item. + **/ + tapBehavior: TapBehavior; + + /** + * Gets a ZoomableView that supports semantic zoom functionality. This API supports the SemanticZoom infrastructure and is not intended to be used directly from your code. + **/ + zoomableView: IZoomableView>; + + //#endregion Properties + + } + + /** + * Represents a menu flyout for displaying commands. + **/ + class Menu { + //#region Constructors + + /** + * Creates a new Menu object. + * @constructor + * @param element The DOM element that will host the control. + * @param options The set of properties and values to apply to the new Menu. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Occurs immediately after the Menu is hidden. + * @param eventInfo An object that contains information about the event. + **/ + onafterhide(eventInfo: Event): void; + + /** + * Occurs after the Menu is shown. + * @param eventInfo An object that contains information about the event. + **/ + onaftershow(eventInfo: Event): void; + + /** + * Occurs before the Menu is hidden. + * @param eventInfo An object that contains information about the event. + **/ + onbeforehide(eventInfo: Event): void; + + /** + * Occurs before a hidden Menu is shown. + * @param eventInfo An object that contains information about the event. + **/ + onbeforeshow(eventInfo: Event): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param type The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide. + * @param listener The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Releases resources held by this Menu. Call this method when the Menu is no longer needed. After calling this method, the Menu becomes unusable. + **/ + dispose(): void; + + /** + * Returns the MenuCommand object identified by id. + * @param id The element identifier (ID) of the command to be returned. + * @returns The command identified by id. + **/ + getCommandById(id: string): MenuCommand; + + /** + * Hides the Menu. + **/ + hide(): void; + + /** + * Hides the specified commands of the Menu. + * @param commands The commands to hide. The array elements may be MenuCommand objects, or the string identifiers (IDs) of commands. + * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to hide the commands immediately, without animating them; otherwise, false. + **/ + hideCommands(commands: any[], immediate: boolean): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. + * @param listener The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Shows the Menu, if hidden, regardless of other states. + * @param anchor Required. The DOM element to anchor the Menu. + * @param placement The placement of the Menu to the anchor: top, bottom, left, or right. + * @param alignment For top or bottom placement, the alignment of the Menu to the anchor's edge: center, left, or right. + **/ + show(anchor: HTMLElement, placement: string, alignment: string): void; + + /** + * Shows the specified commands of the Menu. + * @param commands The commands to show. The array elements may be Menu objects, or the string identifiers (IDs) of commands. + * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the commands immediately, without animating them; otherwise, false. + **/ + showCommands(commands: any[], immediate: boolean): void; + + /** + * Shows the specified commands of the Menu while hiding all other commands. + * @param commands The commands to show. The array elements may be MenuCommand objects, or the string identifiers (IDs) of commands. + * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the specified commands (and hide the others) immediately, without animating them; otherwise, false. + **/ + showOnlyCommands(commands: any[], immediate: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the default alignment to be used for this Menu. + **/ + alignment: string; + + /** + * Gets or sets the default anchor to be used for this Menu. + **/ + anchor: HTMLElement; + + /** + * Sets the MenuCommand objects that appear in the menu. + **/ + commands: MenuCommand[]; + + /** + * Gets the DOM element that hosts the Menu. + **/ + element: HTMLElement; + + /** + * Gets a value that indicates whether the Menu is hidden or in the process of becoming hidden. + **/ + hidden: boolean; + + /** + * Gets or sets the default placement to be used for this Menu. + **/ + placement: string; + + //#endregion Properties + + } + + /** + * Represents a command to be displayed in a Menu object. + **/ + class MenuCommand { + //#region Constructors + + /** + * Creates a new MenuCommand object. + * @constructor + * @param element The DOM element that will host the control. + * @param options The set of properties and values to apply to the new MenuCommand. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param type The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide. + * @param listener The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Disposes this control. + **/ + dispose(): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. + * @param listener The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(type: string, listener: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets a value that indicates whether the MenuCommand is disabled. + **/ + disabled: boolean; + + /** + * Gets the DOM element that hosts the MenuCommand. + **/ + element: HTMLElement; + + /** + * Adds an extra CSS class during construction. + **/ + extraClass: string; + + /** + * Gets or sets the Flyout object displayed by this command. The specified flyout is shown when the MenuCommand's button is invoked. + **/ + flyout: Flyout; + + /** + * Gets a value that indicates whether the MenuCommand is hidden or in the process of becoming hidden. + **/ + hidden: boolean; + + /** + * Gets the element identifier (ID) of the command. + **/ + id: string; + + /** + * Gets or sets the label of the command. + **/ + label: string; + + /** + * Gets or sets the function to be invoked when the command is clicked. + **/ + onclick: Function; + + /** + * Gets or sets the selected state of a toggle button. + **/ + selected: boolean; + + /** + * Gets the type of the command. + **/ + type: string; + + //#endregion Properties + + } + + /** + * Displays navigation commands in a toolbar that the user can show or hide. + **/ + class NavBar { + //#region Constructors + + /** + * Creates a new NavBar. + * @constructor + * @param element The DOM element that will host the new NavBar. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Occurs immediately after the NavBar is hidden. + * @param eventInfo An object that contains information about the event. + **/ + onafterhide(eventInfo: Event): void; + + /** + * Raised after the NavBar is shown. + * @param eventInfo An object that contains information about the event. + **/ + onaftershow(eventInfo: Event): void; + + /** + * Raised just before the NavBar is hidden. + * @param eventInfo An object that contains information about the event. + **/ + onbeforehide(eventInfo: Event): void; + + /** + * Occurs before a hidden NavBar is shown. + * @param eventInfo An object that contains information about the event. + **/ + onbeforeshow(eventInfo: Event): void; + + /** + * Occurs after the NavBar has finished processing its child elements. + * @param eventInfo An object that contains information about the event. + **/ + onchildrenprocessed(eventInfo: Event): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this NavBar. Call this method when the NavBar is no longer needed. After calling this method, the NavBar becomes unusable. + **/ + dispose(): void; + + /** + * Hides the NavBar. + **/ + hide(): void; + + /** + * Hides the specified commands of the NavBar. + * @param commands The commands to hide. The array elements may be NavBarCommand objects, or the string identifiers (IDs) of commands. + * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to hide the commands immediately, without animating them; otherwise, false. + **/ + hideCommands(commands: any[], immediate: boolean): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + /** + * Shows the NavBar if it is not disabled. + **/ + show(): void; + + /** + * Shows the specified commands of the NavBar. + * @param commands The commands to show. The array elements may be NavBarCommand objects, or the string identifiers (IDs) of commands. + * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the commands immediately, without animating them; otherwise, false. + **/ + showCommands(commands: any[], immediate: boolean): void; + + /** + * Shows the specified commands of the NavBar while hiding all other commands. + * @param commands The commands to show. The array elements may be NavBarCommand objects, or the string identifiers (IDs) of commands. + * @param immediate The parameter immediate is not supported and may be altered or unavailable in the future. true to show the specified commands (and hide the others) immediately, without animating them; otherwise, false. + **/ + showOnlyCommands(commands: any[], immediate: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + commands: AppBarCommand; + + /** + * Gets or sets a value that indicates whether the NavBar is disabled. + **/ + disabled: boolean; + + /** + * Gets the HTML element that hosts this NavBar. + **/ + element: HTMLElement; + + /** + * Gets a value that indicates whether the NavBar is hidden or in the process of becoming hidden. + **/ + hidden: boolean; + + /** + * This API supports the WinJS infrastructure and is not intended to be used directly from your code. + **/ + layout: string; + + /** + * Gets or sets a value that specifies whether the NavBar appears at the top or bottom of the main view. + **/ + placement: string; + + /** + * Gets or sets a value that indicates whether the NavBar is sticky (won't light dismiss). If not sticky, the NavBar dismisses normally when the user touches outside of the NavBar. + **/ + sticky: boolean; + + //#endregion Properties + + } + + /** + * Represents a navigation command in a NavBarContainer. + **/ + class NavBarCommand { + //#region Constructors + + /** + * Creates a new NavBarCommand. + * @constructor + * @param element The DOM element hosts the new NavBarCommand. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this NavBarCommand. Call this method when the NavBarCommand is no longer needed. After calling this method, the NavBarCommand becomes unusable. + **/ + dispose(): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets the HTML element that hosts this NavBarCommand. + **/ + element: HTMLElement; + + /** + * Gets or sets the command's icon. + **/ + icon: string; + + /** + * Gets or sets the label of the command. + **/ + label: string; + + /** + * Get or sets the location to navigate to when this command is invoked. + **/ + location: any; + + /** + * Gets or sets a value that specifies whether to show the split tab stop. + **/ + splitButton: boolean; + + /** + * Gets a value that indicates whether the splitButton is open. + **/ + splitOpened: boolean; + + /** + * Gets or sets a user-defined object that represents the state associated with the command's location. + **/ + state: any; + + /** + * Gets or sets the tooltip of the command. + **/ + tooltip: any; + + //#endregion Properties + + } + + /** + * Contains a group of NavBarCommand objects in a NavBar. + **/ + class NavBarContainer { + //#region Constructors + + /** + * Creates a new NavBarContainer. + * @constructor + * @param element The DOM element hosts the new NavBarContainer. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Occurs when a child NavBarCommand object's click event fires. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.index, detail.navbarcommand, detail.data. + **/ + oninvoked(eventInfo: CustomEvent): void; + + /** + * Occurs when the split button of a child NavBarCommand is opened or closed. A split button is toggled when the user navigates to another page or opens another split button. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.opened, detail.index, detail.navbarcommand, detail.data. + **/ + onsplittoggle(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this NavBarCommand. Call this method when the NavBarCommand is no longer needed. After calling this method, the NavBarCommand becomes unusable. + **/ + dispose(): void; + + /** + * Forces the NavBarContainer to update its layout. Use this function when making the NavBarContainer visible again after you set its style.display property to "none". + **/ + forceLayout(): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the index of the current item. + **/ + currentIndex: number; + + /** + * Gets or sets a WinJS.Binding.List that generates NavBarCommand objects. + **/ + data: WinJS.Binding.List; + + /** + * Gets the HTML element that hosts this NavBarContainer. + **/ + element: HTMLElement; + + /** + * Gets or sets a value that specifies whether NavBarCommand objects in this container use a fixed or dynamic width. + **/ + fixedSize: boolean; + + /** + * Gets or sets a value that specifies whether the NavBarContainer has a horizontal or vertical layout. + **/ + layout: Orientation; + + /** + * Gets or sets a value that specifies how many rows of navigation commands to display on a page. + **/ + maxRows: number; + + /** + * Gets or sets the WinJS.Binding.Template or templating function that creates the DOM elements for each item in the data source. Each item can contain multiple elements, but it must have a single root element. + **/ + template: WinJS.Binding.Template; + + //#endregion Properties + + } + + /** + * Lets the user rate something by clicking an icon that represents a rating. The Rating control can display three types of ratings: an average rating, a tentative rating, and the user's rating. + **/ + class Rating { + //#region Constructors + + /** + * Creates a new Rating. + * @constructor + * @param element The DOM element hosts the new Rating. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the cancel event, add a property named "oncancel" to the options object and set its value to the event handler. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Raised when the user finishes interacting with the rating control without committing a tentative rating. + * @param eventInfo An object that contains information about the event. + **/ + oncancel(eventInfo: Event): void; + + /** + * Raised when the user commits a change to the userRating. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.tentativeRating. + **/ + onchange(eventInfo: CustomEvent): void; + + /** + * Raised when the user is choosing a new tentative Rating. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.tentativeRating. + **/ + onpreviewchange(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Releases resources held by this Rating. Call this method when the Rating is no longer needed. After calling this method, the Rating becomes unusable. + **/ + dispose(): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the average rating. + **/ + averageRating: number; + + /** + * Gets or sets whether the control is disabled. When the control is disabled, the user can't specify a new user rating or modify an existing rating. + **/ + disabled: boolean; + + /** + * Gets the DOM element that hosts the Rating. + **/ + element: HTMLElement; + + /** + * Gets or sets whether control lets the user clear the rating. + **/ + enableClear: boolean; + + /** + * Gets or sets the maximum possible rating value. + **/ + maxRating: number; + + /** + * Gets or sets a set of descriptions to show for rating values in the tooltip. + **/ + tooltipStrings: string[]; + + /** + * Gets or sets the user's rating. + **/ + userRating: number; + + //#endregion Properties + + } + + /** + * Generates HTML from a set of data. Use this control to generate lists of items. + **/ + class Repeater { + //#region Constructors + + /** + * Creates a new Repeater control. + * @constructor + * @param options An object that contains one or more property/value pairs to apply to the new Repeater. Each property of the options object corresponds to one of the object's properties or events. Event names must begin with "on". + **/ + constructor(options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Raised after an item in the Repeater control's data source changes and after the corresponding DOM element has been updated. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.index, detail.key, detail.newElement, detail.newItem, detail.newValue, detail.oldElement, detail.oldItem, detail.oldValue, detail.setPromise. + **/ + onitemchanged(eventInfo: CustomEvent): void; + + /** + * Raised after an item in the Repeater control's data source changes but before the corresponding DOM element has been updated. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.index, detail.key, detail.newElement, detail.newItem, detail.newValue, detail.oldElement, detail.oldItem, detail.oldValue, detail.setPromise. + **/ + onitemchanging(eventInfo: CustomEvent): void; + + /** + * Raised after an item has been added to the Repeater control's data source and after the corresponding DOM element has been added. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.key, detail.value. + **/ + oniteminserted(eventInfo: CustomEvent): void; + + /** + * Raised after an item has been added to the Repeater control's data source but before the corresponding DOM element has been added. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.key, detail.value. + **/ + oniteminserting(eventInfo: CustomEvent): void; + + /** + * Raised after an item has been moved from one index to another in the Repeater control's data source and after the corresponding DOM element has been moved. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.key, detail.oldIndex, detail.newIndex. + **/ + onitemmoved(eventInfo: CustomEvent): void; + + /** + * Raised after an item has been moved from one index to another in the Repeater control's data source but before the corresponding DOM element has been moved. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.key, detail.oldIndex, detail.newIndex. + **/ + onitemmoving(eventInfo: CustomEvent): void; + + /** + * Raised after an item has been moved from one index to another in the Repeater control's data source and after the corresponding DOM element has been moved. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.item, detail.setPromise. + **/ + onitemremoved(eventInfo: CustomEvent): void; + + /** + * Raised after an item has been removed from the Repeater control's data source but before the corresponding DOM element has been removed. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElement, detail.index, detail.item, detail.setPromise. + **/ + onitemremoving(eventInfo: CustomEvent): void; + + /** + * Raised when the Repeater has finished loading a new set of data. This event is only fired on construction. This event is only raised when the Repeater is constructed or its data source or template changes. + * @param eventInfo An object that contains information about the event. + **/ + onitemsloaded(eventInfo: CustomEvent): void; + + /** + * Raised after the Repeater control's underlying data has been updated and after the updated HTML has been reloaded. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElements. + **/ + onitemsreloaded(eventInfo: CustomEvent): void; + + /** + * Raised after the Repeater control's underlying data has been updated but before the updated HTML has been reloaded. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.affectedElements, detail.setPromise. + **/ + onitemsreloading(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this Repeater. Call this method when the Repeater is no longer needed. After calling this method, the Repeater becomes unusable. + **/ + dispose(): void; + + /** + * Returns the HTML element for the item at the specified index. + * @param index The index of the item. + * @returns The DOM element for the specified item. + **/ + elementFromIndex(index: number): HTMLElement; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the List that provides the Repeater with items to display. + **/ + data: WinJS.Binding.List; + + /** + * Gets the DOM element that hosts the Repeater. + **/ + element: HTMLElement; + + /** + * Gets the number of items in the Repeater control. + **/ + length: number; + + /** + * Gets or sets a WinJS.Binding.Template or custom rendering function that defines the HTML of each item within the Repeater. + **/ + template: WinJS.Binding.Template; + + //#endregion Properties + + } + + /** + * Enables the user to perform search queries and select suggestions. + **/ + class SearchBox { + //#region Constructors + + /** + * Creates a new SearchBox. + * @constructor + * @param element The DOM element hosts the new SearchBox. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Raised when the user or the app changes the queryText. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.language, detail.queryText, detail.linguisticDetails. + **/ + onquerychanged(eventInfo: CustomEvent): void; + + /** + * Raised awhen the user clicks the search glyph or presses Enter. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.language, detail.queryText, detail.linguisticDetails, detail.keyModifiers. + **/ + onquerysubmitted(eventInfo: CustomEvent): void; + + /** + * Raised when the app automatically redirects focus to the search box. This event can only be raised when the focusOnKeyboardInput property is set to true. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.propertyName. + **/ + onreceivingfocusonkeyboardinput(eventInfo: CustomEvent): void; + + /** + * Raised when the user selects a suggested option for the search. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.tag, detail.keyModifiers, detail.storageFile. + **/ + onresultsuggestionschosen(eventInfo: CustomEvent): void; + + /** + * Raised when the system requests search suggestions from this app. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: detail.language, detail.linguisticDetails, detail.queryText, detail.searchSuggestionCollection. + **/ + onsuggestionsrequested(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click". + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this SearchBox. Call this method when the SearchBox is no longer needed. After calling this method, the SearchBox becomes unusable. + **/ + dispose(): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + /** + * Specifies whether suggestions based on local files are automatically displayed in the search pane, and defines the criteria that Windows uses to locate and filter these suggestions. + * @param settings The new settings for local content suggestions. + **/ + setLocalContentSuggestionSettings(settings: any): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets whether the first suggestion is chosen when the user presses Enter. + **/ + chooseSuggestionOnEnter: boolean; + + /** + * Gets or sets a value that specifies whether the SearchBox is disabled. If the control is disabled, it won't receive focus. + **/ + disabled: boolean; + + /** + * Gets the DOM element that hosts the SearchBox. + **/ + element: HTMLElement; + + /** + * Gets or sets a value that specifies whether the search box automatically receives focus when the user types into the app window. + **/ + focusOnKeyboardInput: boolean; + + /** + * Gets or sets the placeholder text for the SearchBox. This text is displayed if there is no other text in the input box. + **/ + placeholderText: string; + + /** + * Gets or sets the query text for the SearchBox. + **/ + queryText: string; + + /** + * Gets or sets the search history context. This context is used a secondary key (the app ID is the primary key) for storing search history. + **/ + searchHistoryContext: string; + + /** + * Gets or sets a value that specifies whether search history is disabled. + **/ + searchHistoryDisabled: boolean; + + //#endregion Properties + + } + + /** + * Enables the user to zoom between two different views supplied by two child controls. One child control supplies the zoomed-out view and the other provides the zoomed-in view. + **/ + class SemanticZoom { + //#region Constructors + + /** + * Creates a new SemanticZoom. + * @constructor + * @param element The DOM element that hosts the SemanticZoom. + * @param options An object that contains one or more property/value pairs to apply to the new control. This object can contain these properties: initiallyZoomedOut Boolean, zoomFactor 0.2–0.85. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Occurs when the control zooms in or out. + * @param eventInfo An object that contains information about the event. The detail property of this object is true when the control is zoomed out. Otherwise, it's false. + **/ + onzoomchanged(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this SemanticZoom. Call this method when the SemanticZoom is no longer needed. After calling this method, the SemanticZoom becomes unusable. + **/ + dispose(): void; + + /** + * Forces the SemanticZoom to update its layout. Use this function when making the SemanticZoom visible again after its style.display property had been set to "none". + **/ + forceLayout(): void; + + /** + * Unregisters an event handler for the specified event. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets the DOM element that hosts the SemanticZoom control. + **/ + element: HTMLElement; + + /** + * Gets or a sets a value that specifies whether to display the SemanticZoom zoom out button. + **/ + enableButton: boolean; + + /** + * Determines whether any controls contained in a SemanticZoom should be processed separately. This property is always true, meaning that the SemanticZoom takes care of processing its own controls. + **/ + isDeclarativeControlContainer: boolean; + + /** + * Gets or sets a value that indicates whether SemanticZoom is locked and zooming between views is disabled. + **/ + locked: boolean; + + /** + * Gets or sets a value that indicates whether the control is zoomed out. + **/ + zoomedOut: boolean; + + /** + * Gets or sets a value that specifies how much the scaling the cross-fade animation performs when the SemanticZoom transitions between views. + **/ + zoomFactor: number; + + //#endregion Properties + + } + + /** + * Provides users with fast, in-context access to settings that affect the current Windows Store app. + **/ + class SettingsFlyout { + //#region Constructors + + /** + * Creates a new SettingsFlyout object. + * @constructor + * @param element The DOM element that will host the control. + * @param options The set of properties and values to apply to the new SettingsFlyout. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Raised immediately after the SettingsFlyout is completely hidden. + * @param eventInfo An object that contains information about the event. + **/ + onafterhide(eventInfo: Event): void; + + /** + * Raised immediately after a SettingsFlyout is fully shown. + * @param eventInfo An object that contains information about the event. + **/ + onaftershow(eventInfo: Event): void; + + /** + * Raised just before hiding a SettingsFlyout. + * @param eventInfo An object that contains information about the event. + **/ + onbeforehide(eventInfo: Event): void; + + /** + * Raised just before showing a SettingsFlyout. + * @param eventInfo An object that contains information about the event. + **/ + onbeforeshow(eventInfo: Event): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param type The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide. + * @param listener The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this SettingsFlyout. Call this method when the SettingsFlyout is no longer needed. After calling this method, the SettingsFlyout becomes unusable. + **/ + dispose(): void; + + /** + * Hides the SettingsFlyout, if visible, regardless of other states. + **/ + hide(): void; + + /** + * Loads a fragment of the SettingsFlyout. Your app calls this when the user invokes a settings command and the WinJS.Application.onsettings event occurs. + * @param e An object that contains information about the event, received from the WinJS.Application.onsettings event. The detail property of this object contains the applicationcommands sub-property that you set to an array of settings commands. You then populate the SettingsFlyout with these commands by a call to populateSettings. + **/ + static populateSettings(e: CustomEvent): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param type The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide. + * @param listener The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Shows the SettingsPane UI, if hidden. + **/ + show(): void; + + /** + * Shows the SettingsPane UI, if hidden, regardless of other state. + **/ + static show(): void; + + /** + * Show the Settings flyout using the Settings element identifier (ID) and the path of the page that contains the Settings element. + * @param id The ID of the Settings element. + * @param path The path of the page that contains the Settings element. + **/ + static showSettings(id: string, path: any): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets the DOM element the SettingsFlyout is attached to. + **/ + element: HTMLElement; + + /** + * Gets whether the SettingsFlyout is hidden. + **/ + hidden: boolean; + + /** + * Gets or sets the settings command Id for the SettingsFlyout control. + **/ + settingsCommandId: string; + + /** + * This property may be unavailable or altered in future versions. Use the CSS width property of the element that has the win-settingsflyout class instead. + **/ + width: string; + + //#endregion Properties + + } + + /** + * A type of IListDataSource that provides read-access to an object that implements the IStorageQueryResultBase interface. A StorageDataSource enables you to query and bind to items in the data source. + **/ + class StorageDataSource { + //#region Constructors + + /** + * Creates a new StorageDataSource object. + * @constructor + * @param query The IStorageQueryResultBase that the StorageDataSource obtains its items from. Instead of IStorageQueryResultBase, you can also pass one of these string values: Music, Pictures, Videos, Documents. + * @param options The set of properties and values to apply to the new StorageDataSource. Properties on this object may include: mode , requestedThumbnailSize , thumbnailOptions , synchronous . + **/ + constructor(query: any, options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * Draws the thumbnail for the specified item to the specified img element. + * @param item The item to retrieve the thumbnail for. + * @param image The img element that will display the thumbnail. + * @returns A Promise that completes when the full-quality thumbnail is visible. + **/ + loadThumbnail(item: IItem, image: HTMLImageElement): Promise; + + //#endregion Methods + + } + + /** + * Prevents a DOM sub-tree from receiving tab navigations and focus. + **/ + class TabContainer { + //#region Constructors + + /** + * Creates a new TabContainer. + * @constructor + * @param element The DOM element that hosts the TabContainer control. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties. + **/ + constructor(element: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * Releases resources held by this TabContainer. Call this method when the TabContainer is no longer needed. After calling this method, the TabContainer becomes unusable. + **/ + dispose(): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the child DOM element that receives tab focus. + **/ + childFocus: HTMLElement; + + /** + * Gets or sets the tab index of this container. + **/ + tabIndex: number; + + //#endregion Properties + + } + + /** + * Allows users to select time values. + **/ + class TimePicker { + //#region Constructors + + /** + * Initializes a new instance of a TimePicker control. + * @constructor + * @param element The DOM element associated with the TimePicker control. + * @param options The set of options to be applied initially to the TimePicker control. The options are the following: clock. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Occurs when any of the controls are changed by the user. + * @param eventInfo An object that contains information about the event. + **/ + onchange(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Adds an event listener. + * @param type The type (name) of the event. + * @param listener The function that handles the event. + * @param capture If true, specifies that capture should be initiated, otherwise false. + **/ + addEventListener(type: string, listener: Function, capture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this TimePicker. Call this method when the TimePicker is no longer needed. After calling this method, the TimePicker becomes unusable. + **/ + dispose(): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + raiseEvent(type: string, eventProperties: any): boolean; + + /** + * Removes a listener for the specified event. + * @param type The name of the event for which to remove a listener. + * @param listener The listener. + * @param useCapture Optional. The same value that was passed to addEventListener for this listener. It may be omitted if it was omitted when calling addEventListener. + **/ + removeEventListener(type: string, listener: Function, useCapture?: any): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the type of clock to display (12HourClock or 24HourClock). It defaults to the user setting. + **/ + clock: string; + + /** + * Gets or sets the current time of the TimePicker. Note that the date value is always July 15, 2011. + **/ + current: Date; + + /** + * Specifies whether the TimePicker is disabled. + **/ + disabled: boolean; + + /** + * Gets the DOM element for the TimePicker. + **/ + element: HTMLElement; + + /** + * Gets or sets the display pattern for the hour. The default hour pattern is hour.integer(2). You can change the hour pattern by changing the number of integers displayed. + **/ + hourPattern: string; + + /** + * Gets or sets the minute increment. For example, 15 specifies that the TimePicker minute control should display only the choices 00, 15, 30, 45. + **/ + minuteIncrement: number; + + /** + * Gets or sets the display pattern for the minute. The default minute pattern is minute.integer(2). You can change the minute pattern by changing the number of integers displayed. + **/ + minutePattern: string; + + /** + * Gets or sets the display pattern for the period. The default period pattern is period.abbreviated(2). You can change the period pattern by changing the number of integers displayed. + **/ + periodPattern: string; + + //#endregion Properties + + } + + /** + * A control that lets the user switch an option between two states: on (checked is set to true) and off (checked is set to false). + **/ + class ToggleSwitch { + //#region Constructors + + /** + * Creates a new ToggleSwitch. + * @constructor + * @param element The DOM that hosts the control. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the change event, add a property named "onchange" to the options object and set its value to the event handler. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Occurs when the ToggleSwitch control is flipped to on (checked == true) or off (checked == false). + * @param eventInfo An object that contains information about the event. + **/ + onchange(eventInfo: Event): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Releases resources held by this ToggleSwitch. Call this method when the ToggleSwitch is no longer needed. After calling this method, the ToggleSwitch becomes unusable. + **/ + dispose(): void; + + /** + * Handles the specified event. + * @param event The event. + **/ + handleEvent(event: any): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + raiseEvent(type: string, eventProperties: any): boolean; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets a value that specifies whether the control is on or off. + **/ + checked: boolean; + + /** + * Gets or sets a value that specifies whether the control is disabled. + **/ + disabled: boolean; + + /** + * Gets the DOM element that hosts the ToggleSwitch. + **/ + element: HTMLElement; + + /** + * Gets or sets the text that displays when the ToggleSwitch is off (checked is set to false). + **/ + labelOff: string; + + /** + * Gets or sets the text that displays when the ToggleSwitch is on (checked is set to true). + **/ + labelOn: string; + + /** + * Gets or sets the main text for the ToggleSwitch control. This text is always displayed, regardless of whether the control is switched on or off. + **/ + title: string; + + //#endregion Properties + + } + + /** + * Displays a tooltip that can contain images and formatting. + **/ + class Tooltip { + //#region Constructors + + /** + * Creates a new Tooltip. + * @constructor + * @param element The DOM element associated that hosts the Tooltip. + * @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the opened event, add a property named "onopened" to the options object and set its value to the event handler. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Raised just before the Tooltip is hidden. + * @param eventInfo An object that contains information about the event. + **/ + onbeforeclose(eventInfo: CustomEvent): void; + + /** + * Raised just before the Tooltip appears. + * @param eventInfo An object that contains information about the event. + **/ + onbeforeopen(eventInfo: CustomEvent): void; + + /** + * Raised when the Tooltip is no longer displayed. + * @param eventInfo An object that contains information about the event. + **/ + onclosed(eventInfo: CustomEvent): void; + + /** + * Raised when the Tooltip is shown. + * @param eventInfo An object that contains information about the event. + **/ + onopened(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Adds an event handler for the specified event. + * @param eventName The name of the event to handle. + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Hides the Tooltip. + **/ + close(): void; + + /** + * Releases resources held by this Tooltip. Call this method when the Tooltip is no longer needed. After calling this method, the Tooltip becomes unusable. + **/ + dispose(): void; + + /** + * Shows the Tooltip. + * @param type A value that specifies when to show the Tooltip. The default value is "mousedown". + **/ + open(type?: string): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets or sets the HTML element that is the content of the Tooltip. + **/ + contentElement: HTMLElement; + + /** + * Gets the DOM element that hosts the Tooltip control. + **/ + element: HTMLElement; + + /** + * Gets or appends additional CSS classes to apply to the element that hosts the Tooltip. + **/ + extraClass: string; + + /** + * Gets or sets a value that specifies whether the Tooltip is an infotip, a tooltip that contains a lot of info and should be displayed for longer than a typical Tooltip. + **/ + infotip: boolean; + + /** + * Gets or sets the HTML content of the Tooltip. + **/ + innerHTML: string; + + /** + * Gets or sets the position for the Tooltip relative to its target element: top, bottom, left or right. + **/ + placement: string; + + //#endregion Properties + + } + + /** + * Scales a single child element to fill the available space without resizing it. This control reacts to changes in the size of the container as well as changes in size of the child element. For example, a media query may result in a change in aspect ratio. + **/ + class ViewBox { + //#region Constructors + + /** + * Initializes a new instance of the ViewBox control. + * @constructor + * @param element The DOM element that functions as the scaling box. This element fills 100% of the width and height allotted to it. + * @param options The set of options to be applied initially to the ViewBox control. There are currently no options on this control, and any options included in this parameter are ignored. + **/ + constructor(element?: HTMLElement, options?: any); + + //#endregion Constructors + + //#region Methods + + /** + * Adds an event handler for the specified event. + * @param eventName The name of the event to handle. + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Releases resources held by this ViewBox. Call this method when the ViewBox is no longer needed. After calling this method, the ViewBox becomes unusable. + **/ + dispose(): void; + + /** + * Forces the ViewBox to update its layout. Use this function when making the ViewBox visible again after its style.display property had been set to "none". + **/ + forceLayout(): void; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + //#region Properties + + /** + * Gets the DOM element that functions as the scaling box. + **/ + element: HTMLElement; + + //#endregion Properties + + } + + /** + * Serves as the base class for a custom IListDataSource. + **/ + class VirtualizedDataSource { + //#region Constructors + + /** + * Initializes the VirtualizedDataSource base class of a custom data source. + * @constructor + * @param listDataAdapter The object that supplies data to the VirtualizedDataSource. + * @param options An object that can contain properties that specify additional options for the VirtualizedDataSource. It supports these properties: cacheSize. + **/ + constructor(listDataAdapter: IListDataAdapter, options?: any); + + //#endregion Constructors + + //#region Events + + /** + * Occurs when the status of the VirtualizedDataSource changes. + * @param eventInfo An object that contains information about the event. The detail property of this object contains the following sub-properties: status. + **/ + statuschanged(eventInfo: CustomEvent): void; + + //#endregion Events + + //#region Methods + + /** + * Registers an event handler for the specified event. + * @param eventName The name of the event to handle. See the VirtualizedDataSource object page for a list of events. Note that you drop the "on" when specifying the event name for the addEventListener method. For example, instead of specifying "onstatuschanged", you specify "statuschanged". + * @param eventHandler The event handler function to associate with the event. + * @param useCapture Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase. + **/ + addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event, otherwise false. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Removes an event handler that the addEventListener method registered. + * @param eventName The name of the event that the event handler is registered for. See the VirtualizedDataSource object page for a list of events. + * @param eventCallback The event handler function to remove. + * @param useCapture Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler. + **/ + removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; + + //#endregion Methods + + } + + //#endregion Objects + + //#region Functions + + /** + * Returns a new IListDataSource that adds group information to the items of another IListDataSource. + * @param listDataSource The data source for the individual items to group. + * @param groupKey A callback function that accepts a single argument: an item in the IListDataSource. The function is called for each item in the list and must return the group key for that item as a string. + * @param groupData A callback function that accepts a single argument: an item in the IListDataSource. The function is called on one IListDataSource item for each group and must return an object that represents the header of that group. + * @param options An object that can contain properties that specify additional options: groupCountEstimate, batchSize. + * @returns An IListDataSource that contains the items in the original data source and provides additional group information in the form of a "groups" property. The "groups" property returns another IListDataSource that enumerates the different groups in the list. + **/ + function computeDataSourceGroups(listDataSource: IListDataSource, groupKey: Function, groupData: Function, options?: any): IListDataSource; + + /** + * Used to disables all Animations Library and ListView animations. Calling this function does not guarantee that the animations will be disabled, as the determination is made based on several factors. + **/ + function disableAnimations(): void; + + /** + * Used to enable all Animations Library and ListView animations. Calling this function does not guarantee that the animations will be enabled, as the determination is made based on several factors. + **/ + function enableAnimations(): void; + + /** + * Marks a event handler function as being compatible with declarative processing. + * @param handler The handler to be marked as compatible with declarative processing. + * @returns The handler, marked as compatible with declarative processing. + **/ + function eventHandler(handler: any): any; + + /** + * Asynchronously executes a collection of CSS animations on a collection of elements. This is the underlying animation mechanism used by the Animations Library. Apps are encouraged to use the Animations Library to conform with the standard look and feel of the rest of the system, rather than calling this function directly. + * @param element Element or elements to be animated. This parameter can be expressed in several ways: As the special value "undefined", which means that the animation has no target, As a single object, As a JavaScript array (possibly empty), in which each element of the array can be a single element or a JavaScript array of elements., As a NodeList (for example, the result of querySelectorAll), As an HTMLCollection. + * @param animation The animation description or an array of animation descriptions to apply to element. An animation description is a JavaScript object with specific properties, listed below. There are two types of animation descriptions: one for keyframe-based animations and one for explicit animations. These types are distinguished by whether the keyframe property has a defined value. The following properties are required for both types of animation descriptions: property (string), delay (number), duration (number), timing (string). If an animation has a keyframe property with a defined, non-null value, then the animation is a keyframe-based animation. A keyframe-based animation description requires the following property in addition to those mentioned above: keyframe (string). If an animation does not have a keyframe property, or if the value of the property is null or undefined, then the animation is an explicit animation. An explicit animation description requires the following properties in addition to the common properties mentioned above: from, to. The values given in the from and to properties must be valid for the CSS property specified by the property property. For example, if the CSS property is "opacity", then the from and to properties must be numbers between 0 and 1 (inclusive). + * @returns Returns a Promise object that completes when the CSS animation is complete. + **/ + function executeAnimation(element: HTMLElement, animation: any): Promise; + + /** + * Asynchronously executes a collection of CSS transitions on a collection of elements. This is the underlying animation mechanism used by the Animations Library. Apps are encouraged to use the Animations Library to conform with the standard look and feel of the rest of the system, rather than calling this function directly. + * @param element Element or elements on which to perform the transition. This parameter can be expressed in several ways: As the special value "undefined", which means that the transition has no target, As a single object, As a JavaScript array (possibly empty), in which each element of the array can be a single element or a JavaScript array of elements., As a NodeList (for example, the result of querySelectorAll), As an HTMLCollection. + * @param transition The transition description or an array of transition descriptions to apply to element. A transition description is a JavaScript object with these properties: property (string), delay (number), duration (number), timing (string), from (optional), to. The values given in the from and to properties must be valid for the CSS property specified by the property property. For example, if the CSS property is "opacity", then the from and to properties must be numbers between 0 and 1 (inclusive). + * @returns Returns a Promise that completes when the transition is finished. + **/ + function executeTransition(element: HTMLElement, transition: any): Promise; + + /** + * Retrieves the items in the specified index range. + * @param dataSource The data source that contains the items to retrieve. + * @param ranges An array of ISelectionRange objects that have firstIndex and lastIndex values. + * @returns A Promise that contains an array of the requested IItem objects. + **/ + function getItemsFromRanges(dataSource: IListDataSource, ranges: ISelectionRange[]): Promise>; + + /** + * Determines whether the Animations Library and ListView animations will be performed if called. + * @returns Returns true if animations will be performed; otherwise false. + **/ + function isAnimationEnabled(): boolean; + + /** + * Applies declarative control binding to all elements, starting at the specified root element. + * @param rootElement The element at which to start applying the binding. If this parameter is not specified, the binding is applied to the entire document. + * @param skipRoot If true, the elements to be bound skip the specified root element and include only the children. + * @returns A promise that is fulfilled when binding has been applied to all the controls. + **/ + function processAll(rootElement?: Element, skipRoot?: boolean): Promise; + + /** + * Applies declarative control binding to the specified element. + * @param element The element to bind. + * @returns A promise that is fulfilled after the control is activated. The value of the promise is the control that is attached to element. + **/ + function process(element: Element): Promise; + + /** + * Walks the DOM tree from the given element to the root of the document. Whenever a selector scope is encountered, this method performs a lookup within that scope for the specified selector string. The first matching element is returned. + * @param selector The selector string. + * @param element The element to begin walking to the root of the document from. + * @returns The target element, if found. + **/ + function scopedSelect(selector: string, element: HTMLElement): HTMLElement; + + /** + * Given a DOM element and a control, attaches the control to the element. + * @param element Element to associate with the control. + * @param control The control to attach to the element. + **/ + function setControl(element: HTMLElement, control: any): void; + + /** + * Adds the set of declaratively specified options (properties and events) to the specified control. If name of the options property begins with "on", the property value is a function and the control supports addEventListener. setControl calls addEventListener on the control. + * @param control The control on which the properties and events are to be applied. + * @param options The set of options that are specified declaratively. + **/ + function setOptions(control: any, options?: any): void; + + //#endregion Functions } /** * Provides functions to load HTML content programmatically. **/ declare module WinJS.UI.Fragments { - //#region Functions + //#region Functions - /** - * Starts loading the fragment at the specified location. The returned promise completes when the fragment is ready to be copied. - * @param href The URI that contains the fragment to be copied. - * @returns A promise that is fulfilled when the fragment has been prepared for copying. - **/ - function cache(href: string): Promise; + /** + * Starts loading the fragment at the specified location. The returned promise completes when the fragment is ready to be copied. + * @param href The URI that contains the fragment to be copied. + * @returns A promise that is fulfilled when the fragment has been prepared for copying. + **/ + function cache(href: string): Promise; - /** - * Removes any cached information about the specified fragment. This method does not unload any scripts or styles that are referenced by the fragment. - * @param href The URI that contains the fragment to be cleared. If no URI is provided, the entire contents of the cache are cleared. - **/ - function clearCache(href: string): void; + /** + * Removes any cached information about the specified fragment. This method does not unload any scripts or styles that are referenced by the fragment. + * @param href The URI that contains the fragment to be cleared. If no URI is provided, the entire contents of the cache are cleared. + **/ + function clearCache(href: string): void; - /** - * Loads the contents of the specified URI into the specified element without copying it. - * @param href The URI that contains the fragment to copy. - * @param element Optional. The element to which the fragment is appended. - * @returns A promise that is fulfilled when the fragment has been loaded. If a target element is not specified, the copied fragment is the completed value. The element is not added to the cache. See also rendercopy, where the element is added to the cache. - **/ - function render(href: string, element?: HTMLElement): Promise; + /** + * Loads the contents of the specified URI into the specified element without copying it. + * @param href The URI that contains the fragment to copy. + * @param element Optional. The element to which the fragment is appended. + * @returns A promise that is fulfilled when the fragment has been loaded. If a target element is not specified, the copied fragment is the completed value. The element is not added to the cache. See also rendercopy, where the element is added to the cache. + **/ + function render(href: string, element?: HTMLElement): Promise; - /** - * Loads and copies the contents of the specified URI into the specified element. - * @param href The URI that contains the fragment to copy. - * @param target The element to which the fragment is appended. - * @returns A promise that is fulfilled when the fragment has been loaded. If a target element is not specified, the copied fragment is the completed value. The fragment is added to the cache. See also render, where the element is not added to the cache. - **/ - function renderCopy(href: string, target?: HTMLElement): Promise; + /** + * Loads and copies the contents of the specified URI into the specified element. + * @param href The URI that contains the fragment to copy. + * @param target The element to which the fragment is appended. + * @returns A promise that is fulfilled when the fragment has been loaded. If a target element is not specified, the copied fragment is the completed value. The fragment is added to the cache. See also render, where the element is not added to the cache. + **/ + function renderCopy(href: string, target?: HTMLElement): Promise; - //#endregion Functions + //#endregion Functions } /** * Provides methods for defining and displaying PageControl objects. **/ declare module WinJS.UI.Pages { - //#region Interfaces + //#region Interfaces - /** - * Provides members for a PageControl. You implement this interface when defining a new PageControl. - **/ - interface IPageControlMembers { - //#region Methods + /** + * Provides members for a PageControl. You implement this interface when defining a new PageControl. + **/ + interface IPageControlMembers { + //#region Methods - /** - * Called if any error occurs during the processing of the page. - * @param err The error that occurred. - * @returns Nothing if the error was handled, or an error promise if the error was not handled. - **/ - error?(err: any): Promise; + /** + * Called if any error occurs during the processing of the page. + * @param err The error that occurred. + * @returns Nothing if the error was handled, or an error promise if the error was not handled. + **/ + error? (err: any): Promise; - /** - * Initializes the control before the content of the control is set. Use the processed method for any initialization that should be done after the content of the control has been set. - * @param element The DOM element that will contain all the content for the page. - * @param options The options passed to the constructor of the page. - * @returns A promise that is fulfilled when initialization is complete, if asynchronous processing is necessary. If not, returns nothing. - **/ - init?(element: HTMLElement, options: any): Promise; + /** + * Initializes the control before the content of the control is set. Use the processed method for any initialization that should be done after the content of the control has been set. + * @param element The DOM element that will contain all the content for the page. + * @param options The options passed to the constructor of the page. + * @returns A promise that is fulfilled when initialization is complete, if asynchronous processing is necessary. If not, returns nothing. + **/ + init? (element: HTMLElement, options: any): Promise; - /** - * Creates DOM objects from the content in the specified URI. This method is called after the PageControl is defined and before the init method is called. - * @param uri The URI from which to create DOM objects. - * @returns A promise whose fulfilled value is the set of unparented DOM objects. - **/ - load?(uri: string): Promise; + /** + * Creates DOM objects from the content in the specified URI. This method is called after the PageControl is defined and before the init method is called. + * @param uri The URI from which to create DOM objects. + * @returns A promise whose fulfilled value is the set of unparented DOM objects. + **/ + load? (uri: string): Promise; - /** - * Initializes the control after the content of the control is set. - * @param element The DOM element that will contain all the content for the page. - * @param options The options that are to be passed to the constructor of the page. - * @returns A promise that is fulfilled when initialization is complete, if asynchronous processing is necessary. If not, returns nothing. - **/ - processed?(element: HTMLElement, options: any): Promise; + /** + * Initializes the control after the content of the control is set. + * @param element The DOM element that will contain all the content for the page. + * @param options The options that are to be passed to the constructor of the page. + * @returns A promise that is fulfilled when initialization is complete, if asynchronous processing is necessary. If not, returns nothing. + **/ + processed? (element: HTMLElement, options: any): Promise; - /** - * Called after all initialization and rendering is complete. At this time, the element is ready for use. - * @param element The DOM element that contains all the content for the page. - * @param options An object that contains one or more property/value pairs to apply to the PageControl. How these property/value pairs are used (or not used) depends on the implementation of that particular PageControl. - * @returns A promise that is fulfilled when the element is ready for use, if asynchronous processing is necessary. If not, returns nothing. - **/ - ready?(element: HTMLElement, options: any): Promise; + /** + * Called after all initialization and rendering is complete. At this time, the element is ready for use. + * @param element The DOM element that contains all the content for the page. + * @param options An object that contains one or more property/value pairs to apply to the PageControl. How these property/value pairs are used (or not used) depends on the implementation of that particular PageControl. + * @returns A promise that is fulfilled when the element is ready for use, if asynchronous processing is necessary. If not, returns nothing. + **/ + ready? (element: HTMLElement, options: any): Promise; - /** - * Takes the elements returned by the load method and attaches them to the specified element. - * @param element The DOM element to which the loadResult elements are appended. - * @param options An object that contains one or more property/value pairs to apply to the PageControl. How these property/value pairs are used (or not used) depends on the implementation of that particular PageControl. - * @param loadResult A Promise that contains the elements returned from the load method. - **/ - render?(element: HTMLElement, options: any, loadResult: Promise): void; + /** + * Takes the elements returned by the load method and attaches them to the specified element. + * @param element The DOM element to which the loadResult elements are appended. + * @param options An object that contains one or more property/value pairs to apply to the PageControl. How these property/value pairs are used (or not used) depends on the implementation of that particular PageControl. + * @param loadResult A Promise that contains the elements returned from the load method. + **/ + render? (element: HTMLElement, options: any, loadResult: Promise): void; - //#endregion Methods + //#endregion Methods - } + } - //#endregion Interfaces + //#endregion Interfaces - //#region Objects + //#region Objects - /** - * A modular unit of HTML, CSS, and JavaScript that can be navigated to or used as a custom WinJS control. - **/ - class PageControl { - } + /** + * A modular unit of HTML, CSS, and JavaScript that can be navigated to or used as a custom WinJS control. + **/ + class PageControl { + } - //#endregion Objects + //#endregion Objects - //#region Functions + //#region Functions - /** - * Creates a new PageControl from the specified URI that contains the specified members. Multiple calls to this method for the same URI are allowed, and all members will be merged. - * @param uri The URI for the content that defines the page. - * @param members An object that defines the members that the control will have. - * @returns A constructor function that creates the PageControl. - **/ - function define(uri: string, members: IPageControlMembers): PageControl; + /** + * Creates a new PageControl from the specified URI that contains the specified members. Multiple calls to this method for the same URI are allowed, and all members will be merged. + * @param uri The URI for the content that defines the page. + * @param members An object that defines the members that the control will have. + * @returns A constructor function that creates the PageControl. + **/ + function define(uri: string, members: IPageControlMembers): PageControl; - /** - * Gets an already-defined page control for the specified URI, or creates a new one. - * @param uri The URI for the content that defines the page. - * @returns A constructor function that creates the page. - **/ - function get(uri: string): Function; + /** + * Gets an already-defined page control for the specified URI, or creates a new one. + * @param uri The URI for the content that defines the page. + * @returns A constructor function that creates the page. + **/ + function get(uri: string): Function; - /** - * Creates a PageControl from the specified URI and inserts it inside the specified element. - * @param uri The URI for the content that defines the page. - * @param element The DOM element to which the PageControl is appended. - * @param options An object that contains one or more property/value pairs to apply to the new PageControl. How these property/value pairs are used (or not used) depends on the implementation of that particular PageControl. - * @param parentedPromise A Promise that is fulfilled when the new PageControl is done rendering and its contents becomes the child of element. - * @returns A promise that is fulfilled when rendering is complete, if asynchronous processing is necessary. If not, returns nothing. - **/ - function render(uri: string, element: HTMLElement, options?: any, parentedPromise?: Promise): Promise; + /** + * Creates a PageControl from the specified URI and inserts it inside the specified element. + * @param uri The URI for the content that defines the page. + * @param element The DOM element to which the PageControl is appended. + * @param options An object that contains one or more property/value pairs to apply to the new PageControl. How these property/value pairs are used (or not used) depends on the implementation of that particular PageControl. + * @param parentedPromise A Promise that is fulfilled when the new PageControl is done rendering and its contents becomes the child of element. + * @returns A promise that is fulfilled when rendering is complete, if asynchronous processing is necessary. If not, returns nothing. + **/ + function render(uri: string, element: HTMLElement, options?: any, parentedPromise?: Promise): Promise; - //#endregion Functions + //#endregion Functions } /** * Provides methods for detecting when the user tabs to or from DOM elements. **/ declare module WinJS.UI.TrackTabBehavior { - //#region Functions + //#region Functions - /** - * Sets the tab order for the specified element within its container. - * @param element The element to update. - * @param tabIndex The index value of the element within its container. - **/ - function attach(element: HTMLElement, tabIndex: number): void; + /** + * Sets the tab order for the specified element within its container. + * @param element The element to update. + * @param tabIndex The index value of the element within its container. + **/ + function attach(element: HTMLElement, tabIndex: number): void; - /** - * Removes the tab order information from the specified element. - * @param element The element to remove tab information from. - **/ - function detatch(element: HTMLElement): void; + /** + * Removes the tab order information from the specified element. + * @param element The element to remove tab information from. + **/ + function detatch(element: HTMLElement): void; - //#endregion Functions + //#endregion Functions } /** * Provides helper functions, for example, functions to add and remove CSS classes. **/ declare module WinJS.Utilities { - //#region Enumerations - - /** - * Defines a set of keyboard values. - **/ - enum Key { - /** - * The BACKSPACE key. - **/ - backspace, - /** - * The TAB key. - **/ - tab, - /** - * The ENTER key. - **/ - enter, - /** - * The SHIFT key. - **/ - shift, - /** - * The CTRL key. - **/ - ctrl, - /** - * The ALT key. - **/ - alt, - /** - * The PAUSE key. - **/ - pause, - /** - * The CAPS LOCK key. - **/ - capsLock, - /** - * The ESCAPE key. - **/ - escape, - /** - * The SPACE key. - **/ - space, - /** - * The PAGE UP key. - **/ - pageUp, - /** - * The PAGE DOWN key. - **/ - pageDown, - /** - * The END key. - **/ - end, - /** - * The HOME key. - **/ - home, - /** - * The LEFT ARROW key. - **/ - leftArrow, - /** - * The UP ARROW key. - **/ - upArrow, - /** - * The RIGHT ARROW key. - **/ - rightArrow, - /** - * The DOWN ARROW key. - **/ - downArrow, - /** - * The INSERT key. - **/ - insert, - /** - * The DELETE key. - **/ - deleteKey, - /** - * The 0 key. - **/ - num0, - /** - * The 1 key. - **/ - num1, - /** - * The 2 key. - **/ - num2, - /** - * The 3 key. - **/ - num3, - /** - * The 4 key. - **/ - num4, - /** - * The 5 key. - **/ - num5, - /** - * The 6 key. - **/ - num6, - /** - * The 7 key. - **/ - num7, - /** - * The 8 key. - **/ - num8, - /** - * The 9 key. - **/ - num9, - /** - * The a key. - **/ - a, - /** - * The b key. - **/ - b, - /** - * The c key. - **/ - c, - /** - * The d key. - **/ - d, - /** - * The e key. - **/ - e, - /** - * The f key. - **/ - f, - /** - * The g key. - **/ - g, - /** - * The h key. - **/ - h, - /** - * The i key. - **/ - i, - /** - * The j key. - **/ - j, - /** - * The k key. - **/ - k, - /** - * The l key. - **/ - l, - /** - * The m key. - **/ - m, - /** - * The n key. - **/ - n, - /** - * The o key. - **/ - o, - /** - * The p key. - **/ - p, - /** - * The q key. - **/ - q, - /** - * The r key. - **/ - r, - /** - * The s key. - **/ - s, - /** - * The t key. - **/ - t, - /** - * The u key. - **/ - u, - /** - * The v key. - **/ - v, - /** - * The w key. - **/ - w, - /** - * The x key. - **/ - x, - /** - * The y key. - **/ - y, - /** - * The z key. - **/ - z, - /** - * The left Windows key. - **/ - leftWindows, - /** - * The right Windows key. - **/ - rightWindows, - /** - * The menu key. - **/ - menu, - /** - * The 0 key on the numerical keypad. - **/ - numPad0, - /** - * The 1 key on the numerical keypad. - **/ - numPad1, - /** - * The 2 key on the numerical keypad. - **/ - numPad2, - /** - * The 3 key on the numerical keypad. - **/ - numPad3, - /** - * The 4 key on the numerical keypad. - **/ - numPad4, - /** - * The 5 key on the numerical keypad. - **/ - numPad5, - /** - * The 6 key on the numerical keypad. - **/ - numPad6, - /** - * The 7 key on the numerical keypad. - **/ - numPad7, - /** - * The 8 key on the numerical keypad. - **/ - numPad8, - /** - * The 9 key on the numerical keypad. - **/ - numPad9, - /** - * The multiplication key (*). - **/ - multiply, - /** - * The addition key (+). - **/ - add, - /** - * The subtraction key (-). - **/ - subtract, - /** - * The decimal point key (.) - **/ - decimalPoint, - /** - * The division key (/). - **/ - divide, - /** - * The F1 key. - **/ - F1, - /** - * The F2 key. - **/ - F2, - /** - * The F3 key. - **/ - F3, - /** - * The F4 key. - **/ - F4, - /** - * The F5 key. - **/ - F5, - /** - * The F6 key. - **/ - F6, - /** - * The F7 key. - **/ - F7, - /** - * The F8 key. - **/ - F8, - /** - * The F9 key. - **/ - F9, - /** - * The F10 key. - **/ - F10, - /** - * The F11 key. - **/ - F11, - /** - * The F12 key. - **/ - F12, - /** - * The NUMBER LOCK key. - **/ - numLock, - /** - * The SCROLL LOCK key. - **/ - scrollLock, - /** - * The browser BACK key. - **/ - browserBack, - /** - * The browser FORWARD key. - **/ - browserForward, - /** - * The semicolon key (;). - **/ - semicolon, - /** - * The equals key (=). - **/ - equal, - /** - * The comma key (,). - **/ - comma, - /** - * The dash key (-). - **/ - dash, - /** - * The period key (.). - **/ - period, - /** - * The forward slash key (/). - **/ - forwardSlash, - /** - * The grave accent key (`). - **/ - graveAccent, - /** - * The open bracket key ([). - **/ - openBracket, - /** - * The backslash key (\). - **/ - backSlash, - /** - * The close bracket key (]). - **/ - closeBracket, - /** - * The single quote key ('). - **/ - singleQuote - } - - //#endregion Enumerations - - //#region Objects - - /** - * A mixin that contains event-related functions. - **/ - var eventMixin: { - //#region Methods - - /** - * Adds an event listener to the control. - * @param type The type (name) of the event. - * @param listener The listener to invoke when the event gets raised. - * @param useCapture If true, initiates capture, otherwise false. - **/ - addEventListener(type: string, listener: Function, useCapture?: boolean): void; - - /** - * Raises an event of the specified type and with the specified additional properties. - * @param type The type (name) of the event. - * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. - * @returns true if preventDefault was called on the event. - **/ - dispatchEvent(type: string, eventProperties: any): boolean; - - /** - * Removes an event listener from the control. - * @param type The type (name) of the event. - * @param listener The listener to remove. - * @param useCapture true if capture is to be initiated, otherwise false. - **/ - removeEventListener(type: string, listener: Function, useCapture?: boolean): void; - - //#endregion Methods - - }; - - /** - * Represents the result of a query selector, and provides various operations that perform actions over the elements of the collection. - **/ - interface QueryCollection extends Array { - //#region Methods - - /** - * Adds the specified class to all the elements in the collection. - * @param name The name of the class to add. - * @returns This QueryCollection object. - **/ - addClass(name: string): QueryCollection; - - /** - * Creates a QueryCollection that contains the children of the specified parent element. - * @param element The parent element. - * @returns The QueryCollection that contains the children of the element. - **/ - children(element: HTMLElement): QueryCollection; - - /** - * Clears the specified style property for all the elements in the collection. - * @param name The name of the style property to be cleared. - * @returns This QueryCollection object. - **/ - clearStyle(name: string): QueryCollection; - - /** - * Creates controls that are attached to the elements in this QueryCollection, if the ctor parameter is a function, or configures the controls that are attached to the elements in this QueryCollection, if the ctor parameter is an object. - * @param ctor If this parameter is a function, it is a constructor function that is used to create controls to attach to the elements. If it is an object, it is the set of options passed to the controls. - * @param options The options passed to the newly-created controls. - * @returns This QueryCollection object. - **/ - control(ctor: any, options?: any): QueryCollection; - - /** - * Performs an action on each item in the QueryCollection. - * @param callbackFn The action to perform on each item. - * @param thisArg The argument to bind to callbackFn. - * @returns The QueryCollection. - **/ - forEach(callbackFn: (value: T, index: number, array: T[]) => void, thisArg?: any): QueryCollection; - - /** - * Gets an item from the QueryCollection. - * @param index The index of the item to return. - * @returns A single item from the collection. - **/ - get(index: number): T; - - /** - * Gets an attribute value from the first element in the collection. - * @param name The name of the attribute. - * @returns The value of the attribute. - **/ - getAttribute(name: string): any; - - /** - * Determines whether the specified class exists on the first element of the collection. - * @param name The name of the class. - * @returns true if the element has the specified class; otherwise, false. - **/ - hasClass(name: string): boolean; - - /** - * Looks up an element by ID and wraps the result in a QueryCollection. - * @param id The ID of the element. - * @returns A QueryCollection that contains the element, if it is found. - **/ - id(id: string): QueryCollection; - - /** - * Adds a set of items to this QueryCollection. - * @param items The items to add to the QueryCollection. This may be an array-like object, a document fragment, or a single item. - **/ - include(items: T): void; - - /** - * Adds a set of items to this QueryCollection. - * @param items The items to add to the QueryCollection. This may be an array-like object, a document fragment, or a single item. - **/ - include(items: T[]): void; - - /** - * Registers the listener for the specified event on all the elements in the collection. - * @param eventType The name of the event. - * @param listener The event handler function to be called when the event occurs. - * @param capture true if capture == true is to be passed to addEventListener; otherwise, false. - **/ - listen(eventType: string, listener: Function, capture?: boolean): void; - - /** - * Executes a query selector on all the elements in the collection and aggregates the result into a QueryCollection. - * @param query The query selector string. - * @returns A QueryCollection object containing the aggregate results of executing the query on all the elements in the collection. - **/ - query(query: any): QueryCollection; - - /** - * Removes the specified class from all the elements in the collection. - * @param name The name of the class to be removed. - * @returns his QueryCollection object. - **/ - removeClass(name: string): QueryCollection; - - /** - * Unregisters the listener for the specified event on all the elements in the collection. - * @param eventType The name of the event. - * @param listener The event handler function. - * @param capture true if capture == true; otherwise, false. - * @returns This QueryCollection object. - **/ - removeEventListener(eventType: string, listener: Function, capture?: boolean): QueryCollection; - - /** - * Sets an attribute value on all the items in the collection. - * @param name The name of the attribute to be set. - * @param value The value of the attribute to be set. - * @returns This QueryCollection object. - **/ - setAttribute(name: string, value: any): QueryCollection; - - /** - * Sets the specified style property for all the elements in the collection. - * @param name The name of the style property. - * @param value The value for the property. - * @returns This QueryCollection object. - **/ - setStyle(name: string, value: any): QueryCollection; - - /** - * Renders a template that is bound to the given data and parented to the elements included in the QueryCollection. If the QueryCollection contains multiple elements, the template is rendered multiple times, once at each element in the QueryCollection per item of data passed. - * @param templateElement The DOM element to which the template control is attached. - * @param data The data to render. If the data is an array (or any other object that has a forEach method) then the template is rendered multiple times, once for each item in the collection. - * @param renderDonePromiseCallback If supplied, this function is called each time the template gets rendered, and is passed a promise that is fulfilled when the template rendering is complete. - * @returns The QueryCollection. - **/ - template(templateElement: HTMLElement, data: any, renderDonePromiseCallback: Function): QueryCollection; - - /** - * Toggles (adds or removes) the specified class on all the elements in the collection. If the class is present, it is removed; if it is absent, it is added. - * @param name The name of the class to be toggled. - * @returns This QueryCollection object. - **/ - toggleClass(name: string): QueryCollection; - - //#endregion Methods - - } - - /** - * Constructor support for QueryCollection interface - **/ - export var QueryCollection: { - new (items: T[]): QueryCollection; - prototype: QueryCollection; - } - - //#endregion Objects - - //#region Functions - - /** - * Adds the specified class to the specified element. - * @param e The element to which to add the class. - * @param name The name of the class to add. - * @returns The element. - **/ - function addClass(e: T, name: string): T; - - /** - * Gets a collection of elements that are the direct children of the specified element. - * @param element The parent element. - * @returns The collection of children of the element. - **/ - function children(element: HTMLElement): QueryCollection; - - /** - * Converts a CSS positioning string for the specified element to pixels. - * @param element The element. - * @param value The CSS positioning string. - * @returns The number of pixels. - **/ - function convertToPixels(element: HTMLElement, value: string): number; - - /** - * Creates an object that has one event for each name passed to the function. - * @param events A variable list of property names. - * @returns The object with the specified properties. The names of the properties are prefixed with 'on'. - **/ - function createEventProperties(...events: string[]): any; - - /** - * Gets the data value associated with the specified element. - * @param element The element. - * @returns The value associated with the element. - **/ - function data(element: HTMLElement): any; - - /** - * Disposes all first-generation disposable elements that are descendents of the specified element. The specified element itself is not disposed. - * @param element The root element whose sub-tree is to be disposed. - **/ - function disposeSubTree(element: HTMLElement): void; - - /** - * Removes all the child nodes from the specified element. - * @param element The element. - * @returns The element. - **/ - function empty(element: T): T; - - /** - * Determines whether the specified event occurred within the specified element. - * @param element The element. - * @param event The event. - * @returns true if the event occurred within the element; otherwise, false. - **/ - function eventWithinElement(element: HTMLElement, event: Event): boolean; - - /** - * Adds tags and type to a logging message. - * @param message The message to be formatted. - * @param tag The tag(s) to be applied to the message. Multiple tags should be separated by spaces. - * @param type The type of the message. - * @returns The formatted message. - **/ - function formatLog(message: string, tag: string, type: string): string; - - /** - * Gets the height of the content of the specified element. The content height does not include borders or padding. - * @param element The element. - * @returns The content height of the element. - **/ - function getContentHeight(element: HTMLElement): number; - - /** - * Gets the width of the content of the specified element. The content width does not include borders or padding. - * @param element The element. - * @returns The content width of the element. - **/ - function getContentWidth(element: HTMLElement): number; - - /** - * Gets the leaf-level type or namespace specified by the name parameter. - * @param name The name of the member. - * @param root The root to start in. Defaults to the global object. - * @returns The leaf-level type or namespace in the specified parent namespace. - **/ - function getMember(name: string, root?: any): any; - - /** - * Gets the position of the specified element. - * @param element The element. - * @returns An object that contains the left, top, width and height properties of the element. - **/ - function getPosition(element: HTMLElement): IPosition; - - /** - * Gets the left coordinate of the specified element relative to the specified parent. - * @param element The element. - * @param parent The parent element. - * @returns The relative left coordinate. - **/ - function getRelativeLeft(element: HTMLElement, parent: HTMLElement): number; - - /** - * Gets the top coordinate of the element relative to the specified parent. - * @param element The element. - * @param parent The parent element. - * @returns The relative top coordinate. - **/ - function getRelativeTop(element: HTMLElement, parent: HTMLElement): number; - - /** - * Gets the height of the element, including its margins. - * @param element The element. - * @returns The height of the element including margins. - **/ - function getTotalHeight(element: HTMLElement): number; - - /** - * Gets the width of the element, including margins. - * @param element The element. - * @returns The width of the element including margins. - **/ - function getTotalWidth(element: HTMLElement): number; - - /** - * Determines whether the specified element has the specified class. - * @param e The element. - * @param name The name of the class. - * @returns true if the element has the class, otherwise false. - **/ - function hasClass(e: HTMLElement, name: string): boolean; - - /** - * Returns a collection with zero or one elements matching the specified id. - * @param id The ID of the element (or elements). - * @returns A collection of elements whose id matches the id parameter. - **/ - function id(id: string): QueryCollection; - - /** - * Calls insertAdjacentHTML on the specified element. - * @param element The element on which insertAdjacentHTML is to be called. - * @param position The position relative to the element at which to insert the HTML. Possible values are: beforebegin, afterbegin, beforeend, afterend. - * @param text The text to insert. - **/ - function insertAdjacentHTML(element: HTMLElement, position: string, text: string): void; - - /** - * Calls insertAdjacentHTML on the specified element in the context of MSApp.execUnsafeLocalFunction. - * @param element The element on which insertAdjacentHTML is to be called. - * @param position The position relative to the element at which to insert the HTML. Possible values are: beforebegin, afterbegin, beforeend, afterend. - * @param text Value to be provided to insertAdjacentHTML. - **/ - function insertAdjacentHTMLUnsafe(element: HTMLElement, position: string, text: string): void; - - /** - * Attaches the default dispose API wrapping the dispose implementation to the specified element. - * @param element The element to mark as disposable. - * @param disposeImpl The function containing the element-specific dispose logic, called by the dispose function that markDisposable attaches. - **/ - function markDisposable(element: HTMLElement, disposeImpl: Function): void; - - /** - * Marks a function as being compatible with declarative processing. Declarative processing is performed by WinJS.UI.processAll or WinJS.Binding.processAll. - * @param func The function to be marked as compatible with declarative processing. - * @returns The input function, marked as compatible with declarative processing. - **/ - function markSupportedForProcessing(func: U): U; - - /** - * Returns a QueryCollection with zero or one elements matching the specified selector query. - * @param query The CSS selector to use. See Selectors for more information. - * @param element Optional. The root element at which to start the query. If this parameter is omitted, the scope of the query is the entire document. - * @returns A QueryCollection with zero or one elements matching the specified selector query. - **/ - function query(query: any, element?: HTMLElement): QueryCollection; - - /** - * Ensures that the specified function executes only after the DOMContentLoaded event has fired for the current page. The DOMContentLoaded event occurs after the page has been parsed but before all the resources are loaded. - * @param callback A function that executes after the DOMContentLoaded event has occurred. - * @param async If true, the callback should be executed asynchronously. - * @returns A promise that completes after the DOMContentLoaded event has occurred. - **/ - function ready(callback?: Function, async?: boolean): Promise; - - /** - * Removes the specified class from the specified element. - * @param e The element from which to remove the class. - * @param name The name of the class to remove. - * @returns The element. - **/ - function removeClass(e: T, name: string): T; - - /** - * Asserts that the value is compatible with declarative processing. Declarative processing is performed by WinJS.UI.processAll or WinJS.Binding.processAll. If the value is not compatible, and strictProcessing is on, an exception is thrown. All functions that have been declared using WinJS.Class.define, WinJS.Class.derive, WinJS.UI.Pages.define, or WinJS.Binding.converter are automatically marked as supported for declarative processing. Any other function that you use from a declarative context (that is, a context in which an HTML element has a data-win-control or data-win-options attribute) must be marked manually by calling this function. When you mark a function as supported for declarative processing, you are guaranteeing that the code in the function is secure from injection of third-party content. - * @param value The value to be tested for compatibility with declarative processing. If the value is a function it must be marked with a property supportedForProcessing with a value of true when strictProcessing is on. For more information, see WinJS.Utilities.markSupportedForProcessing. - * @returns The input value. - **/ - function requireSupportedForProcessing(value: T): T; - - /** - * Sets the innerHTML property of the specified element to the specified text. - * @param element The element on which the innerHTML property is to be set. - * @param text The value to be set to the innerHTML property. - **/ - function setInnerHTML(element: HTMLElement, text: string): void; - - /** - * Sets the innerHTML property of the specified element to the specified text. - * @param element The element on which the innerHTML property is to be set. - * @param text The value to be set to the innerHTML property. - **/ - function setInnerHTMLUnsafe(element: HTMLElement, text: string): void; - - /** - * Sets the outerHTML property of the specified element to the specified text. - * @param element The element on which the outerHTML property is to be set. - * @param text The value to be set to the outerHTML property. - **/ - function setOuterHTML(element: HTMLElement, text: string): void; - - /** - * Sets the outerHTML property of the specified element to the specified text in the context of MSApp.execUnsafeLocalFunction. - * @param element The element on which the outerHTML property is to be set. - * @param text The value to be set to the outerHTML property. - **/ - function setOuterHTMLUnsafe(element: HTMLElement, text: string): void; - - /** - * Configures a logger that writes messages containing the specified tags to the JavaScript console. - * @param options The tags for messages to log. Multiple tags should be separated by spaces. May contain type, tags, excludeTags and action properties. - **/ + //#region Enumerations + + /** + * Defines a set of keyboard values. + **/ + enum Key { + /** + * The BACKSPACE key. + **/ + backspace, + /** + * The TAB key. + **/ + tab, + /** + * The ENTER key. + **/ + enter, + /** + * The SHIFT key. + **/ + shift, + /** + * The CTRL key. + **/ + ctrl, + /** + * The ALT key. + **/ + alt, + /** + * The PAUSE key. + **/ + pause, + /** + * The CAPS LOCK key. + **/ + capsLock, + /** + * The ESCAPE key. + **/ + escape, + /** + * The SPACE key. + **/ + space, + /** + * The PAGE UP key. + **/ + pageUp, + /** + * The PAGE DOWN key. + **/ + pageDown, + /** + * The END key. + **/ + end, + /** + * The HOME key. + **/ + home, + /** + * The LEFT ARROW key. + **/ + leftArrow, + /** + * The UP ARROW key. + **/ + upArrow, + /** + * The RIGHT ARROW key. + **/ + rightArrow, + /** + * The DOWN ARROW key. + **/ + downArrow, + /** + * The INSERT key. + **/ + insert, + /** + * The DELETE key. + **/ + deleteKey, + /** + * The 0 key. + **/ + num0, + /** + * The 1 key. + **/ + num1, + /** + * The 2 key. + **/ + num2, + /** + * The 3 key. + **/ + num3, + /** + * The 4 key. + **/ + num4, + /** + * The 5 key. + **/ + num5, + /** + * The 6 key. + **/ + num6, + /** + * The 7 key. + **/ + num7, + /** + * The 8 key. + **/ + num8, + /** + * The 9 key. + **/ + num9, + /** + * The a key. + **/ + a, + /** + * The b key. + **/ + b, + /** + * The c key. + **/ + c, + /** + * The d key. + **/ + d, + /** + * The e key. + **/ + e, + /** + * The f key. + **/ + f, + /** + * The g key. + **/ + g, + /** + * The h key. + **/ + h, + /** + * The i key. + **/ + i, + /** + * The j key. + **/ + j, + /** + * The k key. + **/ + k, + /** + * The l key. + **/ + l, + /** + * The m key. + **/ + m, + /** + * The n key. + **/ + n, + /** + * The o key. + **/ + o, + /** + * The p key. + **/ + p, + /** + * The q key. + **/ + q, + /** + * The r key. + **/ + r, + /** + * The s key. + **/ + s, + /** + * The t key. + **/ + t, + /** + * The u key. + **/ + u, + /** + * The v key. + **/ + v, + /** + * The w key. + **/ + w, + /** + * The x key. + **/ + x, + /** + * The y key. + **/ + y, + /** + * The z key. + **/ + z, + /** + * The left Windows key. + **/ + leftWindows, + /** + * The right Windows key. + **/ + rightWindows, + /** + * The menu key. + **/ + menu, + /** + * The 0 key on the numerical keypad. + **/ + numPad0, + /** + * The 1 key on the numerical keypad. + **/ + numPad1, + /** + * The 2 key on the numerical keypad. + **/ + numPad2, + /** + * The 3 key on the numerical keypad. + **/ + numPad3, + /** + * The 4 key on the numerical keypad. + **/ + numPad4, + /** + * The 5 key on the numerical keypad. + **/ + numPad5, + /** + * The 6 key on the numerical keypad. + **/ + numPad6, + /** + * The 7 key on the numerical keypad. + **/ + numPad7, + /** + * The 8 key on the numerical keypad. + **/ + numPad8, + /** + * The 9 key on the numerical keypad. + **/ + numPad9, + /** + * The multiplication key (*). + **/ + multiply, + /** + * The addition key (+). + **/ + add, + /** + * The subtraction key (-). + **/ + subtract, + /** + * The decimal point key (.) + **/ + decimalPoint, + /** + * The division key (/). + **/ + divide, + /** + * The F1 key. + **/ + F1, + /** + * The F2 key. + **/ + F2, + /** + * The F3 key. + **/ + F3, + /** + * The F4 key. + **/ + F4, + /** + * The F5 key. + **/ + F5, + /** + * The F6 key. + **/ + F6, + /** + * The F7 key. + **/ + F7, + /** + * The F8 key. + **/ + F8, + /** + * The F9 key. + **/ + F9, + /** + * The F10 key. + **/ + F10, + /** + * The F11 key. + **/ + F11, + /** + * The F12 key. + **/ + F12, + /** + * The NUMBER LOCK key. + **/ + numLock, + /** + * The SCROLL LOCK key. + **/ + scrollLock, + /** + * The browser BACK key. + **/ + browserBack, + /** + * The browser FORWARD key. + **/ + browserForward, + /** + * The semicolon key (;). + **/ + semicolon, + /** + * The equals key (=). + **/ + equal, + /** + * The comma key (,). + **/ + comma, + /** + * The dash key (-). + **/ + dash, + /** + * The period key (.). + **/ + period, + /** + * The forward slash key (/). + **/ + forwardSlash, + /** + * The grave accent key (`). + **/ + graveAccent, + /** + * The open bracket key ([). + **/ + openBracket, + /** + * The backslash key (\). + **/ + backSlash, + /** + * The close bracket key (]). + **/ + closeBracket, + /** + * The single quote key ('). + **/ + singleQuote + } + + //#endregion Enumerations + + //#region Objects + + /** + * A mixin that contains event-related functions. + **/ + var eventMixin: { + //#region Methods + + /** + * Adds an event listener to the control. + * @param type The type (name) of the event. + * @param listener The listener to invoke when the event gets raised. + * @param useCapture If true, initiates capture, otherwise false. + **/ + addEventListener(type: string, listener: Function, useCapture?: boolean): void; + + /** + * Raises an event of the specified type and with the specified additional properties. + * @param type The type (name) of the event. + * @param eventProperties The set of additional properties to be attached to the event object when the event is raised. + * @returns true if preventDefault was called on the event. + **/ + dispatchEvent(type: string, eventProperties: any): boolean; + + /** + * Removes an event listener from the control. + * @param type The type (name) of the event. + * @param listener The listener to remove. + * @param useCapture true if capture is to be initiated, otherwise false. + **/ + removeEventListener(type: string, listener: Function, useCapture?: boolean): void; + + //#endregion Methods + + }; + + /** + * Represents the result of a query selector, and provides various operations that perform actions over the elements of the collection. + **/ + interface QueryCollection extends Array { + //#region Methods + + /** + * Adds the specified class to all the elements in the collection. + * @param name The name of the class to add. + * @returns This QueryCollection object. + **/ + addClass(name: string): QueryCollection; + + /** + * Creates a QueryCollection that contains the children of the specified parent element. + * @param element The parent element. + * @returns The QueryCollection that contains the children of the element. + **/ + children(element: HTMLElement): QueryCollection; + + /** + * Clears the specified style property for all the elements in the collection. + * @param name The name of the style property to be cleared. + * @returns This QueryCollection object. + **/ + clearStyle(name: string): QueryCollection; + + /** + * Creates controls that are attached to the elements in this QueryCollection, if the ctor parameter is a function, or configures the controls that are attached to the elements in this QueryCollection, if the ctor parameter is an object. + * @param ctor If this parameter is a function, it is a constructor function that is used to create controls to attach to the elements. If it is an object, it is the set of options passed to the controls. + * @param options The options passed to the newly-created controls. + * @returns This QueryCollection object. + **/ + control(ctor: any, options?: any): QueryCollection; + + /** + * Performs an action on each item in the QueryCollection. + * @param callbackFn The action to perform on each item. + * @param thisArg The argument to bind to callbackFn. + * @returns The QueryCollection. + **/ + forEach(callbackFn: (value: T, index: number, array: T[]) => void, thisArg?: any): QueryCollection; + + /** + * Gets an item from the QueryCollection. + * @param index The index of the item to return. + * @returns A single item from the collection. + **/ + get(index: number): T; + + /** + * Gets an attribute value from the first element in the collection. + * @param name The name of the attribute. + * @returns The value of the attribute. + **/ + getAttribute(name: string): any; + + /** + * Determines whether the specified class exists on the first element of the collection. + * @param name The name of the class. + * @returns true if the element has the specified class; otherwise, false. + **/ + hasClass(name: string): boolean; + + /** + * Looks up an element by ID and wraps the result in a QueryCollection. + * @param id The ID of the element. + * @returns A QueryCollection that contains the element, if it is found. + **/ + id(id: string): QueryCollection; + + /** + * Adds a set of items to this QueryCollection. + * @param items The items to add to the QueryCollection. This may be an array-like object, a document fragment, or a single item. + **/ + include(items: T): void; + + /** + * Adds a set of items to this QueryCollection. + * @param items The items to add to the QueryCollection. This may be an array-like object, a document fragment, or a single item. + **/ + include(items: T[]): void; + + /** + * Registers the listener for the specified event on all the elements in the collection. + * @param eventType The name of the event. + * @param listener The event handler function to be called when the event occurs. + * @param capture true if capture == true is to be passed to addEventListener; otherwise, false. + **/ + listen(eventType: string, listener: Function, capture?: boolean): void; + + /** + * Executes a query selector on all the elements in the collection and aggregates the result into a QueryCollection. + * @param query The query selector string. + * @returns A QueryCollection object containing the aggregate results of executing the query on all the elements in the collection. + **/ + query(query: any): QueryCollection; + + /** + * Removes the specified class from all the elements in the collection. + * @param name The name of the class to be removed. + * @returns his QueryCollection object. + **/ + removeClass(name: string): QueryCollection; + + /** + * Unregisters the listener for the specified event on all the elements in the collection. + * @param eventType The name of the event. + * @param listener The event handler function. + * @param capture true if capture == true; otherwise, false. + * @returns This QueryCollection object. + **/ + removeEventListener(eventType: string, listener: Function, capture?: boolean): QueryCollection; + + /** + * Sets an attribute value on all the items in the collection. + * @param name The name of the attribute to be set. + * @param value The value of the attribute to be set. + * @returns This QueryCollection object. + **/ + setAttribute(name: string, value: any): QueryCollection; + + /** + * Sets the specified style property for all the elements in the collection. + * @param name The name of the style property. + * @param value The value for the property. + * @returns This QueryCollection object. + **/ + setStyle(name: string, value: any): QueryCollection; + + /** + * Renders a template that is bound to the given data and parented to the elements included in the QueryCollection. If the QueryCollection contains multiple elements, the template is rendered multiple times, once at each element in the QueryCollection per item of data passed. + * @param templateElement The DOM element to which the template control is attached. + * @param data The data to render. If the data is an array (or any other object that has a forEach method) then the template is rendered multiple times, once for each item in the collection. + * @param renderDonePromiseCallback If supplied, this function is called each time the template gets rendered, and is passed a promise that is fulfilled when the template rendering is complete. + * @returns The QueryCollection. + **/ + template(templateElement: HTMLElement, data: any, renderDonePromiseCallback: Function): QueryCollection; + + /** + * Toggles (adds or removes) the specified class on all the elements in the collection. If the class is present, it is removed; if it is absent, it is added. + * @param name The name of the class to be toggled. + * @returns This QueryCollection object. + **/ + toggleClass(name: string): QueryCollection; + + //#endregion Methods + + } + + /** + * Constructor support for QueryCollection interface + **/ + export var QueryCollection: { + new (items: T[]): QueryCollection; + prototype: QueryCollection; + } + + //#endregion Objects + + //#region Functions + + /** + * Adds the specified class to the specified element. + * @param e The element to which to add the class. + * @param name The name of the class to add. + * @returns The element. + **/ + function addClass(e: T, name: string): T; + + /** + * Gets a collection of elements that are the direct children of the specified element. + * @param element The parent element. + * @returns The collection of children of the element. + **/ + function children(element: HTMLElement): QueryCollection; + + /** + * Converts a CSS positioning string for the specified element to pixels. + * @param element The element. + * @param value The CSS positioning string. + * @returns The number of pixels. + **/ + function convertToPixels(element: HTMLElement, value: string): number; + + /** + * Creates an object that has one event for each name passed to the function. + * @param events A variable list of property names. + * @returns The object with the specified properties. The names of the properties are prefixed with 'on'. + **/ + function createEventProperties(...events: string[]): any; + + /** + * Gets the data value associated with the specified element. + * @param element The element. + * @returns The value associated with the element. + **/ + function data(element: HTMLElement): any; + + /** + * Disposes all first-generation disposable elements that are descendents of the specified element. The specified element itself is not disposed. + * @param element The root element whose sub-tree is to be disposed. + **/ + function disposeSubTree(element: HTMLElement): void; + + /** + * Removes all the child nodes from the specified element. + * @param element The element. + * @returns The element. + **/ + function empty(element: T): T; + + /** + * Determines whether the specified event occurred within the specified element. + * @param element The element. + * @param event The event. + * @returns true if the event occurred within the element; otherwise, false. + **/ + function eventWithinElement(element: HTMLElement, event: Event): boolean; + + /** + * Adds tags and type to a logging message. + * @param message The message to be formatted. + * @param tag The tag(s) to be applied to the message. Multiple tags should be separated by spaces. + * @param type The type of the message. + * @returns The formatted message. + **/ + function formatLog(message: string, tag: string, type: string): string; + + /** + * Gets the height of the content of the specified element. The content height does not include borders or padding. + * @param element The element. + * @returns The content height of the element. + **/ + function getContentHeight(element: HTMLElement): number; + + /** + * Gets the width of the content of the specified element. The content width does not include borders or padding. + * @param element The element. + * @returns The content width of the element. + **/ + function getContentWidth(element: HTMLElement): number; + + /** + * Gets the leaf-level type or namespace specified by the name parameter. + * @param name The name of the member. + * @param root The root to start in. Defaults to the global object. + * @returns The leaf-level type or namespace in the specified parent namespace. + **/ + function getMember(name: string, root?: any): any; + + /** + * Gets the position of the specified element. + * @param element The element. + * @returns An object that contains the left, top, width and height properties of the element. + **/ + function getPosition(element: HTMLElement): IPosition; + + /** + * Gets the left coordinate of the specified element relative to the specified parent. + * @param element The element. + * @param parent The parent element. + * @returns The relative left coordinate. + **/ + function getRelativeLeft(element: HTMLElement, parent: HTMLElement): number; + + /** + * Gets the top coordinate of the element relative to the specified parent. + * @param element The element. + * @param parent The parent element. + * @returns The relative top coordinate. + **/ + function getRelativeTop(element: HTMLElement, parent: HTMLElement): number; + + /** + * Gets the height of the element, including its margins. + * @param element The element. + * @returns The height of the element including margins. + **/ + function getTotalHeight(element: HTMLElement): number; + + /** + * Gets the width of the element, including margins. + * @param element The element. + * @returns The width of the element including margins. + **/ + function getTotalWidth(element: HTMLElement): number; + + /** + * Determines whether the specified element has the specified class. + * @param e The element. + * @param name The name of the class. + * @returns true if the element has the class, otherwise false. + **/ + function hasClass(e: HTMLElement, name: string): boolean; + + /** + * Returns a collection with zero or one elements matching the specified id. + * @param id The ID of the element (or elements). + * @returns A collection of elements whose id matches the id parameter. + **/ + function id(id: string): QueryCollection; + + /** + * Calls insertAdjacentHTML on the specified element. + * @param element The element on which insertAdjacentHTML is to be called. + * @param position The position relative to the element at which to insert the HTML. Possible values are: beforebegin, afterbegin, beforeend, afterend. + * @param text The text to insert. + **/ + function insertAdjacentHTML(element: HTMLElement, position: string, text: string): void; + + /** + * Calls insertAdjacentHTML on the specified element in the context of MSApp.execUnsafeLocalFunction. + * @param element The element on which insertAdjacentHTML is to be called. + * @param position The position relative to the element at which to insert the HTML. Possible values are: beforebegin, afterbegin, beforeend, afterend. + * @param text Value to be provided to insertAdjacentHTML. + **/ + function insertAdjacentHTMLUnsafe(element: HTMLElement, position: string, text: string): void; + + /** + * Attaches the default dispose API wrapping the dispose implementation to the specified element. + * @param element The element to mark as disposable. + * @param disposeImpl The function containing the element-specific dispose logic, called by the dispose function that markDisposable attaches. + **/ + function markDisposable(element: HTMLElement, disposeImpl: Function): void; + + /** + * Marks a function as being compatible with declarative processing. Declarative processing is performed by WinJS.UI.processAll or WinJS.Binding.processAll. + * @param func The function to be marked as compatible with declarative processing. + * @returns The input function, marked as compatible with declarative processing. + **/ + function markSupportedForProcessing(func: U): U; + + /** + * Returns a QueryCollection with zero or one elements matching the specified selector query. + * @param query The CSS selector to use. See Selectors for more information. + * @param element Optional. The root element at which to start the query. If this parameter is omitted, the scope of the query is the entire document. + * @returns A QueryCollection with zero or one elements matching the specified selector query. + **/ + function query(query: any, element?: HTMLElement): QueryCollection; + + /** + * Ensures that the specified function executes only after the DOMContentLoaded event has fired for the current page. The DOMContentLoaded event occurs after the page has been parsed but before all the resources are loaded. + * @param callback A function that executes after the DOMContentLoaded event has occurred. + * @param async If true, the callback should be executed asynchronously. + * @returns A promise that completes after the DOMContentLoaded event has occurred. + **/ + function ready(callback?: Function, async?: boolean): Promise; + + /** + * Removes the specified class from the specified element. + * @param e The element from which to remove the class. + * @param name The name of the class to remove. + * @returns The element. + **/ + function removeClass(e: T, name: string): T; + + /** + * Asserts that the value is compatible with declarative processing. Declarative processing is performed by WinJS.UI.processAll or WinJS.Binding.processAll. If the value is not compatible, and strictProcessing is on, an exception is thrown. All functions that have been declared using WinJS.Class.define, WinJS.Class.derive, WinJS.UI.Pages.define, or WinJS.Binding.converter are automatically marked as supported for declarative processing. Any other function that you use from a declarative context (that is, a context in which an HTML element has a data-win-control or data-win-options attribute) must be marked manually by calling this function. When you mark a function as supported for declarative processing, you are guaranteeing that the code in the function is secure from injection of third-party content. + * @param value The value to be tested for compatibility with declarative processing. If the value is a function it must be marked with a property supportedForProcessing with a value of true when strictProcessing is on. For more information, see WinJS.Utilities.markSupportedForProcessing. + * @returns The input value. + **/ + function requireSupportedForProcessing(value: T): T; + + /** + * Sets the innerHTML property of the specified element to the specified text. + * @param element The element on which the innerHTML property is to be set. + * @param text The value to be set to the innerHTML property. + **/ + function setInnerHTML(element: HTMLElement, text: string): void; + + /** + * Sets the innerHTML property of the specified element to the specified text. + * @param element The element on which the innerHTML property is to be set. + * @param text The value to be set to the innerHTML property. + **/ + function setInnerHTMLUnsafe(element: HTMLElement, text: string): void; + + /** + * Sets the outerHTML property of the specified element to the specified text. + * @param element The element on which the outerHTML property is to be set. + * @param text The value to be set to the outerHTML property. + **/ + function setOuterHTML(element: HTMLElement, text: string): void; + + /** + * Sets the outerHTML property of the specified element to the specified text in the context of MSApp.execUnsafeLocalFunction. + * @param element The element on which the outerHTML property is to be set. + * @param text The value to be set to the outerHTML property. + **/ + function setOuterHTMLUnsafe(element: HTMLElement, text: string): void; + + /** + * Configures a logger that writes messages containing the specified tags to the JavaScript console. + * @param options The tags for messages to log. Multiple tags should be separated by spaces. May contain type, tags, excludeTags and action properties. + **/ function startLog(options?: ILogOptions): void; - /** - * Removes the WinJS logger that had previously been set up. - **/ - function stopLog(): void; + /** + * Removes the WinJS logger that had previously been set up. + **/ + function stopLog(): void; - /** - * Toggles (adds or removes) the specified class on the specified element. If the class is present, it is removed; if it is absent, it is added. - * @param e The element on which to toggle the class. - * @param name The name of the class to toggle. - * @returns The element. - **/ - function toggleClass(e: T, name: string): T; + /** + * Toggles (adds or removes) the specified class on the specified element. If the class is present, it is removed; if it is absent, it is added. + * @param e The element on which to toggle the class. + * @param name The name of the class to toggle. + * @returns The element. + **/ + function toggleClass(e: T, name: string): T; - //#endregion Functions + //#endregion Functions //#region Properties @@ -8321,9 +8314,14 @@ declare module WinJS.Utilities { **/ var hasWinRT: boolean; + /** + * Indicates whether the app is running on Windows Phone. + **/ + var isPhone: boolean; + //#endregion Properties - //#region Interfaces + //#region Interfaces interface ILogOptions { type: string; @@ -8332,246 +8330,246 @@ declare module WinJS.Utilities { tags: string; } - interface IPosition { - left: number; - top: number; - width: number; - height: number; - } + interface IPosition { + left: number; + top: number; + width: number; + height: number; + } - //#endregion Interfaces + //#endregion Interfaces } /** * Provides functions and objects for scheduling and managing asynchronous tasks. **/ declare module WinJS.Utilities.Scheduler { - //#region Enumerations + //#region Enumerations - /** - * Represents a priority for a job managed by the Scheduler. - **/ - enum Priority { - /** - * A priority higher than the normal priority level. - **/ - aboveNormal, - /** - * A priority less than the normal priority level. - **/ - belowNormal, - /** - * A high priority. - **/ - high, - /** - * The idle priority for work items. - **/ - idle, - /** - * The highest priority. - **/ - max, - /** - * The lowest priority. - **/ - min, - /** - * The normal priority for work items. - **/ - normal - } + /** + * Represents a priority for a job managed by the Scheduler. + **/ + enum Priority { + /** + * A priority higher than the normal priority level. + **/ + aboveNormal, + /** + * A priority less than the normal priority level. + **/ + belowNormal, + /** + * A high priority. + **/ + high, + /** + * The idle priority for work items. + **/ + idle, + /** + * The highest priority. + **/ + max, + /** + * The lowest priority. + **/ + min, + /** + * The normal priority for work items. + **/ + normal + } - //#endregion Enumerations + //#endregion Enumerations - //#region Interfaces + //#region Interfaces - /** - * Represents a work item that's executed by the Scheduler. - **/ - interface IJob { - //#region Methods + /** + * Represents a work item that's executed by the Scheduler. + **/ + interface IJob { + //#region Methods - /** - * Cancels the job. - **/ - cancel(): void; + /** + * Cancels the job. + **/ + cancel(): void; - /** - * Pauses the job. - **/ - pause(): void; + /** + * Pauses the job. + **/ + pause(): void; - /** - * Resumes the job. - **/ - resume(): void; + /** + * Resumes the job. + **/ + resume(): void; - //#endregion Methods + //#endregion Methods - //#region Properties + //#region Properties - /** - * Gets a value that indicates whether the job has successfully completed. - **/ - completed: boolean; + /** + * Gets a value that indicates whether the job has successfully completed. + **/ + completed: boolean; - /** - * Gets the unique numeric identifier assigned to the job. - **/ - id: number; + /** + * Gets the unique numeric identifier assigned to the job. + **/ + id: number; - /** - * Gets or sets the name of the job. - **/ - name: string; + /** + * Gets or sets the name of the job. + **/ + name: string; - /** - * Gets or sets the owner of the job. - **/ - owner: IOwnerToken; + /** + * Gets or sets the owner of the job. + **/ + owner: IOwnerToken; - /** - * Gets or sets the priority of the job. - **/ - priority: Priority; + /** + * Gets or sets the priority of the job. + **/ + priority: Priority; - //#endregion Properties + //#endregion Properties - } + } - /** - * Provides a control mechanism that allows a job to cooperatively yield. This object is passed to your work function when you schedule it. - **/ - interface IJobInfo { - //#region Methods + /** + * Provides a control mechanism that allows a job to cooperatively yield. This object is passed to your work function when you schedule it. + **/ + interface IJobInfo { + //#region Methods - /** - * Uses a Promise to determine how long the scheduler should wait before rescheduling the job after it yields. - * @param promise Once the work item yields, the scheduler will wait for this Promise to complete before rescheduling the job. - **/ - setPromise(promise: Promise): void; + /** + * Uses a Promise to determine how long the scheduler should wait before rescheduling the job after it yields. + * @param promise Once the work item yields, the scheduler will wait for this Promise to complete before rescheduling the job. + **/ + setPromise(promise: Promise): void; - /** - * Specifies the next unit of work to run once this job yields. - * @param work The next unit of work to run once this job yields. - **/ - setWork(work: Function): void; + /** + * Specifies the next unit of work to run once this job yields. + * @param work The next unit of work to run once this job yields. + **/ + setWork(work: Function): void; - //#endregion Methods + //#endregion Methods - //#region Properties + //#region Properties - /** - * Gets the work item associated with this IJobInfo. - **/ - job: IJob; + /** + * Gets the work item associated with this IJobInfo. + **/ + job: IJob; - /** - * Gets a value that specifies whether the job should yield. - **/ - shouldYield: boolean; + /** + * Gets a value that specifies whether the job should yield. + **/ + shouldYield: boolean; - //#endregion Properties + //#endregion Properties - } + } - /** - * Represents an object that owns jobs. You can use this object to cancel a set of jobs. - **/ - interface IOwnerToken { - //#region Methods + /** + * Represents an object that owns jobs. You can use this object to cancel a set of jobs. + **/ + interface IOwnerToken { + //#region Methods - /** - * Synchronously cancels the job that this token owns, including paused and blocked jobs. - **/ - cancelAll(): void; + /** + * Synchronously cancels the job that this token owns, including paused and blocked jobs. + **/ + cancelAll(): void; - //#endregion Methods + //#endregion Methods - } + } - //#endregion Interfaces + //#endregion Interfaces - //#region Functions + //#region Functions - /** - * Creates and returns a new IOwnerToken which can be set to the owner property of one or more jobs. - * @returns A new IOwnerToken which can be set to the owner property of one or more jobs. - **/ - function createOwnerToken(): IOwnerToken; + /** + * Creates and returns a new IOwnerToken which can be set to the owner property of one or more jobs. + * @returns A new IOwnerToken which can be set to the owner property of one or more jobs. + **/ + function createOwnerToken(): IOwnerToken; - /** - * Runs the specified callback in a high priority context. - * @param callback The callback to run in a high priority callback. - * @returns The return value of the callback. - **/ - function execHigh(callback: () => U): U; + /** + * Runs the specified callback in a high priority context. + * @param callback The callback to run in a high priority callback. + * @returns The return value of the callback. + **/ + function execHigh(callback: () => U): U; - /** - * Returns a string representation of the scheduler's state for diagnostic purposes. The jobs and drain requests are displayed in the order in which they are currently expected to be processed. The current job and drain request are marked by an asterisk. - * @returns A string representation of the scheduler's state for diagnostic purposes. The jobs and drain requests are displayed in the order in which they are currently expected to be processed. The current job and drain request are marked by an asterisk. - **/ - function retrieveState(): string; + /** + * Returns a string representation of the scheduler's state for diagnostic purposes. The jobs and drain requests are displayed in the order in which they are currently expected to be processed. The current job and drain request are marked by an asterisk. + * @returns A string representation of the scheduler's state for diagnostic purposes. The jobs and drain requests are displayed in the order in which they are currently expected to be processed. The current job and drain request are marked by an asterisk. + **/ + function retrieveState(): string; - /** - * Runs jobs in the scheduler without timeslicing until all jobs at the specified priority and higher have executed. - * @param priority The priority to which the scheduler should drain. The default is -15. - * @param name An optional description of the drain request for diagnostics. - * @returns A Promise which completes when the drain has finished. Canceling this Promise cancels the drain request. This Promise will never enter an error state. - **/ - function requestDrain(priority?: Priority, name?: string): Promise; + /** + * Runs jobs in the scheduler without timeslicing until all jobs at the specified priority and higher have executed. + * @param priority The priority to which the scheduler should drain. The default is -15. + * @param name An optional description of the drain request for diagnostics. + * @returns A Promise which completes when the drain has finished. Canceling this Promise cancels the drain request. This Promise will never enter an error state. + **/ + function requestDrain(priority?: Priority, name?: string): Promise; - /** - * Schedules the specified function to execute asynchronously. - * @param work A function that represents the work item to be scheduled. When called the work item will receive as its first argument an object which allows the work item to ask the scheduler if it should yield cooperatively and if so allows the work item to either provide a function to be run as a continuation or a WinJS.Promise which will when complete provide a function to run as a continuation. Provide these fields for the object: shouldYield, setWork(work), setPromise(promise), job. - * @param priority The priority of the work item. If you don't specify a priority, it defaults to WinJS.Utilities.Scheduler.Priority.normal. - * @param thisArg A "this" instance to be bound to the work item. The default value is null. - * @param name A description of the work item for diagnostics. The default value is an empty string. - * @returns The job instance that represents this work item. - **/ - function schedule(work: (jobInfo: IJobInfo) => any, priority?: Priority, thisArg?: any, name?: string): IJob; + /** + * Schedules the specified function to execute asynchronously. + * @param work A function that represents the work item to be scheduled. When called the work item will receive as its first argument an object which allows the work item to ask the scheduler if it should yield cooperatively and if so allows the work item to either provide a function to be run as a continuation or a WinJS.Promise which will when complete provide a function to run as a continuation. Provide these fields for the object: shouldYield, setWork(work), setPromise(promise), job. + * @param priority The priority of the work item. If you don't specify a priority, it defaults to WinJS.Utilities.Scheduler.Priority.normal. + * @param thisArg A "this" instance to be bound to the work item. The default value is null. + * @param name A description of the work item for diagnostics. The default value is an empty string. + * @returns The job instance that represents this work item. + **/ + function schedule(work: (jobInfo: IJobInfo) => any, priority?: Priority, thisArg?: any, name?: string): IJob; - /** - * Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.aboveNormal priority. - * @param promiseValue The value returned by the completed Promise. - * @param jobName A string that describes the job for diagnostic purposes. - * @returns A Promise that completes within a job of aboveNormal priority. - **/ - function schedulePromiseAboveNormal(promiseValue?: U, jobName?: string): Promise; + /** + * Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.aboveNormal priority. + * @param promiseValue The value returned by the completed Promise. + * @param jobName A string that describes the job for diagnostic purposes. + * @returns A Promise that completes within a job of aboveNormal priority. + **/ + function schedulePromiseAboveNormal(promiseValue?: U, jobName?: string): Promise; - /** - * Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.belowNormal priority. - * @param promiseValue The value returned by the completed Promise. - * @param jobName A string that describes the job for diagnostic purposes. - * @returns A Promise that completes within a job of belowNormal priority. - **/ - function schedulePromiseBelowNormal(promiseValue?: U, jobName?: string): Promise; + /** + * Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.belowNormal priority. + * @param promiseValue The value returned by the completed Promise. + * @param jobName A string that describes the job for diagnostic purposes. + * @returns A Promise that completes within a job of belowNormal priority. + **/ + function schedulePromiseBelowNormal(promiseValue?: U, jobName?: string): Promise; - /** - * Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.high priority. - * @param promiseValue The value returned by the completed Promise. - * @param jobName A string that describes the job for diagnostic purposes. - * @returns A Promise that completes within a job of high priority. - **/ - function schedulePromiseHigh(promiseValue?: U, jobName?: string): Promise; + /** + * Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.high priority. + * @param promiseValue The value returned by the completed Promise. + * @param jobName A string that describes the job for diagnostic purposes. + * @returns A Promise that completes within a job of high priority. + **/ + function schedulePromiseHigh(promiseValue?: U, jobName?: string): Promise; - /** - * Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.Idle priority. - * @param promiseValue The value returned by the completed Promise. - * @param jobName A string that describes the job for diagnostic purposes. - * @returns A Promise that completes within a job of idle priority. - **/ - function schedulePromiseIdle(promiseValue?: U, jobName?: string): Promise; + /** + * Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.Idle priority. + * @param promiseValue The value returned by the completed Promise. + * @param jobName A string that describes the job for diagnostic purposes. + * @returns A Promise that completes within a job of idle priority. + **/ + function schedulePromiseIdle(promiseValue?: U, jobName?: string): Promise; - /** - * Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.normal priority. - * @param promiseValue The value returned by the completed Promise. - * @param jobName A string that describes the job for diagnostic purposes. - * @returns A Promise that completes within a job of normal priority. - **/ - function schedulePromiseNormal(promiseValue?: U, jobName?: string): Promise; + /** + * Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.normal priority. + * @param promiseValue The value returned by the completed Promise. + * @param jobName A string that describes the job for diagnostic purposes. + * @returns A Promise that completes within a job of normal priority. + **/ + function schedulePromiseNormal(promiseValue?: U, jobName?: string): Promise; - //#endregion Functions + //#endregion Functions } diff --git a/ws/ws.d.ts b/ws/ws.d.ts index b0b590b92..ef7acc3ba 100644 --- a/ws/ws.d.ts +++ b/ws/ws.d.ts @@ -110,7 +110,7 @@ declare module "ws" { constructor(options?: IServerOptions, callback?: Function); close(): void; - handleUpgrade(request: http.ClientRequest, socket: net.Socket, + handleUpgrade(request: http.ServerRequest, socket: net.Socket, upgradeHead: Buffer, callback: (client: WebSocket) => void): void; // Events diff --git a/x2js/xml2json.d.ts b/x2js/xml2json.d.ts index c202eface..1b55262f2 100644 --- a/x2js/xml2json.d.ts +++ b/x2js/xml2json.d.ts @@ -1,3 +1,7 @@ +// Type definitions for x2js +// Project: https://code.google.com/p/x2js/ +// Definitions by: Horiuchi_H +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface IX2JS { new (config?: IX2JSOption): IX2JS; diff --git a/xml2js/xml2js-tests.ts b/xml2js/xml2js-tests.ts new file mode 100644 index 000000000..3e3fbb661 --- /dev/null +++ b/xml2js/xml2js-tests.ts @@ -0,0 +1,7 @@ +/// + +import xml2js = require('xml2js'); + +xml2js.parseString("Hello xml2js!", (err: any, result: any) => { }); + +xml2js.parseString("Hello xml2js!", {trim: true}, (err: any, result: any) => { }); diff --git a/xml2js/xml2js.d.ts b/xml2js/xml2js.d.ts new file mode 100644 index 000000000..30aa64a87 --- /dev/null +++ b/xml2js/xml2js.d.ts @@ -0,0 +1,36 @@ +// Type definitions for node-xml2js +// Project: https://github.com/Leonidas-from-XIV/node-xml2js +// Definitions by: Michel Salib +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'xml2js' { + + export = xml2js; + + module xml2js { + function parseString(xml:string, callback: (err: any, result:any) => void): void; + function parseString(xml:string, options: Options, callback: (err: any, result:any) => void): void; + + interface Options { + attrkey?: string; + charkey?: string; + explicitCharkey?: boolean; + trim?: boolean; + normalizeTags?: boolean; + normalize?: boolean; + explicitRoot?: boolean; + emptyTag?: any; + explicitArray?: boolean; + ignoreAttrs?: boolean; + mergeAttrs?: boolean; + validator?: Function; + xmlns?: boolean; + explicitChildren?: boolean; + charsAsChildren?: boolean; + async?: boolean; + strict?: boolean; + attrNameProcessors?: (name: string) => string; + tagNameProcessors?: (name: string) => string; + } + } +} diff --git a/youtube/youtube.d.ts b/youtube/youtube.d.ts index efb4ba344..3f21dcb86 100644 --- a/youtube/youtube.d.ts +++ b/youtube/youtube.d.ts @@ -1,7 +1,6 @@ // Type definitions for YouTube // Project: https://developers.google.com/youtube/ -// Definitions by: Daz Wilkin -// Definitions by: Ian Obermiller +// Definitions by: Daz Wilkin , Ian Obermiller // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module YT { diff --git a/yui/yui-test.d.ts b/yui/yui-test.d.ts index f72784ffa..a9df72232 100644 --- a/yui/yui-test.d.ts +++ b/yui/yui-test.d.ts @@ -1,7 +1,7 @@ // Type definitions for yui 3.14.0 // Project: https://github.com/yui/yui3/blob/release-3.14.0/src/test/js -// Definitions by: -// Gia Bảo @ Sân Đình +// Definitions by: Gia Bảo @ Sân Đình +// Definitions: https://github.com/borisyankov/DefinitelyTyped declare module YUITest { interface YUITestStatic{ diff --git a/zeroclipboard/zeroclipboard.d.ts b/zeroclipboard/zeroclipboard.d.ts index 76086f5bd..6db1ba180 100644 --- a/zeroclipboard/zeroclipboard.d.ts +++ b/zeroclipboard/zeroclipboard.d.ts @@ -1,8 +1,6 @@ // Type definitions for ZeroClipboard // Project: https://github.com/jonrohan/ZeroClipboard -// Definitions by: Eric J. Smith -// Definitions by: Blake Niemyjski -// Definitions by: György Balássy +// Definitions by: Eric J. Smith , Blake Niemyjski , György Balássy // Definitions: https://github.com/borisyankov/DefinitelyTyped declare class ZeroClipboard {