time_tracker_plugin_sdk/
plugin.rs1use serde_json;
4
5#[derive(Debug, Clone)]
7pub struct PluginInfo {
8 pub id: String,
9 pub name: String,
10 pub version: String,
11 pub description: Option<String>,
12}
13
14pub trait Plugin: Send + Sync {
16 fn info(&self) -> &PluginInfo;
18
19 fn initialize(&mut self, api: &dyn crate::api::PluginAPIInterface) -> Result<(), String>;
21
22 fn invoke_command(&self, command: &str, params: serde_json::Value, api: &dyn crate::api::PluginAPIInterface) -> Result<serde_json::Value, String>;
25
26 fn shutdown(&self) -> Result<(), String>;
28
29 fn get_schema_extensions(&self) -> Vec<crate::extensions::SchemaExtension> {
32 vec![]
33 }
34
35 fn get_frontend_bundle(&self) -> Option<Vec<u8>> {
37 None
38 }
39}