document component shorthand syntax

This commit is contained in:
Leo Horie 2015-07-23 23:43:19 -04:00
parent 2b24c7a64d
commit ed3f3f0686
4 changed files with 65 additions and 0 deletions

16
mithril.d.ts vendored
View file

@ -27,6 +27,22 @@ declare module _mithril {
MithrilVirtualElement<T> |
MithrilComponent<T>>
): MithrilVirtualElement<T>;
/**
* Initializes a component for use with m.render, m.mount, etc.
*
* @param component A component.
* @param args Arguments to optionally pass to the component.
* @return A component.
*
* @see m.render
* @see m.mount
* @see m
*/
<T extends MithrilController>(
component: MithrilComponent<T>,
...args: any[]
): MithrilComponent<T>;
/**
* Creates a virtual element for use with m.render, m.mount, etc.