build: include bob lib output
This commit is contained in:
8
lib/module/NativeBplScale.js
Normal file
8
lib/module/NativeBplScale.js
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
import { NativeModules } from 'react-native';
|
||||
const {
|
||||
BplScale
|
||||
} = NativeModules;
|
||||
export default BplScale;
|
||||
//# sourceMappingURL=NativeBplScale.js.map
|
||||
1
lib/module/NativeBplScale.js.map
Normal file
1
lib/module/NativeBplScale.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["NativeModules","BplScale"],"sourceRoot":"..\\..\\src","sources":["NativeBplScale.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,cAAc;AAY5C,MAAM;EAAEC;AAAS,CAAC,GAAGD,aAAa;AAElC,eAAeC,QAAQ","ignoreList":[]}
|
||||
28
lib/module/index.js
Normal file
28
lib/module/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
import { NativeModules, Platform } from 'react-native';
|
||||
const {
|
||||
BplScale
|
||||
} = NativeModules;
|
||||
|
||||
/**
|
||||
* Scan BLE devices and return weight and impedance.
|
||||
* @param scanDurationMs Duration of scan in milliseconds
|
||||
* @returns Promise resolving to a list of BLE devices with weight & impedance
|
||||
*/
|
||||
export const scanDevices = async scanDurationMs => {
|
||||
if (Platform.OS !== 'android') {
|
||||
throw new Error('BplScale module is only supported on Android.');
|
||||
}
|
||||
try {
|
||||
const devices = await BplScale.scanDevices(scanDurationMs);
|
||||
return devices;
|
||||
} catch (error) {
|
||||
console.error('BLE Scan Error:', error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
export default {
|
||||
scanDevices
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
lib/module/index.js.map
Normal file
1
lib/module/index.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["NativeModules","Platform","BplScale","scanDevices","scanDurationMs","OS","Error","devices","error","console"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAatD,MAAM;EAAEC;AAAS,CAAC,GAAGF,aAAiD;;AAEtE;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,WAAW,GAAG,MAAOC,cAAsB,IAA2B;EACjF,IAAIH,QAAQ,CAACI,EAAE,KAAK,SAAS,EAAE;IAC7B,MAAM,IAAIC,KAAK,CAAC,+CAA+C,CAAC;EAClE;EAEA,IAAI;IACF,MAAMC,OAAO,GAAG,MAAML,QAAQ,CAACC,WAAW,CAACC,cAAc,CAAC;IAC1D,OAAOG,OAAO;EAChB,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAAC,iBAAiB,EAAEA,KAAK,CAAC;IACvC,MAAMA,KAAK;EACb;AACF,CAAC;AAED,eAAe;EACbL;AACF,CAAC","ignoreList":[]}
|
||||
1
lib/module/package.json
Normal file
1
lib/module/package.json
Normal file
@@ -0,0 +1 @@
|
||||
{"type":"module"}
|
||||
Reference in New Issue
Block a user