mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
remove cast method
This commit is contained in:
@@ -22,12 +22,6 @@ var constructResult1 = new Promise<string>((resolve: (promise: Thenable<string>)
|
||||
});
|
||||
promiseString = constructResult1;
|
||||
|
||||
//cast test
|
||||
var castResult = Promise.cast('a string');
|
||||
promiseString = castResult;
|
||||
var castResult1 = Promise.cast(Promise.resolve('a string'));
|
||||
promiseString = castResult1;
|
||||
|
||||
//resolve test
|
||||
var resolveResult = Promise.resolve('a string');
|
||||
promiseString = resolveResult;
|
||||
|
||||
@@ -20,12 +20,6 @@ var constructResult1 = new Promise<string>((resolve:(promise: Thenable<string>)
|
||||
});
|
||||
promiseString = constructResult1;
|
||||
|
||||
//cast test
|
||||
var castResult = Promise.cast('a string');
|
||||
promiseString = castResult;
|
||||
var castResult1 = Promise.cast(Promise.resolve('a string'));
|
||||
promiseString = castResult1;
|
||||
|
||||
//resolve test
|
||||
var resolveResult = Promise.resolve('a string');
|
||||
promiseString = resolveResult;
|
||||
|
||||
12
es6-promise/es6-promise.d.ts
vendored
12
es6-promise/es6-promise.d.ts
vendored
@@ -118,23 +118,13 @@ declare class Promise<R> implements Thenable<R> {
|
||||
}
|
||||
|
||||
declare module Promise {
|
||||
/**
|
||||
* Returns promise (only if promise.constructor == Promise)
|
||||
*/
|
||||
function cast<R>(promise: Promise<R>): Promise<R>;
|
||||
/**
|
||||
* Make a promise that fulfills to obj.
|
||||
*/
|
||||
function cast<R>(object: R): Promise<R>;
|
||||
|
||||
/**
|
||||
* Make a new promise from the thenable.
|
||||
* A thenable is promise-like in as far as it has a "then" method.
|
||||
* This also creates a new promise if you pass it a genuine JavaScript promise, making it less efficient for casting than Promise.cast.
|
||||
*/
|
||||
function resolve<R>(thenable?: Thenable<R>): Promise<R>;
|
||||
/**
|
||||
* Make a promise that fulfills to obj. Same as Promise.cast(obj) in this situation.
|
||||
* Make a promise that fulfills to obj.
|
||||
*/
|
||||
function resolve<R>(object?: R): Promise<R>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user