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

@ -45,7 +45,7 @@ export class ClientMessageBroker_ extends ClientMessageBroker {
/** @internal */
public _serializer: Serializer;
constructor(messageBus: MessageBus, _serializer: Serializer, public channel) {
constructor(messageBus: MessageBus, _serializer: Serializer, public channel: any /** TODO #9100 */) {
super();
this._sink = messageBus.to(channel);
this._serializer = _serializer;
@ -58,7 +58,7 @@ export class ClientMessageBroker_ extends ClientMessageBroker {
var time: string = stringify(DateWrapper.toMillis(DateWrapper.now()));
var iteration: number = 0;
var id: string = name + time + stringify(iteration);
while (isPresent(this._pending[id])) {
while (isPresent((this as any /** TODO #9100 */)._pending[id])) {
id = `${name}${time}${iteration}`;
iteration++;
}
@ -66,7 +66,7 @@ export class ClientMessageBroker_ extends ClientMessageBroker {
}
runOnService(args: UiArguments, returnType: Type): Promise<any> {
var fnArgs = [];
var fnArgs: any[] /** TODO #9100 */ = [];
if (isPresent(args.args)) {
args.args.forEach(argument => {
if (argument.type != null) {
@ -102,7 +102,7 @@ export class ClientMessageBroker_ extends ClientMessageBroker {
// TODO(jteplitz602): Create a class for these messages so we don't keep using StringMap #3685
var message = {'method': args.method, 'args': fnArgs};
if (id != null) {
message['id'] = id;
(message as any /** TODO #9100 */)['id'] = id;
}
ObservableWrapper.callEmit(this._sink, message);
@ -151,7 +151,7 @@ class MessageData {
}
export class FnArg {
constructor(public value, public type: Type) {}
constructor(public value: any /** TODO #9100 */, public type: Type) {}
}
export class UiArguments {

View File

@ -43,7 +43,7 @@ export class ServiceMessageBroker_ extends ServiceMessageBroker {
private _sink: EventEmitter<any>;
private _methods: Map<string, Function> = new Map<string, Function>();
constructor(messageBus: MessageBus, private _serializer: Serializer, public channel) {
constructor(messageBus: MessageBus, private _serializer: Serializer, public channel: any /** TODO #9100 */) {
super();
this._sink = messageBus.to(channel);
var source = messageBus.from(channel);

View File

@ -13,7 +13,7 @@ export class EventDispatcher {
constructor(private _sink: EventEmitter<any>, private _serializer: Serializer) {}
dispatchRenderEvent(element: any, eventTarget: string, eventName: string, event: any): boolean {
var serializedEvent;
var serializedEvent: any /** TODO #9100 */;
// TODO (jteplitz602): support custom events #3350
switch (event.type) {
case "click":

View File

@ -80,7 +80,7 @@ function serializeEvent(e: any, properties: string[]): {[key: string]: any} {
var serialized = {};
for (var i = 0; i < properties.length; i++) {
var prop = properties[i];
serialized[prop] = e[prop];
(serialized as any /** TODO #9100 */)[prop] = e[prop];
}
return serialized;
}

View File

@ -155,7 +155,7 @@ export class MessageBasedRenderer {
private _listen(renderer: Renderer, renderElement: any, eventName: string, unlistenId: number) {
var unregisterCallback = renderer.listen(renderElement, eventName,
(event) => this._eventDispatcher.dispatchRenderEvent(
(event: any /** TODO #9100 */) => this._eventDispatcher.dispatchRenderEvent(
renderElement, null, eventName, event));
this._renderStore.store(unregisterCallback, unlistenId);
}
@ -164,7 +164,7 @@ export class MessageBasedRenderer {
unlistenId: number) {
var unregisterCallback = renderer.listenGlobal(
eventTarget, eventName,
(event) => this._eventDispatcher.dispatchRenderEvent(null, eventTarget, eventName, event));
(event: any /** TODO #9100 */) => this._eventDispatcher.dispatchRenderEvent(null, eventTarget, eventName, event));
this._renderStore.store(unregisterCallback, unlistenId);
}

View File

@ -20,7 +20,7 @@ import {AnimationKeyframe, AnimationPlayer, AnimationStyles, RenderDebugInfo} fr
@Injectable()
export class WebWorkerRootRenderer implements RootRenderer {
private _messageBroker;
private _messageBroker: any /** TODO #9100 */;
public globalEvents: NamedEventEmitter = new NamedEventEmitter();
private _componentRenderers: Map<string, WebWorkerRenderer> =
new Map<string, WebWorkerRenderer>();

View File

@ -9,7 +9,7 @@ import {DomAdapter, setRootDomAdapter} from '../../dom/dom_adapter';
export class WorkerDomAdapter extends DomAdapter {
static makeCurrent() { setRootDomAdapter(new WorkerDomAdapter()); }
logError(error) {
logError(error: any /** TODO #9100 */) {
if (console.error) {
console.error(error);
} else {
@ -17,9 +17,9 @@ export class WorkerDomAdapter extends DomAdapter {
}
}
log(error) { console.log(error); }
log(error: any /** TODO #9100 */) { console.log(error); }
logGroup(error) {
logGroup(error: any /** TODO #9100 */) {
if (console.group) {
console.group(error);
this.logError(error);
@ -34,7 +34,7 @@ export class WorkerDomAdapter extends DomAdapter {
}
}
hasProperty(element, name: string): boolean { throw "not implemented"; }
hasProperty(element: any /** TODO #9100 */, name: string): boolean { throw "not implemented"; }
setProperty(el: Element, name: string, value: any) { throw "not implemented"; }
getProperty(el: Element, name: string): any { throw "not implemented"; }
invoke(el: Element, methodName: string, args: any[]): any { throw "not implemented"; }
@ -46,94 +46,94 @@ export class WorkerDomAdapter extends DomAdapter {
parse(templateHtml: string) { throw "not implemented"; }
query(selector: string): any { throw "not implemented"; }
querySelector(el, selector: string): HTMLElement { throw "not implemented"; }
querySelectorAll(el, selector: string): any[] { throw "not implemented"; }
on(el, evt, listener) { throw "not implemented"; }
onAndCancel(el, evt, listener): Function { throw "not implemented"; }
dispatchEvent(el, evt) { throw "not implemented"; }
createMouseEvent(eventType): any { throw "not implemented"; }
querySelector(el: any /** TODO #9100 */, selector: string): HTMLElement { throw "not implemented"; }
querySelectorAll(el: any /** TODO #9100 */, selector: string): any[] { throw "not implemented"; }
on(el: any /** TODO #9100 */, evt: any /** TODO #9100 */, listener: any /** TODO #9100 */) { throw "not implemented"; }
onAndCancel(el: any /** TODO #9100 */, evt: any /** TODO #9100 */, listener: any /** TODO #9100 */): Function { throw "not implemented"; }
dispatchEvent(el: any /** TODO #9100 */, evt: any /** TODO #9100 */) { throw "not implemented"; }
createMouseEvent(eventType: any /** TODO #9100 */): any { throw "not implemented"; }
createEvent(eventType: string): any { throw "not implemented"; }
preventDefault(evt) { throw "not implemented"; }
isPrevented(evt): boolean { throw "not implemented"; }
getInnerHTML(el): string { throw "not implemented"; }
getTemplateContent(el): any { throw "not implemented"; }
getOuterHTML(el): string { throw "not implemented"; }
nodeName(node): string { throw "not implemented"; }
nodeValue(node): string { throw "not implemented"; }
type(node): string { throw "not implemented"; }
content(node): any { throw "not implemented"; }
firstChild(el): Node { throw "not implemented"; }
nextSibling(el): Node { throw "not implemented"; }
parentElement(el): Node { throw "not implemented"; }
childNodes(el): Node[] { throw "not implemented"; }
childNodesAsList(el): Node[] { throw "not implemented"; }
clearNodes(el) { throw "not implemented"; }
appendChild(el, node) { throw "not implemented"; }
removeChild(el, node) { throw "not implemented"; }
replaceChild(el, newNode, oldNode) { throw "not implemented"; }
remove(el): Node { throw "not implemented"; }
insertBefore(el, node) { throw "not implemented"; }
insertAllBefore(el, nodes) { throw "not implemented"; }
insertAfter(el, node) { throw "not implemented"; }
setInnerHTML(el, value) { throw "not implemented"; }
getText(el): string { throw "not implemented"; }
setText(el, value: string) { throw "not implemented"; }
getValue(el): string { throw "not implemented"; }
setValue(el, value: string) { throw "not implemented"; }
getChecked(el): boolean { throw "not implemented"; }
setChecked(el, value: boolean) { throw "not implemented"; }
preventDefault(evt: any /** TODO #9100 */) { throw "not implemented"; }
isPrevented(evt: any /** TODO #9100 */): boolean { throw "not implemented"; }
getInnerHTML(el: any /** TODO #9100 */): string { throw "not implemented"; }
getTemplateContent(el: any /** TODO #9100 */): any { throw "not implemented"; }
getOuterHTML(el: any /** TODO #9100 */): string { throw "not implemented"; }
nodeName(node: any /** TODO #9100 */): string { throw "not implemented"; }
nodeValue(node: any /** TODO #9100 */): string { throw "not implemented"; }
type(node: any /** TODO #9100 */): string { throw "not implemented"; }
content(node: any /** TODO #9100 */): any { throw "not implemented"; }
firstChild(el: any /** TODO #9100 */): Node { throw "not implemented"; }
nextSibling(el: any /** TODO #9100 */): Node { throw "not implemented"; }
parentElement(el: any /** TODO #9100 */): Node { throw "not implemented"; }
childNodes(el: any /** TODO #9100 */): Node[] { throw "not implemented"; }
childNodesAsList(el: any /** TODO #9100 */): Node[] { throw "not implemented"; }
clearNodes(el: any /** TODO #9100 */) { throw "not implemented"; }
appendChild(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw "not implemented"; }
removeChild(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw "not implemented"; }
replaceChild(el: any /** TODO #9100 */, newNode: any /** TODO #9100 */, oldNode: any /** TODO #9100 */) { throw "not implemented"; }
remove(el: any /** TODO #9100 */): Node { throw "not implemented"; }
insertBefore(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw "not implemented"; }
insertAllBefore(el: any /** TODO #9100 */, nodes: any /** TODO #9100 */) { throw "not implemented"; }
insertAfter(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw "not implemented"; }
setInnerHTML(el: any /** TODO #9100 */, value: any /** TODO #9100 */) { throw "not implemented"; }
getText(el: any /** TODO #9100 */): string { throw "not implemented"; }
setText(el: any /** TODO #9100 */, value: string) { throw "not implemented"; }
getValue(el: any /** TODO #9100 */): string { throw "not implemented"; }
setValue(el: any /** TODO #9100 */, value: string) { throw "not implemented"; }
getChecked(el: any /** TODO #9100 */): boolean { throw "not implemented"; }
setChecked(el: any /** TODO #9100 */, value: boolean) { throw "not implemented"; }
createComment(text: string): any { throw "not implemented"; }
createTemplate(html): HTMLElement { throw "not implemented"; }
createElement(tagName, doc?): HTMLElement { throw "not implemented"; }
createElementNS(ns: string, tagName: string, doc?): Element { throw "not implemented"; }
createTextNode(text: string, doc?): Text { throw "not implemented"; }
createScriptTag(attrName: string, attrValue: string, doc?): HTMLElement {
createTemplate(html: any /** TODO #9100 */): HTMLElement { throw "not implemented"; }
createElement(tagName: any /** TODO #9100 */, doc?: any /** TODO #9100 */): HTMLElement { throw "not implemented"; }
createElementNS(ns: string, tagName: string, doc?: any /** TODO #9100 */): Element { throw "not implemented"; }
createTextNode(text: string, doc?: any /** TODO #9100 */): Text { throw "not implemented"; }
createScriptTag(attrName: string, attrValue: string, doc?: any /** TODO #9100 */): HTMLElement {
throw "not implemented";
}
createStyleElement(css: string, doc?): HTMLStyleElement { throw "not implemented"; }
createShadowRoot(el): any { throw "not implemented"; }
getShadowRoot(el): any { throw "not implemented"; }
getHost(el): any { throw "not implemented"; }
getDistributedNodes(el): Node[] { throw "not implemented"; }
createStyleElement(css: string, doc?: any /** TODO #9100 */): HTMLStyleElement { throw "not implemented"; }
createShadowRoot(el: any /** TODO #9100 */): any { throw "not implemented"; }
getShadowRoot(el: any /** TODO #9100 */): any { throw "not implemented"; }
getHost(el: any /** TODO #9100 */): any { throw "not implemented"; }
getDistributedNodes(el: any /** TODO #9100 */): Node[] { throw "not implemented"; }
clone(node: Node): Node { throw "not implemented"; }
getElementsByClassName(element, name: string): HTMLElement[] { throw "not implemented"; }
getElementsByTagName(element, name: string): HTMLElement[] { throw "not implemented"; }
classList(element): any[] { throw "not implemented"; }
addClass(element, className: string) { throw "not implemented"; }
removeClass(element, className: string) { throw "not implemented"; }
hasClass(element, className: string): boolean { throw "not implemented"; }
setStyle(element, styleName: string, styleValue: string) { throw "not implemented"; }
removeStyle(element, styleName: string) { throw "not implemented"; }
getStyle(element, styleName: string): string { throw "not implemented"; }
hasStyle(element, styleName: string, styleValue?: string): boolean { throw "not implemented"; }
tagName(element): string { throw "not implemented"; }
attributeMap(element): Map<string, string> { throw "not implemented"; }
hasAttribute(element, attribute: string): boolean { throw "not implemented"; }
hasAttributeNS(element, ns: string, attribute: string): boolean { throw "not implemented"; }
getAttribute(element, attribute: string): string { throw "not implemented"; }
getAttributeNS(element, ns: string, attribute: string): string { throw "not implemented"; }
setAttribute(element, name: string, value: string) { throw "not implemented"; }
setAttributeNS(element, ns: string, name: string, value: string) { throw "not implemented"; }
removeAttribute(element, attribute: string) { throw "not implemented"; }
removeAttributeNS(element, ns: string, attribute: string) { throw "not implemented"; }
templateAwareRoot(el) { throw "not implemented"; }
getElementsByClassName(element: any /** TODO #9100 */, name: string): HTMLElement[] { throw "not implemented"; }
getElementsByTagName(element: any /** TODO #9100 */, name: string): HTMLElement[] { throw "not implemented"; }
classList(element: any /** TODO #9100 */): any[] { throw "not implemented"; }
addClass(element: any /** TODO #9100 */, className: string) { throw "not implemented"; }
removeClass(element: any /** TODO #9100 */, className: string) { throw "not implemented"; }
hasClass(element: any /** TODO #9100 */, className: string): boolean { throw "not implemented"; }
setStyle(element: any /** TODO #9100 */, styleName: string, styleValue: string) { throw "not implemented"; }
removeStyle(element: any /** TODO #9100 */, styleName: string) { throw "not implemented"; }
getStyle(element: any /** TODO #9100 */, styleName: string): string { throw "not implemented"; }
hasStyle(element: any /** TODO #9100 */, styleName: string, styleValue?: string): boolean { throw "not implemented"; }
tagName(element: any /** TODO #9100 */): string { throw "not implemented"; }
attributeMap(element: any /** TODO #9100 */): Map<string, string> { throw "not implemented"; }
hasAttribute(element: any /** TODO #9100 */, attribute: string): boolean { throw "not implemented"; }
hasAttributeNS(element: any /** TODO #9100 */, ns: string, attribute: string): boolean { throw "not implemented"; }
getAttribute(element: any /** TODO #9100 */, attribute: string): string { throw "not implemented"; }
getAttributeNS(element: any /** TODO #9100 */, ns: string, attribute: string): string { throw "not implemented"; }
setAttribute(element: any /** TODO #9100 */, name: string, value: string) { throw "not implemented"; }
setAttributeNS(element: any /** TODO #9100 */, ns: string, name: string, value: string) { throw "not implemented"; }
removeAttribute(element: any /** TODO #9100 */, attribute: string) { throw "not implemented"; }
removeAttributeNS(element: any /** TODO #9100 */, ns: string, attribute: string) { throw "not implemented"; }
templateAwareRoot(el: any /** TODO #9100 */) { throw "not implemented"; }
createHtmlDocument(): HTMLDocument { throw "not implemented"; }
defaultDoc(): HTMLDocument { throw "not implemented"; }
getBoundingClientRect(el) { throw "not implemented"; }
getBoundingClientRect(el: any /** TODO #9100 */) { throw "not implemented"; }
getTitle(): string { throw "not implemented"; }
setTitle(newTitle: string) { throw "not implemented"; }
elementMatches(n, selector: string): boolean { throw "not implemented"; }
elementMatches(n: any /** TODO #9100 */, selector: string): boolean { throw "not implemented"; }
isTemplateElement(el: any): boolean { throw "not implemented"; }
isTextNode(node): boolean { throw "not implemented"; }
isCommentNode(node): boolean { throw "not implemented"; }
isElementNode(node): boolean { throw "not implemented"; }
hasShadowRoot(node): boolean { throw "not implemented"; }
isShadowRoot(node): boolean { throw "not implemented"; }
isTextNode(node: any /** TODO #9100 */): boolean { throw "not implemented"; }
isCommentNode(node: any /** TODO #9100 */): boolean { throw "not implemented"; }
isElementNode(node: any /** TODO #9100 */): boolean { throw "not implemented"; }
hasShadowRoot(node: any /** TODO #9100 */): boolean { throw "not implemented"; }
isShadowRoot(node: any /** TODO #9100 */): boolean { throw "not implemented"; }
importIntoDoc(node: Node): Node { throw "not implemented"; }
adoptNode(node: Node): Node { throw "not implemented"; }
getHref(element): string { throw "not implemented"; }
getEventKey(event): string { throw "not implemented"; }
resolveAndSetHref(element, baseUrl: string, href: string) { throw "not implemented"; }
getHref(element: any /** TODO #9100 */): string { throw "not implemented"; }
getEventKey(event: any /** TODO #9100 */): string { throw "not implemented"; }
resolveAndSetHref(element: any /** TODO #9100 */, baseUrl: string, href: string) { throw "not implemented"; }
supportsDOMEvents(): boolean { throw "not implemented"; }
supportsNativeShadowDOM(): boolean { throw "not implemented"; }
getGlobalEventTarget(target: string): any { throw "not implemented"; }
@ -142,12 +142,12 @@ export class WorkerDomAdapter extends DomAdapter {
getBaseHref(): string { throw "not implemented"; }
resetBaseElement(): void { throw "not implemented"; }
getUserAgent(): string { throw "not implemented"; }
setData(element, name: string, value: string) { throw "not implemented"; }
getComputedStyle(element): any { throw "not implemented"; }
getData(element, name: string): string { throw "not implemented"; }
setData(element: any /** TODO #9100 */, name: string, value: string) { throw "not implemented"; }
getComputedStyle(element: any /** TODO #9100 */): any { throw "not implemented"; }
getData(element: any /** TODO #9100 */, name: string): string { throw "not implemented"; }
setGlobalVar(name: string, value: any) { throw "not implemented"; }
requestAnimationFrame(callback): number { throw "not implemented"; }
cancelAnimationFrame(id) { throw "not implemented"; }
requestAnimationFrame(callback: any /** TODO #9100 */): number { throw "not implemented"; }
cancelAnimationFrame(id: any /** TODO #9100 */) { throw "not implemented"; }
performanceNow(): number { throw "not implemented"; }
getAnimationPrefix(): string { throw "not implemented"; }
getTransitionEnd(): string { throw "not implemented"; }