icon_theme_schema.rs

 1#![allow(missing_docs)]
 2
 3use gpui::SharedString;
 4use schemars::JsonSchema;
 5use serde::{Deserialize, Serialize};
 6use std::collections::HashMap;
 7
 8use crate::AppearanceContent;
 9
10#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
11pub struct IconThemeFamilyContent {
12    pub name: String,
13    pub author: String,
14    pub themes: Vec<IconThemeContent>,
15}
16
17#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
18pub struct IconThemeContent {
19    pub name: String,
20    pub appearance: AppearanceContent,
21    #[serde(default)]
22    pub directory_icons: DirectoryIconsContent,
23    #[serde(default)]
24    pub chevron_icons: ChevronIconsContent,
25    #[serde(default)]
26    pub file_stems: HashMap<String, String>,
27    #[serde(default)]
28    pub file_suffixes: HashMap<String, String>,
29    #[serde(default)]
30    pub file_icons: HashMap<String, IconDefinitionContent>,
31}
32
33#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonSchema)]
34pub struct DirectoryIconsContent {
35    pub collapsed: Option<SharedString>,
36    pub expanded: Option<SharedString>,
37}
38
39#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonSchema)]
40pub struct ChevronIconsContent {
41    pub collapsed: Option<SharedString>,
42    pub expanded: Option<SharedString>,
43}
44
45#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
46pub struct IconDefinitionContent {
47    pub path: SharedString,
48}