From 8bb66a5eb382f454af80523894efba9c61fc7e7b Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 11 Feb 2016 17:01:17 -0800 Subject: [PATCH] chore: noImplicitAny fixes --- .../compiler/ts/url_resolver/url_resolver.ts | 2 +- .../debug/ts/debug_element/debug_element.ts | 2 +- .../forms/ts/ng_validators/ng_validators.ts | 4 +- .../pipes/ts/async_pipe/async_pipe_example.ts | 7 +- .../lowerupper_pipe_example.ts | 2 +- .../examples/core/ts/metadata/metadata.ts | 6 +- .../core/ts/prod_mode/prod_mode_example.ts | 2 +- .../examples/facade/ts/async/observable.ts | 4 +- .../facade/ts/async/observable_patched.ts | 6 +- .../facade/ts/async/observable_pure.ts | 8 +-- .../ts/can_activate/can_activate_spec.ts | 2 +- .../ts/can_deactivate/can_deactivate_spec.ts | 2 +- .../router/ts/on_activate/on_activate_spec.ts | 2 +- .../ts/on_deactivate/on_deactivate_spec.ts | 2 +- .../examples/router/ts/reuse/reuse_spec.ts | 2 +- .../angular2/examples/testing/ts/testing.ts | 4 +- modules/angular2/src/animate/animation.ts | 4 +- .../angular2/src/animate/browser_details.ts | 5 +- .../angular2/src/common/directives/ng_for.ts | 23 ++++--- .../angular2/src/common/directives/ng_if.ts | 2 +- .../src/common/directives/ng_style.ts | 13 ++-- .../src/common/directives/ng_switch.ts | 10 +-- .../directives/checkbox_value_accessor.ts | 2 +- .../directives/default_value_accessor.ts | 2 +- .../forms/directives/normalize_validator.ts | 11 ++- .../forms/directives/number_value_accessor.ts | 2 +- .../select_control_value_accessor.ts | 2 +- .../src/common/forms/directives/shared.ts | 12 ++-- .../angular2/src/common/forms/form_builder.ts | 5 +- modules/angular2/src/common/forms/model.ts | 18 ++--- .../angular2/src/common/pipes/async_pipe.ts | 4 +- modules/angular2/src/core/application_ref.ts | 21 +++--- modules/angular2/src/core/di/injector.ts | 23 ++++++- .../reflection/reflection_capabilities.ts | 69 +++++++++++-------- .../angular2/src/core/reflection/reflector.ts | 8 +-- modules/angular2/src/testing/utils.ts | 4 +- .../test/core/reflection/reflector_spec.ts | 67 +++++++++++------- tools/public_api_guard/public_api_spec.ts | 2 +- 38 files changed, 219 insertions(+), 147 deletions(-) diff --git a/modules/angular2/examples/compiler/ts/url_resolver/url_resolver.ts b/modules/angular2/examples/compiler/ts/url_resolver/url_resolver.ts index 3910a38a1a..db54d0da6c 100644 --- a/modules/angular2/examples/compiler/ts/url_resolver/url_resolver.ts +++ b/modules/angular2/examples/compiler/ts/url_resolver/url_resolver.ts @@ -2,7 +2,7 @@ import {provide} from 'angular2/core'; import {bootstrap} from 'angular2/bootstrap'; import {UrlResolver} from 'angular2/compiler'; -var MyApp; +var MyApp: any; // #docregion url_resolver class MyUrlResolver extends UrlResolver { diff --git a/modules/angular2/examples/core/debug/ts/debug_element/debug_element.ts b/modules/angular2/examples/core/debug/ts/debug_element/debug_element.ts index 4fc729dae1..14741a2f3f 100644 --- a/modules/angular2/examples/core/debug/ts/debug_element/debug_element.ts +++ b/modules/angular2/examples/core/debug/ts/debug_element/debug_element.ts @@ -1,7 +1,7 @@ import {DebugElement} from 'angular2/core'; var debugElement: DebugElement; -var predicate; +var predicate: any; // #docregion scope_all debugElement.query(predicate); diff --git a/modules/angular2/examples/core/forms/ts/ng_validators/ng_validators.ts b/modules/angular2/examples/core/forms/ts/ng_validators/ng_validators.ts index e0206403ba..a9ba52f18a 100644 --- a/modules/angular2/examples/core/forms/ts/ng_validators/ng_validators.ts +++ b/modules/angular2/examples/core/forms/ts/ng_validators/ng_validators.ts @@ -2,8 +2,8 @@ import {bootstrap} from 'angular2/bootstrap'; import {NG_VALIDATORS} from 'angular2/common'; import {Provider} from 'angular2/core'; -let MyApp = null; -let myValidator = null; +let MyApp: Function = null; +let myValidator: any = null; // #docregion ng_validators bootstrap(MyApp, [new Provider(NG_VALIDATORS, {useValue: myValidator, multi: true})]); diff --git a/modules/angular2/examples/core/pipes/ts/async_pipe/async_pipe_example.ts b/modules/angular2/examples/core/pipes/ts/async_pipe/async_pipe_example.ts index 879ff08455..dae4e30a31 100644 --- a/modules/angular2/examples/core/pipes/ts/async_pipe/async_pipe_example.ts +++ b/modules/angular2/examples/core/pipes/ts/async_pipe/async_pipe_example.ts @@ -1,6 +1,6 @@ import {Component, provide} from 'angular2/core'; import {bootstrap} from 'angular2/bootstrap'; -import {Observable} from 'rxjs/Observable'; +import {Observable, Subscriber} from 'rxjs/Rx'; // #docregion AsyncPipe @Component({ @@ -37,8 +37,9 @@ export class AsyncPipeExample { // #docregion AsyncPipeObservable @Component({selector: "task-cmp", template: "Time: {{ time | async }}"}) class Task { - time = new Observable( - observer => { setInterval(_ => observer.next(new Date().getTime()), 500); }); + time = new Observable((observer: Subscriber) => { + setInterval(_ => observer.next(new Date().getTime()), 500); + }); } // #enddocregion diff --git a/modules/angular2/examples/core/pipes/ts/lowerupper_pipe/lowerupper_pipe_example.ts b/modules/angular2/examples/core/pipes/ts/lowerupper_pipe/lowerupper_pipe_example.ts index 2d891111a1..1ceeb458a0 100644 --- a/modules/angular2/examples/core/pipes/ts/lowerupper_pipe/lowerupper_pipe_example.ts +++ b/modules/angular2/examples/core/pipes/ts/lowerupper_pipe/lowerupper_pipe_example.ts @@ -12,7 +12,7 @@ import {bootstrap} from 'angular2/bootstrap'; }) export class LowerUpperPipeExample { value: string; - change(value) { this.value = value; } + change(value: string) { this.value = value; } } // #enddocregion diff --git a/modules/angular2/examples/core/ts/metadata/metadata.ts b/modules/angular2/examples/core/ts/metadata/metadata.ts index 0924ad4e8d..6ab9d60637 100644 --- a/modules/angular2/examples/core/ts/metadata/metadata.ts +++ b/modules/angular2/examples/core/ts/metadata/metadata.ts @@ -1,6 +1,6 @@ import {Component, Attribute, Directive, Pipe} from 'angular2/core'; -var CustomDirective; +var CustomDirective: Function; // #docregion component @Component({selector: 'greet', template: 'Hello {{name}}!', directives: [CustomDirective]}) @@ -20,7 +20,7 @@ class Page { // #docregion attributeMetadata @Directive({selector: 'input'}) class InputAttrDirective { - constructor(@Attribute('type') type) { + constructor(@Attribute('type') type: string) { // type would be 'text' in this example } } @@ -38,6 +38,6 @@ class InputDirective { // #docregion pipe @Pipe({name: 'lowercase'}) class Lowercase { - transform(v, args) { return v.toLowerCase(); } + transform(v: string, args: any[]) { return v.toLowerCase(); } } // #enddocregion diff --git a/modules/angular2/examples/core/ts/prod_mode/prod_mode_example.ts b/modules/angular2/examples/core/ts/prod_mode/prod_mode_example.ts index 76c3e15f4a..7dd75d6e5a 100644 --- a/modules/angular2/examples/core/ts/prod_mode/prod_mode_example.ts +++ b/modules/angular2/examples/core/ts/prod_mode/prod_mode_example.ts @@ -1,7 +1,7 @@ // #docregion enableProdMode import {enableProdMode} from 'angular2/core'; import {bootstrap} from 'angular2/bootstrap'; -import {MyComponent} from 'my_component'; +import {MyComponent} from './my_component'; enableProdMode(); bootstrap(MyComponent); diff --git a/modules/angular2/examples/facade/ts/async/observable.ts b/modules/angular2/examples/facade/ts/async/observable.ts index 56ce718a74..8fe837cb94 100644 --- a/modules/angular2/examples/facade/ts/async/observable.ts +++ b/modules/angular2/examples/facade/ts/async/observable.ts @@ -1,6 +1,6 @@ // #docregion Observable -import {Observable} from 'rxjs/Observable'; -var obs = new Observable(obs => { +import {Observable, Subscriber} from 'rxjs/Rx'; +var obs = new Observable((obs: Subscriber) => { var i = 0; setInterval(_ => { obs.next(++i); }, 1000); }); diff --git a/modules/angular2/examples/facade/ts/async/observable_patched.ts b/modules/angular2/examples/facade/ts/async/observable_patched.ts index b63ae01e88..f1978d39f9 100644 --- a/modules/angular2/examples/facade/ts/async/observable_patched.ts +++ b/modules/angular2/examples/facade/ts/async/observable_patched.ts @@ -1,10 +1,10 @@ // #docregion Observable -import {Observable} from 'rxjs/Observable'; +import {Observable, Subscriber} from 'rxjs/Rx'; import 'rxjs/add/operator/map'; -var obs = new Observable(obs => { +var obs = new Observable((obs: Subscriber) => { var i = 0; setInterval(_ => obs.next(++i), 1000); }); -obs.map(i => `${i} seconds elapsed`).subscribe(msg => console.log(msg)); +obs.map((i: number) => `${i} seconds elapsed`).subscribe(msg => console.log(msg)); // #enddocregion diff --git a/modules/angular2/examples/facade/ts/async/observable_pure.ts b/modules/angular2/examples/facade/ts/async/observable_pure.ts index a73bfb4d0b..a7d3d4637e 100644 --- a/modules/angular2/examples/facade/ts/async/observable_pure.ts +++ b/modules/angular2/examples/facade/ts/async/observable_pure.ts @@ -1,10 +1,10 @@ // #docregion Observable -import {Observable} from 'rxjs/Observable'; +import {Observable, Subscriber} from 'rxjs/Rx'; import {map} from 'rxjs/operator/map'; -var obs = new Observable(obs => { +var obs = new Observable((sub: Subscriber) => { var i = 0; - setInterval(_ => obs.next(++i), 1000); + setInterval(_ => sub.next(++i), 1000); }); -map.call(obs, i => `${i} seconds elapsed`).subscribe(msg => console.log(msg)); +map.call(obs, (i: number) => `${i} seconds elapsed`).subscribe((msg: string) => console.log(msg)); // #enddocregion diff --git a/modules/angular2/examples/router/ts/can_activate/can_activate_spec.ts b/modules/angular2/examples/router/ts/can_activate/can_activate_spec.ts index 58b8e8cc57..10a29dc700 100644 --- a/modules/angular2/examples/router/ts/can_activate/can_activate_spec.ts +++ b/modules/angular2/examples/router/ts/can_activate/can_activate_spec.ts @@ -1,6 +1,6 @@ import {verifyNoBrowserErrors} from 'angular2/src/testing/e2e_util'; -function waitForElement(selector) { +function waitForElement(selector: string) { var EC = (protractor).ExpectedConditions; // Waits for the element with id 'abc' to be present on the dom. browser.wait(EC.presenceOf($(selector)), 20000); diff --git a/modules/angular2/examples/router/ts/can_deactivate/can_deactivate_spec.ts b/modules/angular2/examples/router/ts/can_deactivate/can_deactivate_spec.ts index a83e76c207..84ab31f6fe 100644 --- a/modules/angular2/examples/router/ts/can_deactivate/can_deactivate_spec.ts +++ b/modules/angular2/examples/router/ts/can_deactivate/can_deactivate_spec.ts @@ -1,6 +1,6 @@ import {verifyNoBrowserErrors} from 'angular2/src/testing/e2e_util'; -function waitForElement(selector) { +function waitForElement(selector: string) { var EC = (protractor).ExpectedConditions; // Waits for the element with id 'abc' to be present on the dom. browser.wait(EC.presenceOf($(selector)), 20000); diff --git a/modules/angular2/examples/router/ts/on_activate/on_activate_spec.ts b/modules/angular2/examples/router/ts/on_activate/on_activate_spec.ts index e6eac4056f..901eae2263 100644 --- a/modules/angular2/examples/router/ts/on_activate/on_activate_spec.ts +++ b/modules/angular2/examples/router/ts/on_activate/on_activate_spec.ts @@ -1,6 +1,6 @@ import {verifyNoBrowserErrors} from 'angular2/src/testing/e2e_util'; -function waitForElement(selector) { +function waitForElement(selector: string) { var EC = (protractor).ExpectedConditions; // Waits for the element with id 'abc' to be present on the dom. browser.wait(EC.presenceOf($(selector)), 20000); diff --git a/modules/angular2/examples/router/ts/on_deactivate/on_deactivate_spec.ts b/modules/angular2/examples/router/ts/on_deactivate/on_deactivate_spec.ts index f063b6c01a..ac84a89062 100644 --- a/modules/angular2/examples/router/ts/on_deactivate/on_deactivate_spec.ts +++ b/modules/angular2/examples/router/ts/on_deactivate/on_deactivate_spec.ts @@ -1,6 +1,6 @@ import {verifyNoBrowserErrors} from 'angular2/src/testing/e2e_util'; -function waitForElement(selector) { +function waitForElement(selector: string) { var EC = (protractor).ExpectedConditions; // Waits for the element with id 'abc' to be present on the dom. browser.wait(EC.presenceOf($(selector)), 20000); diff --git a/modules/angular2/examples/router/ts/reuse/reuse_spec.ts b/modules/angular2/examples/router/ts/reuse/reuse_spec.ts index 7bf638490e..60a0491e67 100644 --- a/modules/angular2/examples/router/ts/reuse/reuse_spec.ts +++ b/modules/angular2/examples/router/ts/reuse/reuse_spec.ts @@ -1,6 +1,6 @@ import {verifyNoBrowserErrors} from 'angular2/src/testing/e2e_util'; -function waitForElement(selector) { +function waitForElement(selector: string) { var EC = (protractor).ExpectedConditions; // Waits for the element with id 'abc' to be present on the dom. browser.wait(EC.presenceOf($(selector)), 20000); diff --git a/modules/angular2/examples/testing/ts/testing.ts b/modules/angular2/examples/testing/ts/testing.ts index f46a2e0079..a8a9980354 100644 --- a/modules/angular2/examples/testing/ts/testing.ts +++ b/modules/angular2/examples/testing/ts/testing.ts @@ -73,7 +73,7 @@ describe('some component', () => { // #docregion beforeEachProviders describe('some component', () => { beforeEachProviders(() => [provide(MyService, {useClass: MyMockService})]); - it('uses MyService', inject([MyService], (service) => { + it('uses MyService', inject([MyService], (service: MyMockService) => { // service is an instance of MyMockService. })); }); @@ -81,7 +81,7 @@ describe('some component', () => { // #docregion afterEach describe('some component', () => { - afterEach((done) => { db.reset().then((_) => done()); }); + afterEach((done: Function) => { db.reset().then((_: any) => done()); }); it('uses the db', () => { // This test can leave the database in a dirty state. // The afterEach will ensure it gets reset. diff --git a/modules/angular2/src/animate/animation.ts b/modules/angular2/src/animate/animation.ts index 4e73758989..49e14a120a 100644 --- a/modules/angular2/src/animate/animation.ts +++ b/modules/angular2/src/animate/animation.ts @@ -52,7 +52,7 @@ export class Animation { this.startTime = DateWrapper.toMillis(DateWrapper.now()); this._stringPrefix = DOM.getAnimationPrefix(); this.setup(); - this.wait(timestamp => this.start()); + this.wait((timestamp: any) => this.start()); } wait(callback: Function) { @@ -97,7 +97,7 @@ export class Animation { * @param styles */ applyStyles(styles: {[key: string]: any}): void { - StringMapWrapper.forEach(styles, (value, key) => { + StringMapWrapper.forEach(styles, (value: any, key: string) => { var dashCaseKey = camelCaseToDashCase(key); if (isPresent(DOM.getStyle(this.element, dashCaseKey))) { DOM.setStyle(this.element, dashCaseKey, value.toString()); diff --git a/modules/angular2/src/animate/browser_details.ts b/modules/angular2/src/animate/browser_details.ts index 8c0316321f..1d0abb15b2 100644 --- a/modules/angular2/src/animate/browser_details.ts +++ b/modules/angular2/src/animate/browser_details.ts @@ -17,7 +17,7 @@ export class BrowserDetails { DOM.setAttribute(div, 'style', `position: absolute; top: -9999px; left: -9999px; width: 1px; height: 1px; transition: all 1ms linear 1ms;`); // Firefox requires that we wait for 2 frames for some reason - this.raf(timestamp => { + this.raf((timestamp: any) => { DOM.on(div, 'transitionend', (event: any) => { var elapsed = Math.round(event.elapsedTime * 1000); this.elapsedTimeIncludesDelay = elapsed == 2; @@ -37,7 +37,8 @@ class RafQueue { currentFrameId: number; constructor(public callback: Function, public frames: number) { this._raf(); } private _raf() { - this.currentFrameId = DOM.requestAnimationFrame(timestamp => this._nextFrame(timestamp)); + this.currentFrameId = + DOM.requestAnimationFrame((timestamp: number) => this._nextFrame(timestamp)); } private _nextFrame(timestamp: number) { this.frames--; diff --git a/modules/angular2/src/common/directives/ng_for.ts b/modules/angular2/src/common/directives/ng_for.ts index 668d58b167..b3d315b746 100644 --- a/modules/angular2/src/common/directives/ng_for.ts +++ b/modules/angular2/src/common/directives/ng_for.ts @@ -10,6 +10,10 @@ import { TrackByFn } from 'angular2/core'; import {isPresent, isBlank} from 'angular2/src/facade/lang'; +import { + DefaultIterableDiffer, + CollectionChangeRecord +} from "../../core/change_detection/differs/default_iterable_differ"; /** * The `NgFor` directive instantiates a template once per item from an iterable. The context for @@ -92,19 +96,19 @@ export class NgFor implements DoCheck { } } - private _applyChanges(changes) { + private _applyChanges(changes: DefaultIterableDiffer) { // TODO(rado): check if change detection can produce a change record that is // easier to consume than current. - var recordViewTuples = []; - changes.forEachRemovedItem((removedRecord) => + var recordViewTuples: RecordViewTuple[] = []; + changes.forEachRemovedItem((removedRecord: CollectionChangeRecord) => recordViewTuples.push(new RecordViewTuple(removedRecord, null))); - changes.forEachMovedItem((movedRecord) => + changes.forEachMovedItem((movedRecord: CollectionChangeRecord) => recordViewTuples.push(new RecordViewTuple(movedRecord, null))); var insertTuples = this._bulkRemove(recordViewTuples); - changes.forEachAddedItem((addedRecord) => + changes.forEachAddedItem((addedRecord: CollectionChangeRecord) => insertTuples.push(new RecordViewTuple(addedRecord, null))); this._bulkInsert(insertTuples); @@ -124,7 +128,7 @@ export class NgFor implements DoCheck { }); } - private _perViewChange(view, record) { + private _perViewChange(view: EmbeddedViewRef, record: CollectionChangeRecord) { view.setLocal('\$implicit', record.item); view.setLocal('index', record.currentIndex); view.setLocal('even', (record.currentIndex % 2 == 0)); @@ -132,8 +136,9 @@ export class NgFor implements DoCheck { } private _bulkRemove(tuples: RecordViewTuple[]): RecordViewTuple[] { - tuples.sort((a, b) => a.record.previousIndex - b.record.previousIndex); - var movedTuples = []; + tuples.sort((a: RecordViewTuple, b: RecordViewTuple) => + a.record.previousIndex - b.record.previousIndex); + var movedTuples: RecordViewTuple[] = []; for (var i = tuples.length - 1; i >= 0; i--) { var tuple = tuples[i]; // separate moved views from removed views. @@ -165,7 +170,7 @@ export class NgFor implements DoCheck { class RecordViewTuple { view: EmbeddedViewRef; record: any; - constructor(record, view) { + constructor(record: any, view: EmbeddedViewRef) { this.record = record; this.view = view; } diff --git a/modules/angular2/src/common/directives/ng_if.ts b/modules/angular2/src/common/directives/ng_if.ts index f4bbfea1c4..bd30c07bb6 100644 --- a/modules/angular2/src/common/directives/ng_if.ts +++ b/modules/angular2/src/common/directives/ng_if.ts @@ -29,7 +29,7 @@ export class NgIf { constructor(private _viewContainer: ViewContainerRef, private _templateRef: TemplateRef) {} - set ngIf(newCondition /* boolean */) { + set ngIf(newCondition: any /* boolean */) { if (newCondition && (isBlank(this._prevCondition) || !this._prevCondition)) { this._prevCondition = true; this._viewContainer.createEmbeddedView(this._templateRef); diff --git a/modules/angular2/src/common/directives/ng_style.ts b/modules/angular2/src/common/directives/ng_style.ts index 99d658a0f9..580f40b9a7 100644 --- a/modules/angular2/src/common/directives/ng_style.ts +++ b/modules/angular2/src/common/directives/ng_style.ts @@ -7,6 +7,7 @@ import { Renderer } from 'angular2/core'; import {isPresent, isBlank, print} from 'angular2/src/facade/lang'; +import {KVChangeRecord} from "../../core/change_detection/differs/default_keyvalue_differ"; /** * The `NgStyle` directive changes styles based on a result of expression evaluation. @@ -62,14 +63,14 @@ import {isPresent, isBlank, print} from 'angular2/src/facade/lang'; @Directive({selector: '[ngStyle]', inputs: ['rawStyle: ngStyle']}) export class NgStyle implements DoCheck { /** @internal */ - _rawStyle; + _rawStyle: {[key: string]: string}; /** @internal */ _differ: KeyValueDiffer; constructor(private _differs: KeyValueDiffers, private _ngEl: ElementRef, private _renderer: Renderer) {} - set rawStyle(v) { + set rawStyle(v: {[key: string]: string}) { this._rawStyle = v; if (isBlank(this._differ) && isPresent(v)) { this._differ = this._differs.find(this._rawStyle).create(null); @@ -86,9 +87,11 @@ export class NgStyle implements DoCheck { } private _applyChanges(changes: any): void { - changes.forEachAddedItem((record) => { this._setStyle(record.key, record.currentValue); }); - changes.forEachChangedItem((record) => { this._setStyle(record.key, record.currentValue); }); - changes.forEachRemovedItem((record) => { this._setStyle(record.key, null); }); + changes.forEachAddedItem( + (record: KVChangeRecord) => { this._setStyle(record.key, record.currentValue); }); + changes.forEachChangedItem( + (record: KVChangeRecord) => { this._setStyle(record.key, record.currentValue); }); + changes.forEachRemovedItem((record: KVChangeRecord) => { this._setStyle(record.key, null); }); } private _setStyle(name: string, val: string): void { diff --git a/modules/angular2/src/common/directives/ng_switch.ts b/modules/angular2/src/common/directives/ng_switch.ts index 469a9dbca2..658d03c1d7 100644 --- a/modules/angular2/src/common/directives/ng_switch.ts +++ b/modules/angular2/src/common/directives/ng_switch.ts @@ -76,7 +76,7 @@ export class NgSwitch { private _valueViews = new Map(); private _activeViews: SwitchView[] = []; - set ngSwitch(value) { + set ngSwitch(value: any) { // Empty the currently active ViewContainers this._emptyAllActiveViews(); @@ -93,7 +93,7 @@ export class NgSwitch { } /** @internal */ - _onWhenValueChanged(oldWhen, newWhen, view: SwitchView): void { + _onWhenValueChanged(oldWhen: any, newWhen: any, view: SwitchView): void { this._deregisterView(oldWhen, view); this._registerView(newWhen, view); @@ -137,7 +137,7 @@ export class NgSwitch { } /** @internal */ - _registerView(value, view: SwitchView): void { + _registerView(value: any, view: SwitchView): void { var views = this._valueViews.get(value); if (isBlank(views)) { views = []; @@ -147,7 +147,7 @@ export class NgSwitch { } /** @internal */ - _deregisterView(value, view: SwitchView): void { + _deregisterView(value: any, view: SwitchView): void { // `_WHEN_DEFAULT` is used a marker for non-registered whens if (value === _WHEN_DEFAULT) return; var views = this._valueViews.get(value); @@ -182,7 +182,7 @@ export class NgSwitchWhen { this._view = new SwitchView(viewContainer, templateRef); } - set ngSwitchWhen(value) { + set ngSwitchWhen(value: any) { this._switch._onWhenValueChanged(this._value, value, this._view); this._value = value; } diff --git a/modules/angular2/src/common/forms/directives/checkbox_value_accessor.ts b/modules/angular2/src/common/forms/directives/checkbox_value_accessor.ts index 9a8fdccb6e..fa1802b493 100644 --- a/modules/angular2/src/common/forms/directives/checkbox_value_accessor.ts +++ b/modules/angular2/src/common/forms/directives/checkbox_value_accessor.ts @@ -21,7 +21,7 @@ const CHECKBOX_VALUE_ACCESSOR = CONST_EXPR(new Provider( providers: [CHECKBOX_VALUE_ACCESSOR] }) export class CheckboxControlValueAccessor implements ControlValueAccessor { - onChange = (_) => {}; + onChange = (_: any) => {}; onTouched = () => {}; constructor(private _renderer: Renderer, private _elementRef: ElementRef) {} diff --git a/modules/angular2/src/common/forms/directives/default_value_accessor.ts b/modules/angular2/src/common/forms/directives/default_value_accessor.ts index 1cc88993a5..5aa92195a9 100644 --- a/modules/angular2/src/common/forms/directives/default_value_accessor.ts +++ b/modules/angular2/src/common/forms/directives/default_value_accessor.ts @@ -24,7 +24,7 @@ const DEFAULT_VALUE_ACCESSOR = CONST_EXPR(new Provider( bindings: [DEFAULT_VALUE_ACCESSOR] }) export class DefaultValueAccessor implements ControlValueAccessor { - onChange = (_) => {}; + onChange = (_: any) => {}; onTouched = () => {}; constructor(private _renderer: Renderer, private _elementRef: ElementRef) {} diff --git a/modules/angular2/src/common/forms/directives/normalize_validator.ts b/modules/angular2/src/common/forms/directives/normalize_validator.ts index 88e3fa6a7b..848d11c2b3 100644 --- a/modules/angular2/src/common/forms/directives/normalize_validator.ts +++ b/modules/angular2/src/common/forms/directives/normalize_validator.ts @@ -1,9 +1,14 @@ import {Validator} from './validators'; +import {Control} from "../model"; -export function normalizeValidator(validator: Function | Validator): Function { +export type ctrlFunc = ((c: Control) => { + [key: string]: any +}); + +export function normalizeValidator(validator: (ctrlFunc | Validator)): ctrlFunc { if ((validator).validate !== undefined) { - return (c) => (validator).validate(c); + return (c: Control) => (validator).validate(c); } else { - return validator; + return validator; } } diff --git a/modules/angular2/src/common/forms/directives/number_value_accessor.ts b/modules/angular2/src/common/forms/directives/number_value_accessor.ts index 1122c60625..875e88a7a4 100644 --- a/modules/angular2/src/common/forms/directives/number_value_accessor.ts +++ b/modules/angular2/src/common/forms/directives/number_value_accessor.ts @@ -25,7 +25,7 @@ const NUMBER_VALUE_ACCESSOR = CONST_EXPR(new Provider( bindings: [NUMBER_VALUE_ACCESSOR] }) export class NumberValueAccessor implements ControlValueAccessor { - onChange = (_) => {}; + onChange = (_: any) => {}; onTouched = () => {}; constructor(private _renderer: Renderer, private _elementRef: ElementRef) {} diff --git a/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts b/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts index 1cb88f6db8..cc91122e1f 100644 --- a/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts +++ b/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts @@ -41,7 +41,7 @@ export class NgSelectOption { }) export class SelectControlValueAccessor implements ControlValueAccessor { value: string; - onChange = (_) => {}; + onChange = (_: any) => {}; onTouched = () => {}; constructor(private _renderer: Renderer, private _elementRef: ElementRef, diff --git a/modules/angular2/src/common/forms/directives/shared.ts b/modules/angular2/src/common/forms/directives/shared.ts index 02edbca183..86b346f346 100644 --- a/modules/angular2/src/common/forms/directives/shared.ts +++ b/modules/angular2/src/common/forms/directives/shared.ts @@ -32,14 +32,14 @@ export function setUpControl(control: Control, dir: NgControl): void { dir.valueAccessor.writeValue(control.value); // view -> model - dir.valueAccessor.registerOnChange(newValue => { + dir.valueAccessor.registerOnChange((newValue: any) => { dir.viewToModelUpdate(newValue); control.updateValue(newValue, {emitModelToViewChange: false}); control.markAsDirty(); }); // model -> view - control.registerOnChange(newValue => dir.valueAccessor.writeValue(newValue)); + control.registerOnChange((newValue: any) => dir.valueAccessor.writeValue(newValue)); // touched dir.valueAccessor.registerOnTouched(() => control.markAsTouched()); @@ -78,10 +78,10 @@ export function selectValueAccessor(dir: NgControl, valueAccessors: ControlValueAccessor[]): ControlValueAccessor { if (isBlank(valueAccessors)) return null; - var defaultAccessor; - var builtinAccessor; - var customAccessor; - valueAccessors.forEach(v => { + var defaultAccessor: ControlValueAccessor; + var builtinAccessor: ControlValueAccessor; + var customAccessor: ControlValueAccessor; + valueAccessors.forEach((v: ControlValueAccessor) => { if (hasConstructor(v, DefaultValueAccessor)) { defaultAccessor = v; diff --git a/modules/angular2/src/common/forms/form_builder.ts b/modules/angular2/src/common/forms/form_builder.ts index 5c87b04841..f6bc0a13fe 100644 --- a/modules/angular2/src/common/forms/form_builder.ts +++ b/modules/angular2/src/common/forms/form_builder.ts @@ -80,9 +80,10 @@ export class FormBuilder { } /** @internal */ - _reduceControls(controlsConfig: any): {[key: string]: modelModule.AbstractControl} { + _reduceControls(controlsConfig: {[k: string]: + any}): {[key: string]: modelModule.AbstractControl} { var controls: {[key: string]: modelModule.AbstractControl} = {}; - StringMapWrapper.forEach(controlsConfig, (controlConfig, controlName) => { + StringMapWrapper.forEach(controlsConfig, (controlConfig: any, controlName: string) => { controls[controlName] = this._createControl(controlConfig); }); return controls; diff --git a/modules/angular2/src/common/forms/model.ts b/modules/angular2/src/common/forms/model.ts index 1d5c6506b8..40850fe3c6 100644 --- a/modules/angular2/src/common/forms/model.ts +++ b/modules/angular2/src/common/forms/model.ts @@ -62,7 +62,7 @@ export abstract class AbstractControl { private _pristine: boolean = true; private _touched: boolean = false; private _parent: ControlGroup | ControlArray; - private _asyncValidationSubscription; + private _asyncValidationSubscription: any; constructor(public validator: Function, public asyncValidator: Function) {} @@ -379,7 +379,8 @@ export class ControlGroup extends AbstractControl { /** @internal */ _setParentForControls() { - StringMapWrapper.forEach(this.controls, (control, name) => { control.setParent(this); }); + StringMapWrapper.forEach( + this.controls, (control: AbstractControl, name: string) => { control.setParent(this); }); } /** @internal */ @@ -388,7 +389,7 @@ export class ControlGroup extends AbstractControl { /** @internal */ _anyControlsHaveStatus(status: string): boolean { var res = false; - StringMapWrapper.forEach(this.controls, (control, name) => { + StringMapWrapper.forEach(this.controls, (control: AbstractControl, name: string) => { res = res || (this.contains(name) && control.status == status); }); return res; @@ -396,16 +397,17 @@ export class ControlGroup extends AbstractControl { /** @internal */ _reduceValue() { - return this._reduceChildren({}, (acc, control, name) => { - acc[name] = control.value; - return acc; - }); + return this._reduceChildren( + {}, (acc: {[k: string]: AbstractControl}, control: AbstractControl, name: string) => { + acc[name] = control.value; + return acc; + }); } /** @internal */ _reduceChildren(initValue: any, fn: Function) { var res = initValue; - StringMapWrapper.forEach(this.controls, (control, name) => { + StringMapWrapper.forEach(this.controls, (control: AbstractControl, name: string) => { if (this._included(name)) { res = fn(res, control, name); } diff --git a/modules/angular2/src/common/pipes/async_pipe.ts b/modules/angular2/src/common/pipes/async_pipe.ts index 34654df5a7..ee27a94aa5 100644 --- a/modules/angular2/src/common/pipes/async_pipe.ts +++ b/modules/angular2/src/common/pipes/async_pipe.ts @@ -102,8 +102,8 @@ export class AsyncPipe implements PipeTransform, OnDestroy { _subscribe(obj: Observable| Promise| EventEmitter): void { this._obj = obj; this._strategy = this._selectStrategy(obj); - this._subscription = - this._strategy.createSubscription(obj, value => this._updateLatestValue(obj, value)); + this._subscription = this._strategy.createSubscription( + obj, (value: Object) => this._updateLatestValue(obj, value)); } /** @internal */ diff --git a/modules/angular2/src/core/application_ref.ts b/modules/angular2/src/core/application_ref.ts index d6e8006a36..c960e8bd33 100644 --- a/modules/angular2/src/core/application_ref.ts +++ b/modules/angular2/src/core/application_ref.ts @@ -250,7 +250,7 @@ export class PlatformRef_ extends PlatformRef { provide(ApplicationRef, {useFactory: (): ApplicationRef => app, deps: []}) ]); - var exceptionHandler; + var exceptionHandler: Function; try { injector = this.injector.resolveAndCreateChild(providers); exceptionHandler = injector.get(ExceptionHandler); @@ -427,7 +427,7 @@ export class ApplicationRef_ extends ApplicationRef { try { var injector: Injector = this._injector.resolveAndCreateChild(componentProviders); var compRefToken: Promise = injector.get(APP_COMPONENT_REF_PROMISE); - var tick = (componentRef) => { + var tick = (componentRef: ComponentRef) => { this._loadComponent(componentRef); completer.resolve(componentRef); }; @@ -460,22 +460,23 @@ export class ApplicationRef_ extends ApplicationRef { } /** @internal */ - _loadComponent(ref): void { - var appChangeDetector = (ref.location).internalElement.parentView.changeDetector; + _loadComponent(componentRef: ComponentRef): void { + var appChangeDetector = + (componentRef.location).internalElement.parentView.changeDetector; this._changeDetectorRefs.push(appChangeDetector.ref); this.tick(); - this._rootComponents.push(ref); - this._bootstrapListeners.forEach((listener) => listener(ref)); + this._rootComponents.push(componentRef); + this._bootstrapListeners.forEach((listener) => listener(componentRef)); } /** @internal */ - _unloadComponent(ref): void { - if (!ListWrapper.contains(this._rootComponents, ref)) { + _unloadComponent(componentRef: ComponentRef): void { + if (!ListWrapper.contains(this._rootComponents, componentRef)) { return; } this.unregisterChangeDetector( - (ref.location).internalElement.parentView.changeDetector.ref); - ListWrapper.remove(this._rootComponents, ref); + (componentRef.location).internalElement.parentView.changeDetector.ref); + ListWrapper.remove(this._rootComponents, componentRef); } get injector(): Injector { return this._injector; } diff --git a/modules/angular2/src/core/di/injector.ts b/modules/angular2/src/core/di/injector.ts index 67d797b1a0..6ad125539e 100644 --- a/modules/angular2/src/core/di/injector.ts +++ b/modules/angular2/src/core/di/injector.ts @@ -777,7 +777,26 @@ export class Injector { var deps = resolvedFactory.dependencies; var length = deps.length; - var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19; + var d0: any; + var d1: any; + var d2: any; + var d3: any; + var d4: any; + var d5: any; + var d6: any; + var d7: any; + var d8: any; + var d9: any; + var d10: any; + var d11: any; + var d12: any; + var d13: any; + var d14: any; + var d15: any; + var d16: any; + var d17: any; + var d18: any; + var d19: any; try { d0 = length > 0 ? this._getByDependency(provider, deps[0], visibility) : null; d1 = length > 1 ? this._getByDependency(provider, deps[1], visibility) : null; @@ -985,7 +1004,7 @@ export class Injector { } get displayName(): string { - return `Injector(providers: [${_mapProviders(this, b => ` "${b.key.displayName}" `).join(", ")}])`; + return `Injector(providers: [${_mapProviders(this, (b: ResolvedProvider) => ` "${b.key.displayName}" `).join(", ")}])`; } toString(): string { return this.displayName; } diff --git a/modules/angular2/src/core/reflection/reflection_capabilities.ts b/modules/angular2/src/core/reflection/reflection_capabilities.ts index a200420d0f..999471999a 100644 --- a/modules/angular2/src/core/reflection/reflection_capabilities.ts +++ b/modules/angular2/src/core/reflection/reflection_capabilities.ts @@ -22,60 +22,73 @@ export class ReflectionCapabilities implements PlatformReflectionCapabilities { case 0: return () => new t(); case 1: - return (a1) => new t(a1); + return (a1: any) => new t(a1); case 2: - return (a1, a2) => new t(a1, a2); + return (a1: any, a2: any) => new t(a1, a2); case 3: - return (a1, a2, a3) => new t(a1, a2, a3); + return (a1: any, a2: any, a3: any) => new t(a1, a2, a3); case 4: - return (a1, a2, a3, a4) => new t(a1, a2, a3, a4); + return (a1: any, a2: any, a3: any, a4: any) => new t(a1, a2, a3, a4); case 5: - return (a1, a2, a3, a4, a5) => new t(a1, a2, a3, a4, a5); + return (a1: any, a2: any, a3: any, a4: any, a5: any) => new t(a1, a2, a3, a4, a5); case 6: - return (a1, a2, a3, a4, a5, a6) => new t(a1, a2, a3, a4, a5, a6); + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any) => + new t(a1, a2, a3, a4, a5, a6); case 7: - return (a1, a2, a3, a4, a5, a6, a7) => new t(a1, a2, a3, a4, a5, a6, a7); + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any) => + new t(a1, a2, a3, a4, a5, a6, a7); case 8: - return (a1, a2, a3, a4, a5, a6, a7, a8) => new t(a1, a2, a3, a4, a5, a6, a7, a8); + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any) => + new t(a1, a2, a3, a4, a5, a6, a7, a8); case 9: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9); + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any) => + new t(a1, a2, a3, a4, a5, a6, a7, a8, a9); case 10: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) => - new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); case 11: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) => - new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); case 12: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) => + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); case 13: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) => + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); case 14: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) => + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); case 15: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) => + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); case 16: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) => + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any, a16: any) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); case 17: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) => + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any, a16: any, a17: any) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); case 18: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) => - new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, - a18); + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any, a16: any, a17: any, + a18: any) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, + a16, a17, a18); case 19: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, - a19) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, - a17, a18, a19); + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any, a16: any, a17: any, + a18: any, a19: any) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, + a14, a15, a16, a17, a18, a19); case 20: - return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, - a19, a20) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, - a16, a17, a18, a19, a20); + return (a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any, a16: any, a17: any, + a18: any, a19: any, a20: any) => new t(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, + a12, a13, a14, a15, a16, a17, a18, a19, a20); }; throw new Error( diff --git a/modules/angular2/src/core/reflection/reflector.ts b/modules/angular2/src/core/reflection/reflector.ts index 5b58109d78..908b993dc9 100644 --- a/modules/angular2/src/core/reflection/reflector.ts +++ b/modules/angular2/src/core/reflection/reflector.ts @@ -148,7 +148,7 @@ export class Reflector { } /** @internal */ - _getReflectionInfo(typeOrFunc) { + _getReflectionInfo(typeOrFunc: any) { if (isPresent(this._usedKeys)) { this._usedKeys.add(typeOrFunc); } @@ -156,11 +156,11 @@ export class Reflector { } /** @internal */ - _containsReflectionInfo(typeOrFunc) { return this._injectableInfo.has(typeOrFunc); } + _containsReflectionInfo(typeOrFunc: any) { return this._injectableInfo.has(typeOrFunc); } importUri(type: Type): string { return this.reflectionCapabilities.importUri(type); } } -function _mergeMaps(target: Map, config: {[key: string]: Function}): void { - StringMapWrapper.forEach(config, (v, k) => target.set(k, v)); +function _mergeMaps(target: Map, config: {[key: string]: Function}): void { + StringMapWrapper.forEach(config, (v: Function, k: string) => target.set(k, v)); } diff --git a/modules/angular2/src/testing/utils.ts b/modules/angular2/src/testing/utils.ts index 6c604a97d6..57200c7598 100644 --- a/modules/angular2/src/testing/utils.ts +++ b/modules/angular2/src/testing/utils.ts @@ -13,7 +13,9 @@ export class Log { add(value): void { this._result.push(value); } fn(value) { - return (a1 = null, a2 = null, a3 = null, a4 = null, a5 = null) => { this._result.push(value); } + return (a1: any = null, a2: any = null, a3: any = null, a4: any = null, a5: any = null) => { + this._result.push(value); + } } clear(): void { this._result = []; } diff --git a/modules/angular2/test/core/reflection/reflector_spec.ts b/modules/angular2/test/core/reflection/reflector_spec.ts index 40e97c565a..d1b9e64e92 100644 --- a/modules/angular2/test/core/reflection/reflector_spec.ts +++ b/modules/angular2/test/core/reflection/reflector_spec.ts @@ -279,118 +279,135 @@ class TestObjWith00Args { class TestObjWith01Args { args: any[]; - constructor(a1) { this.args = [a1]; } + constructor(a1: any) { this.args = [a1]; } } class TestObjWith02Args { args: any[]; - constructor(a1, a2) { this.args = [a1, a2]; } + constructor(a1: any, a2: any) { this.args = [a1, a2]; } } class TestObjWith03Args { args: any[]; - constructor(a1, a2, a3) { this.args = [a1, a2, a3]; } + constructor(a1: any, a2: any, a3: any) { this.args = [a1, a2, a3]; } } class TestObjWith04Args { args: any[]; - constructor(a1, a2, a3, a4) { this.args = [a1, a2, a3, a4]; } + constructor(a1: any, a2: any, a3: any, a4: any) { this.args = [a1, a2, a3, a4]; } } class TestObjWith05Args { args: any[]; - constructor(a1, a2, a3, a4, a5) { this.args = [a1, a2, a3, a4, a5]; } + constructor(a1: any, a2: any, a3: any, a4: any, a5: any) { this.args = [a1, a2, a3, a4, a5]; } } class TestObjWith06Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6) { this.args = [a1, a2, a3, a4, a5, a6]; } + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any) { + this.args = [a1, a2, a3, a4, a5, a6]; + } } class TestObjWith07Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7) { this.args = [a1, a2, a3, a4, a5, a6, a7]; } + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any) { + this.args = [a1, a2, a3, a4, a5, a6, a7]; + } } class TestObjWith08Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8]; } + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any) { + this.args = [a1, a2, a3, a4, a5, a6, a7, a8]; + } } class TestObjWith09Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9]; } } class TestObjWith10Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10]; } } class TestObjWith11Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11]; } } class TestObjWith12Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12]; } } class TestObjWith13Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13]; } } class TestObjWith14Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14]; } } class TestObjWith15Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15]; } } class TestObjWith16Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any, a16: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16]; } } class TestObjWith17Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any, a16: any, a17: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17]; } } class TestObjWith18Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any, a16: any, a17: any, + a18: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18]; } } class TestObjWith19Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, - a19) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any, a16: any, a17: any, + a18: any, a19: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19]; } @@ -398,8 +415,9 @@ class TestObjWith19Args { class TestObjWith20Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, - a20) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any, a16: any, a17: any, + a18: any, a19: any, a20: any) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20]; } @@ -407,8 +425,9 @@ class TestObjWith20Args { class TestObjWith21Args { args: any[]; - constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, - a20, a21) { + constructor(a1: any, a2: any, a3: any, a4: any, a5: any, a6: any, a7: any, a8: any, a9: any, + a10: any, a11: any, a12: any, a13: any, a14: any, a15: any, a16: any, a17: any, + a18: any, a19: any, a20: any, a21: any) { this.args = [ a1, a2, diff --git a/tools/public_api_guard/public_api_spec.ts b/tools/public_api_guard/public_api_spec.ts index f8549ddf46..191bc89af1 100644 --- a/tools/public_api_guard/public_api_spec.ts +++ b/tools/public_api_guard/public_api_spec.ts @@ -763,7 +763,7 @@ const COMMON = [ 'NgStyle', 'NgStyle.constructor(_differs:KeyValueDiffers, _ngEl:ElementRef, _renderer:Renderer)', 'NgStyle.ngDoCheck():any', - 'NgStyle.rawStyle=(v:any)', + 'NgStyle.rawStyle=(v:{[key:string]:string})', 'NgSwitch', 'NgSwitch.ngSwitch=(value:any)', 'NgSwitchDefault',