scanbot-web-sdk 6.0.0-dev.2 → 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.
Files changed (139) hide show
  1. package/@types/consume-type.d.ts +2 -1
  2. package/@types/core/bridge/common.d.ts +1 -1
  3. package/@types/core/bridge/compiled/BarcodeScannerTypes.d.ts +5 -3
  4. package/@types/core/bridge/compiled/GDRTypes.d.ts +38 -0
  5. package/@types/core/bridge/compiled/GenericDocument.d.ts +38 -0
  6. package/@types/core/bridge/compiled/GenericDocumentRecognizerConfigs.d.ts +183 -0
  7. package/@types/core/bridge/compiled/GenericDocumentRecognizerTypes.d.ts +7 -6
  8. package/@types/core/bridge/compiled/GenericDocumentTypes.d.ts +38 -0
  9. package/@types/core/bridge/compiled/ParametricFilters.d.ts +4 -2
  10. package/@types/core/bridge/worker-bridge.d.ts +584 -26
  11. package/@types/core/worker/ScanbotSDK.Core.d.ts +18 -7
  12. package/@types/core-types.d.ts +3 -1
  13. package/@types/document-scanner-view.d.ts +3 -1
  14. package/@types/index.d.ts +39 -4
  15. package/@types/model/barcode/barcode-result.d.ts +12 -2
  16. package/@types/model/barcode/barcode.d.ts +2 -1
  17. package/@types/model/camera-info.d.ts +3 -2
  18. package/@types/model/configuration/barcode-scanner-configuration.d.ts +6 -3
  19. package/@types/model/configuration/cropping-view-configuration.d.ts +5 -0
  20. package/@types/model/configuration/document-scanner-configuration.d.ts +2 -8
  21. package/@types/model/configuration/generic-document-recognizer-configuration.d.ts +1 -1
  22. package/@types/model/configuration/initialization-options.d.ts +8 -0
  23. package/@types/model/configuration/mrz-scanner-configuration.d.ts +1 -1
  24. package/@types/model/configuration/scanner-configuration.d.ts +7 -0
  25. package/@types/model/configuration/selection-overlay-configuration.d.ts +2 -2
  26. package/@types/model/configuration/view-finder-scanner-configuration.d.ts +1 -1
  27. package/@types/model/error/media-error.d.ts +1 -0
  28. package/@types/scanbot-sdk.d.ts +355 -52
  29. package/@types/service/generic-document-recognizer.d.ts +3 -1
  30. package/@types/service/simple-mrz-recognizer.d.ts +3 -1
  31. package/@types/service/text-data-recognizer.d.ts +3 -1
  32. package/@types/ui2/common.d.ts +8 -0
  33. package/@types/ui2/configuration/ActionBarConfiguration.d.ts +30 -30
  34. package/@types/ui2/configuration/ArTrackingOverlayConfiguration.d.ts +220 -220
  35. package/@types/ui2/configuration/BarcodeInfoMapping.d.ts +51 -51
  36. package/@types/ui2/configuration/BarcodeItemMapper.d.ts +2 -2
  37. package/@types/ui2/configuration/BarcodeRecognizerConfiguration.d.ts +32 -32
  38. package/@types/ui2/configuration/BarcodeScannerConfiguration.d.ts +168 -168
  39. package/@types/ui2/configuration/BarcodeScannerTypes.d.ts +1 -6
  40. package/@types/ui2/configuration/BarcodeScannerUIResult.d.ts +29 -0
  41. package/@types/ui2/configuration/BarcodeTextLocalization.d.ts +124 -69
  42. package/@types/ui2/configuration/BarcodeTypes.d.ts +1 -1
  43. package/@types/ui2/configuration/BarcodeUseCase.d.ts +4 -3
  44. package/@types/ui2/configuration/CameraConfiguration.d.ts +32 -32
  45. package/@types/ui2/configuration/CameraPermission.d.ts +33 -33
  46. package/@types/ui2/configuration/Common.d.ts +190 -190
  47. package/@types/ui2/configuration/CommonFieldType.d.ts +1 -0
  48. package/@types/ui2/configuration/FindAndPickScanningModeUseCase.d.ts +364 -12
  49. package/@types/ui2/configuration/GenericDocument.d.ts +1 -0
  50. package/@types/ui2/configuration/MultipleScanningModeUseCase.d.ts +488 -488
  51. package/@types/ui2/configuration/ScanbotAlertDialog.d.ts +27 -27
  52. package/@types/ui2/configuration/SingleScanningModeUseCase.d.ts +169 -169
  53. package/@types/ui2/configuration/TopBarConfiguration.d.ts +36 -36
  54. package/@types/ui2/configuration/UserGuidanceConfiguration.d.ts +16 -16
  55. package/@types/ui2/configuration/ViewFinderConfiguration.d.ts +45 -45
  56. package/@types/ui2/configuration.d.ts +2 -1
  57. package/@types/ui2/controllers/barcode-scanner-controller.d.ts +2 -2
  58. package/@types/ui2/controllers/multiple-scanning-mode-controller.d.ts +4 -2
  59. package/@types/ui2/controllers/single-scanning-mode-controller.d.ts +4 -2
  60. package/@types/ui2/model/counted-barcodes.d.ts +12 -19
  61. package/@types/ui2/scanbot-sdk-ui.d.ts +2 -2
  62. package/@types/ui2/scanbot-ui-library.d.ts +3 -2
  63. package/@types/ui2/utils/barcode-mapper/expected-barcode-mapper.d.ts +13 -0
  64. package/@types/ui2/utils/barcode-mapper/i-barcode-mapper.d.ts +18 -0
  65. package/@types/ui2/utils/{barcode-mapper.d.ts → barcode-mapper/user-barcode-mapper.d.ts} +4 -16
  66. package/@types/ui2/utils/find-and-pick.ts/expected-barcode-counter.d.ts +7 -0
  67. package/@types/ui2/utils/styled-badge.d.ts +1 -1
  68. package/@types/ui2/views/ar/ar-badge.d.ts +18 -0
  69. package/@types/ui2/views/ar/ar-overlay-barcode-info.d.ts +5 -1
  70. package/@types/ui2/views/ar/vertical-positions.d.ts +12 -0
  71. package/@types/ui2/views/barcode-info/barcode-info.d.ts +3 -1
  72. package/@types/ui2/views/barcode-scanner.d.ts +5 -5
  73. package/@types/ui2/views/dialog/base/confirmation-dialog.d.ts +20 -0
  74. package/@types/ui2/views/dialog/find-and-pick-submit-dialog.d.ts +10 -0
  75. package/@types/ui2/views/drawer/barcode-result-drawer.d.ts +1 -1
  76. package/@types/ui2/views/drawer/counting-button.d.ts +1 -1
  77. package/@types/ui2/views/drawer/subviews/barcode-drawer-empty-state.d.ts +1 -1
  78. package/@types/ui2/views/drawer/subviews/barcode-list-item.d.ts +5 -4
  79. package/@types/ui2/views/drawer/subviews/barcode-list.d.ts +8 -1
  80. package/@types/ui2/views/drawer/subviews/drawer-header-content.d.ts +1 -1
  81. package/@types/utils/barcode-utils.d.ts +10 -0
  82. package/@types/utils/browser-cameras.d.ts +92 -0
  83. package/@types/utils/dto/Polygon.d.ts +2 -1
  84. package/@types/utils/stats.d.ts +4 -0
  85. package/@types/utils/video-stream.d.ts +3 -3
  86. package/@types/utils/video-to-image-data/two-d-video-to-image-data.d.ts +8 -0
  87. package/@types/utils/video-to-image-data/video-to-image-data.d.ts +5 -0
  88. package/@types/utils/video-to-image-data/webgl-video-to-image-data.d.ts +21 -0
  89. package/@types/view/barcode-polygon/animated-barcode-selection-overlay.d.ts +1 -0
  90. package/@types/view/scanbot-camera-view.d.ts +9 -3
  91. package/@types/worker/worker-bridge.d.ts +587 -30
  92. package/bundle/ScanbotSDK.min.js +4 -4
  93. package/bundle/ScanbotSDK.ui2.min.js +16 -16
  94. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  95. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  96. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  97. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
  98. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  99. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
  100. package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
  101. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
  102. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  103. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
  104. package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
  105. package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
  106. package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
  107. package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
  108. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  109. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  110. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  111. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
  112. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  113. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
  114. package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
  115. package/package.json +2 -2
  116. package/@types/core/bridge/compiled_schemas_v3/BarcodeConfigs.d.ts +0 -973
  117. package/@types/core/bridge/compiled_schemas_v3/BarcodeScannerTypes.d.ts +0 -183
  118. package/@types/core/bridge/compiled_schemas_v3/BarcodeTypes.d.ts +0 -183
  119. package/@types/core/bridge/compiled_schemas_v3/CheckRecognizerTypes.d.ts +0 -29
  120. package/@types/core/bridge/compiled_schemas_v3/CommonFieldType.d.ts +0 -59
  121. package/@types/core/bridge/compiled_schemas_v3/DocumentDetectorTypes.d.ts +0 -196
  122. package/@types/core/bridge/compiled_schemas_v3/DocumentQualityAnalyzerTypes.d.ts +0 -105
  123. package/@types/core/bridge/compiled_schemas_v3/EhicTypes.d.ts +0 -218
  124. package/@types/core/bridge/compiled_schemas_v3/FrameUtilities.d.ts +0 -18
  125. package/@types/core/bridge/compiled_schemas_v3/GenericDocument.d.ts +0 -198
  126. package/@types/core/bridge/compiled_schemas_v3/GenericDocumentRecognizerTypes.d.ts +0 -104
  127. package/@types/core/bridge/compiled_schemas_v3/GenericTextLineScannerTypes.d.ts +0 -165
  128. package/@types/core/bridge/compiled_schemas_v3/Geometry.d.ts +0 -49
  129. package/@types/core/bridge/compiled_schemas_v3/ImageProcessorTypes.d.ts +0 -13
  130. package/@types/core/bridge/compiled_schemas_v3/LicensePlateScannerTypes.d.ts +0 -67
  131. package/@types/core/bridge/compiled_schemas_v3/MRZTypes.d.ts +0 -52
  132. package/@types/core/bridge/compiled_schemas_v3/MedicalCertificateTypes.d.ts +0 -306
  133. package/@types/core/bridge/compiled_schemas_v3/OcrElements.d.ts +0 -129
  134. package/@types/core/bridge/compiled_schemas_v3/ParametricFilters.d.ts +0 -186
  135. package/@types/core/bridge/compiled_schemas_v3/PdfConfig.d.ts +0 -197
  136. package/@types/core/bridge/compiled_schemas_v3/TiffTypes.d.ts +0 -183
  137. package/@types/ui2/configuration/BarcodeItem.d.ts +0 -6
  138. package/@types/ui2/configuration/utils.d.ts +0 -6
  139. /package/@types/ui2/views/dialog/{styled-dialog.d.ts → base/styled-dialog.d.ts} +0 -0
