Merge pull request #2 from impinball/next

This commit is contained in:
Isiah Meadows 2015-11-02 10:48:33 -05:00
commit 5a47705e7e

46
mithril.d.ts vendored
View file

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