scanbot-web-sdk 2.10.0 → 2.11.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.
@@ -10,6 +10,7 @@ export declare class BarcodeScannerState extends ScanbotCameraState {
10
10
  export default class BarcodeScannerView extends ScannerView<BarcodeScannerProps, BarcodeScannerState> {
11
11
  finder?: ViewFinder;
12
12
  shouldComputeSize: boolean;
13
+ private _configuration;
13
14
  private paused;
14
15
  constructor(props: BarcodeScannerProps);
15
16
  get configuration(): BarcodeScannerConfiguration;
@@ -44,6 +44,7 @@ export default class CroppingView extends React.Component<CroppingViewProps, Cro
44
44
  polygon: DraggableDocumentPolygon | null;
45
45
  container: Animatable;
46
46
  htmlImage: HTMLImageElement;
47
+ private _configuration?;
47
48
  constructor(props: any);
48
49
  /**
49
50
  * Public API functions
@@ -18,6 +18,7 @@ export default class DocumentScannerView extends ScannerView<DocumentScannerProp
18
18
  button: ShutterButton | null;
19
19
  polygonMovementPredicate: PolygonMovementPredicate;
20
20
  autoCaptureToken: any;
21
+ private _configuration?;
21
22
  constructor(props: ScanbotCameraProps);
22
23
  get defaultAction(): ShutterButtonAction;
23
24
  get enabled(): boolean;
package/@types/index.d.ts CHANGED
@@ -29,6 +29,8 @@ import { Barcode } from "./model/barcode/barcode";
29
29
 
30
30
  import { InitializationOptions } from "./model/configuration/initialization-options";
31
31
  import { LicenseInfo } from "./model/response/license-info";
32
+ import { CameraInfo } from "./model/camera-info";
33
+
32
34
 
33
35
  export {
34
36
  IDocumentScannerHandle,
@@ -67,4 +69,6 @@ export {
67
69
  Polygon,
68
70
  Barcode,
69
71
  LicenseInfo,
72
+
73
+ CameraInfo,
70
74
  }
@@ -1,4 +1,7 @@
1
+ import { CameraInfo } from "../model/camera-info";
1
2
  export interface IScannerCommon {
2
3
  swapCameraFacing(force?: boolean): void;
4
+ fetchAvailableCameras(): Promise<CameraInfo[]>;
5
+ switchCamera(deviceId: string, mirrored?: boolean): void;
3
6
  dispose(): void;
4
7
  }
@@ -0,0 +1,4 @@
1
+ export interface CameraInfo {
2
+ deviceId: string;
3
+ label: string;
4
+ }
@@ -2,7 +2,7 @@ export interface WindowStyleConfiguration {
2
2
  width?: string;
3
3
  height?: string;
4
4
  aspectRatio?: number;
5
- paddingPropLeft?: number;
5
+ widthProportion?: number;
6
6
  borderColor?: string;
7
7
  left?: string;
8
8
  top?: string;
@@ -1,9 +1,10 @@
1
1
  export declare class MediaError extends Error {
2
2
  name: MediaErrorType;
3
3
  private constructor();
4
- static notAvailable(message: string): MediaError;
5
- static permissionError(message: string): MediaError;
6
- static unsupportedMediaDevices(message: string): MediaError;
7
- static unknownError(message: string): MediaError;
4
+ static notAvailable(message?: string): MediaError;
5
+ static permissionError(message?: string): MediaError;
6
+ static unsupportedMediaDevices(message?: string): MediaError;
7
+ static unsupportedOperationError(message?: string): MediaError;
8
+ static unknownError(message?: string): MediaError;
8
9
  }
9
- export declare type MediaErrorType = 'MediaNotAvailableError' | 'MediaPermissionError' | 'UnsupportedMediaDevicesError' | 'UnknownError';
10
+ export declare type MediaErrorType = 'MediaNotAvailableError' | 'MediaPermissionError' | 'UnsupportedMediaDevicesError' | 'UnsupportedOperationError' | 'UnknownError';
@@ -14,6 +14,7 @@ export default class MrzScannerView extends ScannerView<MrzScannerProps, MrzScan
14
14
  finder?: ViewFinder;
15
15
  shouldComputeSize: boolean;
16
16
  private paused;
17
+ private _configuration?;
17
18
  constructor(props: MrzScannerProps);
18
19
  get configuration(): MrzScannerConfiguration;
19
20
  get enabled(): boolean;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { ScannerConfiguration } from "./model/configuration/scanner-configuration";
3
3
  import ScanbotCameraView from "./view/scanbot-camera-view";
4
+ import { CameraInfo } from "./model/camera-info";
4
5
  export declare class ScanbotCameraProps {
5
6
  configuration: ScannerConfiguration;
6
7
  container?: HTMLElement;
@@ -25,4 +26,6 @@ export declare abstract class ScannerView<P extends ScanbotCameraProps, S extend
25
26
  onVideoReady: () => void;
26
27
  onVideoError: (err: Error) => void;
27
28
  swapCameraFacing(force?: boolean): void;
29
+ fetchAvailableCameras(): Promise<CameraInfo[]>;
30
+ switchCamera(deviceId: string, mirrored?: boolean): Promise<void>;
28
31
  }
@@ -14,6 +14,7 @@ export default class TextDataScannerView extends ScannerView<TextDataScannerProp
14
14
  finder?: ViewFinder;
15
15
  shouldComputeSize: boolean;
16
16
  private paused;
17
+ private _configuration?;
17
18
  constructor(props: TextDataScannerProps);
18
19
  get configuration(): TextDataScannerConfiguration;
19
20
  get enabled(): boolean;
@@ -1,6 +1,7 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  export interface VideoStreamProps {
3
3
  videoConstraints: any;
4
+ deviceId?: string;
4
5
  onReady: () => void;
5
6
  onStreamChanged: (stream: MediaStream) => void;
6
7
  onError: (err: Error) => void;
@@ -4,6 +4,7 @@ import { Size } from "../utils/dto/Size";
4
4
  import { Frame } from "../utils/dto/Frame";
5
5
  import { WindowStyleConfiguration } from "../model/configuration/window-style-configuration";
6
6
  import { ImageDataWrapper } from "../model/image-data-wrapper";
7
+ import { CameraInfo } from "../model/camera-info";
7
8
  export interface ScanbotCameraViewProps {
8
9
  windowConfiguration?: WindowStyleConfiguration;
9
10
  videoConstraints: MediaTrackConstraints;
@@ -14,6 +15,7 @@ export interface ScanbotCameraViewProps {
14
15
  export interface ScanbotCameraViewState {
15
16
  facingModeRear: boolean;
16
17
  mirrored: boolean;
18
+ deviceId: string;
17
19
  }
18
20
  export default class ScanbotCameraView extends React.Component<ScanbotCameraViewProps, ScanbotCameraViewState> {
19
21
  cutout?: Frame;
@@ -43,4 +45,6 @@ export default class ScanbotCameraView extends React.Component<ScanbotCameraView
43
45
  style(): React.CSSProperties;
44
46
  render(): JSX.Element;
45
47
  swapCameraFacing(force?: boolean): void;
48
+ fetchAvailableCameras(): Promise<CameraInfo[]>;
49
+ switchCamera(deviceId: string, mirrored?: boolean): Promise<void>;
46
50
  }