INNER CODE UNIT · TypeScript
getClientSystem
libnyanpasu/clash-nyanpasu · frontend/platform/src/index.ts:76
export function getClientSystem(): System {
const userAgent =
typeof window === 'undefined' ? '' : (window.navigator?.userAgent ?? '')
const platform = typeof OS_PLATFORM === 'undefined' ? 'unknown' : OS_PLATFORM
return getSystem(userAgent, platform)
}
export const OS = getClientSystem()
export const isWindows = OS === 'windows'
export const isMacOS = OS === 'macos'
export const isLinux = OS === 'linux'
export type NativeTheme = 'light' | 'dark' | null
export interface WindowAdapter {
isMaximized: () => Promise<boolean>
isFullscreen: () => Promise<boolean>