DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/WindServiceHandlers/NativeHost/
Clipboard.rs1#![allow(non_snake_case, unused_variables, dead_code, unused_imports)]
2
3use serde_json::{Value, json};
9
10pub async fn NativeReadClipboardText(_Arguments:Vec<Value>) -> Result<Value, String> {
11 match arboard::Clipboard::new() {
12 Ok(mut Cb) => Ok(json!(Cb.get_text().unwrap_or_default())),
13 Err(_) => Ok(json!("")),
14 }
15}
16
17pub async fn NativeWriteClipboardText(Arguments:Vec<Value>) -> Result<Value, String> {
18 let Text = Arguments.first().and_then(|V| V.as_str()).unwrap_or("").to_string();
19 if let Ok(mut Cb) = arboard::Clipboard::new() {
20 let _ = Cb.set_text(Text);
21 }
22 Ok(Value::Null)
23}
24
25pub async fn NativeReadClipboardFindText(_Arguments:Vec<Value>) -> Result<Value, String> {
28 match arboard::Clipboard::new() {
29 Ok(mut Cb) => Ok(json!(Cb.get_text().unwrap_or_default())),
30 Err(_) => Ok(json!("")),
31 }
32}
33
34pub async fn NativeWriteClipboardFindText(Arguments:Vec<Value>) -> Result<Value, String> {
35 let Text = Arguments.first().and_then(|V| V.as_str()).unwrap_or("").to_string();
36 if let Ok(mut Cb) = arboard::Clipboard::new() {
37 let _ = Cb.set_text(Text);
38 }
39 Ok(Value::Null)
40}
41
42pub async fn NativeReadClipboardBuffer(_Arguments:Vec<Value>) -> Result<Value, String> { Ok(json!([])) }
43
44pub async fn NativeWriteClipboardBuffer(_Arguments:Vec<Value>) -> Result<Value, String> { Ok(Value::Null) }
45
46pub async fn NativeHasClipboard(_Arguments:Vec<Value>) -> Result<Value, String> { Ok(json!(false)) }
47
48pub async fn NativeTriggerPaste(_Arguments:Vec<Value>) -> Result<Value, String> { Ok(json!(false)) }
51
52pub async fn NativeReadImage(_Arguments:Vec<Value>) -> Result<Value, String> { Ok(json!([])) }