Added an overload for withAttr. Added parameters to component controller and view functions.
This commit is contained in:
parent
0682932f63
commit
4a53a49b89
1 changed files with 16 additions and 3 deletions
19
mithril.d.ts
vendored
19
mithril.d.ts
vendored
|
|
@ -27,7 +27,7 @@ declare module _mithril {
|
||||||
MithrilVirtualElement<T> |
|
MithrilVirtualElement<T> |
|
||||||
MithrilComponent<T>>
|
MithrilComponent<T>>
|
||||||
): MithrilVirtualElement<T>;
|
): MithrilVirtualElement<T>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes a component for use with m.render, m.mount, etc.
|
* Initializes a component for use with m.render, m.mount, etc.
|
||||||
*
|
*
|
||||||
|
|
@ -127,6 +127,19 @@ declare module _mithril {
|
||||||
callbackThis: any
|
callbackThis: any
|
||||||
): (e: Event) => any;
|
): (e: Event) => any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a event handler that can be bound to an element, firing with
|
||||||
|
* the specified property.
|
||||||
|
*
|
||||||
|
* @param attributeName Name of the element's attribute to bind to.
|
||||||
|
* @param property The property to bind.
|
||||||
|
* @return A function suitable for listening to an event.
|
||||||
|
*/
|
||||||
|
withAttr<T>(
|
||||||
|
attributeName: string,
|
||||||
|
property: MithrilBasicProperty<T>
|
||||||
|
) : (e: Event) => any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use m.mount instead
|
* @deprecated Use m.mount instead
|
||||||
*/
|
*/
|
||||||
|
|
@ -561,7 +574,7 @@ declare module _mithril {
|
||||||
* @see MithrilControllerConstructor
|
* @see MithrilControllerConstructor
|
||||||
*/
|
*/
|
||||||
interface MithrilControllerFunction<T extends MithrilController> {
|
interface MithrilControllerFunction<T extends MithrilController> {
|
||||||
(): T;
|
(opts?: any): T;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -603,7 +616,7 @@ declare module _mithril {
|
||||||
*
|
*
|
||||||
* @see m.component
|
* @see m.component
|
||||||
*/
|
*/
|
||||||
view(ctrl: T): MithrilVirtualElement<T>;
|
view(ctrl?: T, opts?: any): MithrilVirtualElement<T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue