scanbot-web-sdk 2.12.1-alpha.1 → 2.13.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/barcode-scanner-view.d.ts +26 -0
- package/@types/model/barcode/barcode.d.ts +4 -1
- package/@types/model/configuration/barcode-scanner-configuration.d.ts +4 -1
- package/@types/model/configuration/base-configuration.d.ts +9 -1
- package/@types/model/configuration/selection-overlay-configuration.d.ts +3 -0
- package/@types/scanner-view.d.ts +1 -0
- package/@types/utils/colors.d.ts +6 -0
- package/@types/utils/date-utils.d.ts +3 -0
- package/@types/utils/dto/Point.d.ts +3 -0
- package/@types/utils/dto/Size.d.ts +4 -0
- package/@types/utils/image-utils.d.ts +2 -0
- package/@types/utils/view-utils.d.ts +2 -0
- package/@types/view/action-bar/bottom-action-bar.d.ts +8 -0
- package/@types/view/barcode-calculation/barcode-calculation-popup-list-item.d.ts +6 -0
- package/@types/view/barcode-calculation/barcode-calculation-popup-list.d.ts +8 -0
- package/@types/view/barcode-calculation/barcode-calculation-popup.d.ts +32 -0
- package/@types/view/barcode-calculation/scanned-image-with-overlay.d.ts +12 -0
- package/@types/view/barcode-calculation/styled-spinner.d.ts +3 -0
- package/@types/view/barcode-polygon/animated-barcode-selection-overlay.d.ts +11 -0
- package/@types/view/barcode-polygon/barcode-overlay.d.ts +9 -0
- package/@types/view/barcode-polygon/barcode-selection-overlay.d.ts +17 -0
- package/@types/view/barcode-polygon/barocode-polygon.d.ts +10 -0
- package/@types/view/scanbot-camera-view.d.ts +1 -0
- package/@types/view/shutter-button.d.ts +1 -0
- package/@types/view/utils/capturing-loader.d.ts +4 -0
- package/@types/view/utils/icons/bullets-burger.d.ts +4 -0
- package/@types/view/utils/icons/check-circle.d.ts +4 -0
- package/@types/view/utils/icons/replay.d.ts +4 -0
- package/@types/view/view-finder.d.ts +1 -0
- package/bundle/ScanbotSDK.min.js +5 -2
- 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.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/package.json +2 -2
|
@@ -1,19 +1,41 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ScanbotCameraProps, ScanbotCameraState, ScannerView } from "./scanner-view";
|
|
3
3
|
import { BarcodeScannerConfiguration } from "./model/configuration/barcode-scanner-configuration";
|
|
4
|
+
import { BarcodeResult } from "./model/barcode/barcode-result";
|
|
4
5
|
import { ViewFinder } from "./view/view-finder";
|
|
6
|
+
import { Size } from "./utils/dto/Size";
|
|
7
|
+
import { ShutterButtonAction } from "./view/shutter-button";
|
|
8
|
+
import BarcodeCalculationPopup from "./view/barcode-calculation/barcode-calculation-popup";
|
|
9
|
+
import AnimatedBarcodeSelectionOverlay from "./view/barcode-polygon/animated-barcode-selection-overlay";
|
|
10
|
+
import BottomActionBar from "./view/action-bar/bottom-action-bar";
|
|
11
|
+
import ScannedImageWithOverlay from "./view/barcode-calculation/scanned-image-with-overlay";
|
|
12
|
+
import { ImageDataWrapper } from "./model/image-data-wrapper";
|
|
13
|
+
import { Barcode } from "./model/barcode/barcode";
|
|
5
14
|
export declare class BarcodeScannerProps extends ScanbotCameraProps {
|
|
6
15
|
showFinder?: boolean;
|
|
7
16
|
}
|
|
8
17
|
export declare class BarcodeScannerState extends ScanbotCameraState {
|
|
9
18
|
isFinderVisible?: boolean;
|
|
10
19
|
zoom?: number;
|
|
20
|
+
action: ShutterButtonAction;
|
|
21
|
+
image?: string;
|
|
11
22
|
}
|
|
12
23
|
export default class BarcodeScannerView extends ScannerView<BarcodeScannerProps, BarcodeScannerState> {
|
|
13
24
|
finder?: ViewFinder;
|
|
14
25
|
shouldComputeSize: boolean;
|
|
15
26
|
private _configuration;
|
|
16
27
|
private paused;
|
|
28
|
+
finderRect: DOMRect | undefined;
|
|
29
|
+
recognition: {
|
|
30
|
+
imageData: ImageDataWrapper;
|
|
31
|
+
originalImage: any;
|
|
32
|
+
barcodeResult: BarcodeResult;
|
|
33
|
+
};
|
|
34
|
+
overlay?: AnimatedBarcodeSelectionOverlay | undefined;
|
|
35
|
+
popup: BarcodeCalculationPopup | undefined;
|
|
36
|
+
scannedImage: ScannedImageWithOverlay | undefined;
|
|
37
|
+
bottomActionBar: BottomActionBar | undefined;
|
|
38
|
+
readonly barcodes: Barcode[];
|
|
17
39
|
constructor(props: BarcodeScannerProps);
|
|
18
40
|
get configuration(): BarcodeScannerConfiguration;
|
|
19
41
|
get enabled(): boolean;
|
|
@@ -34,6 +56,10 @@ export default class BarcodeScannerView extends ScannerView<BarcodeScannerProps,
|
|
|
34
56
|
pause(): void;
|
|
35
57
|
computeSize(): boolean;
|
|
36
58
|
detect(): Promise<void>;
|
|
59
|
+
desiredRecognitionResolution: number | undefined;
|
|
60
|
+
setRecognitionResolution(resolution: number): void;
|
|
61
|
+
getResolution(): Promise<Size>;
|
|
62
|
+
private recognizeBarcodes;
|
|
37
63
|
saveExtractedImageData(): void;
|
|
38
64
|
setFinderVisible(isVisible: boolean): void;
|
|
39
65
|
setZoom(zoom: number): void;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { Point } from "../../utils/dto/Point";
|
|
1
2
|
import { BarcodeFormat } from "./barcode-format";
|
|
2
3
|
export declare class Barcode {
|
|
3
4
|
format: BarcodeFormat;
|
|
4
5
|
text: string;
|
|
5
6
|
parsedText: any;
|
|
6
7
|
rawBytes: Uint8Array;
|
|
8
|
+
points: Point[];
|
|
7
9
|
barcodeImage: Uint8Array;
|
|
8
|
-
constructor(format: BarcodeFormat, text: string, parsedText: string, bytes: Uint8Array, barcodeImage: Uint8Array);
|
|
10
|
+
constructor(format: BarcodeFormat, text: string, parsedText: string, bytes: Uint8Array, points: Point[], barcodeImage: Uint8Array);
|
|
11
|
+
equals(barcode: Barcode): unknown;
|
|
9
12
|
static fromWorker(input: any): Barcode;
|
|
10
13
|
}
|
|
@@ -3,6 +3,7 @@ import { BarcodeResult } from "../barcode/barcode-result";
|
|
|
3
3
|
import { EngineMode } from "../barcode/engine-mode";
|
|
4
4
|
import { BarcodeFormat } from "../barcode/barcode-format";
|
|
5
5
|
import { ViewFinderConfiguration } from "./view-finder-configuration";
|
|
6
|
+
import { SelectionOverlayConfiguration } from "./selection-overlay-configuration";
|
|
6
7
|
export declare class BarcodeScannerConfiguration extends ScannerConfiguration {
|
|
7
8
|
constructor();
|
|
8
9
|
/**
|
|
@@ -10,15 +11,17 @@ export declare class BarcodeScannerConfiguration extends ScannerConfiguration {
|
|
|
10
11
|
*/
|
|
11
12
|
captureDelay?: number;
|
|
12
13
|
style?: ViewFinderConfiguration;
|
|
14
|
+
overlay?: SelectionOverlayConfiguration;
|
|
13
15
|
engineMode?: EngineMode;
|
|
14
16
|
barcodeFormats?: BarcodeFormat[];
|
|
15
17
|
returnBarcodeImage?: boolean;
|
|
16
18
|
showFinder?: boolean;
|
|
19
|
+
manualDetection?: boolean;
|
|
17
20
|
/**
|
|
18
21
|
* Digital zoom level of the video stream. Defaults to 1.0.
|
|
19
22
|
* Please note that this is not the same as the optical zoom of the camera.
|
|
20
23
|
*/
|
|
21
|
-
zoom
|
|
24
|
+
zoom?: number;
|
|
22
25
|
/**
|
|
23
26
|
*/
|
|
24
27
|
onBarcodesDetected?: (e: BarcodeResult) => void;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export declare class BaseConfiguration {
|
|
2
2
|
/**
|
|
3
|
-
* The container HTML element of Scanbot Web SDK camera.
|
|
3
|
+
* The container HTML element of Scanbot Web SDK camera.
|
|
4
|
+
* Required when 'containerId' property is left undefined when calling any ScanbotSDK createScanner function.
|
|
5
|
+
* If both are provided, 'container' property takes precedence.
|
|
6
|
+
*/
|
|
7
|
+
container?: HTMLElement;
|
|
8
|
+
/**
|
|
9
|
+
* The container HTML element id of Scanbot Web SDK camera.
|
|
10
|
+
* Required when 'container' property is left undefined when calling any ScanbotSDK createScanner function
|
|
11
|
+
* If both are provided, 'container' property takes precedence.
|
|
4
12
|
*/
|
|
5
13
|
containerId?: string;
|
|
6
14
|
static mapValues(source: any, destination: {
|
package/@types/scanner-view.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare class ScanbotCameraState {
|
|
|
13
13
|
}
|
|
14
14
|
export declare abstract class ScannerView<P extends ScanbotCameraProps, S extends ScanbotCameraState> extends React.Component<P, S> {
|
|
15
15
|
static DEFAULT_DETECTION_RESOLUTION: number;
|
|
16
|
+
static DETECTION_RESULTION_4K: number;
|
|
16
17
|
camera: ScanbotCameraView | null;
|
|
17
18
|
disposed?: boolean;
|
|
18
19
|
get bridge(): import("./worker/worker-bridge").WorkerBridge;
|
|
@@ -6,10 +6,13 @@ export declare class Point {
|
|
|
6
6
|
constructor(x: number, y: number);
|
|
7
7
|
static toPolygon(points: Point[], size: Size): Polygon;
|
|
8
8
|
static scaleToPoint(pt: Point, x: number, y: number, scale: number): Point;
|
|
9
|
+
static scaleListToImageElement(points: Point[], original: ImageData, html: HTMLImageElement): Point[];
|
|
10
|
+
static scaleToImageElement(point: Point, original: ImageData, html: HTMLImageElement): Point;
|
|
9
11
|
static scaleUpTo(pt: Point, size: Size): Point;
|
|
10
12
|
static scaleDownTo(pt: Point, size: Size): Point;
|
|
11
13
|
static fromHtmlElement(element: HTMLElement): Point;
|
|
12
14
|
static withScale(x: number, y: number, scale: number): Point;
|
|
13
15
|
static fromCoordinates(clientX: any, clientY: any, rotations: number, scale: number): Point;
|
|
16
|
+
static centerOf(points: Point[]): Point;
|
|
14
17
|
static empty(): Point;
|
|
15
18
|
}
|
|
@@ -9,6 +9,10 @@ export declare class Size {
|
|
|
9
9
|
static isEmpty(size: Size): boolean;
|
|
10
10
|
static toPolygon(size: Size): Point[];
|
|
11
11
|
static fromHtmlElement(element: HTMLElement): Size;
|
|
12
|
+
static fromJson(json: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}): Size;
|
|
12
16
|
static subtractFrom(original: Size, amount: number): Size;
|
|
13
17
|
static empty(): Size;
|
|
14
18
|
}
|
|
@@ -6,6 +6,8 @@ export declare class ImageUtils {
|
|
|
6
6
|
static getObjectFitSize(container: Size, size: Size, contains?: boolean): Frame;
|
|
7
7
|
static loadFromUrl(imageURL: string): Promise<ImageData>;
|
|
8
8
|
static saveImageData(data: ImageData): void;
|
|
9
|
+
static createImageDataCanvas(data: ImageData): HTMLCanvasElement;
|
|
9
10
|
static saveBlob(blob: Blob, name: string): void;
|
|
10
11
|
static convertImageDataWrapperToImageData(imageDataWrapper: ImageDataWrapper): ImageData;
|
|
12
|
+
static wrapperToBase64(wrapper: ImageDataWrapper): string;
|
|
11
13
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MagneticLine } from "./dto/MagneticLine";
|
|
2
2
|
import { Size } from "./dto/Size";
|
|
3
3
|
import { Point } from "./dto/Point";
|
|
4
|
+
import { ScannerConfiguration } from "../model/configuration/scanner-configuration";
|
|
4
5
|
export declare class ViewUtils {
|
|
5
6
|
static convertLinesToViewportLines(elementSize: Size, lines: MagneticLine[]): MagneticLine[];
|
|
6
7
|
static convertToViewportPointsFromParentSize(elementSize: Size, points: any[]): Point[];
|
|
@@ -13,4 +14,5 @@ export declare class ViewUtils {
|
|
|
13
14
|
private static preventDefaultCallback;
|
|
14
15
|
static disableScreenMovement(): void;
|
|
15
16
|
static enableScreenMovement(): void;
|
|
17
|
+
static findContainerOrThrow(configuration: ScannerConfiguration): HTMLElement;
|
|
16
18
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Barcode } from "../../model/barcode/barcode";
|
|
3
|
+
export default class BottomActionBar extends React.Component<any, any> {
|
|
4
|
+
constructor(props: any);
|
|
5
|
+
update(barcodes: Barcode[]): void;
|
|
6
|
+
didScan(): boolean;
|
|
7
|
+
render(): React.ReactNode;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Barcode } from "../../model/barcode/barcode";
|
|
3
|
+
export default class BarcodeCalculationPopupList extends React.Component<any, any> {
|
|
4
|
+
constructor(props: any);
|
|
5
|
+
toUniqueListWithDuplicateCounter(barcodes: Barcode[]): Barcode[];
|
|
6
|
+
update(barcodes: any): void;
|
|
7
|
+
render(): React.ReactNode;
|
|
8
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
|
+
import { Barcode } from "../../model/barcode/barcode";
|
|
3
|
+
import BarcodeCalculationPopupList from "./barcode-calculation-popup-list";
|
|
4
|
+
export declare enum AnimationType {
|
|
5
|
+
None = 0,
|
|
6
|
+
PushRight = 1,
|
|
7
|
+
PushBottom = 2,
|
|
8
|
+
Pop = 3
|
|
9
|
+
}
|
|
10
|
+
export default class BarcodeCalculationPopup extends React.Component<any, any> {
|
|
11
|
+
list: BarcodeCalculationPopupList;
|
|
12
|
+
previousDestination?: string;
|
|
13
|
+
barcodes?: Barcode[];
|
|
14
|
+
constructor(props: any);
|
|
15
|
+
containerStyle(transform: string): CSSProperties;
|
|
16
|
+
render(): React.ReactNode;
|
|
17
|
+
reset(): void;
|
|
18
|
+
private _isVisible;
|
|
19
|
+
isVisible(): boolean;
|
|
20
|
+
push(type: AnimationType, barcodes: Barcode[]): void;
|
|
21
|
+
update(barcodes: Barcode[]): void;
|
|
22
|
+
pop(): void;
|
|
23
|
+
onAnimationStart(): void;
|
|
24
|
+
onAnimationEnd(): void;
|
|
25
|
+
pushType?: AnimationType;
|
|
26
|
+
updateAnimationType(type: AnimationType, callback?: any): void;
|
|
27
|
+
animation(type: AnimationType): import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
28
|
+
from(type: AnimationType): string;
|
|
29
|
+
to(type: AnimationType): string;
|
|
30
|
+
translate(axis: "X" | "Y", percentage: number): string;
|
|
31
|
+
componentWillUnmount(): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import BarcodeSelectionOverlay from "../barcode-polygon/barcode-selection-overlay";
|
|
3
|
+
import { BarcodeResult } from "../../model/barcode/barcode-result";
|
|
4
|
+
export default class ScannedImageWithOverlay extends React.Component<any, any> {
|
|
5
|
+
image: HTMLImageElement | undefined;
|
|
6
|
+
polygons: BarcodeSelectionOverlay[];
|
|
7
|
+
overlay: BarcodeSelectionOverlay;
|
|
8
|
+
constructor(props: any);
|
|
9
|
+
update(result: BarcodeResult): void;
|
|
10
|
+
reset(): void;
|
|
11
|
+
render(): ReactNode;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import BarcodeSelectionOverlay from "./barcode-selection-overlay";
|
|
3
|
+
import ScanbotCameraView from "../scanbot-camera-view";
|
|
4
|
+
import { ImageDataWrapper } from "../../model/image-data-wrapper";
|
|
5
|
+
import { Barcode } from "../../model/barcode/barcode";
|
|
6
|
+
export default class AnimatedBarcodeSelectionOverlay extends React.Component<any, any> {
|
|
7
|
+
overlay: BarcodeSelectionOverlay | undefined;
|
|
8
|
+
constructor(props: any);
|
|
9
|
+
update(finderRect: DOMRect, camera: ScanbotCameraView, imageData: ImageDataWrapper, container: any, codes: Barcode[]): void;
|
|
10
|
+
render(): React.ReactNode;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Barcode } from "../../model/barcode/barcode";
|
|
2
|
+
import { Point } from "../../utils/dto/Point";
|
|
3
|
+
export declare class BarcodeOverlay {
|
|
4
|
+
base64Image?: string;
|
|
5
|
+
code: Barcode;
|
|
6
|
+
points: Point[];
|
|
7
|
+
highlighted: boolean;
|
|
8
|
+
constructor(barcode: Barcode);
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import BarcodePolygon from "./barocode-polygon";
|
|
3
|
+
import { BarcodeOverlay } from "./barcode-overlay";
|
|
4
|
+
export declare class BarcodeSelectionOverlayProps {
|
|
5
|
+
elements: BarcodeOverlay[];
|
|
6
|
+
}
|
|
7
|
+
export default class BarcodeSelectionOverlay extends React.Component<any, any> {
|
|
8
|
+
interval: number;
|
|
9
|
+
update(elements: BarcodeOverlay[]): void;
|
|
10
|
+
polygons: BarcodePolygon[];
|
|
11
|
+
componentDidMount(): void;
|
|
12
|
+
componentWillUnmount(): void;
|
|
13
|
+
startTimer(): void;
|
|
14
|
+
onTimerElapsed(): void;
|
|
15
|
+
constructor(props: any);
|
|
16
|
+
render(): JSX.Element;
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BarcodeOverlay } from "./barcode-overlay";
|
|
3
|
+
export declare class BarcodePolygonProps {
|
|
4
|
+
element: BarcodeOverlay;
|
|
5
|
+
onClick?: (e: any, element: BarcodeOverlay) => void;
|
|
6
|
+
}
|
|
7
|
+
export default class BarcodePolygon extends React.Component<BarcodePolygonProps, any> {
|
|
8
|
+
updatedAt: number;
|
|
9
|
+
render(): React.ReactNode;
|
|
10
|
+
}
|
|
@@ -5,6 +5,7 @@ import { Point } from "../utils/dto/Point";
|
|
|
5
5
|
import { ViewFinderConfiguration } from "../model/configuration/view-finder-configuration";
|
|
6
6
|
declare class ViewFinderProps {
|
|
7
7
|
configuration: ViewFinderConfiguration;
|
|
8
|
+
onSizeChanged?: (rect: DOMRect) => void;
|
|
8
9
|
}
|
|
9
10
|
declare enum ClipDirection {
|
|
10
11
|
Right = 0,
|