/
platform_info.ts
65 lines (55 loc) · 1.58 KB
/
platform_info.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Must be up to date with https://github.com/mozilla/glean/blob/main/glean-core/src/system.rs
export const enum KnownOperatingSystems {
Android = "Android",
iOS = "iOS",
Linux = "Linux",
MacOS = "Darwin",
Windows = "Windows",
FreeBSD = "FreeBSD",
NetBSD = "NetBSD",
OpenBSD = "OpenBSD",
Solaris = "Solaris",
Unknown = "Unknown",
// ChromeOS is not listed in the Glean SDK because it is not a possibility there.
ChromeOS = "ChromeOS",
// The following additions might be reported by Qt.
TvOS = "TvOS", // https://developer.apple.com/tvos/
Qnx = "QNX", // BlackBerry QNX
Wasm = "Wasm",
// The following additions might be reported by Node.js
SunOS = "SunOS",
AIX = "IBM_AIX",
// Known reported values in the browser User-Agent
WatchOS = "WatchOS",
WebOS = "WebOS"
}
interface PlatformInfo {
/**
* Gets and returns the current OS system.
*
* @returns The current OS.
*/
os(): KnownOperatingSystems;
/**
* Gets and returns the current OS system version.
*
* @returns The current OS version.
*/
osVersion(): string;
/**
* Gets and returns the current system architecture.
*
* @returns The current system architecture.
*/
arch(): string;
/**
* Gets and returns the current system / browser locale.
*
* @returns The current system / browser locale.
*/
locale(): string;
}
export default PlatformInfo;