diff --git a/mithril.d.ts b/mithril.d.ts index a5c24a6e..c7d2c6b6 100644 --- a/mithril.d.ts +++ b/mithril.d.ts @@ -20,13 +20,13 @@ declare module _mithril { * @see m.mount * @see m.component */ - ( + ( selector: string, attributes: MithrilAttributes, ...children: Array | - MithrilComponent> - ): MithrilVirtualElement; + MithrilVirtualElement | + MithrilComponent> + ): MithrilVirtualElement; /** * Creates a virtual element for use with m.render, m.mount, etc. @@ -40,12 +40,12 @@ declare module _mithril { * @see m.mount * @see m.component */ - ( + ( selector: string, ...children: Array | - MithrilComponent> - ): MithrilVirtualElement; + MithrilVirtualElement | + MithrilComponent> + ): MithrilVirtualElement; /** * Initializes a component for use with m.render, m.mount, etc. @@ -364,9 +364,9 @@ declare module _mithril { * @param forceRecreation If true, overwrite the entire tree without * diffing against it. */ - render( + render( rootElement: Element, - children: MithrilVirtualElement|MithrilVirtualElement[], + children: MithrilVirtualElement|MithrilVirtualElement[], forceRecreation?: boolean ): void; @@ -431,10 +431,10 @@ declare module _mithril { * @param defaultRoute The route to start with. * @param routes A key-value mapping of pathname to controller. */ - ( + ( rootElement: Element, defaultRoute: string, - routes: MithrilRoutes + routes: MithrilRoutes ): void; /** @@ -447,11 +447,11 @@ declare module _mithril { * m("a[href='/dashboard/alicesmith']", {config: m.route}); * ``` */ - ( + ( element: Element, isInitialized: boolean, context?: MithrilContext, - vdom?: MithrilVirtualElement + vdom?: MithrilVirtualElement ): void; /** @@ -615,7 +615,7 @@ declare module _mithril { * * @see m */ - interface MithrilVirtualElement { + interface MithrilVirtualElement { /** * A key to optionally associate with this element. */ @@ -634,7 +634,7 @@ declare module _mithril { /** * The children of this element. */ - children?: Array|MithrilComponent>; + children?: Array>; } /** @@ -686,11 +686,11 @@ declare module _mithril { * @param context The associated context for this element. * @param vdom The associated virtual element. */ - ( + ( element: Element, isInitialized: boolean, context: MithrilContext, - vdom: MithrilVirtualElement + vdom: MithrilVirtualElement ): void; } @@ -758,7 +758,7 @@ declare module _mithril { /** * Creates a view out of virtual elements. */ - (ctrl: T): MithrilVirtualElement; + (ctrl: T): MithrilVirtualElement; } /** @@ -781,7 +781,7 @@ declare module _mithril { * * @see m.component */ - view(ctrl: T): MithrilVirtualElement; + view(ctrl: T): MithrilVirtualElement; } /** @@ -805,7 +805,7 @@ declare module _mithril { * * @see m.component */ - view(ctrl: TController, arg1: T1, arg2: T2, arg3: T3, arg4: T4, ...args:any[]): MithrilVirtualElement; + view(ctrl: TController, arg1: T1, arg2: T2, arg3: T3, arg4: T4, ...args:any[]): MithrilVirtualElement; } /** @@ -876,12 +876,12 @@ declare module _mithril { /** * This represents a key-value mapping linking routes to components. */ - interface MithrilRoutes { + interface MithrilRoutes { /** * The key represents the route. The value represents the corresponding * component. */ - [key: string]: MithrilComponent; + [key: string]: MithrilComponent; } /**