Made it possible to use TypeScript class as a controller
This commit is contained in:
parent
a48cf080f4
commit
a5667ff341
1 changed files with 5 additions and 2 deletions
7
mithril.d.ts
vendored
7
mithril.d.ts
vendored
|
|
@ -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>;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue