From b0b727ff73a219218e74c59725655dba2032942e Mon Sep 17 00:00:00 2001 From: Alexander Lindsay Date: Sun, 21 Feb 2016 10:45:13 -0800 Subject: [PATCH 1/2] Fix definition of MithrilPromise MithrilPromise returns the value it holds and not another promise that holds the value. MithrilPromiseProperty was adjusted to act as a nested MithrilPromise. --- mithril.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mithril.d.ts b/mithril.d.ts index c8710226..4e0c06a0 100644 --- a/mithril.d.ts +++ b/mithril.d.ts @@ -658,7 +658,7 @@ declare module _mithril { * * @see m.prop which returns objects that implement this interface. */ - interface MithrilPromiseProperty extends MithrilPromise, + interface MithrilPromiseProperty extends MithrilPromise>, MithrilProperty> { /** * Gets the contained promise. @@ -747,7 +747,7 @@ declare module _mithril { /** * This represents a Mithril promise object. */ - interface MithrilPromise extends Thennable, MithrilProperty> { + interface MithrilPromise extends Thennable, MithrilProperty { /** * Chain this promise with a simple success callback, propogating * rejections. From 40130c1cc50959274d564aaa06df187cb1e43758 Mon Sep 17 00:00:00 2001 From: Alexander Lindsay Date: Mon, 22 Feb 2016 17:55:54 -0800 Subject: [PATCH 2/2] Switched to using a union type Changed T to T | MithrilPromise in the MithrilPromise and MithrilPromiseProperty definitions --- mithril.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mithril.d.ts b/mithril.d.ts index 4e0c06a0..f023b25a 100644 --- a/mithril.d.ts +++ b/mithril.d.ts @@ -658,7 +658,7 @@ declare module _mithril { * * @see m.prop which returns objects that implement this interface. */ - interface MithrilPromiseProperty extends MithrilPromise>, + interface MithrilPromiseProperty extends MithrilPromise>, MithrilProperty> { /** * Gets the contained promise. @@ -747,7 +747,7 @@ declare module _mithril { /** * This represents a Mithril promise object. */ - interface MithrilPromise extends Thennable, MithrilProperty { + interface MithrilPromise extends Thennable, MithrilProperty> { /** * Chain this promise with a simple success callback, propogating * rejections.