/
githubmirror
/
marktext
Обзор
Документация
Войти
/
githubmirror
/
marktext
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/desktop/src/main/app/nativeTheme.ts
20 строк
474 B
Ran Luo
refactor(desktop): remove remaining no-explicit-any suppressions (#4548)
17 июн 2026, 13:24
Не верифицирован
17 июн 2026, 13:24
2482e00
Код
Авторство
О чём код?
import { isDarkThemeId } from '../../common/theme' export type NativeThemeSource = 'system' | 'dark' | 'light' export const isDarkApplicationTheme = (theme: unknown): boolean => { return isDarkThemeId(theme) } export const getNativeThemeSource = ({ followSystemTheme, theme }: { followSystemTheme?: boolean theme?: unknown }): NativeThemeSource => { if (followSystemTheme) { return 'system' } return isDarkApplicationTheme(theme) ? 'dark' : 'light' }