@@ -7,7 +7,7 @@ import { DetectionParameters, type DetectionResult } from "../bridge/compiled/Do
7
7
  import { ScannerConfiguration as GtsConfig, type ScannerResult as GtsResult } from "../bridge/compiled/GenericTextLineScannerTypes";
8
8
  import type { Page } from "../bridge/compiled/OcrElements";
9
9
  import { type BarcodeDocumentFormat, BarcodeRecognizerParameters, type BarcodeScannerResult } from "../bridge/compiled/BarcodeScannerTypes";
10
- import { GenericDocumentRecognizerConfig, RecognitionParameters as GdrRecognitionParameters, type RecognitionResult as GdrRecognitionResult } from "../bridge/compiled/GenericDocumentRecognizerTypes";
10
+ import { GenericDocumentRecognizerParameters, RecognitionParameters as GdrRecognitionParameters, type RecognitionResult as GdrRecognitionResult } from "../bridge/compiled/GenericDocumentRecognizerTypes";
11
11
  import { type Binarize, TIFFWriterParameters } from "../bridge/compiled/TiffTypes";
12
12
  import type { RawImage, Point, DeepPartial } from "../bridge/common";
13
13
  import type { GenericDocument } from "../bridge/compiled/GenericDocument";
@@ -39,10 +39,14 @@ export declare const commands: {
39
39
  detectDocument: (image: Image, options: DeepPartial<DetectionParameters>) => Promise<DetectionResult>;
40
40
  detectAndCropDocument: (image: Image) => Promise<CroppedDetectionResult>;
41
41
  createDocumentDetector: (options: DeepPartial<DetectionParameters>) => Promise<ObjectId<"DocumentDetector">>;
42
- documentDetectorDetect: (documentDetectorToken: ObjectId<"DocumentDetector">, image: Image) => Promise<DetectionResult>;
42
+ documentDetectorDetect: <ImageType extends Image>(documentDetectorToken: ObjectId<"DocumentDetector">, image: ImageType) => Promise<DetectionResult & {
43
+ originalImage: ImageType;
44
+ }>;
43
45
  parseBarcodeDocument: (options: BarcodeDocumentFormat[], data: string) => Promise<GenericDocument | null>;
44
46
  createBarcodeRecognizer: (options: DeepPartial<BarcodeRecognizerParameters>) => Promise<ObjectId<"BarcodeRecognizer">>;
45
- recognizeBarcodes: (barcodeRecognizerToken: ObjectId<"BarcodeRecognizer">, image: Image) => Promise<BarcodeScannerResult>;
47
+ recognizeBarcodes: <ImageType_1 extends Image>(barcodeRecognizerToken: ObjectId<"BarcodeRecognizer">, image: ImageType_1) => Promise<BarcodeScannerResult & {
48
+ originalImage: ImageType_1;
49
+ }>;
46
50
  beginPdf: (options: DeepPartial<PdfConfig>) => Promise<ObjectId<"PdfGenerationContext">>;
47
51
  addPageToPdf: (pdfOperation: ObjectId<"PdfGenerationContext">, image: Image) => Promise<void>;
48
52
  completePdf: (pdfOperation: ObjectId<"PdfGenerationContext">) => Promise<Uint8Array>;
@@ -50,12 +54,16 @@ export declare const commands: {
50
54
  addPageToTiff: (tiffOperation: ObjectId<"TiffGenerationContext">, image: Image, binarize: Binarize) => Promise<unknown>;
51
55
  completeTiff: (tiffOperation: ObjectId<"TiffGenerationContext">) => Promise<Uint8Array>;
52
56
  createMRZRecognizer: (configuration: DeepPartial<MrzRecognizerConfig>) => Promise<ObjectId<"MrzRecognizerContext">>;
53
- recognizeMRZ: (mrzRecognizerToken: ObjectId<"MrzRecognizerContext">, image: Image) => Promise<MrzRecognitionResult>;
57
+ recognizeMRZ: <ImageType_2 extends Image>(mrzRecognizerToken: ObjectId<"MrzRecognizerContext">, image: ImageType_2) => Promise<MrzRecognitionResult & {
58
+ originalImage: ImageType_2;
59
+ }>;
54
60
  releaseObject: <T>(objectToken: ObjectId<T>) => Promise<void>;
55
61
  createOcrEngine: () => Promise<ObjectId<"TLDROcrContext">>;
56
62
  performOcr: (tldrOcrToken: ObjectId<"TLDROcrContext">, image: Image) => Promise<Page>;
57
63
  createGenericTextLineScanner: (configuration: DeepPartial<GtsConfig>) => Promise<ObjectId<"GenericTextLineScanner">>;
58
- recognizeTextLine: (scannerToken: ObjectId<"GenericTextLineScanner">, image: Image) => Promise<GtsResult>;
64
+ recognizeTextLine: <ImageType_3 extends Image>(scannerToken: ObjectId<"GenericTextLineScanner">, image: ImageType_3) => Promise<GtsResult & {
65
+ originalImage: ImageType_3;
66
+ }>;
59
67
  cleanTextLineRecognitionQueue: (scannerToken: ObjectId<"GenericTextLineScanner">) => Promise<void>;
60
68
  createDocumentQualityAnalyzer: (options: DeepPartial<DqaConfig>) => Promise<ObjectId<"DocumentQualityAnalyzer">>;
61
69
  documentQualityAnalyzerAnalyze: (dqaToken: ObjectId<"DocumentQualityAnalyzer">, image: Image) => Promise<DqaAnalysisResult>;
@@ -63,8 +71,11 @@ export declare const commands: {
63
71
  imageCrop: (image: Image, polygon: [Point, Point, Point, Point]) => Promise<RawImage>;
64
72
  imageResize: (image: Image, destinationSize: number) => Promise<RawImage>;
65
73
  imageRotate: (image: Image, rotations: ImageRotation) => Promise<RawImage>;
66
- genericDocumentRecognizerCreate: (config: DeepPartial<GenericDocumentRecognizerConfig>) => Promise<ObjectId<"GenericDocumentRecognizer">>;
67
- genericDocumentRecognizerRecognize: (gdrToken: ObjectId<"GenericDocumentRecognizer">, image: Image, parameters: DeepPartial<GdrRecognitionParameters>) => Promise<GdrRecognitionResult>;
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>;
68
79
  __hasModuleFunction: (functionName: string) => Promise<any>;
69
80
  __callModuleFunction: (functionName: string, args?: any[]) => Promise<any>;
70
81
  };
@@ -7,7 +7,9 @@ export * as DocumentDetectorTypes from './core/bridge/compiled/DocumentDetectorT
7
7
  export * as DocumentQualityAnalyzerTypes from './core/bridge/compiled/DocumentQualityAnalyzerTypes';
8
8
  export * as EhicTypes from './core/bridge/compiled/EhicTypes';
9
9
  export * as GenericDocument from './core/bridge/compiled/GenericDocument';
10
+ export * as GenericDocumentRecognizerConfigs from './core/bridge/compiled/GenericDocumentRecognizerConfigs';
10
11
  export * as GenericDocumentRecognizerTypes from './core/bridge/compiled/GenericDocumentRecognizerTypes';
12
+ export * as GenericDocumentTypes from './core/bridge/compiled/GenericDocumentTypes';
11
13
  export * as GenericTextLineScannerTypes from './core/bridge/compiled/GenericTextLineScannerTypes';
12
14
  export * as Geometry from './core/bridge/compiled/Geometry';
13
15
  export * as ImageProcessorTypes from './core/bridge/compiled/ImageProcessorTypes';
@@ -20,4 +22,4 @@ export * as PdfConfig from './core/bridge/compiled/PdfConfig';
20
22
  export * as TiffTypes from './core/bridge/compiled/TiffTypes';
21
23
  export * as FrameUtilities from './core/bridge/compiled/FrameUtilities';
22
24
  export type { ObjectId, Image, CroppedDetectionResult } from './core/worker/ScanbotSDK.Core';
23
- export type { PartiallyConstructible, RawImage, DeepPartial, Point, Rectangle } from './core/bridge/common';
25
+ export { PartiallyConstructible, type RawImage, type DeepPartial, type Point, type Rectangle } from './core/bridge/common';
@@ -41,7 +41,9 @@ export default class DocumentScannerView extends ScannerView<DocumentScannerProp
41
41
  componentWillUnmount(): Promise<void>;
42
42
  detect(): Promise<void>;
43
43
  getStatusString(detectionResult: DocumentDetectorTypes.DetectionResult): DocumentDetectorTypes.DetectionStatus;
44
- detectInWebWorker(): Promise<DocumentDetectorTypes.DetectionResult>;
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;
package/@types/index.d.ts CHANGED
@@ -28,26 +28,61 @@ export { PdfGenerator } from "./service/pdf-generator";
28
28
  export { TiffGenerator } from "./service/tiff-generator";
29
29
 
30
30
  export { OcrData, default as OcrEngine, Rect } from "./service/ocr-engine";
31
- export { Point } from "./utils/dto/Point";
32
31
  export { MagneticLine } from "./utils/dto/MagneticLine";
33
32
 
34
33
  export { default as DocumentQualityAnalyzer } from "./service/document-quality-analyzer";
35
34
 
36
- export { default as PublicUtils } from "./service/public-utils";
35
+ export { PublicUtils } from "./service/public-utils";
37
36
  export { Size } from "./utils/dto/Size";
38
37
  export { VideoSize } from "./utils/dto/VideoSize";
39
38
 
40
39
  export { SelectionOverlayConfiguration, IBarcodePolygonHandle, IBarcodePolygonLabelHandle, BarcodePolygonStyle, SelectionOverlayTextFormat, SelectionOverlayStyleConfiguration, BarcodePolygonLabelStyle } from "./model/configuration/selection-overlay-configuration";
41
40
 
42
- export { BinarizationFilter, ColorFilter } from "./model/filter-types";
43
41
  export { Polygon } from "./utils/dto/Polygon";
44
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";
45
+
45
46
  export { InitializationOptions } from "./model/configuration/initialization-options";
46
47
  export { LicenseInfo } from "./model/response/license-info";
47
48
  export { CameraInfo, CameraFacingMode } from "./model/camera-info";
48
49
 
49
50
  export { ConsumeType } from "./consume-type";
50
51
 
52
+ export { BrowserCameras, CameraDetectionStrategy, DiscoverCameraMode } from './utils/browser-cameras';
53
+
51
54
  export { default as ScanbotSDKUI2 } from "./ui2/scanbot-sdk-ui";
52
55
  export * as UIConfig from "./ui2/configuration";
53
- export * as Config from "./core-types";
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,8 +1,18 @@
1
1
  import { Size } from "../../utils/dto/Size";
2
2
  import type { BarcodeScannerTypes } from "../../core-types";
3
3
  export declare class BarcodeScannerResultWithSize {
4
+ coreResult: {
5
+ barcodes: BarcodeScannerTypes.BarcodeItem[];
6
+ originalImage?: ImageData;
7
+ };
4
8
  barcodes: BarcodeScannerTypes.BarcodeItem[];
5
- originalImageSize: Size;
6
- constructor(barcodes: BarcodeScannerTypes.BarcodeItem[], originalImageSize: Size);
9
+ originalImageSize: Size | null;
10
+ /**
11
+ * @internal
12
+ */
13
+ constructor(coreResult: {
14
+ barcodes: BarcodeScannerTypes.BarcodeItem[];
15
+ originalImage?: ImageData;
16
+ });
7
17
  isEmpty(): boolean;
8
18
  }
@@ -1,3 +1,4 @@
1
- import type { BarcodeScannerTypes } from "../../core-types";
1
+ import { BarcodeScannerTypes } from "../../core-types";
2
2
  export declare function barcodesEqual(barcodeItem1: BarcodeScannerTypes.BarcodeItem, barcodeItem2: BarcodeScannerTypes.BarcodeItem): boolean;
3
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
- facingMode?: CameraFacingMode;
6
- supportsTorchControl?: boolean;
5
+ maxNumPixels: number | undefined;
6
+ supportsTorchControl: boolean | undefined;
7
+ facingMode: CameraFacingMode;
7
8
  }
@@ -2,7 +2,6 @@ import { SelectionOverlayConfiguration } from "./selection-overlay-configuration
2
2
  import { BarcodeCountConfiguration } from "./barcode-count-configuration";
3
3
  import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
4
4
  import { BarcodeScannerTypes, type DeepPartial } from "../../core-types";
5
- import type { Size } from "../../utils/dto/Size";
6
5
  import type { BarcodeScannerResultWithSize } from "../barcode/barcode-result";
7
6
  export declare class BarcodeScannerConfiguration extends ViewFinderScannerConfiguration {
8
7
  constructor();
@@ -28,8 +27,12 @@ export declare class BarcodeScannerConfiguration extends ViewFinderScannerConfig
28
27
  /**
29
28
  */
30
29
  onBarcodesDetected?: (e: BarcodeScannerResultWithSize) => void;
31
- /** @internal */
32
- _onDetectionFailed?: (originalImageSize: Size) => 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;
33
36
  /**
34
37
  * If set, limit the resolution of the image that is used for barcode recognition.
35
38
  * A lower value will result in faster processing times but may reduce recognition quality.
@@ -43,6 +43,11 @@ export declare class CroppingViewConfiguration extends BaseConfiguration {
43
43
  * Enhances drag-to-crop experience. True by default
44
44
  */
45
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
+ */
46
51
  polygon?: Polygon;
47
52
  image: Image;
48
53
  /**
@@ -1,5 +1,5 @@
1
1
  import { ScannerConfiguration } from "./scanner-configuration";
2
- import { DocumentDetectorTypes, DeepPartial } from "../../core-types";
2
+ import { DocumentDetectorTypes, DeepPartial, CroppedDetectionResult } from "../../core-types";
3
3
  export declare class TextConfiguration {
4
4
  constructor(hint?: HintTextConfiguration);
5
5
  hint?: HintTextConfiguration;
@@ -92,13 +92,7 @@ export declare class DocumentScannerConfiguration extends ScannerConfiguration {
92
92
  /**
93
93
  * Document detected callback. Continuous callback,
94
94
  * stopped only when detection is stopped or camera widget is disposed.
95
- * Result contains the following properties:
96
- * detectionStatus: "OK",
97
- * success: true,
98
- * cropped: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...",
99
- * original: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...",
100
- * polygon: Array(4)}
101
95
  */
102
- onDocumentDetected?: (e: any) => void;
96
+ onDocumentDetected?: (result: CroppedDetectionResult) => void;
103
97
  static fromJson(json: any): DocumentScannerConfiguration;
104
98
  }
@@ -2,7 +2,7 @@ import type { DeepPartial, GenericDocumentRecognizerTypes } from "../../core-typ
2
2
  import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
3
3
  export declare class GenericDocumentRecognizerConfiguration extends ViewFinderScannerConfiguration {
4
4
  constructor();
5
- detectorParameters?: DeepPartial<GenericDocumentRecognizerTypes.GenericDocumentRecognizerConfig>;
5
+ detectorParameters?: DeepPartial<GenericDocumentRecognizerTypes.GenericDocumentRecognizerParameters>;
6
6
  /** Callback is called for every analyzed frame. */
7
7
  onDocumentDetected?: (result: GenericDocumentRecognizerTypes.RecognitionResult) => void;
8
8
  static fromJson(json: DeepPartial<GenericDocumentRecognizerConfiguration>): GenericDocumentRecognizerConfiguration;
@@ -1,3 +1,4 @@
1
+ import { CameraDetectionStrategy } from "../../utils/browser-cameras";
1
2
  export interface InitializationOptions {
2
3
  /**
3
4
  * Scanbot Web SDK License key. Required
@@ -29,4 +30,11 @@ export interface InitializationOptions {
29
30
  * Defaults to '?CURRENT_SDK_VERSION'.
30
31
  */
31
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;
32
40
  }
@@ -10,7 +10,7 @@ export interface MrzScannerAccumulatedFrameVerificationConfiguration {
10
10
  export declare class MrzScannerConfiguration extends ViewFinderScannerConfiguration {
11
11
  constructor();
12
12
  /** {@displayType `DeepPartial<MRZTypes.RecognizerConfiguration>`} {@link Config.MRZTypes.RecognizerConfiguration}*/
13
- recognizerConfiguration: DeepPartial<MRZTypes.RecognizerConfiguration>;
13
+ recognizerConfiguration?: DeepPartial<MRZTypes.RecognizerConfiguration>;
14
14
  onMrzDetected?: (e: MRZTypes.RecognitionResult) => void;
15
15
  _onDetectionFailed?: (e: ImageData) => void;
16
16
  static fromJson(json: any): MrzScannerConfiguration;
@@ -16,6 +16,10 @@ export declare class ScannerConfiguration extends BaseConfiguration {
16
16
  */
17
17
  videoConstraints?: any;
18
18
  mirrored?: boolean;
19
+ /**
20
+ * Camera id or camera label.
21
+ * A list of available cameras can be obtained from {@link ScanbotSDK.cameras}.
22
+ **/
19
23
  preferredCamera?: string;
20
24
  spinnerColor?: string;
21
25
  backgroundColor?: string;
@@ -27,6 +31,9 @@ export declare class ScannerConfiguration extends BaseConfiguration {
27
31
  static mapVideoConstraints(json: any, configuration: ScannerConfiguration): void;
28
32
  /**
29
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.
30
37
  */
31
38
  onError?: (e: any) => void;
32
39
  }
@@ -1,8 +1,8 @@
1
1
  import type { BarcodeScannerTypes } from "../../core-types";
2
2
  export type SelectionOverlayTextFormat = "Text" | "TextAndFormat" | "None";
3
3
  export declare class BarcodePolygonStyle {
4
- fill?: string;
5
- stroke?: string;
4
+ fillColor?: string;
5
+ strokeColor?: string;
6
6
  strokeWidth?: number;
7
7
  cornerRadius?: number;
8
8
  }
@@ -1,6 +1,6 @@
1
1
  import { ScannerConfiguration } from "./scanner-configuration";
2
2
  import { ViewFinderConfiguration, UserGuidanceConfiguration } from "../../ui2/configuration";
3
- import { DeepPartial } from "../../ui2/configuration/utils";
3
+ import { DeepPartial } from "../../ui2/common";
4
4
  export declare class ViewFinderScannerConfiguration extends ScannerConfiguration {
5
5
  constructor(resolution: {
6
6
  width: number;
@@ -24,4 +24,5 @@ export declare class MediaError extends Error {
24
24
  static tryCheckPermission(): Promise<void>;
25
25
  static hasDeniedPermission(): boolean;
26
26
  static hasCheckedPermission(): boolean;
27
+ static createFromDOMException(err: DOMException | unknown): MediaError;
27
28
  }