use std::collections::HashMap;
use std::fmt::Debug;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct Symbol {
pub name: String,
pub html: String,
}
impl std::fmt::Display for Symbol {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.name)
}
}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct SymbolAttributes {
pub symbols: Vec<Symbol>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub struct DefaultStyleAttributes {
pub string: serde_json::Value,
pub datetime: serde_json::Value,
pub date: serde_json::Value,
pub integer: serde_json::Value,
pub float: serde_json::Value,
pub bool: serde_json::Value,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub struct PluginAttributes {
pub symbol: Option<SymbolAttributes>,
pub style: Option<DefaultStyleAttributes>,
}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct PluginConfig {
#[serde(default)]
pub columns: HashMap<String, serde_json::Value>,
}