@tauri-apps/plugin-clipboard-manager
Read and write to the system clipboard.
Functions
clear()
Clears the clipboard.
Platform-specific
- Android: Only supported on SDK 28+. For older releases we write an empty string to the clipboard instead.
Returns
Promise
<void
>
Example
Since
2.0.0
readImage()
Gets the clipboard content as Uint8Array image.
Platform-specific
- Android / iOS: Not supported.
Returns
Promise
<Image
>
Example
Since
2.0.0
readText()
Gets the clipboard content as plain text.
Returns
Promise
<string
>
Example
Since
2.0.0
writeHtml()
- Writes HTML or fallbacks to write provided plain text to the clipboard.
Platform-specific
- Android / iOS: Not supported.
Parameters
Parameter | Type |
---|---|
html | string |
altText ? | string |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Example
Since
2.0.0
writeImage()
Writes image buffer to the clipboard.
Platform-specific
- Android / iOS: Not supported.
Parameters
Parameter | Type |
---|---|
image | | string | number [] | ArrayBuffer | Uint8Array <ArrayBufferLike > | Image |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Example
Since
2.0.0
writeText()
Writes plain text to the clipboard.
Parameters
Parameter | Type |
---|---|
text | string |
opts ? | object |
opts.label ? | string |
Returns
Promise
<void
>
A promise indicating the success or failure of the operation.
Example
Since
2.0.0
© 2024 Tauri Contributors. CC-BY / MIT