feat(build): require parameter types

Fixes #2833
This commit is contained in:
Alex Eagle
2015-07-07 20:03:00 -07:00
parent 6d760666a9
commit de18da2a0d
81 changed files with 379 additions and 290 deletions

View File

@ -30,7 +30,7 @@ export class SpyLocation extends SpyObject {
simulateUrlPop(pathname: string) { ObservableWrapper.callNext(this._subject, {'url': pathname}); }
normalizeAbsolutely(url): string { return this._baseHref + url; }
normalizeAbsolutely(url: string): string { return this._baseHref + url; }
go(url: string) {
url = this.normalizeAbsolutely(url);
@ -49,9 +49,10 @@ export class SpyLocation extends SpyObject {
// TODO
}
subscribe(onNext, onThrow = null, onReturn = null) {
subscribe(onNext: (value: any) => void, onThrow: (error: any) => void = null,
onReturn: () => void = null) {
ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
}
noSuchMethod(m) { super.noSuchMethod(m); }
noSuchMethod(m: any) { super.noSuchMethod(m); }
}

View File

@ -11,7 +11,7 @@ export class MockLocationStrategy extends LocationStrategy {
_subject: EventEmitter = new EventEmitter();
constructor() { super(); }
simulatePopState(url): void {
simulatePopState(url: string): void {
this.internalPath = url;
ObservableWrapper.callNext(this._subject, null);
}
@ -28,7 +28,7 @@ export class MockLocationStrategy extends LocationStrategy {
this.urlChanges.push(url);
}
onPopState(fn): void { ObservableWrapper.subscribe(this._subject, fn); }
onPopState(fn: (value: any) => void): void { ObservableWrapper.subscribe(this._subject, fn); }
getBaseHref(): string { return this.internalBaseHref; }
}

View File

@ -3,7 +3,7 @@ import {NgZone} from 'angular2/src/core/zone/ng_zone';
export class MockNgZone extends NgZone {
constructor() { super({enableLongStackTrace: false}); }
run(fn): any { return fn(); }
run(fn: Function): any { return fn(); }
runOutsideAngular(fn): any { return fn(); }
runOutsideAngular(fn: Function): any { return fn(); }
}