scanbot-web-sdk 3.0.1 → 3.1.0-alpha.1

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 (30) hide show
  1. package/@types/document-scanner-view.d.ts +2 -1
  2. package/@types/model/configuration/document-scanner-configuration.d.ts +16 -1
  3. package/@types/service/ocr-engine.d.ts +1 -1
  4. package/@types/utils/dto/Frame.d.ts +1 -0
  5. package/@types/utils/predicate/polygon-movement-predicate.d.ts +1 -1
  6. package/@types/utils/video-stream.d.ts +1 -0
  7. package/@types/view/document-outline.d.ts +6 -7
  8. package/@types/view/polygon/animated-document-polygon.d.ts +17 -3
  9. package/@types/view/polygon/animated-path.d.ts +13 -0
  10. package/@types/view/scanbot-camera-view.d.ts +6 -2
  11. package/bundle/ScanbotSDK.min.js +3 -3
  12. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  13. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
  14. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
  15. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
  16. package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
  17. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
  18. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm-webpack-file-loader +0 -0
  19. package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
  20. package/bundle/bin/complete/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
  21. package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
  22. package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
  23. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  24. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
  25. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
  26. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
  27. package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
  28. package/package.json +3 -3
  29. package/bundle/bin/complete/tessdata/deu.traineddata +0 -0
  30. package/bundle/bin/complete/tessdata/eng.traineddata +0 -0
@@ -19,10 +19,11 @@ export default class DocumentScannerView extends ScannerView<DocumentScannerProp
19
19
  polygonMovementPredicate: PolygonMovementPredicate;
20
20
  autoCaptureToken: any;
21
21
  private _configuration?;
22
- constructor(props: ScanbotCameraProps);
22
+ constructor(props: DocumentScannerProps);
23
23
  get defaultAction(): ShutterButtonAction;
24
24
  get enabled(): boolean;
25
25
  get configuration(): DocumentScannerConfiguration;
26
+ get autoCaptureDelay(): number;
26
27
  /**
27
28
  * Public API functions
28
29
  */
@@ -18,9 +18,10 @@ declare class StyleConfiguration {
18
18
  outline?: OutlineStyleConfiguration;
19
19
  captureButton?: CaptureButtonStyleConfiguration;
20
20
  }
