Switched to using a union type

Changed T to T | MithrilPromise<T> in the MithrilPromise and
MithrilPromiseProperty definitions
This commit is contained in:
Alexander Lindsay 2016-02-22 17:55:54 -08:00
parent b0b727ff73
commit 40130c1cc5

4
mithril.d.ts vendored
View file

@ -658,7 +658,7 @@ declare module _mithril {
* *
* @see m.prop which returns objects that implement this interface. * @see m.prop which returns objects that implement this interface.
*/ */
interface MithrilPromiseProperty<T> extends MithrilPromise<MithrilPromise<T>>, interface MithrilPromiseProperty<T> extends MithrilPromise<T | MithrilPromise<T>>,
MithrilProperty<MithrilPromise<T>> { MithrilProperty<MithrilPromise<T>> {
/** /**
* Gets the contained promise. * Gets the contained promise.
@ -747,7 +747,7 @@ declare module _mithril {
/** /**
* This represents a Mithril promise object. * This represents a Mithril promise object.
*/ */
interface MithrilPromise<T> extends Thennable<T>, MithrilProperty<T> { interface MithrilPromise<T> extends Thennable<T>, MithrilProperty<T | MithrilPromise<T>> {
/** /**
* Chain this promise with a simple success callback, propogating * Chain this promise with a simple success callback, propogating
* rejections. * rejections.