Skip to content
This repository has been archived by the owner on Jul 6, 2018. It is now read-only.

Commit

Permalink
add typings for PromiseProxyMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
dwickern committed Sep 4, 2017
1 parent 892f12e commit 6a9bdfa
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions types/ember/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1022,13 +1022,36 @@ export namespace Ember {
toArray(): any[];
}
/**
A low level mixin making ObjectProxy promise-aware.
*/
class PromiseProxyMixin {
catch(callback: Function): Rsvp.Promise<any, any>;
finally(callback: Function): Rsvp.Promise<any, any>;
then(callback: Function): Rsvp.Promise<any, any>;
* A low level mixin making ObjectProxy promise-aware.
*/
interface PromiseProxyMixin<T> extends RSVP.Promise<T, any> {
/**
* If the proxied promise is rejected this will contain the reason
* provided.
*/
reason: any;
/**
* Once the proxied promise has settled this will become `false`.
*/
isPending: boolean;
/**
* Once the proxied promise has settled this will become `true`.
*/
isSettled: boolean;
/**
* Will become `true` if the proxied promise is rejected.
*/
isRejected: boolean;
/**
* Will become `true` if the proxied promise is fulfilled.
*/
isFulfilled: boolean;
/**
* The promise whose fulfillment value is being proxied by this object.
*/
promise: RSVP.Promise<T, any>;
}
const PromiseProxyMixin: Mixin<PromiseProxyMixin<any>>;
class Registry {
constructor(options: any);
static set: typeof Ember.set;
Expand Down

0 comments on commit 6a9bdfa

Please sign in to comment.