UNPKG

ionic-native

Version:

Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support

65 lines 2.49 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; import { Cordova, Plugin } from './plugin'; /** * @name Clipboard * @description * Clipboard management plugin for Cordova that supports iOS, Android, and Windows Phone 8. * * Requires Cordova plugin: https://github.com/VersoSolutions/CordovaClipboard * For more info, please see the [Clipboard plugin docs](https://github.com/VersoSolutions/CordovaClipboard.git). * * @usage * ```typescript * import { Clipboard } from 'ionic-native'; * * * Clipboard.copy('Hello world'); * * Clipboard.paste().then( * (resolve: string) => { * alert(resolve); * }, * (reject: string) => { * alert('Error: ' + reject); * } * ); * ); * ``` */ export var Clipboard = (function () { function Clipboard() { } /** * Copies the given text * @param {string} text Text that gets copied on the system clipboard * @returns {Promise<any>} Returns a promise after the text has been copied */ Clipboard.copy = function (text) { return; }; /** * Pastes the text stored in clipboard * @returns {Promise<any>} Returns a promise after the text has been pasted */ Clipboard.paste = function () { return; }; __decorate([ Cordova() ], Clipboard, "copy", null); __decorate([ Cordova() ], Clipboard, "paste", null); Clipboard = __decorate([ Plugin({ pluginName: 'Clipboard', plugin: 'https://github.com/VersoSolutions/CordovaClipboard.git', pluginRef: 'cordova.plugins.clipboard', repo: 'https://github.com/VersoSolutions/CordovaClipboard', platforms: ['Amazon Fire OS', 'iOS', 'Android', 'BlackBerry 10', 'Windows Phone 7', 'Windows Phone 8', 'Windows', 'Firefox OS', 'Browser'] }) ], Clipboard); return Clipboard; }()); //# sourceMappingURL=clipboard.js.map