Ember - Add additional type defs for RSVP namespace (#16359)

* add additional type defs for RSVP

* satisfy linting
This commit is contained in:
Adnan Chowdhury
2017-05-05 16:23:05 -07:00
committed by Mohamed Hegazy
parent c49e2aa150
commit 46eb9a8bfe

View File

@@ -1,6 +1,7 @@
// Type definitions for Ember.js 2.7
// Project: http://emberjs.com/
// Definitions by: Jed Mao <https://github.com/jedmao>
// bttf <https://github.com/bttf>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="jquery" />
@@ -1571,6 +1572,34 @@ declare namespace Ember {
@return {Promise}
*/
finally<V>(callback: (a: T) => V, label?: string): Promise<V, U>;
static all<Q, R>(promises: GlobalArray<(Q | Thenable<Q, R>)>): Promise<Q[], R>;
static race<Q, R>(promises: GlobalArray<Promise<Q, R>>): Promise<Q, R>;
/**
@method resolve
@param {Any} value value that the returned promise will be resolved with
@param {String} label optional string for identifying the returned promise.
Useful for tooling.
@return {Promise} a promise that will become fulfilled with the given
`value`
*/
static resolve<Q, R>(object?: Q | Thenable<Q, R>): Promise<Q, R>;
/**
@method cast (Deprecated in favor of resolve
@param {Any} value value that the returned promise will be resolved with
@param {String} label optional string for identifying the returned promise.
Useful for tooling.
@return {Promise} a promise that will become fulfilled with the given
`value`
*/
static cast<Q, R>(object: Q | Thenable<Q, R>, label?: string): Promise<Q, R>;
/**
`RSVP.Promise.reject` returns a promise rejected with the passed `reason`.
*/
static reject(reason?: any): Promise<any, any>;
}
function all(promises: GlobalArray<Promise<any, any>>): Promise<any, any>;