fix(typings): repair broken typechecks
We had the typechecker disabled by accident, and many problems snuck in Fixes #4507 Closes #4508
This commit is contained in:
@ -58,7 +58,7 @@ export function CONST_EXPR<T>(expr: T): T {
|
||||
return expr;
|
||||
}
|
||||
|
||||
export function CONST(): ClassDecorator {
|
||||
export function CONST(): ClassDecorator & PropertyDecorator {
|
||||
return (target) => target;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,13 @@ export interface ClassDefinition {
|
||||
*
|
||||
* See {@link Class} for example of usage.
|
||||
*/
|
||||
constructor: (Function | any[]);
|
||||
constructor: Function | any[];
|
||||
|
||||
/**
|
||||
* Other methods on the class. Note that values should have type 'Function' but TS requires
|
||||
* all properties to have a narrower type than the index signature.
|
||||
*/
|
||||
[x: string]: Type | Function | any[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -93,7 +93,7 @@ export function main() {
|
||||
});
|
||||
|
||||
it("should throw when more than one custom accessor is provided", () => {
|
||||
var customAccessor = new SpyValueAccessor();
|
||||
var customAccessor: ControlValueAccessor = <any>new SpyValueAccessor();
|
||||
expect(() => selectValueAccessor(dir, [customAccessor, customAccessor])).toThrowError();
|
||||
});
|
||||
});
|
||||
|
@ -156,7 +156,7 @@ export function main() {
|
||||
{"one": new Control("111"), "nested": new ControlGroup({"two": new Control("222")})});
|
||||
expect(g.value).toEqual({"one": "111", "nested": {"two": "222"}});
|
||||
|
||||
g.controls["nested"].controls["two"].updateValue("333");
|
||||
(<Control>(g.controls["nested"].find("two"))).updateValue("333");
|
||||
|
||||
expect(g.value).toEqual({"one": "111", "nested": {"two": "333"}});
|
||||
});
|
||||
|
@ -11,8 +11,7 @@ import {
|
||||
xit,
|
||||
Log,
|
||||
isInInnerZone,
|
||||
browserDetection,
|
||||
TIMEOUT_INTERVAL_FOR_SLOW_BROWSERS
|
||||
browserDetection
|
||||
} from 'angular2/test_lib';
|
||||
|
||||
import {PromiseCompleter, PromiseWrapper, TimerWrapper} from 'angular2/src/core/facade/async';
|
||||
|
Reference in New Issue
Block a user