UNPKG

1.15 kBJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6var NativeClipboard_1 = __importDefault(require("./NativeClipboard"));
7/**
8 * `Clipboard` gives you an interface for setting and getting content from Clipboard on both iOS and Android
9 */
10exports.Clipboard = {
11 /**
12 * Get content of string type, this method returns a `Promise`, so you can use following code to get clipboard content
13 * ```javascript
14 * async _getContent() {
15 * var content = await Clipboard.getString();
16 * }
17 * ```
18 */
19 getString: function () {
20 return NativeClipboard_1.default.getString();
21 },
22 /**
23 * Set content of string type. You can use following code to set clipboard content
24 * ```javascript
25 * _setContent() {
26 * Clipboard.setString('hello world');
27 * }
28 * ```
29 * @param the content to be stored in the clipboard.
30 */
31 setString: function (content) {
32 NativeClipboard_1.default.setString(content);
33 },
34};