@ovok/native 1.16.1-dev.2141 → 1.16.1-dev.2145
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/lib/commonjs/modules/next/background-sync/index.js +11 -0
- package/lib/commonjs/modules/next/background-sync/index.js.map +1 -1
- package/lib/commonjs/modules/next/background-sync/offline-measurement-background-sync.js +63 -0
- package/lib/commonjs/modules/next/background-sync/offline-measurement-background-sync.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-peripheral.js +35 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-peripheral.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js +3 -30
- package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js +2 -2
- package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth-runtime.js +28 -0
- package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth-runtime.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/web/index.js +208 -0
- package/lib/commonjs/modules/next/bluetooth/web/index.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-ble-device.js +143 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-ble-device.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-ble-shapes.js +43 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-ble-shapes.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-bluetooth-permissions.js +21 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-bluetooth-permissions.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-bluetooth-scanner.js +133 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-bluetooth-scanner.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-bluetooth-services.js +28 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-bluetooth-services.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-bluetooth-values.js +37 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-bluetooth-values.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-bluetooth.types.js +2 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-bluetooth.types.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-gatt.js +83 -0
- package/lib/commonjs/modules/next/bluetooth/web/web-gatt.js.map +1 -0
- package/lib/module/modules/next/background-sync/index.js +1 -0
- package/lib/module/modules/next/background-sync/index.js.map +1 -1
- package/lib/module/modules/next/background-sync/offline-measurement-background-sync.js +55 -0
- package/lib/module/modules/next/background-sync/offline-measurement-background-sync.js.map +1 -0
- package/lib/module/modules/next/bluetooth/ble-plx/ble-peripheral.js +30 -0
- package/lib/module/modules/next/bluetooth/ble-plx/ble-peripheral.js.map +1 -0
- package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js +2 -27
- package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -1
- package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js +1 -1
- package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -1
- package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -1
- package/lib/module/modules/next/bluetooth/web/create-web-bluetooth-runtime.js +25 -0
- package/lib/module/modules/next/bluetooth/web/create-web-bluetooth-runtime.js.map +1 -0
- package/lib/module/modules/next/bluetooth/web/index.js +28 -0
- package/lib/module/modules/next/bluetooth/web/index.js.map +1 -0
- package/lib/module/modules/next/bluetooth/web/web-ble-device.js +140 -0
- package/lib/module/modules/next/bluetooth/web/web-ble-device.js.map +1 -0
- package/lib/module/modules/next/bluetooth/web/web-ble-shapes.js +39 -0
- package/lib/module/modules/next/bluetooth/web/web-ble-shapes.js.map +1 -0
- package/lib/module/modules/next/bluetooth/web/web-bluetooth-permissions.js +18 -0
- package/lib/module/modules/next/bluetooth/web/web-bluetooth-permissions.js.map +1 -0
- package/lib/module/modules/next/bluetooth/web/web-bluetooth-scanner.js +128 -0
- package/lib/module/modules/next/bluetooth/web/web-bluetooth-scanner.js.map +1 -0
- package/lib/module/modules/next/bluetooth/web/web-bluetooth-services.js +25 -0
- package/lib/module/modules/next/bluetooth/web/web-bluetooth-services.js.map +1 -0
- package/lib/module/modules/next/bluetooth/web/web-bluetooth-values.js +29 -0
- package/lib/module/modules/next/bluetooth/web/web-bluetooth-values.js.map +1 -0
- package/lib/module/modules/next/bluetooth/web/web-bluetooth.types.js +2 -0
- package/lib/module/modules/next/bluetooth/web/web-bluetooth.types.js.map +1 -0
- package/lib/module/modules/next/bluetooth/web/web-gatt.js +79 -0
- package/lib/module/modules/next/bluetooth/web/web-gatt.js.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/background-sync/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/next/background-sync/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/background-sync/offline-measurement-background-sync.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/next/background-sync/offline-measurement-background-sync.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-peripheral.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-peripheral.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +3 -7
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth-runtime.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth-runtime.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/index.d.ts +41 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-ble-device.d.ts +53 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-ble-device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-ble-shapes.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-ble-shapes.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-bluetooth-permissions.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-bluetooth-permissions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-bluetooth-scanner.d.ts +29 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-bluetooth-scanner.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-bluetooth-services.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-bluetooth-services.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-bluetooth-values.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-bluetooth-values.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-bluetooth.types.d.ts +56 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-bluetooth.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-gatt.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/web-gatt.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/background-sync/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/next/background-sync/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/background-sync/offline-measurement-background-sync.d.ts +22 -0
- package/lib/typescript/module/src/modules/next/background-sync/offline-measurement-background-sync.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-peripheral.d.ts +8 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-peripheral.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +3 -7
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +2 -2
- package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth-runtime.d.ts +23 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth-runtime.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/index.d.ts +41 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-ble-device.d.ts +53 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-ble-device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-ble-shapes.d.ts +27 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-ble-shapes.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-bluetooth-permissions.d.ts +8 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-bluetooth-permissions.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-bluetooth-scanner.d.ts +29 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-bluetooth-scanner.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-bluetooth-services.d.ts +10 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-bluetooth-services.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-bluetooth-values.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-bluetooth-values.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-bluetooth.types.d.ts +56 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-bluetooth.types.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-gatt.d.ts +27 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/web-gatt.d.ts.map +1 -0
- package/package.json +11 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bluetooth for `@ovok/native/next` in browsers, over Web Bluetooth: the same `BluetoothRuntime`, devices, result
|
|
3
|
+
* policies and hooks as `@ovok/native/next/bluetooth`, with a Web Bluetooth scanner instead of `react-native-ble-plx`.
|
|
4
|
+
* Nothing here loads `react-native-ble-plx` or `react-native-permissions`, so a web bundle can import it.
|
|
5
|
+
*
|
|
6
|
+
* Import from `@ovok/native/next/bluetooth/web`.
|
|
7
|
+
*
|
|
8
|
+
* @module next/bluetooth/web
|
|
9
|
+
*/
|
|
10
|
+
export { createWebBluetoothRuntime } from "./create-web-bluetooth-runtime";
|
|
11
|
+
export type { CreateWebBluetoothRuntimeOptions } from "./create-web-bluetooth-runtime";
|
|
12
|
+
export { isWebBluetoothAvailable, webBluetoothScanner } from "./web-bluetooth-scanner";
|
|
13
|
+
export type { WebBluetoothScanner, WebBluetoothScannerOptions } from "./web-bluetooth-scanner";
|
|
14
|
+
export { webBluetoothPermissions } from "./web-bluetooth-permissions";
|
|
15
|
+
export { WEB_BLUETOOTH_SERVICES, webBluetoothServicesFor } from "./web-bluetooth-services";
|
|
16
|
+
export { BluetoothRuntime } from "../runtime";
|
|
17
|
+
export type { BluetoothRuntimeOptions } from "../runtime";
|
|
18
|
+
export { BluetoothError } from "../errors";
|
|
19
|
+
export type { BluetoothErrorCode } from "../errors";
|
|
20
|
+
export type { BluetoothSnapshot, ConnectionState, DeviceReading, NearbyDevice, SaveState } from "../snapshot";
|
|
21
|
+
export type { AdapterState, Advertisement, BluetoothScanner, Peripheral } from "../transport";
|
|
22
|
+
export type { BluetoothPermission, BluetoothPermissions } from "../permissions";
|
|
23
|
+
export type { ReadingSink, SaveResult } from "../sink";
|
|
24
|
+
export { defineDevice } from "../devices";
|
|
25
|
+
export type { DeviceDefinition, DeviceMatch, DeviceSupport } from "../devices";
|
|
26
|
+
export type { DeviceEvent, DeviceProtocol, Driver } from "../driver";
|
|
27
|
+
export type { DeviceInformation, Link } from "../link";
|
|
28
|
+
export { acceptedMemorySlots, dailyTotalsOnly, everyReading, firstReadingPerKind, keepReadings, policyByKind, } from "../result-policy";
|
|
29
|
+
export type { ResultPolicy } from "../result-policy";
|
|
30
|
+
export { SIG_PROTOCOLS } from "../sig-profiles";
|
|
31
|
+
export { builtInDevices } from "../ble-plx/built-in-devices";
|
|
32
|
+
export { IntegratedDevices } from "../../../bt-management/types/integrated-devices";
|
|
33
|
+
export type { AcceptedDevice } from "../../../bt-management/types/accepted-device";
|
|
34
|
+
export { Devices, SUPPORTED_DEVICES } from "../../../bt-device/constants/supported-devices";
|
|
35
|
+
export type { SupportedDeviceDefinition } from "../../../bt-device/constants/supported-devices";
|
|
36
|
+
export { resultPoliciesFor } from "../../../bt-device/utils/device-query";
|
|
37
|
+
export { ovokReadingSink } from "../react-native/ovok-sink";
|
|
38
|
+
export { BluetoothProvider, useBluetooth } from "../react/context";
|
|
39
|
+
export type { BluetoothProviderProps } from "../react/context";
|
|
40
|
+
export { useBluetoothPermission, useBluetoothState, useMeasurements, useNearbyDevice, useNearbyDevices, usePairedDevices, useScanning, } from "../react/hooks";
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/web/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,YAAY,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACvF,YAAY,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAE3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,YAAY,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC9G,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9F,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAChF,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC/E,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACrE,YAAY,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACpF,YAAY,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAC5F,YAAY,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,GACZ,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { BleCharacteristic, WebBleError } from "./web-ble-shapes";
|
|
2
|
+
import { WebBluetoothDevice } from "./web-bluetooth.types";
|
|
3
|
+
type MonitorListener = (error: WebBleError | null, characteristic: BleCharacteristic | null) => void;
|
|
4
|
+
type DisconnectListener = (error: WebBleError | null, device: WebBleDevice) => void;
|
|
5
|
+
type Subscription = {
|
|
6
|
+
remove: () => void;
|
|
7
|
+
};
|
|
8
|
+
/** Advertising data a browser saw for the device, when it let the page watch advertisements. */
|
|
9
|
+
type WebBleAdvertisement = {
|
|
10
|
+
serviceUUIDs: string[] | null;
|
|
11
|
+
manufacturerData: string | null;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A Web Bluetooth device behind the part of the `react-native-ble-plx` `Device` API the SDK's device classes use, so
|
|
15
|
+
* every integrated device and `defineCustomDevice` declaration runs unchanged in a browser. Operations queue (see
|
|
16
|
+
* `WebGatt`), so a write also waits for notifications still being started.
|
|
17
|
+
*/
|
|
18
|
+
declare class WebBleDevice {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly name: string | null;
|
|
21
|
+
readonly localName: string | null;
|
|
22
|
+
readonly manufacturerData: string | null;
|
|
23
|
+
readonly mtu = 23;
|
|
24
|
+
readonly rssi: null;
|
|
25
|
+
serviceUUIDs: string[] | null;
|
|
26
|
+
private readonly gatt;
|
|
27
|
+
private readonly monitors;
|
|
28
|
+
private readonly disconnectListeners;
|
|
29
|
+
constructor(device: WebBluetoothDevice, advertisement?: WebBleAdvertisement);
|
|
30
|
+
connect(): Promise<this>;
|
|
31
|
+
isConnected(): Promise<boolean>;
|
|
32
|
+
cancelConnection(): Promise<this>;
|
|
33
|
+
requestMTU(): Promise<this>;
|
|
34
|
+
/** Discovers the services, and reports them as advertised when the browser showed none. */
|
|
35
|
+
discoverAllServicesAndCharacteristics(): Promise<this>;
|
|
36
|
+
services(): Promise<{
|
|
37
|
+
uuid: string;
|
|
38
|
+
deviceID: string;
|
|
39
|
+
isPrimary: boolean;
|
|
40
|
+
}[]>;
|
|
41
|
+
characteristicsForService(serviceUuid: string): Promise<BleCharacteristic[]>;
|
|
42
|
+
readCharacteristicForService(serviceUuid: string, characteristicUuid: string): Promise<BleCharacteristic>;
|
|
43
|
+
writeCharacteristicWithResponseForService(serviceUuid: string, characteristicUuid: string, base64: string): Promise<BleCharacteristic>;
|
|
44
|
+
writeCharacteristicWithoutResponseForService(serviceUuid: string, characteristicUuid: string, base64: string): Promise<BleCharacteristic>;
|
|
45
|
+
/** Starts notifications in the GATT queue; `listener` gets each value, then `DeviceDisconnected` if the link drops. */
|
|
46
|
+
monitorCharacteristicForService(serviceUuid: string, characteristicUuid: string, listener: MonitorListener): Subscription;
|
|
47
|
+
onDisconnected(listener: DisconnectListener): Subscription;
|
|
48
|
+
private readonly onDisconnect;
|
|
49
|
+
private write;
|
|
50
|
+
}
|
|
51
|
+
export { WebBleDevice };
|
|
52
|
+
export type { WebBleAdvertisement };
|
|
53
|
+
//# sourceMappingURL=web-ble-device.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-ble-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/web/web-ble-device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA4C,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE5G,OAAO,EAA8B,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAQvF,KAAK,eAAe,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,EAAE,cAAc,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;AACrG,KAAK,kBAAkB,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;AACpF,KAAK,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAE3C,gGAAgG;AAChG,KAAK,mBAAmB,GAAG;IAAE,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAE9F;;;;GAIG;AACH,cAAM,YAAY;IAChB,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,SAAgB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,SAAgB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,SAAgB,GAAG,MAAe;IAClC,SAAgB,IAAI,OAAQ;IACrB,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACrC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA8B;IACvD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAiC;gBAElD,MAAM,EAAE,kBAAkB,EAAE,aAAa,CAAC,EAAE,mBAAmB;IAUrE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAMxB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAQjC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxC,2FAA2F;IAC9E,qCAAqC,IAAI,OAAO,CAAC,IAAI,CAAC;IAc5D,QAAQ,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAK7E,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAM5E,4BAA4B,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IASzG,yCAAyC,CAC9C,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,EAC1B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC;IAItB,4CAA4C,CACjD,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,EAC1B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC;IAI7B,uHAAuH;IAChH,+BAA+B,CACpC,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,EAC1B,QAAQ,EAAE,eAAe,GACxB,YAAY;IA0CR,cAAc,CAAC,QAAQ,EAAE,kBAAkB,GAAG,YAAY;IAMjE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAO3B;IAEF,OAAO,CAAC,KAAK;CAed;AAED,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { WebBluetoothCharacteristic } from "./web-bluetooth.types";
|
|
2
|
+
/** `react-native-ble-plx`'s BleErrorCode.DeviceDisconnected, which ends a link instead of failing it. */
|
|
3
|
+
declare const DEVICE_DISCONNECTED = 201;
|
|
4
|
+
declare const UNKNOWN_ERROR = 0;
|
|
5
|
+
/** A failed Web Bluetooth operation in the shape `react-native-ble-plx` reports errors. */
|
|
6
|
+
declare class WebBleError extends Error {
|
|
7
|
+
readonly errorCode: number;
|
|
8
|
+
readonly reason?: unknown | undefined;
|
|
9
|
+
constructor(errorCode: number, message: string, reason?: unknown | undefined);
|
|
10
|
+
}
|
|
11
|
+
/** A characteristic in the shape `react-native-ble-plx` returns one, with its value as base64. */
|
|
12
|
+
type BleCharacteristic = {
|
|
13
|
+
id: string;
|
|
14
|
+
uuid: string;
|
|
15
|
+
serviceUUID: string;
|
|
16
|
+
deviceID: string;
|
|
17
|
+
value: string | null;
|
|
18
|
+
isReadable: boolean;
|
|
19
|
+
isWritableWithResponse: boolean;
|
|
20
|
+
isWritableWithoutResponse: boolean;
|
|
21
|
+
isNotifiable: boolean;
|
|
22
|
+
isIndicatable: boolean;
|
|
23
|
+
};
|
|
24
|
+
declare const toBleCharacteristic: (deviceID: string, serviceUUID: string, characteristic: WebBluetoothCharacteristic, value: string | null) => BleCharacteristic;
|
|
25
|
+
export { DEVICE_DISCONNECTED, toBleCharacteristic, UNKNOWN_ERROR, WebBleError };
|
|
26
|
+
export type { BleCharacteristic };
|
|
27
|
+
//# sourceMappingURL=web-ble-shapes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-ble-shapes.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/web/web-ble-shapes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,yGAAyG;AACzG,QAAA,MAAM,mBAAmB,MAAM,CAAC;AAChC,QAAA,MAAM,aAAa,IAAI,CAAC;AAExB,2FAA2F;AAC3F,cAAM,WAAY,SAAQ,KAAK;aACM,SAAS,EAAE,MAAM;aAAmC,MAAM,CAAC,EAAE,OAAO;gBAApE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAkB,MAAM,CAAC,EAAE,OAAO,YAAA;CAIxG;AAED,kGAAkG;AAClG,KAAK,iBAAiB,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,sBAAsB,EAAE,OAAO,CAAC;IAChC,yBAAyB,EAAE,OAAO,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,mBAAmB,GACvB,UAAU,MAAM,EAChB,aAAa,MAAM,EACnB,gBAAgB,0BAA0B,EAC1C,OAAO,MAAM,GAAG,IAAI,KACnB,iBAgBF,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC;AAChF,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BluetoothPermissions } from "../permissions";
|
|
2
|
+
/**
|
|
3
|
+
* Browser permissions: the browser asks per device in its chooser, so there is no prompt to show first. Granted where
|
|
4
|
+
* the browser has Web Bluetooth, denied where it has none; no settings page can change that.
|
|
5
|
+
*/
|
|
6
|
+
declare const webBluetoothPermissions: () => BluetoothPermissions;
|
|
7
|
+
export { webBluetoothPermissions };
|
|
8
|
+
//# sourceMappingURL=web-bluetooth-permissions.d.ts.map
|
package/lib/typescript/module/src/modules/next/bluetooth/web/web-bluetooth-permissions.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-bluetooth-permissions.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/web/web-bluetooth-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAI3E;;;GAGG;AACH,QAAA,MAAM,uBAAuB,QAAO,oBAInC,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AcceptedDevice } from "../../../bt-management/types/accepted-device";
|
|
2
|
+
import { BluetoothScanner, Peripheral } from "../transport";
|
|
3
|
+
import { WebBluetooth } from "./web-bluetooth.types";
|
|
4
|
+
/** What `webBluetoothScanner` needs. */
|
|
5
|
+
type WebBluetoothScannerOptions = {
|
|
6
|
+
/** The accepted devices; the chooser also allows the services of their `defineCustomDevice` declarations. */
|
|
7
|
+
acceptedDevices?: readonly AcceptedDevice[];
|
|
8
|
+
/** The Web Bluetooth API; defaults to `navigator.bluetooth`. */
|
|
9
|
+
bluetooth?: WebBluetooth;
|
|
10
|
+
};
|
|
11
|
+
/** A `BluetoothScanner` for browsers, where a page only reaches the devices the user picks in the browser's chooser. */
|
|
12
|
+
interface WebBluetoothScanner extends BluetoothScanner {
|
|
13
|
+
/**
|
|
14
|
+
* Opens the browser's device chooser, so it must run from a user gesture such as a tap. Resolves to the picked device,
|
|
15
|
+
* which a running scan also reports, or to `undefined` when the user closes the chooser.
|
|
16
|
+
*/
|
|
17
|
+
chooseDevice(): Promise<Peripheral | undefined>;
|
|
18
|
+
}
|
|
19
|
+
/** Whether this browser has Web Bluetooth, such as Chrome and Edge on desktop and Android, or Bluefy on iOS. */
|
|
20
|
+
declare const isWebBluetoothAvailable: () => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Finds devices through Web Bluetooth. A scan reports the devices this site may already use (`getDevices`, where the
|
|
23
|
+
* browser has it) and every device picked with `chooseDevice`; browsers can't scan in the background or without the
|
|
24
|
+
* user picking.
|
|
25
|
+
*/
|
|
26
|
+
declare const webBluetoothScanner: ({ acceptedDevices, bluetooth, }?: WebBluetoothScannerOptions) => WebBluetoothScanner;
|
|
27
|
+
export { isWebBluetoothAvailable, webBluetoothScanner };
|
|
28
|
+
export type { WebBluetoothScanner, WebBluetoothScannerOptions };
|
|
29
|
+
//# sourceMappingURL=web-bluetooth-scanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-bluetooth-scanner.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/web/web-bluetooth-scanner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAI9E,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK5D,OAAO,EAAE,YAAY,EAAiD,MAAM,uBAAuB,CAAC;AAMpG,wCAAwC;AACxC,KAAK,0BAA0B,GAAG;IAEhC,6GAA6G;IAC7G,eAAe,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAE5C,gEAAgE;IAChE,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B,CAAC;AAEF,wHAAwH;AACxH,UAAU,mBAAoB,SAAQ,gBAAgB;IAEpD;;;OAGG;IACH,YAAY,IAAI,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;CACjD;AAKD,gHAAgH;AAChH,QAAA,MAAM,uBAAuB,QAAO,OAA6C,CAAC;AAiClF;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,GAAI,kCAG1B,0BAA+B,KAAG,mBAkFpC,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AcceptedDevice } from "../../../bt-management/types/accepted-device";
|
|
2
|
+
/**
|
|
3
|
+
* Every GATT service an integrated device uses, as a browser must be told when the user picks a device: a page can
|
|
4
|
+
* only reach the services it named in `navigator.bluetooth.requestDevice`'s `optionalServices`.
|
|
5
|
+
*/
|
|
6
|
+
declare const WEB_BLUETOOTH_SERVICES: readonly string[];
|
|
7
|
+
/** `WEB_BLUETOOTH_SERVICES` and the services of the `defineCustomDevice` declarations among `acceptedDevices`. */
|
|
8
|
+
declare const webBluetoothServicesFor: (acceptedDevices?: readonly AcceptedDevice[]) => string[];
|
|
9
|
+
export { WEB_BLUETOOTH_SERVICES, webBluetoothServicesFor };
|
|
10
|
+
//# sourceMappingURL=web-bluetooth-services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-bluetooth-services.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/web/web-bluetooth-services.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAiC9E;;;GAGG;AACH,QAAA,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAS5C,CAAC;AAEF,kHAAkH;AAClH,QAAA,MAAM,uBAAuB,GAAI,kBAAiB,SAAS,cAAc,EAAO,KAAG,MAAM,EAExF,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A UUID as Web Bluetooth accepts it: lower case, with a 16- or 32-bit alias expanded on the Bluetooth base UUID. */
|
|
2
|
+
declare const canonicalUuid: (uuid: string) => string;
|
|
3
|
+
declare const bytesOf: (view: DataView) => Uint8Array;
|
|
4
|
+
declare const toBase64: (bytes: Uint8Array) => string;
|
|
5
|
+
declare const fromBase64: (base64: string) => Uint8Array;
|
|
6
|
+
/** Manufacturer data the way `react-native-ble-plx` reports it: the company ID, little endian, then the payload. */
|
|
7
|
+
declare const manufacturerDataOf: (data: ReadonlyMap<number, DataView> | undefined) => string | null;
|
|
8
|
+
export { bytesOf, canonicalUuid, fromBase64, manufacturerDataOf, toBase64 };
|
|
9
|
+
//# sourceMappingURL=web-bluetooth-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-bluetooth-values.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/web/web-bluetooth-values.ts"],"names":[],"mappings":"AAIA,sHAAsH;AACtH,QAAA,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,MAQrC,CAAC;AAEF,QAAA,MAAM,OAAO,GAAI,MAAM,QAAQ,KAAG,UAA2E,CAAC;AAE9G,QAAA,MAAM,QAAQ,GAAI,OAAO,UAAU,KAAG,MAA+E,CAAC;AAEtH,QAAA,MAAM,UAAU,GAAI,QAAQ,MAAM,KAAG,UAAyE,CAAC;AAE/G,oHAAoH;AACpH,QAAA,MAAM,kBAAkB,GAAI,MAAM,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS,KAAG,MAAM,GAAG,IAUtF,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** The part of the Web Bluetooth API (`navigator.bluetooth`) the SDK uses; TypeScript's ESNext lib has none of it. */
|
|
2
|
+
type WebBluetoothListener = (event: unknown) => void;
|
|
3
|
+
interface WebBluetoothEventTarget {
|
|
4
|
+
addEventListener(type: string, listener: WebBluetoothListener): void;
|
|
5
|
+
removeEventListener(type: string, listener: WebBluetoothListener): void;
|
|
6
|
+
}
|
|
7
|
+
interface WebBluetoothCharacteristic extends WebBluetoothEventTarget {
|
|
8
|
+
readonly uuid: string;
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly read: boolean;
|
|
11
|
+
readonly write: boolean;
|
|
12
|
+
readonly writeWithoutResponse: boolean;
|
|
13
|
+
readonly notify: boolean;
|
|
14
|
+
readonly indicate: boolean;
|
|
15
|
+
};
|
|
16
|
+
readonly value?: DataView;
|
|
17
|
+
readValue(): Promise<DataView>;
|
|
18
|
+
writeValue(value: Uint8Array): Promise<void>;
|
|
19
|
+
writeValueWithResponse?(value: Uint8Array): Promise<void>;
|
|
20
|
+
writeValueWithoutResponse?(value: Uint8Array): Promise<void>;
|
|
21
|
+
startNotifications(): Promise<unknown>;
|
|
22
|
+
stopNotifications(): Promise<unknown>;
|
|
23
|
+
}
|
|
24
|
+
interface WebBluetoothService {
|
|
25
|
+
readonly uuid: string;
|
|
26
|
+
getCharacteristics(): Promise<WebBluetoothCharacteristic[]>;
|
|
27
|
+
}
|
|
28
|
+
interface WebBluetoothServer {
|
|
29
|
+
readonly connected: boolean;
|
|
30
|
+
connect(): Promise<unknown>;
|
|
31
|
+
disconnect(): void;
|
|
32
|
+
getPrimaryServices(): Promise<WebBluetoothService[]>;
|
|
33
|
+
}
|
|
34
|
+
interface WebBluetoothDevice extends WebBluetoothEventTarget {
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly name?: string | null;
|
|
37
|
+
readonly gatt?: WebBluetoothServer;
|
|
38
|
+
watchAdvertisements?(options?: {
|
|
39
|
+
signal?: AbortSignal;
|
|
40
|
+
}): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
/** What `advertisementreceived` carries. */
|
|
43
|
+
interface WebBluetoothAdvertisement {
|
|
44
|
+
readonly uuids?: readonly string[];
|
|
45
|
+
readonly manufacturerData?: ReadonlyMap<number, DataView>;
|
|
46
|
+
}
|
|
47
|
+
interface WebBluetooth extends WebBluetoothEventTarget {
|
|
48
|
+
getAvailability(): Promise<boolean>;
|
|
49
|
+
requestDevice(options: {
|
|
50
|
+
acceptAllDevices: true;
|
|
51
|
+
optionalServices: string[];
|
|
52
|
+
}): Promise<WebBluetoothDevice>;
|
|
53
|
+
getDevices?(): Promise<WebBluetoothDevice[]>;
|
|
54
|
+
}
|
|
55
|
+
export type { WebBluetooth, WebBluetoothAdvertisement, WebBluetoothCharacteristic, WebBluetoothDevice, WebBluetoothListener, WebBluetoothServer, WebBluetoothService, };
|
|
56
|
+
//# sourceMappingURL=web-bluetooth.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-bluetooth.types.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/web/web-bluetooth.types.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;AAErD,UAAU,uBAAuB;IAC/B,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrE,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACzE;AAED,UAAU,0BAA2B,SAAQ,uBAAuB;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QACvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;QACxB,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;QACvC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;KAC5B,CAAC;IACF,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC;IAC1B,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/B,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,sBAAsB,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,yBAAyB,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACvC;AAED,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kBAAkB,IAAI,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAAC;CAC7D;AAED,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,IAAI,IAAI,CAAC;IACnB,kBAAkB,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;CACtD;AAED,UAAU,kBAAmB,SAAQ,uBAAuB;IAC1D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IACnC,mBAAmB,CAAC,CAAC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzE;AAED,4CAA4C;AAC5C,UAAU,yBAAyB;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAC3D;AAED,UAAU,YAAa,SAAQ,uBAAuB;IACpD,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,aAAa,CAAC,OAAO,EAAE;QAAE,gBAAgB,EAAE,IAAI,CAAC;QAAC,gBAAgB,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC5G,UAAU,CAAC,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;CAC9C;AAED,YAAY,EACV,YAAY,EACZ,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,GACpB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { WebBleError } from "./web-ble-shapes";
|
|
2
|
+
import { WebBluetoothCharacteristic, WebBluetoothDevice, WebBluetoothServer } from "./web-bluetooth.types";
|
|
3
|
+
/**
|
|
4
|
+
* A device's GATT server as one queue: browsers allow one GATT operation at a time, so each runs after the previous one
|
|
5
|
+
* settles, and its services are discovered once per connection.
|
|
6
|
+
*/
|
|
7
|
+
declare class WebGatt {
|
|
8
|
+
private readonly device;
|
|
9
|
+
private readonly characteristics;
|
|
10
|
+
private operations;
|
|
11
|
+
private discovered?;
|
|
12
|
+
constructor(device: WebBluetoothDevice);
|
|
13
|
+
get connected(): boolean;
|
|
14
|
+
server(): WebBluetoothServer;
|
|
15
|
+
/** Runs `operation` after the previous one settles; a failure comes back as a `react-native-ble-plx` error. */
|
|
16
|
+
queued<T>(operation: () => Promise<T>): Promise<T>;
|
|
17
|
+
/** The discovered services' UUIDs; call it inside a queued operation, so discovery never queues behind itself. */
|
|
18
|
+
serviceUuids(): Promise<string[]>;
|
|
19
|
+
characteristicsOf(serviceUuid: string): Promise<WebBluetoothCharacteristic[]>;
|
|
20
|
+
characteristic(serviceUuid: string, characteristicUuid: string): Promise<WebBluetoothCharacteristic>;
|
|
21
|
+
/** Forgets the discovered services, as a new connection must discover them again. */
|
|
22
|
+
forget(): void;
|
|
23
|
+
errorOf(error: unknown): WebBleError;
|
|
24
|
+
private discover;
|
|
25
|
+
}
|
|
26
|
+
export { WebGatt };
|
|
27
|
+
//# sourceMappingURL=web-gatt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-gatt.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/web/web-gatt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEnF,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI3G;;;GAGG;AACH,cAAM,OAAO;IAKQ,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJ1C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA8D;IAC9F,OAAO,CAAC,UAAU,CAAuC;IACzD,OAAO,CAAC,UAAU,CAAC,CAAgB;gBAEC,MAAM,EAAE,kBAAkB;IAE9D,IAAW,SAAS,IAAI,OAAO,CAE9B;IAEM,MAAM,IAAI,kBAAkB;IAQnC,+GAA+G;IACxG,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAUzD,kHAAkH;IACrG,YAAY,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAMjC,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAM7E,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAcjH,qFAAqF;IAC9E,MAAM,IAAI,IAAI;IAId,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW;IAQ3C,OAAO,CAAC,QAAQ;CAkBjB;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovok/native",
|
|
3
|
-
"version": "1.16.1-dev.
|
|
3
|
+
"version": "1.16.1-dev.2145+8eb3814",
|
|
4
4
|
"description": "React native component sdk for OVOK",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -136,11 +136,13 @@
|
|
|
136
136
|
"eslint-plugin-testing-library": "^6.4.0",
|
|
137
137
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
138
138
|
"expo-apple-authentication": "~57.0.2",
|
|
139
|
+
"expo-background-task": "~57.0.21",
|
|
139
140
|
"expo-file-system": "~57.0.7",
|
|
140
141
|
"expo-health-connect": "^0.1.1",
|
|
141
142
|
"expo-image": "~57.0.5",
|
|
142
143
|
"expo-linear-gradient": "~57.0.2",
|
|
143
144
|
"expo-notifications": "57.0.21",
|
|
145
|
+
"expo-task-manager": "~57.0.21",
|
|
144
146
|
"expo-web-browser": "~57.0.3",
|
|
145
147
|
"formik": "^2.4.9",
|
|
146
148
|
"globals": "^15.11.0",
|
|
@@ -195,6 +197,7 @@
|
|
|
195
197
|
"@shopify/flash-list": "*",
|
|
196
198
|
"date-fns": "*",
|
|
197
199
|
"expo-apple-authentication": "*",
|
|
200
|
+
"expo-background-task": "*",
|
|
198
201
|
"expo-crypto": "*",
|
|
199
202
|
"expo-file-system": "*",
|
|
200
203
|
"expo-health-connect": "*",
|
|
@@ -203,6 +206,7 @@
|
|
|
203
206
|
"expo-notifications": "*",
|
|
204
207
|
"expo-secure-store": "*",
|
|
205
208
|
"expo-standard-web-crypto": "*",
|
|
209
|
+
"expo-task-manager": "*",
|
|
206
210
|
"expo-web-browser": "*",
|
|
207
211
|
"formik": "*",
|
|
208
212
|
"i18next": "*",
|
|
@@ -265,6 +269,9 @@
|
|
|
265
269
|
"expo-apple-authentication": {
|
|
266
270
|
"optional": true
|
|
267
271
|
},
|
|
272
|
+
"expo-background-task": {
|
|
273
|
+
"optional": true
|
|
274
|
+
},
|
|
268
275
|
"expo-crypto": {
|
|
269
276
|
"optional": true
|
|
270
277
|
},
|
|
@@ -289,6 +296,9 @@
|
|
|
289
296
|
"expo-standard-web-crypto": {
|
|
290
297
|
"optional": true
|
|
291
298
|
},
|
|
299
|
+
"expo-task-manager": {
|
|
300
|
+
"optional": true
|
|
301
|
+
},
|
|
292
302
|
"expo-web-browser": {
|
|
293
303
|
"optional": true
|
|
294
304
|
},
|