UNPKG

appium-uiautomator2-driver

Version:
27 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getClipboard = getClipboard; exports.setClipboard = setClipboard; /** * Gets the clipboard content as a base64-encoded string. * @returns Base64-encoded clipboard content, or an empty string if the clipboard is empty. */ async function getClipboard() { return String((await this.adb.getApiLevel()) < 29 ? await this.uiautomator2.jwproxy.command('/appium/device/get_clipboard', 'POST', {}) : await this.settingsApp.getClipboard()); } /** * Sets the clipboard content. * @param content - Base64-encoded clipboard payload. * @param contentType - Content type. Only 'plaintext' is supported. Defaults to 'plaintext'. * @param label - Optional label to identify the current clipboard payload. */ async function setClipboard(content, contentType = 'plaintext', label) { await this.uiautomator2.jwproxy.command('/appium/device/set_clipboard', 'POST', { content, contentType, label, }); } //# sourceMappingURL=clipboard.js.map