scanbot-web-sdk 2.13.0 → 2.14.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.
@@ -8,6 +8,7 @@ export declare class Barcode {
8
8
  points: Point[];
9
9
  barcodeImage: Uint8Array;
10
10
  constructor(format: BarcodeFormat, text: string, parsedText: string, bytes: Uint8Array, points: Point[], barcodeImage: Uint8Array);
11
+ id(): string;
11
12
  equals(barcode: Barcode): unknown;
12
13
  static fromWorker(input: any): Barcode;
13
14
  }
@@ -1,3 +1,30 @@
1
+ export declare enum SelectionOverlayTextFormat {
2
+ Text = "Text",
3
+ TextAndFormat = "TextAndFormat",
4
+ None = "None"
5
+ }
6
+ export declare class SelectionOverlayStyleConfiguration {
7
+ private defaultFillColor?;
8
+ private defaultHighlightedFillColor?;
9
+ polygonStrokeColor?: string;
10
+ polygonFillColor?: string;
11
+ highlightedPolygonStrokeColor?: string;
12
+ highlightedPolygonFillColor?: string;
13
+ textColor?: string;
14
+ textBackgroundColor?: string;
15
+ highlightedTextColor?: string;
16
+ highlightedTextBackgroundColor?: string;
17
+ }
1
18
  export declare class SelectionOverlayConfiguration {
2
19
  visible?: boolean;
20
+ /**
21
+ * Controls the format of the text displayed below the selection overlay. Defaults to just the code value
22
+ */
23
+ textFormat?: SelectionOverlayTextFormat;
24
+ /**
25
+ * Determines whether the selection overlay should be automatically selected
26
+ * (and when onBarcodeDetected is called) when a barcode is detected. Defaults to false
27
+ */
28
+ automaticSelectionEnabled?: boolean;
29
+ style?: SelectionOverlayStyleConfiguration;
3
30
  }
@@ -6,8 +6,8 @@ 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
+ static scaleListToHtmlElement(points: Point[], original: ImageData, html: HTMLElement): Point[];
10
+ static scaleToHtmlElement(point: Point, original: ImageData, html: HTMLElement): Point;
11
11
  static scaleUpTo(pt: Point, size: Size): Point;
12
12
  static scaleDownTo(pt: Point, size: Size): Point;
13
13
  static fromHtmlElement(element: HTMLElement): Point;
@@ -16,4 +16,13 @@ export declare class Point {
16
16
  static centerOf(points: Point[]): Point;
17
17
  static smallerSizeOfQuad(points: Point[]): number;
18
18
  static empty(): Point;
19
+ static centerX(points: Point[]): number;
20
+ static highestX(points: Point[]): number;
21
+ static lowestX(points?: Point[]): number;
22
+ static lowestY(points: Point[]): number;
23
+ static highestY(points: Point[]): number;
24
+ static width(points: Point[]): number;
25
+ static left(points: Point[]): any;
26
+ static right(points: Point[]): any;
27
+ static toSvgString(points: Point[]): string;
19
28
  }
@@ -1,10 +1,7 @@
1
1
  import React, { ReactNode } from "react";
2
- import BarcodeSelectionOverlay from "../barcode-polygon/barcode-selection-overlay";
3
2
  import { BarcodeResult } from "../../model/barcode/barcode-result";
