diff --git a/mithril.d.ts b/mithril.d.ts index 85aae717..023b4c3d 100644 --- a/mithril.d.ts +++ b/mithril.d.ts @@ -20,12 +20,10 @@ declare namespace Mithril { * @see m.mount * @see m.component */ - ( + ( selector: string, attributes: Attributes, - ...children: Array> + ...children: Array> ): VirtualElement; /** @@ -56,11 +54,9 @@ declare namespace Mithril { * @see m.mount * @see m.component */ - ( + ( selector: string, - ...children: Array> + ...children: Array> ): VirtualElement; /** @@ -193,7 +189,7 @@ declare namespace Mithril { * @param forceRecreation If true, overwrite the entire tree without * diffing against it. */ - render( + render( rootElement: Element, children: VirtualElement|VirtualElement[], forceRecreation?: boolean @@ -260,7 +256,7 @@ declare namespace Mithril { * @param defaultRoute The route to start with. * @param routes A key-value mapping of pathname to controller. */ - ( + ( rootElement: Element, defaultRoute: string, routes: Routes @@ -276,7 +272,7 @@ declare namespace Mithril { * m("a[href='/dashboard/alicesmith']", {config: m.route}); * ``` */ - ( + ( element: Element, isInitialized: boolean, context?: Context, @@ -515,7 +511,7 @@ declare namespace Mithril { * @param context The associated context for this element. * @param vdom The associated virtual element. */ - ( + ( element: Element, isInitialized: boolean, context: Context, @@ -583,7 +579,7 @@ declare namespace Mithril { * @see ControllerFunction */ interface ControllerConstructor { - new(): T; + new (): T; } /** @@ -608,8 +604,7 @@ declare namespace Mithril { * * @see m.component */ - controller: ControllerFunction | - ControllerConstructor; + controller: ControllerFunction | ControllerConstructor; /** * Creates a view out of virtual elements. @@ -741,7 +736,7 @@ declare namespace Mithril { interface Thennable { then(success: (value: T) => U): Thennable; then(success: (value: T) => U, error: (value: Error) => V): Thennable|Thennable; - catch?: (error: (value: Error) => U) => Thennable; + catch?(error: (value: Error) => U): Thennable; } /** @@ -777,8 +772,7 @@ declare namespace Mithril { * @param error The callback to call when the promise is rejected. * @return The chained promise. */ - catch(error: ErrorCallback): Promise | - Promise; + catch(error: ErrorCallback): Promise | Promise; } /** @@ -918,7 +912,7 @@ declare namespace Mithril { } } -declare var m: Mithril.Static; +declare const m: Mithril.Static; declare module "mithril" { export = m;