fix(build): add missing return types now enforced by linter
This commit is contained in:
@ -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); };
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user