@flighthq/device 0.5.1-next.1069.554a2ac → 0.5.1-next.1201.9b49dee

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 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.1069.554a2ac](https://github.com/flighthq/flight/tree/554a2acc3fecf189b89b0729308ff890a15c21cc/packages/device)
17
- - [License](https://github.com/flighthq/flight/blob/554a2acc3fecf189b89b0729308ff890a15c21cc/LICENSE.md)
16
+ - [Source for @flighthq/device@0.5.1-next.1201.9b49dee](https://github.com/flighthq/flight/tree/9b49dee3f22f6b2838c3d237edcc77bca65734f2/packages/device)
17
+ - [License](https://github.com/flighthq/flight/blob/9b49dee3f22f6b2838c3d237edcc77bca65734f2/LICENSE.md)
package/dist/device.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- import type { DeviceCapabilities, DeviceDisplayMetrics, DeviceInfo, EntityConstruction, HasSystemDevice, SafeAreaInsets } from '@flighthq/types/contract';
1
+ import type { DeviceCapabilities, DeviceDisplayMetrics, DeviceInfo, EntityConstruction, HostDeviceProvider, 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;
5
5
  export declare function createSafeAreaInsets(): SafeAreaInsets;
6
- export declare function getDeviceCapabilities(host: HasSystemDevice, out: DeviceCapabilities): DeviceCapabilities;
7
- export declare function getDeviceDisplayMetrics(host: HasSystemDevice, out: DeviceDisplayMetrics): DeviceDisplayMetrics;
8
- export declare function getDeviceId(host: HasSystemDevice): string;
9
- export declare function getDeviceInfo(host: HasSystemDevice, out: DeviceInfo): DeviceInfo;
10
- export declare function getSafeAreaInsets(host: HasSystemDevice, out: SafeAreaInsets): SafeAreaInsets;
6
+ export declare function getDeviceCapabilities(hostDevice: Readonly<HostDeviceProvider>, out: DeviceCapabilities): DeviceCapabilities;
7
+ export declare function getDeviceDisplayMetrics(hostDevice: Readonly<HostDeviceProvider>, out: DeviceDisplayMetrics): DeviceDisplayMetrics;
8
+ export declare function getDeviceId(hostDevice: Readonly<HostDeviceProvider>): string;
9
+ export declare function getDeviceInfo(hostDevice: Readonly<HostDeviceProvider>, out: DeviceInfo): DeviceInfo;
10
+ export declare function getSafeAreaInsets(hostDevice: Readonly<HostDeviceProvider>, out: SafeAreaInsets): SafeAreaInsets;
11
11
  export declare function initializeDeviceCapabilities(out: EntityConstruction<DeviceCapabilities>): void;
12
12
  export declare function initializeDeviceDisplayMetrics(out: EntityConstruction<DeviceDisplayMetrics>): void;
13
13
  export declare function initializeDeviceInfo(out: EntityConstruction<DeviceInfo>): void;
14
14
  export declare function initializeSafeAreaInsets(out: EntityConstruction<SafeAreaInsets>): void;
15
- export declare function refreshDeviceInfo(host: HasSystemDevice): void;
15
+ export declare function refreshDeviceInfo(hostDevice: Readonly<HostDeviceProvider>): void;
16
16
  //# sourceMappingURL=device.d.ts.map
@@ -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,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,E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GACtB,kBAAkB,CAEpB;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,QAAQ,CAAC,kBAAkB,CAAC,EACxC,GAAG,EAAE,oBAAoB,GACxB,oBAAoB,CAEtB;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAAG,MAAM,CAE5E;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAEnG;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,GAAG,EAAE,cAAc,GAAG,cAAc,CAE/G;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,UAAU,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAEhF"}
package/dist/device.js CHANGED
@@ -20,20 +20,20 @@ export function createSafeAreaInsets() {
20
20
  initializeSafeAreaInsets(out);
21
21
  return finishEntity(out);
22
22
  }
23
- export function getDeviceCapabilities(host, out) {
24
- return host.system.device.getCapabilities(out);
23
+ export function getDeviceCapabilities(hostDevice, out) {
24
+ return hostDevice.getCapabilities(out);
25
25
  }
26
- export function getDeviceDisplayMetrics(host, out) {
27
- return host.system.device.getDisplayMetrics(out);
26
+ export function getDeviceDisplayMetrics(hostDevice, out) {
27
+ return hostDevice.getDisplayMetrics(out);
28
28
  }
29
- export function getDeviceId(host) {
30
- return host.system.device.getId();
29
+ export function getDeviceId(hostDevice) {
30
+ return hostDevice.getId();
31
31
  }
32
- export function getDeviceInfo(host, out) {
33
- return host.system.device.getInfo(out);
32
+ export function getDeviceInfo(hostDevice, out) {
33
+ return hostDevice.getInfo(out);
34
34
  }
35
- export function getSafeAreaInsets(host, out) {
36
- return host.system.device.getSafeAreaInsets(out);
35
+ export function getSafeAreaInsets(hostDevice, out) {
36
+ return hostDevice.getSafeAreaInsets(out);
37
37
  }
38
38
  export function initializeDeviceCapabilities(out) {
39
39
  out.hasKeyboard = false;
@@ -82,7 +82,7 @@ export function initializeSafeAreaInsets(out) {
82
82
  out.right = 0;
83
83
  out.top = 0;
84
84
  }
85
- export function refreshDeviceInfo(host) {
86
- host.system.device.refresh?.();
85
+ export function refreshDeviceInfo(hostDevice) {
86
+ hostDevice.refresh?.();
87
87
  }
88
88
  //# sourceMappingURL=device.js.map
@@ -1 +1 @@
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,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,MAAM,GAAG,GAAG,cAAc,EAAwB,CAAC;IACnD,8BAA8B,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,MAAM,GAAG,GAAG,cAAc,EAAc,CAAC;IACzC,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAC1B,OAAO,YAAY,CAAC,G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,GAAG,CAAC,CAAC;IACd,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AACd,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,UAAwC;IACxE,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-next.1069.554a2ac",
3
+ "version": "0.5.1-next.1201.9b49dee",
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.1069.554a2ac",
42
- "@flighthq/types": "0.5.1-next.1069.554a2ac",
43
- "@flighthq/useragent": "0.5.1-next.1069.554a2ac"
41
+ "@flighthq/entity": "0.5.1-next.1201.9b49dee",
42
+ "@flighthq/types": "0.5.1-next.1201.9b49dee",
43
+ "@flighthq/useragent": "0.5.1-next.1201.9b49dee"
44
44
  },
45
45
  "devDependencies": {
46
46
  "typescript": "^5.3.0"
@@ -1,9 +1,8 @@
1
1
  import type {
2
- DeviceBackend,
2
+ HostDeviceProvider,
3
3
  DeviceCapabilities,
4
4
  DeviceDisplayMetrics,
5
5
  DeviceInfo,
6
- HasSystemDevice,
7
6
  SafeAreaInsets,
8
7
  } from '@flighthq/types/contract';
9
8
  import { DeviceFormFactorUnknown, EntityRuntimeKey } from '@flighthq/types/contract';
@@ -26,7 +25,7 @@ import {
26
25
  refreshDeviceInfo,
27
26
  } from './device';
28
27
 
29
- function fakeBackend(): DeviceBackend {
28
+ function fakeBackend(): HostDeviceProvider {
30
29
  return {
31
30
  [EntityRuntimeKey]: undefined,
32
31
  getCapabilities(out: DeviceCapabilities): DeviceCapabilities {
@@ -86,7 +85,7 @@ function fakeBackend(): DeviceBackend {
86
85
  };
87
86
  }
88
87
 
89
- function fakeHost(): HasSystemDevice {
88
+ function fakeHost(): { readonly system: { readonly device: HostDeviceProvider } } {
90
89
  return { system: { device: fakeBackend() } };
91
90
  }
92
91
 
@@ -153,7 +152,7 @@ describe('getDeviceCapabilities', () => {
153
152
  it('fills and returns out via the host backend', () => {
154
153
  const host = fakeHost();
155
154
  const out = createDeviceCapabilities();
156
- const result = getDeviceCapabilities(host, out);
155
+ const result = getDeviceCapabilities(host.system.device, out);
157
156
  expect(result).toBe(out);
158
157
  expect(out.hasKeyboard).toBe(true);
159
158
  expect(out.hasMouse).toBe(true);
@@ -165,7 +164,7 @@ describe('getDeviceDisplayMetrics', () => {
165
164
  it('fills and returns out via the host backend', () => {
166
165
  const host = fakeHost();
167
166
  const out = createDeviceDisplayMetrics();
168
- const result = getDeviceDisplayMetrics(host, out);
167
+ const result = getDeviceDisplayMetrics(host.system.device, out);
169
168
  expect(result).toBe(out);
170
169
  expect(out.colorDepth).toBe(8);
171
170
  expect(out.densityDpi).toBe(440);
@@ -180,7 +179,7 @@ describe('getDeviceDisplayMetrics', () => {
180
179
  describe('getDeviceId', () => {
181
180
  it('returns the value from the host backend', () => {
182
181
  const host = fakeHost();
183
- expect(getDeviceId(host)).toBe('test-device-id');
182
+ expect(getDeviceId(host.system.device)).toBe('test-device-id');
184
183
  });
185
184
  });
186
185
 
@@ -188,7 +187,7 @@ describe('getDeviceInfo', () => {
188
187
  it('fills and returns out via the host backend', () => {
189
188
  const host = fakeHost();
190
189
  const out = createDeviceInfo();
191
- const result = getDeviceInfo(host, out);
190
+ const result = getDeviceInfo(host.system.device, out);
192
191
  expect(result).toBe(out);
193
192
  expect(out.arch).toBe('arm64');
194
193
  expect(out.availableMemory).toBe(3_000_000_000);
@@ -222,7 +221,7 @@ describe('getSafeAreaInsets', () => {
222
221
  it('fills and returns out via the host backend', () => {
223
222
  const host = fakeHost();
224
223
  const out = createSafeAreaInsets();
225
- const result = getSafeAreaInsets(host, out);
224
+ const result = getSafeAreaInsets(host.system.device, out);
226
225
  expect(result).toBe(out);
227
226
  expect(out.top).toBe(24);
228
227
  expect(out.bottom).toBe(16);
@@ -274,7 +273,7 @@ describe('R3 boundary', () => {
274
273
  describe('refreshDeviceInfo', () => {
275
274
  it('does not throw on a backend without refresh', () => {
276
275
  const host = fakeHost();
277
- expect(() => refreshDeviceInfo(host)).not.toThrow();
276
+ expect(() => refreshDeviceInfo(host.system.device)).not.toThrow();
278
277
  });
279
278
 
280
279
  it('calls refresh() on backends that expose it', () => {
@@ -285,8 +284,8 @@ describe('refreshDeviceInfo', () => {
285
284
  refreshed = true;
286
285
  },
287
286
  };
288
- const host: HasSystemDevice = { system: { device: backend } };
289
- refreshDeviceInfo(host);
287
+ const host: { readonly system: { readonly device: HostDeviceProvider } } = { system: { device: backend } };
288
+ refreshDeviceInfo(host.system.device);
290
289
  expect(refreshed).toBe(true);
291
290
  });
292
291
  });