refactor(TypeScript): Add noImplicitAny

We automatically insert explicit 'any's where needed. These need to be
addressed as in #9100.

Fixes #4924
This commit is contained in:
ScottSWu
2016-06-08 15:45:15 -07:00
parent 87d824e1b4
commit 86fbd50c3d
305 changed files with 2338 additions and 2337 deletions

View File

@ -18,8 +18,8 @@ export class ActiveAnimationPlayersMap {
}
findAllPlayersByElement(element: any): AnimationPlayer[] {
var players = [];
StringMapWrapper.forEach(this._map.get(element), player => players.push(player));
var players: any[] /** TODO #9100 */ = [];
StringMapWrapper.forEach(this._map.get(element), (player: any /** TODO #9100 */) => players.push(player));
return players;
}

View File

@ -55,7 +55,7 @@ export class AnimationGroupPlayer implements AnimationPlayer {
reset(): void { this._players.forEach(player => player.reset()); }
setPosition(p): void {
setPosition(p: any /** TODO #9100 */): void {
this._players.forEach(player => {
player.setPosition(p);
});

View File

@ -9,7 +9,7 @@ export abstract class AnimationPlayer {
abstract finish(): void;
abstract destroy(): void;
abstract reset(): void;
abstract setPosition(p): void;
abstract setPosition(p: any /** TODO #9100 */): void;
abstract getPosition(): number;
get parentPlayer(): AnimationPlayer { throw new BaseException('NOT IMPLEMENTED: Base Class'); }
set parentPlayer(player: AnimationPlayer) { throw new BaseException('NOT IMPLEMENTED: Base Class'); }
@ -17,7 +17,7 @@ export abstract class AnimationPlayer {
export class NoOpAnimationPlayer implements AnimationPlayer {
private _subscriptions = [];
private _subscriptions: any[] /** TODO #9100 */ = [];
public parentPlayer: AnimationPlayer = null;
constructor() {
scheduleMicroTask(() => this._onFinish());
@ -36,6 +36,6 @@ export class NoOpAnimationPlayer implements AnimationPlayer {
}
destroy(): void {}
reset(): void {}
setPosition(p): void {}
setPosition(p: any /** TODO #9100 */): void {}
getPosition(): number { return 0; }
}

View File

@ -72,7 +72,7 @@ export class AnimationSequencePlayer implements AnimationPlayer {
this._players.forEach(player => player.destroy());
}
setPosition(p): void {
setPosition(p: any /** TODO #9100 */): void {
this._players[0].setPosition(p);
}

View File

@ -5,14 +5,14 @@ import {FILL_STYLE_FLAG} from './animation_constants';
export function balanceAnimationStyles(previousStyles: {[key: string]: string|number},
newStyles: {[key: string]: string|number},
nullValue = null): {[key: string]: string} {
nullValue: any /** TODO #9100 */ = null): {[key: string]: string} {
var finalStyles: {[key: string]: string} = {};
StringMapWrapper.forEach(newStyles, (value, prop) => {
StringMapWrapper.forEach(newStyles, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
finalStyles[prop] = value.toString();
});
StringMapWrapper.forEach(previousStyles, (value, prop) => {
StringMapWrapper.forEach(previousStyles, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
if (!isPresent(finalStyles[prop])) {
finalStyles[prop] = nullValue;
}
@ -32,12 +32,12 @@ export function balanceAnimationKeyframes(collectedStyles: {[key: string]: strin
var extraFirstKeyframeStyles = {};
var hasExtraFirstStyles = false;
StringMapWrapper.forEach(collectedStyles, (value, prop) => {
StringMapWrapper.forEach(collectedStyles, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
// if the style is already defined in the first keyframe then
// we do not replace it.
if (!flatenedFirstKeyframeStyles[prop]) {
flatenedFirstKeyframeStyles[prop] = value;
extraFirstKeyframeStyles[prop] = value;
if (!(flatenedFirstKeyframeStyles as any /** TODO #9100 */)[prop]) {
(flatenedFirstKeyframeStyles as any /** TODO #9100 */)[prop] = value;
(extraFirstKeyframeStyles as any /** TODO #9100 */)[prop] = value;
hasExtraFirstStyles = true;
}
});
@ -51,9 +51,9 @@ export function balanceAnimationKeyframes(collectedStyles: {[key: string]: strin
var flatenedFinalKeyframeStyles = flattenStyles(finalKeyframe.styles.styles);
var extraFinalKeyframeStyles = {};
var hasExtraFinalStyles = false;
StringMapWrapper.forEach(keyframeCollectedStyles, (value, prop) => {
if (!isPresent(flatenedFinalKeyframeStyles[prop])) {
extraFinalKeyframeStyles[prop] = AUTO_STYLE;
StringMapWrapper.forEach(keyframeCollectedStyles, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
if (!isPresent((flatenedFinalKeyframeStyles as any /** TODO #9100 */)[prop])) {
(extraFinalKeyframeStyles as any /** TODO #9100 */)[prop] = AUTO_STYLE;
hasExtraFinalStyles = true;
}
});
@ -62,9 +62,9 @@ export function balanceAnimationKeyframes(collectedStyles: {[key: string]: strin
finalKeyframe.styles.styles.push(extraFinalKeyframeStyles);
}
StringMapWrapper.forEach(flatenedFinalKeyframeStyles, (value, prop) => {
if (!isPresent(flatenedFirstKeyframeStyles[prop])) {
extraFirstKeyframeStyles[prop] = AUTO_STYLE;
StringMapWrapper.forEach(flatenedFinalKeyframeStyles, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
if (!isPresent((flatenedFirstKeyframeStyles as any /** TODO #9100 */)[prop])) {
(extraFirstKeyframeStyles as any /** TODO #9100 */)[prop] = AUTO_STYLE;
hasExtraFirstStyles = true;
}
});
@ -87,7 +87,7 @@ export function clearStyles(styles: {[key: string]: string|number}): {[key: stri
export function collectAndResolveStyles(collection: {[key: string]: string|number}, styles: {[key: string]: string|number}[]) {
return styles.map(entry => {
var stylesObj = {};
StringMapWrapper.forEach(entry, (value, prop) => {
StringMapWrapper.forEach(entry, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
if (value == FILL_STYLE_FLAG) {
value = collection[prop];
if (!isPresent(value)) {
@ -95,14 +95,14 @@ export function collectAndResolveStyles(collection: {[key: string]: string|numbe
}
}
collection[prop] = value;
stylesObj[prop] = value;
(stylesObj as any /** TODO #9100 */)[prop] = value;
});
return stylesObj;
});
}
export function renderStyles(element: any, renderer: any, styles: {[key: string]: string|number}): void {
StringMapWrapper.forEach(styles, (value, prop) => {
StringMapWrapper.forEach(styles, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
renderer.setElementStyle(element, prop, value);
});
}
@ -110,8 +110,8 @@ export function renderStyles(element: any, renderer: any, styles: {[key: string]
export function flattenStyles(styles: {[key: string]: string|number}[]) {
var finalStyles = {};
styles.forEach(entry => {
StringMapWrapper.forEach(entry, (value, prop) => {
finalStyles[prop] = value;
StringMapWrapper.forEach(entry, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
(finalStyles as any /** TODO #9100 */)[prop] = value;
});
});
return finalStyles;

View File

@ -263,7 +263,7 @@ export function style(tokens: string|{[key: string]: string | number}|Array<stri
input = [<{[key: string]: string | number}>tokens];
}
input.forEach(entry => {
var entryOffset = entry['offset'];
var entryOffset = (entry as any /** TODO #9100 */)['offset'];
if (isPresent(entryOffset)) {
offset = offset == null ? NumberWrapper.parseFloat(entryOffset) : offset;
}