scandit-datacapture-frameworks-label 8.4.1 → 8.5.0

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.
Files changed (28) hide show
  1. package/__mocks__/ScanditDataCaptureCore.ts +14 -6
  2. package/dist/dts/defaults/index.d.ts +1 -1
  3. package/dist/dts/labelcapture/AdaptiveRecognitionResult.d.ts +1 -1
  4. package/dist/dts/labelcapture/CapturedLabel.d.ts +2 -2
  5. package/dist/dts/labelcapture/LabelCaptureFeedback.d.ts +2 -2
  6. package/dist/dts/labelcapture/LabelField.d.ts +6 -6
  7. package/dist/dts/labelcapture/ReceiptScanningResult.d.ts +3 -3
  8. package/dist/dts/labelcapture/controller/LabelCaptureAdaptiveRecognitionOverlayController.d.ts +6 -4
  9. package/dist/dts/labelcapture/controller/LabelCaptureAdvancedOverlayController.d.ts +2 -0
  10. package/dist/dts/labelcapture/controller/LabelCaptureBasicOverlayController.d.ts +2 -0
  11. package/dist/dts/labelcapture/controller/LabelCaptureValidationFlowOverlayController.d.ts +2 -0
  12. package/dist/dts/labelcapture/private/PrivateLabelField.d.ts +4 -4
  13. package/dist/dts/labelcapture/view/LabelCaptureAdaptiveRecognitionListener.d.ts +1 -1
  14. package/dist/dts/labelcapture/view/LabelCaptureAdaptiveRecognitionOverlay.d.ts +4 -4
  15. package/dist/dts/labelcapture/view/LabelCaptureAdvancedOverlay.d.ts +1 -1
  16. package/dist/dts/labelcapture/view/LabelCaptureAdvancedOverlayListener.d.ts +5 -5
  17. package/dist/dts/labelcapture/view/LabelCaptureAdvancedOverlayView.d.ts +1 -1
  18. package/dist/dts/proxy-types.d.ts +1 -1
  19. package/dist/index.js +205 -99
  20. package/dist/index.js.map +1 -1
  21. package/jest.config.js +4 -11
  22. package/package.json +3 -3
  23. package/test/AdaptiveRecognitionResultType.test.ts +0 -1
  24. package/test/BarcodeFieldSymbologies.test.ts +29 -0
  25. package/test/LabelCaptureAdaptiveRecognitionSettings.test.ts +0 -1
  26. package/test/LabelCaptureValidationFlowOverlayController.test.ts +9 -2
  27. package/test/ReceiptScanningLineItem.test.ts +15 -16
  28. package/test/ReceiptScanningResult.test.ts +22 -59
@@ -1,6 +1,13 @@
1
1
  import { jest } from '@jest/globals';
2
- import { DataCaptureContext, DataCaptureMode, DataCaptureOverlay, DataCaptureView, NativeCaller, PrivateDataCaptureOverlay } from 'scandit-datacapture-frameworks-core';
3
- import { EventEmitter } from "scandit-datacapture-frameworks-core/node_modules/eventemitter3"
2
+ import {
3
+ DataCaptureContext,
4
+ DataCaptureMode,
5
+ DataCaptureOverlay,
6
+ DataCaptureView,
7
+ NativeCaller,
8
+ PrivateDataCaptureOverlay,
9
+ } from 'scandit-datacapture-frameworks-core';
10
+ import { EventEmitter } from 'scandit-datacapture-frameworks-core/node_modules/eventemitter3';
4
11
 
5
12
  export class MockDataCaptureView implements DataCaptureView {
6
13
  public get viewId(): number {
@@ -34,7 +41,7 @@ export class MockDataCaptureContext implements DataCaptureContext {
34
41
  });
35
42
 
36
43
  update = jest.fn(() => Promise.resolve());
37
- initializeAsync = jest.fn(() => Promise.resolve())
44
+ initializeAsync = jest.fn(() => Promise.resolve());
38
45
  }
39
46
 
40
47
  // Mock subscription object that mimics React Native's EmitterSubscription
@@ -73,8 +80,10 @@ export class MockNativeEventEmitter {
73
80
  }
74
81
 
75
82
  export class MockCaller implements NativeCaller {
76
- constructor(public nativeModule: any, public emmiter: MockNativeEventEmitter) {
77
- }
83
+ constructor(
84
+ public nativeModule: any,
85
+ public emmiter: MockNativeEventEmitter
86
+ ) {}
78
87
 
79
88
  eventHook(args: any) {
80
89
  return args;
@@ -91,4 +100,3 @@ export class MockCaller implements NativeCaller {
91
100
  }
92
101
  }
93
102
  }
