fix(build): add missing return types now enforced by linter

This commit is contained in:
Alex Eagle
2015-06-26 11:10:52 -07:00
parent bc585f2724
commit 44891996b5
61 changed files with 467 additions and 400 deletions

View File

@ -1,5 +1,5 @@
import {Type, isPresent, BaseException, isBlank} from 'angular2/src/facade/lang';
import {List, ListWrapper, MapWrapper} from 'angular2/src/facade/collection';
import {List, ListWrapper, MapWrapper, Predicate} from 'angular2/src/facade/collection';
import {DOM} from 'angular2/src/dom/dom_adapter';
@ -90,7 +90,7 @@ export class DebugElement {
getLocal(name: string): any { return this._parentView.locals.get(name); }
/**
* Return the first descendant TestElememt matching the given predicate
* Return the first descendant TestElement matching the given predicate
* and scope.
*
* @param {Function: boolean} predicate
@ -98,7 +98,7 @@ export class DebugElement {
*
* @return {DebugElement}
*/
query(predicate: Function, scope = Scope.all): DebugElement {
query(predicate: Predicate<DebugElement>, scope = Scope.all): DebugElement {
var results = this.queryAll(predicate, scope);
return results.length > 0 ? results[0] : null;
}
@ -112,7 +112,7 @@ export class DebugElement {
*
* @return {List<DebugElement>}
*/
queryAll(predicate: Function, scope = Scope.all): List<DebugElement> {
queryAll(predicate: Predicate<DebugElement>, scope = Scope.all): List<DebugElement> {
var elementsInScope = scope(this);
return ListWrapper.filter(elementsInScope, predicate);
@ -191,10 +191,10 @@ export class Scope {
export class By {
static all(): Function { return (debugElement) => true; }
static css(selector: string): Function {
static css(selector: string): Predicate<DebugElement> {
return (debugElement) => { return DOM.elementMatches(debugElement.nativeElement, selector); };
}
static directive(type: Type): Function {
static directive(type: Type): Predicate<DebugElement> {
return (debugElement) => { return debugElement.hasDirective(type); };
}
}