npm i --save @nativescript-use/nativescript-clipboard
- Version: 0.0.3
- GitHub: https://github.com/NativeScript/plugins
- NPM: https://www.npmjs.com/package/%40nativescript-use%2Fnativescript-clipboard
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
@nativescript-use/nativescript-clipboard
npm install @nativescript-use/nativescript-clipboard
Usage
import { Clipboard } from "@nativescript-use/nativescript-clipboard"
const clipboard = new Clipboard();
// Copy text
clipboard.copy("My text");
// Read Clipboard
const currentClipboardValue = clipboard.read();
// Add listener
clipboard.onCopy((textCopied: string) =>{
console.log(textCopied)
});
// Remove listener
clipboard.offCopy();
Type declaration
export declare class Clipboard {
abstract onCopy(callback: (text: string) => void): void
abstract offCopy(): void
abstract copy(text: string): boolean
abstract read(): string
}
License
Apache License Version 2.0