Skip to main content

DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/Command/Keybinding/
RegisterExtensionKeybindings.rs

1//! Tauri command - register keybindings contributed by an extension.
2//! Stub returns success; pending real implementation that validates,
3//! checks permissions, persists to ApplicationState, and updates the
4//! resolution cache.
5
6use std::sync::Arc;
7
8use CommonLibrary::{Environment::Requires::Requires, Keybinding::KeybindingProvider::KeybindingProvider};
9use serde_json::{Value, json};
10use tauri::{AppHandle, Manager, Wry, command};
11
12use crate::{RunTime::ApplicationRunTime::ApplicationRunTime as Runtime, dev_log};
13
14#[command]
15pub async fn RegisterExtensionKeybindings(
16	ApplicationHandle:AppHandle<Wry>,
17
18	ExtensionIdentifier:String,
19
20	_Keybindings:Value,
21) -> Result<Value, String> {
22	dev_log!("keybinding", "registering keybindings for extension: {}", ExtensionIdentifier);
23
24	let RunTime = ApplicationHandle.state::<Arc<Runtime>>().inner().clone();
25
26	let _Provider:Arc<dyn KeybindingProvider> = RunTime.Environment.Require();
27
28	Ok(json!({ "success": true }))
29}