mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-26 18:48:35 +02:00
NodeJS Plugin Runtime (#53)
This commit is contained in:
25
src-tauri/tauri-plugin-plugin-runtime/src/lib.rs
Normal file
25
src-tauri/tauri-plugin-plugin-runtime/src/lib.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
extern crate core;
|
||||
|
||||
use tauri::plugin::{Builder, TauriPlugin};
|
||||
use tauri::{Manager, Runtime};
|
||||
|
||||
use crate::manager::PluginManager;
|
||||
|
||||
pub mod manager;
|
||||
mod nodejs;
|
||||
|
||||
pub mod plugin_runtime {
|
||||
tonic::include_proto!("yaak.plugins.runtime");
|
||||
}
|
||||
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
Builder::new("plugin_runtime")
|
||||
.setup(|app, _| {
|
||||
tauri::async_runtime::block_on(async move {
|
||||
let manager = PluginManager::new(&app).await;
|
||||
app.manage(manager);
|
||||
Ok(())
|
||||
})
|
||||
})
|
||||
.build()
|
||||
}
|
||||
Reference in New Issue
Block a user