UNPKG

appium-mac2-driver

Version:

XCTest-based Appium driver for macOS apps automation

31 lines 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.macosSetClipboard = macosSetClipboard; exports.macosGetClipboard = macosGetClipboard; /** * Sets the content of the clipboard. * * @param content - The content to be set as base64 encoded string. * @param contentType - The type of the content to set. * Only `plaintext`, 'image and 'url' are supported. */ async function macosSetClipboard(content, contentType = 'plaintext') { await this.proxyCommand('/wda/setPasteboard', 'POST', { content, contentType, }); } /** * Gets the content of the clipboard. * * @param contentType - The type of the content to get. * Only `plaintext`, 'image and 'url' are supported. * @returns {Promise<string>} The actual clipboard content encoded into base64 string. * An empty string is returned if the clipboard contains no data for the given content type. */ async function macosGetClipboard(contentType = 'plaintext') { return /** @type {string} */ await this.proxyCommand('/wda/getPasteboard', 'POST', { contentType, }); } //# sourceMappingURL=clipboard.js.map