1.3.0-1 • Published 5 years ago
universal-clipboard v1.3.0-1
getClipboard
Gets the content on the system clipboard.
Install
$ npm install universal-getClipboard --saveor
$ npm install universal-api --saveUsage
import getClipboard from 'universal-getClipboard';
getClipboard({
success (res){
console.log(res.text);
}
});
// promise
getClipboard().then(res => {
console.log(res.text);
});Methods
getClipboard()
Supported
Arguments
| Property | Type | Description | required | Default |
|---|---|---|---|---|
| options | object | ✔️ | - | |
| options.success | Function | The callback function for a successful API call | ✘ | - |
| options.fail | Function | The callback function for a failed API call | ✘ | - |
| options.complete | Function | The callback function used when the API call completed (always executed whether the call succeeds or fails) | ✘ | - |
Return
| Property | Type | Description |
|---|---|---|
| res | object | |
| res.text | string | The clipboard content |
setClipboard
Sets the content on the system clipboard.
Install
$ npm install universal-setClipboard --saveor
$ npm install universal-api --saveUsage
import setClipboard from 'universal-setClipboard';
setClipboard({
text: 'text',
success (res){
console.log(res);
}
});
// promise
setClipboard({
text: 'text'
}).then(res => {
console.log(res);
});Methods
setClipboard()
Supported
Arguments
| Property | Type | Description | required | Default |
|---|---|---|---|---|
| options | object | ✔️ | - | |
| options.text | string | The clipboard content | ✔️ | - |
| options.success | Function | The callback function for a successful API call | ✘ | - |
| options.fail | Function | The callback function for a failed API call | ✘ | - |
| options.complete | Function | The callback function used when the API call completed (always executed whether the call succeeds or fails) | ✘ | - |
2.0.0-beta
5 years ago
1.2.0
5 years ago
1.3.0-0
5 years ago
1.3.0-1
5 years ago
1.0.1
6 years ago
1.0.0-beta.4
6 years ago
1.0.0-beta.3
6 years ago
1.0.0
6 years ago
1.0.0-beta.2
6 years ago
1.0.0-beta.1
6 years ago