understanding
This commit is contained in:
@@ -1,83 +1,89 @@
|
||||
import type { RGBA } from "@opentui/core"
|
||||
import type { ColorValue, ThemeJson, Variant } from "./theme-schema"
|
||||
import type { RGBA } from "@opentui/core";
|
||||
import type { ColorValue, ThemeJson, Variant } from "./theme-schema";
|
||||
|
||||
export type ThemeName = "system" | "opencode" | "catppuccin" | "gruvbox" | "tokyo" | "nord" | "custom"
|
||||
export type ThemeName =
|
||||
| "system"
|
||||
| "catppuccin"
|
||||
| "gruvbox"
|
||||
| "tokyo"
|
||||
| "nord"
|
||||
| "custom";
|
||||
|
||||
export type LayerBackgrounds = {
|
||||
layer0: ColorValue
|
||||
layer1: ColorValue
|
||||
layer2: ColorValue
|
||||
layer3: ColorValue
|
||||
}
|
||||
layer0: ColorValue;
|
||||
layer1: ColorValue;
|
||||
layer2: ColorValue;
|
||||
layer3: ColorValue;
|
||||
};
|
||||
|
||||
export type ThemeColors = {
|
||||
background: ColorValue
|
||||
surface: ColorValue
|
||||
primary: ColorValue
|
||||
secondary: ColorValue
|
||||
accent: ColorValue
|
||||
text: ColorValue
|
||||
muted: ColorValue
|
||||
warning: ColorValue
|
||||
error: ColorValue
|
||||
success: ColorValue
|
||||
layerBackgrounds?: LayerBackgrounds
|
||||
}
|
||||
background: ColorValue;
|
||||
surface: ColorValue;
|
||||
primary: ColorValue;
|
||||
secondary: ColorValue;
|
||||
accent: ColorValue;
|
||||
text: ColorValue;
|
||||
muted: ColorValue;
|
||||
warning: ColorValue;
|
||||
error: ColorValue;
|
||||
success: ColorValue;
|
||||
layerBackgrounds?: LayerBackgrounds;
|
||||
};
|
||||
|
||||
export type ThemeVariant = {
|
||||
name: string
|
||||
colors: ThemeColors
|
||||
}
|
||||
name: string;
|
||||
colors: ThemeColors;
|
||||
};
|
||||
|
||||
export type ThemeToken = {
|
||||
[key: string]: string
|
||||
}
|
||||
[key: string]: string;
|
||||
};
|
||||
|
||||
export type ResolvedTheme = Record<string, RGBA> & {
|
||||
layerBackgrounds: Record<string, RGBA>
|
||||
_hasSelectedListItemText: boolean
|
||||
thinkingOpacity: number
|
||||
}
|
||||
layerBackgrounds: Record<string, RGBA>;
|
||||
_hasSelectedListItemText: boolean;
|
||||
thinkingOpacity: number;
|
||||
};
|
||||
|
||||
export type DesktopTheme = {
|
||||
name: string
|
||||
variants: ThemeVariant[]
|
||||
defaultVariant: string
|
||||
tokens: ThemeToken
|
||||
}
|
||||
name: string;
|
||||
variants: ThemeVariant[];
|
||||
defaultVariant: string;
|
||||
tokens: ThemeToken;
|
||||
};
|
||||
|
||||
export type VisualizerSettings = {
|
||||
/** Number of frequency bars (8–128, default: 32) */
|
||||
bars: number
|
||||
bars: number;
|
||||
/** Automatic sensitivity: 1 = enabled, 0 = disabled (default: 1) */
|
||||
sensitivity: number
|
||||
sensitivity: number;
|
||||
/** Noise reduction factor 0.0–1.0 (default: 0.77) */
|
||||
noiseReduction: number
|
||||
noiseReduction: number;
|
||||
/** Low frequency cutoff in Hz (default: 50) */
|
||||
lowCutOff: number
|
||||
lowCutOff: number;
|
||||
/** High frequency cutoff in Hz (default: 10000) */
|
||||
highCutOff: number
|
||||
}
|
||||
highCutOff: number;
|
||||
};
|
||||
|
||||
export type AppSettings = {
|
||||
theme: ThemeName
|
||||
fontSize: number
|
||||
playbackSpeed: number
|
||||
downloadPath: string
|
||||
visualizer: VisualizerSettings
|
||||
}
|
||||
theme: ThemeName;
|
||||
fontSize: number;
|
||||
playbackSpeed: number;
|
||||
downloadPath: string;
|
||||
visualizer: VisualizerSettings;
|
||||
};
|
||||
|
||||
export type UserPreferences = {
|
||||
showExplicit: boolean
|
||||
autoDownload: boolean
|
||||
}
|
||||
showExplicit: boolean;
|
||||
autoDownload: boolean;
|
||||
};
|
||||
|
||||
export type AppState = {
|
||||
settings: AppSettings
|
||||
preferences: UserPreferences
|
||||
customTheme: ThemeColors
|
||||
}
|
||||
settings: AppSettings;
|
||||
preferences: UserPreferences;
|
||||
customTheme: ThemeColors;
|
||||
};
|
||||
|
||||
export type ThemeMode = "dark" | "light"
|
||||
export type ThemeVariantValue = Variant
|
||||
export type ThemeDefinition = ThemeJson
|
||||
export type ThemeMode = "dark" | "light";
|
||||
export type ThemeVariantValue = Variant;
|
||||
export type ThemeDefinition = ThemeJson;
|
||||
|
||||
Reference in New Issue
Block a user