diff --git a/mithril/mithril.d.ts b/mithril/mithril.d.ts index 3b9690080..e01dbcc02 100644 --- a/mithril/mithril.d.ts +++ b/mithril/mithril.d.ts @@ -8,7 +8,8 @@ interface MithrilStatic { (selector: string, attributes: Object, children?: any): MithrilVirtualElement; (selector: string, children?: any): MithrilVirtualElement; - prop(value?: T): (value?: T) => T; + prop(value?: T): (value?: T) => T; + prop(promise: MithrilPromise): MithrilPromiseProperty; withAttr(property: string, callback: (value: any) => void): (e: Event) => any; module(rootElement: Node, module: MithrilModule): void; trust(html: string): String; @@ -52,6 +53,13 @@ interface MithrilDeferred { interface MithrilPromise { (value?: T): T; then(successCallback?: (value: T) => R, errorCallback?: (value: any) => any): MithrilPromise; + then(successCallback?: (value: T) => MithrilPromise, errorCallback?: (value: any) => any): MithrilPromise; +} + +interface MithrilPromiseProperty extends MithrilPromise { + (): T; + (value: T): T; + toJSON(): T; } interface MithrilXHROptions {