@nddeps/barcode-scanner 0.1.0 → 0.2.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.
@@ -1,6 +1,7 @@
1
1
  import type { DetectedBarcode } from './barcode-detector.type';
2
2
  import type { OnDecode, OnDecodeError, ScanArea } from './barcode-scanner.types';
3
3
  declare class BarcodeScanner {
4
+ private calcScanArea;
4
5
  private canvas;
5
6
  private canvasContext;
6
7
  private debug?;
@@ -12,7 +13,6 @@ declare class BarcodeScanner {
12
13
  private onDecodeError?;
13
14
  private onVisibilityChange;
14
15
  private requestFrame;
15
- private resizeObserver;
16
16
  private resumeOnVisibilityChange;
17
17
  private scanArea;
18
18
  private scanRate;
@@ -27,6 +27,7 @@ declare class BarcodeScanner {
27
27
  calcScanArea?: (video: HTMLVideoElement) => ScanArea;
28
28
  debug?: boolean;
29
29
  decodeTimeout?: number;
30
+ preferWorker?: boolean;
30
31
  scanRate?: number;
31
32
  };
32
33
  video: HTMLVideoElement;
@@ -35,13 +36,12 @@ declare class BarcodeScanner {
35
36
  destroy(): Promise<void>;
36
37
  getCameraAccess(): Promise<boolean>;
37
38
  getScanArea(video: HTMLVideoElement): ScanArea;
38
- getScanAreaPosition(scanArea?: ScanArea): ScanArea;
39
39
  hasCameraAccess(): Promise<boolean>;
40
40
  pause(): void;
41
- start({ facingMode }?: {
41
+ start({ facingMode, }?: {
42
42
  facingMode?: 'environment' | 'user';
43
43
  }): Promise<void>;
44
44
  stop(): Promise<void>;
45
45
  private decodeFrame;
46
46
  }
47
- export default BarcodeScanner;
47
+ export { BarcodeScanner };
@@ -1,5 +1,5 @@
1
1
  import type { DetectedBarcode } from './barcode-detector.type';
2
- export type OnDecode = (data: null | string, area?: ScanArea) => void;
2
+ export type OnDecode = (data: null | string, area: ScanArea) => void;
3
3
  export type OnDecodeError = () => void;
4
4
  export type ScanArea = {
5
5
  height: number;