mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-19 05:03:32 +08:00
Removes cancel from promises
This commit is contained in:
27
selenium-webdriver/index.d.ts
vendored
27
selenium-webdriver/index.d.ts
vendored
@@ -1004,15 +1004,6 @@ export namespace promise {
|
||||
|
||||
// region Methods
|
||||
|
||||
/**
|
||||
* Cancels the computation of this promise's value, rejecting the promise in the
|
||||
* process.
|
||||
* @param {*} reason The reason this promise is being cancelled. If not an
|
||||
* {@code Error}, one will be created using the value's string
|
||||
* representation.
|
||||
*/
|
||||
cancel(opt_reason?: string | Error): void;
|
||||
|
||||
/**
|
||||
* Registers listeners for when this instance is resolved. This function most
|
||||
* overridden by subtypes.
|
||||
@@ -2053,15 +2044,6 @@ export class AlertPromise extends Alert implements promise.IThenable<Alert> {
|
||||
|
||||
// region Methods
|
||||
|
||||
/**
|
||||
* Cancels the computation of this promise's value, rejecting the promise in the
|
||||
* process.
|
||||
* @param {*} reason The reason this promise is being cancelled. If not an
|
||||
* {@code Error}, one will be created using the value's string
|
||||
* representation.
|
||||
*/
|
||||
cancel(opt_reason?: string | Error): void;
|
||||
|
||||
/**
|
||||
* Registers listeners for when this instance is resolved. This function most
|
||||
* overridden by subtypes.
|
||||
@@ -4829,15 +4811,6 @@ export class WebElementPromise extends WebElement implements promise.IThenable<W
|
||||
*/
|
||||
constructor(driver: WebDriver, el: promise.Promise<WebElement>);
|
||||
|
||||
/**
|
||||
* Cancels the computation of this promise's value, rejecting the promise in the
|
||||
* process. This method is a no-op if the promise has alreayd been resolved.
|
||||
*
|
||||
* @param {string=} opt_reason The reason this promise is being cancelled.
|
||||
*/
|
||||
cancel(opt_reason?: string): void;
|
||||
|
||||
|
||||
/**
|
||||
* Registers listeners for when this instance is resolved.
|
||||
*
|
||||
|
||||
@@ -716,9 +716,6 @@ function TestWebElementPromise() {
|
||||
|
||||
var elementPromise: webdriver.WebElementPromise = driver.findElement(webdriver.By.id('id'));
|
||||
|
||||
elementPromise.cancel();
|
||||
elementPromise.cancel('reason');
|
||||
|
||||
elementPromise.then();
|
||||
elementPromise.then((element: webdriver.WebElement) => {});
|
||||
elementPromise.then((element: webdriver.WebElement) => {}, (error: any) => {});
|
||||
@@ -943,8 +940,6 @@ function TestPromiseClass() {
|
||||
promise = new webdriver.promise.Promise<string>((resolve: (value: webdriver.promise.Promise<string>) => void, reject: () => void) => {});
|
||||
promise = new webdriver.promise.Promise<string>((resolve: (value: string) => void, reject: () => void) => {}, controlFlow);
|
||||
|
||||
promise.cancel('Abort');
|
||||
|
||||
promise = promise.then();
|
||||
promise = promise.then((a: string) => 'cde');
|
||||
promise = promise.then((a: string) => 'cde', (e: any) => {});
|
||||
|
||||
Reference in New Issue
Block a user