@scrumble-nl/react-native-honeywell-scanner 1.4.2 → 1.4.4

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.
@@ -7,6 +7,7 @@ import com.facebook.react.bridge.*;
7
7
  import com.facebook.react.modules.core.DeviceEventManagerModule;
8
8
  import com.honeywell.aidc.*;
9
9
  import com.honeywell.aidc.AidcManager.CreatedCallback;
10
+ import com.honeywell.aidc.AidcManager.*;
10
11
 
11
12
  import javax.annotation.Nullable;
12
13
 
package/dist/index.d.ts CHANGED
@@ -3,26 +3,21 @@
3
3
  * @param {String} eventName Name of event one of barcodeReadSuccess, barcodeReadFail
4
4
  * @param {Function} handler Event handler
5
5
  */
6
+ export declare type ScanEvent = (event: {
7
+ data: string;
8
+ }) => void;
6
9
  interface Scanner {
7
- registerListener: (event: (event: {
8
- data: string;
9
- }) => void) => void;
10
+ registerListener: (event: ScanEvent) => void;
10
11
  clearEventListeners: () => void;
11
- onBarcodeReadFail?: (event: (event: {
12
- data: string;
13
- }) => void) => void;
12
+ onBarcodeReadFail?: (event: ScanEvent) => void;
14
13
  }
15
14
  declare class Honeywell implements Scanner {
16
15
  subscriptionBarcodeReadSuccess: any;
17
16
  subscriptionBarcodeReadFail: any;
18
17
  constructor();
19
- registerListener: (event: (event: {
20
- data: string;
21
- }) => void) => void;
18
+ registerListener: (event: ScanEvent) => void;
22
19
  clearEventListeners: () => void;
23
- onBarcodeReadFail: (event: (event: {
24
- data: string;
25
- }) => void) => void;
20
+ onBarcodeReadFail: (event: ScanEvent) => void;
26
21
  }
27
22
  declare const _default: Honeywell;
28
23
  export default _default;
package/dist/index.js CHANGED
@@ -6,21 +6,16 @@ const barcodeReaderEmitter = new react_native_1.NativeEventEmitter(HoneywellScan
6
6
  class Honeywell {
7
7
  constructor() {
8
8
  this.registerListener = (event) => {
9
- console.log('register event 1: ', event);
10
9
  HoneywellScanner.startReader().then(() => {
11
10
  var _a;
12
- console.log('register event 2: ', event);
13
11
  (_a = this.subscriptionBarcodeReadSuccess) === null || _a === void 0 ? void 0 : _a.remove();
14
12
  this.subscriptionBarcodeReadSuccess = null;
15
13
  this.subscriptionBarcodeReadSuccess = barcodeReaderEmitter.addListener(HoneywellScanner.BARCODE_READ_SUCCESS, event);
16
- console.log('success', this.subscriptionBarcodeReadSuccess);
17
14
  });
18
15
  };
19
16
  this.clearEventListeners = () => {
20
- console.log('clear 1');
21
17
  HoneywellScanner.stopReader().then(() => {
22
18
  var _a;
23
- console.log('clear 2');
24
19
  (_a = this.subscriptionBarcodeReadSuccess) === null || _a === void 0 ? void 0 : _a.remove();
25
20
  });
26
21
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scrumble-nl/react-native-honeywell-scanner",
3
3
  "title": "React Native Honeywell Scanner",
4
- "version": "1.4.2",
4
+ "version": "1.4.4",
5
5
  "description": "Bridge to use the Honeywell scanner",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",