diff --git a/mithril.d.ts b/mithril.d.ts index 784ea6bb..c9763a96 100644 --- a/mithril.d.ts +++ b/mithril.d.ts @@ -2,8 +2,8 @@ declare module _mithril { interface MithrilStatic { - (selector: string, attributes: MithrilAttributes, ...children: Array): MithrilVirtualElement; - (selector: string, ...children: Array): MithrilVirtualElement; + (selector: string, attributes: MithrilAttributes, ...children: Array>): MithrilVirtualElement; + (selector: string, ...children: Array>): MithrilVirtualElement; prop(promise: MithrilPromise) : MithrilPromiseProperty; prop(value: T): MithrilProperty; @@ -11,9 +11,13 @@ declare module _mithril { withAttr(property: string, callback: (value: any) => void): (e: MithrilEvent) => any; - module(rootElement: Node, module: MithrilModule): T; + module(rootElement: Node, component: MithrilComponent): T; module(rootElement: Node): T; + mount(rootElement: Node, component: MithrilComponent): T; + mount(rootElement: Node): T; + component(component: MithrilComponent, ...args: Array): MithrilComponent + trust(html: string): string; render(rootElement: Element|HTMLDocument): void; @@ -96,7 +100,7 @@ declare module _mithril { (ctrl: T): string|MithrilVirtualElement; } - interface MithrilModule { + interface MithrilComponent { controller: MithrilControllerFunction|{ new(): T }; view: MithrilView; } @@ -114,7 +118,7 @@ declare module _mithril { } interface MithrilRoutes { - [key: string]: MithrilModule; + [key: string]: MithrilComponent; }