Merge pull request #460 from cbowdon/typescript_stricter_defs

Typescript stricter defs
This commit is contained in:
Leo Horie 2015-02-18 20:17:26 -05:00
commit a795c1ba1d

7
mithril.d.ts vendored
View file

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