awesome-cordova-plugins/src/plugins/clipboard.ts

53 lines
1.0 KiB
TypeScript
Raw Normal View History

2016-02-17 17:49:26 +08:00
import {Plugin, Cordova} from './plugin';
/**
* Clipboard management plugin for Cordova that supports iOS, Android, and Windows Phone 8.
*
* Requires Cordova plugin: https://github.com/VersoSolutions/CordovaClipboard
*
* ```
* ionic plugin add https://github.com/VersoSolutions/CordovaClipboard.git
2016-03-05 00:33:36 +08:00
* ```
2016-02-17 17:49:26 +08:00
*
* @usage
* ```js
* Clipboard.copy("Hello world");
*
* Clipboard.paste().then(
* (resolve : string) => {
* alert(resolve);
* },
* (reject : string) => {
* alert("Error: " + reject);
* }
* );
* );
* ```
*/
@Plugin({
plugin: 'com.verso.cordova.clipboard',
pluginRef: 'cordova.plugins.clipboard'
})
export class Clipboard {
/**
* Copies the given text
* @param text
* @returns {Promise<T>}
*/
2016-02-17 17:52:00 +08:00
@Cordova()
2016-02-17 17:49:26 +08:00
static copy(text : string) : Promise<any> {
return new Promise((res, resj) => {});
}
/**
* Pastes the text stored in clipboard
* @returns {Promise<T>}
*/
2016-02-17 17:52:00 +08:00
@Cordova()
2016-02-17 17:49:26 +08:00
static paste() : Promise<any> {
return new Promise((res, rej) => {});
}
}