Line data Source code
1 : import { isDesktopHost } from './native_globals.js';
2 :
3 1 : export enum PlatformType {
4 1 : WEB = 0,
5 : /// The desktop app, on any operating system
6 1 : DESKTOP = 1,
7 1 : }
8 :
9 : /// The platform the app runs on
10 1 : export const usePlatformType = (): PlatformType => isDesktopHost() ? PlatformType.DESKTOP : PlatformType.WEB;
11 :
12 : /// Does the app run in the desktop app on macOS? The window inlays the traffic lights into the app there.
13 1 : export const isMacDesktopHost = (): boolean => isDesktopHost() && /Mac/.test(navigator.userAgent);
|