scanbot-web-sdk 4.0.1-alpha.2 → 5.0.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 +2 -1
- package/@types/core/compiled/ParametricFilters.d.ts +181 -0
- package/@types/cropping-view.d.ts +9 -5
- package/@types/document-scanner-view.d.ts +4 -4
- package/@types/index.d.ts +58 -75
- package/@types/interfaces/i-scanner-common-handle.d.ts +1 -0
- package/@types/model/barcode/barcode-format.d.ts +1 -1
- package/@types/model/barcode/barcode-result.d.ts +1 -0
- package/@types/model/camera-info.d.ts +2 -1
- package/@types/model/configuration/document-quality-analyzer-configuration.d.ts +6 -0
- package/@types/model/configuration/document-scanner-configuration.d.ts +3 -4
- package/@types/model/configuration/mrz-scanner-configuration.d.ts +8 -0
- package/@types/model/configuration/scanner-configuration.d.ts +1 -0
- package/@types/model/configuration/text-data-scanner-configuration.d.ts +2 -3
- package/@types/model/error/media-error.d.ts +24 -7
- package/@types/model/filter-types.d.ts +3 -0
- package/@types/model/mrz/mrz-result.d.ts +1 -0
- package/@types/mrz-scanner-view.d.ts +2 -1
- package/@types/scanbot-sdk.d.ts +12 -2
- package/@types/scanner-view.d.ts +1 -0
- package/@types/service/image-processor.d.ts +35 -0
- package/@types/service/pdf-generator.d.ts +37 -13
- package/@types/service/simple-mrz-recognizer.d.ts +5 -4
- package/@types/service/tiff-generator.d.ts +8 -5
- package/@types/text-data-scanner-view.d.ts +2 -1
- package/@types/utils/dto/MagneticLine.d.ts +0 -1
- package/@types/utils/dto/Point.d.ts +6 -0
- package/@types/utils/math-utils.d.ts +1 -0
- package/@types/view/cropping/draggable-base-container.d.ts +28 -2
- package/@types/view/cropping/draggable-handles-component.d.ts +20 -4
- package/@types/view/cropping/draggable-lines-container.d.ts +6 -7
- package/@types/view/cropping/draggable-points-container.d.ts +1 -5
- package/@types/view/cropping/magnetic-lines-component.d.ts +23 -5
- package/@types/view/cropping/magnifier-view.d.ts +0 -1
- package/@types/view/polygon/draggable-document-polygon.d.ts +23 -1
- package/@types/view/scanbot-camera-view.d.ts +1 -0
- package/@types/view/shutter-button.d.ts +2 -12
- package/@types/view/utils/animatable.d.ts +11 -3
- package/@types/view/utils/clamp.d.ts +4 -0
- package/@types/view/view-finder.d.ts +2 -3
- package/bundle/ScanbotSDK.min.js +5 -5
- 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.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
- 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.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
- 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.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
- package/package.json +4 -3
package/@types/scanner-view.d.ts
CHANGED
|
@@ -30,4 +30,5 @@ export declare abstract class ScannerView<P extends ScanbotCameraProps, S extend
|
|
|
30
30
|
switchCamera(deviceId: string, mirrored?: boolean): Promise<void>;
|
|
31
31
|
getActiveCameraInfo(): CameraInfo | undefined;
|
|
32
32
|
fetchAvailableCameras(): Promise<CameraInfo[]>;
|
|
33
|
+
setTorchState(enabled: boolean): Promise<void>;
|
|
33
34
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import ScanbotSDK from "../scanbot-sdk";
|
|
2
|
+
import { ParametricFilter } from "../core/compiled/ParametricFilters";
|
|
3
|
+
import { Polygon } from "../utils/dto/Polygon";
|
|
4
|
+
export declare type Rotation = "ROTATION_NONE" | "ROTATION_90_CLOCKWISE" | "ROTATION_180" | "ROTATION_90_COUNTERCLOCKWISE";
|
|
5
|
+
export declare class ImageProcessor {
|
|
6
|
+
private _sdk;
|
|
7
|
+
private _token;
|
|
8
|
+
/** @internal */
|
|
9
|
+
constructor(_sdk: ScanbotSDK, _token: string);
|
|
10
|
+
copy(): Promise<ImageProcessor>;
|
|
11
|
+
/**
|
|
12
|
+
* Applies the given filter to the image.
|
|
13
|
+
* See {@link ParametricFilters} for available filters.
|
|
14
|
+
* @example
|
|
15
|
+
* imageProcessor.applyFilter(new sdk.imageFilters.ScanbotBinarizationFilter());
|
|
16
|
+
* */
|
|
17
|
+
applyFilter(filter: ParametricFilter): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Crops the image to the given polygon.
|
|
20
|
+
* The polygon is defined by an array of four points, each point being an object with `x` and `y` coordinates.
|
|
21
|
+
* Each coordinate is a floating point number between 0 and 1, representing the percentage of the image width and height, respectively.
|
|
22
|
+
* @example
|
|
23
|
+
* // Crop an image to the center 80% of the image:
|
|
24
|
+
* imageProcessor.crop([{x: 0.1, y: 0.1}, {x: 0.9, y: 0.1}, {x: 0.9, y: 0.9}, {x: 0.1, y: 0.9}])
|
|
25
|
+
*/
|
|
26
|
+
crop(polygon: Polygon): Promise<void>;
|
|
27
|
+
/** Resizes image, keeping aspect ratio, so that the biggest side of the image is equal to `destinationSize`. */
|
|
28
|
+
resize(destinationSize: number): Promise<void>;
|
|
29
|
+
rotate(rotation: Rotation): Promise<void>;
|
|
30
|
+
/** Returns the processed image as a JPEG encoded ArrayBuffer. */
|
|
31
|
+
processedImage(): Promise<ArrayBuffer>;
|
|
32
|
+
release(): Promise<void>;
|
|
33
|
+
/** @internal */
|
|
34
|
+
get __token(): string;
|
|
35
|
+
}
|
|
@@ -1,25 +1,49 @@
|
|
|
1
1
|
import ScanbotSDK from '../scanbot-sdk';
|
|
2
|
-
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
2
|
+
/**
|
|
3
|
+
* "LETTER" 8.5 x 11 (inches) 612 x 792 (pixels) <br>
|
|
4
|
+
* "LEGAL" 8.5 x 14 (inches) 612 x 1008 (pixels) <br>
|
|
5
|
+
* "A3" 297 x 420 (mm) 841.89 x 1199.551 (pixels) <br>
|
|
6
|
+
* "A4" 210 x 297 (mm) 595.276 x 841.89 (pixels) <br>
|
|
7
|
+
* "A5" 148 x 210 (mm) 419.528 x 595.276 (pixels) <br>
|
|
8
|
+
* "B4" 250 x 353 (mm) 708.661 x 1000.63 (pixels) <br>
|
|
9
|
+
* "B5" 176 x 250 (mm) 498.898 x 708.661 (pixels) <br>
|
|
10
|
+
* "EXECUTIVE" 7.25 x 10.5 (inches) 522 x 756 (pixels) <br>
|
|
11
|
+
* "US4x6" 4 x 6 (inches) 288 x 432 (pixels) <br>
|
|
12
|
+
* "US4x8" 4 x 8 (inches) 288 x 576 (pixels) <br>
|
|
13
|
+
* "US5x7" 5 x 7 (inches) 360 x 504 (pixels) <br>
|
|
14
|
+
* "COMM10" 4.125 x 9.5 (inches) 297 x 684 (pixels) <br>
|
|
15
|
+
* "CUSTOM" uses image size
|
|
16
|
+
*/
|
|
17
|
+
export declare type PageSize = "LETTER" | "LEGAL" | "A3" | "A4" | "A5" | "B4" | "B5" | "EXECUTIVE" | "US4x6" | "US4x8" | "US5x7" | "COMM10" | "CUSTOM";
|
|
18
|
+
/**
|
|
19
|
+
* AUTO – decides based on image aspect ratio
|
|
20
|
+
*/
|
|
15
21
|
export declare type PageDirection = "PORTRAIT" | "LANDSCAPE" | "AUTO";
|
|
22
|
+
/**
|
|
23
|
+
* FIT_IN – fit image into page, preserves aspect ratio <br>
|
|
24
|
+
* FILL_IN – fill page with image, preserves aspect ratio <br>
|
|
25
|
+
* STRETCH – stretch image to fill page, does NOT preserve aspect ratio <br>
|
|
26
|
+
* NONE – no resizing, centers the image
|
|
27
|
+
*/
|
|
28
|
+
export declare type PageFit = "FIT_IN" | "FILL_IN" | "STRETCH" | "NONE";
|
|
16
29
|
export interface PdfGenerationOptions {
|
|
17
30
|
standardPaperSize?: PageSize;
|
|
18
31
|
pageDirection?: PageDirection;
|
|
32
|
+
pageFit?: PageFit;
|
|
33
|
+
/**
|
|
34
|
+
* Note that no resampling of images is done in the PDF generation process.
|
|
35
|
+
* The dpi value is only used to calculate the images physical dimensions (in inches),
|
|
36
|
+
* when pageFit="NONE" or pageSize="CUSTOM".
|
|
37
|
+
*
|
|
38
|
+
* If you want to create a PDF with smaller file size, try resizing the image using
|
|
39
|
+
* the {@link ImageProcessor.resize} method before adding it to the PDF.
|
|
40
|
+
* */
|
|
41
|
+
dpi?: number;
|
|
19
42
|
}
|
|
20
43
|
export default class PdfGenerator {
|
|
21
44
|
_pdfOperation: string;
|
|
22
45
|
_sdk: ScanbotSDK;
|
|
46
|
+
/** @internal */
|
|
23
47
|
constructor(sdk: ScanbotSDK, pdfOperation: string);
|
|
24
48
|
addPage(imageBuffer: ArrayBuffer): Promise<void>;
|
|
25
49
|
complete(): Promise<ArrayBuffer>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { MrzResult } from '../model/mrz/mrz-result';
|
|
2
2
|
import ScanbotSDK from '../scanbot-sdk';
|
|
3
3
|
export default class SimpleMrzRecognizer {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
private _sdk;
|
|
5
|
+
private _mrzRecognizerToken;
|
|
6
|
+
private enableFrameAccumulation;
|
|
7
|
+
constructor(_sdk: ScanbotSDK, _mrzRecognizerToken: string, enableFrameAccumulation: boolean);
|
|
8
|
+
recognize(imageData: ImageData | ArrayBuffer): Promise<MrzResult>;
|
|
8
9
|
recognizeURL(imageURL: string): Promise<MrzResult>;
|
|
9
10
|
release(): Promise<void>;
|
|
10
11
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import ScanbotSDK from '../scanbot-sdk';
|
|
2
|
-
import {
|
|
2
|
+
import { ImageProcessor } from "./image-processor";
|
|
3
3
|
export interface TiffGenerationOptions {
|
|
4
|
-
binarizationFilter?: BinarizationFilter;
|
|
5
4
|
dpi?: number;
|
|
6
5
|
}
|
|
7
6
|
export default class TiffGenerator {
|
|
8
|
-
_tiffOperation
|
|
9
|
-
_sdk
|
|
7
|
+
private _tiffOperation;
|
|
8
|
+
private _sdk;
|
|
9
|
+
/** @internal */
|
|
10
10
|
constructor(sdk: ScanbotSDK, tiffOperation: string);
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @param image Can be either an ArrayBuffer containing the JPEG or PNG encoded image data, or an ImageProcessor instance.
|
|
13
|
+
*/
|
|
14
|
+
addPage(image: ArrayBuffer | ImageProcessor): Promise<void>;
|
|
12
15
|
complete(): Promise<ArrayBuffer>;
|
|
13
16
|
}
|
|
@@ -5,6 +5,7 @@ import { ViewFinder } from "./view/view-finder";
|
|
|
5
5
|
import TextDataScanner from "./service/text-data-recognizer";
|
|
6
6
|
import { ScannerConfiguration } from "./model/configuration/scanner-configuration";
|
|
7
7
|
import { ViewFinderConfiguration } from "./model/configuration/view-finder-configuration";
|
|
8
|
+
import { ITextDataScannerHandle } from "./interfaces/i-text-data-scanner-handle";
|
|
8
9
|
export declare class TextDataScannerProps extends ScanbotCameraProps {
|
|
9
10
|
textDataScanner: TextDataScanner;
|
|
10
11
|
onTextDetected: TextDetectionCallback;
|
|
@@ -13,7 +14,7 @@ export declare class TextDataScannerProps extends ScanbotCameraProps {
|
|
|
13
14
|
export declare class TextDataScannerState extends ScanbotCameraState {
|
|
14
15
|
isFinderVisible?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export default class TextDataScannerView extends ScannerView<TextDataScannerProps, TextDataScannerState> {
|
|
17
|
+
export default class TextDataScannerView extends ScannerView<TextDataScannerProps, TextDataScannerState> implements ITextDataScannerHandle {
|
|
17
18
|
static FRAME_RESOLUTION: number;
|
|
18
19
|
finder?: ViewFinder;
|
|
19
20
|
shouldComputeSize: boolean;
|
|
@@ -25,4 +25,10 @@ export declare class Point {
|
|
|
25
25
|
static left(points: Point[]): any;
|
|
26
26
|
static right(points: Point[]): any;
|
|
27
27
|
static toSvgString(points: Point[]): string;
|
|
28
|
+
static distance(pointA: Point, pointB: Point): number;
|
|
29
|
+
static subtract(a: Point, b: Point): Point;
|
|
30
|
+
static add(a: Point, b: Point): Point;
|
|
31
|
+
static multiply(point: Point, scalar: number): Point;
|
|
32
|
+
static cross(a: Point, b: Point): number;
|
|
33
|
+
static clamp(point: Point, containerSize: Size): Point;
|
|
28
34
|
}
|
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
import React, { CSSProperties } from "react";
|
|
2
2
|
import { Point } from "../../utils/dto/Point";
|
|
3
|
-
|
|
3
|
+
import { Size } from "../../utils/dto/Size";
|
|
4
|
+
import { CroppingViewPolygonHandleStyle } from "../../model/configuration/cropping-view-configuration";
|
|
5
|
+
export interface MovingLine {
|
|
6
|
+
points: {
|
|
7
|
+
index: number;
|
|
8
|
+
coordinates: Point;
|
|
9
|
+
}[];
|
|
10
|
+
/** The point of the polygon that is clockwise before the moving line */
|
|
11
|
+
previousPoint: Point;
|
|
12
|
+
/** The point of the polygon that is clockwise after the moving line */
|
|
13
|
+
nextPoint: Point;
|
|
14
|
+
isHorizontal: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface DraggableBaseContainerProps {
|
|
17
|
+
style: CroppingViewPolygonHandleStyle;
|
|
18
|
+
containerSize: Size;
|
|
19
|
+
scale: number;
|
|
20
|
+
rotations: number;
|
|
21
|
+
points: Point[];
|
|
22
|
+
cornerMoveStart?: any;
|
|
23
|
+
cornerMoved?: any;
|
|
24
|
+
cornerMoveEnd?: any;
|
|
25
|
+
lineMoved?: (movingLine: MovingLine) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare class DraggableBaseContainer extends React.Component<DraggableBaseContainerProps, any> {
|
|
4
28
|
POINT_COUNT: number;
|
|
5
|
-
get pointSize():
|
|
29
|
+
get pointSize(): number;
|
|
6
30
|
get pointStyle(): CSSProperties;
|
|
7
31
|
items: HTMLDivElement[];
|
|
8
32
|
parentOffset: Point;
|
|
@@ -11,4 +35,6 @@ export declare class DraggableBaseContainer extends React.Component<any, any> {
|
|
|
11
35
|
isHorizontal(index: number): boolean;
|
|
12
36
|
DRAG_BUFFER: number;
|
|
13
37
|
isOutOfBounds(coordinate: number, bound: number): boolean;
|
|
38
|
+
get invisibleHandleStyle(): CSSProperties;
|
|
14
39
|
}
|
|
40
|
+
export {};
|
|
@@ -2,12 +2,28 @@ import React from "react";
|
|
|
2
2
|
import { MagneticLine } from "../../utils/dto/MagneticLine";
|
|
3
3
|
import { DraggablePointsContainer } from "./draggable-points-container";
|
|
4
4
|
import { DraggableLinesContainer } from "./draggable-lines-container";
|
|
5
|
-
|
|
5
|
+
import { Size } from "../../utils/dto/Size";
|
|
6
|
+
import { CroppingViewPolygonHandleStyle } from "../../model/configuration/cropping-view-configuration";
|
|
7
|
+
import type { MovingLine } from "./draggable-base-container";
|
|
8
|
+
interface DraggableHandlesComponentProps {
|
|
9
|
+
containerSize: Size;
|
|
10
|
+
coordinatePoints: any;
|
|
11
|
+
rotations: number;
|
|
12
|
+
scale: number;
|
|
13
|
+
style: CroppingViewPolygonHandleStyle;
|
|
14
|
+
cornerMoveStart: any;
|
|
15
|
+
cornerMoved: any;
|
|
16
|
+
cornerMoveEnd: any;
|
|
17
|
+
lineMoved: (data: MovingLine) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare class DraggableHandlesComponent extends React.Component<DraggableHandlesComponentProps, {}> {
|
|
6
20
|
corners: DraggablePointsContainer;
|
|
7
21
|
lines: DraggableLinesContainer;
|
|
8
|
-
constructor(props: any);
|
|
9
22
|
render(): JSX.Element;
|
|
10
23
|
setFrame(): void;
|
|
11
|
-
snapTo(data:
|
|
12
|
-
|
|
24
|
+
snapTo(data: {
|
|
25
|
+
magneticLine: MagneticLine;
|
|
26
|
+
polygonLine: MovingLine;
|
|
27
|
+
}): void;
|
|
13
28
|
}
|
|
29
|
+
export {};
|
|
@@ -4,16 +4,15 @@ import { DraggableBaseContainer } from "./draggable-base-container";
|
|
|
4
4
|
export declare class DraggableLinesContainer extends DraggableBaseContainer {
|
|
5
5
|
point1Offset: Point;
|
|
6
6
|
point2Offset: Point;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
point0Start: Readonly<Point>;
|
|
8
|
+
point1Start: Readonly<Point>;
|
|
9
|
+
point2Start: Readonly<Point>;
|
|
10
|
+
point3Start: Readonly<Point>;
|
|
9
11
|
create(): JSX.Element[];
|
|
10
12
|
lineTouchStart(e: React.PointerEvent<HTMLDivElement>, index: number): void;
|
|
11
13
|
lineTouchMove(e: React.PointerEvent<HTMLDivElement>, index: number): void;
|
|
12
|
-
lineTouchEnd(): void;
|
|
13
|
-
MAX_SLOPE_DIFF: number;
|
|
14
|
-
accountForSlopeCalculationError(potential: number, existing: number): number;
|
|
14
|
+
lineTouchEnd(e: React.PointerEvent<HTMLDivElement>): void;
|
|
15
15
|
isNearOpposingPoint(start: Point, active: Point, wall: Point, axis: "x" | "y"): boolean;
|
|
16
|
-
|
|
17
|
-
limitMinMaxCoordinates(value: number, max: number): number;
|
|
16
|
+
areEdgesCrossing(edgeAPoint1: Point, edgeAPoint2: Point, edgeBPoint1: Point, edgeBPoint2: Point): boolean;
|
|
18
17
|
render(): JSX.Element;
|
|
19
18
|
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Point } from "../../utils/dto/Point";
|
|
3
2
|
import { DraggableBaseContainer } from "./draggable-base-container";
|
|
4
3
|
export declare class DraggablePointsContainer extends DraggableBaseContainer {
|
|
5
|
-
lastPointIndex: number;
|
|
6
4
|
create(): JSX.Element[];
|
|
7
5
|
cornerTouchStart(e: React.PointerEvent<HTMLDivElement>, index: number): void;
|
|
8
6
|
cornerTouchMove(e: React.PointerEvent<HTMLDivElement>, index: number): void;
|
|
9
|
-
cornerTouchEnd(): void;
|
|
10
|
-
calculateSlopes(): void;
|
|
11
|
-
calculateSlope(point1: Point, point2: Point, isHorizontal: boolean): number;
|
|
7
|
+
cornerTouchEnd(e: React.PointerEvent<HTMLDivElement>): void;
|
|
12
8
|
render(): JSX.Element;
|
|
13
9
|
}
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MagneticLine } from "../../utils/dto/MagneticLine";
|
|
3
3
|
import { Point } from "../../utils/dto/Point";
|
|
4
|
-
|
|
4
|
+
import type { CroppingViewMagneticLineStyle } from "../../model/configuration/cropping-view-configuration";
|
|
5
|
+
import type { MovingLine } from "./draggable-base-container";
|
|
6
|
+
interface MagneticLinesComponentProps {
|
|
7
|
+
lines: {
|
|
8
|
+
horizontal: {
|
|
9
|
+
scaled: MagneticLine[];
|
|
10
|
+
};
|
|
11
|
+
vertical: {
|
|
12
|
+
scaled: MagneticLine[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
movingLine: MovingLine;
|
|
16
|
+
snapTo: (data: {
|
|
17
|
+
magneticLine: MagneticLine;
|
|
18
|
+
polygonLine: MovingLine;
|
|
19
|
+
}) => void;
|
|
20
|
+
style: CroppingViewMagneticLineStyle;
|
|
21
|
+
}
|
|
22
|
+
export declare class MagneticLinesComponent extends React.Component<MagneticLinesComponentProps, any> {
|
|
5
23
|
fromPoint(point: MagneticLine): JSX.Element;
|
|
6
24
|
componentDidUpdate(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
|
|
7
25
|
render(): JSX.Element;
|
|
8
|
-
isNearAny(): void;
|
|
9
|
-
isLineNearLine(anchor: MagneticLine, other: any[], isHorizontal: boolean): boolean;
|
|
10
|
-
isPointNearLine(anchor: MagneticLine, other: Point, isHorizontal: boolean): boolean;
|
|
11
26
|
BUFFER: number;
|
|
12
|
-
|
|
27
|
+
snapToClosestIfAnyAreClose(): void;
|
|
28
|
+
distanceToLine(line: MagneticLine, x: Point): number;
|
|
29
|
+
midPoint(point1: Point, point2: Point): Point;
|
|
13
30
|
}
|
|
31
|
+
export {};
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DocumentLineQuad } from "./document-line-quad";
|
|
3
3
|
import { DraggableHandlesComponent } from "../cropping/draggable-handles-component";
|
|
4
|
-
|
|
4
|
+
import { Size } from "../../utils/dto/Size";
|
|
5
|
+
import { CroppingViewMagneticLineStyle, CroppingViewPolygonHandleStyle } from "../../model/configuration/cropping-view-configuration";
|
|
6
|
+
import { MovingLine } from "../cropping/draggable-base-container";
|
|
7
|
+
interface DraggableDocumentPolygonProps {
|
|
8
|
+
size: Size;
|
|
9
|
+
points: any;
|
|
10
|
+
rotations: number;
|
|
11
|
+
scale: number;
|
|
12
|
+
handleStyle: CroppingViewPolygonHandleStyle;
|
|
13
|
+
magneticLineStyle: CroppingViewMagneticLineStyle;
|
|
14
|
+
magneticLines: any;
|
|
15
|
+
polygonStyle: any;
|
|
16
|
+
polygonClasses: any;
|
|
17
|
+
cornerMoveStart: any;
|
|
18
|
+
cornerMoved: any;
|
|
19
|
+
cornerMoveEnd: any;
|
|
20
|
+
style: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
interface DraggableDocumentPolygonState {
|
|
23
|
+
movingLine: MovingLine;
|
|
24
|
+
}
|
|
25
|
+
export declare class DraggableDocumentPolygon extends React.Component<DraggableDocumentPolygonProps, DraggableDocumentPolygonState> {
|
|
5
26
|
handles: DraggableHandlesComponent;
|
|
6
27
|
polygon: DocumentLineQuad;
|
|
7
28
|
constructor(props: any);
|
|
8
29
|
render(): JSX.Element;
|
|
9
30
|
setFrame(): void;
|
|
10
31
|
}
|
|
32
|
+
export {};
|
|
@@ -58,4 +58,5 @@ export default class ScanbotCameraView extends React.Component<ScanbotCameraView
|
|
|
58
58
|
switchCamera(deviceId: string, mirrored?: boolean): Promise<void>;
|
|
59
59
|
private updateCameraInfo;
|
|
60
60
|
getActiveCameraInfo(): CameraInfo | undefined;
|
|
61
|
+
setTorchState(enabled: boolean): Promise<void>;
|
|
61
62
|
}
|
|
@@ -7,18 +7,9 @@ export declare class ShutterButtonProps {
|
|
|
7
7
|
onClick: any;
|
|
8
8
|
style?: any;
|
|
9
9
|
}
|
|
10
|
-
declare class AnimationSynchronizer {
|
|
11
|
-
lastTime: number;
|
|
12
|
-
lastDuration: number;
|
|
13
|
-
t: number;
|
|
14
|
-
element: HTMLElement;
|
|
15
|
-
animationClass: string;
|
|
16
|
-
constructor(animationClass: string);
|
|
17
|
-
setDuration(duration: number): void;
|
|
18
|
-
}
|
|
19
10
|
export declare class ShutterButton extends React.Component<ShutterButtonProps, {}> {
|
|
20
|
-
inner1
|
|
21
|
-
inner2
|
|
11
|
+
private inner1;
|
|
12
|
+
private inner2;
|
|
22
13
|
render(): JSX.Element;
|
|
23
14
|
updateAnimationSpeed(action: ShutterButtonAction): void;
|
|
24
15
|
componentDidMount(): void;
|
|
@@ -32,4 +23,3 @@ export declare class ShutterButton extends React.Component<ShutterButtonProps, {
|
|
|
32
23
|
[key: string]: boolean;
|
|
33
24
|
}, child: any, ref?: (ref: any) => void): JSX.Element;
|
|
34
25
|
}
|
|
35
|
-
export {};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Size } from "../../utils/dto/Size";
|
|
3
3
|
import { Point } from "../../utils/dto/Point";
|
|
4
|
-
|
|
4
|
+
interface AnimatableProps {
|
|
5
|
+
size: Size;
|
|
6
|
+
imageMargin: Point;
|
|
7
|
+
rotations: number;
|
|
8
|
+
scale: number;
|
|
9
|
+
duration: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class Animatable extends React.Component<AnimatableProps, any> {
|
|
5
12
|
previousScale: number;
|
|
6
13
|
container: HTMLDivElement;
|
|
7
14
|
width(): number;
|
|
@@ -9,6 +16,7 @@ export declare class Animatable extends React.Component<any, any> {
|
|
|
9
16
|
private animating;
|
|
10
17
|
isAnimating(): boolean;
|
|
11
18
|
render(): JSX.Element;
|
|
12
|
-
marginWithAspect(margin: Point, axis: "x" | "y", size: Size):
|
|
13
|
-
calculate(size: Size,
|
|
19
|
+
marginWithAspect(margin: Point, axis: "x" | "y", size: Size): number;
|
|
20
|
+
calculate(size: Size, property: "width" | "height"): any;
|
|
14
21
|
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Size } from "../../utils/dto/Size";
|
|
2
|
+
import { Point } from "../../utils/dto/Point";
|
|
3
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
4
|
+
export declare function clampHandlePosition(handlePosition: Point, handleDiameter: number, containerSize: Size): Point;
|
|
@@ -3,11 +3,11 @@ import { Frame } from "../utils/dto/Frame";
|
|
|
3
3
|
import { ClipPath } from "../utils/dto/ClipPath";
|
|
4
4
|
import { Point } from "../utils/dto/Point";
|
|
5
5
|
import { ViewFinderConfiguration } from "../model/configuration/view-finder-configuration";
|
|
6
|
-
declare class ViewFinderProps {
|
|
6
|
+
export declare class ViewFinderProps {
|
|
7
7
|
configuration: ViewFinderConfiguration;
|
|
8
8
|
onSizeChanged?: (rect: DOMRect) => void;
|
|
9
9
|
}
|
|
10
|
-
declare enum ClipDirection {
|
|
10
|
+
export declare enum ClipDirection {
|
|
11
11
|
Right = 0,
|
|
12
12
|
Down = 1,
|
|
13
13
|
Left = 2,
|
|
@@ -33,4 +33,3 @@ export declare class ViewFinder extends React.Component<ViewFinderProps, any> {
|
|
|
33
33
|
roundClipPath(x: string, y: string, direction: ClipDirection): string;
|
|
34
34
|
addIncrements(edge: Point, increments: Point[]): string;
|
|
35
35
|
}
|
|
36
|
-
export {};
|