scanbot-web-sdk 5.1.0-beta.1 → 5.1.0-dev.2
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 -9
- package/@types/core/compiled/ParametricFilters.d.ts +1 -1
- package/@types/cropping-view.d.ts +1 -1
- package/@types/document-scanner-view.d.ts +2 -3
- package/@types/index.d.ts +5 -3
- package/@types/model/barcode/barcode-format.d.ts +1 -1
- package/@types/model/barcode/barcode.d.ts +2 -2
- package/@types/model/barcode/engine-mode.d.ts +1 -1
- package/@types/model/barcode/gs1-handling.d.ts +46 -0
- package/@types/model/camera-info.d.ts +1 -1
- package/@types/model/configuration/barcode-scanner-configuration.d.ts +8 -5
- package/@types/model/configuration/base-configuration.d.ts +4 -5
- package/@types/model/configuration/document-scanner-configuration.d.ts +9 -1
- package/@types/model/configuration/mrz-scanner-configuration.d.ts +2 -4
- package/@types/model/configuration/scanner-configuration.d.ts +4 -1
- package/@types/model/configuration/selection-overlay-configuration.d.ts +7 -1
- package/@types/model/configuration/text-data-scanner-configuration.d.ts +4 -27
- package/@types/model/configuration/view-finder-scanner-configuration.d.ts +11 -0
- package/@types/model/configuration/vin-scanner-configuration.d.ts +2 -4
- package/@types/model/document/contour-detection-result.d.ts +8 -0
- package/@types/model/filter-types.d.ts +3 -3
- package/@types/model/mrz/mrz-result.d.ts +1 -1
- package/@types/model/response/document-quality-analyzer-result.d.ts +1 -1
- package/@types/mrz-scanner-view.d.ts +5 -5
- package/@types/scanbot-sdk.d.ts +6 -2
- package/@types/scanner-view.d.ts +1 -1
- package/@types/service/image-processor.d.ts +1 -1
- package/@types/service/pdf-generator.d.ts +3 -3
- package/@types/text-data-scanner-view.d.ts +8 -10
- package/@types/ui2/configuration/ActionBarConfiguration.d.ts +42 -0
- package/@types/ui2/configuration/ArTrackingOverlayConfiguration.d.ts +323 -0
- package/@types/ui2/configuration/BarcodeInfoMapping.d.ts +96 -0
- package/@types/ui2/configuration/BarcodeItem.d.ts +30 -0
- package/@types/ui2/configuration/BarcodeItemMapper.d.ts +6 -0
- package/@types/ui2/configuration/BarcodeRecognizerConfiguration.d.ts +159 -0
- package/@types/ui2/configuration/BarcodeResult.d.ts +14 -0
- package/@types/ui2/configuration/BarcodeScannerConfiguration.d.ts +221 -0
- package/@types/ui2/configuration/BarcodeTextLocalization.d.ts +118 -0
- package/@types/ui2/configuration/BarcodeUseCase.d.ts +10 -0
- package/@types/ui2/configuration/CameraConfiguration.d.ts +37 -0
- package/@types/ui2/configuration/CameraPermission.d.ts +54 -0
- package/@types/ui2/configuration/Common.d.ts +376 -0
- package/@types/ui2/configuration/FindAndPickScanningModeUseCase.d.ts +25 -0
- package/@types/ui2/configuration/MultipleScanningModeUseCase.d.ts +610 -0
- package/@types/ui2/configuration/ScanbotAlertDialog.d.ts +49 -0
- package/@types/ui2/configuration/SingleScanningModeUseCase.d.ts +202 -0
- package/@types/ui2/configuration/TopBarConfiguration.d.ts +55 -0
- package/@types/ui2/configuration/UserGuidanceConfiguration.d.ts +30 -0
- package/@types/ui2/configuration/ViewFinderConfiguration.d.ts +90 -0
- package/@types/ui2/configuration/utils.d.ts +6 -0
- package/@types/ui2/configuration.d.ts +20 -0
- package/@types/ui2/controllers/barcode-scanner-controller.d.ts +9 -0
- package/@types/ui2/controllers/multiple-scanning-mode-controller.d.ts +10 -0
- package/@types/ui2/controllers/single-scanning-mode-controller.d.ts +11 -0
- package/@types/ui2/create-sb-theme.d.ts +14 -0
- package/@types/ui2/model/counted-barcodes.d.ts +32 -0
- package/@types/ui2/scanbot-sdk-ui.d.ts +7 -0
- package/@types/ui2/scanbot-ui-library.d.ts +17 -0
- package/@types/ui2/service/haptics-manager.d.ts +6 -0
- package/@types/ui2/service/sound-manager.d.ts +8 -0
- package/@types/ui2/utils/barcode-mapper.d.ts +41 -0
- package/@types/ui2/utils/camera-config.d.ts +3 -0
- package/@types/ui2/utils/dynamic-viewport-height.d.ts +2 -0
- package/@types/ui2/utils/lazy-initialized-singleton.d.ts +6 -0
- package/@types/ui2/utils/styled-badge.d.ts +9 -0
- package/@types/ui2/utils/styled-box.d.ts +8 -0
- package/@types/ui2/utils/styled-button.d.ts +7 -0
- package/@types/ui2/utils/styled-input.d.ts +6 -0
- package/@types/ui2/utils/useScanningViewSize.d.ts +8 -0
- package/@types/ui2/views/action-button/action-button-container.d.ts +21 -0
- package/@types/ui2/views/action-button/action-button.d.ts +13 -0
- package/@types/ui2/views/ar/ar-overlay-barcode-info.d.ts +19 -0
- package/@types/ui2/views/barcode-info/barcode-info.d.ts +24 -0
- package/@types/ui2/views/barcode-scanner.d.ts +24 -0
- package/@types/ui2/views/camera-permission-denied.d.ts +8 -0
- package/@types/ui2/views/dialog/barcode-info-dialog.d.ts +28 -0
- package/@types/ui2/views/dialog/barcode-mapping-error-dialog.d.ts +12 -0
- package/@types/ui2/views/dialog/count-edit-dialog.d.ts +11 -0
- package/@types/ui2/views/dialog/styled-dialog.d.ts +7 -0
- package/@types/ui2/views/drawer/barcode-result-drawer.d.ts +18 -0
- package/@types/ui2/views/drawer/counting-button.d.ts +11 -0
- package/@types/ui2/views/drawer/hooks/use-drag-listener.d.ts +26 -0
- package/@types/ui2/views/drawer/subviews/barcode-drawer-empty-state.d.ts +8 -0
- package/@types/ui2/views/drawer/subviews/barcode-drawer-header.d.ts +9 -0
- package/@types/ui2/views/drawer/subviews/barcode-list-item.d.ts +12 -0
- package/@types/ui2/views/drawer/subviews/barcode-list.d.ts +12 -0
- package/@types/ui2/views/drawer/subviews/drawer-header-content.d.ts +10 -0
- package/@types/ui2/views/drawer/subviews/swipe-underlay.d.ts +7 -0
- package/@types/ui2/views/form/dialog-button.d.ts +12 -0
- package/@types/ui2/views/navigation-bar.d.ts +15 -0
- package/@types/ui2/views/styled-text.d.ts +15 -0
- package/@types/utils/colors.d.ts +5 -0
- package/@types/utils/constants.d.ts +1 -0
- package/@types/utils/dto/Frame.d.ts +1 -0
- package/@types/utils/dto/Point.d.ts +1 -0
- package/@types/utils/dto/Polygon.d.ts +1 -1
- package/@types/utils/image-utils.d.ts +1 -0
- package/@types/utils/react/usePromise.d.ts +14 -0
- package/@types/utils/video-stream.d.ts +7 -0
- package/@types/view/barcode-calculation/barcode-calculation-popup.d.ts +1 -1
- package/@types/view/barcode-calculation/styled-spinner.d.ts +2 -2
- package/@types/view/barcode-polygon/animated-barcode-selection-overlay.d.ts +9 -3
- package/@types/view/barcode-polygon/barcode-polygon-label.d.ts +5 -1
- package/@types/view/cropping/cropping-image.d.ts +1 -1
- package/@types/view/cropping/draggable-handles-component.d.ts +1 -1
- package/@types/view/cropping/draggable-lines-container.d.ts +2 -2
- package/@types/view/cropping/draggable-points-container.d.ts +2 -2
- package/@types/view/cropping/magnetic-lines-component.d.ts +2 -2
- package/@types/view/cropping/magnifier-view.d.ts +4 -4
- package/@types/view/document-outline.d.ts +1 -1
- package/@types/view/polygon/animated-document-polygon.d.ts +1 -1
- package/@types/view/polygon/document-line-quad.d.ts +2 -2
- package/@types/view/polygon/draggable-document-polygon.d.ts +1 -1
- package/@types/view/scanbot-camera-view.d.ts +10 -4
- package/@types/view/shutter-button.d.ts +8 -8
- package/@types/view/utils/animatable.d.ts +2 -1
- package/@types/view/utils/icons/empty-state-box.d.ts +4 -0
- package/@types/view/utils/scroll-lock.d.ts +1 -1
- package/@types/view/view-finder.d.ts +50 -29
- package/bundle/ScanbotSDK.min.js +6 -6
- package/bundle/ScanbotSDK.ui2.min.js +240 -0
- package/bundle/ScanbotSDK.ui2.min.js.LICENSE.txt +31 -0
- 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.Asm.wasm-webpack-file-loader +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-threads.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm-webpack-file-loader +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.Asm.wasm-webpack-file-loader +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 +2 -1
- package/ui.d.ts +3 -0
- package/ui.js +2 -0
- package/webpack/fileLoader.js +10 -0
- package/webpack/index.js +1 -12
- package/webpack/ui.d.ts +0 -0
- package/webpack/ui.js +3 -0
- package/@types/model/configuration/text-style-configuration.d.ts +0 -5
- package/@types/model/configuration/view-finder-configuration.d.ts +0 -9
- package/@types/model/configuration/window-style-configuration.d.ts +0 -10
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { ScanbotCameraProps, ScanbotCameraState, ScannerView } from "./scanner-view";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ViewFinder } from "./view/view-finder";
|
|
6
|
-
import { Size } from "./utils/dto/Size";
|
|
3
|
+
import { IBarcodeScannerHandle } from "./interfaces/i-barcode-scanner-handle";
|
|
4
|
+
import ViewFinder, { ViewFinderPadding } from "./view/view-finder";
|
|
7
5
|
import { ShutterButtonAction } from "./view/shutter-button";
|
|
8
6
|
import BarcodeCalculationPopup from "./view/barcode-calculation/barcode-calculation-popup";
|
|
9
7
|
import AnimatedBarcodeSelectionOverlay from "./view/barcode-polygon/animated-barcode-selection-overlay";
|
|
10
8
|
import BottomActionBar from "./view/action-bar/bottom-action-bar";
|
|
11
9
|
import ScannedImageWithOverlay from "./view/barcode-calculation/scanned-image-with-overlay";
|
|
10
|
+
import { BarcodeScannerConfiguration } from "./model/configuration/barcode-scanner-configuration";
|
|
11
|
+
import { BarcodeResult } from "./model/barcode/barcode-result";
|
|
12
12
|
import { ImageDataWrapper } from "./model/image-data-wrapper";
|
|
13
13
|
import { Barcode } from "./model/barcode/barcode";
|
|
14
|
-
import {
|
|
14
|
+
import { Size } from "./utils/dto/Size";
|
|
15
15
|
export declare class BarcodeScannerProps extends ScanbotCameraProps {
|
|
16
|
-
|
|
16
|
+
viewFinderPadding?: ViewFinderPadding;
|
|
17
17
|
}
|
|
18
18
|
export declare class BarcodeScannerState extends ScanbotCameraState {
|
|
19
19
|
isFinderVisible?: boolean;
|
|
@@ -27,7 +27,6 @@ export default class BarcodeScannerView extends ScannerView<BarcodeScannerProps,
|
|
|
27
27
|
shouldComputeSize: boolean;
|
|
28
28
|
private _configuration;
|
|
29
29
|
private paused;
|
|
30
|
-
finderRect: DOMRect | undefined;
|
|
31
30
|
recognition: {
|
|
32
31
|
imageData: ImageDataWrapper;
|
|
33
32
|
originalImage: any;
|
|
@@ -38,6 +37,7 @@ export default class BarcodeScannerView extends ScannerView<BarcodeScannerProps,
|
|
|
38
37
|
scannedImage: ScannedImageWithOverlay | undefined;
|
|
39
38
|
bottomActionBar: BottomActionBar | undefined;
|
|
40
39
|
readonly barcodes: Barcode[];
|
|
40
|
+
private detectionRunning;
|
|
41
41
|
constructor(props: BarcodeScannerProps);
|
|
42
42
|
get configuration(): BarcodeScannerConfiguration;
|
|
43
43
|
get enabled(): boolean;
|
|
@@ -67,9 +67,10 @@ export default class BarcodeScannerView extends ScannerView<BarcodeScannerProps,
|
|
|
67
67
|
saveExtractedImageData(): void;
|
|
68
68
|
setFinderVisible(isVisible: boolean): void;
|
|
69
69
|
setZoom(zoom: number): void;
|
|
70
|
+
setCameraDirection(direction: "environment" | "user"): void;
|
|
70
71
|
updateTorch(enabled: boolean): void;
|
|
71
72
|
getCapabilities(): MediaTrackCapabilities | undefined;
|
|
72
|
-
render(): JSX.Element;
|
|
73
|
+
render(): React.JSX.Element;
|
|
73
74
|
resetCountImage(): void;
|
|
74
75
|
countLabelText(barcodes: Barcode[]): string;
|
|
75
76
|
}
|
|
@@ -101,7 +101,7 @@ export class ContrastFilter {
|
|
|
101
101
|
/** @internal */
|
|
102
102
|
toWireType(): any;
|
|
103
103
|
}
|
|
104
|
-
/** Converts color images to grayscale
|
|
104
|
+
/** Converts color images to grayscale and applies autocontrast.*/
|
|
105
105
|
export class GrayscaleFilter {
|
|
106
106
|
|
|
107
107
|
/** Enable or disable autocontrast.
|
|
@@ -57,7 +57,7 @@ export default class CroppingView extends React.Component<CroppingViewProps, Cro
|
|
|
57
57
|
onResize(): void;
|
|
58
58
|
initializeSizes(relativeCoordPolygon?: Polygon, horizontalLines?: MagneticLine[], verticalLines?: MagneticLine[]): void;
|
|
59
59
|
magnifier?: MagnifierView;
|
|
60
|
-
render(): JSX.Element;
|
|
60
|
+
render(): React.JSX.Element;
|
|
61
61
|
showMagnifier(data: any): void;
|
|
62
62
|
updateMagnifier(data: any): void;
|
|
63
63
|
magnifierOptions(data: any): MagnifierOptions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { DocumentScannerConfiguration } from "./model/configuration/document-scanner-configuration";
|
|
3
3
|
import { DocumentDetectionResult } from "./model/document/document-detection-result";
|
|
4
4
|
import { ScanbotCameraProps, ScanbotCameraState, ScannerView } from "./scanner-view";
|
|
@@ -11,7 +11,6 @@ export declare class DocumentScannerState extends ScanbotCameraState {
|
|
|
11
11
|
action: ShutterButtonAction;
|
|
12
12
|
}
|
|
13
13
|
export declare class DocumentScannerProps extends ScanbotCameraProps {
|
|
14
|
-
configuration: DocumentScannerConfiguration;
|
|
15
14
|
}
|
|
16
15
|
export default class DocumentScannerView extends ScannerView<DocumentScannerProps, DocumentScannerState> implements IDocumentScannerHandle {
|
|
17
16
|
static DETECT_AND_CROP_RESOLUTION: number;
|
|
@@ -46,7 +45,7 @@ export default class DocumentScannerView extends ScannerView<DocumentScannerProp
|
|
|
46
45
|
preventAutoCapture?: boolean;
|
|
47
46
|
handleAutoCapture(statusOk: boolean, polygon?: Polygon): Promise<void>;
|
|
48
47
|
updateButton(action: ShutterButtonAction): void;
|
|
49
|
-
render(): JSX.Element;
|
|
48
|
+
render(): React.JSX.Element;
|
|
50
49
|
defaultCaptureButtonClick: () => Promise<void>;
|
|
51
50
|
private scalePolygonPointsToPixels;
|
|
52
51
|
private runMovementPredicate;
|
package/@types/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export { DocumentDetectionResult } from "./model/document/document-detection-res
|
|
|
4
4
|
export { ContourDetectionResult } from "./model/document/contour-detection-result";
|
|
5
5
|
export * as DetectionStatus from "./model/document/detection-status";
|
|
6
6
|
|
|
7
|
+
export { ViewFinderScannerConfiguration } from "./model/configuration/view-finder-scanner-configuration";
|
|
8
|
+
|
|
7
9
|
export { ICroppingViewHandle } from "./interfaces/i-cropping-view-handle";
|
|
8
10
|
export { CroppingViewConfiguration, CroppingViewStyle, CroppingViewMagneticLineStyle, CroppingViewMagnifierStyle, CroppingViewPolygonStyle, CroppingViewMagnifierBorderStyle, CroppingViewMagnifierCrosshairStyle, CroppingViewPolygonHandleStyle } from "./model/configuration/cropping-view-configuration";
|
|
9
11
|
export { CroppingResult } from "./model/response/cropping-result";
|
|
@@ -42,9 +44,6 @@ export { Size } from "./utils/dto/Size";
|
|
|
42
44
|
export { VideoSize } from "./utils/dto/VideoSize";
|
|
43
45
|
|
|
44
46
|
export { SelectionOverlayConfiguration, IBarcodePolygonHandle, IBarcodePolygonLabelHandle, BarcodePolygonStyle, SelectionOverlayTextFormat, SelectionOverlayStyleConfiguration, BarcodePolygonLabelStyle } from "./model/configuration/selection-overlay-configuration";
|
|
45
|
-
export { ViewFinderConfiguration } from "./model/configuration/view-finder-configuration";
|
|
46
|
-
export { TextStyleConfiguration } from "./model/configuration/text-style-configuration";
|
|
47
|
-
export { WindowStyleConfiguration } from "./model/configuration/window-style-configuration";
|
|
48
47
|
|
|
49
48
|
export { default as PdfGenerator, PdfGenerationOptions, PageDirection, PageSize, PageFit } from "./service/pdf-generator";
|
|
50
49
|
export { default as TiffGenerator, TiffGenerationOptions } from "./service/tiff-generator";
|
|
@@ -56,3 +55,6 @@ export { Barcode } from "./model/barcode/barcode";
|
|
|
56
55
|
export { InitializationOptions } from "./model/configuration/initialization-options";
|
|
57
56
|
export { LicenseInfo } from "./model/response/license-info";
|
|
58
57
|
export { CameraInfo, CameraFacingMode } from "./model/camera-info";
|
|
58
|
+
|
|
59
|
+
export { default as ScanbotSDKUI2 } from "./ui2/scanbot-sdk-ui";
|
|
60
|
+
export * as UIConfig from "./ui2/configuration";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type BarcodeFormat = "ONE_D" | "AZTEC" | "CODABAR" | "CODE_39" | "CODE_93" | "CODE_128" | "DATA_MATRIX" | "EAN_8" | "EAN_13" | "ITF" | "MAXICODE" | "PDF_417" | "QR_CODE" | "UPC_A" | "UPC_E" | "UPC_EAN_EXTENSION" | "MSI_PLESSEY" | "IATA_2_OF_5" | "INDUSTRIAL_2_OF_5" | "CODE_25" | "MICRO_QR_CODE" | "USPS_INTELLIGENT_MAIL" | "ROYAL_MAIL" | "JAPAN_POST" | "ROYAL_TNT_POST" | "AUSTRALIA_POST" | "DATABAR" | "DATABAR_EXPANDED" | "DATABAR_LIMITED" | "MICRO_PDF_417" | "GS1_COMPOSITE";
|
|
@@ -3,11 +3,11 @@ import { BarcodeFormat } from "./barcode-format";
|
|
|
3
3
|
export declare class Barcode {
|
|
4
4
|
format: BarcodeFormat;
|
|
5
5
|
text: string;
|
|
6
|
-
|
|
6
|
+
parsedDocument: any;
|
|
7
7
|
rawBytes: Uint8Array;
|
|
8
8
|
points: Point[];
|
|
9
9
|
barcodeImage: Uint8Array;
|
|
10
|
-
constructor(format: BarcodeFormat, text: string,
|
|
10
|
+
constructor(format: BarcodeFormat, text: string, parsedDocument: string, bytes: Uint8Array, points: Point[], barcodeImage: Uint8Array);
|
|
11
11
|
id(): string;
|
|
12
12
|
equals(barcode: Barcode): unknown;
|
|
13
13
|
static fromWorker(input: any): Barcode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type EngineMode = "NEXT_GEN" | "LEGACY";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GS1 message handling options. The GS1 standard defines a
|
|
3
|
+
* a key-value format for business-centric data
|
|
4
|
+
* that can be encoded into many 1D and 2D barcode types.
|
|
5
|
+
* https://ref.gs1.org/standards/genspecs/
|
|
6
|
+
*
|
|
7
|
+
* GS1 messages have two representations or formats: a human-readable format and a
|
|
8
|
+
* machine-readable format. The human-readable format uses parentheses to wrap the keys in each
|
|
9
|
+
* pair. For example, the string "(01)012345678901(37)02(3922)00278" contains three AI keys:
|
|
10
|
+
* 01, 37, and 3922. The corresponding values are 012345678901, 02, and 00278.
|
|
11
|
+
*
|
|
12
|
+
* The machine-readable format uses the special ASCII \x1D character to terminate key-value
|
|
13
|
+
* pairs in the string in cases where the given key implies that the value is variable-length.
|
|
14
|
+
* The equivalent machine-readable string for the above example is
|
|
15
|
+
* "010123456789013702\x1D392200278".
|
|
16
|
+
* In the above example, the 01 AI key is fixed-length, so the \x1D character is not necessary.
|
|
17
|
+
* The 37 AI keys is variable-length, so the \x1D character is necessary after the value in the
|
|
18
|
+
* pair. The 3922 AI key is also variable-length, but it is the last pair in the message, so
|
|
19
|
+
* the \x1D character is not necessary at the end.
|
|
20
|
+
*
|
|
21
|
+
* The character \x1D is UNPRINTABLE - this means that if you try to print or otherwise
|
|
22
|
+
* visualize a GS1 message containing the \x1D character, you may see a number of different
|
|
23
|
+
* results, depending on how the system handles unprintable characters. You may see a question
|
|
24
|
+
* mark, a box, an escape sequence, a space or nothing at all.
|
|
25
|
+
*
|
|
26
|
+
* `NONE`:
|
|
27
|
+
* The (FNC1) character is simply stripped from the result in barcodes that implement this
|
|
28
|
+
* mode.
|
|
29
|
+
* Do not use. Will be removed in a future release.
|
|
30
|
+
*
|
|
31
|
+
* `PARSE`:
|
|
32
|
+
* This is the default. GS1 messages are converted to the machine-readable format per
|
|
33
|
+
* the GS1 spec (the special FNC1 character is converted to ASCII \x1D).
|
|
34
|
+
* The implied 01 AI key is prepended to DataBar results.
|
|
35
|
+
* No validation is performed.
|
|
36
|
+
*
|
|
37
|
+
* `VALIDATE`:
|
|
38
|
+
* Same as PARSE. Additionally, messages containing unknown AI keys are not returned.
|
|
39
|
+
*
|
|
40
|
+
* `DECODE`:
|
|
41
|
+
* Same as VALIDATE, except that GS1 strings are converted to the human-readable format,
|
|
42
|
+
* instead
|
|
43
|
+
* (with parentheses used to wrap AI keys, e.g. "(01)123456789"). The \x1D character is
|
|
44
|
+
* never used in this representation.
|
|
45
|
+
*/
|
|
46
|
+
export type GS1Handling = "NONE" | "PARSE" | "VALIDATE" | "DECODE";
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { ScannerConfiguration } from "./scanner-configuration";
|
|
2
1
|
import { BarcodeResult } from "../barcode/barcode-result";
|
|
3
2
|
import { EngineMode } from "../barcode/engine-mode";
|
|
4
3
|
import { BarcodeFormat } from "../barcode/barcode-format";
|
|
5
|
-
import { ViewFinderConfiguration } from "./view-finder-configuration";
|
|
6
4
|
import { SelectionOverlayConfiguration } from "./selection-overlay-configuration";
|
|
7
5
|
import { BarcodeCountConfiguration } from "./barcode-count-configuration";
|
|
8
|
-
|
|
6
|
+
import { GS1Handling } from "../barcode/gs1-handling";
|
|
7
|
+
import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
|
|
8
|
+
export declare class BarcodeScannerConfiguration extends ViewFinderScannerConfiguration {
|
|
9
9
|
constructor();
|
|
10
10
|
/**
|
|
11
11
|
* Capture delay in milliseconds after detecting barcodes. Defaults to 1000
|
|
12
12
|
*/
|
|
13
13
|
captureDelay?: number;
|
|
14
|
-
style?: ViewFinderConfiguration;
|
|
15
14
|
overlay?: SelectionOverlayConfiguration;
|
|
16
15
|
engineMode?: EngineMode;
|
|
17
16
|
barcodeFormats?: BarcodeFormat[];
|
|
18
17
|
returnBarcodeImage?: boolean;
|
|
19
|
-
showFinder?: boolean;
|
|
20
18
|
/**
|
|
21
19
|
* Special property to enable barcode count mode.
|
|
22
20
|
* This is a type of a ready-to-use user interface scanning and counting found barcodes.
|
|
@@ -30,6 +28,11 @@ export declare class BarcodeScannerConfiguration extends ScannerConfiguration {
|
|
|
30
28
|
* Please note that this is not the same as the optical zoom of the camera.
|
|
31
29
|
*/
|
|
32
30
|
zoom?: number;
|
|
31
|
+
/**
|
|
32
|
+
* If set, only barcodes that match this regular expression will be detected.
|
|
33
|
+
*/
|
|
34
|
+
barcodesRegexFilter?: RegExp;
|
|
35
|
+
gs1Handling?: GS1Handling;
|
|
33
36
|
/**
|
|
34
37
|
*/
|
|
35
38
|
onBarcodesDetected?: (e: BarcodeResult) => void;
|
|
@@ -17,10 +17,9 @@ export declare class BaseConfiguration {
|
|
|
17
17
|
static mapValuesDeep(source: any, destination: {
|
|
18
18
|
[key: string]: any;
|
|
19
19
|
}): void;
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
20
|
+
/**
|
|
21
|
+
* Populate a base configuration object
|
|
22
|
+
* and merge any of its values with the values provided in the partialConfigurationObject.
|
|
22
23
|
*/
|
|
23
|
-
protected static _fromJson<
|
|
24
|
-
new (): T;
|
|
25
|
-
}, partialConfigurationObject: any): T;
|
|
24
|
+
protected static _fromJson<BaseConfiguration>(result: BaseConfiguration, partialConfigurationObject: any): BaseConfiguration;
|
|
26
25
|
}
|
|
@@ -17,7 +17,6 @@ export declare class StyleConfiguration {
|
|
|
17
17
|
constructor();
|
|
18
18
|
outline?: OutlineStyleConfiguration;
|
|
19
19
|
captureButton?: CaptureButtonStyleConfiguration;
|
|
20
|
-
spinnerColor?: string;
|
|
21
20
|
}
|
|
22
21
|
export declare class OutlineStyleConfiguration {
|
|
23
22
|
constructor();
|
|
@@ -54,6 +53,15 @@ export declare class CaptureButtonStyleConfiguration {
|
|
|
54
53
|
}
|
|
55
54
|
export declare class DocumentScannerConfiguration extends ScannerConfiguration {
|
|
56
55
|
constructor();
|
|
56
|
+
/**
|
|
57
|
+
* An average brightness is computed as follows: It is the average
|
|
58
|
+
* of the Value channel in the HSV color space of:
|
|
59
|
+
* - the whole image, if no document was detected
|
|
60
|
+
* - the document crop, if a document was detected
|
|
61
|
+
* It ranges from 0 to 255.
|
|
62
|
+
* If this computed value is below the acceptanceBrightnessThreshold, the document is accepted.
|
|
63
|
+
*/
|
|
64
|
+
acceptedBrightnessThreshold?: number;
|
|
57
65
|
/**
|
|
58
66
|
* The minimum score in percent (0 - 100) of the perspective
|
|
59
67
|
* distortion to accept a detected document. Default is 75.0.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { MrzResult } from "../mrz/mrz-result";
|
|
2
|
-
import {
|
|
3
|
-
import { ViewFinderConfiguration } from "./view-finder-configuration";
|
|
2
|
+
import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
|
|
4
3
|
export interface MrzScannerAccumulatedFrameVerificationConfiguration {
|
|
5
4
|
/** Maximum number of accumulated frames to inspect to verify a scan result */
|
|
6
5
|
maximumNumberOfAccumulatedFrames?: number;
|
|
@@ -8,9 +7,8 @@ export interface MrzScannerAccumulatedFrameVerificationConfiguration {
|
|
|
8
7
|
* in order for the result to be considered verified */
|
|
9
8
|
minimumNumberOfRequiredFramesWithEqualRecognitionResult?: number;
|
|
10
9
|
}
|
|
11
|
-
export declare class MrzScannerConfiguration extends
|
|
10
|
+
export declare class MrzScannerConfiguration extends ViewFinderScannerConfiguration {
|
|
12
11
|
constructor();
|
|
13
|
-
style?: ViewFinderConfiguration;
|
|
14
12
|
accumulatedFrameVerificationConfiguration?: MrzScannerAccumulatedFrameVerificationConfiguration;
|
|
15
13
|
onMrzDetected?: (e: MrzResult) => void;
|
|
16
14
|
_onDetectionFailed?: (e: ImageData) => void;
|
|
@@ -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
|
/**
|
|
@@ -16,6 +17,8 @@ export declare class ScannerConfiguration extends BaseConfiguration {
|
|
|
16
17
|
videoConstraints?: any;
|
|
17
18
|
mirrored?: boolean;
|
|
18
19
|
preferredCamera?: string;
|
|
20
|
+
spinnerColor?: string;
|
|
21
|
+
backgroundColor?: string;
|
|
19
22
|
constructor(resolution: {
|
|
20
23
|
width: number;
|
|
21
24
|
height: number;
|
|
@@ -25,5 +28,5 @@ export declare class ScannerConfiguration extends BaseConfiguration {
|
|
|
25
28
|
/**
|
|
26
29
|
* Error callback of the SDK.
|
|
27
30
|
*/
|
|
28
|
-
onError
|
|
31
|
+
onError?: (e: any) => void;
|
|
29
32
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Barcode } from "../barcode/barcode";
|
|
2
|
-
export
|
|
2
|
+
export type SelectionOverlayTextFormat = "Text" | "TextAndFormat" | "None";
|
|
3
3
|
export declare class BarcodePolygonStyle {
|
|
4
4
|
fill?: string;
|
|
5
5
|
stroke?: string;
|
|
6
|
+
strokeWidth?: number;
|
|
7
|
+
cornerRadius?: number;
|
|
6
8
|
}
|
|
7
9
|
export interface IBarcodePolygonHandle {
|
|
8
10
|
style(style: BarcodePolygonStyle): void;
|
|
@@ -19,8 +21,12 @@ export declare class SelectionOverlayStyleConfiguration {
|
|
|
19
21
|
private defaultHighlightedFillColor?;
|
|
20
22
|
polygonStrokeColor?: string;
|
|
21
23
|
polygonFillColor?: string;
|
|
24
|
+
polygonStrokeWidth?: number;
|
|
25
|
+
polygonCornerRadius?: number;
|
|
22
26
|
highlightedPolygonStrokeColor?: string;
|
|
23
27
|
highlightedPolygonFillColor?: string;
|
|
28
|
+
highlightedPolygonStrokeWidth?: number;
|
|
29
|
+
highlightedPolygonCornerRadius?: number;
|
|
24
30
|
textColor?: string;
|
|
25
31
|
textBackgroundColor?: string;
|
|
26
32
|
highlightedTextColor?: string;
|
|
@@ -1,35 +1,12 @@
|
|
|
1
1
|
import { TextDataScannerResult } from "../generic-text-line-recognizer/text-data-scanner-result";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare class TextDataScannerWindowStyle implements WindowStyleConfiguration {
|
|
7
|
-
aspectRatio: number;
|
|
8
|
-
widthProportion: number;
|
|
9
|
-
borderColor: string;
|
|
10
|
-
left: string;
|
|
11
|
-
top: string;
|
|
12
|
-
transform: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class TextDataScannerTextStyle implements TextStyleConfiguration {
|
|
15
|
-
color: string;
|
|
16
|
-
size: string;
|
|
17
|
-
weight: number;
|
|
18
|
-
}
|
|
19
|
-
export declare class TextDataScannerViewFinderStyle implements ViewFinderConfiguration {
|
|
20
|
-
window: TextDataScannerWindowStyle;
|
|
21
|
-
text: TextDataScannerTextStyle;
|
|
22
|
-
backgroundColor: string;
|
|
23
|
-
hint: string;
|
|
24
|
-
}
|
|
25
|
-
export declare type ValidatorPreset = "VehicleIdentificationNumber";
|
|
26
|
-
export declare type TextDetectionCallback = (e: TextDataScannerResult) => void;
|
|
27
|
-
export declare class TextDataScannerConfiguration extends ScannerConfiguration {
|
|
2
|
+
import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
|
|
3
|
+
export type ValidatorPreset = "VehicleIdentificationNumber";
|
|
4
|
+
export type TextDetectionCallback = (e: TextDataScannerResult) => void;
|
|
5
|
+
export declare class TextDataScannerConfiguration extends ViewFinderScannerConfiguration {
|
|
28
6
|
constructor();
|
|
29
7
|
ocrResolutionLimit?: number;
|
|
30
8
|
supportedLanguages?: string[];
|
|
31
9
|
validatorPreset?: ValidatorPreset;
|
|
32
|
-
style?: ViewFinderConfiguration;
|
|
33
10
|
onTextDetected?: TextDetectionCallback;
|
|
34
11
|
static fromJson(json: any): TextDataScannerConfiguration;
|
|
35
12
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ScannerConfiguration } from "./scanner-configuration";
|
|
2
|
+
import { ViewFinderConfiguration, UserGuidanceConfiguration } from "../../ui2/configuration";
|
|
3
|
+
export declare class ViewFinderScannerConfiguration extends ScannerConfiguration {
|
|
4
|
+
constructor(resolution: {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
});
|
|
8
|
+
finder?: ViewFinderConfiguration;
|
|
9
|
+
userGuidance?: UserGuidanceConfiguration;
|
|
10
|
+
static mapFinderConfiguration(result: ViewFinderScannerConfiguration, json: any): void;
|
|
11
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { ScannerConfiguration } from "./scanner-configuration";
|
|
2
|
-
import { ViewFinderConfiguration } from "./view-finder-configuration";
|
|
3
1
|
import { TextDetectionCallback } from "./text-data-scanner-configuration";
|
|
4
|
-
|
|
2
|
+
import { ViewFinderScannerConfiguration } from "./view-finder-scanner-configuration";
|
|
3
|
+
export declare class VINScannerConfiguration extends ViewFinderScannerConfiguration {
|
|
5
4
|
constructor();
|
|
6
5
|
ocrResolutionLimit?: number;
|
|
7
|
-
style?: ViewFinderConfiguration;
|
|
8
6
|
onTextDetected?: TextDetectionCallback;
|
|
9
7
|
static fromJson(json: any): VINScannerConfiguration;
|
|
10
8
|
}
|
|
@@ -7,5 +7,13 @@ export declare class ContourDetectionResult {
|
|
|
7
7
|
polygon?: Polygon;
|
|
8
8
|
detectionStatus?: DetectionStatus;
|
|
9
9
|
success?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Average brightness, calculated as the average
|
|
12
|
+
* of the Value channel in the HSV color space of:
|
|
13
|
+
* - the whole image, if no document was detected
|
|
14
|
+
* - the document crop, if a document was detected
|
|
15
|
+
* Ranges from 0 to 255
|
|
16
|
+
*/
|
|
17
|
+
averageBrightness?: number;
|
|
10
18
|
constructor(contourDetectionResult?: ContourDetectionResult);
|
|
11
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type BinarizationFilter = 'binarized' | 'otsuBinarization' | 'pureBinarized' | 'lowLightBinarization' | 'lowLightBinarization2' | 'deepBinarization';
|
|
2
|
+
export type ColorFilter = 'color' | 'gray' | 'colorDocument' | 'blackAndWhite' | 'edgeHighlight';
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated Use the new ImageProcessor API instead (see {@link ScanbotSDK.createImageProcessor}).
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type ImageFilter = BinarizationFilter | ColorFilter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type DocumentQuality = "NO_DOCUMENT" | "VERY_POOR" | "POOR" | "REASONABLE" | "GOOD" | "EXCELLENT";
|
|
2
2
|
export default interface DocumentQualityAnalyzerResult {
|
|
3
3
|
/**
|
|
4
4
|
* Result of document quality analysis.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { ScanbotCameraProps, ScanbotCameraState, ScannerView } from "./scanner-view";
|
|
3
|
-
import { MrzScannerConfiguration } from "./model/configuration/mrz-scanner-configuration";
|
|
4
|
-
import { ViewFinder } from "./view/view-finder";
|
|
5
|
-
import SimpleMrzRecognizer from "./service/simple-mrz-recognizer";
|
|
6
3
|
import { IMrzScannerHandle } from "./interfaces/i-mrz-scanner-handle";
|
|
4
|
+
import ViewFinder from "./view/view-finder";
|
|
5
|
+
import SimpleMrzRecognizer from "./service/simple-mrz-recognizer";
|
|
6
|
+
import { MrzScannerConfiguration } from "./model/configuration/mrz-scanner-configuration";
|
|
7
7
|
export declare class MrzScannerProps extends ScanbotCameraProps {
|
|
8
8
|
mrzRecognizer: SimpleMrzRecognizer;
|
|
9
9
|
}
|
|
@@ -38,5 +38,5 @@ export default class MrzScannerView extends ScannerView<MrzScannerProps, MrzScan
|
|
|
38
38
|
detect(): Promise<void>;
|
|
39
39
|
saveExtractedImageData(): void;
|
|
40
40
|
setFinderVisible(isVisible: boolean): void;
|
|
41
|
-
render(): JSX.Element;
|
|
41
|
+
render(): React.JSX.Element;
|
|
42
42
|
}
|
package/@types/scanbot-sdk.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ import DocumentQualityAnalyzerConfiguration from "./model/configuration/document
|
|
|
27
27
|
import DocumentQualityAnalyzer from "./service/document-quality-analyzer";
|
|
28
28
|
import { ImageProcessor } from "./service/image-processor";
|
|
29
29
|
import * as imageFilters from "./core/compiled/ParametricFilters";
|
|
30
|
+
import ScanbotSDKUI from "./ui2/scanbot-sdk-ui";
|
|
31
|
+
import { GS1Handling } from "./model/barcode/gs1-handling";
|
|
30
32
|
export default class ScanbotSDK {
|
|
31
33
|
/** @internal */
|
|
32
34
|
bridge: WorkerBridge;
|
|
@@ -34,6 +36,8 @@ export default class ScanbotSDK {
|
|
|
34
36
|
private static defaultEnginePath;
|
|
35
37
|
/** @internal */
|
|
36
38
|
static instance: ScanbotSDK;
|
|
39
|
+
private static _ui2;
|
|
40
|
+
static get UI(): typeof ScanbotSDKUI;
|
|
37
41
|
static initialize(options: InitializationOptions): Promise<ScanbotSDK>;
|
|
38
42
|
/**
|
|
39
43
|
* View Components
|
|
@@ -54,9 +58,9 @@ export default class ScanbotSDK {
|
|
|
54
58
|
applyFilter(imageBuffer: ArrayBuffer, filterType: ImageFilter): Promise<ArrayBuffer>;
|
|
55
59
|
rotateImageCcw(imageBuffer: ArrayBuffer, rotations: number): Promise<ArrayBuffer>;
|
|
56
60
|
cropAndRotateImageCcw(imageBuffer: ArrayBuffer, polygon: Polygon, rotations: number): Promise<any>;
|
|
57
|
-
detectDocument(imageBuffer: ArrayBuffer, acceptedAngleScore?: number, acceptedSizeScore?: number): Promise<ContourDetectionResult>;
|
|
61
|
+
detectDocument(imageBuffer: ArrayBuffer, acceptedAngleScore?: number, acceptedSizeScore?: number, acceptedBrightnessThreshold?: number): Promise<ContourDetectionResult>;
|
|
58
62
|
detectAndCropDocument(imageBuffer: ArrayBuffer): Promise<ContourDetectionResult>;
|
|
59
|
-
detectBarcodes(base64: string, engineMode?: EngineMode, barcodeFormats?: BarcodeFormat[], returnBarcodeImage?: boolean): Promise<BarcodeResult>;
|
|
63
|
+
detectBarcodes(base64: string, engineMode?: EngineMode, barcodeFormats?: BarcodeFormat[], returnBarcodeImage?: boolean, gs1Handling?: GS1Handling): Promise<BarcodeResult>;
|
|
60
64
|
createSimpleMRZRecognizer(): Promise<SimpleMrzRecognizer>;
|
|
61
65
|
createOcrEngine(options?: {
|
|
62
66
|
mode: string;
|
package/@types/scanner-view.d.ts
CHANGED
|
@@ -32,6 +32,6 @@ export declare abstract class ScannerView<P extends ScanbotCameraProps, S extend
|
|
|
32
32
|
switchCamera(deviceId: string, mirrored?: boolean): Promise<void>;
|
|
33
33
|
getActiveCameraInfo(): CameraInfo | undefined;
|
|
34
34
|
fetchAvailableCameras(): Promise<CameraInfo[]>;
|
|
35
|
-
protected renderSpinner(color: string): JSX.Element;
|
|
35
|
+
protected renderSpinner(color: string): React.JSX.Element;
|
|
36
36
|
setTorchState(enabled: boolean): Promise<void>;
|
|
37
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ScanbotSDK from "../scanbot-sdk";
|
|
2
2
|
import { ParametricFilter } from "../core/compiled/ParametricFilters";
|
|
3
3
|
import { Polygon } from "../utils/dto/Polygon";
|
|
4
|
-
export
|
|
4
|
+
export type Rotation = "ROTATION_NONE" | "ROTATION_90_CLOCKWISE" | "ROTATION_180" | "ROTATION_90_COUNTERCLOCKWISE";
|
|
5
5
|
export declare class ImageProcessor {
|
|
6
6
|
private _sdk;
|
|
7
7
|
private _token;
|
|
@@ -14,18 +14,18 @@ import ScanbotSDK from '../scanbot-sdk';
|
|
|
14
14
|
* "COMM10" 4.125 x 9.5 (inches) 297 x 684 (pixels) at 72 DPI<br>
|
|
15
15
|
* "CUSTOM" physical size will be calculated from the image dimensions and the `dpi` parameter.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type PageSize = "LETTER" | "LEGAL" | "A3" | "A4" | "A5" | "B4" | "B5" | "EXECUTIVE" | "US4x6" | "US4x8" | "US5x7" | "COMM10" | "CUSTOM";
|
|
18
18
|
/**
|
|
19
19
|
* AUTO – decides based on image aspect ratio
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export type PageDirection = "PORTRAIT" | "LANDSCAPE" | "AUTO";
|
|
22
22
|
/**
|
|
23
23
|
* FIT_IN – Fit image into page. May leave white borders if the aspect ratio of the image and the page don't match. Preserves image aspect ratio. <br>
|
|
24
24
|
* FILL_IN – Fill page with image. Will crop the image if the aspect ratio of the image and the page don't match. Preserves image aspect ratio.<br>
|
|
25
25
|
* STRETCH – Stretch image to fill the entire page. The image will never be cropped and there will never be any white borders left, but the image aspect ratio will be made to match the page aspect ratio. <br>
|
|
26
26
|
* NONE – No resizing, centers the image on the page. The physical size of the image will be determined by the `dpi` parameter.
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export type PageFit = "FIT_IN" | "FILL_IN" | "STRETCH" | "NONE";
|
|
29
29
|
/**
|
|
30
30
|
* The parameters `pageSize`, `pageFit`, `dpi` and `resample` interact in a complex way
|
|
31
31
|
* when adding bitmap images (JPEG, PNG, or raw) to the PDF.
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { ScanbotCameraProps, ScanbotCameraState, ScannerView } from "./scanner-view";
|
|
3
|
-
import { TextDetectionCallback } from "./model/configuration/text-data-scanner-configuration";
|
|
4
|
-
import { ViewFinder } from "./view/view-finder";
|
|
5
|
-
import TextDataScanner from "./service/text-data-recognizer";
|
|
6
|
-
import { ScannerConfiguration } from "./model/configuration/scanner-configuration";
|
|
7
|
-
import { ViewFinderConfiguration } from "./model/configuration/view-finder-configuration";
|
|
8
3
|
import { ITextDataScannerHandle } from "./interfaces/i-text-data-scanner-handle";
|
|
4
|
+
import ViewFinder from "./view/view-finder";
|
|
5
|
+
import TextDataScanner from "./service/text-data-recognizer";
|
|
6
|
+
import { TextDetectionCallback } from "./model/configuration/text-data-scanner-configuration";
|
|
7
|
+
import { ViewFinderScannerConfiguration } from "./model/configuration/view-finder-scanner-configuration";
|
|
9
8
|
export declare class TextDataScannerProps extends ScanbotCameraProps {
|
|
10
9
|
textDataScanner: TextDataScanner;
|
|
11
10
|
onTextDetected: TextDetectionCallback;
|
|
12
|
-
style: ViewFinderConfiguration;
|
|
13
11
|
}
|
|
14
12
|
export declare class TextDataScannerState extends ScanbotCameraState {
|
|
15
13
|
isFinderVisible?: boolean;
|
|
@@ -20,12 +18,12 @@ export default class TextDataScannerView extends ScannerView<TextDataScannerProp
|
|
|
20
18
|
shouldComputeSize: boolean;
|
|
21
19
|
private paused;
|
|
22
20
|
constructor(props: TextDataScannerProps);
|
|
23
|
-
get configuration():
|
|
21
|
+
get configuration(): ViewFinderScannerConfiguration;
|
|
24
22
|
get enabled(): boolean;
|
|
25
23
|
/**
|
|
26
24
|
* Public API functions
|
|
27
25
|
*/
|
|
28
|
-
static create(configuration:
|
|
26
|
+
static create(configuration: ViewFinderScannerConfiguration, onTextDetected: TextDetectionCallback, textDataScanner: TextDataScanner): Promise<TextDataScannerView>;
|
|
29
27
|
isDetectionPaused(): boolean;
|
|
30
28
|
resumeDetection(): Promise<void>;
|
|
31
29
|
pauseDetection(): void;
|
|
@@ -40,5 +38,5 @@ export default class TextDataScannerView extends ScannerView<TextDataScannerProp
|
|
|
40
38
|
pause(): void;
|
|
41
39
|
detect(): Promise<void>;
|
|
42
40
|
saveExtractedImageData(): void;
|
|
43
|
-
render(): JSX.Element;
|
|
41
|
+
render(): React.JSX.Element;
|
|
44
42
|
}
|