fresh_core/
file_explorer.rs1use crate::api::OverlayColorSpec;
2use serde::{Deserialize, Serialize};
3use std::path::PathBuf;
4use ts_rs::TS;
5
6#[derive(Debug, Clone, Serialize, Deserialize, TS)]
8#[serde(deny_unknown_fields)]
9#[ts(export)]
10pub struct FileExplorerDecoration {
11 #[ts(type = "string")]
13 pub path: PathBuf,
14 pub symbol: String,
16 pub color: OverlayColorSpec,
18 #[serde(default)]
20 pub priority: i32,
21}
22
23#[cfg(feature = "plugins")]
24impl<'js> rquickjs::FromJs<'js> for FileExplorerDecoration {
25 fn from_js(_ctx: &rquickjs::Ctx<'js>, value: rquickjs::Value<'js>) -> rquickjs::Result<Self> {
26 rquickjs_serde::from_value(value).map_err(|e| rquickjs::Error::FromJs {
27 from: "object",
28 to: "FileExplorerDecoration",
29 message: Some(e.to_string()),
30 })
31 }
32}