clipboard
Access the text from the clipboard.
import { clipboard } from 'miletus';
//Using then()
clipboard.readText().then((text) => {
console.log('Contents of the clipboard: ' + text);
});
//Using await() in an async function
let text = await clipboard.readText();
console.log('Contents of the clipboard: ' + text);
Methods
readText()
Returns Promise<string>
- Resolves with the text that is in the clipboard.
writeText(text)
text
string - Text to write. Writetext
to the clipboard.