From a5667ff3413c3ca25541b1f8167e931579d5573b Mon Sep 17 00:00:00 2001 From: Chris Bowdon Date: Sat, 14 Feb 2015 13:31:50 +0000 Subject: [PATCH] Made it possible to use TypeScript class as a controller --- mithril.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mithril.d.ts b/mithril.d.ts index 3279b8cc..43575f08 100644 --- a/mithril.d.ts +++ b/mithril.d.ts @@ -83,16 +83,19 @@ interface MithrilEvent { } interface MithrilController { - (): any; onunload?(evt: Event): any; } +interface MithrilControllerFunction extends MithrilController { + (): any; +} + interface MithrilView { (ctrl: T): string|MithrilVirtualElement; } interface MithrilModule { - controller: T; + controller: MithrilControllerFunction|{ new(): T }; view: MithrilView; }