1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-21 20:04:02 +00:00
Files
browser/apps/desktop/desktop_native/napi/src/clipboards.rs
2026-02-17 09:51:51 -08:00

16 lines
540 B
Rust

#[napi]
pub mod clipboards {
#[allow(clippy::unused_async)] // FIXME: Remove unused async!
#[napi]
pub async fn read() -> napi::Result<String> {
desktop_core::clipboard::read().map_err(|e| napi::Error::from_reason(e.to_string()))
}
#[allow(clippy::unused_async)] // FIXME: Remove unused async!
#[napi]
pub async fn write(text: String, password: bool) -> napi::Result<()> {
desktop_core::clipboard::write(&text, password)
.map_err(|e| napi::Error::from_reason(e.to_string()))
}
}