scanbot-web-sdk 6.0.0-dev.1 → 6.0.0-dev.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 +10 -10
- package/@types/consume-type.d.ts +8 -0
- package/@types/core/bridge/common.d.ts +24 -0
- package/@types/core/bridge/compiled/BarcodeConfigs.d.ts +973 -0
- package/@types/core/bridge/compiled/BarcodeScannerTypes.d.ts +185 -0
- package/@types/core/bridge/compiled/BarcodeTypes.d.ts +183 -0
- package/@types/core/bridge/compiled/CheckRecognizerTypes.d.ts +29 -0
- package/@types/core/bridge/compiled/CommonFieldType.d.ts +59 -0
- package/@types/core/bridge/compiled/DocumentDetectorTypes.d.ts +196 -0
- package/@types/core/bridge/compiled/DocumentQualityAnalyzerTypes.d.ts +105 -0
- package/@types/core/bridge/compiled/EhicTypes.d.ts +218 -0
- package/@types/core/bridge/compiled/FrameUtilities.d.ts +18 -0
- package/@types/core/bridge/compiled/GDRTypes.d.ts +38 -0
- package/@types/core/bridge/compiled/GenericDocument.d.ts +236 -0
- package/@types/core/bridge/compiled/GenericDocumentRecognizerConfigs.d.ts +183 -0
- package/@types/core/bridge/compiled/GenericDocumentRecognizerTypes.d.ts +105 -0
- package/@types/core/bridge/compiled/GenericDocumentTypes.d.ts +38 -0
- package/@types/core/bridge/compiled/GenericTextLineScannerTypes.d.ts +165 -0
- package/@types/core/bridge/compiled/Geometry.d.ts +49 -0
- package/@types/core/bridge/compiled/ImageProcessorTypes.d.ts +13 -0
- package/@types/core/bridge/compiled/LicensePlateScannerTypes.d.ts +67 -0
- package/@types/core/bridge/compiled/MRZTypes.d.ts +52 -0
- package/@types/core/bridge/compiled/MedicalCertificateTypes.d.ts +306 -0
- package/@types/core/bridge/compiled/OcrElements.d.ts +129 -0
- package/@types/core/bridge/compiled/ParametricFilters.d.ts +188 -0
- package/@types/core/bridge/compiled/PdfConfig.d.ts +197 -0
- package/@types/core/bridge/compiled/TiffTypes.d.ts +183 -0
- package/@types/core/bridge/utils.d.ts +7 -0
- package/@types/core/bridge/worker-bridge.d.ts +920 -0
- package/@types/core/worker/ScanbotSDK.Core-simd-threads.d.ts +0 -0
- package/@types/core/worker/ScanbotSDK.Core-simd.d.ts +0 -0
- package/@types/core/worker/ScanbotSDK.Core.d.ts +86 -0
- package/@types/core-types.d.ts +25 -0
- package/@types/cropping-view.d.ts +4 -2
- package/@types/document-scanner-view.d.ts +7 -5
- package/@types/generic-document-recognizer-view.d.ts +22 -0
- package/@types/index.d.ts +49 -21
- package/@types/interfaces/i-document-scanner-handle.d.ts +2 -2
- package/@types/interfaces/i-generic-document-recognizer-scanner-handle.d.ts +3 -0
- package/@types/model/barcode/barcode-result.d.ts +16 -8
- package/@types/model/barcode/barcode.d.ts +4 -14
- package/@types/model/camera-info.d.ts +3 -2
- package/@types/model/configuration/barcode-scanner-configuration.d.ts +15 -8
- package/@types/model/configuration/cropping-view-configuration.d.ts +7 -1
- package/@types/model/configuration/document-scanner-configuration.d.ts +6 -27
- package/@types/model/configuration/generic-document-recognizer-configuration.d.ts +9 -0
- package/@types/model/configuration/initialization-options.d.ts +10 -1
- package/@types/model/configuration/mrz-scanner-configuration.d.ts +4 -3
- package/@types/model/configuration/scanner-configuration.d.ts +8 -0
- package/@types/model/configuration/selection-overlay-configuration.d.ts +4 -4
- package/@types/model/configuration/text-data-scanner-configuration.d.ts +3 -6
- package/@types/model/configuration/view-finder-scanner-configuration.d.ts +3 -2
- package/@types/model/configuration/vin-scanner-configuration.d.ts +2 -1
- package/@types/model/error/media-error.d.ts +1 -0
- package/@types/model/response/cropping-result.d.ts +2 -1
- package/@types/scanbot-sdk.d.ts +510 -28
- package/@types/service/document-quality-analyzer.d.ts +7 -5
- package/@types/service/generic-document-recognizer.d.ts +13 -0
- package/@types/service/ocr-engine.d.ts +8 -5
- package/@types/service/pdf-generator.d.ts +7 -95
- package/@types/service/public-utils.d.ts +1 -1
- package/@types/service/simple-mrz-recognizer.d.ts +7 -5
- package/@types/service/text-data-recognizer.d.ts +7 -4
- package/@types/service/tiff-generator.d.ts +12 -10
- package/@types/ui2/common.d.ts +8 -0
- package/@types/ui2/configuration/ActionBarConfiguration.d.ts +30 -30
- package/@types/ui2/configuration/ArTrackingOverlayConfiguration.d.ts +220 -220
- package/@types/ui2/configuration/BarcodeInfoMapping.d.ts +52 -52
- package/@types/ui2/configuration/BarcodeItemMapper.d.ts +2 -2
- package/@types/ui2/configuration/BarcodeRecognizerConfiguration.d.ts +38 -181
- package/@types/ui2/configuration/BarcodeScannerConfiguration.d.ts +172 -188
- package/@types/ui2/configuration/BarcodeScannerTypes.d.ts +1 -0
- package/@types/ui2/configuration/BarcodeScannerUIResult.d.ts +29 -0
- package/@types/ui2/configuration/BarcodeTextLocalization.d.ts +102 -107
- package/@types/ui2/configuration/BarcodeTypes.d.ts +1 -0
- package/@types/ui2/configuration/BarcodeUseCase.d.ts +5 -1
- package/@types/ui2/configuration/CameraConfiguration.d.ts +44 -45
- package/@types/ui2/configuration/CameraPermission.d.ts +33 -48
- package/@types/ui2/configuration/Common.d.ts +190 -227
- package/@types/ui2/configuration/CommonFieldType.d.ts +1 -0
- package/@types/ui2/configuration/FindAndPickScanningModeUseCase.d.ts +366 -14
- package/@types/ui2/configuration/GenericDocument.d.ts +1 -0
- package/@types/ui2/configuration/Geometry.d.ts +1 -0
- package/@types/ui2/configuration/MultipleScanningModeUseCase.d.ts +489 -489
- package/@types/ui2/configuration/ScanbotAlertDialog.d.ts +27 -27
- package/@types/ui2/configuration/SingleScanningModeUseCase.d.ts +170 -170
- package/@types/ui2/configuration/TopBarConfiguration.d.ts +36 -52
- package/@types/ui2/configuration/UserGuidanceConfiguration.d.ts +16 -16
- package/@types/ui2/configuration/ViewFinderConfiguration.d.ts +49 -46
- package/@types/ui2/configuration.d.ts +3 -2
- package/@types/ui2/controllers/barcode-scanner-controller.d.ts +2 -2
- package/@types/ui2/controllers/multiple-scanning-mode-controller.d.ts +6 -3
- package/@types/ui2/controllers/single-scanning-mode-controller.d.ts +6 -3
- package/@types/ui2/model/counted-barcodes.d.ts +17 -23
- package/@types/ui2/scanbot-sdk-ui.d.ts +2 -2
- package/@types/ui2/scanbot-ui-library.d.ts +3 -2
- package/@types/ui2/utils/barcode-mapper/expected-barcode-mapper.d.ts +13 -0
- package/@types/ui2/utils/barcode-mapper/i-barcode-mapper.d.ts +18 -0
- package/@types/ui2/utils/{barcode-mapper.d.ts → barcode-mapper/user-barcode-mapper.d.ts} +11 -11
- package/@types/ui2/utils/camera-config.d.ts +2 -2
- package/@types/ui2/utils/find-and-pick.ts/expected-barcode-counter.d.ts +7 -0
- package/@types/ui2/utils/styled-badge.d.ts +1 -1
- package/@types/ui2/utils/styled-input.d.ts +1 -1
- package/@types/ui2/views/action-button/action-button-container.d.ts +2 -0
- package/@types/ui2/views/ar/ar-badge.d.ts +18 -0
- package/@types/ui2/views/ar/ar-overlay-barcode-info.d.ts +5 -1
- package/@types/ui2/views/ar/vertical-positions.d.ts +12 -0
- package/@types/ui2/views/barcode-info/barcode-info.d.ts +3 -1
- package/@types/ui2/views/barcode-scanner.d.ts +6 -5
- package/@types/ui2/views/dialog/base/confirmation-dialog.d.ts +20 -0
- package/@types/ui2/views/dialog/find-and-pick-submit-dialog.d.ts +10 -0
- package/@types/ui2/views/drawer/barcode-result-drawer.d.ts +1 -1
- package/@types/ui2/views/drawer/counting-button.d.ts +1 -1
- package/@types/ui2/views/drawer/subviews/barcode-drawer-empty-state.d.ts +1 -1
- package/@types/ui2/views/drawer/subviews/barcode-list-item.d.ts +5 -4
- package/@types/ui2/views/drawer/subviews/barcode-list.d.ts +8 -1
- package/@types/ui2/views/drawer/subviews/drawer-header-content.d.ts +1 -1
- package/@types/ui2/views/form/dialog-button.d.ts +2 -2
- package/@types/utils/barcode-utils.d.ts +10 -0
- package/@types/utils/browser-cameras.d.ts +92 -0
- package/@types/utils/dto/MagneticLine.d.ts +4 -4
- package/@types/utils/dto/Point.d.ts +2 -2
- package/@types/utils/dto/Polygon.d.ts +2 -1
- package/@types/utils/image-utils.d.ts +1 -0
- package/@types/utils/react/usePromise.d.ts +3 -1
- package/@types/utils/stats.d.ts +4 -0
- package/@types/utils/utils.d.ts +1 -1
- package/@types/utils/video-stream.d.ts +4 -3
- package/@types/utils/video-to-image-data/two-d-video-to-image-data.d.ts +8 -0
- package/@types/utils/video-to-image-data/video-to-image-data.d.ts +5 -0
- package/@types/utils/video-to-image-data/webgl-video-to-image-data.d.ts +21 -0
- package/@types/view/action-bar/bottom-action-bar.d.ts +2 -2
- package/@types/view/barcode-calculation/barcode-calculation-popup-list.d.ts +2 -2
- package/@types/view/barcode-calculation/barcode-calculation-popup.d.ts +4 -4
- package/@types/view/barcode-calculation/scanned-image-with-overlay.d.ts +2 -2
- package/@types/view/barcode-polygon/animated-barcode-selection-overlay.d.ts +7 -5
- package/@types/view/barcode-polygon/barcode-overlay.d.ts +3 -3
- package/@types/view/barcode-polygon/barcode-polygon-label.d.ts +2 -2
- package/@types/view/cropping/draggable-base-container.d.ts +8 -2
- package/@types/view/cropping/draggable-handles-component.d.ts +9 -2
- package/@types/view/scanbot-camera-view.d.ts +9 -3
- package/@types/view/view-finder.d.ts +1 -0
- package/@types/worker/worker-bridge.d.ts +906 -5
- package/Libraries.txt +307 -174
- package/README.md +3 -3
- package/bundle/ScanbotSDK.min.js +5 -5
- package/bundle/ScanbotSDK.ui2.min.js +108 -161
- package/bundle/ScanbotSDK.ui2.min.js.LICENSE.txt +0 -18
- 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 +4 -3
- package/ui.d.ts +3 -0
- package/ui.js +2 -0
- package/webpack/fileLoader.js +3 -5
- package/@types/core/compiled/ParametricFilters.d.ts +0 -181
- package/@types/core/utils.d.ts +0 -1
- package/@types/core/worker-bridge.d.ts +0 -20
- package/@types/model/barcode/barcode-format.d.ts +0 -1
- package/@types/model/barcode/engine-mode.d.ts +0 -1
- package/@types/model/configuration/document-quality-analyzer-configuration.d.ts +0 -13
- package/@types/model/document/contour-detection-result.d.ts +0 -11
- package/@types/model/document/detection-status.d.ts +0 -11
- package/@types/model/document/document-detection-result.d.ts +0 -8
- package/@types/model/filter-types.d.ts +0 -6
- package/@types/model/generic-text-line-recognizer/text-data-scanner-result.d.ts +0 -6
- package/@types/model/mrz/mrz-result.d.ts +0 -41
- package/@types/model/response/document-quality-analyzer-result.d.ts +0 -8
- package/@types/service/image-processor.d.ts +0 -35
- package/@types/ui2/configuration/BarcodeItem.d.ts +0 -30
- package/@types/ui2/configuration/BarcodeResult.d.ts +0 -14
- package/@types/ui2/configuration/utils.d.ts +0 -6
- package/@types/utils/networking.d.ts +0 -7
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
- /package/@types/ui2/views/dialog/{styled-dialog.d.ts → base/styled-dialog.d.ts} +0 -0
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { PdfConfig } from "../bridge/compiled/PdfConfig";
|
|
2
|
+
import { type RecognitionResult as MrzRecognitionResult, RecognizerConfiguration as MrzRecognizerConfig } from "../bridge/compiled/MRZTypes";
|
|
3
|
+
import { Config as DqaConfig, type AnalysisResult as DqaAnalysisResult } from "../bridge/compiled/DocumentQualityAnalyzerTypes";
|
|
4
|
+
import { ParametricFilter } from "../bridge/compiled/ParametricFilters";
|
|
5
|
+
import type { ImageRotation } from "../bridge/compiled/ImageProcessorTypes";
|
|
6
|
+
import { DetectionParameters, type DetectionResult } from "../bridge/compiled/DocumentDetectorTypes";
|
|
7
|
+
import { ScannerConfiguration as GtsConfig, type ScannerResult as GtsResult } from "../bridge/compiled/GenericTextLineScannerTypes";
|
|
8
|
+
import type { Page } from "../bridge/compiled/OcrElements";
|
|
9
|
+
import { type BarcodeDocumentFormat, BarcodeRecognizerParameters, type BarcodeScannerResult } from "../bridge/compiled/BarcodeScannerTypes";
|
|
10
|
+
import { GenericDocumentRecognizerParameters, RecognitionParameters as GdrRecognitionParameters, type RecognitionResult as GdrRecognitionResult } from "../bridge/compiled/GenericDocumentRecognizerTypes";
|
|
11
|
+
import { type Binarize, TIFFWriterParameters } from "../bridge/compiled/TiffTypes";
|
|
12
|
+
import type { RawImage, Point, DeepPartial } from "../bridge/common";
|
|
13
|
+
import type { GenericDocument } from "../bridge/compiled/GenericDocument";
|
|
14
|
+
/** Represents an object of type T residing in the WASM's memory. */
|
|
15
|
+
export declare class ObjectId<T> {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
/** @internal */
|
|
18
|
+
readonly _type?: T;
|
|
19
|
+
constructor(id: string);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Represents an image in a format that can be consumed by the WASM module.
|
|
23
|
+
* That is
|
|
24
|
+
* - either an ImageData object,
|
|
25
|
+
* - an ArrayBuffer or Uint8Array containing the binary data of an encoded image (most common image formats such as PNG and JPEG are supported),
|
|
26
|
+
* - or a RawImage, which are obtained by several SDK functions.
|
|
27
|
+
* */
|
|
28
|
+
export type Image = ImageData | ArrayBuffer | Uint8Array | RawImage;
|
|
29
|
+
type InitializeOptions = {
|
|
30
|
+
captureConsole?: boolean;
|
|
31
|
+
allowThreads?: boolean;
|
|
32
|
+
jpegQuality?: number;
|
|
33
|
+
requestSuffix?: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const commands: {
|
|
36
|
+
initialize: (licenseKey?: string, engine?: string, appId?: string, cdnPath?: string, options?: InitializeOptions) => Promise<any>;
|
|
37
|
+
getLicenseInfo: () => Promise<any>;
|
|
38
|
+
encodeJpeg: (image: Image) => Promise<Uint8Array>;
|
|
39
|
+
detectDocument: (image: Image, options: DeepPartial<DetectionParameters>) => Promise<DetectionResult>;
|
|
40
|
+
detectAndCropDocument: (image: Image) => Promise<CroppedDetectionResult>;
|
|
41
|
+
createDocumentDetector: (options: DeepPartial<DetectionParameters>) => Promise<ObjectId<"DocumentDetector">>;
|
|
42
|
+
documentDetectorDetect: <ImageType extends Image>(documentDetectorToken: ObjectId<"DocumentDetector">, image: ImageType) => Promise<DetectionResult & {
|
|
43
|
+
originalImage: ImageType;
|
|
44
|
+
}>;
|
|
45
|
+
parseBarcodeDocument: (options: BarcodeDocumentFormat[], data: string) => Promise<GenericDocument | null>;
|
|
46
|
+
createBarcodeRecognizer: (options: DeepPartial<BarcodeRecognizerParameters>) => Promise<ObjectId<"BarcodeRecognizer">>;
|
|
47
|
+
recognizeBarcodes: <ImageType_1 extends Image>(barcodeRecognizerToken: ObjectId<"BarcodeRecognizer">, image: ImageType_1) => Promise<BarcodeScannerResult & {
|
|
48
|
+
originalImage: ImageType_1;
|
|
49
|
+
}>;
|
|
50
|
+
beginPdf: (options: DeepPartial<PdfConfig>) => Promise<ObjectId<"PdfGenerationContext">>;
|
|
51
|
+
addPageToPdf: (pdfOperation: ObjectId<"PdfGenerationContext">, image: Image) => Promise<void>;
|
|
52
|
+
completePdf: (pdfOperation: ObjectId<"PdfGenerationContext">) => Promise<Uint8Array>;
|
|
53
|
+
beginTiff: (options: DeepPartial<TIFFWriterParameters>) => Promise<ObjectId<"TiffGenerationContext">>;
|
|
54
|
+
addPageToTiff: (tiffOperation: ObjectId<"TiffGenerationContext">, image: Image, binarize: Binarize) => Promise<unknown>;
|
|
55
|
+
completeTiff: (tiffOperation: ObjectId<"TiffGenerationContext">) => Promise<Uint8Array>;
|
|
56
|
+
createMRZRecognizer: (configuration: DeepPartial<MrzRecognizerConfig>) => Promise<ObjectId<"MrzRecognizerContext">>;
|
|
57
|
+
recognizeMRZ: <ImageType_2 extends Image>(mrzRecognizerToken: ObjectId<"MrzRecognizerContext">, image: ImageType_2) => Promise<MrzRecognitionResult & {
|
|
58
|
+
originalImage: ImageType_2;
|
|
59
|
+
}>;
|
|
60
|
+
releaseObject: <T>(objectToken: ObjectId<T>) => Promise<void>;
|
|
61
|
+
createOcrEngine: () => Promise<ObjectId<"TLDROcrContext">>;
|
|
62
|
+
performOcr: (tldrOcrToken: ObjectId<"TLDROcrContext">, image: Image) => Promise<Page>;
|
|
63
|
+
createGenericTextLineScanner: (configuration: DeepPartial<GtsConfig>) => Promise<ObjectId<"GenericTextLineScanner">>;
|
|
64
|
+
recognizeTextLine: <ImageType_3 extends Image>(scannerToken: ObjectId<"GenericTextLineScanner">, image: ImageType_3) => Promise<GtsResult & {
|
|
65
|
+
originalImage: ImageType_3;
|
|
66
|
+
}>;
|
|
67
|
+
cleanTextLineRecognitionQueue: (scannerToken: ObjectId<"GenericTextLineScanner">) => Promise<void>;
|
|
68
|
+
createDocumentQualityAnalyzer: (options: DeepPartial<DqaConfig>) => Promise<ObjectId<"DocumentQualityAnalyzer">>;
|
|
69
|
+
documentQualityAnalyzerAnalyze: (dqaToken: ObjectId<"DocumentQualityAnalyzer">, image: Image) => Promise<DqaAnalysisResult>;
|
|
70
|
+
imageApplyFilter: (image: Image, filter: DeepPartial<ParametricFilter>) => Promise<RawImage>;
|
|
71
|
+
imageCrop: (image: Image, polygon: [Point, Point, Point, Point]) => Promise<RawImage>;
|
|
72
|
+
imageResize: (image: Image, destinationSize: number) => Promise<RawImage>;
|
|
73
|
+
imageRotate: (image: Image, rotations: ImageRotation) => Promise<RawImage>;
|
|
74
|
+
genericDocumentRecognizerCreate: (parameters: DeepPartial<GenericDocumentRecognizerParameters>) => Promise<ObjectId<"GenericDocumentRecognizer">>;
|
|
75
|
+
genericDocumentRecognizerRecognize: <ImageType_4 extends Image>(gdrToken: ObjectId<"GenericDocumentRecognizer">, image: ImageType_4, parameters: DeepPartial<GdrRecognitionParameters>) => Promise<GdrRecognitionResult & {
|
|
76
|
+
originalImage: ImageType_4;
|
|
77
|
+
}>;
|
|
78
|
+
version: () => Promise<string>;
|
|
79
|
+
__hasModuleFunction: (functionName: string) => Promise<any>;
|
|
80
|
+
__callModuleFunction: (functionName: string, args?: any[]) => Promise<any>;
|
|
81
|
+
};
|
|
82
|
+
export interface CroppedDetectionResult extends DetectionResult {
|
|
83
|
+
croppedImage: RawImage | null;
|
|
84
|
+
originalImage: Image;
|
|
85
|
+
}
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * as BarcodeConfigs from './core/bridge/compiled/BarcodeConfigs';
|
|
2
|
+
export * as BarcodeScannerTypes from './core/bridge/compiled/BarcodeScannerTypes';
|
|
3
|
+
export * as BarcodeTypes from './core/bridge/compiled/BarcodeTypes';
|
|
4
|
+
export * as CheckRecognizerTypes from './core/bridge/compiled/CheckRecognizerTypes';
|
|
5
|
+
export * as CommonFieldType from './core/bridge/compiled/CommonFieldType';
|
|
6
|
+
export * as DocumentDetectorTypes from './core/bridge/compiled/DocumentDetectorTypes';
|
|
7
|
+
export * as DocumentQualityAnalyzerTypes from './core/bridge/compiled/DocumentQualityAnalyzerTypes';
|
|
8
|
+
export * as EhicTypes from './core/bridge/compiled/EhicTypes';
|
|
9
|
+
export * as GenericDocument from './core/bridge/compiled/GenericDocument';
|
|
10
|
+
export * as GenericDocumentRecognizerConfigs from './core/bridge/compiled/GenericDocumentRecognizerConfigs';
|
|
11
|
+
export * as GenericDocumentRecognizerTypes from './core/bridge/compiled/GenericDocumentRecognizerTypes';
|
|
12
|
+
export * as GenericDocumentTypes from './core/bridge/compiled/GenericDocumentTypes';
|
|
13
|
+
export * as GenericTextLineScannerTypes from './core/bridge/compiled/GenericTextLineScannerTypes';
|
|
14
|
+
export * as Geometry from './core/bridge/compiled/Geometry';
|
|
15
|
+
export * as ImageProcessorTypes from './core/bridge/compiled/ImageProcessorTypes';
|
|
16
|
+
export * as LicensePlateScannerTypes from './core/bridge/compiled/LicensePlateScannerTypes';
|
|
17
|
+
export * as MedicalCertificateTypes from './core/bridge/compiled/MedicalCertificateTypes';
|
|
18
|
+
export * as MRZTypes from './core/bridge/compiled/MRZTypes';
|
|
19
|
+
export * as OcrElements from './core/bridge/compiled/OcrElements';
|
|
20
|
+
export * as ParametricFilters from './core/bridge/compiled/ParametricFilters';
|
|
21
|
+
export * as PdfConfig from './core/bridge/compiled/PdfConfig';
|
|
22
|
+
export * as TiffTypes from './core/bridge/compiled/TiffTypes';
|
|
23
|
+
export * as FrameUtilities from './core/bridge/compiled/FrameUtilities';
|
|
24
|
+
export type { ObjectId, Image, CroppedDetectionResult } from './core/worker/ScanbotSDK.Core';
|
|
25
|
+
export { PartiallyConstructible, type RawImage, type DeepPartial, type Point, type Rectangle } from './core/bridge/common';
|
|
@@ -8,7 +8,9 @@ import { Point } from "./utils/dto/Point";
|
|
|
8
8
|
import { MagneticLine } from "./utils/dto/MagneticLine";
|
|
9
9
|
import { Polygon } from "./utils/dto/Polygon";
|
|
10
10
|
import MagnifierView, { MagnifierOptions } from "./view/cropping/magnifier-view";
|
|
11
|
+
import { ImageProcessorTypes } from "./core-types";
|
|
11
12
|
import { ICroppingViewHandle } from "./interfaces/i-cropping-view-handle";
|
|
13
|
+
import { DocumentDetectorTypes } from "./core-types";
|
|
12
14
|
export interface CroppingViewProps {
|
|
13
15
|
configuration: CroppingViewConfiguration;
|
|
14
16
|
container?: HTMLElement;
|
|
@@ -20,6 +22,7 @@ export interface CroppingViewProps {
|
|
|
20
22
|
}
|
|
21
23
|
export interface CroppingViewState {
|
|
22
24
|
image: string;
|
|
25
|
+
documentDetectionResult: DocumentDetectorTypes.DetectionResult;
|
|
23
26
|
polygon: Polygon;
|
|
24
27
|
calculatedSize: Size;
|
|
25
28
|
animation: {
|
|
@@ -67,7 +70,7 @@ export default class CroppingView extends React.Component<CroppingViewProps, Cro
|
|
|
67
70
|
*/
|
|
68
71
|
apply(): Promise<CroppingResult>;
|
|
69
72
|
MAX_ROTATIONS: number;
|
|
70
|
-
|
|
73
|
+
toCoreRotations(cw: number): ImageProcessorTypes.ImageRotation;
|
|
71
74
|
rotate(rotations: number): Promise<void>;
|
|
72
75
|
detect(): Promise<void>;
|
|
73
76
|
dispose(): void;
|
|
@@ -80,5 +83,4 @@ export default class CroppingView extends React.Component<CroppingViewProps, Cro
|
|
|
80
83
|
calculateScale(existingRotations: number, appliedRotations: number, calculatedSize: Size): number;
|
|
81
84
|
calculateRatio(calculatedSize: Size): number;
|
|
82
85
|
calculateMargin(size: Size): Point;
|
|
83
|
-
private detectContour;
|
|
84
86
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DocumentScannerConfiguration } from "./model/configuration/document-scanner-configuration";
|
|
3
|
-
import { DocumentDetectionResult } from "./model/document/document-detection-result";
|
|
4
3
|
import { ScanbotCameraProps, ScanbotCameraState, ScannerView } from "./scanner-view";
|
|
5
4
|
import { ShutterButton, ShutterButtonAction } from "./view/shutter-button";
|
|
6
5
|
import { DocumentOutline } from "./view/document-outline";
|
|
7
6
|
import { PolygonMovementPredicate } from "./utils/predicate/polygon-movement-predicate";
|
|
8
7
|
import { Polygon } from "./utils/dto/Polygon";
|
|
9
8
|
import { IDocumentScannerHandle } from "./interfaces/i-document-scanner-handle";
|
|
9
|
+
import { CroppedDetectionResult, ObjectId, DocumentDetectorTypes } from "./core-types";
|
|
10
10
|
export declare class DocumentScannerState extends ScanbotCameraState {
|
|
11
11
|
action: ShutterButtonAction;
|
|
12
12
|
}
|
|
@@ -28,20 +28,22 @@ export default class DocumentScannerView extends ScannerView<DocumentScannerProp
|
|
|
28
28
|
* Public API functions
|
|
29
29
|
*/
|
|
30
30
|
static create(configuration: DocumentScannerConfiguration): Promise<DocumentScannerView>;
|
|
31
|
-
detectAndCrop(): Promise<
|
|
31
|
+
detectAndCrop(): Promise<CroppedDetectionResult>;
|
|
32
32
|
enableAutoCapture(): void;
|
|
33
33
|
disableAutoCapture(): void;
|
|
34
34
|
updateAutoCapture(enabled: boolean): void;
|
|
35
35
|
isAutoCaptureEnabled(): boolean;
|
|
36
|
-
recognizer:
|
|
36
|
+
recognizer: Promise<ObjectId<"DocumentDetector">>;
|
|
37
37
|
/**
|
|
38
38
|
* Internal functions
|
|
39
39
|
*/
|
|
40
40
|
componentDidMount(): Promise<void>;
|
|
41
41
|
componentWillUnmount(): Promise<void>;
|
|
42
42
|
detect(): Promise<void>;
|
|
43
|
-
getStatusString(detectionResult:
|
|
44
|
-
detectInWebWorker(): Promise<
|
|
43
|
+
getStatusString(detectionResult: DocumentDetectorTypes.DetectionResult): DocumentDetectorTypes.DetectionStatus;
|
|
44
|
+
detectInWebWorker(): Promise<DocumentDetectorTypes.DetectionResult & {
|
|
45
|
+
originalImage: ImageData;
|
|
46
|
+
}>;
|
|
45
47
|
preventAutoCapture?: boolean;
|
|
46
48
|
handleAutoCapture(statusOk: boolean, polygon?: Polygon): Promise<void>;
|
|
47
49
|
updateButton(action: ShutterButtonAction): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ScanbotCameraProps, ScanbotCameraState, ScannerView } from "./scanner-view";
|
|
3
|
+
import { IGenericDocumentRecognizerScannerHandle } from "./interfaces/i-generic-document-recognizer-scanner-handle";
|
|
4
|
+
import { GenericDocumentRecognizerConfiguration } from "./model/configuration/generic-document-recognizer-configuration";
|
|
5
|
+
import type ScanbotSDK from "./scanbot-sdk";
|
|
6
|
+
declare class GenericDocumentRecognizerProps extends ScanbotCameraProps {
|
|
7
|
+
configuration: GenericDocumentRecognizerConfiguration;
|
|
8
|
+
sdk: ScanbotSDK;
|
|
9
|
+
}
|
|
10
|
+
export default class GenericDocumentRecognizerView extends ScannerView<GenericDocumentRecognizerProps, ScanbotCameraState> implements IGenericDocumentRecognizerScannerHandle {
|
|
11
|
+
private configuration;
|
|
12
|
+
private genericDocumentRecognizer;
|
|
13
|
+
private enabled;
|
|
14
|
+
private finder?;
|
|
15
|
+
constructor(props: GenericDocumentRecognizerProps);
|
|
16
|
+
static create(sdk: ScanbotSDK, configuration: GenericDocumentRecognizerConfiguration): Promise<IGenericDocumentRecognizerScannerHandle>;
|
|
17
|
+
componentDidMount(): void;
|
|
18
|
+
componentWillUnmount(): Promise<void>;
|
|
19
|
+
private detect;
|
|
20
|
+
render(): React.JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
package/@types/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export { IDocumentScannerHandle } from "./interfaces/i-document-scanner-handle";
|
|
2
2
|
export { DocumentScannerConfiguration, StyleConfiguration, TextConfiguration, CaptureButtonStyleConfiguration, OutlineStyleConfiguration, HintTextConfiguration, OutlineLabelStyleConfiguration, CaptureAnimationStyleConfiguration, OutlinePolygonStyleConfiguration } from "./model/configuration/document-scanner-configuration";
|
|
3
|
-
export { DocumentDetectionResult } from "./model/document/document-detection-result";
|
|
4
|
-
export { ContourDetectionResult } from "./model/document/contour-detection-result";
|
|
5
|
-
export * as DetectionStatus from "./model/document/detection-status";
|
|
6
3
|
|
|
7
4
|
export { ViewFinderScannerConfiguration } from "./model/configuration/view-finder-scanner-configuration";
|
|
8
5
|
|
|
@@ -12,49 +9,80 @@ export { CroppingResult } from "./model/response/cropping-result";
|
|
|
12
9
|
|
|
13
10
|
export { IBarcodeScannerHandle } from "./interfaces/i-barcode-scanner-handle";
|
|
14
11
|
export { BarcodeScannerConfiguration } from "./model/configuration/barcode-scanner-configuration";
|
|
15
|
-
export { BarcodeResult } from "./model/barcode/barcode-result";
|
|
16
|
-
export { BarcodeFormat } from "./model/barcode/barcode-format";
|
|
17
|
-
export { EngineMode } from "./model/barcode/engine-mode";
|
|
18
12
|
export { BarcodeCountConfiguration, BarcodeCountStyleConfiguration } from "./model/configuration/barcode-count-configuration";
|
|
13
|
+
export { BarcodeScannerResultWithSize } from "./model/barcode/barcode-result";
|
|
19
14
|
|
|
20
15
|
export { IMrzScannerHandle } from "./interfaces/i-mrz-scanner-handle";
|
|
21
16
|
export { MrzScannerConfiguration, MrzScannerAccumulatedFrameVerificationConfiguration } from "./model/configuration/mrz-scanner-configuration";
|
|
22
|
-
export { MrzResult, MrzCheckDigits, MrzField, MRZFieldValidationStatus } from "./model/mrz/mrz-result";
|
|
23
17
|
export * as SimpleMrzRecognizer from "./service/simple-mrz-recognizer";
|
|
24
18
|
|
|
25
|
-
export { TextDataScannerResult } from './model/generic-text-line-recognizer/text-data-scanner-result';
|
|
26
19
|
export { TextDataScannerConfiguration, TextDetectionCallback } from "./model/configuration/text-data-scanner-configuration";
|
|
27
20
|
export { ITextDataScannerHandle } from "./interfaces/i-text-data-scanner-handle";
|
|
28
21
|
|
|
29
22
|
export { VINScannerConfiguration } from "./model/configuration/vin-scanner-configuration";
|
|
30
23
|
|
|
24
|
+
export { GenericDocumentRecognizerConfiguration } from "./model/configuration/generic-document-recognizer-configuration";
|
|
25
|
+
export { default as GenericDocumentRecognizer } from "./service/generic-document-recognizer";
|
|
26
|
+
|
|
27
|
+
export { PdfGenerator } from "./service/pdf-generator";
|
|
28
|
+
export { TiffGenerator } from "./service/tiff-generator";
|
|
29
|
+
|
|
31
30
|
export { OcrData, default as OcrEngine, Rect } from "./service/ocr-engine";
|
|
32
|
-
export { Point } from "./utils/dto/Point";
|
|
33
31
|
export { MagneticLine } from "./utils/dto/MagneticLine";
|
|
34
32
|
|
|
35
|
-
export { ImageProcessor, Rotation } from "./service/image-processor";
|
|
36
|
-
export * as ParametricFilters from "./core/compiled/ParametricFilters";
|
|
37
|
-
|
|
38
|
-
export { default as DocumentQualityAnalyzerConfiguration } from "./model/configuration/document-quality-analyzer-configuration";
|
|
39
33
|
export { default as DocumentQualityAnalyzer } from "./service/document-quality-analyzer";
|
|
40
|
-
export { default as DocumentQualityAnalyzerResult, DocumentQuality } from "./model/response/document-quality-analyzer-result";
|
|
41
34
|
|
|
42
|
-
export {
|
|
35
|
+
export { PublicUtils } from "./service/public-utils";
|
|
43
36
|
export { Size } from "./utils/dto/Size";
|
|
44
37
|
export { VideoSize } from "./utils/dto/VideoSize";
|
|
45
38
|
|
|
46
39
|
export { SelectionOverlayConfiguration, IBarcodePolygonHandle, IBarcodePolygonLabelHandle, BarcodePolygonStyle, SelectionOverlayTextFormat, SelectionOverlayStyleConfiguration, BarcodePolygonLabelStyle } from "./model/configuration/selection-overlay-configuration";
|
|
47
40
|
|
|
48
|
-
export { default as PdfGenerator, PdfGenerationOptions, PageDirection, PageSize, PageFit } from "./service/pdf-generator";
|
|
49
|
-
export { default as TiffGenerator, TiffGenerationOptions } from "./service/tiff-generator";
|
|
50
|
-
|
|
51
|
-
export { BinarizationFilter, ColorFilter, ImageFilter } from "./model/filter-types";
|
|
52
41
|
export { Polygon } from "./utils/dto/Polygon";
|
|
53
|
-
|
|
42
|
+
|
|
43
|
+
//TODO We currently have two implementations of Point in: utils/dto/Point & core-types. Should this be refactored?
|
|
44
|
+
export { Point as Point2 } from "./utils/dto/Point";
|
|
54
45
|
|
|
55
46
|
export { InitializationOptions } from "./model/configuration/initialization-options";
|
|
56
47
|
export { LicenseInfo } from "./model/response/license-info";
|
|
57
48
|
export { CameraInfo, CameraFacingMode } from "./model/camera-info";
|
|
58
49
|
|
|
50
|
+
export { ConsumeType } from "./consume-type";
|
|
51
|
+
|
|
52
|
+
export { BrowserCameras, CameraDetectionStrategy, DiscoverCameraMode } from './utils/browser-cameras';
|
|
53
|
+
|
|
59
54
|
export { default as ScanbotSDKUI2 } from "./ui2/scanbot-sdk-ui";
|
|
60
|
-
export * as UIConfig from "./ui2/configuration";
|
|
55
|
+
export * as UIConfig from "./ui2/configuration";
|
|
56
|
+
export {
|
|
57
|
+
BarcodeConfigs,
|
|
58
|
+
BarcodeScannerTypes,
|
|
59
|
+
BarcodeTypes,
|
|
60
|
+
CheckRecognizerTypes,
|
|
61
|
+
CommonFieldType,
|
|
62
|
+
DocumentDetectorTypes,
|
|
63
|
+
DocumentQualityAnalyzerTypes,
|
|
64
|
+
EhicTypes,
|
|
65
|
+
GenericDocument,
|
|
66
|
+
GenericDocumentRecognizerConfigs,
|
|
67
|
+
GenericDocumentRecognizerTypes,
|
|
68
|
+
GenericDocumentTypes,
|
|
69
|
+
GenericTextLineScannerTypes,
|
|
70
|
+
Geometry,
|
|
71
|
+
ImageProcessorTypes,
|
|
72
|
+
LicensePlateScannerTypes,
|
|
73
|
+
MedicalCertificateTypes,
|
|
74
|
+
MRZTypes,
|
|
75
|
+
OcrElements,
|
|
76
|
+
ParametricFilters,
|
|
77
|
+
PdfConfig,
|
|
78
|
+
TiffTypes,
|
|
79
|
+
FrameUtilities,
|
|
80
|
+
ObjectId, Image, CroppedDetectionResult,
|
|
81
|
+
PartiallyConstructible, RawImage, DeepPartial, Point, Rectangle
|
|
82
|
+
} from "./core-types";
|
|
83
|
+
|
|
84
|
+
// We also need to export the Config-namespace as a whole, because it is directly used in
|
|
85
|
+
// ScanbotSDK.ts and without it, the API docs would be incomplete.
|
|
86
|
+
// In the API docs, Config and the types that are directly exported from ./core-types above are
|
|
87
|
+
// automatically reconciled.
|
|
88
|
+
export * as Config from "./core-types";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DocumentDetectionResult } from "../model/document/document-detection-result";
|
|
2
1
|
import { IScannerCommon } from "./i-scanner-common-handle";
|
|
2
|
+
import type { CroppedDetectionResult } from "../core-types";
|
|
3
3
|
export interface IDocumentScannerHandle extends IScannerCommon {
|
|
4
|
-
detectAndCrop(): Promise<
|
|
4
|
+
detectAndCrop(): Promise<CroppedDetectionResult>;
|
|
5
5
|
enableAutoCapture(): void;
|
|
6
6
|
disableAutoCapture(): void;
|
|
7
7
|
isAutoCaptureEnabled(): boolean;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare class
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { Size } from "../../utils/dto/Size";
|
|
2
|
+
import type { BarcodeScannerTypes } from "../../core-types";
|
|
3
|
+
export declare class BarcodeScannerResultWithSize {
|
|
4
|
+
coreResult: {
|
|
5
|
+
barcodes: BarcodeScannerTypes.BarcodeItem[];
|
|
6
|
+
originalImage?: ImageData;
|
|
7
|
+
};
|
|
8
|
+
barcodes: BarcodeScannerTypes.BarcodeItem[];
|
|
9
|
+
originalImageSize: Size | null;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
constructor(coreResult: {
|
|
14
|
+
barcodes: BarcodeScannerTypes.BarcodeItem[];
|
|
15
|
+
originalImage?: ImageData;
|
|
16
|
+
});
|
|
9
17
|
isEmpty(): boolean;
|
|
10
18
|
}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
text: string;
|
|
6
|
-
parsedText: any;
|
|
7
|
-
rawBytes: Uint8Array;
|
|
8
|
-
points: Point[];
|
|
9
|
-
barcodeImage: Uint8Array;
|
|
10
|
-
constructor(format: BarcodeFormat, text: string, parsedText: string, bytes: Uint8Array, points: Point[], barcodeImage: Uint8Array);
|
|
11
|
-
id(): string;
|
|
12
|
-
equals(barcode: Barcode): unknown;
|
|
13
|
-
static fromWorker(input: any): Barcode;
|
|
14
|
-
}
|
|
1
|
+
import { BarcodeScannerTypes } from "../../core-types";
|
|
2
|
+
export declare function barcodesEqual(barcodeItem1: BarcodeScannerTypes.BarcodeItem, barcodeItem2: BarcodeScannerTypes.BarcodeItem): boolean;
|
|
3
|
+
export declare function barcodeId(barcode: BarcodeScannerTypes.BarcodeItem): string;
|
|
4
|
+
export declare function barcodeItemFromText(text: string): BarcodeScannerTypes.BarcodeItem;
|
|
@@ -2,6 +2,7 @@ export type CameraFacingMode = 'front' | 'back' | 'unknown';
|
|
|
2
2
|
export interface CameraInfo {
|
|
3
3
|
deviceId: string;
|
|
4
4
|
label: string;
|
|
5
|
-
|
|
6
|
-
supportsTorchControl
|
|
5
|
+
maxNumPixels: number | undefined;
|
|
6
|
+
supportsTorchControl: boolean | undefined;
|
|
7
|
+
facingMode: CameraFacingMode;
|
|
7
8
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { BarcodeResult } from "../barcode/barcode-result";
|
|
2
|
-
import { EngineMode } from "../barcode/engine-mode";
|
|
3
|
-
import { BarcodeFormat } from "../barcode/barcode-format";
|
|
4
1
|
import { SelectionOverlayConfiguration } from "./selection-overlay-configuration";
|
|
5
2
|
import { BarcodeCountConfiguration } from "./barcode-count-configuration";
|
|
6
3
|
import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
|
|
4
|
+
import { BarcodeScannerTypes, type DeepPartial } from "../../core-types";
|
|
5
|
+
import type { BarcodeScannerResultWithSize } from "../barcode/barcode-result";
|
|
7
6
|
export declare class BarcodeScannerConfiguration extends ViewFinderScannerConfiguration {
|
|
8
7
|
constructor();
|
|
9
8
|
/**
|
|
@@ -11,9 +10,7 @@ export declare class BarcodeScannerConfiguration extends ViewFinderScannerConfig
|
|
|
11
10
|
*/
|
|
12
11
|
captureDelay?: number;
|
|
13
12
|
overlay?: SelectionOverlayConfiguration;
|
|
14
|
-
|
|
15
|
-
barcodeFormats?: BarcodeFormat[];
|
|
16
|
-
returnBarcodeImage?: boolean;
|
|
13
|
+
detectionParameters?: Omit<DeepPartial<BarcodeScannerTypes.BarcodeRecognizerParameters>, "live">;
|
|
17
14
|
/**
|
|
18
15
|
* Special property to enable barcode count mode.
|
|
19
16
|
* This is a type of a ready-to-use user interface scanning and counting found barcodes.
|
|
@@ -29,7 +26,17 @@ export declare class BarcodeScannerConfiguration extends ViewFinderScannerConfig
|
|
|
29
26
|
zoom?: number;
|
|
30
27
|
/**
|
|
31
28
|
*/
|
|
32
|
-
onBarcodesDetected?: (e:
|
|
33
|
-
|
|
29
|
+
onBarcodesDetected?: (e: BarcodeScannerResultWithSize) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Note that the ImageData is only available at the point in time when _onDetectionFailed is invoked.
|
|
32
|
+
* The underlying buffer will be reused in the next detection cycle and will not be available anymore.
|
|
33
|
+
* @internal
|
|
34
|
+
* */
|
|
35
|
+
_onDetectionFailed?: (originalImageSize: ImageData) => void;
|
|
36
|
+
/**
|
|
37
|
+
* If set, limit the resolution of the image that is used for barcode recognition.
|
|
38
|
+
* A lower value will result in faster processing times but may reduce recognition quality.
|
|
39
|
+
*/
|
|
40
|
+
desiredRecognitionResolution?: number;
|
|
34
41
|
static fromJson(json: any): BarcodeScannerConfiguration;
|
|
35
42
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Polygon } from "../../utils/dto/Polygon";
|
|
2
2
|
import { BaseConfiguration } from "./base-configuration";
|
|
3
|
+
import type { Image } from "../../core-types";
|
|
3
4
|
export declare class CroppingViewMagneticLineStyle {
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
color?: string;
|
|
@@ -42,8 +43,13 @@ export declare class CroppingViewConfiguration extends BaseConfiguration {
|
|
|
42
43
|
* Enhances drag-to-crop experience. True by default
|
|
43
44
|
*/
|
|
44
45
|
disableScroll?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The polygon that defines the initial cropping area.
|
|
48
|
+
* All points should have relative coordinates between 0 and 1.
|
|
49
|
+
* If this is not set, the cropping area is initialized with an automatically detected outline of the document.
|
|
50
|
+
*/
|
|
45
51
|
polygon?: Polygon;
|
|
46
|
-
image:
|
|
52
|
+
image: Image;
|
|
47
53
|
/**
|
|
48
54
|
* Initial rotations of the original image. Default is 0
|
|
49
55
|
*/
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { ScannerConfiguration } from "./scanner-configuration";
|
|
2
|
+
import { DocumentDetectorTypes, DeepPartial, CroppedDetectionResult } from "../../core-types";
|
|
2
3
|
export declare class TextConfiguration {
|
|
3
4
|
constructor(hint?: HintTextConfiguration);
|
|
4
5
|
hint?: HintTextConfiguration;
|
|
5
6
|
}
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
OK_BadAngles?: string;
|
|
10
|
-
OK_BadAspectRatio?: string;
|
|
11
|
-
OK_OffCenter?: string;
|
|
12
|
-
Error_NothingDetected?: string;
|
|
13
|
-
Error_Brightness?: string;
|
|
14
|
-
Error_Noise?: string;
|
|
15
|
-
}
|
|
7
|
+
export type HintTextConfiguration = {
|
|
8
|
+
[key in DocumentDetectorTypes.DetectionStatus]: string;
|
|
9
|
+
};
|
|
16
10
|
export declare class StyleConfiguration {
|
|
17
11
|
constructor();
|
|
18
12
|
outline?: OutlineStyleConfiguration;
|
|
@@ -53,16 +47,7 @@ export declare class CaptureButtonStyleConfiguration {
|
|
|
53
47
|
}
|
|
54
48
|
export declare class DocumentScannerConfiguration extends ScannerConfiguration {
|
|
55
49
|
constructor();
|
|
56
|
-
|
|
57
|
-
* The minimum score in percent (0 - 100) of the perspective
|
|
58
|
-
* distortion to accept a detected document. Default is 75.0.
|
|
59
|
-
*/
|
|
60
|
-
acceptedAngleScore?: number;
|
|
61
|
-
/**
|
|
62
|
-
* The minimum document width or height in percent (0-100)
|
|
63
|
-
* of the screen size to accept a detected document. Default is 80.0.
|
|
64
|
-
*/
|
|
65
|
-
acceptedSizeScore?: number;
|
|
50
|
+
detectionParameters?: DeepPartial<DocumentDetectorTypes.DetectionParameters>;
|
|
66
51
|
/**
|
|
67
52
|
* If auto-capture is enabled and when a document is detected, it will be automatically
|
|
68
53
|
* captured when conditions are good and the auto-snapping time-out elapses.
|
|
@@ -107,13 +92,7 @@ export declare class DocumentScannerConfiguration extends ScannerConfiguration {
|
|
|
107
92
|
/**
|
|
108
93
|
* Document detected callback. Continuous callback,
|
|
109
94
|
* stopped only when detection is stopped or camera widget is disposed.
|
|
110
|
-
* Result contains the following properties:
|
|
111
|
-
* detectionStatus: "OK",
|
|
112
|
-
* success: true,
|
|
113
|
-
* cropped: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...",
|
|
114
|
-
* original: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...",
|
|
115
|
-
* polygon: Array(4)}
|
|
116
95
|
*/
|
|
117
|
-
onDocumentDetected?: (
|
|
96
|
+
onDocumentDetected?: (result: CroppedDetectionResult) => void;
|
|
118
97
|
static fromJson(json: any): DocumentScannerConfiguration;
|
|
119
98
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DeepPartial, GenericDocumentRecognizerTypes } from "../../core-types";
|
|
2
|
+
import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
|
|
3
|
+
export declare class GenericDocumentRecognizerConfiguration extends ViewFinderScannerConfiguration {
|
|
4
|
+
constructor();
|
|
5
|
+
detectorParameters?: DeepPartial<GenericDocumentRecognizerTypes.GenericDocumentRecognizerParameters>;
|
|
6
|
+
/** Callback is called for every analyzed frame. */
|
|
7
|
+
onDocumentDetected?: (result: GenericDocumentRecognizerTypes.RecognitionResult) => void;
|
|
8
|
+
static fromJson(json: DeepPartial<GenericDocumentRecognizerConfiguration>): GenericDocumentRecognizerConfiguration;
|
|
9
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { CameraDetectionStrategy } from "../../utils/browser-cameras";
|
|
1
2
|
export interface InitializationOptions {
|
|
2
3
|
/**
|
|
3
4
|
* Scanbot Web SDK License key. Required
|
|
4
5
|
*/
|
|
5
6
|
licenseKey: string;
|
|
6
7
|
/**
|
|
7
|
-
* Location of the Core WebAssembly Engine.
|
|
8
|
+
* Location of the Core WebAssembly Engine. Mandatory.
|
|
9
|
+
* @deprecated This option is deprecated and will be replaced by the option `enginePath` in the next major release.
|
|
8
10
|
*/
|
|
9
11
|
engine?: string;
|
|
10
12
|
/**
|
|
@@ -28,4 +30,11 @@ export interface InitializationOptions {
|
|
|
28
30
|
* Defaults to '?CURRENT_SDK_VERSION'.
|
|
29
31
|
*/
|
|
30
32
|
requestSuffix?: string;
|
|
33
|
+
/**
|
|
34
|
+
* On devices with multiple cameras, it is difficult to choose which camera to use for scanning.
|
|
35
|
+
* You can choose from several different automatic detection strategies described by
|
|
36
|
+
* {@link CameraDetectionStrategy}.
|
|
37
|
+
* Defaults to `FAST_DEFERRED`.
|
|
38
|
+
*/
|
|
39
|
+
bestCameraDetectionStrategy?: CameraDetectionStrategy;
|
|
31
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DeepPartial, MRZTypes } from "../../core-types";
|
|
2
2
|
import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
|
|
3
3
|
export interface MrzScannerAccumulatedFrameVerificationConfiguration {
|
|
4
4
|
/** Maximum number of accumulated frames to inspect to verify a scan result */
|
|
@@ -9,8 +9,9 @@ export interface MrzScannerAccumulatedFrameVerificationConfiguration {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class MrzScannerConfiguration extends ViewFinderScannerConfiguration {
|
|
11
11
|
constructor();
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
/** {@displayType `DeepPartial<MRZTypes.RecognizerConfiguration>`} {@link Config.MRZTypes.RecognizerConfiguration}*/
|
|
13
|
+
recognizerConfiguration?: DeepPartial<MRZTypes.RecognizerConfiguration>;
|
|
14
|
+
onMrzDetected?: (e: MRZTypes.RecognitionResult) => void;
|
|
14
15
|
_onDetectionFailed?: (e: ImageData) => void;
|
|
15
16
|
static fromJson(json: any): MrzScannerConfiguration;
|
|
16
17
|
}
|
|
@@ -8,6 +8,7 @@ export declare class ScannerConfiguration extends BaseConfiguration {
|
|
|
8
8
|
width: number;
|
|
9
9
|
height: number;
|
|
10
10
|
};
|
|
11
|
+
static DEFAULT_ACCEPTED_BRIGHTNESS_SCORE: number;
|
|
11
12
|
static DEFAULT_ACCEPTED_ANGLE_SCORE: number;
|
|
12
13
|
static DEFAULT_ACCEPTED_SIZE_SCORE: number;
|
|
13
14
|
/**
|
|
@@ -15,6 +16,10 @@ export declare class ScannerConfiguration extends BaseConfiguration {
|
|
|
15
16
|
*/
|
|
16
17
|
videoConstraints?: any;
|
|
17
18
|
mirrored?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Camera id or camera label.
|
|
21
|
+
* A list of available cameras can be obtained from {@link ScanbotSDK.cameras}.
|
|
22
|
+
**/
|
|
18
23
|
preferredCamera?: string;
|
|
19
24
|
spinnerColor?: string;
|
|
20
25
|
backgroundColor?: string;
|
|
@@ -26,6 +31,9 @@ export declare class ScannerConfiguration extends BaseConfiguration {
|
|
|
26
31
|
static mapVideoConstraints(json: any, configuration: ScannerConfiguration): void;
|
|
27
32
|
/**
|
|
28
33
|
* Error callback of the SDK.
|
|
34
|
+
* If any error was reported, your scanner might not be scanning anymore, e.g. due to an out-of-memory error.
|
|
35
|
+
* You should dispose the scanner and use {@link ScanbotSDK.destroy} and {@link ScanbotSDK.initialize} to
|
|
36
|
+
* re-initialize the SDK.
|
|
29
37
|
*/
|
|
30
38
|
onError?: (e: any) => void;
|
|
31
39
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BarcodeScannerTypes } from "../../core-types";
|
|
2
2
|
export type SelectionOverlayTextFormat = "Text" | "TextAndFormat" | "None";
|
|
3
3
|
export declare class BarcodePolygonStyle {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
fillColor?: string;
|
|
5
|
+
strokeColor?: string;
|
|
6
6
|
strokeWidth?: number;
|
|
7
7
|
cornerRadius?: number;
|
|
8
8
|
}
|
|
@@ -44,5 +44,5 @@ export declare class SelectionOverlayConfiguration {
|
|
|
44
44
|
*/
|
|
45
45
|
automaticSelectionEnabled?: boolean;
|
|
46
46
|
style?: SelectionOverlayStyleConfiguration;
|
|
47
|
-
onBarcodeFound?: (code:
|
|
47
|
+
onBarcodeFound?: (code: BarcodeScannerTypes.BarcodeItem, polygon: IBarcodePolygonHandle, label: IBarcodePolygonLabelHandle) => void;
|
|
48
48
|
}
|