Skip to content

Commit

Permalink
feat(): add clipboard plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Feb 17, 2016
1 parent 44d6d5c commit fa4c266
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/plugins/clipboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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
* ````
*
* @usage
* ```js
* Clipboard.copy("Hello world");
*
* Clipboard.paste().then(
* (resolve : string) => {
* alert(resolve);
* },
* (reject : string) => {
* alert("Error: " + reject);
* }
* );
* );
* ```
*/
@Plugin({
name: 'Clipboard',
plugin: 'com.verso.cordova.clipboard',
pluginRef: 'cordova.plugins.clipboard'
})
export class Clipboard {

/**
* Copies the given text
* @param text
* @returns {Promise<T>}
*/
@Cordova
static copy(text : string) : Promise<any> {
return new Promise((res, resj) => {});
}

/**
* Pastes the text stored in clipboard
* @returns {Promise<T>}
*/
@Cordova
static paste() : Promise<any> {
return new Promise((res, rej) => {});
}

}

0 comments on commit fa4c266

Please sign in to comment.