@scrumble-nl/react-native-honeywell-scanner 1.3.9 → 1.3.10
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/dist/index.d.ts +2 -28
- package/dist/index.js +17 -32
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @param {String} eventName Name of event one of barcodeReadSuccess, barcodeReadFail
|
|
4
|
-
* @param {Function} handler Event handler
|
|
5
|
-
*/
|
|
6
|
-
interface Scanner {
|
|
7
|
-
registerListener: (event: (event: {
|
|
8
|
-
data: string;
|
|
9
|
-
}) => void) => void;
|
|
10
|
-
clearEventListeners: () => void;
|
|
11
|
-
onBarcodeReadFail?: (event: (event: {
|
|
12
|
-
data: string;
|
|
13
|
-
}) => void) => void;
|
|
14
|
-
}
|
|
15
|
-
declare class Honeywell implements Scanner {
|
|
16
|
-
subscriptionBarcodeReadSuccess: any;
|
|
17
|
-
subscriptionBarcodeReadFail: any;
|
|
18
|
-
constructor();
|
|
19
|
-
registerListener: (event: (event: {
|
|
20
|
-
data: string;
|
|
21
|
-
}) => void) => void;
|
|
22
|
-
clearEventListeners: () => void;
|
|
23
|
-
onBarcodeReadFail: (event: (event: {
|
|
24
|
-
data: string;
|
|
25
|
-
}) => void) => void;
|
|
26
|
-
}
|
|
27
|
-
declare const _default: Honeywell;
|
|
28
|
-
export default _default;
|
|
1
|
+
declare const HoneywellScanner: any;
|
|
2
|
+
export default HoneywellScanner;
|
package/dist/index.js
CHANGED
|
@@ -3,35 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const react_native_1 = require("react-native");
|
|
4
4
|
const { HoneywellScanner } = react_native_1.NativeModules;
|
|
5
5
|
const barcodeReaderEmitter = new react_native_1.NativeEventEmitter(HoneywellScanner);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
console.log('clear 2');
|
|
24
|
-
(_a = this.subscriptionBarcodeReadSuccess) === null || _a === void 0 ? void 0 : _a.remove();
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
this.onBarcodeReadFail = (event) => {
|
|
28
|
-
var _a;
|
|
29
|
-
(_a = this.subscriptionBarcodeReadFail) === null || _a === void 0 ? void 0 : _a.remove();
|
|
30
|
-
this.subscriptionBarcodeReadFail = null;
|
|
31
|
-
this.subscriptionBarcodeReadFail = barcodeReaderEmitter.addListener(HoneywellScanner.BARCODE_READ_FAIL, event);
|
|
32
|
-
};
|
|
33
|
-
this.subscriptionBarcodeReadSuccess = null;
|
|
34
|
-
this.subscriptionBarcodeReadFail = null;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.default = new Honeywell();
|
|
6
|
+
let subscriptionBarcodeReadSuccess = null;
|
|
7
|
+
let subscriptionBarcodeReadFail = null;
|
|
8
|
+
HoneywellScanner.onBarcodeReadSuccess = (handler) => {
|
|
9
|
+
subscriptionBarcodeReadSuccess === null || subscriptionBarcodeReadSuccess === void 0 ? void 0 : subscriptionBarcodeReadSuccess.remove();
|
|
10
|
+
subscriptionBarcodeReadSuccess = barcodeReaderEmitter.addListener(HoneywellScanner.BARCODE_READ_SUCCESS, handler);
|
|
11
|
+
};
|
|
12
|
+
HoneywellScanner.onBarcodeReadFail = (handler) => {
|
|
13
|
+
subscriptionBarcodeReadFail === null || subscriptionBarcodeReadFail === void 0 ? void 0 : subscriptionBarcodeReadFail.remove();
|
|
14
|
+
subscriptionBarcodeReadFail = barcodeReaderEmitter.addListener(HoneywellScanner.BARCODE_READ_FAIL, handler);
|
|
15
|
+
};
|
|
16
|
+
HoneywellScanner.offBarcodeReadSuccess = () => {
|
|
17
|
+
subscriptionBarcodeReadSuccess === null || subscriptionBarcodeReadSuccess === void 0 ? void 0 : subscriptionBarcodeReadSuccess.remove();
|
|
18
|
+
};
|
|
19
|
+
HoneywellScanner.offBarcodeReadFail = () => {
|
|
20
|
+
subscriptionBarcodeReadFail === null || subscriptionBarcodeReadFail === void 0 ? void 0 : subscriptionBarcodeReadFail.remove();
|
|
21
|
+
};
|
|
22
|
+
exports.default = HoneywellScanner;
|
package/package.json
CHANGED