mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add webdriver.Serializable
Link: https://github.com/SeleniumHQ/selenium/commit/36ae4e02490ea71ab22c4094b46aadd7a5eb42f1#diff-9fd8281e531ca110881ce204a571c9e5
This commit is contained in:
+20
@@ -4159,6 +4159,26 @@ declare module webdriver {
|
||||
ELEMENT: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines an object that can be asynchronously serialized to its WebDriver
|
||||
* wire representation.
|
||||
*
|
||||
* @constructor
|
||||
* @template T
|
||||
*/
|
||||
interface Serializable<T> {
|
||||
/**
|
||||
* Returns either this instance's serialized represention, if immediately
|
||||
* available, or a promise for its serialized representation. This function is
|
||||
* conceptually equivalent to objects that have a {@code toJSON()} property,
|
||||
* except the serialize() result may be a promise or an object containing a
|
||||
* promise (which are not directly JSON friendly).
|
||||
*
|
||||
* @return {!(T|IThenable.<!T>)} This instance's serialized wire format.
|
||||
*/
|
||||
serialize(): T|webdriver.promise.IThenable<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a DOM element. WebElements can be found by searching from the
|
||||
* document root using a {@code webdriver.WebDriver} instance, or by searching
|
||||
|
||||
Reference in New Issue
Block a user