94
-
@@ -1 +1 @@
1
- export { loadLabelCaptureDefaults, getLabelCaptureDefaults, LabelCaptureDefaults, setLabelCaptureDefaultsLoader, ensureLabelCaptureDefaults } from './LabelCaptureDefaults';
1
+ export { loadLabelCaptureDefaults, getLabelCaptureDefaults, LabelCaptureDefaults, setLabelCaptureDefaultsLoader, ensureLabelCaptureDefaults, } from './LabelCaptureDefaults';
@@ -1,4 +1,4 @@
1
- import { AdaptiveRecognitionResultType } from "./AdaptiveRecognitionResultType";
1
+ import { AdaptiveRecognitionResultType } from './AdaptiveRecognitionResultType';
2
2
  export declare abstract class AdaptiveRecognitionResult {
3
3
  get resultType(): AdaptiveRecognitionResultType;
4
4
  }
@@ -1,5 +1,5 @@
1
- import { Quadrilateral } from "scandit-datacapture-frameworks-core";
2
- import { LabelField } from "./LabelField";
1
+ import { Quadrilateral } from 'scandit-datacapture-frameworks-core';
2
+ import { LabelField } from './LabelField';
3
3
  export declare class CapturedLabel {
4
4
  private _fields;
5
5
  private _name;
@@ -1,5 +1,5 @@
1
- import { DefaultSerializeable, Feedback } from "scandit-datacapture-frameworks-core";
2
- import { LabelCaptureController } from "./controller/LabelCaptureController";
1
+ import { DefaultSerializeable, Feedback } from 'scandit-datacapture-frameworks-core';
2
+ import { LabelCaptureController } from './controller/LabelCaptureController';
3
3
  export declare class LabelCaptureFeedback extends DefaultSerializeable {
4
4
  static get defaultFeedback(): LabelCaptureFeedback;
5
5
  private static get labelCaptureDefaults();
@@ -1,9 +1,9 @@
1
- import { Quadrilateral } from "scandit-datacapture-frameworks-core";
2
- import { Barcode } from "scandit-datacapture-frameworks-barcode";
3
- import { LabelDateResult } from "./LabelDateResult";
4
- import { LabelFieldState } from "./LabelFieldState";
5
- import { LabelFieldType } from "./LabelFieldType";
6
- import { LabelFieldValueType } from "./LabelFieldValueType";
1
+ import { Quadrilateral } from 'scandit-datacapture-frameworks-core';
2
+ import { Barcode } from 'scandit-datacapture-frameworks-barcode';
3
+ import { LabelDateResult } from './LabelDateResult';
4
+ import { LabelFieldState } from './LabelFieldState';
5
+ import { LabelFieldType } from './LabelFieldType';
6
+ import { LabelFieldValueType } from './LabelFieldValueType';
7
7
  export declare class LabelField {
8
8
  private _name;
9
9
  private _type;
@@ -1,6 +1,6 @@
1
- import { AdaptiveRecognitionResult } from "./AdaptiveRecognitionResult";
2
- import { ReceiptScanningLineItem } from "./ReceiptScanningLineItem";
3
- import { AdaptiveRecognitionResultType } from "./AdaptiveRecognitionResultType";
1
+ import { AdaptiveRecognitionResult } from './AdaptiveRecognitionResult';
2
+ import { ReceiptScanningLineItem } from './ReceiptScanningLineItem';
3
+ import { AdaptiveRecognitionResultType } from './AdaptiveRecognitionResultType';
4
4
  export declare class ReceiptScanningResult implements AdaptiveRecognitionResult {
5
5
  private _date;
6
6
  private _lineItems;
@@ -1,7 +1,7 @@
1
- import { BaseController } from "scandit-datacapture-frameworks-core";
2
- import { LabelCaptureAdaptiveRecognitionOverlay } from "../view/LabelCaptureAdaptiveRecognitionOverlay";
3
- import { AdaptiveRecognitionResult } from "../AdaptiveRecognitionResult";
4
- import { LabelProxy } from "../../generated";
1
+ import { BaseController } from 'scandit-datacapture-frameworks-core';
2
+ import { LabelCaptureAdaptiveRecognitionOverlay } from '../view/LabelCaptureAdaptiveRecognitionOverlay';
3
+ import { AdaptiveRecognitionResult } from '../AdaptiveRecognitionResult';
4
+ import { LabelProxy } from '../../generated';
5
5
  export declare enum LabelCaptureAdaptiveRecognitionListenerEvents {
6
6
  recognized = "LabelCaptureAdaptiveRecognitionListener.recognized",
7
7
  failure = "LabelCaptureAdaptiveRecognitionListener.failure"
@@ -11,9 +11,11 @@ export declare class LabelCaptureAdaptiveRecognitionOverlayController extends Ba
11
11
  private adapter;
12
12
  private hasListeners;
13
13
  private hasPendingListenerRegistration;
14
+ private registeredViewId;
14
15
  private get dataCaptureViewId();
15
16
  constructor(overlay: LabelCaptureAdaptiveRecognitionOverlay);
16
17
  subscribeListener(): Promise<void>;
18
+ private registerListenerForCurrentView;
17
19
  onViewChanged(): Promise<void>;
18
20
  unsubscribeListener(): Promise<void>;
19
21
  applySettings(): Promise<void>;
@@ -17,6 +17,7 @@ export declare class LabelCaptureAdvancedOverlayController extends BaseControlle
17
17
  private adapter;
18
18
  private hasListeners;
19
19
  private hasPendingListenerRegistration;
20
+ private registeredViewId;
20
21
  constructor(overlay: LabelCaptureAdvancedOverlay);
21
22
  setViewForCapturedLabel(label: CapturedLabel, view: LabelCaptureAdvancedOverlayView | null | Promise<LabelCaptureAdvancedOverlayView>): Promise<void>;
22
23
  setAnchorForCapturedLabel(label: CapturedLabel, anchor: Anchor): Promise<void>;
@@ -26,6 +27,7 @@ export declare class LabelCaptureAdvancedOverlayController extends BaseControlle
26
27
  setOffsetForCapturedLabelField(label: CapturedLabel, field: LabelField, offset: PointWithUnit): Promise<void>;
27
28
  clearCapturedLabelViews(): Promise<void>;
28
29
  subscribeListener(): Promise<void>;
30
+ private registerListenerForCurrentView;
29
31
  onViewChanged(): Promise<void>;
30
32
  unsubscribeListener(): Promise<void>;
31
33
  dispose(): void;
@@ -13,10 +13,12 @@ export declare class LabelCaptureBasicOverlayController extends BaseController<L
13
13
  private adapter;
14
14
  private hasListeners;
15
15
  private hasPendingListenerRegistration;
16
+ private registeredViewId;
16
17
  constructor(overlay: LabelCaptureBasicOverlay);
17
18
  setBrushForFieldOfLabel(brush: Brush | null, field: LabelField, label: CapturedLabel): Promise<void>;
18
19
  setBrushForLabel(brush: Brush | null, label: CapturedLabel): Promise<void>;
19
20
  subscribeListener(): Promise<void>;
21
+ private registerListenerForCurrentView;
20
22
  onViewChanged(): Promise<void>;
21
23
  unsubscribeListener(): Promise<void>;
22
24
  updateBasicOverlay(basicOverlayJson: string): Promise<void>;
@@ -20,11 +20,13 @@ export declare class LabelCaptureValidationFlowOverlayController extends BaseCon
20
20
  private overlay;
21
21
  private isSubscribed;
22
22
  private hasPendingListenerRegistration;
23
+ private registeredViewId;
23
24
  private adapter;
24
25
  private frameDataController;
25
26
  constructor(overlay: LabelCaptureValidationFlowOverlay);
26
27
  updateValidationFlowOverlay(): Promise<void>;
27
28
  subscribeLabelCaptureValidationFlowListener(): Promise<void>;
29
+ private registerListenerForCurrentView;
28
30
  onViewChanged(): Promise<void>;
29
31
  unsubscribeLabelCaptureValidationFlowListener(): Promise<void>;
30
32
  dispose(): void;
@@ -1,7 +1,7 @@
1
- import { BarcodeJSON } from "scandit-datacapture-frameworks-barcode";
2
- import { QuadrilateralJSON } from "scandit-datacapture-frameworks-core";
3
- import { LabelDateResultJSON } from "./PrivateLabelCaptureSession";
4
- import { LabelField } from "../LabelField";
1
+ import { BarcodeJSON } from 'scandit-datacapture-frameworks-barcode';
2
+ import { QuadrilateralJSON } from 'scandit-datacapture-frameworks-core';
3
+ import { LabelDateResultJSON } from './PrivateLabelCaptureSession';
4
+ import { LabelField } from '../LabelField';
5
5
  export interface PrivateExpiryDateText {
6
6
  _dataTypePatterns: string[] | null;
7
7
  }
@@ -1,4 +1,4 @@
1
- import { AdaptiveRecognitionResult } from "../AdaptiveRecognitionResult";
1
+ import { AdaptiveRecognitionResult } from '../AdaptiveRecognitionResult';
2
2
  export interface LabelCaptureAdaptiveRecognitionListener {
3
3
  didRecognize(result: AdaptiveRecognitionResult): void;
4
4
  didFail(): void;
@@ -1,7 +1,7 @@
1
- import { DataCaptureOverlay, DefaultSerializeable } from "scandit-datacapture-frameworks-core";
2
- import { LabelCapture } from "../LabelCapture";
3
- import { LabelCaptureAdaptiveRecognitionListener } from "./LabelCaptureAdaptiveRecognitionListener";
4
- import { LabelCaptureAdaptiveRecognitionSettings } from "../LabelCaptureAdaptiveRecognitionSettings";
1
+ import { DataCaptureOverlay, DefaultSerializeable } from 'scandit-datacapture-frameworks-core';
2
+ import { LabelCapture } from '../LabelCapture';
3
+ import { LabelCaptureAdaptiveRecognitionListener } from './LabelCaptureAdaptiveRecognitionListener';
4
+ import { LabelCaptureAdaptiveRecognitionSettings } from '../LabelCaptureAdaptiveRecognitionSettings';
5
5
  export declare class LabelCaptureAdaptiveRecognitionOverlay extends DefaultSerializeable implements DataCaptureOverlay {
6
6
  private type;
7
7
  private settings;
@@ -1,6 +1,6 @@
1
1
  import { DefaultSerializeable, DataCaptureOverlay, Anchor, PointWithUnit } from 'scandit-datacapture-frameworks-core';
2
2
  import { LabelCaptureAdvancedOverlayView } from './LabelCaptureAdvancedOverlayView';
3
- import { LabelCaptureAdvancedOverlayListener } from "./LabelCaptureAdvancedOverlayListener";
3
+ import { LabelCaptureAdvancedOverlayListener } from './LabelCaptureAdvancedOverlayListener';
4
4
  import { CapturedLabel } from '../CapturedLabel';
5
5
  import { LabelField } from '../LabelField';
6
6
  import { LabelCapture } from '../LabelCapture';
@@ -1,8 +1,8 @@
1
- import { LabelCaptureAdvancedOverlayView } from "./LabelCaptureAdvancedOverlayView";
2
- import { Anchor, PointWithUnit } from "scandit-datacapture-frameworks-core";
3
- import { LabelCaptureAdvancedOverlay } from "./LabelCaptureAdvancedOverlay";
4
- import { CapturedLabel } from "../CapturedLabel";
5
- import { LabelField } from "../LabelField";
1
+ import { LabelCaptureAdvancedOverlayView } from './LabelCaptureAdvancedOverlayView';
2
+ import { Anchor, PointWithUnit } from 'scandit-datacapture-frameworks-core';
3
+ import { LabelCaptureAdvancedOverlay } from './LabelCaptureAdvancedOverlay';
4
+ import { CapturedLabel } from '../CapturedLabel';
5
+ import { LabelField } from '../LabelField';
6
6
  export interface LabelCaptureAdvancedOverlayListener {
7
7
  viewForCapturedLabel?(overlay: LabelCaptureAdvancedOverlay, label: CapturedLabel): LabelCaptureAdvancedOverlayView | null;
8
8
  anchorForCapturedLabel?(overlay: LabelCaptureAdvancedOverlay, label: CapturedLabel): Anchor;
@@ -1,3 +1,3 @@
1
- import { DefaultSerializeable } from "scandit-datacapture-frameworks-core";
1
+ import { DefaultSerializeable } from 'scandit-datacapture-frameworks-core';
2
2
  export interface LabelCaptureAdvancedOverlayView extends DefaultSerializeable {
3
3
  }
@@ -1,5 +1,5 @@
1
1
  import { NativeCallerProvider } from 'scandit-datacapture-frameworks-core';
2
2
  export declare const LABEL_PROXY_TYPE_NAMES: readonly ["LabelCaptureProxy", "LabelCaptureBasicOverlayProxy", "LabelCaptureAdvancedOverlayProxy", "LabelCaptureValidationFlowOverlayProxy", "LabelCaptureAdaptiveRecognitionOverlayProxy"];
3
- export type LabelProxyType = typeof LABEL_PROXY_TYPE_NAMES[number];
3
+ export type LabelProxyType = (typeof LABEL_PROXY_TYPE_NAMES)[number];
4
4
  export interface LabelNativeCallerProvider extends NativeCallerProvider<LabelProxyType> {
5
5
  }