diff --git a/mithril.d.ts b/mithril.d.ts index 111a9ebc..c8710226 100644 --- a/mithril.d.ts +++ b/mithril.d.ts @@ -27,7 +27,7 @@ declare module _mithril { MithrilVirtualElement | MithrilComponent> ): MithrilVirtualElement; - + /** * Initializes a component for use with m.render, m.mount, etc. * @@ -127,6 +127,19 @@ declare module _mithril { callbackThis: 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( + attributeName: string, + property: MithrilBasicProperty + ) : (e: Event) => any; + /** * @deprecated Use m.mount instead */ @@ -561,7 +574,7 @@ declare module _mithril { * @see MithrilControllerConstructor */ interface MithrilControllerFunction { - (): T; + (opts?: any): T; } /** @@ -603,7 +616,7 @@ declare module _mithril { * * @see m.component */ - view(ctrl: T): MithrilVirtualElement; + view(ctrl?: T, opts?: any): MithrilVirtualElement; } /**