From ab71290650b4077c498503315396bece131ae488 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Thu, 28 May 2015 10:50:54 +0800 Subject: [PATCH 01/84] moment: Include some methods which were added in 2.9.0 --- moment/moment-node.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index 13f1b9362..0a89b7066 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -69,6 +69,7 @@ declare module moment { subtract(d: Duration): Duration; toISOString(): string; + toJSON(): string; } @@ -276,6 +277,12 @@ declare module moment { isSame(b: Date, granularity: string): boolean; isSame(b: number[], granularity: string): boolean; + isBetween(a: Moment, b: Moment, granularity?: string): boolean; + isBetween(a: string, b: string, granularity?: string): boolean; + isBetween(a: number, b: number, granularity?: string): boolean; + isBetween(a: Date, b: Date, granularity?: string): boolean; + isBetween(a: number[], b: number[], granularity?: string): boolean; + // Deprecated as of 2.8.0. lang(language: string): Moment; lang(reset: boolean): Moment; @@ -412,6 +419,7 @@ declare module moment { invalid(parsingFlags?: Object): Moment; isMoment(): boolean; isMoment(m: any): boolean; + isDate(m: any): boolean; isDuration(): boolean; isDuration(d: any): boolean; From dbbc90296b72294f8099c19e724c37447dca43f3 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Thu, 28 May 2015 10:51:22 +0800 Subject: [PATCH 02/84] moment: Tests for 2.9.0 methods --- moment/moment-external-tests.ts | 7 +++++++ moment/moment-tests.ts | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/moment/moment-external-tests.ts b/moment/moment-external-tests.ts index c5855c12c..b76752b11 100644 --- a/moment/moment-external-tests.ts +++ b/moment/moment-external-tests.ts @@ -196,10 +196,17 @@ moment.isMoment(); moment.isMoment(new Date()); moment.isMoment(moment()); +moment.isDate(new Date()); +moment.isDate(/regexp/); + moment.isDuration(); moment.isDuration(new Date()); moment.isDuration(moment.duration()); +moment().isBetween(moment(), moment()); +moment().isBetween(new Date(), new Date()); +moment().isBetween([1,1,2000], [1,1,2001], "year"); + moment.localeData('fr'); moment(1316116057189).fromNow(); diff --git a/moment/moment-tests.ts b/moment/moment-tests.ts index 16490d2e1..04c075352 100644 --- a/moment/moment-tests.ts +++ b/moment/moment-tests.ts @@ -196,10 +196,17 @@ moment.isMoment(); moment.isMoment(new Date()); moment.isMoment(moment()); +moment.isDate(new Date()); +moment.isDate(/regexp/); + moment.isDuration(); moment.isDuration(new Date()); moment.isDuration(moment.duration()); +moment().isBetween(moment(), moment()); +moment().isBetween(new Date(), new Date()); +moment().isBetween([1,1,2000], [1,1,2001], "year"); + moment.localeData('fr'); moment(1316116057189).fromNow(); @@ -228,6 +235,8 @@ moment.duration(500).seconds(); moment.duration(500).asSeconds(); moment.duration().minutes(); moment.duration().asMinutes(); +moment.duration().toISOString(); +moment.duration().toJSON(); var adur = moment.duration(3, 'd'); var bdur = moment.duration(2, 'd'); From 8064aa89b0ccf592a507ccd8f5e0389818abb64b Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Tue, 2 Jun 2015 11:30:14 +0800 Subject: [PATCH 03/84] moment: Use type union for methods with moment-like parameters --- moment/moment-node.d.ts | 59 ++++++----------------------------------- 1 file changed, 8 insertions(+), 51 deletions(-) diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index 0a89b7066..eaacb8855 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -216,11 +216,8 @@ declare module moment { dayOfYear(): number; dayOfYear(d: number): Moment; - from(f: Moment): string; - from(f: Moment, suffix: boolean): string; - from(d: Date): string; - from(s: string): string; - from(date: number[]): string; + from(f: Moment|string|number|Date|number[], suffix?: boolean): string; + to(f: Moment|string|number|Date|number[], suffix?: boolean): string; diff(b: Moment): number; diff(b: Moment, unitOfTime: string): number; @@ -243,45 +240,13 @@ declare module moment { isDST(): boolean; isBefore(): boolean; - isBefore(b: Moment): boolean; - isBefore(b: string): boolean; - isBefore(b: Number): boolean; - isBefore(b: Date): boolean; - isBefore(b: number[]): boolean; - isBefore(b: Moment, granularity: string): boolean; - isBefore(b: String, granularity: string): boolean; - isBefore(b: Number, granularity: string): boolean; - isBefore(b: Date, granularity: string): boolean; - isBefore(b: number[], granularity: string): boolean; + isBefore(b: Moment|string|number|Date|number[], granularity?: string): boolean; isAfter(): boolean; - isAfter(b: Moment): boolean; - isAfter(b: string): boolean; - isAfter(b: Number): boolean; - isAfter(b: Date): boolean; - isAfter(b: number[]): boolean; - isAfter(b: Moment, granularity: string): boolean; - isAfter(b: String, granularity: string): boolean; - isAfter(b: Number, granularity: string): boolean; - isAfter(b: Date, granularity: string): boolean; - isAfter(b: number[], granularity: string): boolean; + isAfter(b: Moment|string|number|Date|number[], granularity?: string): boolean; - isSame(b: Moment): boolean; - isSame(b: string): boolean; - isSame(b: Number): boolean; - isSame(b: Date): boolean; - isSame(b: number[]): boolean; - isSame(b: Moment, granularity: string): boolean; - isSame(b: String, granularity: string): boolean; - isSame(b: Number, granularity: string): boolean; - isSame(b: Date, granularity: string): boolean; - isSame(b: number[], granularity: string): boolean; - - isBetween(a: Moment, b: Moment, granularity?: string): boolean; - isBetween(a: string, b: string, granularity?: string): boolean; - isBetween(a: number, b: number, granularity?: string): boolean; - isBetween(a: Date, b: Date, granularity?: string): boolean; - isBetween(a: number[], b: number[], granularity?: string): boolean; + isSame(b: Moment|string|number|Date|number[], granularity?: string): boolean; + isBetween(a: Moment|string|number|Date|number[], b: Moment|string|number|Date|number[], granularity?: string): boolean; // Deprecated as of 2.8.0. lang(language: string): Moment; @@ -297,20 +262,12 @@ declare module moment { localeData(): MomentLanguage; // Deprecated as of 2.7.0. - max(date: Date): Moment; - max(date: number): Moment; - max(date: any[]): Moment; - max(date: string): Moment; + max(date: Moment|string|number|Date|any[]): Moment; max(date: string, format: string): Moment; - max(clone: Moment): Moment; // Deprecated as of 2.7.0. - min(date: Date): Moment; - min(date: number): Moment; - min(date: any[]): Moment; - min(date: string): Moment; + min(date: Moment|string|number|Date|any[]): Moment; min(date: string, format: string): Moment; - min(clone: Moment): Moment; get(unit: string): number; set(unit: string, value: number): Moment; From 8f9ff607f0a79e5a976682d00ce156781f9efd19 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Sat, 6 Jun 2015 16:26:00 +0800 Subject: [PATCH 04/84] moment: Use type alias for moment-like parameters --- moment/moment-node.d.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index eaacb8855..f491833f9 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -216,8 +216,8 @@ declare module moment { dayOfYear(): number; dayOfYear(d: number): Moment; - from(f: Moment|string|number|Date|number[], suffix?: boolean): string; - to(f: Moment|string|number|Date|number[], suffix?: boolean): string; + from(f: MomentLike, suffix?: boolean): string; + to(f: MomentLike, suffix?: boolean): string; diff(b: Moment): number; diff(b: Moment, unitOfTime: string): number; @@ -240,13 +240,13 @@ declare module moment { isDST(): boolean; isBefore(): boolean; - isBefore(b: Moment|string|number|Date|number[], granularity?: string): boolean; + isBefore(b: MomentLike, granularity?: string): boolean; isAfter(): boolean; - isAfter(b: Moment|string|number|Date|number[], granularity?: string): boolean; + isAfter(b: MomentLike, granularity?: string): boolean; - isSame(b: Moment|string|number|Date|number[], granularity?: string): boolean; - isBetween(a: Moment|string|number|Date|number[], b: Moment|string|number|Date|number[], granularity?: string): boolean; + isSame(b: MomentLike, granularity?: string): boolean; + isBetween(a: MomentLike, b: MomentLike, granularity?: string): boolean; // Deprecated as of 2.8.0. lang(language: string): Moment; @@ -262,11 +262,11 @@ declare module moment { localeData(): MomentLanguage; // Deprecated as of 2.7.0. - max(date: Moment|string|number|Date|any[]): Moment; + max(date: MomentLike|any[]): Moment; max(date: string, format: string): Moment; // Deprecated as of 2.7.0. - min(date: Moment|string|number|Date|any[]): Moment; + min(date: MomentLike|any[]): Moment; min(date: string, format: string): Moment; get(unit: string): number; @@ -439,6 +439,9 @@ declare module moment { } + // Moment.js automatically converts datetime parameters from a number of types + type MomentLike = Moment | string | number | Date | number[]; + } declare module 'moment' { From 6f0bcac0caf998f1e943d43b7f9bf240c68ba13e Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Tue, 23 Jun 2015 13:00:22 +0800 Subject: [PATCH 05/84] Revert "moment: Use type alias for moment-like parameters" This reverts commit 8f9ff607f0a79e5a976682d00ce156781f9efd19 which fails to compile on typescript@1.4.1 (however it compiles with typescript@1.5.0-beta). --- moment/moment-node.d.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index f491833f9..eaacb8855 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -216,8 +216,8 @@ declare module moment { dayOfYear(): number; dayOfYear(d: number): Moment; - from(f: MomentLike, suffix?: boolean): string; - to(f: MomentLike, suffix?: boolean): string; + from(f: Moment|string|number|Date|number[], suffix?: boolean): string; + to(f: Moment|string|number|Date|number[], suffix?: boolean): string; diff(b: Moment): number; diff(b: Moment, unitOfTime: string): number; @@ -240,13 +240,13 @@ declare module moment { isDST(): boolean; isBefore(): boolean; - isBefore(b: MomentLike, granularity?: string): boolean; + isBefore(b: Moment|string|number|Date|number[], granularity?: string): boolean; isAfter(): boolean; - isAfter(b: MomentLike, granularity?: string): boolean; + isAfter(b: Moment|string|number|Date|number[], granularity?: string): boolean; - isSame(b: MomentLike, granularity?: string): boolean; - isBetween(a: MomentLike, b: MomentLike, granularity?: string): boolean; + isSame(b: Moment|string|number|Date|number[], granularity?: string): boolean; + isBetween(a: Moment|string|number|Date|number[], b: Moment|string|number|Date|number[], granularity?: string): boolean; // Deprecated as of 2.8.0. lang(language: string): Moment; @@ -262,11 +262,11 @@ declare module moment { localeData(): MomentLanguage; // Deprecated as of 2.7.0. - max(date: MomentLike|any[]): Moment; + max(date: Moment|string|number|Date|any[]): Moment; max(date: string, format: string): Moment; // Deprecated as of 2.7.0. - min(date: MomentLike|any[]): Moment; + min(date: Moment|string|number|Date|any[]): Moment; min(date: string, format: string): Moment; get(unit: string): number; @@ -439,9 +439,6 @@ declare module moment { } - // Moment.js automatically converts datetime parameters from a number of types - type MomentLike = Moment | string | number | Date | number[]; - } declare module 'moment' { From defc79f8004fa04b39d6c3c1a28bf69ffa7338b3 Mon Sep 17 00:00:00 2001 From: Andrew Archibald Date: Sat, 27 Jun 2015 11:47:09 -0700 Subject: [PATCH 06/84] Add bardjs definitions --- bardjs/bardjs.d.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 bardjs/bardjs.d.ts diff --git a/bardjs/bardjs.d.ts b/bardjs/bardjs.d.ts new file mode 100644 index 000000000..77fc799b1 --- /dev/null +++ b/bardjs/bardjs.d.ts @@ -0,0 +1,30 @@ +// Type definitions for bardjs 0.1.4 +// Project: https://github.com/wardbell/bardjs +// Definitions by: Andrew Archibald +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// + +declare module bard { + function $httpBackend($provide: angular.auto.IProvideService); + function $q($provide: angular.auto.IProvideService); + function addGlobals(...args: any[]): void; + function appModule(...args: any[]); + function assertFail(message: string): Chai.AssertionError; + function asyncModule(...args: any[]); + function debugging(x); + function fakeLogger($provide: angular.auto.IProvideService): void; + function fakeRouteHelperProvider($provide: angular.auto.IProvideService): void; + function fakeRouteProvider($provide: angular.auto.IProvideService): void; + function fakeStateProvider($provide: angular.auto.IProvideService): void; + function fakeToastr($provide: angular.auto.IProvideService): void; + function inject(...args: any[]): void; + function log(msg); + function mochaRunnerListener(runner: Mocha.IRunner): void; + function mockService(service, config); + function replaceAccentChars(s: string): string; + function verifyNoOutstandingHttpRequests(): void; + function wrapWithDone(callback: Function, done: Function); +} From 79daa85ac468dc65ba208c775e5ef53780279b4f Mon Sep 17 00:00:00 2001 From: Andrew Archibald Date: Sat, 27 Jun 2015 21:13:51 -0700 Subject: [PATCH 07/84] Add more specific types and comments to bardjs --- bardjs/bardjs.d.ts | 166 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 155 insertions(+), 11 deletions(-) diff --git a/bardjs/bardjs.d.ts b/bardjs/bardjs.d.ts index 77fc799b1..328d5b067 100644 --- a/bardjs/bardjs.d.ts +++ b/bardjs/bardjs.d.ts @@ -7,24 +7,168 @@ /// /// +/** + * Module for bardjs functions + */ declare module bard { - function $httpBackend($provide: angular.auto.IProvideService); - function $q($provide: angular.auto.IProvideService); - function addGlobals(...args: any[]): void; - function appModule(...args: any[]); + /** + * Replaces the ngMock'ed $httpBackend with the real one from ng thus + * restoring the ability to issue AJAX calls to the backend with $http. + * + * Note that $q remains ngMocked so you must flush $http calls ($rootScope.$digest). + * Use $rootScope.$apply() for this purpose. + * + * Could restore $q with $qReal in which case don't need to flush. + */ + function $httpBackend($provide: angular.auto.IProvideService): any; + + /** + * Replaces the ngMock'ed $q with the real one from ng thus + * obviating the need to flush $http and $q queues + * at the expense of ability to control $q timing. + */ + function $q($provide: angular.auto.IProvideService): any; + + /** + * Add names of globals to list of OK globals for this mocha spec + * NB: Call this method ONLY if you're using mocha! + * NB: Turn off browser-sync else mocha detects the browser-sync globals + * like ` ___browserSync___` + */ + function addGlobals(...globals: any[]): void; + + /** + * Prepare ngMocked application feature module + * along with faked toastr, routehelper, + * and faked router services. + * Especially useful for controller testing + * Use it as you would the ngMocks#module method + * + * DO NOT USE IF YOU NEED THE REAL ROUTER SERVICES! + * Fall back to `angular.mock.module(...)` or just `module(...)` + */ + function appModule(...args: any[]): any; + + /** + * Assert a failure in mocha, without condition + */ function assertFail(message: string): Chai.AssertionError; - function asyncModule(...args: any[]); - function debugging(x); + + /** + * Prepare ngMocked module definition that makes real $http and $q calls + * Also adds fakeLogger to the end of the definition + * Use it as you would the ngMocks#module method + */ + function asyncModule(...args: any[]): any; + + /** + * Get or set bard debugging flag + */ + function debugging(newFlag?: any): boolean; + + /** + * Creates a fake logger to be used in testing + */ function fakeLogger($provide: angular.auto.IProvideService): void; + + /** + * Creates a fake route helper provider to be used in testing + */ function fakeRouteHelperProvider($provide: angular.auto.IProvideService): void; + + /** + * Stub out the $routeProvider so we avoid + * all routing calls, including the default route + * which runs on every test otherwise. + * Make sure this goes before the inject in the spec. + */ function fakeRouteProvider($provide: angular.auto.IProvideService): void; + + /** + * Stub out the $stateProvider so we avoid + * all routing calls, including the default state + * which runs on every test otherwise. + * Make sure this goes before the inject in the spec. + */ function fakeStateProvider($provide: angular.auto.IProvideService): void; + + /** + * Creates a fake toastr to be used in testing + */ function fakeToastr($provide: angular.auto.IProvideService): void; - function inject(...args: any[]): void; - function log(msg); + + /** + * Inject selected services into the windows object during test + * then remove them when test ends with an `afterEach`. + * + * spares us the repetition of creating common service vars and injecting them + * + * Option: the first argument may be the mocha spec context object (`this`) + * It MUST be `this` if you what to check for mocha global leaks. + * Do NOT supply `this` as the first arg if you're not running mocha specs. + * + * remaining inject arguments may take one of 3 forms : + * + * function - This fn will be passed to ngMocks.inject. + * Annotations extracted after inject does its thing. + * [strings] - same string array you'd use to set fn.$inject + * (...string) - string arguments turned into a string array + */ + function inject(context?: any, ...args: string[]): void; + + /** + * Write to console if bard debugging flag is on + */ + function log(message: any): void; + + /** + * Listen to mocha test runner events + * Usage in browser: + * var runner = mocha.run(); + * bard.mochaRunnerListener(runner); + */ function mochaRunnerListener(runner: Mocha.IRunner): void; - function mockService(service, config); - function replaceAccentChars(s: string): string; + + /** + * Mocks out a service with sinon stubbed functions + * that return the values specified in the config + * + * If the config value is `undefined`, + * stub the service method with a dummy that doesn't return a value + * + * If the config value is a function, set service property with it + * + * If a service member is a property, not a function, + * set it with the config value + * If a service member name is not a key in config, + * follow the same logic as above to set its members + * using the config._default value (which is `undefined` if omitted) + * + * If there is a config entry that is NOT a member of the service + * add mocked function to the service using the config value + */ + function mockService(service: any, config: any): any; + + /** + * Replaces the accented characters of many European languages w/ unaccented chars + * Use it in JavaScript string sorts where such characters may be encountered + * Matches the default string comparers of most databases. + * Ex: replaceAccentChars(a.Name) < replaceAccentChars(b.Name) + * instead of: a.Name < b.Name + */ + function replaceAccentChars(text: string): string; + + /** + * Assert that there are no outstanding HTTP requests after test is complete + * For use with ngMocks; doesn't work for async server integration tests + */ function verifyNoOutstandingHttpRequests(): void; - function wrapWithDone(callback: Function, done: Function); + + /** + * Returns a function that execute a callback function + * (typically a fn making asserts) within a try/catch + * The try/catch then calls the ambient "done" function + * in the appropriate way for both success and failure + */ + function wrapWithDone(callback: Function, done: Function): Function; } From 9d20855e549fd43fcb71221f05e75be0e3e57418 Mon Sep 17 00:00:00 2001 From: Andrew Archibald Date: Sat, 27 Jun 2015 21:30:18 -0700 Subject: [PATCH 08/84] Made more specific comments in bardjs --- bardjs/bardjs.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bardjs/bardjs.d.ts b/bardjs/bardjs.d.ts index 328d5b067..e0288825f 100644 --- a/bardjs/bardjs.d.ts +++ b/bardjs/bardjs.d.ts @@ -67,12 +67,12 @@ declare module bard { function debugging(newFlag?: any): boolean; /** - * Creates a fake logger to be used in testing + * Registers a fake logger service that you can spy on */ function fakeLogger($provide: angular.auto.IProvideService): void; /** - * Creates a fake route helper provider to be used in testing + * Registers a fake route helper provider service that you can spy on */ function fakeRouteHelperProvider($provide: angular.auto.IProvideService): void; @@ -93,7 +93,7 @@ declare module bard { function fakeStateProvider($provide: angular.auto.IProvideService): void; /** - * Creates a fake toastr to be used in testing + * Registers a fake toastr service that you can spy on */ function fakeToastr($provide: angular.auto.IProvideService): void; From 97f251cef19e557391588889493103c15fffde12 Mon Sep 17 00:00:00 2001 From: Toshiya Nakakura Date: Sun, 5 Jul 2015 13:16:47 +0900 Subject: [PATCH 09/84] add webvr-api definition --- webvr-api/webvr-api-test.ts | 62 +++++++++++++ webvr-api/webvr-api.d.ts | 175 ++++++++++++++++++++++++++++++++++++ 2 files changed, 237 insertions(+) create mode 100644 webvr-api/webvr-api-test.ts create mode 100644 webvr-api/webvr-api.d.ts diff --git a/webvr-api/webvr-api-test.ts b/webvr-api/webvr-api-test.ts new file mode 100644 index 000000000..df2a72438 --- /dev/null +++ b/webvr-api/webvr-api-test.ts @@ -0,0 +1,62 @@ +/// + +function fieldOfViewToProjectionMatrix(fov: WebVRApi.VRFieldOfView, zNear: number, zFar: number) { + var upTan = Math.tan(fov.upDegrees * Math.PI/180.0); + var downTan = Math.tan(fov.downDegrees * Math.PI/180.0); + var leftTan = Math.tan(fov.leftDegrees * Math.PI/180.0); + var rightTan = Math.tan(fov.rightDegrees * Math.PI/180.0); + var xScale = 2.0 / (leftTan + rightTan); + var yScale = 2.0 / (upTan + downTan); + + var out = new Float32Array(16); + out[0] = xScale; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + out[4] = 0.0; + out[5] = yScale; + out[6] = 0.0; + out[7] = 0.0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = ((upTan - downTan) * yScale * 0.5); + out[10] = -(zNear + zFar) / (zFar - zNear); + out[11] = -1.0; + out[12] = 0.0; + out[13] = 0.0; + out[14] = -(2.0 * zFar * zNear) / (zFar - zNear); + out[15] = 0.0; + + return out; +} + +var hmd: HMDVRDevice; +var leftEyeParams = hmd.getEyeParameters("left"); +var rightEyeParams = hmd.getEyeParameters("right"); +var leftEyeRect = leftEyeParams.renderRect; +var rightEyeRect = rightEyeParams.renderRect; + +var canvas: HTMLCanvasElement; +canvas.width = rightEyeRect.x + rightEyeRect.width; +canvas.height = Math.max(leftEyeRect.y + leftEyeRect.height, rightEyeRect.y + rightEyeRect.height); + +var gHMD: WebVRApi.VRDevice; +var gPositionSensor: WebVRApi.VRDevice; + +navigator.getVRDevices().then(function(devices) { + for (var i = 0; i < devices.length; ++i) { + if (devices[i] instanceof HMDVRDevice) { + gHMD = devices[i]; + break; + } + } + + if (gHMD) { + for (var i = 0; i < devices.length; ++i) { + if (devices[i] instanceof PositionSensorVRDevice && + devices[i].hardwareUnitId == gHMD.hardwareUnitId) { + gPositionSensor = devices[i]; + break; + } + } + } +}); diff --git a/webvr-api/webvr-api.d.ts b/webvr-api/webvr-api.d.ts new file mode 100644 index 000000000..16918cf30 --- /dev/null +++ b/webvr-api/webvr-api.d.ts @@ -0,0 +1,175 @@ +// Type definitions for WebVR API +// Project: http://mozvr.github.io/webvr-spec/webvr.html +// Definitions by: Toshiya Nakakura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare type VREye = string; + +declare module WebVRApi { + export interface VRFieldOfViewReadOnly { + upDegrees: number; + rightDegrees: number; + downDegrees: number; + leftDegrees: number; + } + + export interface VRFieldOfViewInit { + upDegrees: number; + rightDegrees: number; + downDegrees: number; + leftDegrees: number; + } + + export interface VRFieldOfView extends VRFieldOfViewReadOnly { + constructor(upDegrees:number, rightDegrees:number, downDegrees:number, leftDegrees:number): VRFieldOfView; + upDegrees: number; + rightDegrees: number; + downDegrees: number; + leftDegrees: number; + } + + export interface VRPositionState { + /** + * Monotonically increasing value that allows the author to determine if position state data been updated from the hardware. + */ + timeStamp: number; + /** + * True if the position attribute is valid. If false position MUST be null. + */ + hasPosition: boolean; + /** + * Position of the sensor at timeStamp as a 3D vector. + */ + position?: GeometryDom.DOMPoint; + /** + * Linear velocity of the sensor at timeStamp. + */ + linearVelocity?: GeometryDom.DOMPoint; + /** + * Linear acceleration of the sensor at timeStamp. + */ + linearAcceleration?: GeometryDom.DOMPoint; + /** + * True if the orientation attribute is valid. If false orientation MUST be null. + */ + hasOrientation: boolean; + /** + * Orientation of the sensor at timeStamp as a quaternion. + */ + orientation?: GeometryDom.DOMPoint; + /** + * Angular velocity of the sensor at timeStamp. + */ + angularVelocity?: GeometryDom.DOMPoint; + /** + * Angular acceleration of the sensor at timeStamp. + */ + angularAcceleration?: GeometryDom.DOMPoint; + } + + export interface VREyeParameters { + /** + * Describes the minimum supported field of view for the eye. + */ + minimumFieldOfView: VRFieldOfView; + /** + * Describes the maximum supported field of view for the eye. + */ + maximumFieldOfView: VRFieldOfView; + /** + * Describes the recommended field of view for the eye. + */ + recommendedFieldOfView: VRFieldOfView; + /** + * Offset from the center of the users head to the eye in meters. + */ + eyeTranslation: GeometryDom.DOMPoint; + /** + * The current field of view for the eye, as specified by setFieldOfView. + */ + currentFieldOfView: VRFieldOfView; + /** + * Describes the viewport of a canvas into which visuals for this eye should be rendered. + */ + renderRect: GeometryDom.DOMRect; + } + + export interface VRDevice { + /** + * An identifier for the distinct hardware unit that this VRDevice is a part of. + */ + hardwareUnitId: string; + /** + * An identifier for this distinct sensor/device on a physical hardware device. + */ + deviceId: string; + /** + * A user-readable name identifying the device. + */ + deviceName: string; + } +} + +declare class HMDVRDevice implements WebVRApi.VRDevice { + /** + * An identifier for the distinct hardware unit that this VRDevice is a part of. + */ + hardwareUnitId: string; + /** + * An identifier for this distinct sensor/device on a physical hardware device. + */ + deviceId: string; + /** + * A user-readable name identifying the device. + */ + deviceName: string; + + /** + * Return the current VREyeParameters for the given eye. + */ + getEyeParameters(whichEye: VREye): WebVRApi.VREyeParameters; + /** + * Set the field of view for both eyes. If + */ + setFieldOfView(leftFOV?: WebVRApi.VRFieldOfViewInit, rightFOV?: WebVRApi.VRFieldOfViewInit, zNear?: number, zFar?: number): void; +} + +declare class PositionSensorVRDevice implements WebVRApi.VRDevice { + /** + * An identifier for the distinct hardware unit that this VRDevice is a part of. + */ + hardwareUnitId: string; + /** + * An identifier for this distinct sensor/device on a physical hardware device. + */ + deviceId: string; + /** + * A user-readable name identifying the device. + */ + deviceName: string; + + /** + * Return a VRPositionState dictionary containing the state of this position sensor state for the current frame (if within a requestAnimationFrame context) or for the previous frame. + */ + getState(): WebVRApi.VRPositionState; + /** + * Return the current instantaneous sensor state. + */ + getImmediateState(): WebVRApi.VRPositionState; + + /** + * Reset this sensor, treating its current position and orientation yaw as the "origin/zero" values. + */ + resetSensor(): void; +} + +interface Navigator { + /** + * Return a Promise which resolves to a list of available VRDevices. + */ + getVRDevices(): Promise>; +} + From 3387b8b71553573ec44125b9daf81d9c6e22efa9 Mon Sep 17 00:00:00 2001 From: pafflique Date: Tue, 7 Jul 2015 16:57:09 +0300 Subject: [PATCH 10/84] Collection.add signature fix http://backbonejs.org/#Collection-add - "Returns the added (or preexisting, if duplicate) models." --- backbone/backbone.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index 9d54361d5..b9039be35 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -181,8 +181,8 @@ declare module Backbone { comparator(element: TModel): number; comparator(compare: TModel, to?: TModel): number; - add(model: TModel, options?: AddOptions): Collection; - add(models: TModel[], options?: AddOptions): Collection; + add(model: TModel, options?: AddOptions): TModel; + add(models: TModel[], options?: AddOptions): TModel[]; at(index: number): TModel; /** * Get a model from a collection, specified by an id, a cid, or by passing in a model. From 70761a5ae8f624f2ce3517540a93bc68de5f3f4c Mon Sep 17 00:00:00 2001 From: pafflique Date: Tue, 7 Jul 2015 17:11:04 +0300 Subject: [PATCH 11/84] Allow mixed content in Collection.add Valid for TypeScript 1.4 --- backbone/backbone.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index b9039be35..275dba237 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -181,8 +181,8 @@ declare module Backbone { comparator(element: TModel): number; comparator(compare: TModel, to?: TModel): number; - add(model: TModel, options?: AddOptions): TModel; - add(models: TModel[], options?: AddOptions): TModel[]; + add(model: {}|TModel, options?: AddOptions): TModel; + add(models: ({}|TModel)[], options?: AddOptions): TModel[]; at(index: number): TModel; /** * Get a model from a collection, specified by an id, a cid, or by passing in a model. From 3675e7ea849a06811282b93bf7d059944f322143 Mon Sep 17 00:00:00 2001 From: Vadim Macagon Date: Tue, 7 Jul 2015 11:30:46 +0700 Subject: [PATCH 12/84] Add typings for atom-keymap library --- atom-keymap/.editorconfig | 3 + atom-keymap/atom-keymap-tests.ts | 24 ++++++ atom-keymap/atom-keymap.d.ts | 135 +++++++++++++++++++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 atom-keymap/.editorconfig create mode 100644 atom-keymap/atom-keymap-tests.ts create mode 100644 atom-keymap/atom-keymap.d.ts diff --git a/atom-keymap/.editorconfig b/atom-keymap/.editorconfig new file mode 100644 index 000000000..570211f89 --- /dev/null +++ b/atom-keymap/.editorconfig @@ -0,0 +1,3 @@ +[*.ts] +indent_style = tab +indent_size = 4 diff --git a/atom-keymap/atom-keymap-tests.ts b/atom-keymap/atom-keymap-tests.ts new file mode 100644 index 000000000..520327da9 --- /dev/null +++ b/atom-keymap/atom-keymap-tests.ts @@ -0,0 +1,24 @@ +/// + +import atomKeymap = require('atom-keymap'); +var KeymapManager = atomKeymap.KeymapManager; +type ICompleteMatchEvent = AtomKeymap.ICompleteMatchEvent; +// The import and type aliasing above can be done more concisely in TypeScript 1.5+: +//import { KeymapManager, ICompleteMatchEvent } from "atom-keymap"; + +var manager = new KeymapManager(); +manager.add('some/unique/path', { + '.workspace': { + 'ctrl-x': 'package:do-something', + 'ctrl-y': 'package:do-something-else' + }, + '.mini.editor': { + 'enter': 'core:confirm' + } +}); + +manager.onDidMatchBinding((event: ICompleteMatchEvent): void => { + console.log(event.binding.command); +}) + +manager.destroy(); diff --git a/atom-keymap/atom-keymap.d.ts b/atom-keymap/atom-keymap.d.ts new file mode 100644 index 000000000..355ea38af --- /dev/null +++ b/atom-keymap/atom-keymap.d.ts @@ -0,0 +1,135 @@ +// Type definitions for atom-keymap v5.1.5 +// Project: https://github.com/atom/atom-keymap/ +// Definitions by: Vadim Macagon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module AtomKeymap { + type Disposable = AtomEventKit.Disposable; + + /** Instance side of KeyBinding class. */ + interface KeyBinding { + enabled: boolean; + source: string; + command: string; + keystrokes: string; + keystrokeCount: number; + selector: string; + specificity: number; + + matches(keystroke: string): boolean; + compare(keyBinding: KeyBinding): number; + } + + interface ICompleteMatchEvent { + /** Keystrokes that matched the binding. */ + keystrokes: string; + /** Binding that was matched to the keystrokes. */ + binding: KeyBinding; + /** DOM element that was the target of the most recent `KeyboardEvent`. */ + keyboardEventTarget: Element; + } + + interface IPartialMatchEvent { + /** Keystrokes that matched the binding. */ + keystrokes: string; + /** Bindings that were partially matched to the keystrokes. */ + partiallyMatchedBindings: KeyBinding[]; + /** DOM element that was the target of the most recent `KeyboardEvent`. */ + keyboardEventTarget: Element; + } + + interface IFailedMatchEvent { + /** Keystrokes that failed to match a binding. */ + keystrokes: string; + /** DOM element that was the target of the most recent `KeyboardEvent`. */ + keyboardEventTarget: Element; + } + + interface IKeymapLoadEvent { + /** Path to a keymap file. */ + path: string; + } + + /** Static side of KeymapManager class. */ + interface KeymapManagerStatic { + prototype: KeymapManager; + new (options?: { defaultTarget?: Element }): KeymapManager; + } + + /** Instance side of KeymapManager class. */ + interface KeymapManager { + constructor: KeymapManagerStatic; + /** Unwatches all watched paths. */ + destroy(): void; + + // Event Subscription + + /** Sets callback to invoke when one or more keystrokes completely match a key binding. */ + onDidMatchBinding(callback: (event: ICompleteMatchEvent) => void): Disposable; + /** Sets callback to invoke when one or more keystrokes partially match a binding. */ + onDidPartiallyMatchBindings(callback: (event: IPartialMatchEvent) => void): Disposable; + /** Sets callback to invoke when one or more keystrokes fail to match any bindings. */ + onDidFailToMatchBinding(callback: (event: IFailedMatchEvent) => void): Disposable; + /** Sets callback to invoke when a keymap file is reloaded. */ + onDidReloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable; + /** Sets callback to invoke when a keymap file is unloaded. */ + onDidUnloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable; + /** Sets callback to invoke when a keymap file could not to be loaded. */ + onDidFailToReadFile(callback: (error: Error) => void): Disposable; + + // Adding and Removing Bindings + + /** Adds sets of key bindings grouped by CSS selector. */ + add(source: string, keyBindingsBySelector: any): Disposable; + + // Accessing Bindings + + getKeyBindings(): KeyBinding[]; + findKeyBindings(params?: { + keystrokes: string; // e.g. 'ctrl-x ctrl-s' + command: string; // e.g. 'editor:backspace' + target?: Element; + }): KeyBinding[]; + + // Managing Keymap Files + + /** + * Loads the key bindings from the given path. + * + * @param bindingsPath A path to a file or a directory. If the path is a directory all files + * inside it will be loaded. + */ + loadKeymap(bindingsPath: string, options?: { watch: boolean }): void; + /** + * Starts watching the given file/directory for changes, reloading any keymaps at that location + * when changes are detected. + * + * @param filePath A path to a file or a directory. + */ + watchKeymap(filePath: string): void; + + // Managing Keyboard Events + + /** + * Dispatches a custom event associated with the matching key binding for the given + * `KeyboardEvent` if one can be found. + */ + handleKeyboardEvent(event: KeyboardEvent): void; + /** Translates a keydown event to a keystroke string. */ + keystrokeForKeyboardEvent(event: KeyboardEvent): string; + /** + * @return The number of milliseconds allowed before pending states caused by partial matches of + * multi-keystroke bindings are terminated. + */ + getPartialMatchTimeout(): number; + } + + /** Allows commands to be associated with keystrokes in a context-sensitive way.*/ + var KeymapManager: KeymapManagerStatic; +} + +declare module 'atom-keymap' { + export = AtomKeymap; +} From e22b188d1b6477ead3ac7866c6209581bf01e2ce Mon Sep 17 00:00:00 2001 From: Sam Saint-Pettersen Date: Wed, 15 Jul 2015 10:10:32 +0100 Subject: [PATCH 13/84] Type definitions and tests for node random-string module --- random-string/random-string-tests.ts | 11 +++++++++++ random-string/random-string.d.ts | 9 +++++++++ 2 files changed, 20 insertions(+) create mode 100644 random-string/random-string-tests.ts create mode 100644 random-string/random-string.d.ts diff --git a/random-string/random-string-tests.ts b/random-string/random-string-tests.ts new file mode 100644 index 000000000..2b278a4f5 --- /dev/null +++ b/random-string/random-string-tests.ts @@ -0,0 +1,11 @@ +/// + +import randomString = require('random-string'); + +console.log(randomString()); +console.log(randomString({ + length: 20, + numeric: true, + letters: true, + special: true +})); diff --git a/random-string/random-string.d.ts b/random-string/random-string.d.ts new file mode 100644 index 000000000..f9bcddb1b --- /dev/null +++ b/random-string/random-string.d.ts @@ -0,0 +1,9 @@ +// Type definitions for random-string +// Project: https://github.com/valiton/node-random-string +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "random-string" { + function randomString(opts?: Object): string; + export = randomString; +} From 22ac5f1c784e6222ccaddde2dcf793a1c947d310 Mon Sep 17 00:00:00 2001 From: chr22 Date: Wed, 15 Jul 2015 11:37:52 +0200 Subject: [PATCH 14/84] Added three missing methods to $urlMatcherFactory --- angular-ui-router/angular-ui-router.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 18a6fb397..ed2f36ccf 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -88,6 +88,9 @@ declare module angular.ui { compile(pattern: string): IUrlMatcher; isMatcher(o: any): boolean; type(name: string, definition: any, definitionFn?: any): any; + caseInsensitive(value: boolean): void; + defaultSquashPolicy(value: string): void; + strictMode(value: boolean): void; } interface IUrlRouterProvider extends angular.IServiceProvider { From c3b544905994200debd3b5a6b5734a71c5436f4a Mon Sep 17 00:00:00 2001 From: catbusstop Date: Wed, 15 Jul 2015 14:39:26 +0100 Subject: [PATCH 15/84] Fixing slickgrid getItemMetadata Added optional index parameter to allow for row formatting --- slickgrid/SlickGrid.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slickgrid/SlickGrid.d.ts b/slickgrid/SlickGrid.d.ts index cfdd3c690..54686df9f 100644 --- a/slickgrid/SlickGrid.d.ts +++ b/slickgrid/SlickGrid.d.ts @@ -1557,7 +1557,7 @@ declare module Slick { public getLength(): number; public getItem(index: number): T; - public getItemMetadata(): void; + public getItemMetadata(index?: number): void; public onRowCountChanged: Slick.Event; public onRowsChanged: Slick.Event; From e39fec20653e110c960b2956a9ef6d1644117865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20D=C3=BC=C3=BCna?= Date: Wed, 15 Jul 2015 16:55:42 +0300 Subject: [PATCH 16/84] Easy-api-request --- easy-api-request/easy-api-request-tests.ts | 44 ++++++++ easy-api-request/easy-api-request.d.ts | 115 +++++++++++++++++++++ 2 files changed, 159 insertions(+) create mode 100644 easy-api-request/easy-api-request-tests.ts create mode 100644 easy-api-request/easy-api-request.d.ts diff --git a/easy-api-request/easy-api-request-tests.ts b/easy-api-request/easy-api-request-tests.ts new file mode 100644 index 000000000..38a4b68dd --- /dev/null +++ b/easy-api-request/easy-api-request-tests.ts @@ -0,0 +1,44 @@ +/** + * Created by karl on 14/07/15. + */ + +/// +/// + +import express = require('express'); +import APIRequest = require('easy-api-request'); + +APIRequest.create({ + name: 'testAPI', + config: { + url: 'http://example.com' + } +}); + +var app = express(); + +app.get('/', function (req:any, res:express.Response) { + var rMaker = req.testAPI; + var r = rMaker(); + r.get('/', function (err, resp) { + if(err) { + console.error(err); + } + res.json(err || resp); + }); +}); + +app.get('/', function (req:any, res:express.Response) { + var rMaker = req.testAPI; + var r = rMaker(); + r.get('/') + .then(function (resp) { + res.json(resp); + }) + .catch(function (err){ + if(err) { + console.error(err); + } + res.json(err); + }); +}); diff --git a/easy-api-request/easy-api-request.d.ts b/easy-api-request/easy-api-request.d.ts new file mode 100644 index 000000000..d3152e49d --- /dev/null +++ b/easy-api-request/easy-api-request.d.ts @@ -0,0 +1,115 @@ +// Type definitions for easy-api-request +// Project: https://github.com/DeadAlready/easy-api-request +// Definitions by: Karl Düüna +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// +/// +/// + +declare module "easy-api-request" { + import stream = require('stream'); + import http = require('http'); + import request = require('request'); + import bunyan = require('bunyan'); + import express = require('express'); + + export function create(opts: { + name: any; + config: { + url: string; + internal?: boolean; + headers?: string[]; + cookies?: string[]; + replyCookies?: string[]; + jSend?: boolean; + opts?: Object; + }; + }): void; + + import Q = require('q'); + interface Result { + response: http.IncomingMessage; + body: any; + err?: any; + data?: any; + } + class BaseRequest { + protected base: request.Request; + protected req: express.Request; + protected log: bunyan.Logger; + protected replyCookies: string[]; + protected jSend: boolean; + constructor(opts: any); + _parseOptions(args: IArguments, type: string): { + opts: any; + cb: any; + }; + _do(args: IArguments, type?: string): any; + _request(opts?: any, cb?:any): any; + + get(url?: any, opts?: any, cb?: any): any; + post(url?: any, opts?: any, cb?: any): any; + patch(url?: any, opts?: any, cb?: any): any; + del(url?: any, opts?: any, cb?: any): any; + } + + class StreamRequest extends BaseRequest { + _request(opts: Object): stream.Stream; + + get(url: string, params: Object): stream.Stream; + get(opts: Object): stream.Stream; + get(url: string): stream.Stream; + + post(url: string, params: Object): stream.Stream; + post(opts: Object): stream.Stream; + post(url: string): stream.Stream; + + patch(url: string, params: Object): stream.Stream; + patch(opts: Object): stream.Stream; + patch(url: string): stream.Stream; + + del(url: string, params: Object): stream.Stream; + del(opts: Object): stream.Stream; + del(url: string): stream.Stream; + } + + class CBPromiseRequest extends BaseRequest { + _request(opts: Object): stream.Stream; + + get(url: string, params: Object, cb:(err?:any, resp?: Result) => void): void; + get(url: string, cb:(err?:any, resp?: Result) => void): void; + get(opts: Object, cb:(err?:any, resp?: Result) => void): void; + get(url: string, params: Object): Q.Promise; + get(opts: Object): Q.Promise; + get(url: string): Q.Promise; + + post(url: string, params: Object, cb:(err?:any, resp?: Result) => void): void; + post(url: string, cb:(err?:any, resp?: Result) => void): void; + post(opts: Object, cb:(err?:any, resp?: Result) => void): void; + post(url: string, params: Object): Q.Promise; + post(opts: Object): Q.Promise; + post(url: string): Q.Promise; + + patch(url: string, params: Object, cb:(err?:any, resp?: Result) => void): void; + patch(url: string, cb:(err?:any, resp?: Result) => void): void; + patch(opts: Object, cb:(err?:any, resp?: Result) => void): void; + patch(url: string, params: Object): Q.Promise; + patch(opts: Object): Q.Promise; + patch(url: string): Q.Promise; + + del(url: string, params: Object, cb:(err?:any, resp?: Result) => void): void; + del(url: string, cb:(err?:any, resp?: Result) => void): void; + del(opts: Object, cb:(err?:any, resp?: Result) => void): void; + del(url: string, params: Object): Q.Promise; + del(opts: Object): Q.Promise; + del(url: string): Q.Promise; + } + + export interface RequestMaker { + (): CBPromiseRequest; + (stream: boolean): StreamRequest | CBPromiseRequest; + } +} From c5f81c00fba471a648ea6391b3954b620729cb75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20D=C3=BC=C3=BCna?= Date: Wed, 15 Jul 2015 16:59:26 +0300 Subject: [PATCH 17/84] Fix casing --- easy-api-request/easy-api-request.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easy-api-request/easy-api-request.d.ts b/easy-api-request/easy-api-request.d.ts index d3152e49d..61bc79142 100644 --- a/easy-api-request/easy-api-request.d.ts +++ b/easy-api-request/easy-api-request.d.ts @@ -3,7 +3,7 @@ // Definitions by: Karl Düüna // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// /// /// /// From 8d9ed6686dca2bcf0b0f5945c1c6c734273acfde Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Thu, 16 Jul 2015 09:09:31 +1200 Subject: [PATCH 18/84] Added support for query (docs: https://github.com/pgte/nock#specifying-request-query-string) --- nock/nock-tests.ts | 3 +++ nock/nock.d.ts | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nock/nock-tests.ts b/nock/nock-tests.ts index 00227dfaf..bc936a05b 100644 --- a/nock/nock-tests.ts +++ b/nock/nock-tests.ts @@ -45,6 +45,9 @@ inst = inst.merge(str, data); inst = inst.merge(str, obj); inst = inst.merge(str, regex); +inst = inst.query(obj); +inst = inst.query(bool); + inst = inst.intercept(str, str); inst = inst.intercept(str, str, str); inst = inst.intercept(str, str, obj); diff --git a/nock/nock.d.ts b/nock/nock.d.ts index b6803ca89..3cd92e65a 100644 --- a/nock/nock.d.ts +++ b/nock/nock.d.ts @@ -45,6 +45,9 @@ declare module "nock" { merge(path: string, data?: Object): Scope; merge(path: string, regex?: RegExp): Scope; + query(params: any): Scope; + query(acceptAnyParams: boolean): Scope; + intercept(path: string, verb: string, body?: string, options?: any): Scope; intercept(path: string, verb: string, body?: Object, options?: any): Scope; intercept(path: string, verb: string, body?: RegExp, options?: any): Scope; @@ -55,7 +58,7 @@ declare module "nock" { replyWithFile(responseCode: number, fileName: string): Scope; defaultReplyHeaders(headers: Object): Scope; - + matchHeader(name: string, value: string): Scope; matchHeader(name: string, regex: RegExp): Scope; matchHeader(name: string, fn: (value: string) => boolean): Scope; From c8bcc84a58cb2d0b830780d5a564d6c11d565b31 Mon Sep 17 00:00:00 2001 From: PatrickJS Date: Wed, 15 Jul 2015 15:45:26 -0700 Subject: [PATCH 19/84] fix(browserify): missing options in function calls source code shows options object https://github.com/substack/node-browserify/blob/master/index.js#L267 --- browserify/browserify.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/browserify/browserify.d.ts b/browserify/browserify.d.ts index 2289d2165..c301df51e 100644 --- a/browserify/browserify.d.ts +++ b/browserify/browserify.d.ts @@ -6,7 +6,7 @@ /// interface BrowserifyObject extends NodeJS.EventEmitter { - add(file:string): BrowserifyObject; + add(file:string, opts?:any): BrowserifyObject; require(file:string, opts?:{ expose: string; }): BrowserifyObject; @@ -18,10 +18,10 @@ interface BrowserifyObject extends NodeJS.EventEmitter { insertGlobalVars?: any; }, cb?:(err:any, src:any) => void): NodeJS.ReadableStream; - external(file:string): BrowserifyObject; - ignore(file:string): BrowserifyObject; - transform(tr:string): BrowserifyObject; - transform(tr:Function): BrowserifyObject; + external(file:string, opts?:any): BrowserifyObject; + ignore(file:string, opts?:any): BrowserifyObject; + transform(tr:string, opts?:any): BrowserifyObject; + transform(tr:Function, opts?:any): BrowserifyObject; plugin(plugin:string, opts?:any): BrowserifyObject; plugin(plugin:Function, opts?:any): BrowserifyObject; } From e95209b2433658b056d31d20ca0f8ad9cb7b2209 Mon Sep 17 00:00:00 2001 From: Victor Pineda Gonzalez Date: Wed, 15 Jul 2015 18:03:01 -0500 Subject: [PATCH 20/84] node() function will return DOM Node --- d3/d3.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index a5b908cbe..37719a5f4 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -386,7 +386,7 @@ declare module d3 { /** * Returns the first non-null element in the selection, or null otherwise. */ - node(): EventTarget; + node(): Node; /** * Returns the total number of elements in the selection. From 5576e902151dc027bcf308728a46817a7ee4248c Mon Sep 17 00:00:00 2001 From: Arjun Mathur Date: Wed, 15 Jul 2015 16:10:32 -0700 Subject: [PATCH 21/84] Fixed name of variable for browser global context --- deep-diff/deep-diff.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deep-diff/deep-diff.d.ts b/deep-diff/deep-diff.d.ts index 93e99f789..4242731f2 100644 --- a/deep-diff/deep-diff.d.ts +++ b/deep-diff/deep-diff.d.ts @@ -34,7 +34,7 @@ declare module deepDiff { } } -declare var diff: deepDiff.IDeepDiff; +declare var DeepDiff: deepDiff.IDeepDiff; declare module "deep-diff" { var diff: deepDiff.IDeepDiff; From f91aabedc10bb94dd657d550f858af68077bf527 Mon Sep 17 00:00:00 2001 From: Andrew Archibald Date: Wed, 15 Jul 2015 17:08:47 -0700 Subject: [PATCH 22/84] Started bardjs tests; Made some bardjs types more clear. --- bardjs/bardjs-tests.ts | 158 +++++++++++++++++++++++++++++++++++++++++ bardjs/bardjs.d.ts | 6 +- 2 files changed, 161 insertions(+), 3 deletions(-) create mode 100644 bardjs/bardjs-tests.ts diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts new file mode 100644 index 000000000..9243c1008 --- /dev/null +++ b/bardjs/bardjs-tests.ts @@ -0,0 +1,158 @@ +/// +/// +/// +/// +/// + +var expect = chai.expect, assert = chai.assert; + +function someFunction() { } +var someObject = { }; +var myService; + +/* + * bard.$httpBackend + */ +var myService; + +beforeEach(module(bard.$httpBackend, 'app')); + +beforeEach(inject(function(_myService_) { + myService = _myService_; +})); + +it('should return valid data', function(done) { + myService.remoteCall() + .then(function(data) { + expect(data).to.exist; + }) + .then(done, done); + + $rootScope.$apply; // because not using bard.$q, must flush the $http and $q queues +}); + +/* + * bard.$q + */ +beforeEach(module(bard.$q, bard.$httpBackend, 'app')); + +beforeEach(inject(function(_myService_) { + myService = _myService_; +})); + +it('should return valid data', (done) => { + myService.remoteCall() + .then((data) => { + expect(data).to.exist; + }) + .then(done, done); + + // no need to flush +}); + +/* + * bard.addGlobals + */ + +/* + * bard.appModule + */ +beforeEach(bard.appModule('myModule')); + +beforeEach(bard.appModule('myModule', someFunction, someObject)); + +/* + * bard.assertFail + */ + +/* + * bard.asyncModule + */ +beforeEach(bard.asyncModule('app')); + +beforeEach(bard.asyncModule('myModule', someFunction, someObject)); + +/* + * bard.debugging + */ + +/* + * bard.fakeLogger + */ +beforeEach(module('myModule', bard.fakeLogger)); +beforeEach(bard.appModule('myModule', bard.fakeLogger)); +beforeEach(bard.asyncModule('myModule', bard.fakeLogger)); + +/* + * bard.fakeRouteHelperProvider + */ +beforeEach(module('myModule', bard.fakeRouteHelperProvider)); +beforeEach(bard.appModule('myModule', bard.fakeRouteHelperProvider)); +beforeEach(bard.asyncModule('myModule', bard.fakeRouteHelperProvider)); + +/* + * bard.fakeRouteProvider + */ +beforeEach(module('myModule', bard.fakeRouteProvider)); +beforeEach(bard.appModule('myModule', bard.fakeRouteProvider)); +beforeEach(bard.asyncModule('myModule', bard.fakeRouteProvider)); + +/* + * bard.fakeStateProvider + */ +beforeEach(module('myModule', bard.fakeStateProvider)); +beforeEach(bard.appModule('myModule', bard.fakeStateProvider)); +beforeEach(bard.asyncModule('myModule', bard.fakeStateProvider)); + +/* + * bard.fakeToastr + */ +beforeEach(module('myModule', bard.fakeToastr)); +beforeEach(bard.appModule('myModule', bard.fakeToastr)); +beforeEach(bard.asyncModule('myModule', bard.fakeToastr)); + +/* + * bard.inject + */ +beforeEach(() => bard.inject(this, '$controller', '$log', '$q', '$rootScope', 'dataservice')); + +/* + * bard.log + */ +bard.log('We got the goods'); + +/* + * bard.mochaRunnerListener + */ + +/* + * bard.mockService + */ +var controller; +var avengers = [{name: 'Captain America' /* ... */}]; +var $controller, $q, $rootScope, dataservice; + +beforeEach(function() { + bard.appModule('app.avengers'); + bard.inject(this, '$controller', '$q', '$rootScope', 'dataservice'); + + bard.mockService(dataservice, { + getAvengers: $q.when(avengers), + _default: $q.when([]) + }); + + controller = $controller('Avengers'); + $rootScope.$apply(); +}); + +/* + * bard.replaceAccentChars + */ + +/* + * bard.verifyNoOutstandingHttpRequests + */ + +/* + * bard.wrapWithDone + */ diff --git a/bardjs/bardjs.d.ts b/bardjs/bardjs.d.ts index e0288825f..3d3ad5f22 100644 --- a/bardjs/bardjs.d.ts +++ b/bardjs/bardjs.d.ts @@ -47,7 +47,7 @@ declare module bard { * DO NOT USE IF YOU NEED THE REAL ROUTER SERVICES! * Fall back to `angular.mock.module(...)` or just `module(...)` */ - function appModule(...args: any[]): any; + function appModule(...fns: (string | Function | Object)[]): () => void; /** * Assert a failure in mocha, without condition @@ -59,7 +59,7 @@ declare module bard { * Also adds fakeLogger to the end of the definition * Use it as you would the ngMocks#module method */ - function asyncModule(...args: any[]): any; + function asyncModule(...fns: (string | Function | Object)[]): () => void; /** * Get or set bard debugging flag @@ -114,7 +114,7 @@ declare module bard { * [strings] - same string array you'd use to set fn.$inject * (...string) - string arguments turned into a string array */ - function inject(context?: any, ...args: string[]): void; + function inject(context?: Function, ...args: string[]): void; /** * Write to console if bard debugging flag is on From e28aef1c025ec1f6377cc1a4cbba5ac256e8840a Mon Sep 17 00:00:00 2001 From: Andrew Archibald Date: Wed, 15 Jul 2015 21:35:55 -0700 Subject: [PATCH 23/84] Fixed some issues with bard tests --- bardjs/bardjs-tests.ts | 372 +++++++++++++++++++++++++---------------- 1 file changed, 226 insertions(+), 146 deletions(-) diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts index 9243c1008..d15cc3d18 100644 --- a/bardjs/bardjs-tests.ts +++ b/bardjs/bardjs-tests.ts @@ -4,155 +4,235 @@ /// /// -var expect = chai.expect, assert = chai.assert; +var expect = chai.expect, + assert = chai.assert; -function someFunction() { } -var someObject = { }; -var myService; - -/* - * bard.$httpBackend - */ -var myService; - -beforeEach(module(bard.$httpBackend, 'app')); - -beforeEach(inject(function(_myService_) { - myService = _myService_; -})); - -it('should return valid data', function(done) { - myService.remoteCall() - .then(function(data) { - expect(data).to.exist; - }) - .then(done, done); - - $rootScope.$apply; // because not using bard.$q, must flush the $http and $q queues -}); - -/* - * bard.$q - */ -beforeEach(module(bard.$q, bard.$httpBackend, 'app')); - -beforeEach(inject(function(_myService_) { - myService = _myService_; -})); - -it('should return valid data', (done) => { - myService.remoteCall() - .then((data) => { - expect(data).to.exist; - }) - .then(done, done); - - // no need to flush -}); - -/* - * bard.addGlobals - */ - -/* - * bard.appModule - */ -beforeEach(bard.appModule('myModule')); - -beforeEach(bard.appModule('myModule', someFunction, someObject)); - -/* - * bard.assertFail - */ - -/* - * bard.asyncModule - */ -beforeEach(bard.asyncModule('app')); - -beforeEach(bard.asyncModule('myModule', someFunction, someObject)); - -/* - * bard.debugging - */ - -/* - * bard.fakeLogger - */ -beforeEach(module('myModule', bard.fakeLogger)); -beforeEach(bard.appModule('myModule', bard.fakeLogger)); -beforeEach(bard.asyncModule('myModule', bard.fakeLogger)); - -/* - * bard.fakeRouteHelperProvider - */ -beforeEach(module('myModule', bard.fakeRouteHelperProvider)); -beforeEach(bard.appModule('myModule', bard.fakeRouteHelperProvider)); -beforeEach(bard.asyncModule('myModule', bard.fakeRouteHelperProvider)); - -/* - * bard.fakeRouteProvider - */ -beforeEach(module('myModule', bard.fakeRouteProvider)); -beforeEach(bard.appModule('myModule', bard.fakeRouteProvider)); -beforeEach(bard.asyncModule('myModule', bard.fakeRouteProvider)); - -/* - * bard.fakeStateProvider - */ -beforeEach(module('myModule', bard.fakeStateProvider)); -beforeEach(bard.appModule('myModule', bard.fakeStateProvider)); -beforeEach(bard.asyncModule('myModule', bard.fakeStateProvider)); - -/* - * bard.fakeToastr - */ -beforeEach(module('myModule', bard.fakeToastr)); -beforeEach(bard.appModule('myModule', bard.fakeToastr)); -beforeEach(bard.asyncModule('myModule', bard.fakeToastr)); - -/* - * bard.inject - */ -beforeEach(() => bard.inject(this, '$controller', '$log', '$q', '$rootScope', 'dataservice')); - -/* - * bard.log - */ -bard.log('We got the goods'); - -/* - * bard.mochaRunnerListener - */ - -/* - * bard.mockService - */ -var controller; -var avengers = [{name: 'Captain America' /* ... */}]; -var $controller, $q, $rootScope, dataservice; - -beforeEach(function() { - bard.appModule('app.avengers'); - bard.inject(this, '$controller', '$q', '$rootScope', 'dataservice'); - - bard.mockService(dataservice, { - getAvengers: $q.when(avengers), - _default: $q.when([]) +class MyService { + static $inject = ['$q']; + + constructor(private $q: angular.IQService) {} + + remoteCall(): angular.IPromise { + return new this.$q((resolve, reject) => { + resolve('Here is some data'); }); + } +} - controller = $controller('Avengers'); - $rootScope.$apply(); -}); +function myService($q: angular.IQService) { + return new MyService($q); +} -/* - * bard.replaceAccentChars - */ +angular + .module('tests') + .service('myService', myService); -/* - * bard.verifyNoOutstandingHttpRequests - */ -/* - * bard.wrapWithDone - */ + +module bardTests { + /* + * bard.$httpBackend + */ + function test_$httpBackend() { + var myService: MyService; + var $rootScope: any; + + beforeEach(module(bard.$httpBackend, 'app')); + + beforeEach(inject(function(_myService_: MyService, _$rootScope_: any) { + myService = _myService_; + $rootScope = _$rootScope_; + })); + + it('should return valid data', function(done) { + myService.remoteCall() + .then(function(data) { + expect(data).to.exist; + }) + .then(done, done); + + $rootScope.$apply; // because not using bard.$q, must flush the $http and $q queues + }); + } + + /* + * bard.$q + */ + function test_$q() { + var myService: MyService; + + beforeEach(module(bard.$q, bard.$httpBackend, 'app')); + + beforeEach(inject(function(_myService_) { + myService = _myService_; + })); + + it('should return valid data', (done) => { + myService.remoteCall() + .then((data) => { + expect(data).to.exist; + }) + .then(done, done); + + // no need to flush + }); + } + + /* + * bard.addGlobals + */ + function test_addGlobals() { + + } + + /* + * bard.appModule + */ + function test_appModule() { + beforeEach(bard.appModule('myModule')); + //// + beforeEach(bard.appModule('myModule', function() {}, {})); + } + + /* + * bard.assertFail + */ + function test_assertFail() { + + } + + /* + * bard.asyncModule + */ + function test_asyncModule() { + beforeEach(bard.asyncModule('app')); + //// + beforeEach(bard.asyncModule('myModule', function() {}, {})); + } + + /* + * bard.debugging + */ + function test_debugging() { + + } + + /* + * bard.fakeLogger + */ + function test_fakeLogger() { + beforeEach(module('myModule', bard.fakeLogger)); + //// + beforeEach(bard.appModule('myModule', bard.fakeLogger)); + //// + beforeEach(bard.asyncModule('myModule', bard.fakeLogger)); + } + + /* + * bard.fakeRouteHelperProvider + */ + function test_fakeRouteHelperProvider() { + beforeEach(module('myModule', bard.fakeRouteHelperProvider)); + //// + beforeEach(bard.appModule('myModule', bard.fakeRouteHelperProvider)); + //// + beforeEach(bard.asyncModule('myModule', bard.fakeRouteHelperProvider)); + } + + /* + * bard.fakeRouteProvider + */ + function test_fakeRouteProvider() { + beforeEach(module('myModule', bard.fakeRouteProvider)); + //// + beforeEach(bard.appModule('myModule', bard.fakeRouteProvider)); + //// + beforeEach(bard.asyncModule('myModule', bard.fakeRouteProvider)); + } + + /* + * bard.fakeStateProvider + */ + function test_fakeStateProvider() { + beforeEach(module('myModule', bard.fakeStateProvider)); + //// + beforeEach(bard.appModule('myModule', bard.fakeStateProvider)); + //// + beforeEach(bard.asyncModule('myModule', bard.fakeStateProvider)); + } + + /* + * bard.fakeToastr + */ + function test_fakeToastr() { + beforeEach(module('myModule', bard.fakeToastr)); + //// + beforeEach(bard.appModule('myModule', bard.fakeToastr)); + //// + beforeEach(bard.asyncModule('myModule', bard.fakeToastr)); + } + + /* + * bard.inject + */ + function test_inject() { + beforeEach(() => bard.inject(this, '$controller', '$log', '$q', '$rootScope', 'dataservice')); + } + + /* + * bard.log + */ + function test_log() { + bard.log('We got the goods'); + } + + /* + * bard.mochaRunnerListener + */ + function test_mochaRunnerListener() { + + } + + /* + * bard.mockService + */ + function test_mockService() { + var controller; + var avengers = [{name: 'Captain America' /* ... */}]; + var $controller, $q, $rootScope, dataservice; + + beforeEach(function() { + bard.appModule('app.avengers'); + bard.inject(this, '$controller', '$q', '$rootScope', 'dataservice'); + + bard.mockService(dataservice, { + getAvengers: $q.when(avengers), + _default: $q.when([]) + }); + + controller = $controller('Avengers'); + $rootScope.$apply(); + }); + } + + /* + * bard.replaceAccentChars + */ + function test_replaceAccentChars() { + + } + + /* + * bard.verifyNoOutstandingHttpRequests + */ + function test_verifyNoOutstandingHttpRequests() { + + } + + /* + * bard.wrapWithDone + */ + function test_wrapWithDone() { + + } +} \ No newline at end of file From e80350d66819f909e50bbccef3e74f6205fb95a6 Mon Sep 17 00:00:00 2001 From: Andrew Archibald Date: Wed, 15 Jul 2015 21:51:59 -0700 Subject: [PATCH 24/84] Fixed some bardjs implicit 'any' types --- bardjs/bardjs-tests.ts | 67 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts index d15cc3d18..8083fd3f2 100644 --- a/bardjs/bardjs-tests.ts +++ b/bardjs/bardjs-tests.ts @@ -4,42 +4,40 @@ /// /// -var expect = chai.expect, - assert = chai.assert; - -class MyService { - static $inject = ['$q']; - - constructor(private $q: angular.IQService) {} - - remoteCall(): angular.IPromise { - return new this.$q((resolve, reject) => { - resolve('Here is some data'); - }); - } -} - -function myService($q: angular.IQService) { - return new MyService($q); -} - -angular - .module('tests') - .service('myService', myService); - - - module bardTests { + var expect = chai.expect, + assert = chai.assert; + + class MyService { + static $inject = ['$q']; + + constructor(private $q: angular.IQService) {} + + remoteCall(): angular.IPromise { + return new this.$q((resolve, reject) => { + resolve(['Hello', 'World']); + }); + } + } + + function myService($q: angular.IQService) { + return new MyService($q); + } + + angular + .module('bardTests') + .service('myService', myService); + /* * bard.$httpBackend */ function test_$httpBackend() { var myService: MyService; - var $rootScope: any; + var $rootScope: angular.IRootScopeService; beforeEach(module(bard.$httpBackend, 'app')); - beforeEach(inject(function(_myService_: MyService, _$rootScope_: any) { + beforeEach(inject(function(_myService_: MyService, _$rootScope_: angular.IRootScopeService) { myService = _myService_; $rootScope = _$rootScope_; })); @@ -51,7 +49,7 @@ module bardTests { }) .then(done, done); - $rootScope.$apply; // because not using bard.$q, must flush the $http and $q queues + $rootScope.$apply; // Because not using bard.$q, must flush the $http and $q queues }); } @@ -63,7 +61,7 @@ module bardTests { beforeEach(module(bard.$q, bard.$httpBackend, 'app')); - beforeEach(inject(function(_myService_) { + beforeEach(inject(function(_myService_: MyService) { myService = _myService_; })); @@ -74,7 +72,7 @@ module bardTests { }) .then(done, done); - // no need to flush + // No need to flush }); } @@ -176,7 +174,7 @@ module bardTests { * bard.inject */ function test_inject() { - beforeEach(() => bard.inject(this, '$controller', '$log', '$q', '$rootScope', 'dataservice')); + beforeEach(() => bard.inject(this, '$controller', '$log', '$q', '$rootScope', 'myService')); } /* @@ -199,11 +197,14 @@ module bardTests { function test_mockService() { var controller; var avengers = [{name: 'Captain America' /* ... */}]; - var $controller, $q, $rootScope, dataservice; + var $controller: angular.IControllerService, + $q: angular.IQService, + $rootScope: angular.IRootScopeService, + myService: MyService; beforeEach(function() { bard.appModule('app.avengers'); - bard.inject(this, '$controller', '$q', '$rootScope', 'dataservice'); + bard.inject(this, '$controller', '$q', '$rootScope', 'myService'); bard.mockService(dataservice, { getAvengers: $q.when(avengers), From 6de3f1f79c3470d02f41f9319839879c74b1328b Mon Sep 17 00:00:00 2001 From: Andrew Archibald Date: Wed, 15 Jul 2015 22:19:10 -0700 Subject: [PATCH 25/84] Added more tests to bardjs-tests.ts --- bardjs/bardjs-tests.ts | 462 ++++++++++++++++++++++------------------- 1 file changed, 253 insertions(+), 209 deletions(-) diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts index 8083fd3f2..3eedd970b 100644 --- a/bardjs/bardjs-tests.ts +++ b/bardjs/bardjs-tests.ts @@ -5,235 +5,279 @@ /// module bardTests { - var expect = chai.expect, - assert = chai.assert; + var expect = chai.expect, + assert = chai.assert; - class MyService { - static $inject = ['$q']; + class MyService { + static $inject = ['$q']; - constructor(private $q: angular.IQService) {} + constructor(private $q: angular.IQService) {} - remoteCall(): angular.IPromise { - return new this.$q((resolve, reject) => { - resolve(['Hello', 'World']); - }); + remoteCall(): angular.IPromise { + return new this.$q((resolve, reject) => { + resolve(['Hello', 'World']); + }); + } } - } - function myService($q: angular.IQService) { - return new MyService($q); - } + function myService($q: angular.IQService) { + return new MyService($q); + } - angular - .module('bardTests') - .service('myService', myService); + class MyController { + myProperty: string; + } - /* - * bard.$httpBackend - */ - function test_$httpBackend() { - var myService: MyService; - var $rootScope: angular.IRootScopeService; + angular + .module('myModule') + .service('myService', myService) + .controller('MyController', MyController); - beforeEach(module(bard.$httpBackend, 'app')); + /* + * bard.$httpBackend + */ + function test_$httpBackend() { + var myService: MyService; + var $rootScope: angular.IRootScopeService; - beforeEach(inject(function(_myService_: MyService, _$rootScope_: angular.IRootScopeService) { - myService = _myService_; - $rootScope = _$rootScope_; - })); + beforeEach(module(bard.$httpBackend, 'myModule')); - it('should return valid data', function(done) { - myService.remoteCall() - .then(function(data) { - expect(data).to.exist; + beforeEach(inject(function(_myService_: MyService, _$rootScope_: angular.IRootScopeService) { + myService = _myService_; + $rootScope = _$rootScope_; + })); + + it('should return valid data', function(done) { + myService.remoteCall() + .then(function(data) { + expect(data).to.exist; + }) + .then(done, done); + + $rootScope.$apply; // Because not using bard.$q, must flush the $http and $q queues + }); + } + + /* + * bard.$q + */ + function test_$q() { + var myService: MyService; + + beforeEach(module(bard.$q, bard.$httpBackend, 'myModule')); + + beforeEach(inject(function(_myService_: MyService) { + myService = _myService_; + })); + + it('should return valid data', (done) => { + myService.remoteCall() + .then((data) => { + expect(data).to.exist; + }) + .then(done, done); + + // No need to flush + }); + } + + /* + * bard.addGlobals + */ + function test_addGlobals() { + describe('someting', function() { + var ctx = this; + + it('should work', function() { + var bar = 'bar'; + bard.addGlobals(this, 'foo'); // where `this` is the spec context + bard.addGlobals(this, 'foo', bar); + bard.addGlobals.bind(this)('foo', 'bar'); + bard.addGlobals(ctx, ['foo', 'bar']) // where ctx is the spec context + }); }) - .then(done, done); + } - $rootScope.$apply; // Because not using bard.$q, must flush the $http and $q queues - }); - } - - /* - * bard.$q - */ - function test_$q() { - var myService: MyService; + /* + * bard.appModule + */ + function test_appModule() { + beforeEach(bard.appModule('myModule')); + //// + beforeEach(bard.appModule('myModule', function() {}, {})); + } - beforeEach(module(bard.$q, bard.$httpBackend, 'app')); + /* + * bard.assertFail + */ + function test_assertFail() { + bard.assertFail('FAIL!'); + } - beforeEach(inject(function(_myService_: MyService) { - myService = _myService_; - })); + /* + * bard.asyncModule + */ + function test_asyncModule() { + beforeEach(bard.asyncModule('myModule')); + //// + beforeEach(bard.asyncModule('myModule', function() {}, {})); + } - it('should return valid data', (done) => { - myService.remoteCall() - .then((data) => { - expect(data).to.exist; - }) - .then(done, done); + /* + * bard.debugging + */ + function test_debugging() { + console.log( + bard.debugging(true), // should be true + bard.debugging(false), // should be false + bard.debugging(42), // should be true + bard.debugging(''), // should be false + bard.debugging() // should be false + ); + } - // No need to flush - }); - } - - /* - * bard.addGlobals - */ - function test_addGlobals() { - - } + /* + * bard.fakeLogger + */ + function test_fakeLogger() { + beforeEach(module('myModule', bard.fakeLogger)); + //// + beforeEach(bard.appModule('myModule', bard.fakeLogger)); + //// + beforeEach(bard.asyncModule('myModule', bard.fakeLogger)); + } - /* - * bard.appModule - */ - function test_appModule() { - beforeEach(bard.appModule('myModule')); - //// - beforeEach(bard.appModule('myModule', function() {}, {})); - } + /* + * bard.fakeRouteHelperProvider + */ + function test_fakeRouteHelperProvider() { + beforeEach(module('myModule', bard.fakeRouteHelperProvider)); + //// + beforeEach(bard.appModule('myModule', bard.fakeRouteHelperProvider)); + //// + beforeEach(bard.asyncModule('myModule', bard.fakeRouteHelperProvider)); + } - /* - * bard.assertFail - */ - function test_assertFail() { - - } + /* + * bard.fakeRouteProvider + */ + function test_fakeRouteProvider() { + beforeEach(module('myModule', bard.fakeRouteProvider)); + //// + beforeEach(bard.appModule('myModule', bard.fakeRouteProvider)); + //// + beforeEach(bard.asyncModule('myModule', bard.fakeRouteProvider)); + } - /* - * bard.asyncModule - */ - function test_asyncModule() { - beforeEach(bard.asyncModule('app')); - //// - beforeEach(bard.asyncModule('myModule', function() {}, {})); - } - - /* - * bard.debugging - */ - function test_debugging() { - - } - - /* - * bard.fakeLogger - */ - function test_fakeLogger() { - beforeEach(module('myModule', bard.fakeLogger)); - //// - beforeEach(bard.appModule('myModule', bard.fakeLogger)); - //// - beforeEach(bard.asyncModule('myModule', bard.fakeLogger)); - } - - /* - * bard.fakeRouteHelperProvider - */ - function test_fakeRouteHelperProvider() { - beforeEach(module('myModule', bard.fakeRouteHelperProvider)); - //// - beforeEach(bard.appModule('myModule', bard.fakeRouteHelperProvider)); - //// - beforeEach(bard.asyncModule('myModule', bard.fakeRouteHelperProvider)); - } - - /* - * bard.fakeRouteProvider - */ - function test_fakeRouteProvider() { - beforeEach(module('myModule', bard.fakeRouteProvider)); - //// - beforeEach(bard.appModule('myModule', bard.fakeRouteProvider)); - //// - beforeEach(bard.asyncModule('myModule', bard.fakeRouteProvider)); - } - - /* - * bard.fakeStateProvider - */ - function test_fakeStateProvider() { - beforeEach(module('myModule', bard.fakeStateProvider)); - //// - beforeEach(bard.appModule('myModule', bard.fakeStateProvider)); - //// - beforeEach(bard.asyncModule('myModule', bard.fakeStateProvider)); - } - - /* - * bard.fakeToastr - */ - function test_fakeToastr() { - beforeEach(module('myModule', bard.fakeToastr)); - //// - beforeEach(bard.appModule('myModule', bard.fakeToastr)); - //// - beforeEach(bard.asyncModule('myModule', bard.fakeToastr)); - } - - /* - * bard.inject - */ - function test_inject() { - beforeEach(() => bard.inject(this, '$controller', '$log', '$q', '$rootScope', 'myService')); - } - - /* - * bard.log - */ - function test_log() { - bard.log('We got the goods'); - } - - /* - * bard.mochaRunnerListener - */ - function test_mochaRunnerListener() { - - } - - /* - * bard.mockService - */ - function test_mockService() { - var controller; - var avengers = [{name: 'Captain America' /* ... */}]; - var $controller: angular.IControllerService, - $q: angular.IQService, - $rootScope: angular.IRootScopeService, - myService: MyService; + /* + * bard.fakeStateProvider + */ + function test_fakeStateProvider() { + beforeEach(module('myModule', bard.fakeStateProvider)); + //// + beforeEach(bard.appModule('myModule', bard.fakeStateProvider)); + //// + beforeEach(bard.asyncModule('myModule', bard.fakeStateProvider)); + } - beforeEach(function() { - bard.appModule('app.avengers'); - bard.inject(this, '$controller', '$q', '$rootScope', 'myService'); + /* + * bard.fakeToastr + */ + function test_fakeToastr() { + beforeEach(module('myModule', bard.fakeToastr)); + //// + beforeEach(bard.appModule('myModule', bard.fakeToastr)); + //// + beforeEach(bard.asyncModule('myModule', bard.fakeToastr)); + } - bard.mockService(dataservice, { - getAvengers: $q.when(avengers), - _default: $q.when([]) - }); + /* + * bard.inject + */ + function test_inject() { + beforeEach(() => bard.inject(this, '$controller', '$log', '$q', '$rootScope', 'myService')); + } - controller = $controller('Avengers'); - $rootScope.$apply(); - }); - } - - /* - * bard.replaceAccentChars - */ - function test_replaceAccentChars() { - - } - - /* - * bard.verifyNoOutstandingHttpRequests - */ - function test_verifyNoOutstandingHttpRequests() { - - } - - /* - * bard.wrapWithDone - */ - function test_wrapWithDone() { - - } + /* + * bard.log + */ + function test_log() { + bard.log('We got the goods'); + } + + /* + * bard.mochaRunnerListener + */ + function test_mochaRunnerListener() { + var runner = mocha.run(); + bard.mochaRunnerListener(runner); + } + + /* + * bard.mockService + */ + function test_mockService() { + var controller: MyController, + myArray = ['This', 'is', 'some', 'mocked', 'data']; + var $controller: angular.IControllerService, + $q: angular.IQService, + $rootScope: angular.IRootScopeService, + myService: MyService; + + beforeEach(function() { + bard.appModule('myModule'); + bard.inject(this, '$controller', '$q', '$rootScope', 'myService'); + + bard.mockService(myService, { + remoteCall: $q.when(myArray), + _default: $q.when([]) + }); + + controller = $controller('MyController'); + $rootScope.$apply(); + }); + } + + /* + * bard.replaceAccentChars + */ + function test_replaceAccentChars() { + console.log(bard.replaceAccentChars('àáâãäåèéêëìíîïòóôõöùúûüýÿ') === 'aaaaaaeeeeeeeeooooouuuuyy'); + } + + /* + * bard.verifyNoOutstandingHttpRequests + */ + function test_verifyNoOutstandingHttpRequests() { + var controller: MyController, + myArray = ['This', 'is', 'some', 'mocked', 'data']; + var $controller: angular.IControllerService, + $q: angular.IQService, + $rootScope: angular.IRootScopeService, + myService: MyService; + + beforeEach(function() { + bard.appModule('myModule'); + bard.inject(this, '$controller', '$q', '$rootScope', 'myService'); + + bard.mockService(myService, { + remoteCall: $q.when(myArray), + _default: $q.when([]) + }); + + controller = $controller('MyController'); + $rootScope.$apply(); + }); + + bard.verifyNoOutstandingHttpRequests(); + } + + /* + * bard.wrapWithDone + */ + function test_wrapWithDone() { + function callback() { console.log('Doing something...'); } + function done() { console.log('...Done'); } + bard.wrapWithDone(callback, done); + } } \ No newline at end of file From 3cf112bb6b9d85b9b931f8ff575b5ba3b10ed747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20D=C3=BC=C3=BCna?= Date: Thu, 16 Jul 2015 12:14:45 +0300 Subject: [PATCH 26/84] Easy-x-headers --- easy-x-headers/easy-x-headers-tests.ts | 16 ++++++++++++++++ easy-x-headers/easy-x-headers.d.ts | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 easy-x-headers/easy-x-headers-tests.ts create mode 100644 easy-x-headers/easy-x-headers.d.ts diff --git a/easy-x-headers/easy-x-headers-tests.ts b/easy-x-headers/easy-x-headers-tests.ts new file mode 100644 index 000000000..9a306ea6a --- /dev/null +++ b/easy-x-headers/easy-x-headers-tests.ts @@ -0,0 +1,16 @@ +/** + * Created by karl on 14/07/15. + */ + +/// +/// + +import express = require('express'); +import xHeaders = require('easy-x-headers'); + +var app = express(); +app.use(xHeaders.getMiddleware()); + +app.get('/', function (req, res) { + res.json(req.info); +}); diff --git a/easy-x-headers/easy-x-headers.d.ts b/easy-x-headers/easy-x-headers.d.ts new file mode 100644 index 000000000..c0a13d1a8 --- /dev/null +++ b/easy-x-headers/easy-x-headers.d.ts @@ -0,0 +1,18 @@ +// Type definitions for easy-x-headers +// Project: https://github.com/DeadAlready/easy-x-headers +// Definitions by: Karl Düüna +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Express { + export interface Request { + info: any; + } +} + +declare module "easy-x-headers" { + import express = require('express'); + + export function getMiddleware(): express.RequestHandler; +} From d79fffd2221b23cf286c668b0be7180c8b586954 Mon Sep 17 00:00:00 2001 From: Alwin Schoemaker Date: Thu, 16 Jul 2015 12:00:21 +0200 Subject: [PATCH 27/84] Added content param for IToastService.showSimple() This param was missing in the interface, but [according to the doc](https://github.com/angular/material/blob/master/src/components/toast/toast.js#L49) without it, it's rather useless. --- angular-material/angular-material.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 17f8328e1..aba83a86f 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -144,7 +144,7 @@ declare module angular.material { interface IToastService { show(optionsOrPreset: IToastOptions|IToastPreset): angular.IPromise; - showSimple(): angular.IPromise; + showSimple(content: string): angular.IPromise; simple(): ISimpleToastPreset; build(): IToastPreset; updateContent(): void; From abb3f318b878ba5277212e75284ccc3412d871bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20D=C3=BC=C3=BCna?= Date: Thu, 16 Jul 2015 13:07:49 +0300 Subject: [PATCH 28/84] easy-xapi-supertest --- .../easy-xapi-supertest-tests.ts | 27 +++++++++++++++++ easy-xapi-supertest/easy-xapi-supertest.d.ts | 29 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 easy-xapi-supertest/easy-xapi-supertest-tests.ts create mode 100644 easy-xapi-supertest/easy-xapi-supertest.d.ts diff --git a/easy-xapi-supertest/easy-xapi-supertest-tests.ts b/easy-xapi-supertest/easy-xapi-supertest-tests.ts new file mode 100644 index 000000000..5b43ce061 --- /dev/null +++ b/easy-xapi-supertest/easy-xapi-supertest-tests.ts @@ -0,0 +1,27 @@ +/** + * Created by karl on 14/07/15. + */ + +/// +/// + +import express = require('express'); +import eSupertest = require('easy-xapi-supertest'); + +var app = express(); + +var getAgent = eSupertest.getAgentFactory(app); + +var agent = getAgent({ + user: 'Jack', + role: 'user' +}); + +var getAgent2 = eSupertest.getAgentFactory(app, function (user:string, role?:string) { + return { + user: user, + role: role || 'user' + } +}); + +var agent = getAgent2('Jack'); diff --git a/easy-xapi-supertest/easy-xapi-supertest.d.ts b/easy-xapi-supertest/easy-xapi-supertest.d.ts new file mode 100644 index 000000000..4ea936976 --- /dev/null +++ b/easy-xapi-supertest/easy-xapi-supertest.d.ts @@ -0,0 +1,29 @@ +// Type definitions for easy-x-headers +// Project: https://github.com/DeadAlready/easy-x-headers +// Definitions by: Karl Düüna +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "easy-xapi-supertest" { + import express = require('express'); + + export interface BodyAgent { + send(data: Object): any; + attach(arg1: any, arg2?: any): any; + } + + export interface Agent { + get(url:string): any; + delete(url:string): any; + post(url:string): BodyAgent; + patch(url:string): BodyAgent; + put(url:string): BodyAgent; + } + + interface getAgent { + (...args:any[]): Agent + } + + export function getAgentFactory(app: express.Application, transform?: Function): getAgent; +} From 9d04a7b772d8ba7afc37f1e93a8e1bd9d3fbedf1 Mon Sep 17 00:00:00 2001 From: Toshiya Nakakura Date: Sun, 5 Jul 2015 13:16:47 +0900 Subject: [PATCH 29/84] add webvr-api definition --- webvr-api/webvr-api-test.ts | 62 +++++++++++++ webvr-api/webvr-api.d.ts | 175 ++++++++++++++++++++++++++++++++++++ 2 files changed, 237 insertions(+) create mode 100644 webvr-api/webvr-api-test.ts create mode 100644 webvr-api/webvr-api.d.ts diff --git a/webvr-api/webvr-api-test.ts b/webvr-api/webvr-api-test.ts new file mode 100644 index 000000000..df2a72438 --- /dev/null +++ b/webvr-api/webvr-api-test.ts @@ -0,0 +1,62 @@ +/// + +function fieldOfViewToProjectionMatrix(fov: WebVRApi.VRFieldOfView, zNear: number, zFar: number) { + var upTan = Math.tan(fov.upDegrees * Math.PI/180.0); + var downTan = Math.tan(fov.downDegrees * Math.PI/180.0); + var leftTan = Math.tan(fov.leftDegrees * Math.PI/180.0); + var rightTan = Math.tan(fov.rightDegrees * Math.PI/180.0); + var xScale = 2.0 / (leftTan + rightTan); + var yScale = 2.0 / (upTan + downTan); + + var out = new Float32Array(16); + out[0] = xScale; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + out[4] = 0.0; + out[5] = yScale; + out[6] = 0.0; + out[7] = 0.0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = ((upTan - downTan) * yScale * 0.5); + out[10] = -(zNear + zFar) / (zFar - zNear); + out[11] = -1.0; + out[12] = 0.0; + out[13] = 0.0; + out[14] = -(2.0 * zFar * zNear) / (zFar - zNear); + out[15] = 0.0; + + return out; +} + +var hmd: HMDVRDevice; +var leftEyeParams = hmd.getEyeParameters("left"); +var rightEyeParams = hmd.getEyeParameters("right"); +var leftEyeRect = leftEyeParams.renderRect; +var rightEyeRect = rightEyeParams.renderRect; + +var canvas: HTMLCanvasElement; +canvas.width = rightEyeRect.x + rightEyeRect.width; +canvas.height = Math.max(leftEyeRect.y + leftEyeRect.height, rightEyeRect.y + rightEyeRect.height); + +var gHMD: WebVRApi.VRDevice; +var gPositionSensor: WebVRApi.VRDevice; + +navigator.getVRDevices().then(function(devices) { + for (var i = 0; i < devices.length; ++i) { + if (devices[i] instanceof HMDVRDevice) { + gHMD = devices[i]; + break; + } + } + + if (gHMD) { + for (var i = 0; i < devices.length; ++i) { + if (devices[i] instanceof PositionSensorVRDevice && + devices[i].hardwareUnitId == gHMD.hardwareUnitId) { + gPositionSensor = devices[i]; + break; + } + } + } +}); diff --git a/webvr-api/webvr-api.d.ts b/webvr-api/webvr-api.d.ts new file mode 100644 index 000000000..16918cf30 --- /dev/null +++ b/webvr-api/webvr-api.d.ts @@ -0,0 +1,175 @@ +// Type definitions for WebVR API +// Project: http://mozvr.github.io/webvr-spec/webvr.html +// Definitions by: Toshiya Nakakura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare type VREye = string; + +declare module WebVRApi { + export interface VRFieldOfViewReadOnly { + upDegrees: number; + rightDegrees: number; + downDegrees: number; + leftDegrees: number; + } + + export interface VRFieldOfViewInit { + upDegrees: number; + rightDegrees: number; + downDegrees: number; + leftDegrees: number; + } + + export interface VRFieldOfView extends VRFieldOfViewReadOnly { + constructor(upDegrees:number, rightDegrees:number, downDegrees:number, leftDegrees:number): VRFieldOfView; + upDegrees: number; + rightDegrees: number; + downDegrees: number; + leftDegrees: number; + } + + export interface VRPositionState { + /** + * Monotonically increasing value that allows the author to determine if position state data been updated from the hardware. + */ + timeStamp: number; + /** + * True if the position attribute is valid. If false position MUST be null. + */ + hasPosition: boolean; + /** + * Position of the sensor at timeStamp as a 3D vector. + */ + position?: GeometryDom.DOMPoint; + /** + * Linear velocity of the sensor at timeStamp. + */ + linearVelocity?: GeometryDom.DOMPoint; + /** + * Linear acceleration of the sensor at timeStamp. + */ + linearAcceleration?: GeometryDom.DOMPoint; + /** + * True if the orientation attribute is valid. If false orientation MUST be null. + */ + hasOrientation: boolean; + /** + * Orientation of the sensor at timeStamp as a quaternion. + */ + orientation?: GeometryDom.DOMPoint; + /** + * Angular velocity of the sensor at timeStamp. + */ + angularVelocity?: GeometryDom.DOMPoint; + /** + * Angular acceleration of the sensor at timeStamp. + */ + angularAcceleration?: GeometryDom.DOMPoint; + } + + export interface VREyeParameters { + /** + * Describes the minimum supported field of view for the eye. + */ + minimumFieldOfView: VRFieldOfView; + /** + * Describes the maximum supported field of view for the eye. + */ + maximumFieldOfView: VRFieldOfView; + /** + * Describes the recommended field of view for the eye. + */ + recommendedFieldOfView: VRFieldOfView; + /** + * Offset from the center of the users head to the eye in meters. + */ + eyeTranslation: GeometryDom.DOMPoint; + /** + * The current field of view for the eye, as specified by setFieldOfView. + */ + currentFieldOfView: VRFieldOfView; + /** + * Describes the viewport of a canvas into which visuals for this eye should be rendered. + */ + renderRect: GeometryDom.DOMRect; + } + + export interface VRDevice { + /** + * An identifier for the distinct hardware unit that this VRDevice is a part of. + */ + hardwareUnitId: string; + /** + * An identifier for this distinct sensor/device on a physical hardware device. + */ + deviceId: string; + /** + * A user-readable name identifying the device. + */ + deviceName: string; + } +} + +declare class HMDVRDevice implements WebVRApi.VRDevice { + /** + * An identifier for the distinct hardware unit that this VRDevice is a part of. + */ + hardwareUnitId: string; + /** + * An identifier for this distinct sensor/device on a physical hardware device. + */ + deviceId: string; + /** + * A user-readable name identifying the device. + */ + deviceName: string; + + /** + * Return the current VREyeParameters for the given eye. + */ + getEyeParameters(whichEye: VREye): WebVRApi.VREyeParameters; + /** + * Set the field of view for both eyes. If + */ + setFieldOfView(leftFOV?: WebVRApi.VRFieldOfViewInit, rightFOV?: WebVRApi.VRFieldOfViewInit, zNear?: number, zFar?: number): void; +} + +declare class PositionSensorVRDevice implements WebVRApi.VRDevice { + /** + * An identifier for the distinct hardware unit that this VRDevice is a part of. + */ + hardwareUnitId: string; + /** + * An identifier for this distinct sensor/device on a physical hardware device. + */ + deviceId: string; + /** + * A user-readable name identifying the device. + */ + deviceName: string; + + /** + * Return a VRPositionState dictionary containing the state of this position sensor state for the current frame (if within a requestAnimationFrame context) or for the previous frame. + */ + getState(): WebVRApi.VRPositionState; + /** + * Return the current instantaneous sensor state. + */ + getImmediateState(): WebVRApi.VRPositionState; + + /** + * Reset this sensor, treating its current position and orientation yaw as the "origin/zero" values. + */ + resetSensor(): void; +} + +interface Navigator { + /** + * Return a Promise which resolves to a list of available VRDevices. + */ + getVRDevices(): Promise>; +} + From af4db82d97e862205afc10efd11ea77e2169889c Mon Sep 17 00:00:00 2001 From: Toshiya Nakakura Date: Thu, 16 Jul 2015 19:18:30 +0900 Subject: [PATCH 30/84] rename webvr-api-test --- webvr-api/{webvr-api-test.ts => webvr-api-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename webvr-api/{webvr-api-test.ts => webvr-api-tests.ts} (100%) diff --git a/webvr-api/webvr-api-test.ts b/webvr-api/webvr-api-tests.ts similarity index 100% rename from webvr-api/webvr-api-test.ts rename to webvr-api/webvr-api-tests.ts From 14e024237bd6c4f346ee43941366d537faf2eede Mon Sep 17 00:00:00 2001 From: Toshiya Nakakura Date: Thu, 16 Jul 2015 19:23:42 +0900 Subject: [PATCH 31/84] remove garbage --- webvr-api/webvr-api-test.ts | 62 ------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 webvr-api/webvr-api-test.ts diff --git a/webvr-api/webvr-api-test.ts b/webvr-api/webvr-api-test.ts deleted file mode 100644 index df2a72438..000000000 --- a/webvr-api/webvr-api-test.ts +++ /dev/null @@ -1,62 +0,0 @@ -/// - -function fieldOfViewToProjectionMatrix(fov: WebVRApi.VRFieldOfView, zNear: number, zFar: number) { - var upTan = Math.tan(fov.upDegrees * Math.PI/180.0); - var downTan = Math.tan(fov.downDegrees * Math.PI/180.0); - var leftTan = Math.tan(fov.leftDegrees * Math.PI/180.0); - var rightTan = Math.tan(fov.rightDegrees * Math.PI/180.0); - var xScale = 2.0 / (leftTan + rightTan); - var yScale = 2.0 / (upTan + downTan); - - var out = new Float32Array(16); - out[0] = xScale; - out[1] = 0.0; - out[2] = 0.0; - out[3] = 0.0; - out[4] = 0.0; - out[5] = yScale; - out[6] = 0.0; - out[7] = 0.0; - out[8] = -((leftTan - rightTan) * xScale * 0.5); - out[9] = ((upTan - downTan) * yScale * 0.5); - out[10] = -(zNear + zFar) / (zFar - zNear); - out[11] = -1.0; - out[12] = 0.0; - out[13] = 0.0; - out[14] = -(2.0 * zFar * zNear) / (zFar - zNear); - out[15] = 0.0; - - return out; -} - -var hmd: HMDVRDevice; -var leftEyeParams = hmd.getEyeParameters("left"); -var rightEyeParams = hmd.getEyeParameters("right"); -var leftEyeRect = leftEyeParams.renderRect; -var rightEyeRect = rightEyeParams.renderRect; - -var canvas: HTMLCanvasElement; -canvas.width = rightEyeRect.x + rightEyeRect.width; -canvas.height = Math.max(leftEyeRect.y + leftEyeRect.height, rightEyeRect.y + rightEyeRect.height); - -var gHMD: WebVRApi.VRDevice; -var gPositionSensor: WebVRApi.VRDevice; - -navigator.getVRDevices().then(function(devices) { - for (var i = 0; i < devices.length; ++i) { - if (devices[i] instanceof HMDVRDevice) { - gHMD = devices[i]; - break; - } - } - - if (gHMD) { - for (var i = 0; i < devices.length; ++i) { - if (devices[i] instanceof PositionSensorVRDevice && - devices[i].hardwareUnitId == gHMD.hardwareUnitId) { - gPositionSensor = devices[i]; - break; - } - } - } -}); From b00376da53018decfb4119c53fec46205fd91017 Mon Sep 17 00:00:00 2001 From: Toshiya Nakakura Date: Thu, 16 Jul 2015 19:48:28 +0900 Subject: [PATCH 32/84] add skyway definition --- skyway/skyway-tests.ts | 51 ++++++++++++ skyway/skyway.d.ts | 184 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 235 insertions(+) create mode 100644 skyway/skyway-tests.ts create mode 100644 skyway/skyway.d.ts diff --git a/skyway/skyway-tests.ts b/skyway/skyway-tests.ts new file mode 100644 index 000000000..a7eced27d --- /dev/null +++ b/skyway/skyway-tests.ts @@ -0,0 +1,51 @@ +/// +/// + +var peerByOption: PeerJs.Peer = new Peer({ + key: 'peerKey', + debug: 3, + logFunction: ()=>{ + } +}); + +peerByOption.listAllPeers(function(items){ + for(var i in items){ + console.log(decodeURI(items[i])); + } +}); + +var peerById: PeerJs.Peer = new Peer("peerid"); + +var peerByIdAndOption: PeerJs.Peer = new Peer( + "peerId", + { + key: 'peerKey', + debug: 3, + logFunction: ()=>{ + } + }); + +var id = peerByOption.id; +var connections = peerByOption.connections; +var flag = peerByOption.disconnected; +flag = peerByOption.destroyed; + +peerByOption.disconnect(); +peerByOption.destroy(); + +var connection = peerById.connect("id", { + label: 'chat', + serialization: 'none', + metadata: {message: 'hi i want to chat with you!'} +}); + +var call = peerById.call('callto-id', (window).localStream); + +var openHandler=()=> console.log("open"); +peerById.on("open", openHandler); +peerById.on("connection", (c)=> console.log("connection")); +peerById.on("call", (media)=> console.log("call")); +peerById.on("close", ()=> console.log("close")); +peerById.on("disconnected", ()=> console.log("disconnected")); +peerById.on("error", (err)=> console.log(err)); +peerById.off("open", openHandler); diff --git a/skyway/skyway.d.ts b/skyway/skyway.d.ts new file mode 100644 index 000000000..681d358b8 --- /dev/null +++ b/skyway/skyway.d.ts @@ -0,0 +1,184 @@ +// Type definitions for SkyWay +// Project: http://nttcom.github.io/skyway/ +// Definitions by: Toshiya Nakakura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module PeerJs{ + interface PeerJSOption{ + key?: string; + host?: string; + port?: number; + path?: string; + secure?: boolean; + turn?: boolean; + config?: RTCPeerConnectionConfig; + debug?: number; + } + + interface PeerConnectOption{ + label?: string; + metadata?: any; + serialization?: string; + reliable?: boolean; + } + + interface DataConnection{ + send(data: any): void; + close(): void; + on(event: string, cb: ()=>void): void; + on(event: 'data', cb: (data: any)=>void): void; + on(event: 'open', cb: ()=>void): void; + on(event: 'close', cb: ()=>void): void; + on(event: 'error', cb: (err: any)=>void): void; + off(event: string, fn: Function, once?: boolean): void; + bufferSize: number; + dataChannel: RTCDataChannel; + label: string; + metadata: any; + open: boolean; + peerConnection: any; + peer: string; + reliable: boolean; + serialization: string; + type: string; + } + + interface MediaConnection{ + answer(stream?: any): void; + close(): void; + on(event: string, cb: ()=>void): void; + on(event: 'stream', cb: (stream: any)=>void): void; + on(event: 'close', cb: ()=>void): void; + on(event: 'error', cb: (err: any)=>void): void; + off(event: string, fn: Function, once?: boolean): void; + open: boolean; + metadata: any; + peer: string; + type: string; + } + + interface utilSupportsObj { + audioVideo: boolean; + data: boolean; + binary: boolean; + reliable: boolean; + } + + interface util{ + browser: string; + supports: utilSupportsObj; + } + + export interface Peer{ + /** + * + * @param id The brokering ID of the remote peer (their peer.id). + * @param options for specifying details about Peer Connection + */ + connect(id: string, options?: PeerJs.PeerJSOption): PeerJs.DataConnection; + /** + * Connects to the remote peer specified by id and returns a data connection. + * @param id The brokering ID of the remote peer (their peer.id). + * @param stream The caller's media stream + */ + call(id: string, stream: any): PeerJs.MediaConnection; + /** + * Calls the remote peer specified by id and returns a media connection. + * @param event Event name + * @param cb Callback Function + */ + on(event: string, cb: ()=>void): void; + /** + * Emitted when a connection to the PeerServer is established. + * @param event Event name + * @param cb id is the brokering ID of the peer + */ + on(event: 'open', cb: (id: string)=>void): void; + /** + * Emitted when a new data connection is established from a remote peer. + * @param event Event name + * @param cb Callback Function + */ + on(event: 'connection', cb: (dataConnection: PeerJs.DataConnection)=>void): void; + /** + * Emitted when a remote peer attempts to call you. + * @param event Event name + * @param cb Callback Function + */ + on(event: 'call', cb: (mediaConnection: PeerJs.MediaConnection)=>void): void; + /** + * Emitted when the peer is destroyed and can no longer accept or create any new connections. + * @param event Event name + * @param cb Callback Function + */ + on(event: 'close', cb: ()=>void): void; + /** + * Emitted when the peer is disconnected from the signalling server + * @param event Event name + * @param cb Callback Function + */ + on(event: 'disconnected', cb: ()=>void): void; + /** + * Errors on the peer are almost always fatal and will destroy the peer. + * @param event Event name + * @param cb Callback Function + */ + on(event: 'error', cb: (err: any)=>void): void; + /** + * Remove event listeners.(EventEmitter3) + * @param {String} event The event we want to remove. + * @param {Function} fn The listener that we need to find. + * @param {Boolean} once Only remove once listeners. + */ + off(event: string, fn: Function, once?: boolean): void; + /** + * Close the connection to the server, leaving all existing data and media connections intact. + */ + disconnect(): void; + /** + * Close the connection to the server and terminate all existing connections. + */ + destroy(): void; + /** + * Get a list of available peer IDs + * @param callback + */ + listAllPeers(callback: (peerIds: Array)=>void): void; + + /** + * The brokering ID of this peer + */ + id: string; + /** + * A hash of all connections associated with this peer, keyed by the remote peer's ID. + */ + connections: any; + /** + * false if there is an active connection to the PeerServer. + */ + disconnected: boolean; + /** + * true if this peer and all of its connections can no longer be used. + */ + destroyed: boolean; + } +} + +declare var Peer: { + prototype: RTCIceServer; + /** + * A peer can connect to other peers and listen for connections. + * @param id Other peers can connect to this peer using the provided ID. + * If no ID is given, one will be generated by the brokering server. + * @param options for specifying details about PeerServer + */ + new (id: string, options?: PeerJs.PeerJSOption): PeerJs.Peer; + + /** + * A peer can connect to other peers and listen for connections. + * @param options for specifying details about PeerServer + */ + new (options: PeerJs.PeerJSOption): PeerJs.Peer; +}; From f1e34355814e30f94e0b80680a6c6863e0b07c32 Mon Sep 17 00:00:00 2001 From: Sam Saint-Pettersen Date: Thu, 16 Jul 2015 11:52:55 +0100 Subject: [PATCH 33/84] Type definitions and tests for node shortid module --- shortid/shortid-tests.ts | 10 ++++++++++ shortid/shortid.d.ts | 12 ++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 shortid/shortid-tests.ts create mode 100644 shortid/shortid.d.ts diff --git a/shortid/shortid-tests.ts b/shortid/shortid-tests.ts new file mode 100644 index 000000000..31ee0df1d --- /dev/null +++ b/shortid/shortid-tests.ts @@ -0,0 +1,10 @@ +/// + +import shortid = require('shortid'); + +var my_short_id: string = shortid.generate(); +console.log(my_short_id); + +console.log('Is valid short id? => %s', shortid.isValid(my_short_id)); // => true +console.log('Is valid short id? => %s', shortid.isValid(5)); // => false +console.log('Is valid short id? => %s', shortid.isValid('i have spaces')); // => false diff --git a/shortid/shortid.d.ts b/shortid/shortid.d.ts new file mode 100644 index 000000000..049e53969 --- /dev/null +++ b/shortid/shortid.d.ts @@ -0,0 +1,12 @@ +// Type definitions for shortid +// Project: https://github.com/dylang/shortid +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "shortid" { + export function generate(): string; + export function characters(string: string): string; + export function isValid(id: any): boolean; + export function worker(integer: number): void; + export function seed(float: number): void; +} From 4340cbf5c38ccd2d6a751e1c17dff70d8e403406 Mon Sep 17 00:00:00 2001 From: Nicholas Penree Date: Thu, 16 Jul 2015 08:34:58 -0400 Subject: [PATCH 34/84] Add type definitions for kue --- kue/kue-tests.ts | 96 ++++++++++++++++++++++++++++++ kue/kue.d.ts | 149 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 245 insertions(+) create mode 100644 kue/kue-tests.ts create mode 100644 kue/kue.d.ts diff --git a/kue/kue-tests.ts b/kue/kue-tests.ts new file mode 100644 index 000000000..c58f6f874 --- /dev/null +++ b/kue/kue-tests.ts @@ -0,0 +1,96 @@ +/// +/// + +import kue = require('kue'); + +// create our job queue + +var jobs = kue.createQueue(); + +// start redis with $ redis-server + +// create some jobs at random, +// usually you would create these +// in your http processes upon +// user input etc. + +function create() { + var name = [ 'tobi', 'loki', 'jane', 'manny' ][ Math.random() * 4 | 0 ]; + var job = jobs.create( 'video conversion', { + title: 'converting ' + name + '\'s to avi', user: 1, frames: 200 + }); + + job.on('complete', function() { + console.log(" Job complete"); + }).on('failed', function() { + console.log(" Job failed"); + }).on('progress', function(progress: number) { + process.stdout.write('\r job #' + job.id + ' ' + progress + '% complete'); + }); + + job.save(); + + setTimeout( create, Math.random() * 2000 | 0 ); +} + +create(); + +// process video conversion jobs, 1 at a time. + +jobs.process('video conversion', 1, function(job: kue.Job, done: Function) { + var frames: number = job.data.frames; + + function next(i: number) { + // pretend we are doing some work + convertFrame(i, function(err: Error) { + if (err) return done(err); + // report progress, i/frames complete + job.progress(i, frames); + if (i >= frames) done(); + else next(i + Math.random() * 10); + } ); + } + + next(0); +} ); + +function convertFrame(i: number, fn: Function) { + setTimeout(fn, Math.random() * 50); +} + +// one minute + +var minute = 60000; + +var email = jobs.create('email', { + title: 'Account renewal required', to: 'tj@learnboost.com', template: 'renewal-email' +}).delay(minute) + .priority('high') + .save(); + + +email.on('promotion', function() { + console.log('renewal job promoted'); +} ); + +email.on('complete', function() { + console.log('renewal job completed' ); +} ); + +jobs.create('email', { + title: 'Account expired', to: 'tj@learnboost.com', template: 'expired-email' +} ).delay( minute * 10 ) + .priority('high') + .save(); + +jobs.promote(); + +jobs.process('email', 10, function(job, done) { + setTimeout(function() { + done(); + }, Math.random() * 5000); +}); + +// start the UI +kue.app.listen(3000); +console.log('UI started on port 3000'); \ No newline at end of file diff --git a/kue/kue.d.ts b/kue/kue.d.ts new file mode 100644 index 000000000..1b3fff227 --- /dev/null +++ b/kue/kue.d.ts @@ -0,0 +1,149 @@ +// Type definitions for kue 0.9.x +// Project: https://github.com/Automattic/kue +// Definitions by: Nicholas Penree +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// + +declare module "kue" { + import events = require('events'); + import express = require('express'); + import redis = require('redis'); + + export class Queue extends events.EventEmitter { + name: string; + id: string; + promoter: any; + workers: Worker[]; + shuttingDown: boolean; + client: redis.RedisClient; + testMode: TestMode; + + static singleton: Queue; + + constructor(options: Object); + create(type: string, data: Object): Job; + createJob(type: string, data: Object): Job; + promote(ms?: number): void; + setupTimer(): void; + checkJobPromotion(ms: number): void; + checkActiveJobTtl(ttlOptions: Object): void; + watchStuckJobs(ms: number): void; + setting(name: string, fn: Function): Queue; + process(type: string, n?: number, fn?: Function): void; + shutdown(timeout: number, type: string, fn: Function): Queue; + types(fn: Function): Queue; + state(string: string, fn: Function): Queue; + workTime(fn: Function): Queue; + cardByType(type: string, state: string, fn: Function): Queue; + card(state: string, fn: Function): Queue; + complete(fn: Function): Queue; + failed(fn: Function): Queue; + inactive(fn: Function): Queue; + active(fn: Function): Queue; + delayed(fn: Function): Queue; + completeCount(type: string, fn: Function): Queue; + failedCount(type: string, fn: Function): Queue; + inactiveCount(type: string, fn: Function): Queue; + activeCount(type: string, fn: Function): Queue; + delayedCount(type: string, fn: Function): Queue; + } + + interface Priorities { + low: number; + normal: number; + medium: number; + high: number; + critical: number; + } + + export class Job extends events.EventEmitter { + public id: number; + public type: string; + public data: any; + public client: redis.RedisClient; + private _max_attempts; + + static priorities: Priorities; + static disableSearch: boolean; + static jobEvents: boolean; + static get(id: number, fn: Function): void; + static remove(id: number, fn?: Function): void; + static removeBadJob(id: number): void; + static log(id: number, fn: Function): void; + static range(from: number, to: number, order: string, fn: Function): void; + static rangeByState(state: string, from: number, to: number, order: string, fn: Function): void; + static rangeByType(type: string, state: string, from: number, to: number, order: string, fn: Function): void; + + constructor(type: string, data?: any); + toJSON(): Object; + log(str: string): Job; + set(key: string, val: string, fn?: Function): Job; + get(key: string, fn?: Function): Job; + progress(complete: number, total: number, data?: any): Job; + delay(ms:number|Date): Job; + removeOnComplete(param: any): void; + backoff(param: any): void; + ttl(param: any): void; + private _getBackoffImpl(): void; + priority(level: string|number): Job; + attempt(fn: Function): Job; + reattempt(attempt: number, fn?: Function): void; + attempts(n: number): Job; + searchKeys(keys: string[]|string): Job; + remove(fn?: Function): Job; + state(state: string, fn?: Function): Job; + error(err: Error): Job; + complete(fn?: Function): Job; + failed(fn?: Function): Job; + inactive(fn?: Function): Job; + active(fn?: Function): Job; + delayed(fn?: Function): Job; + save(fn?: Function): Job; + update(fn?: Function): Job; + subscribe(fn?: Function): Job; + } + + class Worker extends events.EventEmitter { + queue: Queue; + type: string; + client: redis.RedisClient; + job: Job; + + constructor(queue: Queue, type: string); + start(fn: Function): Worker; + error(err: Error, job: Job): Worker; + failed(job: Job, theErr: Object, fn?: Function): Worker; + process(job: Job, fn: Function): Worker; + private zpop(key: string, fn: Function): void; + private getJob(fn: Function): void; + idle(): Worker; + shutdown(timeout: number, fn: Function): void; + emitJobEvent(event: Object, job: Job, arg1: any, arg2: any): void; + resume(): boolean; + } + + interface Redis { + configureFactory(options: Object, queue: Queue): void; + createClient(): redis.RedisClient; + createClientFactory(options: Object): redis.RedisClient; + client(): redis.RedisClient; + pubsubClient(): redis.RedisClient; + reset(): void; + } + + interface TestMode { + jobs: Job[]; + enter(): void; + exit(): void; + clear(): void; + } + + export var app: express.Application; + export var redis: Redis; + export var workers: Worker[]; + + export function createQueue(options?: Object): Queue; +} \ No newline at end of file From 7057e7d2aac7e19cd035497fc289205539f3b5b8 Mon Sep 17 00:00:00 2001 From: Nicholas Penree Date: Thu, 16 Jul 2015 09:48:03 -0400 Subject: [PATCH 35/84] Fix types in kue tests --- kue/kue-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kue/kue-tests.ts b/kue/kue-tests.ts index c58f6f874..0a990ee7b 100644 --- a/kue/kue-tests.ts +++ b/kue/kue-tests.ts @@ -85,7 +85,7 @@ jobs.create('email', { jobs.promote(); -jobs.process('email', 10, function(job, done) { +jobs.process('email', 10, function(job: kue.Job, done: Function) { setTimeout(function() { done(); }, Math.random() * 5000); From 2bab2df8287f7eb91900d63f69485f6a16eb3896 Mon Sep 17 00:00:00 2001 From: Chabardes Date: Thu, 16 Jul 2015 17:12:01 +0200 Subject: [PATCH 36/84] Update velocity-animate.d.ts add hook functions (http://julian.com/research/velocity/#hook) --- velocity-animate/velocity-animate.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/velocity-animate/velocity-animate.d.ts b/velocity-animate/velocity-animate.d.ts index 00c421896..6946da972 100644 --- a/velocity-animate/velocity-animate.d.ts +++ b/velocity-animate/velocity-animate.d.ts @@ -34,6 +34,16 @@ declare module jquery.velocity { 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; + /** + * Get a hook value. Hooks are the subvalues of multi-value CSS properties. + * It features the same API as $.css(). + */ + hook(element: HTMLElement|JQuery, cssKey: string): string; + /** + * Set a hook value. Hooks are the subvalues of multi-value CSS properties. + * It features the same API as $.css(). + */ + hook(element: HTMLElement|JQuery, cssKey: string, cssValue: string): void; } interface VelocityOptions { From 8f1775b79db7a5a552eb8f26f6e59fe9e04a8e09 Mon Sep 17 00:00:00 2001 From: Dasa Paddock Date: Thu, 16 Jul 2015 08:15:38 -0700 Subject: [PATCH 37/84] Update for ArcGIS API for JavaScript version 3.14 --- arcgis-js-api/arcgis-js-api.d.ts | 3396 +++++++++++++++++++----------- 1 file changed, 2151 insertions(+), 1245 deletions(-) diff --git a/arcgis-js-api/arcgis-js-api.d.ts b/arcgis-js-api/arcgis-js-api.d.ts index 1f6523a23..ba5e0fb9f 100644 --- a/arcgis-js-api/arcgis-js-api.d.ts +++ b/arcgis-js-api/arcgis-js-api.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript v3.13 +// Type definitions for ArcGIS API for JavaScript v3.14 // Project: http://js.arcgis.com // Definitions by: Esri // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -16,12 +16,12 @@ declare module "esri" { import Extent = require("esri/geometry/Extent"); import TileInfo = require("esri/layers/TileInfo"); import BasemapLayer = require("esri/dijit/BasemapLayer"); + import Symbol = require("esri/symbols/Symbol"); import BookmarkItem = require("esri/dijit/BookmarkItem"); import Units = require("esri/units"); import Color = require("esri/Color"); import LocationProviderBase = require("esri/tasks/locationproviders/LocationProviderBase"); import PictureMarkerSymbol = require("esri/symbols/PictureMarkerSymbol"); - import Geocoder = require("esri/dijit/Geocoder"); import RouteParameters = require("esri/tasks/RouteParameters"); import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol"); import Font = require("esri/symbols/Font"); @@ -31,16 +31,19 @@ declare module "esri" { import LayerSource = require("esri/layers/LayerSource"); import GraphicsLayer = require("esri/layers/GraphicsLayer"); import SpatialReference = require("esri/SpatialReference"); - import Symbol = require("esri/symbols/Symbol"); import Layer = require("esri/layers/layer"); + import SimpleFillSymbol = require("esri/symbols/SimpleFillSymbol"); + import ArcGISImageServiceLayer = require("esri/layers/ArcGISImageServiceLayer"); + import SimpleMarkerSymbol = require("esri/symbols/SimpleMarkerSymbol"); import Locator = require("esri/tasks/locator"); import InfoWindowBase = require("esri/InfoWindowBase"); import LOD = require("esri/layers/LOD"); + import Polyline = require("esri/geometry/Polyline"); + import Polygon = require("esri/geometry/Polygon"); import FillSymbol = require("esri/symbols/FillSymbol"); import PrintTemplate = require("esri/tasks/PrintTemplate"); import QueryTask = require("esri/tasks/QueryTask"); import TextSymbol = require("esri/symbols/TextSymbol"); - import SimpleMarkerSymbol = require("esri/symbols/SimpleMarkerSymbol"); import StandardGeographyQueryTask = require("esri/tasks/geoenrichment/StandardGeographyQueryTask"); import WMTSLayerInfo = require("esri/layers/WMTSLayerInfo"); @@ -245,6 +248,18 @@ declare module "esri" { /** Whether the widget is visible by default. */ visible?: boolean; } + export interface BlendRendererOptions { + /** This determines how colors are blended together. */ + blendMode?: string; + /** An array of objects to blend containing the field name and color to use. */ + fields: any[]; + /** The field to normalize. */ + normalizationField?: string; + /** An array of objects which determines opacity. */ + opacityStops: any[]; + /** The symbol in which the BlendRenderer is applied. */ + symbol: Symbol; + } export interface BookmarksOptions { /** An array of BookmarkItem objects or a json object with the BookmarkItem format to initially display in the bookmark widget. */ bookmarks?: BookmarkItem[]; @@ -279,7 +294,7 @@ declare module "esri" { } export interface CircleOptions2 { /** The center point of the circle. */ - center: any; + center: Point | number[]; /** Applicable when the spatial reference of the center point is either set to Web Mercator or geographic/geodesic as true would apply. */ geodesic?: boolean; /** A circle can be thought of similar to a polygon. */ @@ -537,7 +552,7 @@ declare module "esri" { } export interface DirectionsOptions { /** Defines the values that label each stop. */ - alphabet?: any; + alphabet?: string | string[] | boolean; /** When true, solve will start when the last destination is complete and enter key is hit. */ autoSolve?: boolean; /** Display the 'Add Destination' button. */ @@ -556,10 +571,6 @@ declare module "esri" { fromSymbol?: PictureMarkerSymbol; /** The symbol that displays when the from location is dragged to a new location. */ fromSymbolDrag?: PictureMarkerSymbol; - /** Define optional geocoder options view the Geocoder help for details on the object properties. */ - geocoderOptions?: any; - /** List of Geocoder widgets used for each stop. */ - geocoders?: Geocoder[]; /** If available, this geometry service is used to provide latitude/longitude values for stops whose reverse geocoding did not return an address (Added at v3.11). */ geometryTaskUrl?: string; /** Reference to the map object. */ @@ -586,6 +597,8 @@ declare module "esri" { routeSymbol?: SimpleLineSymbol; /** Specify the service that will be used to calculate directions. */ routeTaskUrl?: string; + /** Used to define optional search options. */ + searchOptions?: any; /** Define the info template for the popup that appears when the popup for a route segment is displayed. */ segmentInfoTemplate?: InfoTemplate; /** Specify the symbol used to render the individual route segments that display on the map when a direction step is clicked. */ @@ -617,7 +630,7 @@ declare module "esri" { /** List of graphics used to display the point marker. */ stopGraphics?: Graphic[]; /** An array of points that define the stop locations. */ - stops?: any; + stops?: Point[] | number[][] | string[] | any[]; /** Define the info template for the popup that appears when a stop is clicked. */ stopsInfoTemplate?: InfoTemplate; /** The symbol that displays on the map for the locations between the origin and final destination locations. */ @@ -642,6 +655,8 @@ declare module "esri" { traffic?: boolean; /** The traffic layer used for real-time traffic. */ trafficLayer?: ArcGISDynamicMapServiceLayer; + /** An example of when to use this is when working with a proxied ArcGIS Online route service item with stored credentials. */ + travelModesServiceUrl?: string; } export interface DissolveBoundariesOptions { /** The URL to the GPServer used to execute an analysis job. */ @@ -709,7 +724,7 @@ declare module "esri" { /** Marker symbol used to display the insertable vertices. */ ghostVertexSymbol?: MarkerSymbol; /** If users want to place the text symbol editor to a user defined HTML element. */ - textSymbolEditorHolder?: any; + textSymbolEditorHolder?: Node | string; /** When true, if the geometry is re-sized the aspect ration will be preserved. */ uniformScaling?: boolean; /** Marker symbol used to draw the vertices. */ @@ -719,6 +734,16 @@ declare module "esri" { /** Create a new settings object that defines the capabilities of the widget. */ settings?: any; } + export interface ElevationProfileOptions { + /** This object contains properties used to render the chart. */ + chartOptions?: any; + /** Reference to the map. */ + map: Map; + /** The URL to the elevation profile service. */ + profileTaskUrl: string; + /** The measurement unit of the scalebar units. */ + scalebarUnits?: string; + } export interface EnrichLayerOptions { /** The URL to the GPServer used to execute an analysis job. */ analysisGpServer?: string; @@ -823,6 +848,10 @@ declare module "esri" { /** Initial visibility of the layer. */ visible?: boolean; } + export interface FeatureLayerStatisticsOptions { + /** The feature layer that will be the source for calculating statistics. */ + layer: FeatureLayer; + } export interface FeatureTableOptions { /** A dGrid property. */ allowSelectAll?: boolean; @@ -963,7 +992,7 @@ declare module "esri" { } export interface GeocoderOptions { /** By default, the Geocoder widget uses the Esri World Locator to find search locations. */ - arcgisGeocoder?: any; + arcgisGeocoder?: boolean | any; /** When false, the geocoder will not display the auto-complete results menu. */ autoComplete?: boolean; /** When false, the geolocator will not navigate to the result after selection or search. */ @@ -1005,7 +1034,7 @@ declare module "esri" { /** Class attribute to set for the layer's node. */ className?: string; /** List of attribute fields to be added as custom data attributes to graphics node. */ - dataAttributes?: any; + dataAttributes?: string | string[]; /** When true, graphics are displayed during panning. */ displayOnPan?: boolean; /** Id to assign to the layer. */ @@ -1085,6 +1114,44 @@ declare module "esri" { /** Specify the geodatabase version to display. */ gdbVersion?: string; } + export interface ImageServiceMeasureOptions { + /** Symbol to be used when drawing a polygon or extent. */ + fillSymbol?: SimpleFillSymbol; + /** Image service layer with which the toolbar is associated. */ + layer: ArcGISImageServiceLayer; + /** Symbol to be used when drawing a line. */ + lineSymbol?: SimpleLineSymbol; + /** Map instance with which the toolbar is associate. */ + map: Map; + /** Symbol to be used when drawing a point. */ + markerSymbol?: SimpleMarkerSymbol; + } + export interface ImageServiceMeasureToolOptions { + /** The angular unit in which directions of line segments will be calculated. */ + angularUnit?: string; + /** The area unit in which areas of polygons will be calculated. */ + areaUnit?: string; + /** Symbol to be used when drawing a polygon or extent. */ + fillSymbol?: SimpleFillSymbol; + /** Image service layer the toolbar is associated with. */ + layer: ArcGISImageServiceLayer; + /** The linear unit in which height, length, or perimeters will be calculated. */ + linearUnit?: string; + /** Symbol to be used when drawing a line. */ + lineSymbol?: SimpleLineSymbol; + /** Map instance the toolbar is associated with. */ + map: Map; + /** Symbol to be used when drawing a point. */ + markerSymbol?: SimpleMarkerSymbol; + } + export interface ImageSpatialReferenceOptions { + /** The full Image Coordinate System object, which includes transformations and map spatial reference information specific to each image. */ + ics?: any; + /** The OBJECTID of the image in a mosaic dataset. */ + icsid?: number; + /** The url of the image service. */ + url: string; + } export interface KMLLayerOptions { /** Class attribute to set for the layer's node. */ className?: string; @@ -1099,6 +1166,20 @@ declare module "esri" { /** Display mode for the label layer. */ mode?: string; } + export interface LayerListOptions { + /** An array of operational layers. */ + layers: any[]; + /** Reference to the map. */ + map: Map; + /** Indicates whether to remove underscores from the layer title. */ + removeUnderscores?: boolean; + /** Indicates whether to show sublayers in the list of layers. */ + subLayers?: boolean; + /** The CSS class selector used to uniquely style the widget. */ + theme?: string; + /** Indicates whether to show the LayerList widget. */ + visible?: boolean; + } export interface LayerOptions { /** Class attribute to set for the layer's node. */ className?: string; @@ -1183,7 +1264,7 @@ declare module "esri" { /** Specify a basemap for the map. */ basemap?: string; /** The location where the map should be centered. */ - center?: any; + center?: number[] | Point; /** When true, graphics are displayed during panning. */ displayGraphicsOnPan?: boolean; /** If provided, the extent and projection of the map is set to the properties of Extent. */ @@ -1249,7 +1330,7 @@ declare module "esri" { /** The default length unit for the measure distance tool. */ defaultLengthUnit?: Units; /** Allows the user to immediately measure previously-created geometry on dijit creation. */ - geometry?: any; + geometry?: Point | Polyline | Polygon; /** Line symbol used to draw the lines for the measure line and measure distance tools. */ lineSymbol?: SimpleLineSymbol; /** Reference to the map. */ @@ -1341,6 +1422,36 @@ declare module "esri" { /** The ArcGIS for Portal URL. */ portalUrl?: string; } + export interface ObliqueViewerOptions { + /** Azimuth angle value for which to display oblique images. */ + azimuthAngle?: number; + /** Image service field that denotes the sensor azimuth value for a record. */ + azimuthField?: string; + /** Tolerance value applied when filtering azimuth images. */ + azimuthTolerance?: number; + /** Image service field that denotes the sensor elevation value for a record. */ + elevationField?: string; + /** Elevation value between 0 and 90 that differentiates an image as oblique or nadir. */ + elevationThreshold?: number; + /** Image service layer to be used as source for oblique images. */ + imageServiceLayer: ArcGISImageServiceLayer; + /** Map object associated with the widget. */ + map: Map; + /** When true, the widget doesn't refresh itself with new oblique records when the map's extent changes. */ + noQueryOnExtentChange?: boolean; + /** Raster info fields to be queried and displayed in the raster list. */ + rasterInfoFields?: any[]; + /** DOM Node or id, where the list element is to be placed. */ + rasterListDiv?: string | Node; + /** When true, list is populated on data refresh. */ + rasterListRefresh?: boolean; + /** DOM Node or id, where the oblique rotation gauge element is to be placed. */ + rotationDiv?: string | Node; + /** When true, thumbnail images for records are displayed in the list. */ + showThumbnail?: boolean; + /** Sorting function that takes query results and sorts them. */ + sorter?: Function; + } export interface OpacitySliderOptions { /** Handles identified by their index values within the stops array. */ handles: number[]; @@ -1595,7 +1706,7 @@ declare module "esri" { /** Toggle for showing the black handle bars. */ showHandles?: boolean; /** Flexible toggle for showing labels (e.g. */ - showLabels?: any; + showLabels?: boolean | string[]; /** Toggle for showing the horizontal line indicators from the center of the handle. */ showTicks?: boolean; /** Stores positions represented as numbers that fall between minimum and maximum. */ @@ -1623,7 +1734,7 @@ declare module "esri" { } export interface SearchOptions { /** The currently selected source. */ - activeSourceIndex?: any; + activeSourceIndex?: number | string; /** Indicates whether to automatically add all the feature layers from the map. */ addLayersFromMap?: boolean; /** Indicates whether to automatically navigate to the selected result. */ @@ -1710,6 +1821,8 @@ declare module "esri" { sizeInfo: any; /** Represents statistics data object. */ statistics?: any; + /** The symbol used with the widget. */ + symbol: Symbol; /** Additional options to customize slider. */ zoomOptions?: any; } @@ -1883,6 +1996,18 @@ declare module "esri" { /** When true, the template picker displays map service legend swatches for feature layers created in selection mode that have an associated map service added to the map as a dynamic map service layer. */ useLegend?: boolean; } + export interface TimeClassBreaksAgerOptions { + /** The alpha opacity for the break. */ + alpha: number; + /** The color for the break. */ + color: Color; + /** The maximum age for the break info. */ + maxAge: number; + /** The minimum age for the break info. */ + minAge: number; + /** The size for the break. */ + size: number; + } export interface TimeSliderOptions { /** When true, subtracts one second to the time extent's end time to exclude data at the exact end time instant. */ excludeDataAtLeadingThumb?: boolean; @@ -1937,6 +2062,42 @@ declare module "esri" { /** A predefined style. */ style?: string; } + export interface VisibleScaleRangeSliderOptions { + /** Layer used to determine the suggested scale range and set the minScale, maxScale values. */ + layer: FeatureLayer; + /** Reference to the map. */ + map: Map; + /** Region of preview scale thumbnails. */ + region?: string; + } + export interface WFSLayerOptions { + /** Full WFS body request sent to WFS server via POST method. */ + getFeatureRequest?: string; + /** URL used when executing getFeature request. */ + getFeatureUrl?: string; + /** The template that defines the content to display in the map info window when the user clicks on a feature. */ + infoTemplate?: InfoTemplate; + /** For "ondemand" mode only. */ + inverseFilter?: boolean; + /** When true, the XY coordinates should be swapped (this is required for some WFS vendors, versions, and WKIDS). */ + inverseResponse?: boolean; + /** Specifies the maximum number of features to return in one response. */ + maxFeatures?: number; + /** The query mode for the WFS layer. */ + mode?: string; + /** For "ondemand" mode only. */ + nsGeometryFieldName?: string; + /** The full layer name including the namespace as a prefix. */ + nsLayerName?: string; + /** When true, more details will be printed to console when the first connection to a WFS server is established. */ + showDetails?: boolean; + /** URL to the WFS server. */ + url: string; + /** OGC WFS version number. */ + version?: string; + /** The well-known ID of the spatial reference used by the WFSLayer. */ + wkid?: string; + } export interface WMSLayerOptions { /** Specify the map image format, valid options are png,jpg,bmp,gif,svg. */ format?: string; @@ -2018,17 +2179,7 @@ declare module "esri/Color" { * Creates a new Color object. * @param color A named string, hex string, array of rgb or rgba values, an object with r, g, b, and a properties, or another Color object. */ - constructor(color?: string); - /** - * Creates a new Color object. - * @param color A named string, hex string, array of rgb or rgba values, an object with r, g, b, and a properties, or another Color object. - */ - constructor(color?: number[]); - /** - * Creates a new Color object. - * @param color A named string, hex string, array of rgb or rgba values, an object with r, g, b, and a properties, or another Color object. - */ - constructor(color?: any); + constructor(color?: string | number[] | any); /** * Blend colors start and end with weight from 0 to 1, 0.5 being a 50/50 blend. * @param start The start color. @@ -2065,17 +2216,7 @@ declare module "esri/Color" { * Takes a named string, hex string, array of rgb or rgba values, an object with r, g, b, and a properties, or another Color object and sets this color instance to that value. * @param color The new color value. */ - setColor(color: string): Color; - /** - * Takes a named string, hex string, array of rgb or rgba values, an object with r, g, b, and a properties, or another Color object and sets this color instance to that value. - * @param color The new color value. - */ - setColor(color: number[]): Color; - /** - * Takes a named string, hex string, array of rgb or rgba values, an object with r, g, b, and a properties, or another Color object and sets this color instance to that value. - * @param color The new color value. - */ - setColor(color: any): Color; + setColor(color: string | number[] | any): Color; /** * Returns a css color string in rgb(a) representation. * @param includeAlpha If true, the alpha value will be included in the result. @@ -2258,13 +2399,42 @@ declare module "esri/IdentityManagerBase" { export = IdentityManagerBase; } +declare module "esri/ImageSpatialReference" { + import esri = require("esri"); + import SpatialReference = require("esri/SpatialReference"); + + /** Defines the Image Coordinate System (ICS) for ImageServices. */ + class ImageSpatialReference extends SpatialReference { + /** The full Image Coordinate System, which includes transformations and map spatial reference information specific to each image. */ + ics: any; + /** The OBJECTID of the image in a mosaic dataset. */ + icsid: number; + /** + * Creates an instance of ImageSpatialReference. + * @param params Options that may be passed into the constructor. + */ + constructor(params: esri.ImageSpatialReferenceOptions); + /** + * Tests whether the input image coordinate system equals the image coordinate system of the instance calling this method. + * @param inSR The ImageSpatialReference to test the equality against this instance. + */ + equals(inSR: ImageSpatialReference): boolean; + /** + * Converts the ImageSpatialReference instance to a JSON object. + * @param preserveUrl Indicates whether to preserve the URL in the output JSON object. + */ + toJson(preserveUrl?: boolean): boolean; + } + export = ImageSpatialReference; +} + declare module "esri/InfoTemplate" { /** An InfoTemplate contains a title and content template string used to transform Graphic.attributes into an HTML representation. */ class InfoTemplate { /** The template for defining how to format the content used in an InfoWindow. */ - content: any; + content: string | Function; /** The template for defining how to format the title used in an InfoWindow. */ - title: any; + title: string | Function; /** Creates a new empty InfoTemplate object. */ constructor(); /** @@ -2272,7 +2442,7 @@ declare module "esri/InfoTemplate" { * @param title The template for defining how to format the title used in an InfoWindow. * @param content The template for defining how to format the content used in an InfoWindow. */ - constructor(title: string, content: string); + constructor(title: string | Function, content: string | Function); /** * Creates a new InfoTemplate object using a JSON object. * @param json JSON object representing the InfoTemplate. @@ -2282,22 +2452,12 @@ declare module "esri/InfoTemplate" { * Sets the content template. * @param template The template for the content. */ - setContent(template: string): InfoTemplate; - /** - * Sets the content template. - * @param template The template for the content. - */ - setContent(template: Function): InfoTemplate; + setContent(template: string | Function): InfoTemplate; /** * Sets the title template. * @param template The template for the title. */ - setTitle(template: string): InfoTemplate; - /** - * Sets the title template. - * @param template The template for the title. - */ - setTitle(template: Function): InfoTemplate; + setTitle(template: string | Function): InfoTemplate; /** Converts object to its ArcGIS Server JSON representation. */ toJson(): any; } @@ -2324,13 +2484,7 @@ declare module "esri/InfoWindowBase" { * @param value A string with HTML tags or a DOM node. * @param parentNode The parent node where the value will be placed. */ - place(value: string, parentNode: Node): void; - /** - * Helper method. - * @param value A string with HTML tags or a DOM node. - * @param parentNode The parent node where the value will be placed. - */ - place(value: HTMLElement, parentNode: Node): void; + place(value: string | HTMLElement, parentNode: Node): void; /** * Resize the info window to the specified width and height (in pixels). * @param width The new width of the InfoWindow in pixels. @@ -2341,12 +2495,7 @@ declare module "esri/InfoWindowBase" { * Define the info window content. * @param content The content argument can be any of the following. */ - setContent(content: string): void; - /** - * Define the info window content. - * @param content The content argument can be any of the following. - */ - setContent(content: any): void; + setContent(content: string | any): void; /** * This method is called by the map when the object is set as its info window. * @param map The map object. @@ -2356,12 +2505,7 @@ declare module "esri/InfoWindowBase" { * Set the input value as the title for the info window. * @param title In most cases the title will be a string value but the same options are available as for the setContent method. */ - setTitle(title: string): void; - /** - * Set the input value as the title for the info window. - * @param title In most cases the title will be a string value but the same options are available as for the setContent method. - */ - setTitle(title: any): void; + setTitle(title: string | any): void; /** * Display the info window at the specified location. * @param location Location is an instance of esri.geometry.Point. @@ -2927,8 +3071,6 @@ declare module "esri/arcgis/Portal" { } declare module "esri/arcgis/utils" { - import Layer = require("esri/layers/layer"); - /** Utility methods to work with content from ArcGIS.com. */ var utils: { /** Specify the domain where the map associated with the webmap id is located. */ @@ -2939,14 +3081,7 @@ declare module "esri/arcgis/utils" { * @param mapDiv Container ID for referencing map. * @param options Optional parameters that define the map functionality. */ - createMap(itemIdOrItemInfo: string, mapDiv: string, options?: any): any; - /** - * Create a map using information from an ArcGIS.com item. - * @param itemIdOrItemInfo An itemId for an ArcGIS.com item or the response object obtained from calling the arcgisUtils.getItem method. - * @param mapDiv Container ID for referencing map. - * @param options Optional parameters that define the map functionality. - */ - createMap(itemIdOrItemInfo: any, mapDiv: string, options?: any): any; + createMap(itemIdOrItemInfo: string | any, mapDiv: string, options?: any): any; /** * Get details about the input ArcGIS.com item. * @param itemId The itemId for a publicly shared ArcGIS.com item. @@ -2956,13 +3091,13 @@ declare module "esri/arcgis/utils" { * Can be used with esri.dijit.Legend to get the layerInfos list to be passed into the Legend constructor. * @param createMapResponse Object returned by .createMap() in the .then() callback. */ - getLegendLayers(createMapResponse: any): Layer[]; + getLegendLayers(createMapResponse: any): any[]; }; export = utils; } declare module "esri/basemaps" { - /** Contains properties referencing default basemaps used in the JS API. */ + /** This class contains properties referencing default basemaps used in the JS API that allow you to add map services as default basemaps in web applications. */ var basemaps: { /** The Light Gray Canvas basemap is designed to be used as a neutral background map for overlaying and emphasizing other map layers. */ gray: any; @@ -3010,13 +3145,7 @@ declare module "esri/dijit/AttributeInspector" { * @param params See options list. * @param srcNodeRef HTML element where the attribute inspector should be rendered. */ - constructor(params: esri.AttributeInspectorOptions, srcNodeRef: Node); - /** - * Creates a new Attribute Inspector object. - * @param params See options list. - * @param srcNodeRef HTML element where the attribute inspector should be rendered. - */ - constructor(params: esri.AttributeInspectorOptions, srcNodeRef: string); + constructor(params: esri.AttributeInspectorOptions, srcNodeRef: Node | string); /** Destroys the widget, used for page clean up. */ destroy(): void; /** Moves to the first feature. */ @@ -3061,13 +3190,7 @@ declare module "esri/dijit/Attribution" { * @param options An object that defines the attribution options. * @param srcNodeRef HTML element where the time slider should be rendered. */ - constructor(options: esri.AttributionOptions, srcNodeRef: Node); - /** - * Creates a new Attribution object. - * @param options An object that defines the attribution options. - * @param srcNodeRef HTML element where the time slider should be rendered. - */ - constructor(options: esri.AttributionOptions, srcNodeRef: string); + constructor(options: esri.AttributionOptions, srcNodeRef: Node | string); /** Destroy the attribution widget. */ destroy(): void; /** Finalizes the creation of the widget. */ @@ -3118,13 +3241,7 @@ declare module "esri/dijit/BasemapGallery" { * @param params Parameters used to configure the widget. * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. */ - constructor(params: esri.BasemapGalleryOptions, srcNodeRef?: Node); - /** - * Creates a new BasemapGallery dijit. - * @param params Parameters used to configure the widget. - * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. - */ - constructor(params: esri.BasemapGalleryOptions, srcNodeRef?: string); + constructor(params: esri.BasemapGalleryOptions, srcNodeRef?: Node | string); /** * Add a new basemap to the BasemapGallery's list of basemaps. * @param basemap The basemap to add to the map. @@ -3204,7 +3321,7 @@ declare module "esri/dijit/BasemapToggle" { class BasemapToggle { /** The secondary basemap to toggle to. */ basemap: string; - /** Object containing the labels and URLs for the image of each basemap. */ + /** Object containing the title and thumbnailURL for the image of each basemap. */ basemaps: any; /** Whether the widget has been loaded. */ loaded: boolean; @@ -3219,13 +3336,7 @@ declare module "esri/dijit/BasemapToggle" { * @param params Various parameters to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.BasemapToggleOptions, srcNodeRef: Node); - /** - * Creates a new BasemapToggle dijit using the given DOM node. - * @param params Various parameters to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.BasemapToggleOptions, srcNodeRef: string); + constructor(params: esri.BasemapToggleOptions, srcNodeRef: Node | string); /** Destroys the widget. */ destroy(): void; /** Hides the widget. */ @@ -3273,13 +3384,7 @@ declare module "esri/dijit/Bookmarks" { * @param params See options list for parameters. * @param srcNodeRef HTML element where the bookmark widget should be rendered. */ - constructor(params: esri.BookmarksOptions, srcNodeRef: Node); - /** - * Creates a new Bookmark widget - * @param params See options list for parameters. - * @param srcNodeRef HTML element where the bookmark widget should be rendered. - */ - constructor(params: esri.BookmarksOptions, srcNodeRef: string); + constructor(params: esri.BookmarksOptions, srcNodeRef: Node | string); /** * Add a new bookmark to the bookmark widget. * @param bookmarkItem A BookmarkItem or json object with the same structure that defines the new location. @@ -3354,13 +3459,7 @@ declare module "esri/dijit/ClassedColorSlider" { * @param params Set of parameters used to specify the ClassedColorSlider widget options. * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. */ - constructor(params: esri.ClassedColorSliderOptions, srcNodeRef: Node); - /** - * Creates a new ClassedColorSlider widget. - * @param params Set of parameters used to specify the ClassedColorSlider widget options. - * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. - */ - constructor(params: esri.ClassedColorSliderOptions, srcNodeRef: string); + constructor(params: esri.ClassedColorSliderOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; /** Fires when the ClassedColorSlider widget properties change. */ @@ -3415,13 +3514,7 @@ declare module "esri/dijit/ClassedSizeSlider" { * @param params Set of parameters used to specify the ClassedSizeSlider widget options. * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. */ - constructor(params: esri.ClassedSizeSliderOptions, srcNodeRef: Node); - /** - * Creates a new ClassedSizeSlider widget within the provided DOM node srcNodeRef. - * @param params Set of parameters used to specify the ClassedSizeSlider widget options. - * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. - */ - constructor(params: esri.ClassedSizeSliderOptions, srcNodeRef: string); + constructor(params: esri.ClassedSizeSliderOptions, srcNodeRef: Node | string); /** Fires when ClassedSizeSlider changes. */ on(type: "change", listener: (event: { breakInfos: any; target: ClassedSizeSlider }) => void): esri.Handle; /** Fires when minValue or maxValue changes in ClassedSizeSlider. */ @@ -3478,13 +3571,7 @@ declare module "esri/dijit/ColorInfoSlider" { * @param params Set of parameters used to specify the ColorInfoSlider widget options. * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. */ - constructor(params: esri.ColorInfoSliderOptions, srcNodeRef: Node); - /** - * Creates a new ColorInfoSlider widget within the provided DOM node srcNodeRef. - * @param params Set of parameters used to specify the ColorInfoSlider widget options. - * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. - */ - constructor(params: esri.ColorInfoSliderOptions, srcNodeRef: string); + constructor(params: esri.ColorInfoSliderOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; /** Fires when ColorInfoSlider changes. */ @@ -3515,13 +3602,7 @@ declare module "esri/dijit/ColorPicker" { * @param params Set of parameters used to specify the ColorPicker widget options. * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. */ - constructor(params: esri.ColorPickerOptions, srcNodeRef: Node); - /** - * Creates a new ColorPicker widget. - * @param params Set of parameters used to specify the ColorPicker widget options. - * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. - */ - constructor(params: esri.ColorPickerOptions, srcNodeRef: string); + constructor(params: esri.ColorPickerOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; /** Fires when the selected color has changed. */ @@ -3544,8 +3625,6 @@ declare module "esri/dijit/Directions" { class Directions { /** Read-only: Get the directions to all the locations along the route. */ directions: DirectionsFeatureSet; - /** An array of objects that defines the potential matches for the input locations. */ - geocoderResults: any[]; /** Indicates whether the Directions widget adds a stop on each map click. */ mapClickActive: boolean; /** Read-only: When true, the maximum number of stops for the route has been reached. */ @@ -3577,13 +3656,7 @@ declare module "esri/dijit/Directions" { * @param options Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(options: esri.DirectionsOptions, srcNodeRef: Node); - /** - * Creates a new Directions dijit using the given DOM node. - * @param options Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(options: esri.DirectionsOptions, srcNodeRef: string); + constructor(options: esri.DirectionsOptions, srcNodeRef: Node | string); /** Deprecated at v3.13. */ activate(): void; /** @@ -3591,49 +3664,13 @@ declare module "esri/dijit/Directions" { * @param stop A point that defines the stop location. * @param index The index location where the stop should be added. */ - addStop(stop: Point, index?: number): any; - /** - * Add a stop to the directions widget at the specified index location. - * @param stop A point that defines the stop location. - * @param index The index location where the stop should be added. - */ - addStop(stop: number[], index?: number): any; - /** - * Add a stop to the directions widget at the specified index location. - * @param stop A point that defines the stop location. - * @param index The index location where the stop should be added. - */ - addStop(stop: string, index?: number): any; - /** - * Add a stop to the directions widget at the specified index location. - * @param stop A point that defines the stop location. - * @param index The index location where the stop should be added. - */ - addStop(stop: any, index?: number): any; + addStop(stop: Point | number[] | string | any, index?: number): any; /** * Add multiple stops to the directions list starting at the specified location. * @param stops An array of points that define the stop locations. * @param index The index location where the stops will be added. */ - addStops(stops: Point[], index?: number): any; - /** - * Add multiple stops to the directions list starting at the specified location. - * @param stops An array of points that define the stop locations. - * @param index The index location where the stops will be added. - */ - addStops(stops: number[][], index?: number): any; - /** - * Add multiple stops to the directions list starting at the specified location. - * @param stops An array of points that define the stop locations. - * @param index The index location where the stops will be added. - */ - addStops(stops: string[], index?: number): any; - /** - * Add multiple stops to the directions list starting at the specified location. - * @param stops An array of points that define the stop locations. - * @param index The index location where the stops will be added. - */ - addStops(stops: any[], index?: number): any; + addStops(stops: Point[] | number[][] | string[] | any[], index?: number): any; /** * Center the map at the start of the specified route segment. * @param index The index of the segment where the map should be centered. @@ -3677,45 +3714,12 @@ declare module "esri/dijit/Directions" { * @param stop A point that defines the stop location. * @param index The index of the stop to update. */ - updateStop(stop: Point, index: number): any; - /** - * Update the existing stop at the specified index location. - * @param stop A point that defines the stop location. - * @param index The index of the stop to update. - */ - updateStop(stop: number[], index: number): any; - /** - * Update the existing stop at the specified index location. - * @param stop A point that defines the stop location. - * @param index The index of the stop to update. - */ - updateStop(stop: string, index: number): any; - /** - * Update the existing stop at the specified index location. - * @param stop A point that defines the stop location. - * @param index The index of the stop to update. - */ - updateStop(stop: any, index: number): any; + updateStop(stop: Point | number[] | string | any, index: number): any; /** * Update multiple stops in the directions widget by specifying an array of stops information. * @param stops An array of points that define the stop locations. */ - updateStops(stops: Point[]): any; - /** - * Update multiple stops in the directions widget by specifying an array of stops information. - * @param stops An array of points that define the stop locations. - */ - updateStops(stops: number[][]): any; - /** - * Update multiple stops in the directions widget by specifying an array of stops information. - * @param stops An array of points that define the stop locations. - */ - updateStops(stops: string[]): any; - /** - * Update multiple stops in the directions widget by specifying an array of stops information. - * @param stops An array of points that define the stop locations. - */ - updateStops(stops: any[]): any; + updateStops(stops: Point[] | number[][] | string[] | any[]): any; /** * Sets the corresponding stop to point at the user's current location. * @param stopIndex Index of the stop that will point to the user's current location. @@ -3751,12 +3755,45 @@ declare module "esri/dijit/Directions" { export = Directions; } +declare module "esri/dijit/ElevationProfile" { + import esri = require("esri"); + import Geometry = require("esri/geometry/Geometry"); + + /** (Currently in beta)The Elevation Profile widget allows a user to create an elevation profile based on a polyline geometry input parameter or existing features.NOTE: Currently there is a known issue when creating an elevation profile that crosses the international dateline multiple times. */ + class ElevationProfile { + /** The measurement unit of the polyline geometry. */ + measureUnits: string; + /** The polyline input geometry used to create the elevation profile. */ + profileGeometry: Geometry; + /** + * Create a new ElevationProfile widget using the given DOM node. + * @param options See options table below for the full descriptions of the properties needed for this object. + * @param srcNode Reference or id of the HTML element where the widget should be rendered. + */ + constructor(options: esri.ElevationProfileOptions, srcNode: Node | string); + /** Clears the elevation profile chart. */ + clearProfile(): void; + /** Destroy the widget. */ + destroy(): void; + /** Finalizes the creation of the ElevationProfile widget. */ + startup(): void; + /** Fires when the elevation profile is cleared. */ + on(type: "clear-profile", listener: (event: { target: ElevationProfile }) => void): esri.Handle; + /** Fires when the widget has fully loaded. */ + on(type: "load", listener: (event: { target: ElevationProfile }) => void): esri.Handle; + /** Fires when the elevation profile is updated. */ + on(type: "update-profile", listener: (event: { profileResults: any; target: ElevationProfile }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = ElevationProfile; +} + declare module "esri/dijit/FeatureTable" { import esri = require("esri"); import FeatureLayer = require("esri/layers/FeatureLayer"); import Map = require("esri/map"); - /** (Beta at v3.12) Creates an instance of the FeatureTable widget within the provided DOM node. */ + /** (Currently in beta) Creates an instance of the FeatureTable widget within the provided DOM node. */ class FeatureTable { /** An optional dGrid property. */ allowSelectAll: boolean; @@ -3784,8 +3821,6 @@ declare module "esri/dijit/FeatureTable" { noDataMessage: string; /** Attribute fields to include in the FeatureTable. */ outFields: string[]; - /** Indicates whether the data is editable via the widget. */ - readOnly: boolean; /** A dGrid property. */ selectionMode: string; /** @@ -3793,13 +3828,7 @@ declare module "esri/dijit/FeatureTable" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.FeatureTableOptions, srcNodeRef: Node); - /** - * Creates an instance of the FeatureTable widget within the provided DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.FeatureTableOptions, srcNodeRef: string); + constructor(params: esri.FeatureTableOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; /** Fired when a row is deselected. */ @@ -3825,13 +3854,7 @@ declare module "esri/dijit/Gallery" { * @param params See options list. * @param srcNodeRef HTML element where the gallery should be rendered. */ - constructor(params: esri.GalleryOptions, srcNodeRef: Node); - /** - * Creates a new mobile Gallery. - * @param params See options list. - * @param srcNodeRef HTML element where the gallery should be rendered. - */ - constructor(params: esri.GalleryOptions, srcNodeRef: string); + constructor(params: esri.GalleryOptions, srcNodeRef: Node | string); /** Removes any object references and associated objects created by the gallery. */ destroy(): void; /** Gets the item with the current focus. */ @@ -3874,38 +3897,20 @@ declare module "esri/dijit/Gauge" { * @param params See options list for parameters. * @param srcNodeRef HTML element where the gauge should be rendered. */ - constructor(params: esri.GaugeOptions, srcNodeRef: Node); - /** - * Create a new Gauge object. - * @param params See options list for parameters. - * @param srcNodeRef HTML element where the gauge should be rendered. - */ - constructor(params: esri.GaugeOptions, srcNodeRef: string); + constructor(params: esri.GaugeOptions, srcNodeRef: Node | string); /** Destroy the gauge. */ destroy(): void; /** * Get the value of the property from the Gauge. * @param name Property to get value. */ - get(name: string): any; + get(name: string): string | Graphic | number; /** * Set the value of a property from the Gauge. * @param name Property to set value. * @param value Value to set. */ - set(name: string, value: string): Gauge; - /** - * Set the value of a property from the Gauge. - * @param name Property to set value. - * @param value Value to set. - */ - set(name: string, value: Graphic): Gauge; - /** - * Set the value of a property from the Gauge. - * @param name Property to set value. - * @param value Value to set. - */ - set(name: string, value: number): Gauge; + set(name: string, value: string | Graphic | number): Gauge; /** Finalizes the creation of the gauge. */ startup(): void; } @@ -3917,7 +3922,7 @@ declare module "esri/dijit/Geocoder" { import GraphicsLayer = require("esri/layers/GraphicsLayer"); import Symbol = require("esri/symbols/Symbol"); - /** Add a geographic search box to an application. */ + /** Starting with version 3.13, the Search Widget supersedes the Geocoder Widget and is deprecated. */ class Geocoder { /** Currently selected locator object. */ activeGeocoder: any; @@ -3958,13 +3963,7 @@ declare module "esri/dijit/Geocoder" { * @param params Set of parameters used to specify Geocoder options. * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. */ - constructor(params: esri.GeocoderOptions, srcNodeRef: Node); - /** - * Create a new Geocoder widget using the given DOM node. - * @param params Set of parameters used to specify Geocoder options. - * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. - */ - constructor(params: esri.GeocoderOptions, srcNodeRef: string); + constructor(params: esri.GeocoderOptions, srcNodeRef: Node | string); /** Unfocus the widget's text input. */ blur(): void; /** Clears the values currently set in the widget. */ @@ -4028,13 +4027,7 @@ declare module "esri/dijit/HeatmapSlider" { * @param params Set of parameters used to specify the HeatmapSlider widget options. * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. */ - constructor(params: esri.HeatmapSliderOptions, srcNodeRef: Node); - /** - * Creates a new HeatmapSlider widget within the provided DOM node srcNodeRef. - * @param params Set of parameters used to specify the HeatmapSlider widget options. - * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. - */ - constructor(params: esri.HeatmapSliderOptions, srcNodeRef: string); + constructor(params: esri.HeatmapSliderOptions, srcNodeRef: Node | string); /** Fires when HeatmapSlider changes. */ on(type: "change", listener: (event: { colorStops: any; target: HeatmapSlider }) => void): esri.Handle; /** Fires when HeatmapSlider handle is moved. */ @@ -4054,13 +4047,7 @@ declare module "esri/dijit/HistogramTimeSlider" { * @param params Input parameters. * @param srcNodeRef HTML element where the tool should be rendered. */ - constructor(params: esri.HistogramTimeSliderOptions, srcNodeRef: Node); - /** - * Creates a new HistogramTimeSlider dijit using the given DOM node. - * @param params Input parameters. - * @param srcNodeRef HTML element where the tool should be rendered. - */ - constructor(params: esri.HistogramTimeSliderOptions, srcNodeRef: string); + constructor(params: esri.HistogramTimeSliderOptions, srcNodeRef: Node | string); /** Set related objects as null and hide the widget. */ destroy(): void; /** Finalizes the creation of the widget. */ @@ -4096,13 +4083,7 @@ declare module "esri/dijit/HomeButton" { * @param params Various parameters to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.HomeButtonOptions, srcNodeRef: Node); - /** - * Creates a new HomeButton dijit using the given DOM node. - * @param params Various parameters to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.HomeButtonOptions, srcNodeRef: string); + constructor(params: esri.HomeButtonOptions, srcNodeRef: Node | string); /** Destroys the widget. */ destroy(): void; /** Hides the widget. */ @@ -4134,19 +4115,36 @@ declare module "esri/dijit/HorizontalSlider" { * @param params Set of parameters used to specify the HorizontalSlider widget options. * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. */ - constructor(params: esri.HorizontalSliderOptions, srcNodeRef: Node); - /** - * Creates a new HorizontalSlider widget. - * @param params Set of parameters used to specify the HorizontalSlider widget options. - * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. - */ - constructor(params: esri.HorizontalSliderOptions, srcNodeRef: string); + constructor(params: esri.HorizontalSliderOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } export = HorizontalSlider; } +declare module "esri/dijit/ImageServiceMeasure" { + import esri = require("esri"); + import SimpleFillSymbol = require("esri/symbols/SimpleFillSymbol"); + import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol"); + import SimpleMarkerSymbol = require("esri/symbols/SimpleMarkerSymbol"); + + /** This widget allows you to perform measurements on image services. */ + class ImageServiceMeasure { + /** Symbol to be used when drawing a polygon or extent. */ + fillSymbol: SimpleFillSymbol; + /** Symbol to be used when drawing a line. */ + lineSymbol: SimpleLineSymbol; + /** Symbol to be used when drawing a point. */ + markerSymbol: SimpleMarkerSymbol; + /** + * Creates an instance of the ImageServiceMeasure widget. + * @param params An Object containing constructor options. + */ + constructor(params: esri.ImageServiceMeasureOptions); + } + export = ImageServiceMeasure; +} + declare module "esri/dijit/InfoWindow" { import esri = require("esri"); import InfoWindowBase = require("esri/InfoWindowBase"); @@ -4175,13 +4173,7 @@ declare module "esri/dijit/InfoWindow" { * @param params Optional parameters. * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. */ - constructor(params: any, srcNodeRef: Node); - /** - * Create a new Info Window. - * @param params Optional parameters. - * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: any, srcNodeRef: Node | string); /** Hides the InfoWindow. */ hide(): void; /** @@ -4288,6 +4280,49 @@ declare module "esri/dijit/InfoWindowLite" { export = InfoWindowLite; } +declare module "esri/dijit/LayerList" { + import esri = require("esri"); + import Map = require("esri/map"); + + /** (Currently in beta) The LayerList widget provides a list of layers that allows the toggling of layer visibility. */ + class LayerList { + /** An array of operational layers. */ + layers: any[]; + /** Indicates whether the widget has been loaded. */ + loaded: boolean; + /** Reference to the map. */ + map: Map; + /** Indicates whether to remove underscores from the layer title */ + removeUnderscores: boolean; + /** Indicates whether to show sublayers in the list of layers. */ + sublayers: boolean; + /** CSS Class for uniquely styling the widget. */ + theme: string; + /** Indicates whether to show the widget. */ + visible: boolean; + /** + * Create a new LayerList widget using the given DOM node. + * @param options Set of options used to specify LayerList options. + * @param srcNode Reference or id of the HTML element where the widget should be rendered. + */ + constructor(options: esri.LayerListOptions, srcNode: Node | string); + /** Destroy the LayerList widget. */ + destroy(): void; + /** Reloads all layers and properties that may have changed. */ + refresh(): void; + /** Finalizes the creation of the LayerList widget. */ + startup(): void; + /** Fired when the LayerList widget has fully loaded. */ + on(type: "load", listener: (event: { target: LayerList }) => void): esri.Handle; + /** Fired when refresh is called on the LabelList widget. */ + on(type: "refresh", listener: (event: { target: LayerList }) => void): esri.Handle; + /** Fired when the layer is toggled on/off within the widget. */ + on(type: "toggle", listener: (event: { layerIndex: number; subLayerIndex: number; visible: boolean; target: LayerList }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = LayerList; +} + declare module "esri/dijit/LayerSwipe" { import esri = require("esri"); import Layer = require("esri/layers/layer"); @@ -4320,13 +4355,7 @@ declare module "esri/dijit/LayerSwipe" { * @param params Various parameters to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.LayerSwipeOptions, srcNodeRef: Node); - /** - * Creates a new LayerSwipe dijit using the given DOM node. - * @param params Various parameters to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.LayerSwipeOptions, srcNodeRef: string); + constructor(params: esri.LayerSwipeOptions, srcNodeRef: Node | string); /** Destroys the widget. */ destroy(): void; /** Disables the widget. */ @@ -4356,13 +4385,7 @@ declare module "esri/dijit/Legend" { * @param params Parameters used to configure the dijit. * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. */ - constructor(params: esri.LegendOptions, srcNodeRef: Node); - /** - * Creates a new Legend dijit. - * @param params Parameters used to configure the dijit. - * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. - */ - constructor(params: esri.LegendOptions, srcNodeRef: string); + constructor(params: esri.LegendOptions, srcNodeRef: Node | string); /** Destroys the legend. */ destroy(): void; /** Refresh the legend. */ @@ -4418,13 +4441,7 @@ declare module "esri/dijit/LocateButton" { * @param params Various parameters to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.LocateButtonOptions, srcNodeRef: Node); - /** - * Creates a new LocateButton dijit using the given DOM node. - * @param params Various parameters to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.LocateButtonOptions, srcNodeRef: string); + constructor(params: esri.LocateButtonOptions, srcNodeRef: Node | string); /** Clears the point graphic. */ clear(): void; /** Destroys the widget. */ @@ -4460,13 +4477,7 @@ declare module "esri/dijit/Measurement" { * @param params See options list for parameters. * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. */ - constructor(params: esri.MeasurementOptions, srcNodeRef: Node); - /** - * Creates a new Measurement widget. - * @param params See options list for parameters. - * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. - */ - constructor(params: esri.MeasurementOptions, srcNodeRef: string); + constructor(params: esri.MeasurementOptions, srcNodeRef: Node | string); /** Remove the measurement graphics and results. */ clearResult(): void; /** Destroy the measurement widget. */ @@ -4486,17 +4497,7 @@ declare module "esri/dijit/Measurement" { * Invoke the measurement functionality of the widget by passing in a previously created geometry. * @param geometry Geometry to be measured. */ - measure(geometry: Point): void; - /** - * Invoke the measurement functionality of the widget by passing in a previously created geometry. - * @param geometry Geometry to be measured. - */ - measure(geometry: Polyline): void; - /** - * Invoke the measurement functionality of the widget by passing in a previously created geometry. - * @param geometry Geometry to be measured. - */ - measure(geometry: Polygon): void; + measure(geometry: Point | Polyline | Polygon): void; /** * Activate or deactivate a tool. * @param toolName The name of the tool to activate or deactivate. @@ -4515,7 +4516,7 @@ declare module "esri/dijit/Measurement" { /** Fires when a measurement is made but the measurement is not complete (single-click). */ on(type: "measure", listener: (event: { geometry: Geometry; toolName: string; unitName: string; values: number; target: Measurement }) => void): esri.Handle; /** Fired when the measurement is complete. */ - on(type: "measure-end", listener: (event: { geometry: Geometry; toolName: string; unitName: string; values: any; target: Measurement }) => void): esri.Handle; + on(type: "measure-end", listener: (event: { geometry: Geometry; toolName: string; unitName: string; values: number[] | number; target: Measurement }) => void): esri.Handle; /** Fires when a measurement operation begins (single-click). */ on(type: "measure-start", listener: (event: { toolName: string; unitName: string; target: Measurement }) => void): esri.Handle; /** Fires when the primary tool is changed. */ @@ -4527,6 +4528,94 @@ declare module "esri/dijit/Measurement" { export = Measurement; } +declare module "esri/dijit/ObliqueViewer" { + import esri = require("esri"); + import ArcGISImageServiceLayer = require("esri/layers/ArcGISImageServiceLayer"); + import Map = require("esri/map"); + import Geometry = require("esri/geometry/Geometry"); + import SpatialReference = require("esri/SpatialReference"); + import Extent = require("esri/geometry/Extent"); + + /** (Currently in beta) The oblique viewer widget, displays images in their native coordinate system using an Image Coordinate System (ICS). */ + class ObliqueViewer { + /** Indicates the current azimuth angle of the viewer. */ + azimuthAngle: number; + /** Image service field that denotes the sensor azimuth value for a record. */ + azimuthField: string; + /** Indicates the tolerance value applied when selecting images for a given azimuth angle value. */ + azimuthTolerance: number; + /** Image service field that denotes the sensor elevation value for a record. */ + elevationField: string; + /** Elevation value between 0 and 90 that differentiates an image as oblique or nadir. */ + elevationThreshold: number; + /** Subset of records, filtered based on current azimuth angle. */ + filteredRecords: any[]; + /** Image service layer to be used as source for oblique images. */ + imageServiceLayer: ArcGISImageServiceLayer; + /** Indicates whether current view is nadir. */ + isNadir: boolean; + /** Map object associated with the widget. */ + map: Map; + /** When true, the widget doesn't refresh itself with new oblique records when the map's extent changes. */ + noQueryOnExtentChange: boolean; + /** Raster info fields to be queried and displayed in the raster list. */ + rasterInfoFields: any[]; + /** When true, the list is populated on data refresh. */ + rasterListRefresh: boolean; + /** Oblique image data that is currently being used by the viewer. */ + records: any[]; + /** Object containing additional information about the raster. */ + selectedRaster: any; + /** Id of the raster currently being displayed. */ + selectedRasterId: number; + /** When true, thumbnail images for records are displayed in the list. */ + showThumbnail: boolean; + /** + * Creates an instance of the ObliqueViewer widget. + * @param params Constructor options. + */ + constructor(params: esri.ObliqueViewerOptions); + /** + * Projects the input geometry to the specified spatial reference. + * @param geometry The geometry to project. + * @param outSpatialReference The spatial reference to project the geometry to. + */ + projectGeometry(geometry: Geometry, outSpatialReference: SpatialReference): any; + /** + * Performs a query on the image service for oblique images covering the input geometry. + * @param geometry The input geometry to use for the search. + */ + search(geometry: Geometry): any; + /** + * Sets the records and extent on the viewer. + * @param records An array of raster data objects. + * @param extent The extent to set the viewer to. + */ + setData(records: any[], extent: Extent): void; + /** + * Projects the given extent to the map's spatial reference and sets the extent. + * @param extent The extent to project the map's spatial reference to. + */ + setExtent(extent: Extent): any; + /** + * Sets the input image (based on the image ID) to the given extent. + * @param id The ID of the raster image. + * @param extent The extent to set the raster image to. + */ + setImage(id: number, extent: Extent): void; + /** Sets the map extent to the currently selected image. */ + zoomToSelectedImage(): void; + /** Fires when the azimuth is changed. */ + on(type: "azimuth-change", listener: (event: { azimuth: number; target: ObliqueViewer }) => void): esri.Handle; + /** Fires when the selected raster is changed. */ + on(type: "raster-select", listener: (event: { selectedRasterId: number; target: ObliqueViewer }) => void): esri.Handle; + /** Fires when the viewer records are refreshed. */ + on(type: "records-refresh", listener: (event: { filteredRecords: any[]; records: any[]; target: ObliqueViewer }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = ObliqueViewer; +} + declare module "esri/dijit/OpacitySlider" { import esri = require("esri"); import RendererSlider = require("esri/dijit/RendererSlider"); @@ -4566,13 +4655,7 @@ declare module "esri/dijit/OpacitySlider" { * @param params Set of parameters used to specify the OpacitySlider widget options. * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. */ - constructor(params: esri.OpacitySliderOptions, srcNodeRef: Node); - /** - * Creates a new OpacitySlider widget within the provided DOM node srcNodeRef. - * @param params Set of parameters used to specify the OpacitySlider widget options. - * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. - */ - constructor(params: esri.OpacitySliderOptions, srcNodeRef: string); + constructor(params: esri.OpacitySliderOptions, srcNodeRef: Node | string); /** Fires when OpacitySlider changes. */ on(type: "change", listener: (event: { opacityInfo: any; target: OpacitySlider }) => void): esri.Handle; /** Fires when minValue or maxValue of OpacitySlider changes. */ @@ -4586,21 +4669,18 @@ declare module "esri/dijit/OpacitySlider" { declare module "esri/dijit/OverviewMap" { import esri = require("esri"); + import Map = require("esri/map"); /** The OverviewMap widget displays the current extent of the map within the context of a larger area. */ class OverviewMap { + /** The Map instance displayed in the OverviewMap widget's container. */ + overviewMap: Map; /** * Creates a new OverviewMap object. * @param params Parameters that define the functionality of the OverviewMap widget. * @param srcNodeRef HTML element where the widget should be rendered. */ - constructor(params: esri.OverviewMapOptions, srcNodeRef: Node); - /** - * Creates a new OverviewMap object. - * @param params Parameters that define the functionality of the OverviewMap widget. - * @param srcNodeRef HTML element where the widget should be rendered. - */ - constructor(params: esri.OverviewMapOptions, srcNodeRef: string); + constructor(params: esri.OverviewMapOptions, srcNodeRef: Node | string); /** Releases the resources used by the dijit. */ destroy(): void; /** Hide the overview map. */ @@ -4682,13 +4762,7 @@ declare module "esri/dijit/Popup" { * @param options Optional parameters. * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. */ - constructor(options: esri.PopupOptions, srcNodeRef: Node); - /** - * Create a new Popup object. - * @param options Optional parameters. - * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. - */ - constructor(options: esri.PopupOptions, srcNodeRef: string); + constructor(options: esri.PopupOptions, srcNodeRef: Node | string); /** Removes all features and destroys any pending deferreds. */ clearFeatures(): void; /** Destroy the popup. */ @@ -4728,32 +4802,17 @@ declare module "esri/dijit/Popup" { * Set the content for the info window. * @param content The content for the info window. */ - setContent(content: string): void; - /** - * Set the content for the info window. - * @param content The content for the info window. - */ - setContent(content: Function): void; + setContent(content: string | Function): void; /** * Associate an array of features or an array of deferreds that return features with the info window. * @param features An array of features or deferreds. */ - setFeatures(features: Graphic[]): void; - /** - * Associate an array of features or an array of deferreds that return features with the info window. - * @param features An array of features or deferreds. - */ - setFeatures(features: any[]): void; + setFeatures(features: Graphic[] | any[]): void; /** * Sets the info window title. * @param title The text for the title. */ - setTitle(title: string): void; - /** - * Sets the info window title. - * @param title The text for the title. - */ - setTitle(title: Function): void; + setTitle(title: string | Function): void; /** * Display the info window at the specified location. * @param location An instance of esri.geometry.Point that represents the geographic location to display the popup. @@ -4796,13 +4855,7 @@ declare module "esri/dijit/PopupMobile" { * @param options Optional parameters. * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. */ - constructor(options: esri.PopupMobileOptions, srcNodeRef: Node); - /** - * Create a new PopupMobile object. - * @param options Optional parameters. - * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. - */ - constructor(options: esri.PopupMobileOptions, srcNodeRef: string); + constructor(options: esri.PopupMobileOptions, srcNodeRef: Node | string); /** Removes all features and destroys any pending deferreds. */ clearFeatures(): void; /** Destroy the popup. */ @@ -4824,32 +4877,17 @@ declare module "esri/dijit/PopupMobile" { * Set the content for the info window. * @param content The content for the info window. */ - setContent(content: string): void; - /** - * Set the content for the info window. - * @param content The content for the info window. - */ - setContent(content: Function): void; + setContent(content: string | Function): void; /** * Associate an array of features or an array of deferreds that return features with the info window. * @param features An array of features or deferreds. */ - setFeatures(features: Graphic[]): any; - /** - * Associate an array of features or an array of deferreds that return features with the info window. - * @param features An array of features or deferreds. - */ - setFeatures(features: any[]): any; + setFeatures(features: Graphic[] | any[]): void; /** * Sets the info window title. * @param title The text for the title. */ - setTitle(title: string): void; - /** - * Sets the info window title. - * @param title The text for the title. - */ - setTitle(title: Function): void; + setTitle(title: string | Function): void; /** * Display the info window at the specified location. * @param location An instance of esri.geometry.Point that represents the geographic location to display the popup. @@ -4901,13 +4939,7 @@ declare module "esri/dijit/Print" { * @param params Parameters for the print widget. * @param srcNodeRef HTML element where the print widget button and drop down list will be rendered. */ - constructor(params: esri.PrintOptions, srcNodeRef: Node); - /** - * Creates a new Print widget. - * @param params Parameters for the print widget. - * @param srcNodeRef HTML element where the print widget button and drop down list will be rendered. - */ - constructor(params: esri.PrintOptions, srcNodeRef: string); + constructor(params: esri.PrintOptions, srcNodeRef: Node | string); /** Destroys the print widget. */ destroy(): void; /** Hide the print widget. */ @@ -4950,7 +4982,7 @@ declare module "esri/dijit/RendererSlider" { /** Toggle for showing the black handle bars. */ showHandles: boolean; /** Flexible toggle for showing labels e.g. */ - showLabels: any; + showLabels: boolean | string[]; /** Toggle for showing the horizontal line indicators from the center of the handle. */ showTicks: boolean; /** Handle positions represented as numbers that fall between minimum and maximum. */ @@ -4960,13 +4992,7 @@ declare module "esri/dijit/RendererSlider" { * @param params Set of parameters used to specify the RendererSlider widget options. * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. */ - constructor(params: esri.RendererSliderOptions, srcNodeRef: Node); - /** - * Creates a new RendererSlider widget. - * @param params Set of parameters used to specify the RendererSlider widget options. - * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. - */ - constructor(params: esri.RendererSliderOptions, srcNodeRef: string); + constructor(params: esri.RendererSliderOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; /** Fires when the user actively slides the handle. */ @@ -4988,13 +5014,7 @@ declare module "esri/dijit/Scalebar" { * @param params Parameters used to configure the widget. * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. */ - constructor(params: esri.ScalebarOptions, srcNodeRef?: Node); - /** - * Creates a new Scalebar dijit. - * @param params Parameters used to configure the widget. - * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. - */ - constructor(params: esri.ScalebarOptions, srcNodeRef?: string); + constructor(params: esri.ScalebarOptions, srcNodeRef?: Node | string); /** Destroy the scalebar. */ destroy(): void; /** Hide the scalebar dijit. */ @@ -5026,7 +5046,7 @@ declare module "esri/dijit/Search" { addLayersFromMap: boolean; /** Indicates whether to automatically navigate to the selected result. */ autoNavigate: boolean; - /** Indicates whether to automatically select the first result. */ + /** Indicates whether to automatically select and zoom to the first geocoded result. */ autoSelect: boolean; /** Indicates whether to enable an option to collapse/expand the search into a button. */ enableButtonMode: boolean; @@ -5089,13 +5109,7 @@ declare module "esri/dijit/Search" { * @param options Set of options used to specify Search options. * @param srcNode Reference or id of the HTML element where the widget should be rendered. */ - constructor(options: esri.SearchOptions, srcNode: Node); - /** - * Create a new Search widget using the given DOM node. - * @param options Set of options used to specify Search options. - * @param srcNode Reference or id of the HTML element where the widget should be rendered. - */ - constructor(options: esri.SearchOptions, srcNode: string); + constructor(options: esri.SearchOptions, srcNode: Node | string); /** Unfocus the widget's text input. */ blur(): void; /** Clears the current value, search results, suggest results, graphic, and/or graphics layer. */ @@ -5112,39 +5126,25 @@ declare module "esri/dijit/Search" { * Get the value of the property from the Search widget. * @param name String value indicating the property to get. */ - get(name: string): any; + get(name: string): any | boolean | Layer | Graphic | InfoTemplate | number | TextSymbol | Map | any[] | string; /** Hides the Search widget. */ hide(): void; /** * Depending on the sources specified, search() queries the feature layer(s) and/or performs address matching using any specified Locator(s) and returns any applicable results. * @param value This value can be a string, geometry, suggest candidate object, or an array of [latitude,longitude]. */ - search(value?: string): any; - /** - * Depending on the sources specified, search() queries the feature layer(s) and/or performs address matching using any specified Locator(s) and returns any applicable results. - * @param value This value can be a string, geometry, suggest candidate object, or an array of [latitude,longitude]. - */ - search(value?: Geometry): any; - /** - * Depending on the sources specified, search() queries the feature layer(s) and/or performs address matching using any specified Locator(s) and returns any applicable results. - * @param value This value can be a string, geometry, suggest candidate object, or an array of [latitude,longitude]. - */ - search(value?: any): any; - /** - * Depending on the sources specified, search() queries the feature layer(s) and/or performs address matching using any specified Locator(s) and returns any applicable results. - * @param value This value can be a string, geometry, suggest candidate object, or an array of [latitude,longitude]. - */ - search(value?: any[]): any; + search(value?: string | Geometry | any | number[]): any; /** * Selects a result. * @param value The result object to select. */ select(value: any): void; /** - * Set the value of a non "read-only" property from the widget. + * Sets the value of a non "read-only" property from the widget. * @param name The string value to set. + * @param value The value to set the specified property to. */ - set(name: string): any; + set(name: string, value: any | boolean | Layer | Graphic | InfoTemplate | number | TextSymbol | Map | any[] | string): void; /** Show the Search widget. */ show(): void; /** Finalizes the creation of the Search widget. */ @@ -5162,12 +5162,12 @@ declare module "esri/dijit/Search" { on(type: "focus", listener: (event: { target: Search }) => void): esri.Handle; /** Fired when the search widget has fully loaded. */ on(type: "load", listener: (event: { target: Search }) => void): esri.Handle; - /** Fired when the search method is called and returns its results. */ - on(type: "search-results", listener: (event: { activeSourceIndex: number; error: Error; numResults: number; results: any; value: string; target: Search }) => void): esri.Handle; + /** Fires when the search method is called and returns its results. */ + on(type: "search-results", listener: (event: { activeSourceIndex: number; errors: Error[]; numErrors: number; numResults: number; results: any[]; value: string; target: Search }) => void): esri.Handle; /** Fired when a search result is selected. */ on(type: "select-result", listener: (event: { result: any; source: any; sourceIndex: number; target: Search }) => void): esri.Handle; /** Fired when the suggest method is called and returns its results. */ - on(type: "suggest-results", listener: (event: { activeSourceIndex: number; error: Error; numResults: number; results: any; value: string; target: Search }) => void): esri.Handle; + on(type: "suggest-results", listener: (event: { activeSourceIndex: number; errors: Error[]; numErrors: number; numResults: number; results: any[]; value: string; target: Search }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; } export = Search; @@ -5215,13 +5215,7 @@ declare module "esri/dijit/SizeInfoSlider" { * @param params Set of parameters used to specify the SizeInfoSlider widget options. * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. */ - constructor(params: esri.SizeInfoSliderOptions, srcNodeRef: Node); - /** - * Creates a new SizeInfoSlider widget. - * @param params Set of parameters used to specify the SizeInfoSlider widget options. - * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. - */ - constructor(params: esri.SizeInfoSliderOptions, srcNodeRef: string); + constructor(params: esri.SizeInfoSliderOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; /** Fires when the SizeInfoSlider properties change. */ @@ -5248,13 +5242,7 @@ declare module "esri/dijit/SymbolStyler" { * @param params Set of parameters used to specify the SymbolStyler widget options. * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. */ - constructor(params: esri.SymbolStylerOptions, srcNodeRef: Node); - /** - * Creates a new SymbolStyler widget. - * @param params Set of parameters used to specify the SymbolStyler widget options. - * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. - */ - constructor(params: esri.SymbolStylerOptions, srcNodeRef: string); + constructor(params: esri.SymbolStylerOptions, srcNodeRef: Node | string); /** * Sets the symbol to edit. * @param symbol Symbol to edit. @@ -5292,13 +5280,7 @@ declare module "esri/dijit/TimeSlider" { * @param params Parameters for the time slider object. * @param srcNodeRef HTML element where the time slider should be rendered. */ - constructor(params: esri.TimeSliderOptions, srcNodeRef: Node); - /** - * Creates a new TimeSlider object. - * @param params Parameters for the time slider object. - * @param srcNodeRef HTML element where the time slider should be rendered. - */ - constructor(params: esri.TimeSliderOptions, srcNodeRef: string); + constructor(params: esri.TimeSliderOptions, srcNodeRef: Node | string); /** * The specified number of time stops are created for the input time extent. * @param timeExtent The time extent used to define the time slider's start and end time stops. @@ -5395,13 +5377,7 @@ declare module "esri/dijit/VisibleScaleRangeSlider" { * @param params Set of parameters used to specify the VisibleScaleRangeSlider widget options. * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. */ - constructor(params: any, srcNodeRef: Node); - /** - * Creates a new VisibleScaleRangeSlider widget. - * @param params Set of parameters used to specify the VisibleScaleRangeSlider widget options. - * @param srcNodeRef Reference or ID of the HTMLElement where the widget should be rendered. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: esri.VisibleScaleRangeSliderOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; /** Dispatched whenever minScale or maxScale changes. */ @@ -5441,10 +5417,14 @@ declare module "esri/dijit/analysis/AggregatePoints" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** An array of attribute field names and statistic types that you would like to aggregate for all points within each polygon. */ @@ -5454,13 +5434,7 @@ declare module "esri/dijit/analysis/AggregatePoints" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.AggregatePointsOptions, srcNodeRef: Node); - /** - * Creates a new AggregatePoints dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.AggregatePointsOptions, srcNodeRef: string); + constructor(params: esri.AggregatePointsOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -5478,8 +5452,14 @@ declare module "esri/dijit/analysis/AnalysisBase" { folderId: string; /** Sets the selected folder of the select folder dropdown, based on the provided folderName, when showSelectFolder is true. */ folderName: string; + /** The self response of the Portal. */ + portalSelf: any; /** The URL to the ArcGIS.com site or in-house portal where the GP server is hosted, for example "http://www.arcgis.com". */ portalUrl: string; + /** When true, adds an option to the UI that allows users to choose ready to use analysis layers from the Living Atlas Analysis Layers. */ + showReadyToUseLayers: boolean; + /** Overrides the default widget title with a custom title. */ + title: string; /** * Cancels an analysis job that is being processed. * @param jobInfo An object containing job information including job ID, status, message, etc returned by the job-status event. @@ -5554,10 +5534,14 @@ declare module "esri/dijit/analysis/CalculateDensity" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -5565,13 +5549,7 @@ declare module "esri/dijit/analysis/CalculateDensity" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: any, srcNodeRef: Node); - /** - * Creates a new CalculateDensity dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: any, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -5602,10 +5580,14 @@ declare module "esri/dijit/analysis/ConnectOriginsToDestinations" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -5613,13 +5595,7 @@ declare module "esri/dijit/analysis/ConnectOriginsToDestinations" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.ConnectOriginsToDestinationsOptions, srcNodeRef: Node); - /** - * Creates a new ConnectOriginsToDestinations dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.ConnectOriginsToDestinationsOptions, srcNodeRef: string); + constructor(params: esri.ConnectOriginsToDestinationsOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -5646,10 +5622,14 @@ declare module "esri/dijit/analysis/CreateBuffers" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** The linear unit to be used with the distance value(s). */ @@ -5659,13 +5639,7 @@ declare module "esri/dijit/analysis/CreateBuffers" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.CreateBuffersOptions, srcNodeRef: Node); - /** - * Creates a new CreateBuffers dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.CreateBuffersOptions, srcNodeRef: string); + constructor(params: esri.CreateBuffersOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -5698,10 +5672,14 @@ declare module "esri/dijit/analysis/CreateDriveTimeAreas" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -5709,13 +5687,7 @@ declare module "esri/dijit/analysis/CreateDriveTimeAreas" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.CreateDriveTimeAreasOptions, srcNodeRef: Node); - /** - * Creates a new CreateDriveTimeAreas dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.CreateDriveTimeAreasOptions, srcNodeRef: string); + constructor(params: esri.CreateDriveTimeAreasOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -5748,10 +5720,14 @@ declare module "esri/dijit/analysis/CreateViewshed" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** The height of structures or people on the ground used to establish visibility. */ @@ -5763,13 +5739,7 @@ declare module "esri/dijit/analysis/CreateViewshed" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.CreateViewshedOptions, srcNodeRef: Node); - /** - * Creates a new CreateViewshed dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.CreateViewshedOptions, srcNodeRef: string); + constructor(params: esri.CreateViewshedOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -5796,10 +5766,14 @@ declare module "esri/dijit/analysis/CreateWatersheds" { searchUnits: string; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -5807,13 +5781,7 @@ declare module "esri/dijit/analysis/CreateWatersheds" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.CreateWatershedsOptions, srcNodeRef: Node); - /** - * Creates a new CreateWatersheds dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.CreateWatershedsOptions, srcNodeRef: string); + constructor(params: esri.CreateWatershedsOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -5836,10 +5804,14 @@ declare module "esri/dijit/analysis/DeriveNewLocations" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -5847,13 +5819,7 @@ declare module "esri/dijit/analysis/DeriveNewLocations" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: any, srcNodeRef: Node); - /** - * Creates a new DeriveNewLocations dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: any, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -5880,10 +5846,14 @@ declare module "esri/dijit/analysis/DissolveBoundaries" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** An array of field names and statistical summary types that you wish to calculate from the polygons that are dissolved together. */ @@ -5893,13 +5863,7 @@ declare module "esri/dijit/analysis/DissolveBoundaries" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.DissolveBoundariesOptions, srcNodeRef: Node); - /** - * Creates a new DissolveBoundaries dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.DissolveBoundariesOptions, srcNodeRef: string); + constructor(params: esri.DissolveBoundariesOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -5928,10 +5892,14 @@ declare module "esri/dijit/analysis/EnrichLayer" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** When true, you can specify a time for traffic condition under Define areas to enrich - Driving Time. */ @@ -5941,13 +5909,7 @@ declare module "esri/dijit/analysis/EnrichLayer" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.EnrichLayerOptions, srcNodeRef: Node); - /** - * Creates a new EnrichLayer dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.EnrichLayerOptions, srcNodeRef: string); + constructor(params: esri.EnrichLayerOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -5976,10 +5938,14 @@ declare module "esri/dijit/analysis/ExtractData" { outputLayerName: string; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -5987,13 +5953,7 @@ declare module "esri/dijit/analysis/ExtractData" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.ExtractDataOptions, srcNodeRef: Node); - /** - * Creates a new ExtractData dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.ExtractDataOptions, srcNodeRef: string); + constructor(params: esri.ExtractDataOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -6016,10 +5976,14 @@ declare module "esri/dijit/analysis/FindExistingLocations" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -6027,13 +5991,7 @@ declare module "esri/dijit/analysis/FindExistingLocations" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: any, srcNodeRef: Node); - /** - * Creates a new FindExistingLocations dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: any, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -6068,10 +6026,14 @@ declare module "esri/dijit/analysis/FindHotSpots" { returnProcessInfo: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -6079,13 +6041,7 @@ declare module "esri/dijit/analysis/FindHotSpots" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.FindHotSpotsOptions, srcNodeRef: Node); - /** - * Creates a new FindHotSpots dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.FindHotSpotsOptions, srcNodeRef: string); + constructor(params: esri.FindHotSpotsOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -6122,10 +6078,14 @@ declare module "esri/dijit/analysis/FindNearest" { searchCutoffUnits: string; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -6133,13 +6093,7 @@ declare module "esri/dijit/analysis/FindNearest" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.FindNearestOptions, srcNodeRef: Node); - /** - * Creates a new FindNearest dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.FindNearestOptions, srcNodeRef: string); + constructor(params: esri.FindNearestOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -6165,10 +6119,14 @@ declare module "esri/dijit/analysis/FindSimilarLocations" { searchLayers: FeatureLayer[]; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -6176,13 +6134,7 @@ declare module "esri/dijit/analysis/FindSimilarLocations" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: any, srcNodeRef: Node); - /** - * Creates a new FindSimilarLocations dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: any, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; /** Fires when the select tool option is activated. */ @@ -6222,10 +6174,14 @@ declare module "esri/dijit/analysis/InterpolatePoints" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -6233,13 +6189,7 @@ declare module "esri/dijit/analysis/InterpolatePoints" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: any, srcNodeRef: Node); - /** - * Creates a new InterpolatePoints dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: any, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -6270,10 +6220,14 @@ declare module "esri/dijit/analysis/MergeLayers" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** @@ -6281,13 +6235,7 @@ declare module "esri/dijit/analysis/MergeLayers" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.MergeLayersOptions, srcNodeRef: Node); - /** - * Creates a new MergeLayers dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.MergeLayersOptions, srcNodeRef: string); + constructor(params: esri.MergeLayersOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -6316,10 +6264,14 @@ declare module "esri/dijit/analysis/OverlayLayers" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** When the distance between features is less than the tolerance, the features in the overlay layer will snap to the features in the input layer. */ @@ -6331,13 +6283,7 @@ declare module "esri/dijit/analysis/OverlayLayers" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.OverlayLayersOptions, srcNodeRef: Node); - /** - * Creates a new OverlayLayers dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.OverlayLayersOptions, srcNodeRef: string); + constructor(params: esri.OverlayLayersOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -6370,10 +6316,14 @@ declare module "esri/dijit/analysis/PlanRoutes" { routeCount: number; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** Provide the locations where the people or vehicles start their routes. */ @@ -6385,13 +6335,7 @@ declare module "esri/dijit/analysis/PlanRoutes" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: any, srcNodeRef: Node); - /** - * Creates a new PlanRoutes dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: any, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -6428,10 +6372,14 @@ declare module "esri/dijit/analysis/SummarizeNearby" { shapeUnits: string; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** An array of possible statistics attribute field names and summary types that you wish to calculate for all nearby features. */ @@ -6451,13 +6399,7 @@ declare module "esri/dijit/analysis/SummarizeNearby" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.SummarizeNearbyOptions, srcNodeRef: Node); - /** - * Creates a new SummarizeNearby dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.SummarizeNearbyOptions, srcNodeRef: string); + constructor(params: esri.SummarizeNearbyOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -6486,10 +6428,14 @@ declare module "esri/dijit/analysis/SummarizeWithin" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** A list of field names and statistical summary type that you wish to calculate for all features in SummaryLayer that are within each polygon in sumWithinLayer. */ @@ -6505,13 +6451,7 @@ declare module "esri/dijit/analysis/SummarizeWithin" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: esri.SummarizeWithinOptions, srcNodeRef: Node); - /** - * Creates a new SummarizeWithin dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: esri.SummarizeWithinOptions, srcNodeRef: string); + constructor(params: esri.SummarizeWithinOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -6538,10 +6478,14 @@ declare module "esri/dijit/analysis/TraceDownstream" { returnFeatureCollection: boolean; /** When true, the choose extent checkbox will be shown. */ showChooseExtent: boolean; + /** Indicates whether to show the close icon on the widget's user interface. */ + showCloseIcon: boolean; /** When true, the show credit option is visible. */ showCredits: boolean; /** When true, the help links will be shown. */ showHelp: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder: boolean; /** The trace line will be split into multiple lines where each line is of the specified length. */ @@ -6553,13 +6497,7 @@ declare module "esri/dijit/analysis/TraceDownstream" { * @param params Various options to configure this dijit. * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ - constructor(params: any, srcNodeRef: Node); - /** - * Creates a new TraceDownstream dijit using the given DOM node. - * @param params Various options to configure this dijit. - * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: any, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; } @@ -6596,13 +6534,7 @@ declare module "esri/dijit/editing/AttachmentEditor" { * @param params No parameter options. * @param srcNodeRef HTML element where the widget is rendered. */ - constructor(params: any, srcNodeRef: Node); - /** - * Creates a new AttachmentEditor object. - * @param params No parameter options. - * @param srcNodeRef HTML element where the widget is rendered. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: any, srcNodeRef: Node | string); /** * Display the attachment editor. * @param graphic Graphic, with attachments, to display in the attachment editor. @@ -6655,6 +6587,7 @@ declare module "esri/dijit/editing/Delete" { declare module "esri/dijit/editing/Editor" { import esri = require("esri"); + import Edit = require("esri/toolbars/edit"); /** The Editor widget provides out-of-the-box editing capabilities using an editable layer in a Feature Service. */ class Editor { @@ -6678,18 +6611,14 @@ declare module "esri/dijit/editing/Editor" { static CREATE_TOOL_RECTANGLE: any; /** Triangle tool */ static CREATE_TOOL_TRIANGLE: any; + /** The default Edit toolbar instance. */ + editToolbar: Edit; /** * Creates a new Editor object. * @param params Parameters that define the functionality of the editor widget. * @param srcNodeRef HTML element where the widget should be rendered. */ - constructor(params: esri.EditorOptions, srcNodeRef: Node); - /** - * Creates a new Editor object. - * @param params Parameters that define the functionality of the editor widget. - * @param srcNodeRef HTML element where the widget should be rendered. - */ - constructor(params: esri.EditorOptions, srcNodeRef: string); + constructor(params: esri.EditorOptions, srcNodeRef: Node | string); /** Finalizes the creation of the widget. */ startup(): void; /** Fires when the widget has fully loaded. */ @@ -6713,13 +6642,7 @@ declare module "esri/dijit/editing/TemplatePicker" { * @param params FeatureLayers or items are required all other parameters are optional. * @param srcNodeRef HTML element where the TemplatePicker will be rendered. */ - constructor(params: esri.TemplatePickerOptions, srcNodeRef: Node); - /** - * Creates a new TemplatePicker object that displays a gallery of templates from the input feature layers or items. - * @param params FeatureLayers or items are required all other parameters are optional. - * @param srcNodeRef HTML element where the TemplatePicker will be rendered. - */ - constructor(params: esri.TemplatePickerOptions, srcNodeRef: string); + constructor(params: esri.TemplatePickerOptions, srcNodeRef: Node | string); /** * Get or set the properties of the template picker. * @param name Name of the attribute of interest. @@ -6791,13 +6714,7 @@ declare module "esri/dijit/geoenrichment/DataBrowser" { * @param options Optional parameters used to create the layer. * @param srcNodeRef Reference or id of an HTML element where the DataBrowser should be rendered. */ - constructor(options: esri.DataBrowserOptions, srcNodeRef: Node); - /** - * Creates a new DataBrowser dijit using the given DOM node. - * @param options Optional parameters used to create the layer. - * @param srcNodeRef Reference or id of an HTML element where the DataBrowser should be rendered. - */ - constructor(options: esri.DataBrowserOptions, srcNodeRef: string); + constructor(options: esri.DataBrowserOptions, srcNodeRef: Node | string); /** Finalizes the creation of the DataBrowser. */ startup(): void; /** Fires when user clicks the Back button. */ @@ -6816,6 +6733,9 @@ declare module "esri/dijit/geoenrichment/DataBrowser" { declare module "esri/dijit/geoenrichment/InfoGraphic" { import esri = require("esri"); import GeometryStudyArea = require("esri/tasks/geoenrichment/GeometryStudyArea"); + import RingBuffer = require("esri/tasks/geoenrichment/RingBuffer"); + import DriveBuffer = require("esri/tasks/geoenrichment/DriveBuffer"); + import IntersectingGeographies = require("esri/tasks/geoenrichment/IntersectingGeographies"); import FeatureSet = require("esri/tasks/FeatureSet"); /** Displays an Infographic of one or more variables that describe the geographic context of a location. */ @@ -6833,7 +6753,7 @@ declare module "esri/dijit/geoenrichment/InfoGraphic" { /** The study area for this Infographic. */ studyArea: GeometryStudyArea; /** The options to apply to the study area. */ - studyAreaOptions: any; + studyAreaOptions: RingBuffer | DriveBuffer | IntersectingGeographies; /** An HTML template string used to define the Infographic subtitle. */ subtitle: string; /** The title of the Infographic. */ @@ -6847,13 +6767,7 @@ declare module "esri/dijit/geoenrichment/InfoGraphic" { * @param params Various optional parameters that can be used to configure the dijit. * @param srcNodeRef Reference or id of an HTML element where the Infographic should be rendered. */ - constructor(params: any, srcNodeRef: Node); - /** - * Creates a new Infographic dijit using the given DOM node. - * @param params Various optional parameters that can be used to configure the dijit. - * @param srcNodeRef Reference or id of an HTML element where the Infographic should be rendered. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: any, srcNodeRef: Node | string); /** * Define the infographic data. * @param data Specify the FeatureSet containing the custom data to display in the Infographic. @@ -6901,13 +6815,7 @@ declare module "esri/dijit/geoenrichment/InfographicsCarousel" { * @param params Various optional parameters that can be used to configure the dijit. * @param srcNodeRef Reference or id of an HTML element where the Directions widget should be rendered. */ - constructor(params: any, srcNodeRef: Node); - /** - * Creates a new InfographicsCarousel dijit using the given DOM node. - * @param params Various optional parameters that can be used to configure the dijit. - * @param srcNodeRef Reference or id of an HTML element where the Directions widget should be rendered. - */ - constructor(params: any, srcNodeRef: string); + constructor(params: any, srcNodeRef: Node | string); /** Finalizes the creation of this dijit. */ startup(): void; /** Fires if an error occurs in retrieving data for the study area. */ @@ -6924,10 +6832,14 @@ declare module "esri/dijit/geoenrichment/InfographicsCarousel" { } declare module "esri/dijit/geoenrichment/InfographicsOptions" { + import RingBuffer = require("esri/tasks/geoenrichment/RingBuffer"); + import DriveBuffer = require("esri/tasks/geoenrichment/DriveBuffer"); + import IntersectingGeographies = require("esri/tasks/geoenrichment/IntersectingGeographies"); + /** InfographicsOptions is used to customize and configure the Infographic's included in a InfographicCarousel. */ class InfographicsOptions { /** The options to apply to the study area. */ - studyAreaOptions: any; + studyAreaOptions: RingBuffer | DriveBuffer | IntersectingGeographies; /** The name of the css theme used to format the InfographicsCarousel. */ theme: string; /** @@ -6977,19 +6889,7 @@ declare module "esri/dijit/util/busyIndicator" { * @param target The String (Node id, dijit/_WidgetBase id), HTMLElement reference (Node), or dijit/_WidgetBase. * @param params (Optional) The params options can be used when needing more fine-grained control. */ - create(target: string, params?: any): any; - /** - * Creates a busy indicator on a target. - * @param target The String (Node id, dijit/_WidgetBase id), HTMLElement reference (Node), or dijit/_WidgetBase. - * @param params (Optional) The params options can be used when needing more fine-grained control. - */ - create(target: HTMLElement, params?: any): any; - /** - * Creates a busy indicator on a target. - * @param target The String (Node id, dijit/_WidgetBase id), HTMLElement reference (Node), or dijit/_WidgetBase. - * @param params (Optional) The params options can be used when needing more fine-grained control. - */ - create(target: any, params?: any): any; + create(target: string | HTMLElement | any, params?: any): any; }; export = busyIndicator; } @@ -7003,42 +6903,22 @@ declare module "esri/domUtils" { * Returns the DOM node from HTMLElement or dijit/_WidgetBase. * @param target The HTMLElement or dijit/_WidgetBase to retrieve. */ - getNode(target: HTMLElement): Node; - /** - * Returns the DOM node from HTMLElement or dijit/_WidgetBase. - * @param target The HTMLElement or dijit/_WidgetBase to retrieve. - */ - getNode(target: any): Node; + getNode(target: HTMLElement | any): Node; /** * Hides the HTMLElement or dijit/_WidgetBase. * @param target The HTMLElement or dijit/_WidgetBase. */ - hide(target: HTMLElement): void; - /** - * Hides the HTMLElement or dijit/_WidgetBase. - * @param target The HTMLElement or dijit/_WidgetBase. - */ - hide(target: any): void; + hide(target: HTMLElement | any): void; /** * Shows the HTMLElement or dijit/_WidgetBase. * @param target The HTMLElement or dijit/_WidgetBase. */ - show(target: HTMLElement): void; - /** - * Shows the HTMLElement or dijit/_WidgetBase. - * @param target The HTMLElement or dijit/_WidgetBase. - */ - show(target: any): void; + show(target: HTMLElement | any): void; /** * If the target (HTMLElement or dijit/_WidgetBase) is currently visible, the target is hidden. * @param target The HTMLElement or dijit/_WidgetBase. */ - toggle(target: HTMLElement): void; - /** - * If the target (HTMLElement or dijit/_WidgetBase) is currently visible, the target is hidden. - * @param target The HTMLElement or dijit/_WidgetBase. - */ - toggle(target: any): void; + toggle(target: HTMLElement | any): void; }; export = domUtils; } @@ -7046,13 +6926,13 @@ declare module "esri/domUtils" { declare module "esri/geometry/Circle" { import esri = require("esri"); import Polygon = require("esri/geometry/Polygon"); - import SpatialReference = require("esri/SpatialReference"); import Point = require("esri/geometry/Point"); + import SpatialReference = require("esri/SpatialReference"); /** A circle (Polygon) created by a specified center point. */ class Circle extends Polygon { /** Center point of the circle. */ - center: any; + center: Point | number[]; /** The radius of the circle based. */ radius: number; /** Unit of the radius. */ @@ -7066,13 +6946,7 @@ declare module "esri/geometry/Circle" { * @param center Center point of the circle. * @param options See options descriptions for further information. */ - constructor(center: Point, options?: esri.CircleOptions1); - /** - * Create a new Circle by specifying an input center location using either an esri.geometry.Point object or a latitude/longitude array and an object with the following optional properties: radius, radiusUnits, geodesic and numberOfPoints. - * @param center Center point of the circle. - * @param options See options descriptions for further information. - */ - constructor(center: number[], options?: esri.CircleOptions1); + constructor(center: Point | number[], options?: esri.CircleOptions1); /** * Create a new Circle by specifying an object with a required center location, defined as a longitude/latitude array or an esri.geometry.Point, and the following additional optional parameters: radius, radiusUnits, geodesic, and numberOfPoints. * @param params If no center parameter is provided, it must be set within the options. @@ -7133,22 +7007,22 @@ declare module "esri/geometry/Extent" { /** Distance between xmin and xmax. */ getWidth(): number; /** - * Returns the interesection extent if the input geometry is an extent that intersects this extent. + * Returns the intersection extent if the input geometry is an extent that intersects this extent. * @param geometry The geometry used to test the intersection. */ - intersects(geometry: Geometry): any; + intersects(geometry: Geometry): Extent | boolean; /** Returns an array with either one Extent that's been shifted to within +/- 180 or two Extents if the original extent intersects the dateline. */ normalize(): Extent[]; /** * Returns a new Extent with x and y offsets. - * @param dx The offset distance in map units for the y-coordinate. - * @param dy The offset distance in map units for the x-coordinate. + * @param dx The offset distance in map units for the x-coordinate. + * @param dy The offset distance in map units for the y-coordinate. */ offset(dx: number, dy: number): Extent; /** Returns an extent with a spatial reference with a custom shifted central meridian if the extent intersects the dateline. */ shiftCentralMeridian(): Extent; /** - * Expands this extent to include the extent of the argument. + * Expands this extent to include the extent of the argument.NOTE: Performing a Union returns a new extent as opposed to modifying the existing extent. * @param extent The minx, miny, maxx, and maxy bounding box. */ union(extent: Extent): Extent; @@ -7224,12 +7098,7 @@ declare module "esri/geometry/Multipoint" { * Adds a point to the Multipoint. * @param point The point to add. */ - addPoint(point: Point): Multipoint; - /** - * Adds a point to the Multipoint. - * @param point The point to add. - */ - addPoint(point: number[]): Multipoint; + addPoint(point: Point | number[]): Multipoint; /** Gets the extent of all the points. */ getExtent(): Extent; /** @@ -7362,22 +7231,12 @@ declare module "esri/geometry/Polygon" { * Create a new polygon by providing an array of geographic coordinate pairs. * @param coordinates An array of geographic coordinates that define the polygon. */ - constructor(coordinates: number[][]); - /** - * Create a new polygon by providing an array of geographic coordinate pairs. - * @param coordinates An array of geographic coordinates that define the polygon. - */ - constructor(coordinates: number[][][]); + constructor(coordinates: number[][] | number[][][]); /** * Adds a ring to the Polygon. * @param ring A polygon ring. */ - addRing(ring: Point[]): Polygon; - /** - * Adds a ring to the Polygon. - * @param ring A polygon ring. - */ - addRing(ring: number[][]): Polygon; + addRing(ring: Point[] | number[][]): Polygon; /** * Checks on the client if the specified point is inside the polygon. * @param point The location defined by an X- and Y- coordinate in map units. @@ -7409,12 +7268,7 @@ declare module "esri/geometry/Polygon" { * Checks if a Polygon ring is clockwise. * @param ring A polygon ring. */ - isClockwise(ring: Point[]): boolean; - /** - * Checks if a Polygon ring is clockwise. - * @param ring A polygon ring. - */ - isClockwise(ring: number[][]): boolean; + isClockwise(ring: Point[] | number[][]): boolean; /** * When true, the polygon is self-intersecting which means that the ring of the polygon crosses itself. * @param polygon The polygon to test for self-intersection. @@ -7466,22 +7320,12 @@ declare module "esri/geometry/Polyline" { * Create a new polyline by providing an array of geographic coordinates. * @param coordinates An array of geographic coordinates that define the polyline. */ - constructor(coordinates: number[][]); - /** - * Create a new polyline by providing an array of geographic coordinates. - * @param coordinates An array of geographic coordinates that define the polyline. - */ - constructor(coordinates: number[][][]); + constructor(coordinates: number[][] | number[][][]); /** * Adds a path to the Polyline. * @param path Path to add to the Polyline. */ - addPath(path: Point[]): Polyline; - /** - * Adds a path to the Polyline. - * @param path Path to add to the Polyline. - */ - addPath(path: number[][]): Polyline; + addPath(path: Point[] | number[][]): Polyline; /** Returns the extent of the Polyline. */ getExtent(): Extent; /** @@ -7601,45 +7445,22 @@ declare module "esri/geometry/geodesicUtils" { declare module "esri/geometry/geometryEngine" { import Geometry = require("esri/geometry/Geometry"); + import Polygon = require("esri/geometry/Polygon"); import Extent = require("esri/geometry/Extent"); import Polyline = require("esri/geometry/Polyline"); import SpatialReference = require("esri/SpatialReference"); import Point = require("esri/geometry/Point"); - /** (Beta at v3.13) A client-side geometry engine. */ + /** (Currently in beta) A client-side geometry engine. */ var geometryEngine: { /** - * Creates buffer polygons at a specified distance around the given geometries. + * Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries. * @param geometry The buffer input geometry. * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. + * @param unit Unit for the distance(s). * @param unionResults Whether the output geometries should be unioned into a single polygon. */ - buffer(geometry: Geometry, distance: number[], unit?: number, unionResults?: boolean): any; - /** - * Creates buffer polygons at a specified distance around the given geometries. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - buffer(geometry: Geometry[], distance: number, unit?: number, unionResults?: boolean): any; - /** - * Creates buffer polygons at a specified distance around the given geometries. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - buffer(geometry: Geometry, distance: number, unit?: number, unionResults?: boolean): any; - /** - * Creates buffer polygons at a specified distance around the given geometries. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - buffer(geometry: Geometry[], distance: number[], unit?: number, unionResults?: boolean): any; + buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; /** * Calculates the clipped geometry from a target geometry by an envelope. * @param geometry The geometry to be clipped. @@ -7657,13 +7478,7 @@ declare module "esri/geometry/geometryEngine" { * @param geometry The input geometry. * @param merge Whether to merge output geometries. */ - convexHull(geometry: Geometry, merge?: boolean): any; - /** - * Calculates the convex hull of the input geometry. - * @param geometry The input geometry. - * @param merge Whether to merge output geometries. - */ - convexHull(geometry: Geometry[], merge?: boolean): any; + convexHull(geometry: Geometry | Geometry[], merge?: boolean): Geometry | Geometry[]; /** * Indicates if one geometry crosses another geometry. * @param geometry1 The geometry to cross. @@ -7671,7 +7486,7 @@ declare module "esri/geometry/geometryEngine" { */ crosses(geometry1: Geometry, geometry2: Geometry): boolean; /** - * Split the input polyline or polygon where it crosses a cutting polyline. + * Split the input Polyline or Polygon where it crosses a cutting Polyline. * @param geometry The geometry to be cut. * @param cutter The polyline to cut the geometry. */ @@ -7682,36 +7497,30 @@ declare module "esri/geometry/geometryEngine" { * @param maxSegmentLength The maximum segment length allowed. * @param maxSegmentLengthUnit Unit for the maximum segment length. */ - densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit?: number): Geometry; + densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; /** * Creates the difference of two geometries. - * @param geometry The input geometry. - * @param subtractor The geometry being subtracted. + * @param inputGeometry The input geometry to subtract from. + * @param subtractor The geometry being subtracted from inputGeometry. */ - difference(geometry: Geometry, subtractor: Geometry): any; + difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): Geometry | Geometry[]; /** - * Creates the difference of two geometries. - * @param geometry The input geometry. - * @param subtractor The geometry being subtracted. - */ - difference(geometry: Geometry[], subtractor: Geometry): any; - /** - * Indicates if one geometry is disjoint from another geometry. - * @param geometry1 The base geometry that is tested for within relationship to the other geometry. + * Indicates if one geometry is disjoint (doesn't intersect in any way) with another geometry. + * @param geometry1 The base geometry that is tested for the "disjoint" relationship to the other geometry. * @param geometry2 The comparison geometry that is tested for the disjoint relationship to the other geometry. */ disjoint(geometry1: Geometry, geometry2: Geometry): boolean; /** - * Calculates the 2D planar shortest distance between two geometries. - * @param geometry1 - * @param geometry2 + * Calculates the shortest planar distance between two geometries. + * @param geometry1 First input geometry. + * @param geometry2 Second input geometry. * @param distanceUnit Units of the return value. */ - distance(geometry1: Geometry, geometry2: Geometry, distanceUnit?: number): number; + distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): number; /** * Indicates if two geometries are equal. - * @param geometry1 - * @param geometry2 + * @param geometry1 First input geometry. + * @param geometry2 Second input geometry. */ equals(geometry1: Geometry, geometry2: Geometry): boolean; /** @@ -7738,63 +7547,33 @@ declare module "esri/geometry/geometryEngine" { * @param removeDegenerateParts When true, the degenerate parts of the geometry will be removed from the output (may be undesired for drawing). * @param maxDeviationUnit A unit for maximum deviation. */ - generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: number): Geometry; + generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): Geometry; /** - * Calculates area of input geometry using geographic (geodesic) coordinates. - * @param geometry + * Calculates the area of the input geometry. + * @param geometry The input geometry. * @param unit Units of the return value. */ - geodesicArea(geometry: Geometry, unit?: number): number; + geodesicArea(geometry: Geometry, unit: string | number): number; /** - * Creates buffer polygons at a specified distance around the given geometries using geographic (geodesic) coordinates. + * Creates geodesic buffer polygons at a specified distance around the input geometries. * @param geometry The buffer input geometry. * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. + * @param unit Unit for the distance(s). * @param unionResults Whether the output geometries should be unioned into a single polygon. */ - geodesicBuffer(geometry: Geometry, distance: number[], unit?: number, unionResults?: boolean): any; + geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; /** - * Creates buffer polygons at a specified distance around the given geometries using geographic (geodesic) coordinates. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - geodesicBuffer(geometry: Geometry[], distance: number, unit?: number, unionResults?: boolean): any; - /** - * Creates buffer polygons at a specified distance around the given geometries using geographic (geodesic) coordinates. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - geodesicBuffer(geometry: Geometry, distance: number, unit?: number, unionResults?: boolean): any; - /** - * Creates buffer polygons at a specified distance around the given geometries using geographic (geodesic) coordinates. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - geodesicBuffer(geometry: Geometry[], distance: number[], unit?: number, unionResults?: boolean): any; - /** - * Calculates length of the input geometry using geographic (geodesic) coordinates. - * @param geometry + * Calculates the length of the input geometry. + * @param geometry The input geometry. * @param unit Units of the return value. */ - geodesicLength(geometry: Geometry, unit?: number): number; + geodesicLength(geometry: Geometry, unit: string | number): number; /** * Creates a new geometry through intersection between two geometries. * @param geometry The input geometry. * @param intersector The geometry being intersected. */ - intersect(geometry: Geometry, intersector: Geometry): any; - /** - * Creates a new geometry through intersection between two geometries. - * @param geometry The input geometry. - * @param intersector The geometry being intersected. - */ - intersect(geometry: Geometry[], intersector: Geometry): any; + intersect(geometry: Geometry | Geometry[], intersector: Geometry): Geometry | Geometry[]; /** * Indicates if one geometry intersects another geometry. * @param geometry1 The geometry that is tested for the intersects relationship to the other geometry. @@ -7802,26 +7581,26 @@ declare module "esri/geometry/geometryEngine" { */ intersects(geometry1: Geometry, geometry2: Geometry): boolean; /** - * Indicates if the given geometry is simple. + * Indicates if the given geometry is topologically simple. * @param geometry Geometry */ isSimple(geometry: Geometry): boolean; /** * Finds the coordinate of the geometry which is closest to the specified point. * @param geometry The geometry to consider. - * @param inputPoint The point to find the nearest coordinate in the geometry for. + * @param inputPoint The point used to search the nearest coordinate in the geometry. */ nearestCoordinate(geometry: Geometry, inputPoint: Point): any; /** * Finds vertex on the geometry nearest to the specified point. * @param geometry The geometry to consider. - * @param inputPoint The point to find the nearest vertex in the geometry for. + * @param inputPoint The point used to search the nearest vertex in the geometry. */ nearestVertex(geometry: Geometry, inputPoint: Point): any; /** * Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest and returns them as an array of objects. * @param geometry The geometry to consider. - * @param inputPoint The point to start from. + * @param inputPoint The point from which to measure. * @param searchRadius The search radius. * @param maxVertexCountToReturn The maximum number number of vertices to return. */ @@ -7829,23 +7608,13 @@ declare module "esri/geometry/geometryEngine" { /** * Creates offset version of the input geometry. * @param geometry The geometries to offset. - * @param distance The offset distance for the Geometries. + * @param offsetDistance The offset distance for the Geometries. * @param offsetUnit Unit for the offset. * @param joinType The join type. * @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. * @param flattenError Applicable to ROUND, flattenError determines the maximum distance of the resulting segments compared to the true circular arc. */ - offset(geometry: Geometry, distance: number, offsetUnit: number, joinType: number, bevelRatio?: number, flattenError?: number): any; - /** - * Creates offset version of the input geometry. - * @param geometry The geometries to offset. - * @param distance The offset distance for the Geometries. - * @param offsetUnit Unit for the offset. - * @param joinType The join type. - * @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. - * @param flattenError Applicable to ROUND, flattenError determines the maximum distance of the resulting segments compared to the true circular arc. - */ - offset(geometry: Geometry[], distance: number, offsetUnit: number, joinType: number, bevelRatio?: number, flattenError?: number): any; + offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): Geometry | Geometry[]; /** * Indicates if one geometry overlaps another geometry. * @param geometry1 The base geometry that is tested for overlaps relationship to the other geometry. @@ -7853,22 +7622,22 @@ declare module "esri/geometry/geometryEngine" { */ overlaps(geometry1: Geometry, geometry2: Geometry): boolean; /** - * Calculates the area of the input geometry using projected (planar) coordinates. - * @param geometry + * Calculates the area of the input geometry. + * @param geometry The input geometry. * @param unit Units of the return value. */ - planarArea(geometry: Geometry, unit?: number): number; + planarArea(geometry: Geometry, unit: string | number): number; /** - * Calculates the length of the input geometry using projected (planar) coordinates. - * @param geometry + * Calculates the length of the input geometry. + * @param geometry The input geometry. * @param unit Units of the return value. */ - planarLength(geometry: Geometry, unit: number): number; + planarLength(geometry: Geometry, unit: string | number): number; /** - * Indicates if the given relation holds for the two geometries. + * Indicates if the given DE-9IM relation holds for the two geometries. * @param geometry1 The first geometry for the relation. * @param geometry2 The second geometry for the relation. - * @param relation The DE-9IM matrix relation encoded as a string. + * @param relation The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to test against the relationship of the two geometries. */ relate(geometry1: Geometry, geometry2: Geometry, relation: string): boolean; /** @@ -7880,7 +7649,7 @@ declare module "esri/geometry/geometryEngine" { rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): Geometry; /** * Performs the simplify operation on the geometry which alters the given geometries to make their definitions topologically legal with respect to their geometry type. - * @param geometry Geometry + * @param geometry The geometry to be simplified. */ simplify(geometry: Geometry): Geometry; /** @@ -7888,13 +7657,7 @@ declare module "esri/geometry/geometryEngine" { * @param leftGeometry One of the Geometry instances in the XOR operation. * @param rightGeometry One of the Geometry instances in the XOR operation. */ - symmetricDifference(leftGeometry: Geometry, rightGeometry: Geometry): any; - /** - * Creates the symmetric difference of two geometries. - * @param leftGeometry One of the Geometry instances in the XOR operation. - * @param rightGeometry One of the Geometry instances in the XOR operation. - */ - symmetricDifference(leftGeometry: Geometry[], rightGeometry: Geometry): any; + symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): Geometry | Geometry[]; /** * Indicates if one geometry touches another geometry. * @param geometry1 The geometry which may be touching another geometry. @@ -7923,40 +7686,16 @@ declare module "esri/geometry/geometryEngineAsync" { import SpatialReference = require("esri/SpatialReference"); import Point = require("esri/geometry/Point"); - /** (Beta at v3.13) A client-side asynchronous geometry engine. */ + /** (Currently in beta) A client-side asynchronous geometry engine. */ var geometryEngineAsync: { /** - * Creates buffer polygons at a specified distance around the given geometries. + * Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries. * @param geometry The buffer input geometry. * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. + * @param unit Unit for the distance(s). * @param unionResults Whether the output geometries should be unioned into a single polygon. */ - buffer(geometry: Geometry, distance: number[], unit?: number, unionResults?: boolean): any; - /** - * Creates buffer polygons at a specified distance around the given geometries. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - buffer(geometry: Geometry[], distance: number, unit?: number, unionResults?: boolean): any; - /** - * Creates buffer polygons at a specified distance around the given geometries. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - buffer(geometry: Geometry, distance: number, unit?: number, unionResults?: boolean): any; - /** - * Creates buffer polygons at a specified distance around the given geometries. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - buffer(geometry: Geometry[], distance: number[], unit?: number, unionResults?: boolean): any; + buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): any; /** * Calculates the clipped geometry from a target geometry by an envelope. * @param geometry The geometry to be clipped. @@ -7974,13 +7713,7 @@ declare module "esri/geometry/geometryEngineAsync" { * @param geometry The input geometry. * @param merge Whether to merge output geometries. */ - convexHull(geometry: Geometry, merge?: boolean): any; - /** - * Calculates the convex hull of the input geometry. - * @param geometry The input geometry. - * @param merge Whether to merge output geometries. - */ - convexHull(geometry: Geometry[], merge?: boolean): any; + convexHull(geometry: Geometry | Geometry[], merge?: boolean): any; /** * Indicates if one geometry crosses another geometry. * @param geometry1 The geometry to cross. @@ -7997,43 +7730,37 @@ declare module "esri/geometry/geometryEngineAsync" { * Densify geometries by plotting points between existing vertices. * @param geometry The geometry to be densified. * @param maxSegmentLength The maximum segment length allowed. - * @param maxSegmentLengthUnit Unit for the maximum segment length. + * @param maxSegmentLengthUnit Defaults to the units of the input geometries. */ - densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit?: number): any; + densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): any; /** * Creates the difference of two geometries. - * @param geometry The input geometry. + * @param inputGeometry The input geometry to subtract from. * @param subtractor The geometry being subtracted. */ - difference(geometry: Geometry, subtractor: Geometry): any; + difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): any; /** - * Creates the difference of two geometries. - * @param geometry The input geometry. - * @param subtractor The geometry being subtracted. - */ - difference(geometry: Geometry[], subtractor: Geometry): any; - /** - * Indicates if one geometry is disjoint from another geometry. - * @param geometry1 The base geometry that is tested for within relationship to the other geometry. + * Indicates if one geometry is disjoint (doesn't intersect in any way) with another geometry. + * @param geometry1 The base geometry that is tested for the "disjoint" relationship to the other geometry. * @param geometry2 The comparison geometry that is tested for the disjoint relationship to the other geometry. */ disjoint(geometry1: Geometry, geometry2: Geometry): any; /** - * Calculates the 2D planar shortest distance between two geometries. - * @param geometry1 - * @param geometry2 + * Calculates the shortest planar distance between two geometries. + * @param geometry1 First input geometry. + * @param geometry2 Second input geometry. * @param distanceUnit Units of the return value. */ - distance(geometry1: Geometry, geometry2: Geometry, distanceUnit?: number): any; + distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): any; /** * Indicates if two geometries are equal. - * @param geometry1 - * @param geometry2 + * @param geometry1 First input geometry. + * @param geometry2 Second input geometry. */ equals(geometry1: Geometry, geometry2: Geometry): any; /** * Returns an object containing additional information about the input spatial reference. - * @param spatialReference The spatial Reference. + * @param spatialReference The input spatial reference. */ extendedSpatialReferenceInfo(spatialReference: SpatialReference): any; /** @@ -8053,65 +7780,35 @@ declare module "esri/geometry/geometryEngineAsync" { * @param geometry The geometry to be generalized. * @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry. * @param removeDegenerateParts When true, the degenerate parts of the geometry will be removed from the output (may be undesired for drawing). - * @param maxDeviationUnit A unit for maximum deviation. + * @param maxDeviationUnit Defaults to the units of the input geometries. */ - generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: number): any; + generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): any; /** - * Calculates area of input geometry using geographic (geodesic) coordinates. - * @param geometry + * Calculates the area of the input geometry. + * @param geometry The input geometry. * @param unit Units of the return value. */ - geodesicArea(geometry: Geometry, unit?: number): any; + geodesicArea(geometry: Geometry, unit: string | number): any; /** - * Creates buffer polygons at a specified distance around the given geometries using geographic (geodesic) coordinates. + * Creates geodesic buffer polygons at a specified distance around the input geometries. * @param geometry The buffer input geometry. * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. + * @param unit Unit for the distance(s). * @param unionResults Whether the output geometries should be unioned into a single polygon. */ - geodesicBuffer(geometry: Geometry, distance: number[], unit?: number, unionResults?: boolean): any; + geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): any; /** - * Creates buffer polygons at a specified distance around the given geometries using geographic (geodesic) coordinates. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - geodesicBuffer(geometry: Geometry[], distance: number, unit?: number, unionResults?: boolean): any; - /** - * Creates buffer polygons at a specified distance around the given geometries using geographic (geodesic) coordinates. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - geodesicBuffer(geometry: Geometry, distance: number, unit?: number, unionResults?: boolean): any; - /** - * Creates buffer polygons at a specified distance around the given geometries using geographic (geodesic) coordinates. - * @param geometry The buffer input geometry. - * @param distance The specified distance(s) for buffering. - * @param unit Unit for the distances. - * @param unionResults Whether the output geometries should be unioned into a single polygon. - */ - geodesicBuffer(geometry: Geometry[], distance: number[], unit?: number, unionResults?: boolean): any; - /** - * Calculates length of the input geometry using geographic (geodesic) coordinates. - * @param geometry + * Calculates the length of the input geometry. + * @param geometry The input geometry. * @param unit Units of the return value. */ - geodesicLength(geometry: Geometry, unit?: number): any; + geodesicLength(geometry: Geometry, unit: string | number): any; /** * Creates a new geometry through intersection between two geometries. * @param geometry The input geometry. * @param intersector The geometry being intersected. */ - intersect(geometry: Geometry, intersector: Geometry): any; - /** - * Creates a new geometry through intersection between two geometries. - * @param geometry The input geometry. - * @param intersector The geometry being intersected. - */ - intersect(geometry: Geometry[], intersector: Geometry): any; + intersect(geometry: Geometry | Geometry[], intersector: Geometry): any; /** * Indicates if one geometry intersects another geometry. * @param geometry1 The geometry that is tested for the intersects relationship to the other geometry. @@ -8119,26 +7816,26 @@ declare module "esri/geometry/geometryEngineAsync" { */ intersects(geometry1: Geometry, geometry2: Geometry): any; /** - * Indicates if the given geometry is simple. + * Indicates if the given geometry is topologically simple. * @param geometry Geometry */ isSimple(geometry: Geometry): any; /** * Finds the coordinate of the geometry which is closest to the specified point. * @param geometry The geometry to consider. - * @param inputPoint The point used to find the nearest coordinate in the geometry. + * @param inputPoint The point used to search the nearest coordinate in the geometry. */ nearestCoordinate(geometry: Geometry, inputPoint: Point): any; /** * Finds vertex on the geometry nearest to the specified point. * @param geometry The geometry to consider. - * @param inputPoint The point to find the nearest vertex in the geometry for. + * @param inputPoint The point used to search the nearest vertex in the geometry. */ nearestVertex(geometry: Geometry, inputPoint: Point): any; /** * Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest and returns them as an array of objects once resolved. * @param geometry The geometry to consider. - * @param inputPoint The point to start from. + * @param inputPoint The point from which to measure. * @param searchRadius The search radius. * @param maxVertexCountToReturn The maximum number number of vertices to return. */ @@ -8146,23 +7843,13 @@ declare module "esri/geometry/geometryEngineAsync" { /** * Creates offset version of the input geometry. * @param geometry The geometries to offset. - * @param distance The offset distance for the Geometries. + * @param offsetDistance The offset distance for the Geometries. * @param offsetUnit Unit for the offset. * @param joinType The join type. * @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. * @param flattenError Applicable to ROUND, flattenError determines the maximum distance of the resulting segments compared to the true circular arc. */ - offset(geometry: Geometry, distance: number, offsetUnit: number, joinType: number, bevelRatio?: number, flattenError?: number): any; - /** - * Creates offset version of the input geometry. - * @param geometry The geometries to offset. - * @param distance The offset distance for the Geometries. - * @param offsetUnit Unit for the offset. - * @param joinType The join type. - * @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. - * @param flattenError Applicable to ROUND, flattenError determines the maximum distance of the resulting segments compared to the true circular arc. - */ - offset(geometry: Geometry[], distance: number, offsetUnit: number, joinType: number, bevelRatio?: number, flattenError?: number): any; + offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): any; /** * Indicates if one geometry overlaps another geometry. * @param geometry1 The base geometry that is tested for overlaps relationship to the other geometry. @@ -8170,22 +7857,22 @@ declare module "esri/geometry/geometryEngineAsync" { */ overlaps(geometry1: Geometry, geometry2: Geometry): any; /** - * Calculates the area of the input geometry using projected (planar) coordinates. - * @param geometry + * Calculates the area of the input geometry. + * @param geometry The input geometry. * @param unit Units of the return value. */ - planarArea(geometry: Geometry, unit?: number): any; + planarArea(geometry: Geometry, unit: string | number): any; /** - * Calculates the length of the input geometry using projected (planar) coordinates. - * @param geometry + * Calculates the length of the input geometry. + * @param geometry The input geometry. * @param unit Units of the return value. */ - planarLength(geometry: Geometry, unit: number): any; + planarLength(geometry: Geometry, unit: string | number): any; /** - * Indicates if the given relation holds for the two geometries. + * Indicates if the given DE-9IM relation holds for the two geometries. * @param geometry1 The first geometry for the relation. * @param geometry2 The second geometry for the relation. - * @param relation The DE-9IM matrix relation encoded as a string. + * @param relation The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to test against the relationship of the two geometries. */ relate(geometry1: Geometry, geometry2: Geometry, relation: string): any; /** @@ -8197,7 +7884,7 @@ declare module "esri/geometry/geometryEngineAsync" { rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): any; /** * Performs the simplify operation on the geometry which alters the given geometries to make their definitions topologically legal with respect to their geometry type. - * @param geometry Geometry + * @param geometry The geometry to be simplified. */ simplify(geometry: Geometry): any; /** @@ -8205,13 +7892,7 @@ declare module "esri/geometry/geometryEngineAsync" { * @param leftGeometry One of the Geometry instances in the XOR operation. * @param rightGeometry One of the Geometry instances in the XOR operation. */ - symmetricDifference(leftGeometry: Geometry, rightGeometry: Geometry): any; - /** - * Creates the symmetric difference of two geometries. - * @param leftGeometry One of the Geometry instances in the XOR operation. - * @param rightGeometry One of the Geometry instances in the XOR operation. - */ - symmetricDifference(leftGeometry: Geometry[], rightGeometry: Geometry): any; + symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): any; /** * Indicates if one geometry touches another geometry. * @param geometry1 The geometry which may be touching another geometry. @@ -8315,17 +7996,7 @@ declare module "esri/geometry/scaleUtils" { * Returns the value of one map unit for the given spatial reference (in meters). * @param sr The spatial reference represented as a SpatialReference class, Number, or String. */ - getUnitValueForSR(sr: SpatialReference): number; - /** - * Returns the value of one map unit for the given spatial reference (in meters). - * @param sr The spatial reference represented as a SpatialReference class, Number, or String. - */ - getUnitValueForSR(sr: number): number; - /** - * Returns the value of one map unit for the given spatial reference (in meters). - * @param sr The spatial reference represented as a SpatialReference class, Number, or String. - */ - getUnitValueForSR(sr: string): number; + getUnitValueForSR(sr: SpatialReference | number | string): number; }; export = scaleUtils; } @@ -8341,8 +8012,8 @@ declare module "esri/geometry/screenUtils" { /** * Converts the geometry argument to map coordinates based on the extent, width, and height of the Map. * @param extent The current extent of the map in map coordinates. - * @param width The current width of the map in map units. - * @param height The current width of the map in map units. + * @param width The current width of the map in screen units. + * @param height The current height of the map in screen units. * @param screenGeometry The geometry to convert from screen to map units. */ toMapGeometry(extent: Extent, width: number, height: number, screenGeometry: Geometry): Geometry; @@ -8350,7 +8021,7 @@ declare module "esri/geometry/screenUtils" { * Converts and returns the argument screen point in map coordinates. * @param extent The current extent of the map in map coordinates. * @param width The current width of the map in screen units. - * @param height The current width of the map in screen units. + * @param height The current height of the map in screen units. * @param screenPoint The screenPoint to convert from screen to map units. */ toMapPoint(extent: Extent, width: number, height: number, screenPoint: ScreenPoint): Point; @@ -8358,7 +8029,7 @@ declare module "esri/geometry/screenUtils" { * Converts the geometry argument to screen coordinates based on the extent, width, and height of the Map. * @param extent The current extent of the map in map coordinates. * @param width The current width of the map in screen units. - * @param height The current width of the map in screen units. + * @param height The current height of the map in screen units. * @param mapGeometry The geometry to convert from map to screen units. */ toScreenGeometry(extent: Extent, width: number, height: number, mapGeometry: Geometry): Geometry; @@ -8366,7 +8037,7 @@ declare module "esri/geometry/screenUtils" { * Converts and returns the argument map point in screen coordinates. * @param extent The current extent of the map in map coordinates. * @param width The current width of the map in screen units. - * @param height The current width of the map in screen units. + * @param height The current height of the map in screen units. * @param mapPoint The point to convert from map to screen units. */ toScreenPoint(extent: Extent, width: number, height: number, mapPoint: Point): ScreenPoint; @@ -8385,25 +8056,7 @@ declare module "esri/geometry/webMercatorUtils" { * @param source An input of type SpatialReference or an object with spatialReference property such as Geometry or Map. * @param target The target spatial reference, of type SpatialReference or an object with spatialReference property such as Map. */ - canProject(source: SpatialReference, target: any): boolean; - /** - * Returns true if the 'source' can be projected to 'target' by the project() function, or if the 'source' and 'target' is the same spatialReference. - * @param source An input of type SpatialReference or an object with spatialReference property such as Geometry or Map. - * @param target The target spatial reference, of type SpatialReference or an object with spatialReference property such as Map. - */ - canProject(source: any, target: SpatialReference): boolean; - /** - * Returns true if the 'source' can be projected to 'target' by the project() function, or if the 'source' and 'target' is the same spatialReference. - * @param source An input of type SpatialReference or an object with spatialReference property such as Geometry or Map. - * @param target The target spatial reference, of type SpatialReference or an object with spatialReference property such as Map. - */ - canProject(source: SpatialReference, target: SpatialReference): boolean; - /** - * Returns true if the 'source' can be projected to 'target' by the project() function, or if the 'source' and 'target' is the same spatialReference. - * @param source An input of type SpatialReference or an object with spatialReference property such as Geometry or Map. - * @param target The target spatial reference, of type SpatialReference or an object with spatialReference property such as Map. - */ - canProject(source: any, target: any): boolean; + canProject(source: SpatialReference | any, target: SpatialReference | any): boolean; /** * Converts geometry from geographic units to Web Mercator units. * @param geometry The geometry to convert. @@ -8420,13 +8073,7 @@ declare module "esri/geometry/webMercatorUtils" { * @param geometry An input geometry. * @param target The target spatial reference, of type SpatialReference or an object with spatialReference property such as Map. */ - project(geometry: Geometry, target: SpatialReference): any; - /** - * Project the geometry clientside (if possible). - * @param geometry An input geometry. - * @param target The target spatial reference, of type SpatialReference or an object with spatialReference property such as Map. - */ - project(geometry: Geometry, target: any): any; + project(geometry: Geometry, target: SpatialReference | any): any; /** * Converts geometry from Web Mercator units to geographic units. * @param geometry The geometry to convert. @@ -8474,7 +8121,7 @@ declare module "esri/graphic" { */ constructor(json: Object); /** - * Adds a new attribute or changes the value of an existing attribute on the graphic's node. + * Adds a new attribute or changes the value of an existing attribute on the graphic's DOM node. * @param name The name of the attribute. * @param value The value of the attribute. */ @@ -8578,12 +8225,7 @@ declare module "esri/lang" { * Strips HTML tags from a String or Object. * @param value Object or String to be stripped of HTML tags. */ - stripTags(value: any): any; - /** - * Strips HTML tags from a String or Object. - * @param value Object or String to be stripped of HTML tags. - */ - stripTags(value: string): any; + stripTags(value: any | string): any | string; /** * A wrapper around dojo.string.substitute that can also handle wildcard substitution. * @param data The data object used in the substitution. @@ -8628,6 +8270,8 @@ declare module "esri/layers/ArcGISDynamicMapServiceLayer" { dpi: number; /** Array of DynamicLayerInfos used to change the layer ordering or redefine the map. */ dynamicLayerInfos: DynamicLayerInfo[]; + /** The geodatabase version. */ + gdbVersion: string; /** When true, the layer has attribution data. */ hasAttributionData: boolean; /** The output image type. */ @@ -9133,12 +8777,7 @@ declare module "esri/layers/CodedValueDomain" { * Returns the name of the coded-value associated with the specified code. * @param code The code in which you wish to search for the name. */ - getName(code: number): string; - /** - * Returns the name of the coded-value associated with the specified code. - * @param code The code in which you wish to search for the name. - */ - getName(code: string): string; + getName(code: number | string): string; } export = CodedValueDomain; } @@ -9148,7 +8787,7 @@ declare module "esri/layers/DataAdapterFeatureLayer" { import FeatureLayer = require("esri/layers/FeatureLayer"); import LocationProviderBase = require("esri/tasks/locationproviders/LocationProviderBase"); - /** (Beta at v3.12) Display features using data that contains location information such as X and Y coordinates, Street address, place names etc using a DataAdapter object to retrieve the features and a LocationProvider to generate their geometries. */ + /** (Currently in beta) Display features using data that contains location information such as X and Y coordinates, Street address, place names etc using a DataAdapter object to retrieve the features and a LocationProvider to generate their geometries. */ class DataAdapterFeatureLayer extends FeatureLayer { /** The DataAdapter object points to data sources that contain non-spatial tables. */ dataAdapter: any; @@ -9357,6 +8996,8 @@ declare module "esri/layers/FeatureLayer" { fields: Field[]; /** The full extent of the layer. */ fullExtent: Extent; + /** The geodatabase version. */ + gdbVersion: string; /** Geometry type of the features in the layer. */ geometryType: string; /** The globalIdField for the layer. */ @@ -9842,7 +9483,7 @@ declare module "esri/layers/GraphicsLayer" { /** A layer that contains one or more Graphic features. */ class GraphicsLayer extends Layer { /** List of attribute fields added as custom data attributes to graphics node. */ - dataAttributes: any; + dataAttributes: string | string[]; /** The array of graphics that make up the layer. */ graphics: Graphic[]; /** The info template for the layer. */ @@ -10212,21 +9853,7 @@ declare module "esri/layers/LabelLayer" { * @param renderer The renderer used to render text labels. * @param textExpression An expression determining what text and field(s) will be displayed as in labels. */ - addFeatureLayer(featureLayer: FeatureLayer, renderer?: SimpleRenderer, textExpression?: any): void; - /** - * Adds reference to the feature layer which is labeled. - * @param featureLayer The feature layer to be added to the label layer. - * @param renderer The renderer used to render text labels. - * @param textExpression An expression determining what text and field(s) will be displayed as in labels. - */ - addFeatureLayer(featureLayer: FeatureLayer, renderer?: UniqueValueRenderer, textExpression?: any): void; - /** - * Adds reference to the feature layer which is labeled. - * @param featureLayer The feature layer to be added to the label layer. - * @param renderer The renderer used to render text labels. - * @param textExpression An expression determining what text and field(s) will be displayed as in labels. - */ - addFeatureLayer(featureLayer: FeatureLayer, renderer?: ClassBreaksRenderer, textExpression?: any): void; + addFeatureLayer(featureLayer: FeatureLayer, renderer?: SimpleRenderer | UniqueValueRenderer | ClassBreaksRenderer, textExpression?: any): void; /** * Returns reference to the feature layer which features will be labeled. * @param index Index of the referenced feature layer. @@ -10440,6 +10067,8 @@ declare module "esri/layers/MosaicRule" { static OPERATION_MEAN: any; /** Takes the minimum value of all overlapping pixels. */ static OPERATION_MIN: any; + /** Takes the sum of all overlapping pixels. */ + static OPERATION_SUM: any; /** Indicates whether the sort should be ascending or not. */ ascending: boolean; /** An array of raster Ids. */ @@ -10493,7 +10122,7 @@ declare module "esri/layers/OpenStreetMapLayer" { declare module "esri/layers/PixelBlock" { import esri = require("esri"); - /** (Beta at v3.13) The PixelBlock is used to hold pixels. */ + /** The PixelBlock is used to hold pixels. */ class PixelBlock { /** Number of rows. */ height: number; @@ -10596,6 +10225,8 @@ declare module "esri/layers/RasterFunction" { functionArguments: any; /** The raster function name. */ functionName: string; + /** Defines the output image's pixel type. */ + outputPixelType: string; /** Variable name for the raster function. */ variableName: string; /** Creates a new RasterFunction object. */ @@ -10615,7 +10246,7 @@ declare module "esri/layers/RasterLayer" { import esri = require("esri"); import Layer = require("esri/layers/layer"); - /** (Beta at v3.13) The RasterLayer is used to display image services. */ + /** The RasterLayer is used to display image services. */ class RasterLayer extends Layer { /** * Creates a new RasterLayer object. @@ -10625,6 +10256,18 @@ declare module "esri/layers/RasterLayer" { constructor(url: string, options?: esri.RasterLayerOptions); /** Returns the context of the Canvas. */ getContext(): any; + /** + * Sets the image format. + * @param imageFormat The image format to set. + * @param doNotRefresh Use true to avoid refreshing the layer; false to refresh it. + */ + setImageFormat(imageFormat: string, doNotRefresh?: boolean): void; + /** + * Determines if the layer will update its content based on the map's current time extent. + * @param use Use true to update the layer's content based on the map's current time extent. + * @param doNotRefresh Use true to avoid refreshing the layer; false to refresh the layer. + */ + setUseMapTime(use: boolean, doNotRefresh?: boolean): void; } export = RasterLayer; } @@ -10633,6 +10276,7 @@ declare module "esri/layers/StreamLayer" { import esri = require("esri"); import FeatureLayer = require("esri/layers/FeatureLayer"); import Extent = require("esri/geometry/Extent"); + import Graphic = require("esri/graphic"); import Layer = require("esri/layers/layer"); /** The stream layer extends the feature layer to add the ability to connect to a stream of data using HTML5 WebSockets. */ @@ -10671,6 +10315,8 @@ declare module "esri/layers/StreamLayer" { getDefinitionExpression(): string; /** Gets the spatial filter set on the layer. */ getGeometryDefinition(): Extent; + /** Gets the latest observation for each track in the layer. */ + getLatestObservations(): Graphic; /** * Gets the unique values of the graphics (in the StreamLayer) based on the `fieldName` parameter. * @param fieldName Field to get the unique values from. @@ -10859,6 +10505,64 @@ declare module "esri/layers/TimeReference" { export = TimeReference; } +declare module "esri/layers/WFSLayer" { + import esri = require("esri"); + import Field = require("esri/layers/Field"); + import Extent = require("esri/geometry/Extent"); + import Graphic = require("esri/graphic"); + import InfoTemplate = require("esri/InfoTemplate"); + import Renderer = require("esri/renderers/Renderer"); + + /** (Currently in beta)A layer for OGC Web Feature Services (WFS). */ + class WFSLayer { + /** An array of fields in the layer. */ + fields: Field[]; + /** The full extent of the layer. */ + fullExtent: Extent; + /** The geometry type of the features in the layer. */ + geometryType: string; + /** An array of features in the layer. */ + graphics: Graphic[]; + /** ID assigned to the layer. */ + id: string; + /** The InfoTemplate for the layer. */ + infoTemplate: InfoTemplate; + /** The renderer to apply to the layer. */ + renderer: Renderer; + /** The visibility of the layer. */ + visible: boolean; + /** + * Creates a new WFSLayer object + * @param options See options table below for full descriptions of the properties needed for this object. + */ + constructor(options: esri.WFSLayerOptions); + /** Creates the getFeature parameter based on the version, nsLayerName, nsGeometryFieldName, mode, wkid, inverseFilter, maxFeatures constructor parameters. */ + buildRequest(): string; + /** + * Gets the WFS layer capabilities. + * @param callback An array of WFS layers in JSON format. + */ + getCapabilities(callback?: Function): void; + /** Performs the getFeature request. */ + getFeature(): void; + /** Returns a JSON Object containing all of the WFS parameters. */ + getWFSParameters(): any; + /** Redraws all the graphics in the layer. */ + redraw(): void; + /** Refreshes the features in the WFS layer. */ + refresh(): void; + /** Sets the default line symbol to be used if no renderer is specified. */ + setLineSymbol(): void; + /** Sets the default point symbol to be used if no renderer is specified. */ + setPointSymbol(): void; + /** Sets the default polygon symbol to be used if no renderer is specified. */ + setPolygonSymbol(): void; + /** Sets the WFS parameters using the provided JSON Object. */ + setWFSParameters(): void; + } + export = WFSLayer; +} + declare module "esri/layers/WMSLayer" { import esri = require("esri"); import DynamicMapServiceLayer = require("esri/layers/DynamicMapServiceLayer"); @@ -10868,6 +10572,8 @@ declare module "esri/layers/WMSLayer" { /** A layer for OGC Web Map Services (WMS). */ class WMSLayer extends DynamicMapServiceLayer { + /** All bounding boxes defined for the layer. */ + allExtents: Extent[]; /** Copyright of the WMS service. */ copyright: string; /** Description of the WMS service. */ @@ -10886,6 +10592,8 @@ declare module "esri/layers/WMSLayer" { maxWidth: number; /** Spatial reference of the WMS service. */ spatialReference: SpatialReference; + /** An array of WKIDs of all spatial references defined for the layer. */ + spatialReferences: number[]; /** Title of the WMS service. */ title: string; /** Version of the WMS service. */ @@ -10920,6 +10628,8 @@ declare module "esri/layers/WMSLayerInfo" { /** The WMSLayerInfo class defines and provides information about layers in a WMS service. */ class WMSLayerInfo { + /** All bounding boxes defined for the layer. */ + allExtents: Extent[]; /** The layer description defines the value of the Abstract capabilities property. */ description: string; /** The layer extent. */ @@ -10928,6 +10638,10 @@ declare module "esri/layers/WMSLayerInfo" { legendURL: string; /** The layer name. */ name: string; + /** An array of WKIDs of all spatial references defined for the layer. */ + spatialReferences: number[]; + /** WMSLayerInfos of the layer's sub layers. */ + subLayers: WMSLayerInfo[]; /** The layer title. */ title: string; /** @@ -11246,7 +10960,7 @@ declare module "esri/map" { * @param divId Container id for the referencing map. * @param options Optional parameters. */ - constructor(divId: string, options?: esri.MapOptions); + constructor(divId: Node | string, options?: esri.MapOptions); /** * Adds an Esri Layer to the map. * @param layer Layer to be added to the map. @@ -11474,7 +11188,7 @@ declare module "esri/map" { /** Fires when a map layer resumes drawing. */ on(type: "layer-resume", listener: (event: { layer: Layer; target: Map }) => void): esri.Handle; /** Fires after all layers are added to the map using the map.addLayers method. */ - on(type: "layers-add-result", listener: (event: { layers: Layer[]; target: Map }) => void): esri.Handle; + on(type: "layers-add-result", listener: (event: { layers: any[]; target: Map }) => void): esri.Handle; /** Fires after all the layers have been removed. */ on(type: "layers-removed", listener: (event: { target: Map }) => void): esri.Handle; /** Fires when all the layers have been reordered. */ @@ -11530,7 +11244,495 @@ declare module "esri/map" { export = Map; } +declare module "esri/opsdashboard/DataSourceProxy" { + import Field = require("esri/layers/Field"); + import FeatureType = require("esri/layers/FeatureType"); + import Query = require("esri/tasks/query"); + import Graphic = require("esri/graphic"); + + /** DataSourceProxy is a proxy class that represents a operations dashboard data source. */ + class DataSourceProxy { + /** Read-only: The name of the display field. */ + displayFieldName: string; + /** Read-only: The collection of fields. */ + fields: Field[]; + /** The geometry type. */ + geometryType: string; + /** Read-only: The id of the data source. */ + id: string; + /** Read-only: Indicates if the last query failed and the data source is in a broken state. */ + isBroken: boolean; + /** Read-only: The name of the data source. */ + name: string; + /** Read-only: The name of the object id field. */ + objectIdFieldName: string; + /** Read-only: Indicates if the data source supports selections. */ + supportsSelection: boolean; + /** Read-only: The name of the type id field. */ + typeIdFieldName: string; + /** Read-only: The collection of feature types. */ + types: FeatureType[]; + /** Clear the selection. */ + clearSelection(): void; + /** + * Executes a query and get the result. + * @param query The query object to apply. + */ + executeQuery(query: Query): any; + /** Retrieve the associated data source that supports selection. */ + getAssociatedSelectionDataSourceProxy(): any; + /** Get the associated popupInfo for the data source if any available. */ + getPopupInfo(): any; + /** Get the associated render object for the data source if any available. */ + getRenderer(): any; + /** + * Get the feature type from a feature coming from the data source. + * @param feature A feature coming from the data source + */ + getTypeFromFeature(feature: Graphic): number; + /** + * Returns the value corresponding to a field name from a feature coming from the data source. + * @param feature A feature coming from the data source + * @param fieldName The name of the field for which the value should be returned. + */ + getValueFromFeature(feature: Graphic, fieldName: string): number | string; + /** + * Select features in the data source using a query. + * @param query The query object to apply + */ + selectFeatures(query: Query): void; + /** + * Select features in the data source using a collection of object ids. + * @param objectIds The collection of object ids of the features to select. + */ + selectFeaturesByObjectIds(objectIds: string[]): void; + } + export = DataSourceProxy; +} + +declare module "esri/opsdashboard/ExtensionBase" { + import esri = require("esri"); + import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy"); + + /** ExtensionBase is a base class used by all the extension proxies. */ + class ExtensionBase { + /** "circle" */ + static CIRCLE: any; + /** "extent" */ + static EXTENT: any; + /** "freehandpolygon" */ + static FREEHAND_POLYGON: any; + /** "freehandpolyline" */ + static FREEHAND_POLYLINE: any; + /** "line" */ + static LINE: any; + /** "point" */ + static POINT: any; + /** "polygon" */ + static POLYGON: any; + /** "polyline" */ + static POLYLINE: any; + /** Read-only: Indicates if the host application is the Windows Operations Dashboard. */ + isNative: boolean; + /** Get the collection of data sources from the host application. */ + getDataSourceProxies(): any; + /** Get the collection of data sources from the host application. */ + getDataSourceProxies(): any; + /** Get the data source corresponding to the data source id from the host application. */ + getDataSourceProxy(): any; + /** Get the collection of map widgets from the host application. */ + getMapWidgetProxies(): any; + /** + * Get the map widget corresponding to the map widget id from the host application. + * @param mapWidgetId A map widget id + */ + getMapWidgetProxy(mapWidgetId: string): any; + /** + * Called when an error occurred during the initialization process with the host application. + * @param err The error that occurred. + */ + hostInitializationError(err: Error): void; + /** Called by the host application when the relationship has been established with the extension. */ + hostReady(): void; + /** + * Called by the host application when a map widget has been added to the current view. + * @param mapWidgetProxy A map widget id. + */ + mapWidgetAdded(mapWidgetProxy: MapWidgetProxy): void; + /** + * Called by the host application when a map widget has been removed from the current view. + * @param mapWidgetId A map widget id. + */ + mapWidgetRemoved(mapWidgetId: string): void; + /** Event indicating that a new data source has been added into the host operation view. */ + on(type: "data-source-added", listener: (event: { dataSourceProxy: any; target: ExtensionBase }) => void): esri.Handle; + /** Event indicating that a data source has been removed from the host operation view. */ + on(type: "data-source-removed", listener: (event: { dataSourceId: string; target: ExtensionBase }) => void): esri.Handle; + /** Event indicating that the initialization process was successful. */ + on(type: "host-ready", listener: (event: { target: ExtensionBase }) => void): esri.Handle; + /** Event indicating that the initialization process encountered an error. */ + on(type: "initialization-error", listener: (event: { error: Error; target: ExtensionBase }) => void): esri.Handle; + /** Event indicating that a new map widget has been added into the host operation view. */ + on(type: "map-widget-added", listener: (event: { mapWidgetProxy: MapWidgetProxy; target: ExtensionBase }) => void): esri.Handle; + /** Event indicating that a map widget has been removed from the host operation view. */ + on(type: "map-widget-removed", listener: (event: { mapWidgetId: string; target: ExtensionBase }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = ExtensionBase; +} + +declare module "esri/opsdashboard/ExtensionConfigurationBase" { + import ExtensionBase = require("esri/opsdashboard/ExtensionBase"); + + /** ExtensionConfigurationBase is a base class used by all the extension configuration proxies. */ + class ExtensionConfigurationBase extends ExtensionBase { + /** Indicates that the configuration is ready to be persisted or not. */ + readyToPersistConfig: boolean; + } + export = ExtensionConfigurationBase; +} + +declare module "esri/opsdashboard/FeatureActionConfigurationProxy" { + import ExtensionConfigurationBase = require("esri/opsdashboard/ExtensionConfigurationBase"); + + /** FeatureActionConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension feature action. */ + class FeatureActionConfigurationProxy extends ExtensionConfigurationBase { + } + export = FeatureActionConfigurationProxy; +} + +declare module "esri/opsdashboard/FeatureActionFeatures" { + import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy"); + import Graphic = require("esri/graphic"); + + /** FeatureActionFeatures is a specialized collection of features used by WidgetProxy to hold the collection of features for the associated feature actions. */ + class FeatureActionFeatures { + /** The DataSourceProxy from which the collection of features belongs to. */ + dataSourceProxy: DataSourceProxy; + /** + * Add a feature to the host collection. + * @param featureOrObjectId + */ + addFeature(featureOrObjectId: Graphic | number): void; + /** + * Add a collection of features or collection of object id in the host collection. + * @param featuresOrObjectIds + */ + addFeatures(featuresOrObjectIds: Graphic[] | number[]): void; + /** Remove all the features from the host collection. */ + clear(): void; + /** + * Test if a feature exists in the host collection. + * @param featureOrObjectId Feature to test existance for. + */ + contains(featureOrObjectId: Graphic | number): boolean; + /** + * Returns the index of a feature in the host collection. + * @param featureOrObjectId Feature to return index from. + */ + indexOf(featureOrObjectId: Graphic | number): number; + /** + * Remove a collection of features from the host collection. + * @param featureOrObjectId Feature to remove. + */ + removeFeature(featureOrObjectId: Graphic | number): void; + /** + * Remove a feature from the host collection. + * @param featuresOrObjectIds Features to remove. + */ + removeFeatures(featuresOrObjectIds: Graphic[] | number[]): void; + } + export = FeatureActionFeatures; +} + +declare module "esri/opsdashboard/GraphicsLayerProxy" { + import Renderer = require("esri/renderers/Renderer"); + import Graphic = require("esri/graphic"); + + /** GraphicsLayerProxy is a proxy class that represents a graphics layer in a map widget in the host application. */ + class GraphicsLayerProxy { + /** Read-only: The current host graphics layer maximum visible scale. */ + maxScale: number; + /** Read-only: The current host graphics layer minimum visible scale. */ + minScale: number; + /** Read-only: The current host graphics layer opacity ratio. */ + opacity: number; + /** The current renderer used by the host graphics layer. */ + renderer: Renderer; + /** Read-only: The current host graphics layer visibility. */ + visible: boolean; + /** + * Update a graphic in the host graphics layer with a new version. + * @param graphic The graphic to update in the host graphics layer. + */ + addOrUpdateGraphic(graphic: Graphic): void; + /** + * Update a graphic in the host graphics layer with a new version. + * @param graphic The graphic to update in the host graphics layer. + */ + addOrUpdateGraphics(graphic: Graphic): void; + /** Removes all the graphics from the host graphics layer. */ + clear(): void; + /** + * Removes from the host graphics layer a graphic. + * @param graphic The graphic to remove from the host graphics layer. + */ + removeGraphic(graphic: Graphic): void; + /** + * Sets the host graphics layer maximum scale. + * @param maxScale + */ + setMaxScale(maxScale: number): void; + /** + * Sets the host graphics layer minimum scale. + * @param minScale + */ + setMinScale(minScale: number): void; + /** + * Sets the host graphics layer opacity ratio. + * @param opacity An opacity ratio between 0 and 1. + */ + setOpacity(opacity: number): void; + /** + * Sets the host graphics layer renderer. + * @param renderer Since the Windows operations dashboard is built using ArcGIS Runtime SDK for WPF, only renderers supported by the WPF should be used, such as SimpleRenderer, UniqueValueRenderer and ClassBreaksRenderer. + */ + setRenderer(renderer: Renderer): void; + /** + * Set the visibility of the host graphics layer. + * @param visibility The new visibility value. + */ + setVisibility(visibility: boolean): void; + } + export = GraphicsLayerProxy; +} + +declare module "esri/opsdashboard/MapToolConfigurationProxy" { + import ExtensionConfigurationBase = require("esri/opsdashboard/ExtensionConfigurationBase"); + + /** MapToolConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension map tool. */ + class MapToolConfigurationProxy extends ExtensionConfigurationBase { + } + export = MapToolConfigurationProxy; +} + +declare module "esri/opsdashboard/MapToolProxy" { + import esri = require("esri"); + import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy"); + import Geometry = require("esri/geometry/Geometry"); + + /** MapToolProxy is a class used to define an operations dashboard extension map tool. */ + class MapToolProxy { + /** Read-only: The available size for the map tool user experience on the host map widget. */ + availableDisplaySize: number; + /** Read-only: The map tool user experience size in pixels. */ + displaySize: any; + /** Read-only: The map widget that is hosting the map tool user experience. */ + mapWidgetProxy: MapWidgetProxy; + /** Read-only: The previous map tool user experience state that was passed the last time the map tool was deactivated. */ + previousState: any; + /** + * Activates a drawing activity on the host map widget. + * @param options Drawing options. + */ + activateMapDrawing(options: any): void; + /** + * Called by the host application when the available size for the map tool user experience has changed (user resizes the application or the map widget). + * @param availableSize The size available on the host map widget for the map tool user experience. + */ + availableDisplaySizeChanged(availableSize: any): void; + /** Deactivates the drawing activity on the host map widget. */ + deactivateMapDrawing(): void; + /** + * Deactivate the map tool user experience. + * @param state A JSON object that needs to be persisted in the host until the next activation of the map tool user experience. + */ + deactivateMapTool(state: any): void; + /** + * Called by the host application when the user has completed the drawing activity on the map. + * @param geometry The geometry captured by the user during the drawing activity. + */ + mapDrawComplete(geometry: Geometry): void; + /** + * Change the size of the user experience area in the host application for this map tool user experience. + * @param size The new size for the user experience. + */ + setDisplaySize(size: any): any; + /** Event indicating that the available display size for the map tool user experience has changed. */ + on(type: "available-display-size-changed", listener: (event: { size: any; target: MapToolProxy }) => void): esri.Handle; + /** Event indicating that a previously activate drawing activity has been completed by the user. */ + on(type: "draw-complete", listener: (event: { geometry: Geometry; target: MapToolProxy }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = MapToolProxy; +} + +declare module "esri/opsdashboard/MapWidgetProxy" { + import esri = require("esri"); + import SpatialReference = require("esri/SpatialReference"); + import GraphicsLayerProxy = require("esri/opsdashboard/GraphicsLayerProxy"); + import Point = require("esri/geometry/Point"); + import Extent = require("esri/geometry/Extent"); + + /** MapWidgetProxy is a proxy class that represents a operations dashboard map widget. */ + class MapWidgetProxy { + /** Read-only: The map id. */ + id: string; + /** Read-only: The name of the map. */ + name: string; + /** Read-only: The spatial reference of the map. */ + spatialReference: SpatialReference; + /** + * Creates a graphics layer in the host map. + * @param options The options for the new graphics layer + */ + createGraphicsLayerProxy(options?: any): any; + /** + * Destroys in the host map a host graphics layer. + * @param graphicsLayerProxy The host graphics layer to destroy. + */ + destroyGraphicsLayerProxy(graphicsLayerProxy: GraphicsLayerProxy): void; + /** Gets the current host map extent. */ + getMapExtent(): any; + /** Called by the host application when the extent of the host map has changed. */ + mapExtentChanged(): void; + /** + * Pans the map to a new location. + * @param mapPoint A new location with the same spatial reference as the host map. + */ + panTo(mapPoint: Point): void; + /** + * Sets an extent on the host map extent. + * @param extent A new map extent. + */ + setExtent(extent: Extent): void; + /** Subscribes to the host map events. */ + subscribeToMapEvents(): void; + /** Unsubscribes from the host map events. */ + unsubscribeFromMapEvents(): void; + /** Event indicating that the host map extent has changed. */ + on(type: "map-extent-change", listener: (event: { extent: Extent; target: MapWidgetProxy }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = MapWidgetProxy; +} + +declare module "esri/opsdashboard/WidgetConfigurationProxy" { + import esri = require("esri"); + import ExtensionConfigurationBase = require("esri/opsdashboard/ExtensionConfigurationBase"); + import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy"); + import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy"); + + /** WidgetConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension widget. */ + class WidgetConfigurationProxy extends ExtensionConfigurationBase { + /** The object that will store the widget configuration. */ + config: any; + /** + * Called by the host application when the user has changed the selected data source in the data source selector. + * @param dataSourceProxy The selected data source. + * @param dataSourceConfig The associated data source config. + */ + dataSourceSelectionChanged(dataSourceProxy: DataSourceProxy, dataSourceConfig: any): void; + /** + * Get the data source config for a data source. + * @param dataSourceProxyOrDataSourceId A data source or a data source id. + */ + getDataSourceConfig(dataSourceProxyOrDataSourceId: DataSourceProxy | string): any; + /** + * Called by the host application when the user has changed the slected map widget in the map widget selector. + * @param mapWidgetProxy The selected map widget. + */ + mapWidgetSelectionChanged(mapWidgetProxy: MapWidgetProxy): void; + /** Event indicating the user has changed the selected data source for the configuration. */ + on(type: "data-source-selection-changed", listener: (event: { dataSourceConfig: any; dataSourceProxy: DataSourceProxy; target: WidgetConfigurationProxy }) => void): esri.Handle; + /** Event indicating the user has changed the selected map widget for the configuration. */ + on(type: "map-widget-selection-changed", listener: (event: { mapWidgetProxy: MapWidgetProxy; target: WidgetConfigurationProxy }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = WidgetConfigurationProxy; +} + +declare module "esri/opsdashboard/WidgetProxy" { + import esri = require("esri"); + import ExtensionBase = require("esri/opsdashboard/ExtensionBase"); + import FeatureActionFeatures = require("esri/opsdashboard/FeatureActionFeatures"); + import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy"); + import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy"); + import Graphic = require("esri/graphic"); + import Geometry = require("esri/geometry/Geometry"); + + /** WidgetProxy is a class used to define an operations dashboard extension widget. */ + class WidgetProxy extends ExtensionBase { + /** Read-only: If the widget was configured to consume data sources, the dataSourceConfig array will hold a collection of dataSourceConfig objects. */ + dataSourceConfigs: any[]; + /** Read-only: The host collection of features used by the widget feature actions. */ + featureActionFeatures: FeatureActionFeatures; + /** Read-only: Indicates if the widget has a default feature action associated with. */ + hasDefaultFeatureAction: boolean; + /** Read-only: Indicates if the widget has feature actions associated with it. */ + hasFeatureActions: boolean; + /** + * Activate a drawing toolbar on a map widget. + * @param options + * @param mapWidgetProxy The target map widget. + */ + activateDrawingToolbar(options?: any, mapWidgetProxy?: MapWidgetProxy): any; + /** + * Called by the host application when a data source state has expired. + * @param dataSourceProxy + * @param associated dataSourceConfig + */ + dataSourceExpired(dataSourceProxy: DataSourceProxy, associated?: any): void; + /** + * Deactivate the drawing toolbar on the map widget. + * @param mapWidgetProxy The target map widget. + */ + deactivateDrawingToolbar(mapWidgetProxy?: MapWidgetProxy): void; + /** Called by the host application when the user has canceled the drawing activity. */ + drawingToolbarDeactivated(): void; + /** + * Execute the default feature action. + * @param featuresOrObjectIds + */ + executeDefaultFeatureAction(featuresOrObjectIds: Graphic[] | number[]): void; + /** + * Get the data source config for a data source. + * @param dataSourceProxyOrDataSourceId A data source or a data source id. + */ + getDataSourceConfig(dataSourceProxyOrDataSourceId: DataSourceProxy | string): any; + /** + * Called by the host application when the user has finished the drawing activity. + * @param geometry + */ + toolbarDrawComplete(geometry: Geometry): void; + /** Event indicating that a data source validity has expired. */ + on(type: "data-source-expired", listener: (event: { dataSourceConfig: any; dataSourceProxy: DataSourceProxy; target: WidgetProxy }) => void): esri.Handle; + /** Event indicating that the user has deactivated the previously activated drawing toolbar on the map widget. */ + on(type: "drawing-toolbar-deactivated", listener: (event: { target: WidgetProxy }) => void): esri.Handle; + /** Event indicating the user has finished a drawing activity with the previously activated drawing toolbar. */ + on(type: "toolbar-draw-complete", listener: (event: { geometry: Geometry; target: WidgetProxy }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = WidgetProxy; +} + +declare module "esri/opsdashboard/featureActionProxy" { + import esri = require("esri"); + import ExtensionBase = require("esri/opsdashboard/ExtensionBase"); + import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy"); + import FeatureSet = require("esri/tasks/FeatureSet"); + + /** featureActionProxy is a singleton object that allows implementing an operations dashboard Feature Action extension. */ + class featureActionProxy extends ExtensionBase { + /** Event raised when the feature action should execute for a set of features. */ + on(type: "execute", listener: (event: { config: any; dataSourceProxy: DataSourceProxy; featureSet: FeatureSet; target: featureActionProxy }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = featureActionProxy; +} + declare module "esri/plugins/FeatureLayerStatistics" { + import esri = require("esri"); import FeatureLayer = require("esri/layers/FeatureLayer"); /** This module defines a class and a feature layer plugin that is used to calculate feature layer statistics. */ @@ -11539,7 +11741,7 @@ declare module "esri/plugins/FeatureLayerStatistics" { * Creates a new object that is used to calculate statistics about features in a feature layer. * @param params Parameters that define the FeatureLayerStatistics. */ - constructor(params: any); + constructor(params: esri.FeatureLayerStatisticsOptions); /** * This function is called internally when the plugin is added to a feature layer. * @param layer The target FeatureLayer that have the plugin added. @@ -11601,13 +11803,7 @@ declare module "esri/plugins/spatialIndex" { * @param target The map or feature layer to which the index is connected. * @param options See the object specifications table below for the structure of the index options object. */ - add(target: Map, options?: any): void; - /** - * Adds an index property to the target instance. - * @param target The map or feature layer to which the index is connected. - * @param options See the object specifications table below for the structure of the index options object. - */ - add(target: FeatureLayer, options?: any): void; + add(target: Map | FeatureLayer, options?: any): void; /** Removes the index plugin. */ remove(): void; }; @@ -11686,28 +11882,7 @@ declare module "esri/process/SpatialIndex" { * @param layerId ID assigned to the layer. * @param getRects Whether to get the rectangle object with data in leaf, otherwise just get the stored data. */ - intersects(test: Point, layerId?: string, getRects?: boolean): any; - /** - * Searches index for items which intersect the test object. - * @param test The point or area to intersect. - * @param layerId ID assigned to the layer. - * @param getRects Whether to get the rectangle object with data in leaf, otherwise just get the stored data. - */ - intersects(test: Graphic, layerId?: string, getRects?: boolean): any; - /** - * Searches index for items which intersect the test object. - * @param test The point or area to intersect. - * @param layerId ID assigned to the layer. - * @param getRects Whether to get the rectangle object with data in leaf, otherwise just get the stored data. - */ - intersects(test: Extent, layerId?: string, getRects?: boolean): any; - /** - * Searches index for items which intersect the test object. - * @param test The point or area to intersect. - * @param layerId ID assigned to the layer. - * @param getRects Whether to get the rectangle object with data in leaf, otherwise just get the stored data. - */ - intersects(test: number[], layerId?: string, getRects?: boolean): any; + intersects(test: Point | Graphic | Extent | number[], layerId?: string, getRects?: boolean): any; /** * Searches for the nearest point(s) to the passed point within the specified criteria. * @param criteria See the object specifications table below for the structure of the criteria object. @@ -11718,6 +11893,56 @@ declare module "esri/process/SpatialIndex" { export = SpatialIndex; } +declare module "esri/renderers/BlendRenderer" { + import esri = require("esri"); + import Symbol = require("esri/symbols/Symbol"); + + /** (Currently in beta) BlendRenderer allows you to easily identify a predominant attribute among two or more competing attributes in a feature. */ + class BlendRenderer { + /** This determines how colors are blended together. */ + blendMode: string; + /** An array of objects to blend containing the field name and color to use. */ + fields: any[]; + /** The field to normalize. */ + normalizationField: string; + /** An array of objects which determines opacity. */ + opacityStops: any[]; + /** The BlendRenderer applies to the color of the symbol. */ + symbol: Symbol; + /** + * Creates a new BlendRenderer object. + * @param params Required and optional parameters. + */ + constructor(params?: esri.BlendRendererOptions); + /** + * Sets the mode that determines how colors are blended together. + * @param blendMode The blend mode used to determine how colors are blended together. + */ + setBlendMode(blendMode: string): void; + /** + * Sets an array of objects to blend containing the field name and color to use. + * @param fields An array of objects to blend containing the field name and color to use. + */ + setFields(fields: any[]): void; + /** + * Sets the field to normalize + * @param field The field to normalize. + */ + setNormalizationField(field: string): void; + /** + * Sets an array of objects which determines opacity. + * @param opacityStops Sets an array of objects which determines opacity. + */ + setOpacityStops(opacityStops: any[]): void; + /** + * Sets the symbol to blend. + * @param symbol The symbol to blend. + */ + setSymbol(symbol: Symbol): void; + } + export = BlendRenderer; +} + declare module "esri/renderers/ClassBreaksRenderer" { import Renderer = require("esri/renderers/Renderer"); import FillSymbol = require("esri/symbols/FillSymbol"); @@ -11751,13 +11976,7 @@ declare module "esri/renderers/ClassBreaksRenderer" { * @param defaultSymbol Default symbol for the renderer. * @param attributeField Specify either the attribute field the renderer uses to match values or starting at version 3.3, a function that returns a value to be compared against class breaks. */ - constructor(defaultSymbol: Symbol, attributeField: string); - /** - * Creates a new ClassBreaksRenderer object. - * @param defaultSymbol Default symbol for the renderer. - * @param attributeField Specify either the attribute field the renderer uses to match values or starting at version 3.3, a function that returns a value to be compared against class breaks. - */ - constructor(defaultSymbol: Symbol, attributeField: Function); + constructor(defaultSymbol: Symbol, attributeField: string | Function); /** * Creates a new ClassBreaksRenderer. * @param json JSON object representing the ClassBreaksRenderer. @@ -11769,14 +11988,7 @@ declare module "esri/renderers/ClassBreaksRenderer" { * @param maxValue Maximum value in the break. * @param symbol Symbol used for the break. */ - addBreak(minValueOrInfo: number, maxValue?: number, symbol?: Symbol): void; - /** - * Adds a class break. - * @param minValueOrInfo The value can be provided as individual arguments or as an info object. - * @param maxValue Maximum value in the break. - * @param symbol Symbol used for the break. - */ - addBreak(minValueOrInfo: any, maxValue?: number, symbol?: Symbol): void; + addBreak(minValueOrInfo: number | any, maxValue?: number, symbol?: Symbol): void; /** Remove all existing class breaks for this renderer. */ clearBreaks(): void; /** @@ -11927,6 +12139,8 @@ declare module "esri/renderers/Renderer" { rotationInfo: any; /** Defines the size of the symbol where feature size is proportional to data value. */ sizeInfo: any; + /** This property allows you to define how to render values in a layer. */ + visualVariables: any[]; /** * Gets the color for the Graphic. * @param graphic Graphic to get color from. @@ -11952,6 +12166,13 @@ declare module "esri/renderers/Renderer" { * @param graphic Graphic to symbolize. */ getSymbol(graphic: Graphic): Symbol; + /** + * Returns the visual variable of the specified type. + * @param type The type of visual variable desired. + */ + getVisualVariablesForType(type: string): any; + /** Indicates if the renderer has defined visualVariables. */ + hasVisualVariables(): boolean; /** * Sets the colorInfo property. * @param info An info object that defines the color. @@ -11969,6 +12190,11 @@ declare module "esri/renderers/Renderer" { setRotationInfo(info: any): Renderer; /** Set size info of the renderer to modify the symbol size based on data value. */ setSizeInfo(): Renderer; + /** + * Sets the renderer with the specified visualVariables. + * @param visualParams The specified visualVariables. + */ + setVisualVariables(visualParams: any[]): void; /** Converts object to its ArcGIS Server JSON representation. */ toJson(): any; } @@ -12088,6 +12314,7 @@ declare module "esri/renderers/TemporalRenderer" { } declare module "esri/renderers/TimeClassBreaksAger" { + import esri = require("esri"); import SymbolAger = require("esri/renderers/SymbolAger"); import Symbol = require("esri/symbols/Symbol"); import Graphic = require("esri/graphic"); @@ -12112,10 +12339,10 @@ declare module "esri/renderers/TimeClassBreaksAger" { static UNIT_YEARS: any; /** * Creates a new TimeClassBreaksAgerObject with the specified time breaks inforamtion. - * @param infos Each element in the array is an object that describes the class breaks information. + * @param params Each element in the array is an object that describes the class breaks information. * @param timeUnits The unit in which the minimum and maximum break values are measured. */ - constructor(infos: any[], timeUnits?: string); + constructor(params: esri.TimeClassBreaksAgerOptions[], timeUnits?: string); /** * Calculates aging and returns the appropriate symbol. * @param symbol The symbol to age. @@ -12182,16 +12409,7 @@ declare module "esri/renderers/UniqueValueRenderer" { * @param attributeField3 If needed, specify an additional attribute field the renderer uses to match values. * @param fieldDelimeter String inserted between the values of different fields. */ - constructor(defaultSymbol: Symbol, attributeField: string, attributeField2?: string, attributeField3?: string, fieldDelimeter?: string); - /** - * Creates a new UniqueValueRenderer object. - * @param defaultSymbol Default symbol for the renderer. - * @param attributeField Specify either the attribute field the renderer uses to match values or starting at version 3.3, a function that returns a value to be compared against unique values. - * @param attributeField2 If needed, specify an additional attribute field the renderer uses to match values. - * @param attributeField3 If needed, specify an additional attribute field the renderer uses to match values. - * @param fieldDelimeter String inserted between the values of different fields. - */ - constructor(defaultSymbol: Symbol, attributeField: Function, attributeField2?: string, attributeField3?: string, fieldDelimeter?: string); + constructor(defaultSymbol: Symbol, attributeField: string | Function, attributeField2?: string, attributeField3?: string, fieldDelimeter?: string); /** * Creates a new Unique Value Renderer. * @param json JSON object representing the UniqueValueRenderer. @@ -12202,13 +12420,7 @@ declare module "esri/renderers/UniqueValueRenderer" { * @param valueOrInfo Value to match with. * @param symbol Symbol used for the value. */ - addValue(valueOrInfo: string, symbol?: Symbol): void; - /** - * Adds a unique value and symbol. - * @param valueOrInfo Value to match with. - * @param symbol Symbol used for the value. - */ - addValue(valueOrInfo: any, symbol?: Symbol): void; + addValue(valueOrInfo: string | any, symbol?: Symbol): void; /** * Returns rendering and legend information (as defined by the renderer) associated with the given graphic. * @param graphic The graphic whose rendering and legend information will be returned. @@ -12301,6 +12513,11 @@ declare module "esri/renderers/smartMapping" { * @param params See the object specifications table below for the structure of the params object. */ createHeatmapRenderer(params: any): any; + /** + * Creates an object that describes how opacity of features is calculated. + * @param params See the object specifications table below for the structure of the params object. + */ + createOpacityInfo(params: any): any; /** * Creates a renderer for visualizing features by varying their size based on data. * @param params See the object specifications table below for the structure of the params object. @@ -12477,16 +12694,7 @@ declare module "esri/symbols/Font" { * @param weight Font weight. * @param family Font family. */ - constructor(size?: number, style?: string, variant?: string, weight?: string, family?: string); - /** - * Creates a new Font object. - * @param size Font size. - * @param style Font style. - * @param variant Font variant. - * @param weight Font weight. - * @param family Font family. - */ - constructor(size?: string, style?: string, variant?: string, weight?: string, family?: string); + constructor(size?: number | string, style?: string, variant?: string, weight?: string, family?: string); /** * Creates a new Font object using a JSON object. * @param json JSON object representing the font. @@ -12506,12 +12714,7 @@ declare module "esri/symbols/Font" { * Sets the font size. * @param size Font size. */ - setSize(size: number): Font; - /** - * Sets the font size. - * @param size Font size. - */ - setSize(size: string): Font; + setSize(size: number | string): Font; /** * Sets the font style. * @param style Font style. @@ -12694,8 +12897,8 @@ declare module "esri/symbols/PictureMarkerSymbol" { declare module "esri/symbols/SimpleFillSymbol" { import FillSymbol = require("esri/symbols/FillSymbol"); - import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol"); import Color = require("esri/Color"); + import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol"); /** Fill symbols are used to draw polygon features on the graphics layer. */ class SimpleFillSymbol extends FillSymbol { @@ -12715,6 +12918,8 @@ declare module "esri/symbols/SimpleFillSymbol" { static STYLE_SOLID: any; /** The fill is vertical lines. */ static STYLE_VERTICAL: any; + /** Symbol color - only applies when SimpleFillSymbol.style = 'STYLE_SOLID'. */ + color: Color; /** The fill style. */ style: string; /** Creates a new empty SimpleFillSymbol object. */ @@ -12731,6 +12936,11 @@ declare module "esri/symbols/SimpleFillSymbol" { * @param json JSON object representing the SimpleFillSymbol. */ constructor(json: Object); + /** + * Sets the symbol color - only applies when style is STYLE_SOLID. + * @param color Symbol color. + */ + setColor(color: Color): SimpleFillSymbol; /** * Sets the fill symbol style. * @param style Fill style. @@ -13046,18 +13256,18 @@ declare module "esri/tasks/AlgorithmicColorRamp" { } declare module "esri/tasks/AreasAndLengthsParameters" { - import Geometry = require("esri/geometry/Geometry"); + import Polygon = require("esri/geometry/Polygon"); /** Input parameters for the areasAndLengths() method on the Geometry Service. */ class AreasAndLengthsParameters { /** The area unit in which areas of polygons will be calculated. */ - areaUnit: any; + areaUnit: number | string; /** Defines the type of calculation for the geometry. */ calculationType: string; /** The length unit in which perimeters of polygons will be calculated. */ - lengthUnit: any; + lengthUnit: number | string; /** Polygon geometries for which to compute areas and lengths */ - polygons: Geometry[]; + polygons: Polygon[]; /** Creates a new AreasAndLengthsParameters object. */ constructor(); } @@ -13083,7 +13293,7 @@ declare module "esri/tasks/BufferParameters" { /** If true, all geometries buffered at a given distance are unioned into a single (possibly multipart) polygon, and the unioned geometry is placed in the output array. */ unionResults: boolean; /** The units for calculating each buffer distance. */ - unit: string; + unit: number; /** Creates a new BufferParameters object. */ constructor(); } @@ -13165,7 +13375,7 @@ declare module "esri/tasks/ClosestFacilityParameters" { /** The set of facilities loaded as network locations during analysis. */ facilities: any; /** The network attribute field name used as the impedance attribute during analysis. */ - impedenceAttribute: string; + impedanceAttribute: string; /** The set of incidents loaded as network locations during analysis. */ incidents: any; /** The output geometry precision. */ @@ -13206,6 +13416,8 @@ declare module "esri/tasks/ClosestFacilityParameters" { timeOfDayUsage: string; /** Options for traveling to or from the facility. */ travelDirection: string; + /** Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. */ + travelMode: any; /** If true, the hierarchy attribute for the network will be used in analysis. */ useHierarchy: boolean; /** Creates a new ClosestFacilityParameters object */ @@ -13256,6 +13468,8 @@ declare module "esri/tasks/ClosestFacilityTask" { * @param url URL to the ArcGIS Server REST resource that represents a network analysis service. */ constructor(url: string); + /** Returns an object describing a Closest Facility service endpoint (URL of the endpoint is specified in the constructor). */ + getServiceDescription(): any; /** * Solve the closest facility. * @param params The ClosestFacilityParameters object. @@ -13350,7 +13564,7 @@ declare module "esri/tasks/DensifyParameters" { /** The array of geometries to be densified. */ geometries: Geometry[]; /** The length unit of maxSegmentLength, can be any esriUnits constant. */ - lengthUnit: any; + lengthUnit: number | string; /** All segments longer than maxSegmentLength are replaced with sequences of lines no longer than maxSegmentLength. */ maxSegmentLength: number; /** Converts object to its JSON representation. */ @@ -13392,10 +13606,10 @@ declare module "esri/tasks/DistanceParameters" { /** Input parameters for the distance method on the GeometryService. */ class DistanceParameters { /** Specifies the units for measuring distance between geometry1 and geometry2. */ - distanceUnit: any; + distanceUnit: number | string; /** When true, the geodesic distance between geometry1 and geometry2 is measured. */ geodesic: boolean; - /** The geometry from which the distance is to measured. */ + /** The geometry from which the distance is to be measured. */ geometry1: Geometry; /** The geometry to which the distance is measured. */ geometry2: Geometry; @@ -13547,7 +13761,7 @@ declare module "esri/tasks/GeneralizeParameters" { /** Sets the geometries, maximum deviation and units for the generalize operation. */ class GeneralizeParameters { /** The maximum deviation unit. */ - deviationUnit: any; + deviationUnit: number | string; /** The array of input geometries to generalize. */ geometries: Geometry[]; /** The maximum deviation for constructing a generalized geometry based on the input geometries. */ @@ -13625,6 +13839,7 @@ declare module "esri/tasks/GeometryService" { import ProjectParameters = require("esri/tasks/ProjectParameters"); import RelationParameters = require("esri/tasks/RelationParameters"); import TrimExtendParameters = require("esri/tasks/TrimExtendParameters"); + import Point = require("esri/geometry/Point"); /** Represents a geometry service resource exposed by the ArcGIS Server REST API. */ class GeometryService { @@ -13758,7 +13973,7 @@ declare module "esri/tasks/GeometryService" { * @param callback The function to call when the method has completed. * @param errback An error object is returned if an error occurs on the Server during task execution. */ - labelPoints(polygons: Geometry[], callback?: Function, errback?: Function): any; + labelPoints(polygons: Polygon[], callback?: Function, errback?: Function): any; /** * Gets the lengths for a Geometry[] when the geometry type is Polyline. * @param lengthsParameter Specify the polylines and optionally the length unit and the geodesic length option. @@ -13828,7 +14043,7 @@ declare module "esri/tasks/GeometryService" { /** Fires when the autoComplete operation is complete. */ on(type: "auto-complete-complete", listener: (event: { geometries: Polygon[]; target: GeometryService }) => void): esri.Handle; /** Fires when the buffer operation is complete. */ - on(type: "buffer-complete", listener: (event: { geometries: Geometry[]; target: GeometryService }) => void): esri.Handle; + on(type: "buffer-complete", listener: (event: { geometries: Polygon[]; target: GeometryService }) => void): esri.Handle; /** Fires when the convexHull operation is complete. */ on(type: "convex-hull-complete", listener: (event: { geometry: Geometry; target: GeometryService }) => void): esri.Handle; /** Fires when the cut operation is complete. */ @@ -13846,7 +14061,7 @@ declare module "esri/tasks/GeometryService" { /** Fires when the intersect operation is complete. */ on(type: "intersect-complete", listener: (event: { geometries: Geometry[]; target: GeometryService }) => void): esri.Handle; /** Fires when the labelPoints operation is complete. */ - on(type: "label-points-complete ", listener: (event: { geometries: Geometry[]; target: GeometryService }) => void): esri.Handle; + on(type: "label-points-complete ", listener: (event: { geometries: Point[]; target: GeometryService }) => void): esri.Handle; /** Fires when the lengths operation is complete. */ on(type: "lengths-complete", listener: (event: { result: any; target: GeometryService }) => void): esri.Handle; /** Fires when the offset operation is complete. */ @@ -14108,7 +14323,7 @@ declare module "esri/tasks/ImageServiceIdentifyParameters" { /** Specifies the mosaic rules defining the image sorting order. */ mosaicRule: MosaicRule; /** The pixel or RGB color value representing no information. */ - noData: any; + noData: string | number; /** Used along with the noData property. */ noDataInterpretation: string; /** Specify the pixel level being identified on the x and y axis. */ @@ -14160,7 +14375,7 @@ declare module "esri/tasks/ImageServiceIdentifyTask" { import ImageServiceIdentifyParameters = require("esri/tasks/ImageServiceIdentifyParameters"); import ImageServiceIdentifyResult = require("esri/tasks/ImageServiceIdentifyResult"); - /** Performs an identify operation on an image service resource . */ + /** Performs an identify operation on an image service resource. */ class ImageServiceIdentifyTask { /** * Creates a new ImageServiceIdentifyTask object. @@ -14181,6 +14396,60 @@ declare module "esri/tasks/ImageServiceIdentifyTask" { export = ImageServiceIdentifyTask; } +declare module "esri/tasks/ImageServiceMeasureParameters" { + import Geometry = require("esri/geometry/Geometry"); + import MosaicRule = require("esri/layers/MosaicRule"); + import Point = require("esri/geometry/Point"); + + /** Defines parameters for the ImageServiceMeasureTask. */ + class ImageServiceMeasureParameters { + /** The angular unit in which directions of line segments will be calculated. */ + angularUnit: string; + /** The area unit in which areas of polygons will be calculated. */ + areaUnit: string; + /** A geometry that defines the "from" location of the measurement. */ + fromGeometry: Geometry; + /** The linear unit in which height, length, or perimeters will be calculated. */ + linearUnit: string; + /** Specifies the mosaic rule when defining how individual images should be mosaicked. */ + mosaicRule: MosaicRule; + /** The mensuration rule to apply to the measure operation. */ + operation: string; + /** The pixel resolution being measured. */ + pixelSize: Point; + /** A geometry that defines the "to" location of the measurement. */ + toGeometry: Geometry; + /** Converts the ImageServiceMeasureParameters instance to a JSON object. */ + toJson(): any; + } + export = ImageServiceMeasureParameters; +} + +declare module "esri/tasks/ImageServiceMeasureTask" { + import esri = require("esri"); + import ImageServiceMeasureParameters = require("esri/tasks/ImageServiceMeasureParameters"); + + /** Performs a measure operation on an Image Service. */ + class ImageServiceMeasureTask { + /** + * Creates a new instance of ImageServiceMeasureTask + * @param url URL to the ArcGIS Server REST resource that represents an image service. + */ + constructor(url: string); + /** + * Sends a request to an image service to perform the designated measure operation. + * @param params Parameters to pass to the server to execute the task. + * @param callback The function to call when the method has completed. + * @param errback An error object is returned if an error occurs on the Server during task execution. + */ + execute(params: ImageServiceMeasureParameters, callback?: Function, errback?: Function): any; + /** Fires when measure completes. */ + on(type: "complete", listener: (event: { target: ImageServiceMeasureTask }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = ImageServiceMeasureTask; +} + declare module "esri/tasks/JobInfo" { import GPMessage = require("esri/tasks/GPMessage"); @@ -14241,7 +14510,7 @@ declare module "esri/tasks/LengthsParameters" { /** If polylines are in geographic coordinate system, then geodesic needs to be set to true in order to calculate the ellipsoidal shortest path distance between each pair of the vertices in the polylines. */ geodesic: boolean; /** The length unit in which perimeters of polygons will be calculated. */ - lengthUnit: any; + lengthUnit: number | string; /** The array of polylines whose lengths are to be computed. */ polylines: Geometry[]; /** Creates a new LengthsParameter object. */ @@ -14408,7 +14677,7 @@ declare module "esri/tasks/PrintTemplate" { exportOptions: any; /** The print output format. */ format: string; - /** The text that appears on the PrintWidget's print button. */ + /** The text that appears on the Print widget's print button. */ label: string; /** The layout used for the print output. */ layout: string; @@ -14420,6 +14689,8 @@ declare module "esri/tasks/PrintTemplate" { preserveScale: boolean; /** When false, attribution is not displayed on the printout. */ showAttribution: boolean; + /** Indicates whether visible LabelLayers in the map are displayed or not. */ + showLabels: boolean; /** Creates a new PrintTemplate object. */ constructor(); } @@ -14666,6 +14937,8 @@ declare module "esri/tasks/RouteParameters" { startTimeIsUTC: boolean; /** The set of stops loaded as network locations during analysis. */ stops: any; + /** Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. */ + travelMode: any; /** If true, the hierarchy attribute for the network should be used in analysis. */ useHierarchy: boolean; /** A useful feature of the RouteTask is the ability to constrain stop visits to certain times of day, or "time windows". */ @@ -14707,6 +14980,8 @@ declare module "esri/tasks/RouteTask" { * @param url URL to the ArcGIS Server REST resource that represents a network analysis service. */ constructor(url: string); + /** Returns an object describing a Route service endpoint (URL of the endpoint is specified in the constructor). */ + getServiceDescription(): any; /** * Solves the route against the route layer with the route parameters. * @param params Route parameters used as input to generate the route. @@ -14784,6 +15059,8 @@ declare module "esri/tasks/ServiceAreaParameters" { timeOfDay: Date; /** Options for traveling to or from the facility. */ travelDirection: string; + /** Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. */ + travelMode: any; /** If true, the outermost polygon (at the maximum break value) will be trimmed. */ trimOuterPolygon: boolean; /** If polygons are being trimmed, provides the distance to trim. */ @@ -14837,6 +15114,8 @@ declare module "esri/tasks/ServiceAreaTask" { * @param url URL to the ArcGIS Server REST resource that represents a network analysis service. */ constructor(url: string); + /** Returns an object describing a Service Area service endpoint (URL of the endpoint is specified in the constructor). */ + getServiceDescription(): any; /** * Solve the service area. * @param params The ServiceAreaParameters object. @@ -14871,8 +15150,20 @@ declare module "esri/tasks/TrimExtendParameters" { /** Sets the polylines and other parameters for the trimExtend operation. */ class TrimExtendParameters { + /** Default value. */ + static DEFAULT_CURVE_EXTENSION: any; + /** When an extension is performed at an end, do not extrapolate the end segments attributes for the new point. */ + static KEEP_END_ATTRIBUTES: any; + /** When an extension is performed at an end, do not extrapolate the end segment's attributes for the new point. */ + static NO_END_ATTRIBUTES: any; + /** Do not extend the 'from' end of any path. */ + static NO_EXTEND_AT_FROM: any; + /** Do not extend the 'to' end of any path. */ + static NO_EXTEND_AT_TO: any; + /** When an extension is performed at an end, relocate the end point to the new position. */ + static RELOCATE_ENDS: any; /** A flag used along with the trimExtend operation. */ - extendHow: string; + extendHow: number; /** The array of polylines to trim or extend. */ polylines: Polyline[]; /** A polyline used as a guide for trimming or extending input polylines. */ @@ -14908,6 +15199,550 @@ declare module "esri/tasks/UniqueValueDefinition" { export = UniqueValueDefinition; } +declare module "esri/tasks/datareviewer/BatchValidationJob" { + import BatchValidationJobInfo = require("esri/tasks/datareviewer/BatchValidationJobInfo"); + import BatchValidationParameters = require("esri/tasks/datareviewer/BatchValidationParameters"); + + /** Encapsulates a Batch Validation Job. */ + class BatchValidationJob { + /** Contains a list of batch run IDs, one for each batch validation execution associated with this batch validation job. */ + batchRunIds : string[]; + /** Gets job creation date. */ + creationDate: Date; + /** Gets the Job Id. */ + jobId: string; + /** Gets batch job execution details. */ + jobInfo: BatchValidationJobInfo; + /** Gets batch job parameters. */ + parameters: BatchValidationParameters; + /** Gets the job status. */ + status: string; + /** Gets the job type. */ + type: string; + } + export = BatchValidationJob; +} + +declare module "esri/tasks/datareviewer/BatchValidationJobInfo" { + /** Encapsulates batch validation job execution details. */ + class BatchValidationJobInfo { + /** Gets the batch run Id of the job execution. */ + batchRunId: string; + /** Gets the finish time of the job execution. */ + finishTimeUTC: Date; + /** Gets the job's geoprocessing Job Id. */ + gpJobId: string; + /** Gets the URL of the geoprocessing service that executed the batch validation. */ + gpUrl: string; + /** Gets batch validation messages. */ + messages: string; + /** Gets the start time of the job execution. */ + startTimeUTC: Date; + /** Gets the batch validation status. */ + status: string; + } + export = BatchValidationJobInfo; +} + +declare module "esri/tasks/datareviewer/BatchValidationParameters" { + import Polygon = require("esri/geometry/Polygon"); + + /** Encapsulates batch job parameters including session Id, production workspace and analysis area. */ + class BatchValidationParameters { + /** A geometry that defines the validation extent. */ + analysisArea: Polygon; + /** Read-only: Gets the uploaded batch job name. */ + batchJobFileName: string; + /** Controls validation type on enterprise geodatabases. */ + changedFeaturesOnly: boolean; + /** Read-only: Gets the name of the web user that created the batch job schedule. */ + createdBy: string; + /** Gets or sets the batch validation execution schedule. */ + cronExpression: string; + /** Gets or sets the ending date for a batch validation schedule. */ + executionsEndDate: Date; + /** Gets or sets the ID of the uploaded batch job. */ + fileItemId: string; + /** Gets or sets the maximum number of batch validation executions that can run. */ + maxNumberOfExecutions: number; + /** Gets or sets the production workspace path. */ + productionWorkspace: string; + /** Gets or sets the ArcGIS Data Reviewer session. */ + sessionString: string; + /** Gets or sets the batch validation title. */ + title: string; + /** Gets or sets the user name under which records are written to the reviewer workspace. */ + userName: string; + } + export = BatchValidationParameters; +} + +declare module "esri/tasks/datareviewer/BatchValidationTask" { + import esri = require("esri"); + import SessionOptions = require("esri/tasks/datareviewer/SessionOptions"); + import BatchValidationParameters = require("esri/tasks/datareviewer/BatchValidationParameters"); + import ReviewerSession = require("esri/tasks/datareviewer/ReviewerSession"); + import BatchValidationJob = require("esri/tasks/datareviewer/BatchValidationJob"); + import BatchValidationJobInfo = require("esri/tasks/datareviewer/BatchValidationJobInfo"); + + /** Exposes functions for executing and scheduling Batch Validation in ArcGIS Data Reviewer for Server. */ + class BatchValidationTask { + /** + * Creates a new BatchValidationTask object. + * @param url The DataReviewerServer Server Object Extension (SOE) URL. + */ + constructor(url: string); + /** + * Cancels an executing job. + * @param jobId Job Id of the batch validation job to cancel. + */ + cancelJobExecution(jobId: string): any; + /** + * Creates a new Reviewer session. + * @param sessionName Name of the session to be created. + * @param sessionOptions Session properties to be used to create the session. + */ + createReviewerSession(sessionName: string, sessionOptions: SessionOptions): any; + /** + * Deletes an existing scheduled Batch Validation Job. + * @param jobId Job Id of the batch validation job to delete. + */ + deleteJob(jobId: string): any; + /** + * Pauses an existing Batch Validation Job's schedule. + * @param jobId Job Id of the batch validation job to be disabled. + */ + disableJob(jobId: string): any; + /** + * Edits the schedule, settings and title of an existing Batch Validation Job. + * @param jobId Job Id of the batch validation job to edit. + * @param parameters Parameters to change in an existing batch job. + */ + editJob(jobId: string, parameters: BatchValidationParameters): any; + /** + * Restarts an existing Batch Validation Job's schedule. + * @param jobId Job Id of the batch validation job to enable. + */ + enableJob(jobId: string): any; + /** + * Executes an adhoc job. + * @param parameters Parameters specifying the details of a job to execute. + */ + executeJob(parameters: BatchValidationParameters): any; + /** Retrieves all adhoc jobs from the server and returns an array of BatchValidationJob with the information. */ + getAdhocJobsList(): any; + /** + * Fetches Batch Validation Job details. + * @param jobId Job Id of the batch validation job. + */ + getJobDetails(jobId: string): any; + /** + * Fetches the Job Execution details of a Batch Validation Job. + * @param jobId Job Id of the batch validation job. + */ + getJobExecutionDetails(jobId: string): any; + /** Returns an object that contains Scheduled and AdhocJob IDs in two separate arrays. */ + getJobIds(): any; + /** Retrieves a list of localized life cycle status strings from the Reviewer workspace. */ + getLifecycleStatusStrings(): any; + /** Extracts the MapServer url from the full ArcGIS Data Reviewer for Server SOE url. */ + getReviewerMapServerUrl(): string; + /** Returns an array of sessions in a Reviewer workspace. */ + getReviewerSessions(): any; + /** Retrieves all scheduled jobs from the server and returns an array of BatchValidationJob with the information. */ + getScheduledJobsList(): any; + /** + * Schedules a new Batch Validation. + * @param parameters Parameters for scheduling a batch job. + */ + scheduleJob(parameters: BatchValidationParameters): any; + /** Fires when the cancelJobExecution method is complete. */ + on(type: "cancel-job-execution", listener: (event: { canceled: boolean; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the createReviewerSessions method is complete. */ + on(type: "create-reviewer-sessions", listener: (event: { reviewerSession: ReviewerSession; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the deleteJob method is complete. */ + on(type: "delete-job", listener: (event: { deleted: boolean; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the disableJob method is complete. */ + on(type: "disable-job", listener: (event: { disabled: boolean; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the editJob method is complete. */ + on(type: "edit-job", listener: (event: { edited: boolean; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the enableJob method is complete. */ + on(type: "enable-job", listener: (event: { enabled: boolean; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when an error occurs during a BatchValidationTask method execution. */ + on(type: "error", listener: (event: { error: Error; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the executeJob method is complete. */ + on(type: "execute-job", listener: (event: { jobId: string; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the getAdhocJobsList method is complete. */ + on(type: "get-adhoc-jobs-list", listener: (event: { adhocJobs: any[]; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the getJobDetails method is complete. */ + on(type: "get-job-details", listener: (event: { jobDetails: BatchValidationJob; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the getJobExecutionDetails method is complete. */ + on(type: "get-job-execution-details", listener: (event: { jobInfo: BatchValidationJobInfo; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the getJobIds method is complete. */ + on(type: "get-job-ids", listener: (event: { adhocJobs: any[]; scheduledJobs: any[]; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the getLifecycleStatusStrings method is complete. */ + on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: any[]; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the getReviewerSessions method is complete. */ + on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: any[]; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the getScheduledJobsList method is complete. */ + on(type: "get-scheduled-jobs-list", listener: (event: { scheduledJobs: any[]; target: BatchValidationTask }) => void): esri.Handle; + /** Fires when the scheduleJob method is complete. */ + on(type: "schedule-job", listener: (event: { jobId: string; target: BatchValidationTask }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = BatchValidationTask; +} + +declare module "esri/tasks/datareviewer/DashboardResult" { + import ReviewerFilters = require("esri/tasks/datareviewer/ReviewerFilters"); + + /** Encapsulates data describing a Dashboard Result. */ + class DashboardResult { + /** Array of reviewer result field value counts. */ + counts: any[]; + /** Name of the reviewer results field. */ + fieldName: string; + /** Array of reviewer results field values. */ + fieldValues: any[]; + /** An instance of ReviewerFilters class. */ + filters: ReviewerFilters; + /** + * Gets the result count for a field value. + * @param fieldValue Unique field value from the fieldValues array. + */ + getCount(fieldValue: string | number): number; + } + export = DashboardResult; +} + +declare module "esri/tasks/datareviewer/DashboardTask" { + import esri = require("esri"); + import SessionOptions = require("esri/tasks/datareviewer/SessionOptions"); + import ReviewerFilters = require("esri/tasks/datareviewer/ReviewerFilters"); + import ReviewerSession = require("esri/tasks/datareviewer/ReviewerSession"); + import DashboardResult = require("esri/tasks/datareviewer/DashboardResult"); + + /** Provides functionality to retrieve dashboard results from an ArcGIS Data Reviewer for Server Dashboard REST resource. */ + class DashboardTask { + /** + * Creates a new DashboardTask object. + * @param url The DataReviewerServer Server Object Extension (SOE) URL. + */ + constructor(url: string); + /** + * Creates a new Reviewer session. + * @param sessionName Name of the session to be created. + * @param sessionOptions Session properties to be used to create the session. + */ + createReviewerSession(sessionName: string, sessionOptions: SessionOptions): any; + /** Requests Dashboard results field names. */ + getDashboardFieldNames(): any; + /** + * Requests dashboard results by fieldName. + * @param fieldName Field name for dashboard results. + * @param filters Instance of ReviewerFilters containing one or more filters used to narrow down dashboard results. + */ + getDashboardResults(fieldName: string, filters?: ReviewerFilters): any; + /** Retrieves a list of localized life cycle status strings from the Reviewer workspace. */ + getLifecycleStatusStrings(): any; + /** Extracts the MapServer url from the full ArcGIS Data Reviewer for Server SOE url. */ + getReviewerMapServerUrl(): string; + /** Returns an array of sessions in a Reviewer workspace. */ + getReviewerSessions(): any; + /** Fires when the createReviewerSessions method is complete. */ + on(type: "create-reviewer-sessions", listener: (event: { reviewerSession: ReviewerSession; target: DashboardTask }) => void): esri.Handle; + /** Fires when an error occurs during a DashboardTask method execution. */ + on(type: "error", listener: (event: { error: Error; target: DashboardTask }) => void): esri.Handle; + /** Fires when the getDashboardFieldNames method is complete. */ + on(type: "get-dashboard-field-names", listener: (event: { fieldNames: any[]; target: DashboardTask }) => void): esri.Handle; + /** Fires when the getDashboardResults method is complete. */ + on(type: "get-dashboard-results", listener: (event: { dashboardResult: DashboardResult; target: DashboardTask }) => void): esri.Handle; + /** Fires when the getLifecycleStatusStrings method is complete. */ + on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: any[]; target: DashboardTask }) => void): esri.Handle; + /** Fires when the getReviewerSessions method is complete. */ + on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: any[]; target: DashboardTask }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = DashboardTask; +} + +declare module "esri/tasks/datareviewer/GetResultsQueryParameters" { + /** Encapsulates data used for retrieving results from the reviewer workspace. */ + class GetResultsQueryParameters { + /** The page number, zero based index, of the results to return. */ + pageNumber: number; + /** The number of items to list on a page. */ + pageSize: number; + /** Array of field names. */ + returnFields: any[]; + /** Indicates a field name by which to sort. */ + sortBy: string; + /** Controls sort order. */ + sortDescending: boolean; + /** Returns a JSON representation of an instance of GetResultsQueryParameters. */ + toJSON(): any; + } + export = GetResultsQueryParameters; +} + +declare module "esri/tasks/datareviewer/ReviewerAttributes" { + /** Encapsulates data used by the writeFeatureAsResult and writeResult methods of the ReviewerResults class. */ + class ReviewerAttributes { + /** Represents the state of a reviewer result. */ + lifecycleStatus: number; + /** Extra information describing a result or feature. */ + notes: string; + /** Represents an ArcGIS Data Reviewer resource name. */ + resourceName: string; + /** A status value (any string) to write to the ReviewStatus field for the result or feature written to the reviewer workspace. */ + reviewStatus: string; + /** The user name under which results or features are written to the reviewer workspace. */ + reviewTechnician: string; + /** Represents an ArcGIS Data Reviewer session ID, the numeric identifier of the session. */ + sessionId: number; + /** Represents an ArcGIS Data Reviewer severity value. */ + severity: number; + /** Subtype from the original feature that was checked and caused an error. */ + subtype: string; + /** Returns a JSON representation of an instance of ReviewerAttributes. */ + toJSON(): any; + } + export = ReviewerAttributes; +} + +declare module "esri/tasks/datareviewer/ReviewerFilters" { + import Polygon = require("esri/geometry/Polygon"); + + /** ReviewerFilters limit or precisely define which results to generate by applying conditions to a query for dashboard results. */ + class ReviewerFilters { + /** + * Queries an attribute by a value. + * @param fieldName The field used to perform the filter. + * @param fieldValues A value or an Array of values in fieldName to filter. + */ + addAttributeFilter(fieldName: string, fieldValues: string | number | any[]): void; + /** + * Queries an attribute by a range of values. + * @param fieldName The field used to perform the filter. + * @param min Minimum value range. + * @param max Maximum value range. + */ + addRangeFilter(fieldName: string, min: string | number, max: string | number): void; + /** + * Queries by a polygon. + * @param geometry The geometry used to perform the filter. + */ + addSpatialFilter(geometry: Polygon): void; + /** Returns the count of ReviewerFilters added. */ + getCount(): number; + /** Returns a JSON representation of a filter object. */ + toJSON(): any; + } + export = ReviewerFilters; +} + +declare module "esri/tasks/datareviewer/ReviewerLifecycle" { + /** The ReviewerLifecycle class specifies constant values for all lifecycle status and lifecycle phase strings within the Reviewer quality control workflow. */ + class ReviewerLifecycle { + /** Acceptable lifecycleStatus code = 4 belongs to Verification Phase. */ + ACCEPTABLE: number; + /** Code for Correction Phase. */ + CORRECTION: number; + /** Exception lifecycleStatus code = 9 belongs to Verification Phase. */ + EXCEPTION: number; + /** Failed lifecycleStatus code = 12 belongs to Verification Phase. */ + FAILED: number; + /** Object containing lifecycle phase codes and their associated descriptions. */ + LIFECYCLEPHASE_DESCRIPTIONS: any; + /** Object containing lifecycle status codes and their associated descriptions. */ + LIFECYCLESTATUS_DESCRIPTIONS: any; + /** Mark As Exception lifecycleStatus code = 3 belongs to Correction Phase. */ + MARK_AS_EXCEPTION: number; + /** New lifecycleStatus code = 10 belongs to Review Phase. */ + NEW: number; + /** Passed lifecycleStatus code = 11 belongs to Verification Phase. */ + PASSED: number; + /** Resolved lifecycleStatus code = 2 belongs to Correction Phase. */ + RESOLVED: number; + /** Code for Review Phase. */ + REVIEW: number; + /** Reviewed lifecycleStatus code = 1 belongs to Review Phase. */ + REVIEWED: number; + /** Unacceptable lifecycleStatus code = 6 belongs to Review Phase. */ + UNACCEPTABLE: number; + /** Unknown lifecycleStatus code = 0 belongs to Review Phase. */ + UNKNOWN: number; + /** Unresolved Acceptable lifecycleStatus code = 8 belongs to Verification Phase. */ + UNRESOLVED_ACCEPTABLE: number; + /** Unresolved Exception lifecycleStatus code = 5 belongs to Verification Phase. */ + UNRESOLVED_EXCEPTION: number; + /** Unresolved Unacceptable lifecycleStatus code = 7 belongs to Review Phase. */ + UNRESOLVED_UNACCEPTABLE: number; + /** Code for Verififcation Phase. */ + VERIFICATION: number; + /** + * This function returns the the associated lifecycle phase of the input lifecycle status. + * @param lifecycleStatus The lifecycle status code. + */ + getCurrentLifecyclePhase(lifecycleStatus: number): string; + /** + * This function accepts an array of lifecycle statuses and returns an object containing the next appropriate lifecycle status and phase that the record will advance to. + * @param lifecycleStatus An Array of lifecycle statuses. + */ + getLifecycleInfo(lifecycleStatus: any[]): any; + /** + * This function returns lifecycle phase string associated with the input lifecycle phase code. + * @param lifecyclePhase The lifecycle phase code. + */ + toLifecyclePhaseString(lifecyclePhase: number): string; + /** + * This function returns lifecycle status string associated with the input lifecycle status code. + * @param lifecycleStatus The lifecycle status code. + */ + toLifecycleStatusString(lifecycleStatus: number): string; + } + export = ReviewerLifecycle; +} + +declare module "esri/tasks/datareviewer/ReviewerResultsTask" { + import esri = require("esri"); + import SessionOptions = require("esri/tasks/datareviewer/SessionOptions"); + import ReviewerFilters = require("esri/tasks/datareviewer/ReviewerFilters"); + import GetResultsQueryParameters = require("esri/tasks/datareviewer/GetResultsQueryParameters"); + import ReviewerAttributes = require("esri/tasks/datareviewer/ReviewerAttributes"); + import Graphic = require("esri/graphic"); + import Geometry = require("esri/geometry/Geometry"); + import ReviewerSession = require("esri/tasks/datareviewer/ReviewerSession"); + import FeatureSet = require("esri/tasks/FeatureSet"); + + /** ReviewerResults allows access to the reviewer workspace. */ + class ReviewerResultsTask { + /** + * Creates a new ReviewerResultsTask object. + * @param url The DataReviewerServer Server Object Extension (SOE) URL. + */ + constructor(url: string); + /** + * Creates a new Reviewer session. + * @param sessionName Name of the session to be created. + * @param sessionOptions Session properties to be used to create the session. + */ + createReviewerSession(sessionName: string, sessionOptions: SessionOptions): any; + /** + * Fetches batch run information from REVBATCHRUNTABLE and REVCHECKRUNTABLE. + * @param batchRunIds Array of batchRunIds used to get batch run details. + */ + getBatchRunDetails(batchRunIds: any[]): any; + /** + * Utility operation that returns a where clause given a set of input filters. + * @param filters An instance of ReviewerFilters used to create a layer definition. + */ + getLayerDefinition(filters: ReviewerFilters): any; + /** Retrieves a list of localized life cycle status strings from the Reviewer workspace. */ + getLifecycleStatusStrings(): any; + /** + * Queries records from REVTABLEMAIN, REVBATCHRUNTABLE and REVCHECKRUNTABLE. + * @param getResultsQueryParameters Defines the size and scope of the FeatureSet returned to the callback function. + * @param filters Instance of ReviewerFilters used to query reviewer results. + */ + getResults(getResultsQueryParameters: GetResultsQueryParameters, filters?: ReviewerFilters): any; + /** Extracts the MapServer url from the full ArcGIS Data Reviewer for Server SOE url. */ + getReviewerMapServerUrl(): any; + /** Returns an array of sessions in a Reviewer workspace. */ + getReviewerSessions(): any; + /** + * Updates lifecycle status of the Reviewer results. + * @param sessionId Session that contains results to update. + * @param lifecycleStatus Lifecycle status to which the Reviewer results will get updated. + * @param technicianName Name of the technician performing the update. + * @param filters Instance of ReviewerFilters used to query Reviewer results. + */ + updateLifecycleStatus(sessionId: number, lifecycleStatus: number, technicianName: string, filters: ReviewerFilters): any; + /** + * Writes a feature to the reviewer workspace. + * @param reviewerAttributes Class used to encapsulate all fields to be written to the reviewer workspace. + * @param feature Graphic to write to the reviewer workspace. + */ + writeFeatureAsResult(reviewerAttributes: ReviewerAttributes, feature: Graphic): any; + /** + * Writes a geometry and associated reviewer attributes to the reviewer workspace. + * @param reviewerAttributes Class used to encapsulate all fields to be written to the reviewer workspace. + * @param geometry A Geometry (point, polyline or polygon) to write to the reviewer workspace. + */ + writeResult(reviewerAttributes: ReviewerAttributes, geometry: Geometry): any; + /** Fires when the createReviewerSession method is complete. */ + on(type: "create-reviewer-sessions", listener: (event: { reviewerSession: ReviewerSession; target: ReviewerResultsTask }) => void): esri.Handle; + /** Fires when an error occurs during a ReviewerResultsTask method execution. */ + on(type: "error", listener: (event: { error: Error; target: ReviewerResultsTask }) => void): esri.Handle; + /** Fires when the getBatchRunDetails method is complete. */ + on(type: "get-batch-run-details", listener: (event: { featureSet: FeatureSet; target: ReviewerResultsTask }) => void): esri.Handle; + /** Fires when the getLayerDefinition method is complete. */ + on(type: "get-layer-definition", listener: (event: { whereClause: string; target: ReviewerResultsTask }) => void): esri.Handle; + /** Fires when the getLifecycleStatusStrings method is complete. */ + on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: any[]; target: ReviewerResultsTask }) => void): esri.Handle; + /** Fires when the getResults method is complete. */ + on(type: "get-results", listener: (event: { featureSet: FeatureSet; target: ReviewerResultsTask }) => void): esri.Handle; + /** Fires when the getReviewerSessions method is complete. */ + on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: any[]; target: ReviewerResultsTask }) => void): esri.Handle; + /** Fires when the updateLifecycleStatus method is complete. */ + on(type: "update-lifecycle-status", listener: (event: { featureEditResults: any[]; target: ReviewerResultsTask }) => void): esri.Handle; + /** Fires when the writeFeatureAsResult method is complete. */ + on(type: "write-feature-as-result", listener: (event: { success: boolean; target: ReviewerResultsTask }) => void): esri.Handle; + /** Fires when the writeResult method is complete. */ + on(type: "write-result", listener: (event: { success: boolean; target: ReviewerResultsTask }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = ReviewerResultsTask; +} + +declare module "esri/tasks/datareviewer/ReviewerSession" { + /** Represents an ArcGIS Data Reviewer session in which validation and manual quality control results are written to the reviewer workspace. */ + class ReviewerSession { + /** Numeric identifier of the session. */ + sessionId: number; + /** Session name. */ + sessionName: string; + /** Name under which records are written to the reviewer workspace. */ + userName: string; + /** Enterprise geodatabase version in which records are validated. */ + versionName: string; + /** + * Creates a new ReviewerSession object. + * @param sessionId Numeric identifier of the session. + * @param sessionName Name of the session. + * @param userName User name under which records are written to the reviewer workspace. + * @param versionName The enterprise geodatabase version in which records are validated. + */ + constructor(sessionId: string, sessionName: string, userName: string, versionName: string); + /** The Session ID and name in format Session 10 : Parcels. */ + toString(): string; + } + export = ReviewerSession; +} + +declare module "esri/tasks/datareviewer/SessionOptions" { + /** Represents an ArcGIS Data Reviewer session properties in which validation and manual quality control results are written to the reviewer workspace. */ + class SessionOptions { + /** Indicates how to handle duplicate results when writing the results to the Reviewer workspace. */ + duplicateFilter: string; + /** Indicates if validation result geometries are stored in the Reviewer workspace. */ + storeGeometry: boolean; + /** The user account to associate with a session. */ + userName: string; + /** Indicates an enterprise geodatabase version to associate with the session. */ + versionName: string; + /** + * Creates a new SessionOptions object. + * @param userName The username under which records are written to the reviewer workspace. + * @param versionName The enterprise geodatabase version under which records are written to the reviewer workspace. + * @param duplicateFilter Handle duplicate results when writing the results to the Reviewer workspace. + * @param storeGeometry Controls if validation result geometries are stored in the Reviewer workspace. + */ + constructor(userName: string, versionName: string, duplicateFilter: string, storeGeometry: boolean); + } + export = SessionOptions; +} + declare module "esri/tasks/geoenrichment/AddressStudyArea" { import StudyArea = require("esri/tasks/geoenrichment/StudyArea"); @@ -15019,7 +15854,7 @@ declare module "esri/tasks/geoenrichment/GeographyLevel" { declare module "esri/tasks/geoenrichment/GeographyQuery" { import GeographyQueryBase = require("esri/tasks/geoenrichment/GeographyQueryBase"); - /** (Beta at v3.12) Represents StandardGeographyQuery parameters to search for geographies by ID or Name. */ + /** (Currently in beta) Represents StandardGeographyQuery parameters to search for geographies by ID or Name. */ class GeographyQuery extends GeographyQueryBase { /** Array of geography IDs. */ geographyIDs: string[]; @@ -15036,7 +15871,7 @@ declare module "esri/tasks/geoenrichment/GeographyQuery" { declare module "esri/tasks/geoenrichment/GeographyQueryBase" { import SpatialReference = require("esri/SpatialReference"); - /** (Beta at v3.12) Base class for all GeographyQuery objects. */ + /** (Currently in beta) Base class for all GeographyQuery objects. */ class GeographyQueryBase { /** Two-digit country code. */ countryID: string; @@ -15113,7 +15948,7 @@ declare module "esri/tasks/geoenrichment/StandardGeographyQueryTask" { import GeographyQueryBase = require("esri/tasks/geoenrichment/GeographyQueryBase"); import FeatureSet = require("esri/tasks/FeatureSet"); - /** (Beta at v3.12) Geoenrichment helper task that returns standard geography IDs and features for the supported geographic levels in Canada, the United States and a number of European countries. */ + /** (Currently in beta) Geoenrichment helper task that returns standard geography IDs and features for the supported geographic levels in Canada, the United States and a number of European countries. */ class StandardGeographyQueryTask { /** * Creates a new instance of the StandardGeographyQueryTask class. @@ -15151,6 +15986,9 @@ declare module "esri/tasks/geoenrichment/StandardGeographyStudyArea" { declare module "esri/tasks/geoenrichment/StudyArea" { import GeographyLevel = require("esri/tasks/geoenrichment/GeographyLevel"); + import RingBuffer = require("esri/tasks/geoenrichment/RingBuffer"); + import DriveBuffer = require("esri/tasks/geoenrichment/DriveBuffer"); + import IntersectingGeographies = require("esri/tasks/geoenrichment/IntersectingGeographies"); /** The study area that is used for enrichment or for display in an Infographic widget. */ class StudyArea { @@ -15159,7 +15997,7 @@ declare module "esri/tasks/geoenrichment/StudyArea" { /** The identifiers for layers used to find comparison geographies. */ comparisonGeographyLevels: GeographyLevel[]; /** The options to apply to the study area. */ - options: any; + options: RingBuffer | DriveBuffer | IntersectingGeographies; /** If true, geometry will be returned. */ returnGeometry: boolean; /** Converts object to its JSON representation. */ @@ -15171,7 +16009,7 @@ declare module "esri/tasks/geoenrichment/StudyArea" { declare module "esri/tasks/geoenrichment/SubGeographyQuery" { import GeographyQueryBase = require("esri/tasks/geoenrichment/GeographyQueryBase"); - /** (Beta at v3.12) Represents StandardGeographyQuery parameters to search subgeographic areas that are within a parent geography. */ + /** (Currently in beta) Represents StandardGeographyQuery parameters to search subgeographic areas that are within a parent geography. */ class SubGeographyQuery extends GeographyQueryBase { /** Parent layer geography IDs. */ filterGeographyIDs: string; @@ -15196,7 +16034,7 @@ declare module "esri/tasks/locationproviders/CoordinatesLocationProvider" { import esri = require("esri"); import LocationProviderClientBase = require("esri/tasks/locationproviders/LocationProviderClientBase"); - /** (Beta at v3.12) The CoordinatesLocationProvider class uses the fields that contain Latitude and Longitude values to generate or locate geometries. */ + /** (Currently in beta) The CoordinatesLocationProvider class uses the fields that contain Latitude and Longitude values to generate or locate geometries. */ class CoordinatesLocationProvider extends LocationProviderClientBase { /** The attribute field in the graphic object that has the longitude (X) values. */ xField: string; @@ -15215,7 +16053,7 @@ declare module "esri/tasks/locationproviders/GeometryLocationProvider" { import esri = require("esri"); import LocationProviderClientBase = require("esri/tasks/locationproviders/LocationProviderClientBase"); - /** (Beta at v3.12) The GeometryLocationProvider class uses the field in the data that has geometry as a JSON to generate the corresponding geometry. */ + /** (Currently in beta) The GeometryLocationProvider class uses the field in the data that has geometry as a JSON to generate the corresponding geometry. */ class GeometryLocationProvider extends LocationProviderClientBase { /** The attribute field in the graphic object that contains the JSON string representing the geometry. */ geometryField: string; @@ -15232,7 +16070,7 @@ declare module "esri/tasks/locationproviders/LocationProviderBase" { import esri = require("esri"); import Graphic = require("esri/graphic"); - /** (Beta at v3.12) The base class for all LocationProviders. */ + /** (Currently in beta) The base class for all LocationProviders. */ class LocationProviderBase { /** The geometry type of the returned features. */ geometryType: string; @@ -15261,7 +16099,7 @@ declare module "esri/tasks/locationproviders/LocationProviderClientBase" { import LocationProviderBase = require("esri/tasks/locationproviders/LocationProviderBase"); import SpatialReference = require("esri/SpatialReference"); - /** (Beta at v3.12) The base class for CoordinatesLocationProvider and GeometryLocationProvider. */ + /** (Currently in beta) The base class for CoordinatesLocationProvider and GeometryLocationProvider. */ class LocationProviderClientBase extends LocationProviderBase { /** The Spatial Reference of the input geometries. */ inSpatialReference: SpatialReference; @@ -15272,7 +16110,7 @@ declare module "esri/tasks/locationproviders/LocationProviderClientBase" { declare module "esri/tasks/locationproviders/LocationProviderRemoteBase" { import LocationProviderBase = require("esri/tasks/locationproviders/LocationProviderBase"); - /** (Beta at v3.12) The base class for Location Providers that use a remote service to locate geometries. */ + /** (Currently in beta) The base class for Location Providers that use a remote service to locate geometries. */ class LocationProviderRemoteBase extends LocationProviderBase { } export = LocationProviderRemoteBase; @@ -15283,7 +16121,7 @@ declare module "esri/tasks/locationproviders/LocatorLocationProvider" { import LocationProviderRemoteBase = require("esri/tasks/locationproviders/LocationProviderRemoteBase"); import Locator = require("esri/tasks/locator"); - /** (Beta at v3.12) The LocatorLocationProvider class uses a geocode service through the Locator object to generate or locate geometries using fields in the graphics that contain Street address information */ + /** (Currently in beta) The LocatorLocationProvider class uses a geocode service through the Locator object to generate or locate geometries using fields in the graphics that contain Street address information */ class LocatorLocationProvider extends LocationProviderRemoteBase { /** Object that matches the Locator address fields to corresponding attribute names in the Graphic object. */ addressFields: any; @@ -15303,7 +16141,7 @@ declare module "esri/tasks/locationproviders/QueryTaskLocationProvider" { import LocationProviderRemoteBase = require("esri/tasks/locationproviders/LocationProviderRemoteBase"); import QueryTask = require("esri/tasks/QueryTask"); - /** (Beta at v3.12) The QueryTaskLocationProvider performs a query against a ArcGIS Feature service or Map service layer based on common fields that are present in both the data and the ArcGIS layer. */ + /** (Currently in beta) The QueryTaskLocationProvider performs a query against a ArcGIS Feature service or Map service layer based on common fields that are present in both the data and the ArcGIS layer. */ class QueryTaskLocationProvider extends LocationProviderRemoteBase { /** A query parameter object that will be used to query the ArcGIS layer. */ queryParameters: any; @@ -15327,7 +16165,7 @@ declare module "esri/tasks/locationproviders/StandardGeographyQueryLocationProvi import LocationProviderRemoteBase = require("esri/tasks/locationproviders/LocationProviderRemoteBase"); import StandardGeographyQueryTask = require("esri/tasks/geoenrichment/StandardGeographyQueryTask"); - /** (Beta at v3.12) The StandardGeographyQueryLocationProvider class uses the Geoenrichment service to generate geometries by querying the standard geography layers. */ + /** (Currently in beta) The StandardGeographyQueryLocationProvider class uses the Geoenrichment service to generate geometries by querying the standard geography layers. */ class StandardGeographyQueryLocationProvider extends LocationProviderRemoteBase { /** A template to be used to build the query for Standard Geography query. */ geographyQueryTemplate: string; @@ -15491,6 +16329,90 @@ declare module "esri/tasks/query" { export = Query; } +declare module "esri/toolbars/ImageServiceMeasureTool" { + import esri = require("esri"); + import SimpleFillSymbol = require("esri/symbols/SimpleFillSymbol"); + import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol"); + import SimpleMarkerSymbol = require("esri/symbols/SimpleMarkerSymbol"); + import Geometry = require("esri/geometry/Geometry"); + + /** A toolbar that provides support for measuring image services. */ + class ImageServiceMeasureTool { + /** The angular unit in which directions of line segments will be calculated. */ + angularUnit: string; + /** The area unit in which areas of polygons will be calculated. */ + areaUnit: string; + /** Symbol to be used when drawing a polygon or extent. */ + fillSymbol: SimpleFillSymbol; + /** The linear unit in which height, length, or perimeters will be calculated. */ + linearUnit: string; + /** Symbol to be used when drawing a line. */ + lineSymbol: SimpleLineSymbol; + /** Symbol to be used when drawing a point. */ + markerSymbol: SimpleMarkerSymbol; + /** + * Creates a new instance of ImageServiceMeasureTool. + * @param params Constructor options. + */ + constructor(params: esri.ImageServiceMeasureToolOptions); + /** + * Activates the toolbar for performing the measure operation. + * @param operation The mensuration rule to apply to the measure operation. + */ + activate(operation: string): void; + /** Deactivates the toolbar. */ + deactivate(): void; + /** Returns a list of measure operations supported by the image service. */ + getSupportedMeasureOperations(): string[]; + /** Returns a list of supported linear, angular and area units. */ + getSupportedUnits(): string[]; + /** Disables the tooltip message for performing a draw. */ + hideDrawTooltip(): void; + /** + * Sets the angularUnit. + * @param unit The angular unit to set. + */ + setAngularUnit(unit: string): void; + /** + * Sets the areaUnit. + * @param unit Possible Values: esriSquareInches | esriSqudareFeet | esriSquareYards | esriAcres | esriSquareMiles | esriSquareMillimeters | esriSquareCentimeters | esriSquareDecimeters | esriSquareMeters | esriAres | esriHectares | esriSquareKilometers + */ + setAreaUnit(unit: string): void; + /** + * Sets the fillSymbol. + * @param fillSymbol The fill symbol to set. + */ + setFillSymbol(fillSymbol: SimpleFillSymbol): void; + /** + * Sets the linearUnit. + * @param unit The linear unit to set. + */ + setLinearUnit(unit: string): void; + /** + * Sets the lineSymbol. + * @param lineSymbol The line symbol to set. + */ + setLineSymbol(lineSymbol: SimpleLineSymbol): void; + /** + * Sets the markerSymbol. + * @param markerSymbol The marker symbol to set. + */ + setMarkerSymbol(markerSymbol: SimpleMarkerSymbol): void; + /** Enables the tooltip message for performing a draw. */ + showDrawTooltip(): void; + /** Fires when the drawing is complete. */ + on(type: "draw-end", listener: (event: { geometry: Geometry; target: ImageServiceMeasureTool }) => void): esri.Handle; + /** Fires when the user starts drawing. */ + on(type: "draw-start", listener: (event: { target: ImageServiceMeasureTool }) => void): esri.Handle; + /** Fires when the measure operation has been performed. */ + on(type: "measure-end", listener: (event: { measureResult: any; target: ImageServiceMeasureTool }) => void): esri.Handle; + /** Fires when the unit has been changed. */ + on(type: "unit-change", listener: (event: { measureResult: any; target: ImageServiceMeasureTool }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = ImageServiceMeasureTool; +} + declare module "esri/toolbars/draw" { import esri = require("esri"); import SimpleFillSymbol = require("esri/symbols/SimpleFillSymbol"); @@ -15823,7 +16745,7 @@ declare module "esri/units" { static POINTS: any; /** Units are square centimeters. */ static SQUARE_CENTIMETERS: any; - /** Units are square deciemeters. */ + /** Units are square decimeters. */ static SQUARE_DECIMETERS: any; /** Units are square feet. */ static SQUARE_FEET: any; @@ -16013,34 +16935,18 @@ declare module "esri/workers/WorkerClient" { * Import any script or function into the worker. * @param paths An AMD require path to a script file to import. */ - importScripts(paths: string): any; - /** - * Import any script or function into the worker. - * @param paths An AMD require path to a script file to import. - */ - importScripts(paths: string[]): any; + importScripts(paths: string | string[]): any; /** * Posts a message to the worker. * @param msg The data to post to the worker. * @param transfers An optional array of transferable objects. */ - postMessage(msg: any, transfers?: any[]): any; - /** - * Posts a message to the worker. - * @param msg The data to post to the worker. - * @param transfers An optional array of transferable objects. - */ - postMessage(msg: any[], transfers?: any[]): any; + postMessage(msg: any | any[], transfers?: any[]): any; /** * Sets the worker that is used in the Worker Client. * @param paths An AMD require path to a script file to import. */ - setWorker(paths: string): void; - /** - * Sets the worker that is used in the Worker Client. - * @param paths An AMD require path to a script file to import. - */ - setWorker(paths: string[]): void; + setWorker(paths: string | string[]): void; /** Terminates the worker and cancels all unresolved messages. */ terminate(): void; } From aaa447bd7e4b4dbfc75e6ea6c393a86c6d567bdc Mon Sep 17 00:00:00 2001 From: "Watal M. Iwasaki" Date: Fri, 17 Jul 2015 00:51:16 +0900 Subject: [PATCH 38/84] i18next: Add init() and setLng() with a two-arg callback --- i18next/i18next.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/i18next/i18next.d.ts b/i18next/i18next.d.ts index 3d24c9b96..e20cb4c93 100644 --- a/i18next/i18next.d.ts +++ b/i18next/i18next.d.ts @@ -87,6 +87,7 @@ interface I18nextStatic { }; init(callback?: (t: (key: string, options?: any) => string) => void ): JQueryDeferred; init(options?: I18nextOptions, callback?: (t: (key: string, options?: any) => string) => void ): JQueryDeferred; + init(options?: I18nextOptions, callback?: (err: any, t: (key: string, options?: any) => string) => void ): JQueryDeferred; lng(): string; loadNamespace(namespace: string, callback?: () => void ): void; loadNamespaces(namespaces: string[], callback?: () => void ): void; @@ -104,6 +105,7 @@ interface I18nextStatic { preload(languages: string[], callback?: (t: (key: string, options?: any) => string) => void ): void; setDefaultNamespace(namespace: string): void; setLng(language: string, callback?: (t: (key: string, options?: any) => string) => void ): void; + setLng(language: string, callback?: (err: any, t: (key: string, options?: any) => string) => void ): void; sync: { load: (languages: string[], options: I18nextOptions, callback: (err: Error, store: IResourceStore) => void ) => void; postMissing: (language: string, namespace: string, key: string, defaultValue: any, languages: string[]) => void; From 3aae128161027bfb8dced69bc95d9c85929c09fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20D=C3=BC=C3=BCna?= Date: Thu, 16 Jul 2015 19:33:38 +0300 Subject: [PATCH 39/84] easy-xapi --- easy-xapi/easy-xapi-tests.ts | 32 ++++++++++++++++++++++++++ easy-xapi/easy-xapi.d.ts | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 easy-xapi/easy-xapi-tests.ts create mode 100644 easy-xapi/easy-xapi.d.ts diff --git a/easy-xapi/easy-xapi-tests.ts b/easy-xapi/easy-xapi-tests.ts new file mode 100644 index 000000000..70c5351d4 --- /dev/null +++ b/easy-xapi/easy-xapi-tests.ts @@ -0,0 +1,32 @@ +/** + * Created by karl on 14/07/15. + */ + +/// +/// + +import express = require('express'); +import eXapi = require('easy-xapi'); + +eXapi.init({ + jSend: { + partial: true + } +}); + +var xApi = eXapi.create({ + root: __dirname, + log: { + name: 'Log', + level: 'info' + }, + port: 3000, + name: 'test', + mount: function (app) { + app.get('/', function (req, res) { + res.send('ok'); + }); + } +}); + +xApi.listen(); diff --git a/easy-xapi/easy-xapi.d.ts b/easy-xapi/easy-xapi.d.ts new file mode 100644 index 000000000..612dd51d5 --- /dev/null +++ b/easy-xapi/easy-xapi.d.ts @@ -0,0 +1,44 @@ +// Type definitions for easy-xapi +// Project: https://github.com/DeadAlready/easy-xapi +// Definitions by: Karl Düüna +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module Express { + export interface Request { + log: any; + info: any; + } +} + +declare module "easy-xapi" { + import express = require('express'); + import http = require('http'); + + interface InitConfig { + jSend?: {partial: boolean}; + } + + interface Config { + root: string; + port: number; + name: string; + log: { + name: string; + level: string + } + mount: (app: express.Application) => void + } + + interface Result { + express: any; + app: express.Application; + server: http.Server; + listen: () => void; + } + + export function init(conf: InitConfig): void; + export function create(conf: Config): Result; +} From e6b1d5f73b03df88acabef15a393e4a52e19e681 Mon Sep 17 00:00:00 2001 From: Andrew Archibald Date: Thu, 16 Jul 2015 09:49:34 -0700 Subject: [PATCH 40/84] Formatted bardjs tests. --- bardjs/bardjs-tests.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts index 3eedd970b..3aba6cade 100644 --- a/bardjs/bardjs-tests.ts +++ b/bardjs/bardjs-tests.ts @@ -128,11 +128,11 @@ module bardTests { */ function test_debugging() { console.log( - bard.debugging(true), // should be true - bard.debugging(false), // should be false - bard.debugging(42), // should be true - bard.debugging(''), // should be false - bard.debugging() // should be false + bard.debugging(true), // should return true + bard.debugging(false), // should return false + bard.debugging(42), // should return true + bard.debugging(''), // should return false + bard.debugging() // should return false ); } @@ -280,4 +280,4 @@ module bardTests { function done() { console.log('...Done'); } bard.wrapWithDone(callback, done); } -} \ No newline at end of file +} From 7fcdbd1a9b5ebdf39b5ac8e51ce72adfde685d74 Mon Sep 17 00:00:00 2001 From: Andrew Archibald Date: Thu, 16 Jul 2015 10:14:38 -0700 Subject: [PATCH 41/84] Made myService in bard tests minification safe --- bardjs/bardjs-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts index 3aba6cade..b033ffe3c 100644 --- a/bardjs/bardjs-tests.ts +++ b/bardjs/bardjs-tests.ts @@ -9,8 +9,6 @@ module bardTests { assert = chai.assert; class MyService { - static $inject = ['$q']; - constructor(private $q: angular.IQService) {} remoteCall(): angular.IPromise { @@ -20,6 +18,7 @@ module bardTests { } } + myService.$inject = ['$q']; function myService($q: angular.IQService) { return new MyService($q); } From 98440df4412a47e844039acf50025b98709d616d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20D=C3=BC=C3=BCna?= Date: Thu, 16 Jul 2015 20:19:32 +0300 Subject: [PATCH 42/84] Add xHeaderDefaults --- easy-xapi/easy-xapi.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/easy-xapi/easy-xapi.d.ts b/easy-xapi/easy-xapi.d.ts index 612dd51d5..4afe5b44c 100644 --- a/easy-xapi/easy-xapi.d.ts +++ b/easy-xapi/easy-xapi.d.ts @@ -25,6 +25,7 @@ declare module "easy-xapi" { root: string; port: number; name: string; + xHeaderDefaults: Object; log: { name: string; level: string From 09e37c0f4069b986237c4fa8506d28b243e88aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20D=C3=BC=C3=BCna?= Date: Thu, 16 Jul 2015 20:19:53 +0300 Subject: [PATCH 43/84] Fix typo --- easy-xapi/easy-xapi.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easy-xapi/easy-xapi.d.ts b/easy-xapi/easy-xapi.d.ts index 4afe5b44c..7e59a14b5 100644 --- a/easy-xapi/easy-xapi.d.ts +++ b/easy-xapi/easy-xapi.d.ts @@ -25,7 +25,7 @@ declare module "easy-xapi" { root: string; port: number; name: string; - xHeaderDefaults: Object; + xHeaderDefaults?: Object; log: { name: string; level: string From 4b055bdf5ab9c2cbd6bd3721460b53ba38ff01ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20D=C3=BC=C3=BCna?= Date: Thu, 16 Jul 2015 20:58:44 +0300 Subject: [PATCH 44/84] Updates for easy- definitions --- easy-jsend/easy-jsend.d.ts | 4 ++-- easy-x-headers/easy-x-headers.d.ts | 2 +- easy-xapi/easy-xapi.d.ts | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/easy-jsend/easy-jsend.d.ts b/easy-jsend/easy-jsend.d.ts index 21a9bc11e..b45fbdac7 100644 --- a/easy-jsend/easy-jsend.d.ts +++ b/easy-jsend/easy-jsend.d.ts @@ -27,7 +27,7 @@ declare module Express { export interface Response { success (data?: any, status?: number): void; fail (data: any, status?: number): void; - error (err: any): void; + error (err: any, status?: number): void; partial? (data: PartialInput, status?: number): void; makePartial? (data: MakePartialInput): void; } @@ -35,4 +35,4 @@ declare module Express { declare module "easy-jsend" { export function init(conf?:{partial:boolean}): void; -} \ No newline at end of file +} diff --git a/easy-x-headers/easy-x-headers.d.ts b/easy-x-headers/easy-x-headers.d.ts index c0a13d1a8..4158654ed 100644 --- a/easy-x-headers/easy-x-headers.d.ts +++ b/easy-x-headers/easy-x-headers.d.ts @@ -14,5 +14,5 @@ declare module Express { declare module "easy-x-headers" { import express = require('express'); - export function getMiddleware(): express.RequestHandler; + export function getMiddleware(defaults?: Object): express.RequestHandler; } diff --git a/easy-xapi/easy-xapi.d.ts b/easy-xapi/easy-xapi.d.ts index 7e59a14b5..2468cb8b6 100644 --- a/easy-xapi/easy-xapi.d.ts +++ b/easy-xapi/easy-xapi.d.ts @@ -9,7 +9,6 @@ declare module Express { export interface Request { log: any; - info: any; } } From 91df93db208c4b3cf79fd49f6e8b3d72413f4305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20D=C3=BC=C3=BCna?= Date: Thu, 16 Jul 2015 22:45:02 +0300 Subject: [PATCH 45/84] Update easy-xapi output --- easy-xapi/easy-xapi.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/easy-xapi/easy-xapi.d.ts b/easy-xapi/easy-xapi.d.ts index 2468cb8b6..25d95b432 100644 --- a/easy-xapi/easy-xapi.d.ts +++ b/easy-xapi/easy-xapi.d.ts @@ -5,6 +5,7 @@ /// /// +/// declare module Express { export interface Request { @@ -15,6 +16,7 @@ declare module Express { declare module "easy-xapi" { import express = require('express'); import http = require('http'); + import bunyan = require('bunyan'); interface InitConfig { jSend?: {partial: boolean}; @@ -36,6 +38,7 @@ declare module "easy-xapi" { express: any; app: express.Application; server: http.Server; + log: bunyan.Logger; listen: () => void; } From 563cc35a17808ace7d527f1af829e74a2431290b Mon Sep 17 00:00:00 2001 From: Sam Saint-Pettersen Date: Thu, 16 Jul 2015 22:25:10 +0100 Subject: [PATCH 46/84] Type definitions and tests for node title-case module --- title-case/title-case-tests.ts | 7 +++++++ title-case/title-case.d.ts | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 title-case/title-case-tests.ts create mode 100644 title-case/title-case.d.ts diff --git a/title-case/title-case-tests.ts b/title-case/title-case-tests.ts new file mode 100644 index 000000000..d1183db8f --- /dev/null +++ b/title-case/title-case-tests.ts @@ -0,0 +1,7 @@ +/// + +import titleCase = require('title-case'); + +console.log(titleCase('string')); // => "String" +console.log(titleCase('PascalCase')); // => "Pascal Case" +console.log(titleCase('STRING', 'tr')); // => "Strıng" diff --git a/title-case/title-case.d.ts b/title-case/title-case.d.ts new file mode 100644 index 000000000..c8e4dee30 --- /dev/null +++ b/title-case/title-case.d.ts @@ -0,0 +1,9 @@ +// Type definitions for title-case +// Project: https://github.com/blakeembrey/title-case +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "title-case" { + function titleCase(string1: string, string2?: string): string; + export = titleCase; +} \ No newline at end of file From 212793c4be051977f73675fa9bb125d891df037a Mon Sep 17 00:00:00 2001 From: Jeff Cross Date: Thu, 16 Jul 2015 15:59:19 -0700 Subject: [PATCH 47/84] angular2: add typings for angular2 and angular2 router --- angular2/angular2-2.0.0-alpha.31.d.ts | 6137 ++++++++++++++++++++++++ angular2/angular2.d.ts | 6218 +++++++++++-------------- angular2/router-2.0.0-alpha.31.d.ts | 459 ++ angular2/router.d.ts | 325 +- 4 files changed, 9552 insertions(+), 3587 deletions(-) create mode 100644 angular2/angular2-2.0.0-alpha.31.d.ts create mode 100644 angular2/router-2.0.0-alpha.31.d.ts diff --git a/angular2/angular2-2.0.0-alpha.31.d.ts b/angular2/angular2-2.0.0-alpha.31.d.ts new file mode 100644 index 000000000..dfad7d349 --- /dev/null +++ b/angular2/angular2-2.0.0-alpha.31.d.ts @@ -0,0 +1,6137 @@ +// Type definitions for Angular v2.0.0-alpha.31 +// Project: http://angular.io/ +// Definitions by: angular team +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// *********************************************************** +// This file is generated by the Angular build process. +// Please do not create manual edits or send pull requests +// modifying this file. +// *********************************************************** + +// Angular depends transitively on these libraries. +// If you don't have them installed you can run +// $ tsd query es6-promise rx rx-lite --action install --save +/// +/// + +interface List extends Array {} +interface Map {} +interface StringMap extends Map {} + +declare module ng { + type SetterFn = typeof Function; + type int = number; + interface Type extends Function { + new (...args:any[]):any; + } + + // See https://github.com/Microsoft/TypeScript/issues/1168 + class BaseException /* extends Error */ { + message: string; + stack: string; + toString(): string; + } + interface InjectableReference {} +} + + + + +/** + * The `angular2` is the single place to import all of the individual types. + */ +declare module ng { + class DehydratedException extends BaseException { + } + + class ExpressionChangedAfterItHasBeenChecked extends BaseException { + } + + class ChangeDetectionError extends BaseException { + + location: string; + } + + + /** + * ON_PUSH means that the change detector's mode will be set to CHECK_ONCE during hydration. + */ + var ON_PUSH:any; + + + /** + * DEFAULT means that the change detector's mode will be set to CHECK_ALWAYS during hydration. + */ + var DEFAULT:any; + + + /** + * Controls change detection. + * + * {@link ChangeDetectorRef} allows requesting checks for detectors that rely on observables. It + * also allows detaching and + * attaching change detector subtrees. + */ + class ChangeDetectorRef { + + + /** + * Request to check all ON_PUSH ancestors. + */ + requestCheck(): void; + + + /** + * Detaches the change detector from the change detector tree. + * + * The detached change detector will not be checked until it is reattached. + */ + detach(): void; + + + /** + * Reattach the change detector to the change detector tree. + * + * This also requests a check of this change detector. This reattached change detector will be + * checked during the + * next change detection run. + */ + reattach(): void; + } + + class Pipes { + + + /** + * Map of {@link Pipe} names to {@link PipeFactory} lists used to configure the + * {@link Pipes} registry. + * + * #Example + * + * ``` + * var pipesConfig = { + * 'json': [jsonPipeFactory] + * } + * @Component({ + * viewInjector: [ + * bind(Pipes).toValue(new Pipes(pipesConfig)) + * ] + * }) + * ``` + */ + config: StringMap; + + get(type: string, obj: any, cdRef?: ChangeDetectorRef, existingPipe?: Pipe): Pipe; + } + + + /** + * Indicates that the result of a {@link Pipe} transformation has changed even though the reference + * has not changed. + * + * The wrapped value will be unwrapped by change detection, and the unwrapped value will be stored. + */ + class WrappedValue { + + wrapped: any; + } + + + /** + * An interface for extending the list of pipes known to Angular. + * + * If you are writing a custom {@link Pipe}, you must extend this interface. + * + * #Example + * + * ``` + * class DoublePipe implements Pipe { + * supports(obj) { + * return true; + * } + * + * onDestroy() {} + * + * transform(value, args = []) { + * return `${value}${value}`; + * } + * } + * ``` + */ + interface Pipe { + + supports(obj: any): boolean; + + onDestroy(): void; + + transform(value: any, args: List): any; + } + + interface PipeFactory { + + supports(obs: any): boolean; + + create(cdRef: ChangeDetectorRef): Pipe; + } + + class NullPipe extends BasePipe { + + called: boolean; + + supports(obj: any): boolean; + + transform(value: any, args?: List): WrappedValue; + } + + class NullPipeFactory implements PipeFactory { + + supports(obj: any): boolean; + + create(cdRef: ChangeDetectorRef): Pipe; + } + + var defaultPipes : Pipes ; + + + /** + * Provides default implementation of supports and onDestroy. + * + * #Example + * + * ``` + * class DoublePipe extends BasePipe {* + * transform(value) { + * return `${value}${value}`; + * } + * } + * ``` + */ + class BasePipe implements Pipe { + + supports(obj: any): boolean; + + onDestroy(): void; + + transform(value: any, args: List): any; + } + + class Locals { + + parent: Locals; + + current: Map; + + contains(name: string): boolean; + + get(name: string): any; + + set(name: string, value: any): void; + + clearValues(): void; + } + + + interface AbstractControl_onlySelfArgs { + onlySelf?: boolean; + } + + interface AbstractControl_updateValueAndValidityArgs { + onlySelf?: boolean; + emitEvent?: boolean; + } + + /** + * Omitting from external API doc as this is really an abstract internal concept. + */ + class AbstractControl { + + validator: Function; + + value: any; + + status: string; + + valid: boolean; + + errors: StringMap; + + pristine: boolean; + + dirty: boolean; + + touched: boolean; + + untouched: boolean; + + valueChanges: Observable; + + markAsTouched(): void; + + markAsDirty(args?:AbstractControl_onlySelfArgs): void; + + setParent(parent: any): void; + + updateValidity(args?:AbstractControl_onlySelfArgs): void; + + updateValueAndValidity(args?:AbstractControl_updateValueAndValidityArgs): void; + + find(path: List| string): AbstractControl; + + getError(errorCode: string, path?: List): any; + + hasError(errorCode: string, path?: List): boolean; + } + + class AbstractControlDirective { + + control: AbstractControl; + + value: any; + + valid: boolean; + + errors: StringMap; + + pristine: boolean; + + dirty: boolean; + + touched: boolean; + + untouched: boolean; + } + + + interface Control_updateValueOptions { + onlySelf?: boolean; + emitEvent?: boolean; + } + /** + * Defines a part of a form that cannot be divided into other controls. + * + * `Control` is one of the three fundamental building blocks used to define forms in Angular, along + * with + * {@link ControlGroup} and {@link ControlArray}. + */ + class Control extends AbstractControl { + + updateValue(value: any, options?: Control_updateValueOptions): void; + + registerOnChange(fn: Function): void; + } + + + /** + * Defines a part of a form, of fixed length, that can contain other controls. + * + * A ControlGroup aggregates the values and errors of each {@link Control} in the group. Thus, if + * one of the controls + * in a group is invalid, the entire group is invalid. Similarly, if a control changes its value, + * the entire group + * changes as well. + * + * `ControlGroup` is one of the three fundamental building blocks used to define forms in Angular, + * along with + * {@link Control} and {@link ControlArray}. {@link ControlArray} can also contain other controls, + * but is of variable + * length. + */ + class ControlGroup extends AbstractControl { + + controls: StringMap; + + addControl(name: string, c: AbstractControl): void; + + removeControl(name: string): void; + + include(controlName: string): void; + + exclude(controlName: string): void; + + contains(controlName: string): boolean; + } + + + /** + * Defines a part of a form, of variable length, that can contain other controls. + * + * A `ControlArray` aggregates the values and errors of each {@link Control} in the group. Thus, if + * one of the controls + * in a group is invalid, the entire group is invalid. Similarly, if a control changes its value, + * the entire group + * changes as well. + * + * `ControlArray` is one of the three fundamental building blocks used to define forms in Angular, + * along with {@link Control} and {@link ControlGroup}. {@link ControlGroup} can also contain + * other controls, but is of fixed length. + */ + class ControlArray extends AbstractControl { + + controls: List; + + at(index: number): AbstractControl; + + push(control: AbstractControl): void; + + insert(index: number, control: AbstractControl): void; + + removeAt(index: number): void; + + length: number; + } + + + /** + * Creates and binds a control with a specified name to a DOM element. + * + * This directive can only be used as a child of {@link NgForm} or {@link NgFormModel}. + * + * # Example + * + * In this example, we create the login and password controls. + * We can work with each control separately: check its validity, get its value, listen to its + * changes. + * + * ``` + * @Component({selector: "login-comp"}) + * @View({ + * directives: [formDirectives], + * template: ` + *
+ * Login + *
Login is invalid
+ * + * Password + * + * + *
+ * `}) + * class LoginComp { + * onLogIn(value) { + * // value === {login: 'some login', password: 'some password'} + * } + * } + * ``` + * + * We can also use ng-model to bind a domain model to the form. + * + * ``` + * @Component({selector: "login-comp"}) + * @View({ + * directives: [formDirectives], + * template: ` + *
+ * Login + * Password + * + *
+ * `}) + * class LoginComp { + * credentials: {login:string, password:string}; + * + * onLogIn() { + * // this.credentials.login === "some login" + * // this.credentials.password === "some password" + * } + * } + * ``` + */ + class NgControlName extends NgControl { + + update: void; + + model: any; + + ngValidators: QueryList; + + onChange(c: StringMap): void; + + onDestroy(): void; + + viewToModelUpdate(newValue: any): void; + + path: List; + + formDirective: any; + + control: Control; + + validator: Function; + } + + + /** + * Binds an existing control to a DOM element. + * + * # Example + * + * In this example, we bind the control to an input element. When the value of the input element + * changes, the value of + * the control will reflect that change. Likewise, if the value of the control changes, the input + * element reflects that + * change. + * + * ``` + * @Component({selector: "login-comp"}) + * @View({ + * directives: [formDirectives], + * template: "" + * }) + * class LoginComp { + * loginControl:Control; + * + * constructor() { + * this.loginControl = new Control(''); + * } + * } + * + * ``` + * + * We can also use ng-model to bind a domain model to the form. + * + * ``` + * @Component({selector: "login-comp"}) + * @View({ + * directives: [formDirectives], + * template: "" + * }) + * class LoginComp { + * loginControl:Control; + * login:string; + * + * constructor() { + * this.loginControl = new Control(''); + * } + * } + * ``` + */ + class NgFormControl extends NgControl { + + form: Control; + + update: void; + + model: any; + + ngValidators: QueryList; + + onChange(c: any): void; + + path: List; + + control: Control; + + validator: Function; + + viewToModelUpdate(newValue: any): void; + } + + + /** + * Binds a domain model to the form. + * + * # Example + * ``` + * @Component({selector: "search-comp"}) + * @View({ + * directives: [formDirectives], + * template: ` + * + * `}) + * class SearchComp { + * searchQuery: string; + * } + * ``` + */ + class NgModel extends NgControl { + + update: void; + + model: any; + + ngValidators: QueryList; + + onChange(c: any): void; + + control: Control; + + path: List; + + validator: Function; + + viewToModelUpdate(newValue: any): void; + } + + + /** + * An abstract class that all control directive extend. + * + * It binds a {@link Control} object to a DOM element. + */ + class NgControl extends AbstractControlDirective { + + name: string; + + valueAccessor: ControlValueAccessor; + + validator: Function; + + path: List; + + viewToModelUpdate(newValue: any): void; + } + + + /** + * Creates and binds a control group to a DOM element. + * + * This directive can only be used as a child of {@link NgForm} or {@link NgFormModel}. + * + * # Example + * + * In this example, we create the credentials and personal control groups. + * We can work with each group separately: check its validity, get its value, listen to its changes. + * + * ``` + * @Component({selector: "signup-comp"}) + * @View({ + * directives: [formDirectives], + * template: ` + *
+ *
+ * Login + * Password + *
+ *
Credentials are invalid
+ * + *
+ * Name + *
+ * + *
+ * `}) + * class SignupComp { + * onSignUp(value) { + * // value === {personal: {name: 'some name'}, + * // credentials: {login: 'some login', password: 'some password'}} + * } + * } + * + * ``` + */ + class NgControlGroup extends ControlContainer { + + onInit(): void; + + onDestroy(): void; + + control: ControlGroup; + + path: List; + + formDirective: Form; + } + + + /** + * Binds an existing control group to a DOM element. + * + * # Example + * + * In this example, we bind the control group to the form element, and we bind the login and + * password controls to the + * login and password elements. + * + * ``` + * @Component({selector: "login-comp"}) + * @View({ + * directives: [formDirectives], + * template: "
" + + * "Login " + + * "Password " + + * "" + + * "
" + * }) + * class LoginComp { + * loginForm:ControlGroup; + * + * constructor() { + * this.loginForm = new ControlGroup({ + * login: new Control(""), + * password: new Control("") + * }); + * } + * + * onLogin() { + * // this.loginForm.value + * } + * } + * + * ``` + * + * We can also use ng-model to bind a domain model to the form. + * + * ``` + * @Component({selector: "login-comp"}) + * @View({ + * directives: [formDirectives], + * template: "
" + + * "Login " + + * "Password " + + * "" + + * "
" + * }) + * class LoginComp { + * credentials:{login:string, password:string} + * loginForm:ControlGroup; + * + * constructor() { + * this.loginForm = new ControlGroup({ + * login: new Control(""), + * password: new Control("") + * }); + * } + * + * onLogin() { + * // this.credentials.login === 'some login' + * // this.credentials.password === 'some password' + * } + * } + * ``` + */ + class NgFormModel extends ControlContainer implements Form { + + form: ControlGroup; + + directives: List; + + ngSubmit: void; + + onChange(_: any): void; + + formDirective: Form; + + control: ControlGroup; + + path: List; + + addControl(dir: NgControl): void; + + getControl(dir: NgControl): Control; + + removeControl(dir: NgControl): void; + + addControlGroup(dir: NgControlGroup): void; + + removeControlGroup(dir: NgControlGroup): void; + + getControlGroup(dir: NgControlGroup): ControlGroup; + + updateModel(dir: NgControl, value: any): void; + + onSubmit(): boolean; + } + + + /** + * Creates and binds a form object to a DOM element. + * + * # Example + * + * ``` + * @Component({selector: "signup-comp"}) + * @View({ + * directives: [formDirectives], + * template: ` + *
+ *
+ * Login + * Password + *
+ *
Credentials are invalid
+ * + *
+ * Name + *
+ * + *
+ * `}) + * class SignupComp { + * onSignUp(value) { + * // value === {personal: {name: 'some name'}, + * // credentials: {login: 'some login', password: 'some password'}} + * } + * } + * + * ``` + */ + class NgForm extends ControlContainer implements Form { + + form: ControlGroup; + + ngSubmit: void; + + formDirective: Form; + + control: ControlGroup; + + path: List; + + controls: StringMap; + + addControl(dir: NgControl): void; + + getControl(dir: NgControl): Control; + + removeControl(dir: NgControl): void; + + addControlGroup(dir: NgControlGroup): void; + + removeControlGroup(dir: NgControlGroup): void; + + getControlGroup(dir: NgControlGroup): ControlGroup; + + updateModel(dir: NgControl, value: any): void; + + onSubmit(): boolean; + } + + + /** + * A bridge between a control and a native element. + * + * Please see {@link DefaultValueAccessor} for more information. + */ + interface ControlValueAccessor { + + writeValue(obj: any): void; + + registerOnChange(fn: any): void; + + registerOnTouched(fn: any): void; + } + + + /** + * The default accessor for writing a value and listening to changes that is used by the + * {@link NgModel}, {@link NgFormControl}, and {@link NgControlName} directives. + * + * # Example + * ``` + * + * ``` + */ + class DefaultValueAccessor implements ControlValueAccessor { + + value: string; + + onChange: void; + + onTouched: void; + + cd: NgControl; + + renderer: Renderer; + + elementRef: ElementRef; + + writeValue(value: any): void; + + ngClassUntouched: boolean; + + ngClassTouched: boolean; + + ngClassPristine: boolean; + + ngClassDirty: boolean; + + ngClassValid: boolean; + + ngClassInvalid: boolean; + + registerOnChange(fn: any): void; + + registerOnTouched(fn: any): void; + } + + + /** + * The accessor for writing a value and listening to changes on a checkbox input element. + * + * # Example + * ``` + * + * ``` + */ + class CheckboxControlValueAccessor implements ControlValueAccessor { + + checked: boolean; + + onChange: void; + + onTouched: void; + + cd: NgControl; + + renderer: Renderer; + + elementRef: ElementRef; + + writeValue(value: any): void; + + ngClassUntouched: boolean; + + ngClassTouched: boolean; + + ngClassPristine: boolean; + + ngClassDirty: boolean; + + ngClassValid: boolean; + + ngClassInvalid: boolean; + + registerOnChange(fn: any): void; + + registerOnTouched(fn: any): void; + } + + + /** + * The accessor for writing a value and listening to changes on a select element. + */ + class SelectControlValueAccessor implements ControlValueAccessor { + + value: void; + + onChange: void; + + onTouched: void; + + cd: NgControl; + + renderer: Renderer; + + elementRef: ElementRef; + + writeValue(value: any): void; + + ngClassUntouched: boolean; + + ngClassTouched: boolean; + + ngClassPristine: boolean; + + ngClassDirty: boolean; + + ngClassValid: boolean; + + ngClassInvalid: boolean; + + registerOnChange(fn: any): void; + + registerOnTouched(fn: any): void; + } + + + /** + * A list of all the form directives used as part of a `@View` annotation. + * + * This is a shorthand for importing them each individually. + */ + var formDirectives : List ; + + + /** + * Provides a set of validators used by form controls. + * + * # Example + * + * ``` + * var loginControl = new Control("", Validators.required) + * ``` + */ + class Validators { + } + + class NgValidator { + + validator: Function; + } + + class NgRequiredValidator extends NgValidator { + + validator: Function; + } + + + /** + * Creates a form object from a user-specified configuration. + * + * # Example + * + * ``` + * import {Component, View, bootstrap} from 'angular2/angular2'; + * import {FormBuilder, Validators, formDirectives, ControlGroup} from 'angular2/forms'; + * + * @Component({ + * selector: 'login-comp', + * viewInjector: [ + * FormBuilder + * ] + * }) + * @View({ + * template: ` + *
+ * Login + * + *
+ * Password + * Confirm password + *
+ *
+ * `, + * directives: [ + * formDirectives + * ] + * }) + * class LoginComp { + * loginForm: ControlGroup; + * + * constructor(builder: FormBuilder) { + * this.loginForm = builder.group({ + * login: ["", Validators.required], + * + * passwordRetry: builder.group({ + * password: ["", Validators.required], + * passwordConfirmation: ["", Validators.required] + * }) + * }); + * } + * } + * + * bootstrap(LoginComp) + * ``` + * + * This example creates a {@link ControlGroup} that consists of a `login` {@link Control}, and a + * nested + * {@link ControlGroup} that defines a `password` and a `passwordConfirmation` {@link Control}: + * + * ``` + * var loginForm = builder.group({ + * login: ["", Validators.required], + * + * passwordRetry: builder.group({ + * password: ["", Validators.required], + * passwordConfirmation: ["", Validators.required] + * }) + * }); + * + * ``` + */ + class FormBuilder { + + group(controlsConfig: StringMap, extra?: StringMap): ControlGroup; + + control(value: Object, validator?: Function): Control; + + array(controlsConfig: List, validator?: Function): ControlArray; + } + + var formInjectables : List ; + + + /** + * A dispatcher for all events happening in a view. + */ + interface EventDispatcher { + + + /** + * Called when an event was triggered for a on-* attribute on an element. + * @param {Map} locals Locals to be used to evaluate the + * event expressions + */ + dispatchEvent(elementIndex: number, eventName: string, locals: Map): void; + } + + class Renderer { + + + /** + * Creates a root host view that includes the given element. + * @param {RenderProtoViewRef} hostProtoViewRef a RenderProtoViewRef of type + * ProtoViewDto.HOST_VIEW_TYPE + * @param {any} hostElementSelector css selector for the host element (will be queried against the + * main document) + * @return {RenderViewRef} the created view + */ + createRootHostView(hostProtoViewRef: RenderProtoViewRef, hostElementSelector: string): RenderViewRef; + + + /** + * Creates a regular view out of the given ProtoView + */ + createView(protoViewRef: RenderProtoViewRef): RenderViewRef; + + + /** + * Destroys the given view after it has been dehydrated and detached + */ + destroyView(viewRef: RenderViewRef): void; + + + /** + * Attaches a componentView into the given hostView at the given element + */ + attachComponentView(location: RenderElementRef, componentViewRef: RenderViewRef): void; + + + /** + * Detaches a componentView into the given hostView at the given element + */ + detachComponentView(location: RenderElementRef, componentViewRef: RenderViewRef): void; + + + /** + * Attaches a view into a ViewContainer (in the given parentView at the given element) at the + * given index. + */ + attachViewInContainer(location: RenderElementRef, atIndex: number, viewRef: RenderViewRef): void; + + + /** + * Detaches a view into a ViewContainer (in the given parentView at the given element) at the + * given index. + */ + detachViewInContainer(location: RenderElementRef, atIndex: number, viewRef: RenderViewRef): void; + + + /** + * Hydrates a view after it has been attached. Hydration/dehydration is used for reusing views + * inside of the view pool. + */ + hydrateView(viewRef: RenderViewRef): void; + + + /** + * Dehydrates a view after it has been attached. Hydration/dehydration is used for reusing views + * inside of the view pool. + */ + dehydrateView(viewRef: RenderViewRef): void; + + + /** + * Returns the native element at the given location. + * Attention: In a WebWorker scenario, this should always return null! + */ + getNativeElementSync(location: RenderElementRef): any; + + + /** + * Sets a property on an element. + */ + setElementProperty(location: RenderElementRef, propertyName: string, propertyValue: any): void; + + + /** + * Sets an attribute on an element. + */ + setElementAttribute(location: RenderElementRef, attributeName: string, attributeValue: string): void; + + + /** + * Sets a class on an element. + */ + setElementClass(location: RenderElementRef, className: string, isAdd: boolean): void; + + + /** + * Sets a style on an element. + */ + setElementStyle(location: RenderElementRef, styleName: string, styleValue: string): void; + + + /** + * Calls a method on an element. + */ + invokeElementMethod(location: RenderElementRef, methodName: string, args: List): void; + + + /** + * Sets the value of a text node. + */ + setText(viewRef: RenderViewRef, textNodeIndex: number, text: string): void; + + + /** + * Sets the dispatcher for all events of the given view + */ + setEventDispatcher(viewRef: RenderViewRef, dispatcher: EventDispatcher): void; + } + + + /** + * Abstract reference to the element which can be marshaled across web-worker boundry. + * + * This interface is used by the {@link Renderer} api. + */ + interface RenderElementRef { + + + /** + * Reference to the {@link RenderViewRef} where the `RenderElementRef` is inside of. + */ + renderView: RenderViewRef; + + + /** + * Index of the element inside the {@link ViewRef}. + * + * This is used internally by the Angular framework to locate elements. + */ + boundElementIndex: number; + } + + class RenderViewRef { + } + + class RenderProtoViewRef { + } + + class DomRenderer extends Renderer { + + createRootHostView(hostProtoViewRef: RenderProtoViewRef, hostElementSelector: string): RenderViewRef; + + createView(protoViewRef: RenderProtoViewRef): RenderViewRef; + + destroyView(view: RenderViewRef): void; + + getNativeElementSync(location: RenderElementRef): any; + + attachComponentView(location: RenderElementRef, componentViewRef: RenderViewRef): void; + + setComponentViewRootNodes(componentViewRef: RenderViewRef, rootNodes: List): void; + + getRootNodes(viewRef: RenderViewRef): List; + + detachComponentView(location: RenderElementRef, componentViewRef: RenderViewRef): void; + + attachViewInContainer(location: RenderElementRef, atIndex: number, viewRef: RenderViewRef): void; + + detachViewInContainer(location: RenderElementRef, atIndex: number, viewRef: RenderViewRef): void; + + hydrateView(viewRef: RenderViewRef): void; + + dehydrateView(viewRef: RenderViewRef): void; + + setElementProperty(location: RenderElementRef, propertyName: string, propertyValue: any): void; + + setElementAttribute(location: RenderElementRef, attributeName: string, attributeValue: string): void; + + setElementClass(location: RenderElementRef, className: string, isAdd: boolean): void; + + setElementStyle(location: RenderElementRef, styleName: string, styleValue: string): void; + + invokeElementMethod(location: RenderElementRef, methodName: string, args: List): void; + + setText(viewRef: RenderViewRef, textNodeIndex: number, text: string): void; + + setEventDispatcher(viewRef: RenderViewRef, dispatcher: any): void; + } + + var DOCUMENT_TOKEN:any; + + + /** + * Declare reusable UI building blocks for an application. + * + * Each Angular component requires a single `@Component` and at least one `@View` annotation. The + * `@Component` + * annotation specifies when a component is instantiated, and which properties and hostListeners it + * binds to. + * + * When a component is instantiated, Angular + * - creates a shadow DOM for the component. + * - loads the selected template into the shadow DOM. + * - creates all the injectable objects configured with `hostInjector` and `viewInjector`. + * + * All template expressions and statements are then evaluated against the component instance. + * + * For details on the `@View` annotation, see {@link View}. + * + * ## Example + * + * ``` + * @Component({ + * selector: 'greet' + * }) + * @View({ + * template: 'Hello {{name}}!' + * }) + * class Greet { + * name: string; + * + * constructor() { + * this.name = 'World'; + * } + * } + * ``` + */ + class ComponentAnnotation extends DirectiveAnnotation { + + + /** + * Defines the used change detection strategy. + * + * When a component is instantiated, Angular creates a change detector, which is responsible for + * propagating + * the component's bindings. + * + * The `changeDetection` property defines, whether the change detection will be checked every time + * or only when the component + * tells it to do so. + */ + changeDetection: string; + + + /** + * Defines the set of injectable objects that are visible to its view dom children. + * + * ## Simple Example + * + * Here is an example of a class that can be injected: + * + * ``` + * class Greeter { + * greet(name:string) { + * return 'Hello ' + name + '!'; + * } + * } + * + * @Directive({ + * selector: 'needs-greeter' + * }) + * class NeedsGreeter { + * greeter:Greeter; + * + * constructor(greeter:Greeter) { + * this.greeter = greeter; + * } + * } + * + * @Component({ + * selector: 'greet', + * viewInjector: [ + * Greeter + * ] + * }) + * @View({ + * template: ``, + * directives: [NeedsGreeter] + * }) + * class HelloWorld { + * } + * + * ``` + */ + viewInjector: List; + } + + + /** + * Directives allow you to attach behavior to elements in the DOM. + * + * {@link Directive}s with an embedded view are called {@link Component}s. + * + * A directive consists of a single directive annotation and a controller class. When the + * directive's `selector` matches + * elements in the DOM, the following steps occur: + * + * 1. For each directive, the `ElementInjector` attempts to resolve the directive's constructor + * arguments. + * 2. Angular instantiates directives for each matched element using `ElementInjector` in a + * depth-first order, + * as declared in the HTML. + * + * ## Understanding How Injection Works + * + * There are three stages of injection resolution. + * - *Pre-existing Injectors*: + * - The terminal {@link Injector} cannot resolve dependencies. It either throws an error or, if + * the dependency was + * specified as `@Optional`, returns `null`. + * - The platform injector resolves browser singleton resources, such as: cookies, title, + * location, and others. + * - *Component Injectors*: Each component instance has its own {@link Injector}, and they follow + * the same parent-child hierarchy + * as the component instances in the DOM. + * - *Element Injectors*: Each component instance has a Shadow DOM. Within the Shadow DOM each + * element has an `ElementInjector` + * which follow the same parent-child hierarchy as the DOM elements themselves. + * + * When a template is instantiated, it also must instantiate the corresponding directives in a + * depth-first order. The + * current `ElementInjector` resolves the constructor dependencies for each directive. + * + * Angular then resolves dependencies as follows, according to the order in which they appear in the + * {@link View}: + * + * 1. Dependencies on the current element + * 2. Dependencies on element injectors and their parents until it encounters a Shadow DOM boundary + * 3. Dependencies on component injectors and their parents until it encounters the root component + * 4. Dependencies on pre-existing injectors + * + * + * The `ElementInjector` can inject other directives, element-specific special objects, or it can + * delegate to the parent + * injector. + * + * To inject other directives, declare the constructor parameter as: + * - `directive:DirectiveType`: a directive on the current element only + * - `@Ancestor() directive:DirectiveType`: any directive that matches the type between the current + * element and the + * Shadow DOM root. Current element is not included in the resolution, therefore even if it could + * resolve it, it will + * be ignored. + * - `@Parent() directive:DirectiveType`: any directive that matches the type on a direct parent + * element only. + * - `@Query(DirectiveType) query:QueryList`: A live collection of direct child + * directives. + * - `@QueryDescendants(DirectiveType) query:QueryList`: A live collection of any + * child directives. + * + * To inject element-specific special objects, declare the constructor parameter as: + * - `element: ElementRef` to obtain a reference to logical element in the view. + * - `viewContainer: ViewContainerRef` to control child template instantiation, for + * {@link Directive} directives only + * - `bindingPropagation: BindingPropagation` to control change detection in a more granular way. + * + * ## Example + * + * The following example demonstrates how dependency injection resolves constructor arguments in + * practice. + * + * + * Assume this HTML template: + * + * ``` + *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * ``` + * + * With the following `dependency` decorator and `SomeService` injectable class. + * + * ``` + * @Injectable() + * class SomeService { + * } + * + * @Directive({ + * selector: '[dependency]', + * properties: [ + * 'id: dependency' + * ] + * }) + * class Dependency { + * id:string; + * } + * ``` + * + * Let's step through the different ways in which `MyDirective` could be declared... + * + * + * ### No injection + * + * Here the constructor is declared with no arguments, therefore nothing is injected into + * `MyDirective`. + * + * ``` + * @Directive({ selector: '[my-directive]' }) + * class MyDirective { + * constructor() { + * } + * } + * ``` + * + * This directive would be instantiated with no dependencies. + * + * + * ### Component-level injection + * + * Directives can inject any injectable instance from the closest component injector or any of its + * parents. + * + * Here, the constructor declares a parameter, `someService`, and injects the `SomeService` type + * from the parent + * component's injector. + * ``` + * @Directive({ selector: '[my-directive]' }) + * class MyDirective { + * constructor(someService: SomeService) { + * } + * } + * ``` + * + * This directive would be instantiated with a dependency on `SomeService`. + * + * + * ### Injecting a directive from the current element + * + * Directives can inject other directives declared on the current element. + * + * ``` + * @Directive({ selector: '[my-directive]' }) + * class MyDirective { + * constructor(dependency: Dependency) { + * expect(dependency.id).toEqual(3); + * } + * } + * ``` + * This directive would be instantiated with `Dependency` declared at the same element, in this case + * `dependency="3"`. + * + * + * ### Injecting a directive from a direct parent element + * + * Directives can inject other directives declared on a direct parent element. By definition, a + * directive with a + * `@Parent` annotation does not attempt to resolve dependencies for the current element, even if + * this would satisfy + * the dependency. + * + * ``` + * @Directive({ selector: '[my-directive]' }) + * class MyDirective { + * constructor(@Parent() dependency: Dependency) { + * expect(dependency.id).toEqual(2); + * } + * } + * ``` + * This directive would be instantiated with `Dependency` declared at the parent element, in this + * case `dependency="2"`. + * + * + * ### Injecting a directive from any ancestor elements + * + * Directives can inject other directives declared on any ancestor element (in the current Shadow + * DOM), i.e. on the + * parent element and its parents. By definition, a directive with an `@Ancestor` annotation does + * not attempt to + * resolve dependencies for the current element, even if this would satisfy the dependency. + * + * ``` + * @Directive({ selector: '[my-directive]' }) + * class MyDirective { + * constructor(@Ancestor() dependency: Dependency) { + * expect(dependency.id).toEqual(2); + * } + * } + * ``` + * + * Unlike the `@Parent` which only checks the parent, `@Ancestor` checks the parent, as well as its + * parents recursively. If `dependency="2"` didn't exist on the direct parent, this injection would + * have returned + * `dependency="1"`. + * + * + * ### Injecting a live collection of direct child directives + * + * + * A directive can also query for other child directives. Since parent directives are instantiated + * before child directives, a directive can't simply inject the list of child directives. Instead, + * the directive injects a {@link QueryList}, which updates its contents as children are added, + * removed, or moved by a directive that uses a {@link ViewContainerRef} such as a `ng-for`, an + * `ng-if`, or an `ng-switch`. + * + * ``` + * @Directive({ selector: '[my-directive]' }) + * class MyDirective { + * constructor(@Query(Dependency) dependencies:QueryList) { + * } + * } + * ``` + * + * This directive would be instantiated with a {@link QueryList} which contains `Dependency` 4 and + * 6. Here, `Dependency` 5 would not be included, because it is not a direct child. + * + * ### Injecting a live collection of descendant directives + * + * By passing the descendant flag to `@Query` above, we can include the children of the child + * elements. + * + * ``` + * @Directive({ selector: '[my-directive]' }) + * class MyDirective { + * constructor(@Query(Dependency, {descendants: true}) dependencies:QueryList) { + * } + * } + * ``` + * + * This directive would be instantiated with a Query which would contain `Dependency` 4, 5 and 6. + * + * ### Optional injection + * + * The normal behavior of directives is to return an error when a specified dependency cannot be + * resolved. If you + * would like to inject `null` on unresolved dependency instead, you can annotate that dependency + * with `@Optional()`. + * This explicitly permits the author of a template to treat some of the surrounding directives as + * optional. + * + * ``` + * @Directive({ selector: '[my-directive]' }) + * class MyDirective { + * constructor(@Optional() dependency:Dependency) { + * } + * } + * ``` + * + * This directive would be instantiated with a `Dependency` directive found on the current element. + * If none can be + * found, the injector supplies `null` instead of throwing an error. + * + * ## Example + * + * Here we use a decorator directive to simply define basic tool-tip behavior. + * + * ``` + * @Directive({ + * selector: '[tooltip]', + * properties: [ + * 'text: tooltip' + * ], + * hostListeners: { + * 'onmouseenter': 'onMouseEnter()', + * 'onmouseleave': 'onMouseLeave()' + * } + * }) + * class Tooltip{ + * text:string; + * overlay:Overlay; // NOT YET IMPLEMENTED + * overlayManager:OverlayManager; // NOT YET IMPLEMENTED + * + * constructor(overlayManager:OverlayManager) { + * this.overlay = overlay; + * } + * + * onMouseEnter() { + * // exact signature to be determined + * this.overlay = this.overlayManager.open(text, ...); + * } + * + * onMouseLeave() { + * this.overlay.close(); + * this.overlay = null; + * } + * } + * ``` + * In our HTML template, we can then add this behavior to a `
` or any other element with the + * `tooltip` selector, + * like so: + * + * ``` + *
+ * ``` + * + * Directives can also control the instantiation, destruction, and positioning of inline template + * elements: + * + * A directive uses a {@link ViewContainerRef} to instantiate, insert, move, and destroy views at + * runtime. + * The {@link ViewContainerRef} is created as a result of `