DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/Command/Keybinding/
GetResolvedKeybinding.rs1use std::sync::Arc;
6
7use CommonLibrary::{Environment::Requires::Requires, Keybinding::KeybindingProvider::KeybindingProvider};
8use serde_json::Value;
9use tauri::{AppHandle, Manager, Wry, command};
10
11use crate::{RunTime::ApplicationRunTime::ApplicationRunTime as Runtime, dev_log};
12
13#[command]
14pub async fn GetResolvedKeybinding(ApplicationHandle:AppHandle<Wry>) -> Result<Value, String> {
15 dev_log!("keybinding", "getting resolved keybindings for UI");
16
17 let RunTime = ApplicationHandle.state::<Arc<Runtime>>().inner().clone();
18
19 let Provider:Arc<dyn KeybindingProvider> = RunTime.Environment.Require();
20
21 Provider.GetResolvedKeybinding().await.map_err(|Error| Error.to_string())
22}