fix: resolve vscode type errors inside color module (#4598)

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
Alexandr Garbuzov
2025-10-25 20:31:29 +02:00
committed by martin-mfg
co-authored by Alexandr
parent ad5579f497
commit b44de10025
+6 -3
View File
@@ -1,3 +1,5 @@
// @ts-check
import { themes } from "../../themes/index.js";
/**
@@ -69,7 +71,6 @@ const fallbackColor = (color, fallbackColor) => {
* @param {string=} args.border_color Card border color.
* @param {string=} args.ring_color Card ring color.
* @param {string=} args.theme Card theme.
* @param {string=} args.fallbackTheme Fallback theme.
* @returns {CardColors} Card colors.
*/
const getCardColors = ({
@@ -80,11 +81,13 @@ const getCardColors = ({
border_color,
ring_color,
theme,
fallbackTheme = "default",
}) => {
const defaultTheme = themes[fallbackTheme];
const defaultTheme = themes["default"];
const isThemeProvided = theme !== null && theme !== undefined;
// @ts-ignore
const selectedTheme = isThemeProvided ? themes[theme] : defaultTheme;
const defaultBorderColor =
"border_color" in selectedTheme
? selectedTheme.border_color