refactor(core): ts’ify core
This commit is contained in:
@ -2,15 +2,11 @@ import {TestabilityRegistry, Testability} from 'angular2/src/core/testability/te
|
||||
import {global} from 'angular2/src/facade/lang';
|
||||
|
||||
class PublicTestability {
|
||||
_testabililty: Testability;
|
||||
_testability: Testability;
|
||||
|
||||
constructor(testability: Testability) {
|
||||
this._testability = testability;
|
||||
}
|
||||
constructor(testability: Testability) { this._testability = testability; }
|
||||
|
||||
whenStable(callback: Function) {
|
||||
this._testability.whenStable(callback);
|
||||
}
|
||||
whenStable(callback: Function) { this._testability.whenStable(callback); }
|
||||
|
||||
findBindings(using, binding: string, exactMatch: boolean) {
|
||||
return this._testability.findBindings(using, binding, exactMatch);
|
@ -1,8 +1,8 @@
|
||||
import {Injectable} from 'angular2/src/di/annotations_impl';
|
||||
import {Injectable} from 'angular2/di';
|
||||
import {DOM} from 'angular2/src/dom/dom_adapter';
|
||||
import {Map, MapWrapper, List, ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {StringWrapper, isBlank, BaseException} from 'angular2/src/facade/lang';
|
||||
import * as getTestabilityModule from 'angular2/src/core/testability/get_testability';
|
||||
import * as getTestabilityModule from './get_testability';
|
||||
|
||||
|
||||
/**
|
||||
@ -13,7 +13,7 @@ import * as getTestabilityModule from 'angular2/src/core/testability/get_testabi
|
||||
@Injectable()
|
||||
export class Testability {
|
||||
_pendingCount: number;
|
||||
_callbacks: List;
|
||||
_callbacks: List<Function>;
|
||||
|
||||
constructor() {
|
||||
this._pendingCount = 0;
|
||||
@ -45,11 +45,9 @@ export class Testability {
|
||||
// TODO(juliemr) - hook into the zone api.
|
||||
}
|
||||
|
||||
getPendingCount(): number {
|
||||
return this._pendingCount;
|
||||
}
|
||||
getPendingCount(): number { return this._pendingCount; }
|
||||
|
||||
findBindings(using, binding: string, exactMatch: boolean): List {
|
||||
findBindings(using, binding: string, exactMatch: boolean): List<any> {
|
||||
// TODO(juliemr): implement.
|
||||
return [];
|
||||
}
|
||||
@ -57,7 +55,7 @@ export class Testability {
|
||||
|
||||
@Injectable()
|
||||
export class TestabilityRegistry {
|
||||
_applications: Map;
|
||||
_applications: Map<any, Testability>;
|
||||
|
||||
constructor() {
|
||||
this._applications = MapWrapper.create();
|
||||
@ -69,7 +67,7 @@ export class TestabilityRegistry {
|
||||
MapWrapper.set(this._applications, token, testability);
|
||||
}
|
||||
|
||||
findTestabilityInTree(elem) : Testability {
|
||||
findTestabilityInTree(elem): Testability {
|
||||
if (elem == null) {
|
||||
return null;
|
||||
}
|
Reference in New Issue
Block a user