A Tauri clipboard plugin with text, files, html, RTF, and image support. Clipboard content update monitoring is also supported.
Used to check the status of clipboard monitor
Listen to "plugin:clipboard://clipboard-monitor/update" from Tauri core. The corresponding clipboard type event will be emitted when there is clipboard update.
Listen to monitor status update. Instead of calling isMonitorRunning to get status of monitor, "plugin:clipboard://clipboard-monitor/status" event is emitted from Tauri core when monitor status updates.
This listen to clipboard monitor update event, and trigger the callback function. However from this event we don't know whether it's text or image, no real data is returned. Use with listenToClipboard function.
Listen to clipboard update event and get the updated types in a callback.
This listener tells you what types of data are updated.
This relies on listenToClipboard() who emits events this function listens to.
You can run listenToClipboard() or startListening() before calling this function.
When HTML is copied, this will be passed to callback: {files: false, image: false, html: true, rtf: false, text: true}
read clipboard image
Read clipboard image, get the data in binary format int_array (Array) is received from Tauri core, Uint8Array and Blob are transformed from int_array
Here is the transformation flow, read clipboard image as Array (int_array) -> int_array -> Uint8Array -> Blob -> ObjectURL There are many layers which could make this function slow for large images.
Start running mointor thread in Tauri core. This feature is added in v0.5.x. Before v0.5.x, the monitor is started during setup when app starts. After v0.5.x, this function must be called first to start monitor. After monitor is started, events "plugin:clipboard://clipboard-monitor/update" will be emitted when there is clipboard update. "plugin:clipboard://clipboard-monitor/status" event is also emitted when monitor status updates Still have to listen to these events.
Stop clipboard monitor thread.
Write html and text to clipboard. writeHtml API only writes html, readText will return nothing. This API writes both html and text, so readText will return the text.
write image to clipboard
Used to check the status of clipboard monitor
Listen to "plugin:clipboard://clipboard-monitor/update" from Tauri core. The corresponding clipboard type event will be emitted when there is clipboard update.
Listen to monitor status update. Instead of calling isMonitorRunning to get status of monitor, "plugin:clipboard://clipboard-monitor/status" event is emitted from Tauri core when monitor status updates.
This listen to clipboard monitor update event, and trigger the callback function. However from this event we don't know whether it's text or image, no real data is returned. Use with listenToClipboard function.
Listen to clipboard update event and get the updated types in a callback.
This listener tells you what types of data are updated.
This relies on listenToClipboard() who emits events this function listens to.
You can run listenToClipboard() or startListening() before calling this function.
When HTML is copied, this will be passed to callback: {files: false, image: false, html: true, rtf: false, text: true}
read clipboard image
Read clipboard image, get the data in binary format int_array (Array) is received from Tauri core, Uint8Array and Blob are transformed from int_array
Here is the transformation flow, read clipboard image as Array (int_array) -> int_array -> Uint8Array -> Blob -> ObjectURL There are many layers which could make this function slow for large images.
Start running mointor thread in Tauri core. This feature is added in v0.5.x. Before v0.5.x, the monitor is started during setup when app starts. After v0.5.x, this function must be called first to start monitor. After monitor is started, events "plugin:clipboard://clipboard-monitor/update" will be emitted when there is clipboard update. "plugin:clipboard://clipboard-monitor/status" event is also emitted when monitor status updates Still have to listen to these events.
Stop clipboard monitor thread.
Write html and text to clipboard. writeHtml API only writes html, readText will return nothing. This API writes both html and text, so readText will return the text.
write image to clipboard