scanbot-web-sdk 8.0.0-beta.1 → 8.0.0-beta.3
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/@types/barcode-scanner-view.d.ts +4 -25
- package/@types/check-scanner-view.d.ts +21 -0
- package/@types/cropping-view.d.ts +3 -3
- package/@types/document-data-extractor-view.d.ts +12 -11
- package/@types/document-scanner-view.d.ts +1 -3
- package/@types/finder-scanner-view.d.ts +31 -0
- package/@types/index.d.ts +5 -6
- package/@types/interfaces/base/i-finder-scanner-handle.d.ts +6 -0
- package/@types/interfaces/{i-scanner-common-handle.d.ts → base/i-scanner-common-handle.d.ts} +3 -1
- package/@types/interfaces/i-barcode-scanner-handle.d.ts +2 -7
- package/@types/interfaces/i-check-scanner-handle.d.ts +3 -0
- package/@types/interfaces/i-document-data-extractor-handle.d.ts +3 -0
- package/@types/interfaces/i-document-scanner-handle.d.ts +1 -1
- package/@types/interfaces/i-mrz-scanner-handle.d.ts +2 -5
- package/@types/interfaces/i-text-pattern-scanner-handle.d.ts +2 -5
- package/@types/model/barcode/barcode-result.d.ts +2 -5
- package/@types/model/configuration/barcode-scanner-view-configuration.d.ts +0 -9
- package/@types/model/configuration/check-scanner-view-configuration.d.ts +9 -0
- package/@types/model/configuration/mrz-scanner-view-configuration.d.ts +0 -7
- package/@types/mrz-scanner-view.d.ts +7 -15
- package/@types/scanbot-sdk.d.ts +5 -5
- package/@types/scanner-view.d.ts +3 -1
- package/@types/text-pattern-scanner-view.d.ts +6 -14
- package/@types/ui2/barcode/controllers/barcode-scanner-controller.d.ts +2 -0
- package/@types/ui2/barcode/controllers/multiple-scanning-mode-controller.d.ts +2 -0
- package/@types/ui2/barcode/controllers/single-scanning-mode-controller.d.ts +2 -0
- package/@types/ui2/barcode/views/barcode-scanner.d.ts +2 -0
- package/@types/ui2/barcode/views/styled-text.d.ts +1 -0
- package/@types/ui2/data-scanner/mrz-scanner-controller.d.ts +2 -0
- package/@types/ui2/data-scanner/views/mrz-scanner-box.d.ts +2 -0
- package/@types/ui2/document/controller/camera-screen-controller.d.ts +2 -0
- package/@types/ui2/document/controller/document-scanner-controller.d.ts +2 -0
- package/@types/ui2/document/views/camera-screen/use-document-scanner-view.d.ts +2 -0
- package/@types/utils/view-utils.d.ts +2 -0
- package/README.md +168 -59
- package/bundle/ScanbotSDK.min.js +5 -5
- package/bundle/ScanbotSDK.ui2.min.js +6 -6
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
- package/package.json +1 -1
- package/@types/interfaces/i-document-data-extractor-scanner-handle.d.ts +0 -3
- package/@types/service/document-data-extractor.d.ts +0 -10
- package/@types/view/action-bar/bottom-action-bar.d.ts +0 -8
- package/@types/view/barcode-calculation/barcode-calculation-popup-list-item.d.ts +0 -5
- package/@types/view/barcode-calculation/barcode-calculation-popup-list.d.ts +0 -8
- package/@types/view/barcode-calculation/barcode-calculation-popup.d.ts +0 -32
- package/@types/view/barcode-calculation/scanned-image-with-overlay.d.ts +0 -9
|
@@ -1,46 +1,31 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ScanbotCameraProps, ScanbotCameraState
|
|
2
|
+
import { ScanbotCameraProps, ScanbotCameraState } from "./scanner-view";
|
|
3
3
|
import { IBarcodeScannerHandle } from "./interfaces/i-barcode-scanner-handle";
|
|
4
|
-
import ViewFinder from "./view/view-finder";
|
|
5
4
|
import { ShutterButtonAction } from "./view/shutter-button";
|
|
6
|
-
import BarcodeCalculationPopup from "./view/barcode-calculation/barcode-calculation-popup";
|
|
7
5
|
import AnimatedBarcodeSelectionOverlay from "./view/barcode-polygon/animated-barcode-selection-overlay";
|
|
8
|
-
import BottomActionBar from "./view/action-bar/bottom-action-bar";
|
|
9
|
-
import ScannedImageWithOverlay from "./view/barcode-calculation/scanned-image-with-overlay";
|
|
10
6
|
import { BarcodeScannerViewConfiguration } from "./model/configuration/barcode-scanner-view-configuration";
|
|
11
7
|
import { Size } from "./utils/dto/Size";
|
|
12
8
|
import { BarcodeItem } from "./core-types";
|
|
13
9
|
import { BarcodeScanner } from "./core/compiled/bridge/BarcodeScanner";
|
|
10
|
+
import FinderScannerView from "./finder-scanner-view";
|
|
14
11
|
export declare class BarcodeScannerProps extends ScanbotCameraProps {
|
|
15
12
|
}
|
|
16
13
|
export declare class BarcodeScannerState extends ScanbotCameraState {
|
|
17
14
|
isFinderVisible?: boolean;
|
|
18
15
|
action: ShutterButtonAction;
|
|
19
|
-
image?: string;
|
|
20
|
-
bottomHintText?: string;
|
|
21
16
|
}
|
|
22
|
-
export default class BarcodeScannerView extends
|
|
23
|
-
finder?: ViewFinder;
|
|
17
|
+
export default class BarcodeScannerView extends FinderScannerView<BarcodeScannerProps, BarcodeScannerState> implements IBarcodeScannerHandle {
|
|
24
18
|
shouldComputeSize: boolean;
|
|
25
19
|
private _configuration;
|
|
26
|
-
private paused;
|
|
27
20
|
overlay?: AnimatedBarcodeSelectionOverlay | undefined;
|
|
28
|
-
popup: BarcodeCalculationPopup | undefined;
|
|
29
|
-
scannedImage: ScannedImageWithOverlay | undefined;
|
|
30
|
-
bottomActionBar: BottomActionBar | undefined;
|
|
31
21
|
barcodeScannerHandle: BarcodeScanner | null;
|
|
32
22
|
readonly barcodes: BarcodeItem[];
|
|
33
23
|
private detectionRunning;
|
|
34
24
|
constructor(props: BarcodeScannerProps);
|
|
35
25
|
get configuration(): BarcodeScannerViewConfiguration;
|
|
36
26
|
get enabled(): boolean;
|
|
37
|
-
|
|
38
|
-
* Public API functions
|
|
39
|
-
*/
|
|
27
|
+
private static root;
|
|
40
28
|
static create(configuration: BarcodeScannerViewConfiguration): Promise<BarcodeScannerView>;
|
|
41
|
-
isDetectionPaused(): boolean;
|
|
42
|
-
resumeDetection(): Promise<void>;
|
|
43
|
-
pauseDetection(): void;
|
|
44
29
|
private readonly updateDimensionsCallback;
|
|
45
30
|
onSdkReady(): Promise<void>;
|
|
46
31
|
/**
|
|
@@ -50,11 +35,7 @@ export default class BarcodeScannerView extends ScannerView<BarcodeScannerProps,
|
|
|
50
35
|
componentDidUpdate(prevProps: Readonly<BarcodeScannerProps>, prevState: Readonly<BarcodeScannerState>, snapshot?: any): void;
|
|
51
36
|
componentWillUnmount(): void;
|
|
52
37
|
updateDimensions(): Promise<void>;
|
|
53
|
-
resume(): Promise<void>;
|
|
54
|
-
pause(): void;
|
|
55
38
|
detect(): Promise<void>;
|
|
56
|
-
backendurl: string | undefined;
|
|
57
|
-
setUseBackendService(url: string | undefined): void;
|
|
58
39
|
private recognizeBarcodes;
|
|
59
40
|
desiredRecognitionResolution: number | undefined;
|
|
60
41
|
setRecognitionResolution(resolution: number): void;
|
|
@@ -63,6 +44,4 @@ export default class BarcodeScannerView extends ScannerView<BarcodeScannerProps,
|
|
|
63
44
|
setFinderVisible(isVisible: boolean): void;
|
|
64
45
|
updateTorch(enabled: boolean): void;
|
|
65
46
|
render(): React.JSX.Element;
|
|
66
|
-
resetCountImage(): void;
|
|
67
|
-
countLabelText(barcodes: BarcodeItem[]): string;
|
|
68
47
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ICheckScannerHandle } from "./interfaces/i-check-scanner-handle";
|
|
3
|
+
import FinderScannerView, { FinderScannerProps, FinderScannerState } from "./finder-scanner-view";
|
|
4
|
+
import { CheckScannerViewConfiguration } from "./model/configuration/check-scanner-view-configuration";
|
|
5
|
+
import type ScanbotSDK from "./scanbot-sdk";
|
|
6
|
+
export declare class CheckScannerProps extends FinderScannerProps {
|
|
7
|
+
configuration: CheckScannerViewConfiguration;
|
|
8
|
+
}
|
|
9
|
+
export default class CheckScannerView extends FinderScannerView<CheckScannerProps, FinderScannerState> implements ICheckScannerHandle {
|
|
10
|
+
static FRAME_RESOLUTION: number;
|
|
11
|
+
private handle;
|
|
12
|
+
private readonly configuration;
|
|
13
|
+
constructor(props: CheckScannerProps);
|
|
14
|
+
private static root;
|
|
15
|
+
static create(sdk: ScanbotSDK, configuration: CheckScannerViewConfiguration): Promise<ICheckScannerHandle>;
|
|
16
|
+
onSdkReady(): Promise<void>;
|
|
17
|
+
componentWillUnmount(): void;
|
|
18
|
+
get enabled(): boolean;
|
|
19
|
+
detect(): Promise<void>;
|
|
20
|
+
render(): React.ReactNode;
|
|
21
|
+
}
|
|
@@ -11,9 +11,11 @@ import { Polygon } from "./utils/dto/Polygon";
|
|
|
11
11
|
import MagnifierView, { MagnifierOptions } from "./view/cropping/magnifier-view";
|
|
12
12
|
import { ICroppingViewHandle } from "./interfaces/i-cropping-view-handle";
|
|
13
13
|
import { DeepPartial, DocumentDetectionResult } from "./core-types";
|
|
14
|
+
import { Root } from "react-dom/client";
|
|
14
15
|
export interface CroppingViewProps {
|
|
15
16
|
configuration: CroppingViewConfiguration;
|
|
16
17
|
container?: HTMLElement;
|
|
18
|
+
root: Root;
|
|
17
19
|
style?: {
|
|
18
20
|
polygon: {};
|
|
19
21
|
};
|
|
@@ -53,9 +55,7 @@ export default class CroppingView extends React.Component<CroppingViewProps, Cro
|
|
|
53
55
|
private sdk;
|
|
54
56
|
private static readonly FULL_SIZE_POLYGON;
|
|
55
57
|
constructor(props: any);
|
|
56
|
-
|
|
57
|
-
* Public API functions
|
|
58
|
-
*/
|
|
58
|
+
private static root;
|
|
59
59
|
static create(configuration: CroppingViewConfiguration, sdk: ScanbotSDK): Promise<CroppingView>;
|
|
60
60
|
componentDidMount(): Promise<void>;
|
|
61
61
|
componentWillUnmount(): Promise<void>;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ScanbotCameraProps, ScanbotCameraState
|
|
3
|
-
import {
|
|
2
|
+
import { ScanbotCameraProps, ScanbotCameraState } from "./scanner-view";
|
|
3
|
+
import { IDocumentDataExtractorHandle } from "./interfaces/i-document-data-extractor-handle";
|
|
4
4
|
import { DocumentDataExtractorViewConfiguration } from "./model/configuration/document-data-extractor-view-configuration";
|
|
5
5
|
import type ScanbotSDK from "./scanbot-sdk";
|
|
6
|
+
import FinderScannerView from "./finder-scanner-view";
|
|
6
7
|
declare class DocumentDataExtractorProps extends ScanbotCameraProps {
|
|
7
8
|
configuration: DocumentDataExtractorViewConfiguration;
|
|
8
9
|
sdk: ScanbotSDK;
|
|
9
10
|
}
|
|
10
|
-
export default class DocumentDataExtractorView extends
|
|
11
|
-
private configuration;
|
|
12
|
-
private
|
|
13
|
-
private enabled;
|
|
14
|
-
private finder?;
|
|
11
|
+
export default class DocumentDataExtractorView extends FinderScannerView<DocumentDataExtractorProps, ScanbotCameraState> implements IDocumentDataExtractorHandle {
|
|
12
|
+
private readonly configuration;
|
|
13
|
+
private handle;
|
|
15
14
|
constructor(props: DocumentDataExtractorProps);
|
|
16
|
-
static
|
|
17
|
-
|
|
15
|
+
private static root;
|
|
16
|
+
static create(sdk: ScanbotSDK, configuration: DocumentDataExtractorViewConfiguration): Promise<IDocumentDataExtractorHandle>;
|
|
18
17
|
componentWillUnmount(): Promise<void>;
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
get enabled(): boolean;
|
|
19
|
+
onSdkReady(): Promise<void>;
|
|
20
|
+
detect(): Promise<void>;
|
|
21
|
+
render(): React.ReactNode;
|
|
21
22
|
}
|
|
22
23
|
export {};
|
|
@@ -32,9 +32,7 @@ export default class DocumentScannerView extends ScannerView<DocumentScannerProp
|
|
|
32
32
|
get configuration(): DocumentScannerViewConfiguration;
|
|
33
33
|
componentDidUpdate(prevProps: DocumentScannerProps): void;
|
|
34
34
|
get autoCaptureSensitivity(): number;
|
|
35
|
-
|
|
36
|
-
* Public API functions
|
|
37
|
-
*/
|
|
35
|
+
private static root;
|
|
38
36
|
static create(configuration: DocumentScannerViewConfiguration, sdk: ScanbotSDK): Promise<DocumentScannerView>;
|
|
39
37
|
detectAndCrop(): Promise<DocumentScannerScanResponse | null>;
|
|
40
38
|
enableAutoCapture(): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ScanbotCameraProps, ScanbotCameraState, ScannerView } from "./scanner-view";
|
|
3
|
+
import { IFinderScannerHandle } from "./interfaces/base/i-finder-scanner-handle";
|
|
4
|
+
import ViewFinder from "./view/view-finder";
|
|
5
|
+
import { ViewFinderScannerConfiguration } from "./model/configuration/view-finder-scanner-configuration";
|
|
6
|
+
export declare class FinderScannerProps extends ScanbotCameraProps {
|
|
7
|
+
}
|
|
8
|
+
export declare class FinderScannerState extends ScanbotCameraState {
|
|
9
|
+
isFinderVisible?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export default class FinderScannerView<P extends FinderScannerProps, S extends FinderScannerState> extends ScannerView<P, S> implements IFinderScannerHandle {
|
|
12
|
+
finder?: ViewFinder;
|
|
13
|
+
constructor(props: P);
|
|
14
|
+
componentDidMount(): void;
|
|
15
|
+
componentWillUnmount(): void;
|
|
16
|
+
/**
|
|
17
|
+
* You should use this variable in your 'detect' method override to check if the detection is paused.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
paused: boolean;
|
|
21
|
+
resumeDetection(): void;
|
|
22
|
+
pauseDetection(): void;
|
|
23
|
+
isDetectionPaused(): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Start of the detection loop. This needs to be overridden and should contain your infinite detection loop.
|
|
26
|
+
* Internally it is called by 'componentDidMount' and stopped only when the component is disposed.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
detect(): Promise<void>;
|
|
30
|
+
renderView(configuration: ViewFinderScannerConfiguration): React.ReactNode;
|
|
31
|
+
}
|
package/@types/index.d.ts
CHANGED
|
@@ -36,21 +36,20 @@ export {
|
|
|
36
36
|
export { BarcodeScannerResultWithSize } from "./model/barcode/barcode-result";
|
|
37
37
|
|
|
38
38
|
export { IMrzScannerHandle } from "./interfaces/i-mrz-scanner-handle";
|
|
39
|
-
export {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} from "./model/configuration/
|
|
39
|
+
export { MrzScannerViewConfiguration } from "./model/configuration/mrz-scanner-view-configuration";
|
|
40
|
+
|
|
41
|
+
export { ICheckScannerHandle } from "./interfaces/i-check-scanner-handle";
|
|
42
|
+
export { CheckScannerViewConfiguration } from "./model/configuration/check-scanner-view-configuration";
|
|
43
43
|
|
|
44
|
+
export { ITextPatternScannerHandle } from "./interfaces/i-text-pattern-scanner-handle";
|
|
44
45
|
export {
|
|
45
46
|
TextPatternScannerViewConfiguration,
|
|
46
47
|
TextDetectionCallback
|
|
47
48
|
} from "./model/configuration/text-pattern-scanner-view-configuration";
|
|
48
|
-
export { ITextPatternScannerHandle } from "./interfaces/i-text-pattern-scanner-handle";
|
|
49
49
|
|
|
50
50
|
export { VinScannerViewConfiguration, VinDetectionCallback } from "./model/configuration/vin-scanner-view-configuration";
|
|
51
51
|
|
|
52
52
|
export { DocumentDataExtractorViewConfiguration } from "./model/configuration/document-data-extractor-view-configuration";
|
|
53
|
-
export { DocumentDataExtractor } from "./service/document-data-extractor";
|
|
54
53
|
|
|
55
54
|
export { PdfGenerator, PdfPageOptions } from "./service/pdf-generator";
|
|
56
55
|
export { TiffGenerator, TiffPageOptions } from "./service/tiff-generator";
|
package/@types/interfaces/{i-scanner-common-handle.d.ts → base/i-scanner-common-handle.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CameraInfo } from "
|
|
1
|
+
import { CameraInfo } from "../../model/camera-info";
|
|
2
2
|
export interface IScannerCommon {
|
|
3
3
|
swapCameraFacing(force?: boolean): void;
|
|
4
4
|
switchCamera(deviceId: string, mirrored?: boolean): void;
|
|
@@ -6,4 +6,6 @@ export interface IScannerCommon {
|
|
|
6
6
|
getActiveCameraInfo(): CameraInfo | undefined;
|
|
7
7
|
setTorchState(state: boolean): Promise<void>;
|
|
8
8
|
dispose(): void;
|
|
9
|
+
getCapabilities(): MediaTrackCapabilities | undefined;
|
|
10
|
+
setZoom(zoom: number): void;
|
|
9
11
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { Size } from "../utils/dto/Size";
|
|
2
|
-
import {
|
|
3
|
-
export interface IBarcodeScannerHandle extends
|
|
2
|
+
import { IFinderScannerHandle } from "./base/i-finder-scanner-handle";
|
|
3
|
+
export interface IBarcodeScannerHandle extends IFinderScannerHandle {
|
|
4
4
|
saveExtractedImageData(): void;
|
|
5
|
-
resumeDetection(): void;
|
|
6
|
-
pauseDetection(): void;
|
|
7
|
-
isDetectionPaused(): boolean;
|
|
8
|
-
getCapabilities(): MediaTrackCapabilities | undefined;
|
|
9
|
-
setZoom(zoom: number): void;
|
|
10
5
|
setFinderVisible(isVisible: boolean): void;
|
|
11
6
|
updateTorch(enabled: boolean): void;
|
|
12
7
|
getResolution(): Promise<Size>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IScannerCommon } from "./i-scanner-common-handle";
|
|
1
|
+
import { IScannerCommon } from "./base/i-scanner-common-handle";
|
|
2
2
|
import { DocumentScannerScanResponse } from "../core-types";
|
|
3
3
|
export interface IDocumentScannerHandle extends IScannerCommon {
|
|
4
4
|
detectAndCrop(): Promise<DocumentScannerScanResponse | null>;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface IMrzScannerHandle extends
|
|
3
|
-
resumeDetection(): void;
|
|
4
|
-
pauseDetection(): void;
|
|
5
|
-
isDetectionPaused(): boolean;
|
|
1
|
+
import { IFinderScannerHandle } from "./base/i-finder-scanner-handle";
|
|
2
|
+
export interface IMrzScannerHandle extends IFinderScannerHandle {
|
|
6
3
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ITextPatternScannerHandle extends
|
|
3
|
-
resumeDetection(): void;
|
|
4
|
-
pauseDetection(): void;
|
|
5
|
-
isDetectionPaused(): boolean;
|
|
1
|
+
import { IFinderScannerHandle } from "./base/i-finder-scanner-handle";
|
|
2
|
+
export interface ITextPatternScannerHandle extends IFinderScannerHandle {
|
|
6
3
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { Size } from "../../utils/dto/Size";
|
|
2
|
-
import { BarcodeItem,
|
|
2
|
+
import { BarcodeItem, BarcodeScannerRunResponse } from "../../core-types";
|
|
3
3
|
export declare class BarcodeScannerResultWithSize {
|
|
4
4
|
barcodes: BarcodeItem[];
|
|
5
5
|
originalImageSize: Size | null;
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
constructor(
|
|
10
|
-
result: BarcodeScannerResult;
|
|
11
|
-
originalImage: Image;
|
|
12
|
-
} | undefined);
|
|
9
|
+
constructor(response: BarcodeScannerRunResponse | undefined);
|
|
13
10
|
isEmpty(): boolean;
|
|
14
11
|
static fromBarcode(item: BarcodeItem): BarcodeScannerResultWithSize;
|
|
15
12
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SelectionOverlayConfiguration } from "./selection-overlay-configuration";
|
|
2
|
-
import { BarcodeCountConfiguration } from "./barcode-count-configuration";
|
|
3
2
|
import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
|
|
4
3
|
import { BarcodeScannerConfiguration, type DeepPartial, Image } from "../../core-types";
|
|
5
4
|
import type { BarcodeScannerResultWithSize } from "../barcode/barcode-result";
|
|
@@ -12,14 +11,6 @@ export declare class BarcodeScannerViewConfiguration extends ViewFinderScannerCo
|
|
|
12
11
|
overlay?: SelectionOverlayConfiguration;
|
|
13
12
|
/** {@displayType `Omit<DeepPartial<BarcodeScannerConfiguration>, "live">`} {@link BarcodeScannerConfiguration}*/
|
|
14
13
|
detectionParameters?: DeepPartial<BarcodeScannerConfiguration>;
|
|
15
|
-
/**
|
|
16
|
-
* Special property to enable barcode count mode.
|
|
17
|
-
* This is a type of a ready-to-use user interface scanning and counting found barcodes.
|
|
18
|
-
* It can be configured via its 'style' (BarcodeCountStyleConfiguration) property.
|
|
19
|
-
* It returns results normally via 'onBarcodesDetected' callback.
|
|
20
|
-
* Please note that results are returned for each consecutive scan, not only after the last scan
|
|
21
|
-
*/
|
|
22
|
-
scanAndCount?: BarcodeCountConfiguration;
|
|
23
14
|
/**
|
|
24
15
|
*/
|
|
25
16
|
onBarcodesDetected?: (e: BarcodeScannerResultWithSize) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
|
|
2
|
+
import { CheckScannerConfiguration, CheckScanningResult, DeepPartial } from "../../core-types";
|
|
3
|
+
export declare class CheckScannerViewConfiguration extends ViewFinderScannerConfiguration {
|
|
4
|
+
constructor();
|
|
5
|
+
/** {@displayType `DeepPartial<CheckScannerConfiguration>`} {@link CheckScannerConfiguration}*/
|
|
6
|
+
scannerConfiguration?: DeepPartial<CheckScannerConfiguration>;
|
|
7
|
+
onCheckDetected?: (e: CheckScanningResult) => void;
|
|
8
|
+
static fromJson(json: any): CheckScannerViewConfiguration;
|
|
9
|
+
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { DeepPartial, Image, MrzScannerConfiguration, MrzScannerResult } from "../../core-types";
|
|
2
2
|
import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
|
|
3
|
-
export interface MrzScannerAccumulatedFrameVerificationConfiguration {
|
|
4
|
-
/** Maximum number of accumulated frames to inspect to verify a scan result */
|
|
5
|
-
maximumNumberOfAccumulatedFrames?: number;
|
|
6
|
-
/** Minimum number of accumulated frames that have an equal result,
|
|
7
|
-
* in order for the result to be considered verified */
|
|
8
|
-
minimumNumberOfRequiredFramesWithEqualRecognitionResult?: number;
|
|
9
|
-
}
|
|
10
3
|
export declare class MrzScannerViewConfiguration extends ViewFinderScannerConfiguration {
|
|
11
4
|
constructor();
|
|
12
5
|
/** {@displayType `DeepPartial<MrzScannerConfiguration>`} {@link MrzScannerConfiguration}*/
|
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ScanbotCameraProps, ScanbotCameraState
|
|
2
|
+
import { ScanbotCameraProps, ScanbotCameraState } from "./scanner-view";
|
|
3
3
|
import { IMrzScannerHandle } from "./interfaces/i-mrz-scanner-handle";
|
|
4
|
-
import ViewFinder from "./view/view-finder";
|
|
5
4
|
import { MrzScannerViewConfiguration } from "./model/configuration/mrz-scanner-view-configuration";
|
|
6
5
|
import { MrzScanner } from "./core/compiled/bridge/MrzScanner";
|
|
6
|
+
import FinderScannerView from "./finder-scanner-view";
|
|
7
7
|
export declare class MrzScannerProps extends ScanbotCameraProps {
|
|
8
8
|
}
|
|
9
9
|
export declare class MrzScannerState extends ScanbotCameraState {
|
|
10
10
|
isFinderVisible?: boolean;
|
|
11
11
|
}
|
|
12
|
-
export default class MrzScannerView extends
|
|
12
|
+
export default class MrzScannerView extends FinderScannerView<MrzScannerProps, MrzScannerState> implements IMrzScannerHandle {
|
|
13
13
|
static FRAME_RESOLUTION: number;
|
|
14
|
-
finder?: ViewFinder;
|
|
15
14
|
shouldComputeSize: boolean;
|
|
16
|
-
private paused;
|
|
17
15
|
private _configuration?;
|
|
18
16
|
constructor(props: MrzScannerProps);
|
|
19
17
|
get configuration(): MrzScannerViewConfiguration;
|
|
20
18
|
get enabled(): boolean;
|
|
21
|
-
|
|
22
|
-
* Public API functions
|
|
23
|
-
*/
|
|
19
|
+
private static root;
|
|
24
20
|
static create(configuration: MrzScannerViewConfiguration): Promise<MrzScannerView>;
|
|
25
|
-
isDetectionPaused(): boolean;
|
|
26
|
-
resumeDetection(): Promise<void>;
|
|
27
|
-
pauseDetection(): void;
|
|
28
21
|
private readonly updateDimensionsCallback;
|
|
29
|
-
|
|
22
|
+
handle?: MrzScanner;
|
|
30
23
|
onSdkReady(): Promise<void>;
|
|
31
24
|
/**
|
|
32
25
|
* React Overrides
|
|
@@ -34,10 +27,9 @@ export default class MrzScannerView extends ScannerView<MrzScannerProps, MrzScan
|
|
|
34
27
|
componentDidMount(): Promise<void>;
|
|
35
28
|
componentWillUnmount(): void;
|
|
36
29
|
updateDimensions(): Promise<void>;
|
|
37
|
-
|
|
38
|
-
pause(): void;
|
|
30
|
+
pauseDetection(): void;
|
|
39
31
|
detect(): Promise<void>;
|
|
40
32
|
saveExtractedImageData(): void;
|
|
41
33
|
setFinderVisible(isVisible: boolean): void;
|
|
42
|
-
render(): React.
|
|
34
|
+
render(): React.ReactNode;
|
|
43
35
|
}
|
package/@types/scanbot-sdk.d.ts
CHANGED
|
@@ -16,14 +16,15 @@ import { TextPatternScannerViewConfiguration } from "./model/configuration/text-
|
|
|
16
16
|
import { VinScannerViewConfiguration } from "./model/configuration/vin-scanner-view-configuration";
|
|
17
17
|
import { ITextPatternScannerHandle } from "./interfaces/i-text-pattern-scanner-handle";
|
|
18
18
|
import ScanbotSDKUI from "./ui2/scanbot-sdk-ui";
|
|
19
|
-
import { Image, DeepPartial, DocumentScannerParameters, BarcodeScannerConfiguration, BarcodeDocumentFormat, MrzScannerConfiguration, DocumentQualityAnalyzerConfiguration, PdfConfiguration, TiffGeneratorParameters,
|
|
19
|
+
import { Image, DeepPartial, DocumentScannerParameters, BarcodeScannerConfiguration, BarcodeDocumentFormat, MrzScannerConfiguration, DocumentQualityAnalyzerConfiguration, PdfConfiguration, TiffGeneratorParameters, BarcodeScannerResult, BarcodeDocumentParserResult, DocumentQualityAnalyzer, DocumentDetectionResult } from "./core-types";
|
|
20
20
|
import * as Config from "./core-types";
|
|
21
|
-
import { DocumentDataExtractor } from "./service/document-data-extractor";
|
|
22
21
|
import { DocumentDataExtractorViewConfiguration } from "./model/configuration/document-data-extractor-view-configuration";
|
|
23
22
|
import { ConsumeType } from "./consume-type";
|
|
24
23
|
import { Stats } from "./utils/stats";
|
|
25
24
|
import { BrowserCameras } from "./utils/browser-cameras";
|
|
26
25
|
import { SBStorage } from "./service/storage/sb-storage";
|
|
26
|
+
import { ICheckScannerHandle } from "./interfaces/i-check-scanner-handle";
|
|
27
|
+
import { CheckScannerViewConfiguration } from "./model/configuration/check-scanner-view-configuration";
|
|
27
28
|
export default class ScanbotSDK {
|
|
28
29
|
/** @internal */
|
|
29
30
|
bridge: WorkerBridge;
|
|
@@ -41,11 +42,12 @@ export default class ScanbotSDK {
|
|
|
41
42
|
createDocumentScanner(configuration: DocumentScannerViewConfiguration): Promise<IDocumentScannerHandle>;
|
|
42
43
|
createMrzScanner(configuration: MrzScannerViewConfiguration): Promise<IMrzScannerHandle>;
|
|
43
44
|
createBarcodeScanner(configuration: BarcodeScannerViewConfiguration): Promise<IBarcodeScannerHandle>;
|
|
45
|
+
createCheckScanner(config: CheckScannerViewConfiguration): Promise<ICheckScannerHandle>;
|
|
44
46
|
openCroppingView(configuration: CroppingViewConfiguration): Promise<ICroppingViewHandle>;
|
|
45
47
|
createTextPatternScanner(configuration: TextPatternScannerViewConfiguration): Promise<ITextPatternScannerHandle>;
|
|
46
48
|
createVinScanner(configuration: VinScannerViewConfiguration): Promise<ITextPatternScannerHandle>;
|
|
47
49
|
createDocumentQualityAnalyzer(configuration: DocumentQualityAnalyzerConfiguration): Promise<DocumentQualityAnalyzer>;
|
|
48
|
-
|
|
50
|
+
createDocumentDataExtractor(config: DocumentDataExtractorViewConfiguration): Promise<any>;
|
|
49
51
|
/**
|
|
50
52
|
* Image Operations
|
|
51
53
|
*/
|
|
@@ -78,8 +80,6 @@ export default class ScanbotSDK {
|
|
|
78
80
|
beginPdf(options: DeepPartial<PdfConfiguration>): Promise<PdfGenerator>;
|
|
79
81
|
/** @param options {@displayType `DeepPartial<TiffGeneratorParameters>`} {@link TiffGeneratorParameters} */
|
|
80
82
|
beginTiff(options?: DeepPartial<TiffGeneratorParameters>): Promise<TiffGenerator>;
|
|
81
|
-
/** @param options {@displayType `DeepPartial<DocumentDataExtractorConfiguration>`} {@link DocumentDataExtractorConfiguration}*/
|
|
82
|
-
createDocumentDataExtractor(options: DeepPartial<DocumentDataExtractorConfiguration>): Promise<DocumentDataExtractor>;
|
|
83
83
|
imageToJpeg(image: Image, consumeImage?: ConsumeType): Promise<Uint8Array>;
|
|
84
84
|
get version(): string;
|
|
85
85
|
private _utils;
|
package/@types/scanner-view.d.ts
CHANGED
|
@@ -4,14 +4,16 @@ import { ScannerConfiguration } from "./model/configuration/scanner-configuratio
|
|
|
4
4
|
import ScanbotCameraView from "./view/scanbot-camera-view";
|
|
5
5
|
import { CameraInfo } from "./model/camera-info";
|
|
6
6
|
import { WorkerBridge } from "./worker/worker-bridge";
|
|
7
|
+
import { Root } from "react-dom/client";
|
|
7
8
|
export declare class ScanbotCameraProps {
|
|
8
9
|
configuration: ScannerConfiguration;
|
|
10
|
+
root: Root;
|
|
9
11
|
container?: HTMLElement;
|
|
10
12
|
onSuccess?: (scanner: any) => void;
|
|
11
13
|
onFailure?: (err: Error) => void;
|
|
12
14
|
sdk?: ScanbotSDK;
|
|
13
15
|
/**
|
|
14
|
-
* The user should check that the license is valid before using
|
|
16
|
+
* The user should check that the license is valid before using a Scanner.
|
|
15
17
|
* In case the license expires while the scanner is open, `onLicenseError` will be called.
|
|
16
18
|
*/
|
|
17
19
|
onLicenseError?: () => void;
|
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ScanbotCameraProps, ScanbotCameraState
|
|
2
|
+
import { ScanbotCameraProps, ScanbotCameraState } from "./scanner-view";
|
|
3
3
|
import { ITextPatternScannerHandle } from "./interfaces/i-text-pattern-scanner-handle";
|
|
4
|
-
import ViewFinder from "./view/view-finder";
|
|
5
4
|
import { ViewFinderScannerConfiguration } from "./model/configuration/view-finder-scanner-configuration";
|
|
6
5
|
import { TextPatternScannerViewConfiguration } from "./model/configuration/text-pattern-scanner-view-configuration";
|
|
7
6
|
import { VinScannerViewConfiguration } from "./model/configuration/vin-scanner-view-configuration";
|
|
8
7
|
import { VinScanner } from "./core/compiled/bridge/VinScanner";
|
|
9
8
|
import { TextPatternScanner } from "./core/compiled/bridge/TextPatternScanner";
|
|
9
|
+
import FinderScannerView from "./finder-scanner-view";
|
|
10
10
|
export declare class TextPatternScannerProps extends ScanbotCameraProps {
|
|
11
11
|
}
|
|
12
12
|
export declare class TextPatternScannerState extends ScanbotCameraState {
|
|
13
13
|
isFinderVisible?: boolean;
|
|
14
14
|
}
|
|
15
|
-
export default class TextPatternScannerView extends
|
|
15
|
+
export default class TextPatternScannerView extends FinderScannerView<TextPatternScannerProps, TextPatternScannerState> implements ITextPatternScannerHandle {
|
|
16
16
|
static FRAME_RESOLUTION: number;
|
|
17
|
-
finder?: ViewFinder;
|
|
18
17
|
shouldComputeSize: boolean;
|
|
19
|
-
private paused;
|
|
20
18
|
scanner?: VinScanner | TextPatternScanner;
|
|
21
19
|
constructor(props: TextPatternScannerProps);
|
|
22
20
|
get configuration(): ViewFinderScannerConfiguration;
|
|
23
21
|
get enabled(): boolean;
|
|
24
|
-
|
|
25
|
-
* Public API functions
|
|
26
|
-
*/
|
|
22
|
+
private static root;
|
|
27
23
|
static create(configuration: TextPatternScannerViewConfiguration | VinScannerViewConfiguration): Promise<TextPatternScannerView>;
|
|
28
|
-
isDetectionPaused(): boolean;
|
|
29
|
-
resumeDetection(): Promise<void>;
|
|
30
|
-
pauseDetection(): void;
|
|
31
24
|
private readonly updateDimensionsCallback;
|
|
32
25
|
onSdkReady(): Promise<void>;
|
|
33
26
|
/**
|
|
@@ -36,9 +29,8 @@ export default class TextPatternScannerView extends ScannerView<TextPatternScann
|
|
|
36
29
|
componentDidMount(): Promise<void>;
|
|
37
30
|
componentWillUnmount(): void;
|
|
38
31
|
updateDimensions(): Promise<void>;
|
|
39
|
-
|
|
40
|
-
pause(): void;
|
|
32
|
+
pauseDetection(): void;
|
|
41
33
|
detect(): Promise<void>;
|
|
42
34
|
saveExtractedImageData(): void;
|
|
43
|
-
render(): React.
|
|
35
|
+
render(): React.ReactNode;
|
|
44
36
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BarcodeScannerScreenConfiguration, BarcodeScannerUiResult } from '../../configuration';
|
|
3
|
+
import { Root } from "react-dom/client";
|
|
3
4
|
export declare class Props {
|
|
5
|
+
root: Root;
|
|
4
6
|
configuration: BarcodeScannerScreenConfiguration;
|
|
5
7
|
onClose: () => void;
|
|
6
8
|
onSubmit: (barcodeScannerResult: BarcodeScannerUiResult) => void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BarcodeScannerUiResult, BarcodeScannerScreenConfiguration } from "../../configuration";
|
|
3
3
|
import { IBarcodeMapper } from "../utils/barcode-mapper/i-barcode-mapper";
|
|
4
|
+
import { Root } from "react-dom/client";
|
|
4
5
|
declare class Props {
|
|
6
|
+
root: Root;
|
|
5
7
|
configuration: BarcodeScannerScreenConfiguration;
|
|
6
8
|
onCameraPermissionDenied: () => void;
|
|
7
9
|
onSubmit: (barcodeScannerResult: BarcodeScannerUiResult) => void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BarcodeScannerScreenConfiguration, BarcodeScannerUiResult } from "../../configuration";
|
|
3
3
|
import { IBarcodeMapper } from "../utils/barcode-mapper/i-barcode-mapper";
|
|
4
|
+
import { Root } from "react-dom/client";
|
|
4
5
|
declare class Props {
|
|
6
|
+
root: Root;
|
|
5
7
|
configuration: BarcodeScannerScreenConfiguration;
|
|
6
8
|
onClose: () => void;
|
|
7
9
|
onSubmit: (barcodeScannerUIResult: BarcodeScannerUiResult) => void;
|
|
@@ -6,7 +6,9 @@ import { BarcodePolygon } from "../../../view/barcode-polygon/barocode-polygon";
|
|
|
6
6
|
import { BarcodePolygonLabel } from "../../../view/barcode-polygon/barcode-polygon-label";
|
|
7
7
|
import type { CameraConfiguration } from "../../configuration/common/CameraConfiguration";
|
|
8
8
|
import type { BarcodeItem } from "../../configuration";
|
|
9
|
+
import { Root } from "react-dom/client";
|
|
9
10
|
export declare class Props {
|
|
11
|
+
root: Root;
|
|
10
12
|
cameraConfiguration: CameraConfiguration;
|
|
11
13
|
arOverlay: ArOverlayGeneralConfiguration | ArOverlayFindAndPickConfiguration;
|
|
12
14
|
actionBarConfig: ActionBarConfiguration;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MrzScannerScreenConfiguration } from "../configuration/mrz/MRZScannerScreenConfiguration";
|
|
3
3
|
import { MrzScannerUiResult } from "../configuration/mrz/MRZScannerUIResult";
|
|
4
|
+
import { Root } from "react-dom/client";
|
|
4
5
|
declare class Props {
|
|
6
|
+
root: Root;
|
|
5
7
|
configuration: MrzScannerScreenConfiguration;
|
|
6
8
|
onClose: () => void;
|
|
7
9
|
onSubmit: (result: MrzScannerUiResult) => void;
|
|
@@ -2,8 +2,10 @@ import React, { MutableRefObject } from "react";
|
|
|
2
2
|
import MrzScannerView from "../../../mrz-scanner-view";
|
|
3
3
|
import { MrzScannerScreenConfiguration } from "../../configuration/mrz/MRZScannerScreenConfiguration";
|
|
4
4
|
import { MrzScannerResult } from "../../../core-types";
|
|
5
|
+
import { Root } from "react-dom/client";
|
|
5
6
|
export type MrzResultCallback = (result: MrzScannerResult) => void;
|
|
6
7
|
declare class Props {
|
|
8
|
+
root: Root;
|
|
7
9
|
visible?: boolean;
|
|
8
10
|
config: MrzScannerScreenConfiguration;
|
|
9
11
|
onCameraPermissionDenied: (err: Error) => void;
|
|
@@ -3,8 +3,10 @@ import { DocumentScanningFlow } from "../../configuration/document/DocumentScann
|
|
|
3
3
|
import type ScanbotSDK from "../../../scanbot-sdk";
|
|
4
4
|
import { SBPage } from "../model/sb-page";
|
|
5
5
|
import { RtuDocumentDetectionResultPromise } from "../model/document-detection-ui-result";
|
|
6
|
+
import { Root } from "react-dom/client";
|
|
6
7
|
export type SnappingMode = "auto" | "manual";
|
|
7
8
|
type Props = {
|
|
9
|
+
root: Root;
|
|
8
10
|
visible: boolean;
|
|
9
11
|
configuration: DocumentScanningFlow;
|
|
10
12
|
onClose?: () => void;
|
|
@@ -2,7 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { DocumentScanningFlow } from "../../configuration";
|
|
3
3
|
import { DocumentScannerUIResult } from "../../configuration/DocumentScannerUIResult";
|
|
4
4
|
import type ScanbotSDK from "../../../scanbot-sdk";
|
|
5
|
+
import { Root } from "react-dom/client";
|
|
5
6
|
type Props = {
|
|
7
|
+
root: Root;
|
|
6
8
|
documentId?: number;
|
|
7
9
|
configuration: DocumentScanningFlow;
|
|
8
10
|
onClose: () => void;
|