@flighthq/device 0.5.1-next.815.cc08b93 → 0.5.1-next.903.f434bc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/contract.d.ts +1 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +1 -0
- package/dist/contract.js.map +1 -1
- package/dist/device.d.ts +5 -1
- package/dist/device.d.ts.map +1 -1
- package/dist/device.js +60 -43
- package/dist/device.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/device`. The `@fligh
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/device@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/device@0.5.1-next.903.f434bc2](https://github.com/flighthq/flight/tree/f434bc233778d75aeea61995df3a8cfaec459a85/packages/device)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/f434bc233778d75aeea61995df3a8cfaec459a85/LICENSE.md)
|
package/dist/contract.d.ts
CHANGED
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,UAAU,CAAC"}
|
package/dist/contract.js
CHANGED
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,UAAU,CAAC"}
|
package/dist/device.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeviceCapabilities, DeviceDisplayMetrics, DeviceInfo, HasSystemDevice, SafeAreaInsets } from '@flighthq/types/contract';
|
|
1
|
+
import type { DeviceCapabilities, DeviceDisplayMetrics, DeviceInfo, EntityConstruction, HasSystemDevice, SafeAreaInsets } from '@flighthq/types/contract';
|
|
2
2
|
export declare function createDeviceCapabilities(): DeviceCapabilities;
|
|
3
3
|
export declare function createDeviceDisplayMetrics(): DeviceDisplayMetrics;
|
|
4
4
|
export declare function createDeviceInfo(): DeviceInfo;
|
|
@@ -8,5 +8,9 @@ export declare function getDeviceDisplayMetrics(host: HasSystemDevice, out: Devi
|
|
|
8
8
|
export declare function getDeviceId(host: HasSystemDevice): string;
|
|
9
9
|
export declare function getDeviceInfo(host: HasSystemDevice, out: DeviceInfo): DeviceInfo;
|
|
10
10
|
export declare function getSafeAreaInsets(host: HasSystemDevice, out: SafeAreaInsets): SafeAreaInsets;
|
|
11
|
+
export declare function initializeDeviceCapabilities(out: EntityConstruction<DeviceCapabilities>): void;
|
|
12
|
+
export declare function initializeDeviceDisplayMetrics(out: EntityConstruction<DeviceDisplayMetrics>): void;
|
|
13
|
+
export declare function initializeDeviceInfo(out: EntityConstruction<DeviceInfo>): void;
|
|
14
|
+
export declare function initializeSafeAreaInsets(out: EntityConstruction<SafeAreaInsets>): void;
|
|
11
15
|
export declare function refreshDeviceInfo(host: HasSystemDevice): void;
|
|
12
16
|
//# sourceMappingURL=device.d.ts.map
|
package/dist/device.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,cAAc,EACf,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,wBAAwB,IAAI,kBAAkB,
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,cAAc,EACf,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,wBAAwB,IAAI,kBAAkB,CAI7D;AAED,wBAAgB,0BAA0B,IAAI,oBAAoB,CAIjE;AAED,wBAAgB,gBAAgB,IAAI,UAAU,CAI7C;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CAIrD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,kBAAkB,GAAG,kBAAkB,CAExG;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,oBAAoB,GAAG,oBAAoB,CAE9G;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAEzD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAEhF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,GAAG,cAAc,CAE5F;AAED,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAI9F;AAED,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,kBAAkB,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAQlG;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAAG,IAAI,CA0B9E;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,kBAAkB,CAAC,cAAc,CAAC,GAAG,IAAI,CAKtF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAE7D"}
|
package/dist/device.js
CHANGED
|
@@ -1,54 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
2
2
|
import { DeviceFormFactorUnknown } from '@flighthq/types/contract';
|
|
3
3
|
export function createDeviceCapabilities() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
hasStylus: false,
|
|
8
|
-
});
|
|
4
|
+
const out = allocateEntity();
|
|
5
|
+
initializeDeviceCapabilities(out);
|
|
6
|
+
return finishEntity(out);
|
|
9
7
|
}
|
|
10
8
|
export function createDeviceDisplayMetrics() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
logicalHeight: -1,
|
|
15
|
-
logicalWidth: -1,
|
|
16
|
-
physicalHeight: -1,
|
|
17
|
-
physicalWidth: -1,
|
|
18
|
-
pixelRatio: -1,
|
|
19
|
-
});
|
|
9
|
+
const out = allocateEntity();
|
|
10
|
+
initializeDeviceDisplayMetrics(out);
|
|
11
|
+
return finishEntity(out);
|
|
20
12
|
}
|
|
21
13
|
export function createDeviceInfo() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
boardName: '',
|
|
26
|
-
colorGamut: '',
|
|
27
|
-
cpuCores: -1,
|
|
28
|
-
fontScale: -1,
|
|
29
|
-
formFactor: DeviceFormFactorUnknown,
|
|
30
|
-
gpuRenderer: '',
|
|
31
|
-
gpuVendor: '',
|
|
32
|
-
isHdr: false,
|
|
33
|
-
isJailbroken: false,
|
|
34
|
-
isLowEndDevice: false,
|
|
35
|
-
isRooted: false,
|
|
36
|
-
isVirtual: false,
|
|
37
|
-
manufacturer: '',
|
|
38
|
-
marketingName: '',
|
|
39
|
-
model: '',
|
|
40
|
-
osBuild: '',
|
|
41
|
-
osName: '',
|
|
42
|
-
osVersion: '',
|
|
43
|
-
platformString: '',
|
|
44
|
-
productName: '',
|
|
45
|
-
supportedAbis: [],
|
|
46
|
-
totalMemory: -1,
|
|
47
|
-
webViewVersion: '',
|
|
48
|
-
});
|
|
14
|
+
const out = allocateEntity();
|
|
15
|
+
initializeDeviceInfo(out);
|
|
16
|
+
return finishEntity(out);
|
|
49
17
|
}
|
|
50
18
|
export function createSafeAreaInsets() {
|
|
51
|
-
|
|
19
|
+
const out = allocateEntity();
|
|
20
|
+
initializeSafeAreaInsets(out);
|
|
21
|
+
return finishEntity(out);
|
|
52
22
|
}
|
|
53
23
|
export function getDeviceCapabilities(host, out) {
|
|
54
24
|
return host.system.device.getCapabilities(out);
|
|
@@ -65,6 +35,53 @@ export function getDeviceInfo(host, out) {
|
|
|
65
35
|
export function getSafeAreaInsets(host, out) {
|
|
66
36
|
return host.system.device.getSafeAreaInsets(out);
|
|
67
37
|
}
|
|
38
|
+
export function initializeDeviceCapabilities(out) {
|
|
39
|
+
out.hasKeyboard = false;
|
|
40
|
+
out.hasMouse = false;
|
|
41
|
+
out.hasStylus = false;
|
|
42
|
+
}
|
|
43
|
+
export function initializeDeviceDisplayMetrics(out) {
|
|
44
|
+
out.colorDepth = -1;
|
|
45
|
+
out.densityDpi = -1;
|
|
46
|
+
out.logicalHeight = -1;
|
|
47
|
+
out.logicalWidth = -1;
|
|
48
|
+
out.physicalHeight = -1;
|
|
49
|
+
out.physicalWidth = -1;
|
|
50
|
+
out.pixelRatio = -1;
|
|
51
|
+
}
|
|
52
|
+
export function initializeDeviceInfo(out) {
|
|
53
|
+
out.arch = '';
|
|
54
|
+
out.availableMemory = -1;
|
|
55
|
+
out.boardName = '';
|
|
56
|
+
out.colorGamut = '';
|
|
57
|
+
out.cpuCores = -1;
|
|
58
|
+
out.fontScale = -1;
|
|
59
|
+
out.formFactor = DeviceFormFactorUnknown;
|
|
60
|
+
out.gpuRenderer = '';
|
|
61
|
+
out.gpuVendor = '';
|
|
62
|
+
out.isHdr = false;
|
|
63
|
+
out.isJailbroken = false;
|
|
64
|
+
out.isLowEndDevice = false;
|
|
65
|
+
out.isRooted = false;
|
|
66
|
+
out.isVirtual = false;
|
|
67
|
+
out.manufacturer = '';
|
|
68
|
+
out.marketingName = '';
|
|
69
|
+
out.model = '';
|
|
70
|
+
out.osBuild = '';
|
|
71
|
+
out.osName = '';
|
|
72
|
+
out.osVersion = '';
|
|
73
|
+
out.platformString = '';
|
|
74
|
+
out.productName = '';
|
|
75
|
+
out.supportedAbis = [];
|
|
76
|
+
out.totalMemory = -1;
|
|
77
|
+
out.webViewVersion = '';
|
|
78
|
+
}
|
|
79
|
+
export function initializeSafeAreaInsets(out) {
|
|
80
|
+
out.bottom = 0;
|
|
81
|
+
out.left = 0;
|
|
82
|
+
out.right = 0;
|
|
83
|
+
out.top = 0;
|
|
84
|
+
}
|
|
68
85
|
export function refreshDeviceInfo(host) {
|
|
69
86
|
host.system.device.refresh?.();
|
|
70
87
|
}
|
package/dist/device.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AASzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,UAAU,wBAAwB;IACtC,MAAM,GAAG,GAAG,cAAc,EAAsB,CAAC;IACjD,4BAA4B,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,YAAY,CAAC,GAAG,CAAC,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AG,CAAC,aAAa,GAAG,EAAE,CAAC;IACvB,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;IACf,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC;IACjB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAChB,GAAG,CAAC,SAAS,GAAG,EAAE,CAAC;IACnB,GAAG,CAAC,cAAc,GAAG,EAAE,CAAC;IACxB,GAAG,CAAC,WAAW,GAAG,EAAE,CAAC;IACrB,GAAG,CAAC,aAAa,GAAG,EAAE,CAAC;IACvB,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;IACrB,GAAG,CAAC,cAAc,GAAG,EAAE,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,GAAuC;IAC9E,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;IACf,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC;IACb,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IACd,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AACd,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAqB;IACrD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/device",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.903.f434bc2",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/entity": "0.5.1-next.
|
|
42
|
-
"@flighthq/types": "0.5.1-next.
|
|
43
|
-
"@flighthq/useragent": "0.5.1-next.
|
|
41
|
+
"@flighthq/entity": "0.5.1-next.903.f434bc2",
|
|
42
|
+
"@flighthq/types": "0.5.1-next.903.f434bc2",
|
|
43
|
+
"@flighthq/useragent": "0.5.1-next.903.f434bc2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"typescript": "^5.3.0"
|