mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-29 17:08:21 +08:00
change 'then' signature of promise that TS async/await is working (#11726)
change 'then' signature of promise that TS async/await is working
This commit is contained in:
committed by
Mohamed Hegazy
parent
af17fc34a8
commit
4b4beff441
4
selenium-webdriver/index.d.ts
vendored
4
selenium-webdriver/index.d.ts
vendored
@@ -2319,7 +2319,7 @@ declare namespace webdriver {
|
||||
* resolved with the result of the invoked callback.
|
||||
* @template R
|
||||
*/
|
||||
then<R>(opt_callback?: (value: T) => R|IThenable<R>, opt_errback?: (error: any) => R|IThenable<R>): Promise<R>;
|
||||
then<R>(opt_callback?: (value: T) => R|IThenable<R>, opt_errback?: (error: any) => any): Promise<R>;
|
||||
|
||||
/**
|
||||
* Registers a listener for when this promise is rejected. This is synonymous
|
||||
@@ -2526,7 +2526,7 @@ declare namespace webdriver {
|
||||
* @return A new promise which will be resolved
|
||||
* with the result of the invoked callback.
|
||||
*/
|
||||
then(opt_callback?: Function, opt_errback?: Function): Promise<any>;
|
||||
then<R>(opt_callback?: (value: T) => IThenable<R>|R, opt_errback?: (error: any) => any): Promise<R>;
|
||||
|
||||
/**
|
||||
* Registers a listener for when this promise is rejected. This is synonymous
|
||||
|
||||
@@ -1114,6 +1114,10 @@ function TestErrorCode() {
|
||||
errorCode = new webdriver.error.UnknownMethodError().code();
|
||||
errorCode = new webdriver.error.UnsupportedOperationError().code();
|
||||
}
|
||||
async function TestAsyncAwaitable() {
|
||||
var thenable: webdriver.promise.Promise<string> = new webdriver.promise.Promise<string>();
|
||||
var str: string = await thenable;
|
||||
}
|
||||
|
||||
function TestTestingModule() {
|
||||
testing.before(function () {
|
||||
|
||||
Reference in New Issue
Block a user