@flighthq/device 0.5.1-edge.1471.4e82419 → 0.5.1-edge.1685.dc0e23a
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 +0 -1
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +0 -1
- package/dist/contract.js.map +1 -1
- package/dist/device.d.ts +5 -9
- package/dist/device.d.ts.map +1 -1
- package/dist/device.js +40 -60
- package/dist/device.js.map +1 -1
- package/package.json +4 -4
- package/src/device.test.ts +0 -27
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-edge.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/device@0.5.1-edge.1685.dc0e23a](https://github.com/flighthq/flight/tree/dc0e23a17453ec75c20ccbf07058a57b5ef10c4c/packages/device)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/dc0e23a17453ec75c20ccbf07058a57b5ef10c4c/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"}
|
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"}
|
package/dist/device.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import type { DeviceCapabilities, DeviceDisplayMetrics, DeviceInfo,
|
|
2
|
-
export declare function createDeviceCapabilities(): DeviceCapabilities
|
|
3
|
-
export declare function createDeviceDisplayMetrics(): DeviceDisplayMetrics
|
|
4
|
-
export declare function createDeviceInfo(): DeviceInfo
|
|
5
|
-
export declare function createSafeAreaInsets(): SafeAreaInsets
|
|
1
|
+
import type { DeviceCapabilities, DeviceDisplayMetrics, DeviceInfo, HostDeviceCapability, NonEntityCreateResult, SafeAreaInsets } from '@flighthq/types/contract';
|
|
2
|
+
export declare function createDeviceCapabilities(): NonEntityCreateResult<DeviceCapabilities, 'descriptor'>;
|
|
3
|
+
export declare function createDeviceDisplayMetrics(): NonEntityCreateResult<DeviceDisplayMetrics, 'descriptor'>;
|
|
4
|
+
export declare function createDeviceInfo(): NonEntityCreateResult<DeviceInfo, 'descriptor'>;
|
|
5
|
+
export declare function createSafeAreaInsets(): NonEntityCreateResult<SafeAreaInsets, 'descriptor'>;
|
|
6
6
|
export declare function getDeviceCapabilities(hostDevice: Readonly<HostDeviceCapability>, out: DeviceCapabilities): DeviceCapabilities;
|
|
7
7
|
export declare function getDeviceDisplayMetrics(hostDevice: Readonly<HostDeviceCapability>, out: DeviceDisplayMetrics): DeviceDisplayMetrics;
|
|
8
8
|
export declare function getDeviceId(hostDevice: Readonly<HostDeviceCapability>): string;
|
|
9
9
|
export declare function getDeviceInfo(hostDevice: Readonly<HostDeviceCapability>, out: DeviceInfo): DeviceInfo;
|
|
10
10
|
export declare function getSafeAreaInsets(hostDevice: Readonly<HostDeviceCapability>, 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;
|
|
15
11
|
export declare function refreshDeviceInfo(hostDevice: Readonly<HostDeviceCapability>): void;
|
|
16
12
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,wBAAwB,IAAI,qBAAqB,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAElG;AAED,wBAAgB,0BAA0B,IAAI,qBAAqB,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAYtG;AAED,wBAAgB,gBAAgB,IAAI,qBAAqB,CAAC,UAAU,EAAE,YAAY,CAAC,CA4BlF;AAED,wBAAgB,oBAAoB,IAAI,qBAAqB,CAAC,cAAc,EAAE,YAAY,CAAC,CAE1F;AAED,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAC1C,GAAG,EAAE,kBAAkB,GACtB,kBAAkB,CAEpB;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAC1C,GAAG,EAAE,oBAAoB,GACxB,oBAAoB,CAEtB;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAAC,GAAG,MAAM,CAE9E;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAErG;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,GAAG,EAAE,cAAc,GAAG,cAAc,CAEjH;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAElF"}
|
package/dist/device.js
CHANGED
|
@@ -1,24 +1,51 @@
|
|
|
1
|
-
import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
2
1
|
import { DeviceFormFactorUnknown } from '@flighthq/types/contract';
|
|
3
2
|
export function createDeviceCapabilities() {
|
|
4
|
-
|
|
5
|
-
initializeDeviceCapabilities(out);
|
|
6
|
-
return finishEntity(out);
|
|
3
|
+
return { hasKeyboard: false, hasMouse: false, hasStylus: false };
|
|
7
4
|
}
|
|
8
5
|
export function createDeviceDisplayMetrics() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return
|
|
6
|
+
// -1 is the "not reported" sentinel every field starts at, so a host that supplies only some of
|
|
7
|
+
// them leaves the rest visibly unknown rather than reading as a real zero.
|
|
8
|
+
return {
|
|
9
|
+
colorDepth: -1,
|
|
10
|
+
densityDpi: -1,
|
|
11
|
+
logicalHeight: -1,
|
|
12
|
+
logicalWidth: -1,
|
|
13
|
+
physicalHeight: -1,
|
|
14
|
+
physicalWidth: -1,
|
|
15
|
+
pixelRatio: -1,
|
|
16
|
+
};
|
|
12
17
|
}
|
|
13
18
|
export function createDeviceInfo() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
return {
|
|
20
|
+
arch: '',
|
|
21
|
+
availableMemory: -1,
|
|
22
|
+
boardName: '',
|
|
23
|
+
colorGamut: '',
|
|
24
|
+
cpuCores: -1,
|
|
25
|
+
fontScale: -1,
|
|
26
|
+
formFactor: DeviceFormFactorUnknown,
|
|
27
|
+
gpuRenderer: '',
|
|
28
|
+
gpuVendor: '',
|
|
29
|
+
isHdr: false,
|
|
30
|
+
isJailbroken: false,
|
|
31
|
+
isLowEndDevice: false,
|
|
32
|
+
isRooted: false,
|
|
33
|
+
isVirtual: false,
|
|
34
|
+
manufacturer: '',
|
|
35
|
+
marketingName: '',
|
|
36
|
+
model: '',
|
|
37
|
+
osBuild: '',
|
|
38
|
+
osName: '',
|
|
39
|
+
osVersion: '',
|
|
40
|
+
platformString: '',
|
|
41
|
+
productName: '',
|
|
42
|
+
supportedAbis: [],
|
|
43
|
+
totalMemory: -1,
|
|
44
|
+
webViewVersion: '',
|
|
45
|
+
};
|
|
17
46
|
}
|
|
18
47
|
export function createSafeAreaInsets() {
|
|
19
|
-
|
|
20
|
-
initializeSafeAreaInsets(out);
|
|
21
|
-
return finishEntity(out);
|
|
48
|
+
return { bottom: 0, left: 0, right: 0, top: 0 };
|
|
22
49
|
}
|
|
23
50
|
export function getDeviceCapabilities(hostDevice, out) {
|
|
24
51
|
return hostDevice.getCapabilities(out);
|
|
@@ -35,53 +62,6 @@ export function getDeviceInfo(hostDevice, out) {
|
|
|
35
62
|
export function getSafeAreaInsets(hostDevice, out) {
|
|
36
63
|
return hostDevice.getSafeAreaInsets(out);
|
|
37
64
|
}
|
|
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
|
-
}
|
|
85
65
|
export function refreshDeviceInfo(hostDevice) {
|
|
86
66
|
hostDevice.refresh?.();
|
|
87
67
|
}
|
package/dist/device.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,UAAU,wBAAwB;IACtC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACnE,CAAC;AAED,MAAM,UA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CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,UAA0C,EAC1C,GAAyB;IAEzB,OAAO,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,UAA0C;IACpE,OAAO,UAAU,CAAC,KAAK,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAA0C,EAAE,GAAe;IACvF,OAAO,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,UAA0C,EAAE,GAAmB;IAC/F,OAAO,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,UAA0C;IAC1E,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;AACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/device",
|
|
3
|
-
"version": "0.5.1-edge.
|
|
3
|
+
"version": "0.5.1-edge.1685.dc0e23a",
|
|
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-edge.
|
|
42
|
-
"@flighthq/types": "0.5.1-edge.
|
|
43
|
-
"@flighthq/useragent": "0.5.1-edge.
|
|
41
|
+
"@flighthq/entity": "0.5.1-edge.1685.dc0e23a",
|
|
42
|
+
"@flighthq/types": "0.5.1-edge.1685.dc0e23a",
|
|
43
|
+
"@flighthq/useragent": "0.5.1-edge.1685.dc0e23a"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"typescript": "^5.3.0"
|
package/src/device.test.ts
CHANGED
|
@@ -18,10 +18,6 @@ import {
|
|
|
18
18
|
getDeviceId,
|
|
19
19
|
getDeviceInfo,
|
|
20
20
|
getSafeAreaInsets,
|
|
21
|
-
initializeDeviceCapabilities,
|
|
22
|
-
initializeDeviceDisplayMetrics,
|
|
23
|
-
initializeDeviceInfo,
|
|
24
|
-
initializeSafeAreaInsets,
|
|
25
21
|
refreshDeviceInfo,
|
|
26
22
|
} from './device';
|
|
27
23
|
|
|
@@ -227,29 +223,6 @@ describe('getSafeAreaInsets', () => {
|
|
|
227
223
|
});
|
|
228
224
|
});
|
|
229
225
|
|
|
230
|
-
describe('initializeDeviceCapabilities', () => {
|
|
231
|
-
it('is the construction initializer of createDeviceCapabilities', () => {
|
|
232
|
-
expect(typeof initializeDeviceCapabilities).toBe('function');
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
describe('initializeDeviceDisplayMetrics', () => {
|
|
237
|
-
it('is the construction initializer of createDeviceDisplayMetrics', () => {
|
|
238
|
-
expect(typeof initializeDeviceDisplayMetrics).toBe('function');
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
describe('initializeDeviceInfo', () => {
|
|
242
|
-
it('is the construction initializer of createDeviceInfo', () => {
|
|
243
|
-
expect(typeof initializeDeviceInfo).toBe('function');
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
describe('initializeSafeAreaInsets', () => {
|
|
248
|
-
it('is the construction initializer of createSafeAreaInsets', () => {
|
|
249
|
-
expect(typeof initializeSafeAreaInsets).toBe('function');
|
|
250
|
-
});
|
|
251
|
-
});
|
|
252
|
-
|
|
253
226
|
describe('R3 boundary', () => {
|
|
254
227
|
it('exports no ambient-state API (setDeviceBackend, getDeviceBackend, etc.)', () => {
|
|
255
228
|
const exports = Object.keys(deviceContract);
|