示例工程 15-tailwind-css-and-design-tokens
15-tailwind-css-and-design-tokens/app/shared/ipc.ts
export const CH = {
themeGet: "theme:get",
themeSet: "theme:set",
themeChanged: "theme:changed",
} as const;
export type ThemeSource = "system" | "light" | "dark";
export type ThemeState = {
source: ThemeSource;
dark: boolean;
};
export function isThemeSource(value: unknown): value is ThemeSource {
return value === "system" || value === "light" || value === "dark";
}