21
- declare class OutlineStyleConfiguration {
21
+ export declare class OutlineStyleConfiguration {
22
22
  constructor();
23
23
  polygon?: OutlinePolygonStyleConfiguration;
24
+ path?: CaptureAnimationStyleConfiguration;
24
25
  label?: OutlineLabelStyleConfiguration;
25
26
  }
26
27
  export declare class OutlinePolygonStyleConfiguration {
@@ -30,6 +31,10 @@ export declare class OutlinePolygonStyleConfiguration {
30
31
  fillSearching?: string;
31
32
  strokeWidth?: any;
32
33
  }
34
+ export declare class CaptureAnimationStyleConfiguration {
35
+ stroke?: string;
36
+ strokeWidth?: number;
37
+ }
33
38
  declare class OutlineLabelStyleConfiguration {
34
39
  position?: any;
35
40
  top?: any;
@@ -74,6 +79,16 @@ export declare class DocumentScannerConfiguration extends ScannerConfiguration {
74
79
  * By default BadAspectRatio is not ignored.
75
80
  */
76
81
  ignoreBadAspectRatio?: boolean;
82
+ /**
83
+ * Attempts to take a single exposure using the video capture device,
84
+ * resulting in a high resolution image and potentially greatly improved detection quality.
85
+ * Relies on the experimental ImageCapture API that: https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture.
86
+ * Use with caution. At the time of writing this, reliably only works on Android devices with Google Chrome.
87
+ * If enabled, this only affects extraction after the document outline has been identified.
88
+ * This may also trigger your device's default "snap" animation, making scanbotSDK.utils.flash(); irrelevant
89
+ * Defaults to false.
90
+ */
91
+ useImageCaptureAPI?: boolean;
77
92
  text?: TextConfiguration;
78
93
  style?: StyleConfiguration;
79
94
  /**
@@ -6,7 +6,7 @@ export interface Rect {
6
6
  width: number;
7
7
  }
8
8
  export interface OcrData {
9
- test: string;
9
+ text: string;
10
10
  confidence: number;
11
11
  boundingBox: Rect;
12
12
  }
@@ -10,4 +10,5 @@ export declare class Frame {
10
10
  static empty(): Frame;
11
11
  static fromRect(rect: DOMRect): Frame;
12
12
  static fromPoint(point: Point, size: number): Frame;
13
+ static fromDOMRect(rect: DOMRect): Frame;
13
14
  }
@@ -5,7 +5,7 @@ export declare class PolygonMovementPredicate {
5
5
  private lastPolygon;
6
6
  private maxDistance;
7
7
  private sensitivity;
8
- constructor(videoSize: VideoSize, sensitivity?: Number);
8
+ constructor(videoSize: VideoSize, sensitivity?: number);
9
9
  check(polygon: Polygon): boolean;
10
10
  reset(): void;
11
11
  update(polygon: Polygon): void;
@@ -21,4 +21,5 @@ export default class VideoStream extends React.Component<VideoStreamProps, Video
21
21
  componentWillUnmount(): void;
22
22
  updateTorch(enabled: boolean): Promise<void>;
23
23
  getCapabilities(): MediaTrackCapabilities | undefined;
24
+ getVideoTrack(): MediaStreamTrack | undefined;
24
25
  }
@@ -1,13 +1,12 @@
1
1
  import React from "react";
2
2
  import "../styles/main.css";
3
- import { AnimatedDocumentPolygon } from "./polygon/animated-document-polygon";
3
+ import AnimatedDocumentPolygon from "./polygon/animated-document-polygon";
4
+ import { ShutterButtonAction } from "./shutter-button";
5
+ import { OutlineStyleConfiguration } from "../model/configuration/document-scanner-configuration";
4
6
  export interface DocumentOutlineProps {
5
- style: {
6
- polygon: {};
7
- label: {};
8
- };
9
- showLabel: boolean;
10
- visible?: boolean;
7
+ style?: OutlineStyleConfiguration;
8
+ action?: ShutterButtonAction;
9
+ autoCaptureDelay?: number;
11
10
  }
12
11
  export declare class DocumentOutline extends React.Component<DocumentOutlineProps, any> {
13
12
  hintLabelClassName: string;
@@ -1,9 +1,23 @@
1
1
  import React from "react";
2
2
  import DocumentPolygon from "./document-polygon";
3
- export declare class AnimatedDocumentPolygon extends React.Component<any, any> {
3
+ import AnimatedPath from "./animated-path";
4
+ import { ShutterButtonAction } from "../shutter-button";
5
+ import { CaptureAnimationStyleConfiguration, OutlinePolygonStyleConfiguration } from "../../model/configuration/document-scanner-configuration";
6
+ export declare class AnimatedDocumentPolygonProps {
7
+ action?: ShutterButtonAction;
8
+ autoCaptureDelay?: number;
9
+ style?: any;
10
+ isOk?: boolean;
11
+ isVisible?: boolean;
12
+ polygonStyle?: OutlinePolygonStyleConfiguration;
13
+ pathStyle?: CaptureAnimationStyleConfiguration;
14
+ }
15
+ export default class AnimatedDocumentPolygon extends React.Component<AnimatedDocumentPolygonProps, any> {
4
16
  polygon: DocumentPolygon;
5
17
  previous: any[];
6
- testComponent: React.RefObject<any>;
18
+ path: AnimatedPath;
7
19
  render(): JSX.Element;
8
- update(points: any[], isOk: boolean, isVisible: boolean): void;
20
+ update(points: any[], isOk: boolean, action: ShutterButtonAction): void;
21
+ animateCapturing(): void;
22
+ clearAnimation(): void;
9
23
  }
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { Point } from "../../utils/dto/Point";
3
+ import { CaptureAnimationStyleConfiguration } from "../../model/configuration/document-scanner-configuration";
4
+ export declare class AnimatedPathProps {
5
+ duration: number;
6
+ style?: CaptureAnimationStyleConfiguration;
7
+ }
8
+ export default class AnimatedPath extends React.Component<AnimatedPathProps, any> {
9
+ constructor(props: any);
10
+ render(): React.ReactNode;
11
+ animate(points: Point[]): void;
12
+ clear(): void;
13
+ }
@@ -3,9 +3,10 @@ import VideoStream from "../utils/video-stream";
3
3
  import { Size } from "../utils/dto/Size";
4
4
  import { Frame } from "../utils/dto/Frame";
5
5
  import { WindowStyleConfiguration } from "../model/configuration/window-style-configuration";
6
- import { ImageDataWrapper } from "../model/image-data-wrapper";
7
6
  import { CameraInfo } from "../model/camera-info";
7
+ import { ScannerConfiguration } from "../model/configuration/scanner-configuration";
8
8
  export interface ScanbotCameraViewProps {
9
+ configuration?: ScannerConfiguration;
9
10
  windowConfiguration?: WindowStyleConfiguration;
10
11
  videoConstraints: MediaTrackConstraints;
11
12
  mirrored: boolean;
@@ -37,7 +38,10 @@ export default class ScanbotCameraView extends React.Component<ScanbotCameraView
37
38
  save: boolean;
38
39
  saveExtractedData(): void;
39
40
  zoom(): number;
40
- createImageData(maxLargerLength?: number): ImageDataWrapper;
41
+ private capture?;
42
+ private imageCapture;
43
+ createImageData(maxLargerLength?: number, useImageCaptureAPI?: boolean): Promise<ImageData>;
44
+ windowSize(): Frame;
41
45
  calculateClientVideoConstraints(): {
42
46
  clientVideoWidth: number;
43
47
  clientVideoHeight: number;