fix(build): add missing return types now enforced by linter
This commit is contained in:
@ -42,7 +42,7 @@ export class Attribute extends DependencyAnnotation {
|
||||
// account.
|
||||
return this;
|
||||
}
|
||||
toString() { return `@Attribute(${stringify(this.attributeName)})`; }
|
||||
toString(): string { return `@Attribute(${stringify(this.attributeName)})`; }
|
||||
}
|
||||
|
||||
/**
|
||||
@ -67,5 +67,5 @@ export class Query extends DependencyAnnotation {
|
||||
|
||||
get varBindings(): List<string> { return StringWrapper.split(this.selector, new RegExp(",")); }
|
||||
|
||||
toString() { return `@Query(${stringify(this.selector)})`; }
|
||||
toString(): string { return `@Query(${stringify(this.selector)})`; }
|
||||
}
|
||||
|
@ -326,7 +326,7 @@ export class ApplicationRef {
|
||||
|
||||
dispose() {
|
||||
// TODO: We also need to clean up the Zone, ... here!
|
||||
return this._hostComponent.dispose();
|
||||
this._hostComponent.dispose();
|
||||
}
|
||||
|
||||
get injector() { return this._injector; }
|
||||
|
@ -14,7 +14,7 @@ export class BaseQueryList<T> {
|
||||
protected _callbacks = [];
|
||||
protected _dirty = false;
|
||||
|
||||
[Symbol.iterator]() { return this._results[Symbol.iterator](); }
|
||||
[Symbol.iterator](): any { return this._results[Symbol.iterator](); }
|
||||
|
||||
reset(newList) {
|
||||
this._results = newList;
|
||||
@ -33,9 +33,9 @@ export class BaseQueryList<T> {
|
||||
}
|
||||
}
|
||||
|
||||
onChange(callback) { this._callbacks.push(callback); }
|
||||
onChange(callback): void { this._callbacks.push(callback); }
|
||||
|
||||
removeCallback(callback) { ListWrapper.remove(this._callbacks, callback); }
|
||||
removeCallback(callback): void { ListWrapper.remove(this._callbacks, callback); }
|
||||
|
||||
get length() { return this._results.length; }
|
||||
get first() { return ListWrapper.first(this._results); }
|
||||
|
@ -19,11 +19,11 @@ export class ElementBinder {
|
||||
}
|
||||
}
|
||||
|
||||
hasStaticComponent() {
|
||||
hasStaticComponent(): boolean {
|
||||
return isPresent(this.componentDirective) && isPresent(this.nestedProtoView);
|
||||
}
|
||||
|
||||
hasEmbeddedProtoView() {
|
||||
hasEmbeddedProtoView(): boolean {
|
||||
return !isPresent(this.componentDirective) && isPresent(this.nestedProtoView);
|
||||
}
|
||||
}
|
||||
|
@ -190,11 +190,13 @@ export class DirectiveDependency extends Dependency {
|
||||
}
|
||||
|
||||
static _attributeName(properties): string {
|
||||
var p = ListWrapper.find(properties, (p) => p instanceof Attribute);
|
||||
var p = <Attribute>ListWrapper.find(properties, (p) => p instanceof Attribute);
|
||||
return isPresent(p) ? p.attributeName : null;
|
||||
}
|
||||
|
||||
static _query(properties) { return ListWrapper.find(properties, (p) => p instanceof Query); }
|
||||
static _query(properties): Query {
|
||||
return <Query>ListWrapper.find(properties, (p) => p instanceof Query);
|
||||
}
|
||||
}
|
||||
|
||||
export class DirectiveBinding extends ResolvedBinding {
|
||||
@ -292,7 +294,7 @@ export class PreBuiltObjects {
|
||||
export class EventEmitterAccessor {
|
||||
constructor(public eventName: string, public getter: Function) {}
|
||||
|
||||
subscribe(view: viewModule.AppView, boundElementIndex: number, directive: Object) {
|
||||
subscribe(view: viewModule.AppView, boundElementIndex: number, directive: Object): Object {
|
||||
var eventEmitter = this.getter(directive);
|
||||
return ObservableWrapper.subscribe(
|
||||
eventEmitter,
|
||||
@ -303,7 +305,7 @@ export class EventEmitterAccessor {
|
||||
export class HostActionAccessor {
|
||||
constructor(public methodName: string, public getter: Function) {}
|
||||
|
||||
subscribe(view: viewModule.AppView, boundElementIndex: number, directive: Object) {
|
||||
subscribe(view: viewModule.AppView, boundElementIndex: number, directive: Object): Object {
|
||||
var eventEmitter = this.getter(directive);
|
||||
return ObservableWrapper.subscribe(
|
||||
eventEmitter,
|
||||
@ -314,9 +316,9 @@ export class HostActionAccessor {
|
||||
export class BindingData {
|
||||
constructor(public binding: ResolvedBinding, public visibility: number) {}
|
||||
|
||||
getKeyId() { return this.binding.key.id; }
|
||||
getKeyId(): number { return this.binding.key.id; }
|
||||
|
||||
createEventEmitterAccessors() {
|
||||
createEventEmitterAccessors(): List<EventEmitterAccessor> {
|
||||
if (!(this.binding instanceof DirectiveBinding)) return [];
|
||||
var db = <DirectiveBinding>this.binding;
|
||||
return ListWrapper.map(db.eventEmitters, eventConfig => {
|
||||
@ -331,11 +333,11 @@ export class BindingData {
|
||||
// short format: 'name' when fieldName and eventName are the same
|
||||
fieldName = eventName = eventConfig;
|
||||
}
|
||||
return new EventEmitterAccessor(eventName, reflector.getter(fieldName))
|
||||
return new EventEmitterAccessor(eventName, reflector.getter(fieldName));
|
||||
});
|
||||
}
|
||||
|
||||
createHostActionAccessors() {
|
||||
createHostActionAccessors(): HostActionAccessor[] {
|
||||
if (!(this.binding instanceof DirectiveBinding)) return [];
|
||||
var res = [];
|
||||
var db = <DirectiveBinding>this.binding;
|
||||
@ -355,7 +357,7 @@ export class ProtoElementInjector {
|
||||
|
||||
static create(parent: ProtoElementInjector, index: number, bindings: List<ResolvedBinding>,
|
||||
firstBindingIsComponent: boolean, distanceToParent: number,
|
||||
directiveVariableBindings: Map<string, number>) {
|
||||
directiveVariableBindings: Map<string, number>): ProtoElementInjector {
|
||||
var bd = [];
|
||||
|
||||
ProtoElementInjector._createDirectiveBindingData(bindings, bd, firstBindingIsComponent);
|
||||
@ -808,7 +810,7 @@ export class ElementInjector extends TreeNode<ElementInjector> {
|
||||
}
|
||||
}
|
||||
|
||||
getDirectiveAtIndex(index: number) { return this._injector.getObjAtIndex(index); }
|
||||
getDirectiveAtIndex(index: number): any { return this._injector.getObjAtIndex(index); }
|
||||
|
||||
hasInstances(): boolean { return this._proto.hasBindings && this.hydrated; }
|
||||
|
||||
|
@ -286,12 +286,14 @@ function _collectNestedProtoViewsVariableNames(
|
||||
return nestedPvVariableNames;
|
||||
}
|
||||
|
||||
function _createVariableNames(parentVariableNames, renderProtoView): List<string> {
|
||||
var res = isBlank(parentVariableNames) ? [] : ListWrapper.clone(parentVariableNames);
|
||||
function _createVariableNames(parentVariableNames: List<string>, renderProtoView): List<string> {
|
||||
var res =
|
||||
isBlank(parentVariableNames) ? <List<string>>[] : ListWrapper.clone(parentVariableNames);
|
||||
MapWrapper.forEach(renderProtoView.variableBindings,
|
||||
(mappedName, varName) => { res.push(mappedName); });
|
||||
ListWrapper.forEach(renderProtoView.elementBinders, binder => {
|
||||
MapWrapper.forEach(binder.variableBindings, (mappedName, varName) => { res.push(mappedName); });
|
||||
MapWrapper.forEach(binder.variableBindings,
|
||||
(mappedName: string, varName: string) => { res.push(mappedName); });
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
@ -78,9 +78,9 @@ import {BaseQueryList} from './base_query_list';
|
||||
export class QueryList<T> extends BaseQueryList<T> {
|
||||
/**
|
||||
*/
|
||||
onChange(callback) { return super.onChange(callback); }
|
||||
onChange(callback) { super.onChange(callback); }
|
||||
|
||||
/**
|
||||
*/
|
||||
removeCallback(callback) { return super.removeCallback(callback); }
|
||||
removeCallback(callback) { super.removeCallback(callback); }
|
||||
}
|
||||
|
@ -134,12 +134,12 @@ export class AppView implements ChangeDispatcher, EventDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
getDirectiveFor(directive: DirectiveIndex) {
|
||||
getDirectiveFor(directive: DirectiveIndex): any {
|
||||
var elementInjector = this.elementInjectors[directive.elementIndex];
|
||||
return elementInjector.getDirectiveAtIndex(directive.directiveIndex);
|
||||
}
|
||||
|
||||
getDetectorFor(directive: DirectiveIndex) {
|
||||
getDetectorFor(directive: DirectiveIndex): any {
|
||||
var childView = this.componentChildViews[directive.elementIndex];
|
||||
return isPresent(childView) ? childView.changeDetector : null;
|
||||
}
|
||||
|
@ -42,7 +42,9 @@ export class ViewContainerRef {
|
||||
return this.viewManager.attachViewInContainer(this.element, atIndex, viewRef);
|
||||
}
|
||||
|
||||
indexOf(viewRef: ViewRef) { return ListWrapper.indexOf(this._getViews(), internalView(viewRef)); }
|
||||
indexOf(viewRef: ViewRef): number {
|
||||
return ListWrapper.indexOf(this._getViews(), internalView(viewRef));
|
||||
}
|
||||
|
||||
remove(atIndex: number = -1): void {
|
||||
if (atIndex == -1) atIndex = this.length - 1;
|
||||
|
@ -8,7 +8,7 @@ class PublicTestability {
|
||||
|
||||
whenStable(callback: Function) { this._testability.whenStable(callback); }
|
||||
|
||||
findBindings(using, binding: string, exactMatch: boolean) {
|
||||
findBindings(using, binding: string, exactMatch: boolean): List<any> {
|
||||
return this._testability.findBindings(using, binding, exactMatch);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export class Testability {
|
||||
this._callbacks = [];
|
||||
}
|
||||
|
||||
increaseCount(delta: number = 1) {
|
||||
increaseCount(delta: number = 1): number {
|
||||
this._pendingCount += delta;
|
||||
if (this._pendingCount < 0) {
|
||||
throw new BaseException('pending async requests below zero');
|
||||
|
@ -103,7 +103,7 @@ export class NgZone {
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
run(fn) {
|
||||
run(fn): any {
|
||||
if (this._disabled) {
|
||||
return fn();
|
||||
} else {
|
||||
@ -127,7 +127,7 @@ export class NgZone {
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
runOutsideAngular(fn) {
|
||||
runOutsideAngular(fn): any {
|
||||
if (this._disabled) {
|
||||
return fn();
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user