Made it possible to use TypeScript class as a controller

This commit is contained in:
Chris Bowdon 2015-02-14 13:31:50 +00:00
parent a48cf080f4
commit a5667ff341

7
mithril.d.ts vendored
View file

@ -83,16 +83,19 @@ interface MithrilEvent {
}
interface MithrilController {
(): any;
onunload?(evt: Event): any;
}
interface MithrilControllerFunction extends MithrilController {
(): any;
}
interface MithrilView<T extends MithrilController> {
(ctrl: T): string|MithrilVirtualElement;
}
interface MithrilModule<T extends MithrilController> {
controller: T;
controller: MithrilControllerFunction|{ new(): T };
view: MithrilView<T>;
}