appium-espresso-driver
Version:
Espresso integration for Appium
30 lines • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getClipboard = getClipboard;
exports.mobileSetClipboard = mobileSetClipboard;
/**
* @this {EspressoDriver}
* @returns {Promise<string>} Base64-encoded content of the clipboard
* or an empty string if the clipboard is empty.
*/
async function getClipboard() {
return /** @type {string} */ ((await this.adb.getApiLevel() < 29)
? (await this.espresso.jwproxy.command('/appium/device/get_clipboard', 'POST', {}))
: (await this.settingsApp.getClipboard()));
}
/**
* @this {EspressoDriver}
* @param {string} content Base64-encoded clipboard payload
* @param {'plaintext'} [contentType] Only a single
* content type is supported, which is 'plaintext'
* @param {string} [label] Optional label to identify the current
* clipboard payload
* @returns {Promise<void>}
*/
async function mobileSetClipboard(content, contentType, label) {
await this.espresso.jwproxy.command('/appium/device/set_clipboard', 'POST', { content, contentType, label });
}
/**
* @typedef {import('../driver').EspressoDriver} EspressoDriver
*/
//# sourceMappingURL=clipboard.js.map