4
3
  export default class ScannedImageWithOverlay extends React.Component<any, any> {
5
4
  image: HTMLImageElement | undefined;
6
- polygons: BarcodeSelectionOverlay[];
7
- overlay: BarcodeSelectionOverlay;
8
5
  constructor(props: any);
9
6
  update(result: BarcodeResult): void;
10
7
  reset(): void;
@@ -1,11 +1,25 @@
1
1
  import React from "react";
2
- import BarcodeSelectionOverlay from "./barcode-selection-overlay";
3
2
  import ScanbotCameraView from "../scanbot-camera-view";
4
- import { ImageDataWrapper } from "../../model/image-data-wrapper";
5
3
  import { Barcode } from "../../model/barcode/barcode";
6
- export default class AnimatedBarcodeSelectionOverlay extends React.Component<any, any> {
7
- overlay: BarcodeSelectionOverlay | undefined;
4
+ import { BarcodeOverlay } from "./barcode-overlay";
5
+ import BarcodePolygon from "./barocode-polygon";
6
+ import BarcodePolygonLabel from "./barcode-polygon-label";
7
+ import { SelectionOverlayConfiguration } from "../../model/configuration/selection-overlay-configuration";
8
+ export declare class BarcodePolygonElement {
9
+ element: BarcodeOverlay;
10
+ updatedAt?: number;
11
+ polygon: JSX.Element;
12
+ label: JSX.Element;
13
+ polygonRef?: BarcodePolygon;
14
+ labelRef?: BarcodePolygonLabel;
15
+ }
16
+ export declare class SelectionOverlayProps {
17
+ configuration?: SelectionOverlayConfiguration;
18
+ onPolygonClick?: (code: Barcode) => void;
19
+ }
20
+ export default class AnimatedBarcodeSelectionOverlay extends React.Component<SelectionOverlayProps, any> {
8
21
  constructor(props: any);
9
- update(finderRect: DOMRect, camera: ScanbotCameraView, imageData: ImageDataWrapper, container: any, codes: Barcode[]): void;
22
+ update(finderRect: DOMRect, camera: ScanbotCameraView, imageData: ImageData, container: any, codes: Barcode[]): void;
23
+ onPolygonClick(view: BarcodePolygon, model: BarcodeOverlay): void;
10
24
  render(): React.ReactNode;
11
25
  }
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { BarcodeOverlay } from "./barcode-overlay";
3
+ import { Point } from "../../utils/dto/Point";
4
+ import { SelectionOverlayConfiguration, SelectionOverlayTextFormat } from "../../model/configuration/selection-overlay-configuration";
5
+ import { Barcode } from "../../model/barcode/barcode";
6
+ export declare class BarcodePolygonLabelProps {
7
+ element: BarcodeOverlay;
8
+ configuration: SelectionOverlayConfiguration;
9
+ animateToPoints?: Point[];
10
+ }
11
+ export default class BarcodePolygonLabel extends React.Component<BarcodePolygonLabelProps, any> {
12
+ constructor(props: any);
13
+ update(model: BarcodeOverlay): void;
14
+ label: HTMLDivElement;
15
+ formatText(code: Barcode, format: SelectionOverlayTextFormat): string;
16
+ render(): React.ReactNode;
17
+ }
@@ -1,10 +1,15 @@
1
1
  import React from "react";
2
+ import { Point } from "../../utils/dto/Point";
2
3
  import { BarcodeOverlay } from "./barcode-overlay";
4
+ import { SelectionOverlayConfiguration } from "../../model/configuration/selection-overlay-configuration";
3
5
  export declare class BarcodePolygonProps {
4
6
  element: BarcodeOverlay;
5
- onClick?: (e: any, element: BarcodeOverlay) => void;
7
+ configuration: SelectionOverlayConfiguration;
8
+ animateToPoints?: Point[];
9
+ onClick?: (polygon: BarcodePolygon, element: BarcodeOverlay) => void;
6
10
  }
7
11
  export default class BarcodePolygon extends React.Component<BarcodePolygonProps, any> {
8
- updatedAt: number;
12
+ constructor(props: any);
13
+ update(model: BarcodeOverlay): void;
9
14
  render(): React.ReactNode;
10
15
  }
@@ -1,17 +1,9 @@
1
- import { DocumentPolygon } from "./document-polygon";
2
1
  import React from "react";
2
+ import DocumentPolygon from "./document-polygon";
3
3
  export declare class AnimatedDocumentPolygon extends React.Component<any, any> {
4
- PULL_FORCE: number;
5
- MIN_SPEED: number;
6
- overlayPolygonCurrent: any[];
7
- overlayPolygonTarget: any[];
8
- animationLastTime: number | null;
9
4
  polygon: DocumentPolygon;
10
- container: HTMLDivElement;
11
- constructor(props: any);
12
- animate(currentTime: number): void;
13
- calculateOffset(currentTime: number, f: any, t: any, axis: "x" | "y"): number;
14
- absMin(a: number, b: number): number;
15
- absMax(a: number, b: number): number;
5
+ previous: any[];
6
+ testComponent: React.RefObject<any>;
16
7
  render(): JSX.Element;
8
+ update(points: any[], isOk: boolean, isVisible: boolean): void;
17
9
  }
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export declare class DocumentLineQuad extends React.Component<any, any> {
3
+ LINE_COUNT: number;
4
+ static CLASSNAME: string;
5
+ render(): JSX.Element;
6
+ fill(): SVGLineElement[];
7
+ setFrame(): void;
8
+ }
@@ -1,8 +1,11 @@
1
1
  import React from "react";
2
- export declare class DocumentPolygon extends React.Component<any, any> {
3
- LINE_COUNT: number;
4
- static CLASSNAME: string;
5
- render(): JSX.Element;
6
- fill(): SVGLineElement[];
7
- setFrame(): void;
2
+ import { Point } from "../../utils/dto/Point";
3
+ declare class DocumentPolygon extends React.Component<any, any> {
4
+ polygon: SVGPolygonElement;
5
+ latestValidPoints: Point[];
6
+ constructor(props: any);
7
+ update(points: Point[], animatedPoints: Point[], isOk: boolean, isVisible: boolean): void;
8
+ pointStringOrLatestValidPoints(points: Point[]): string;
9
+ render(): React.ReactNode;
8
10
  }
11
+ export default DocumentPolygon;
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
- import { DocumentPolygon } from "./document-polygon";
2
+ import { DocumentLineQuad } from "./document-line-quad";
3
3
  import { DraggableHandlesComponent } from "../cropping/draggable-handles-component";
4
4
  export declare class DraggableDocumentPolygon extends React.Component<any, any> {
5
5
  handles: DraggableHandlesComponent;
6
- polygon: DocumentPolygon;
6
+ polygon: DocumentLineQuad;
7
7
  constructor(props: any);
8
8
  render(): JSX.Element;
9
9
  setFrame(): void;
package/README.md CHANGED
@@ -33,7 +33,7 @@ like [Code 39](https://scanbot.io/products/barcode-software/1d-barcode-scanner/c
33
33
  [PDF-417](https://scanbot.io/products/barcode-software/2d-barcode-scanner/pdf417/),
34
34
  [Data Matrix](https://scanbot.io/products/barcode-software/2d-barcode-scanner/data-matrix/), etc.
35
35
 
36
- Check out our [live demo](https://scanbot.io/trial/demo-web/).
36
+ Check out our [live demo](https://scanbot.io/trial/demo-web/barcode-demo/).
37
37
 
38
38
 
39
39
  # Document Scanner for the Web