-
Notifications
You must be signed in to change notification settings - Fork 1
/
device-info.ts
38 lines (37 loc) · 1.08 KB
/
device-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
import {
BatteryInfo,
GetLanguageCodeResult,
LanguageTag,
DeviceInfo as DeviceGeneralInfo,
} from '@capacitor/device';
/**
* Includes all the device information fields provided by the `@capacitor/device` package.
*
* @remarks
* It's a combination of several types, including {@link DeviceGeneralInfo} (general device information), {@link BatteryInfo} (battery status information), `languageCode` (the device's current language code), and `languageTag` (the device's current language tag).
*
* @example
* #### Device Info Example
```ts
const deviceInfo: DeviceInfo = {
"identifier": "d787dc6b-041f-4a61-8078-d5573c2e7a4e",
"model": "X11",
"platform": "web",
"isVirtual": false,
"osVersion": "x86.64",
"isCharging": true,
"languageTag": "en",
"batteryLevel": 1,
"languageCode": "en",
"manufacturer": "Google Inc.",
"webViewVersion": "113.0.0.0",
"operatingSystem": "unknown"
}
```
*/
export type DeviceInfo = Partial<
DeviceGeneralInfo &
BatteryInfo & { languageCode: GetLanguageCodeResult['value'] } & {
languageTag: LanguageTag['value'];
}
>;