Interface IBarcodeScannerHandle

interface IBarcodeScannerHandle {
    dispose(): void;
    fetchAvailableCameras(): Promise<CameraInfo[]>;
    getActiveCameraInfo(): CameraInfo;
    getCapabilities(): MediaTrackCapabilities;
    getResolution(): Promise<Size>;
    isDetectionPaused(): boolean;
    pauseDetection(): void;
    resumeDetection(): void;
    saveExtractedImageData(): void;
    setFacingMode(mode): Promise<void>;
    setRecognitionResolution(resolution): void;
    setTorchState(state): Promise<void>;
    setZoom(zoom): void;
    switchCamera(deviceId, mirrored?): void;
    updateConfiguration(config): void;
    updateTorch(enabled): void;
}

Hierarchy

  • IFinderScannerHandle
    • IBarcodeScannerHandle

Methods

  • Returns void

  • Returns Promise<CameraInfo[]>

  • Returns CameraInfo

  • Returns MediaTrackCapabilities

  • Returns Promise<Size>

  • Returns boolean

  • Returns void

  • Returns void

  • Returns void

  • Parameters

    Returns Promise<void>

  • Parameters

    • resolution: number

    Returns void

  • Parameters

    • state: boolean

    Returns Promise<void>

  • Parameters

    • zoom: number

    Returns void

  • Parameters

    • deviceId: string
    • Optional mirrored: boolean

    Returns void

  • Parameters

    • config: {
          backgroundColor?: string;
          captureDelay?: number;
          container?: { accessKey?: string; readonly accessKeyLabel?: string; autocapitalize?: string; dir?: string; draggable?: boolean; hidden?: boolean; inert?: boolean; innerText?: string; lang?: string; readonly offsetHeight?: number; ... 288 more ...; focus?: (options?: FocusOptions) => void; };
          containerId?: string;
          desiredRecognitionResolution?: number;
          enable4kStream?: boolean;
          finder?: {
              aspectRatio?: { readonly width?: number; readonly height?: number; };
              minimumInsets?: { top?: number; left?: number; bottom?: number; right?: number; };
              overlayColor?: string;
              preferredHeight?: number;
              style?: ({ strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) & {
                  _type: "FinderCorneredStyle";
              } | ({ strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) & {
                  _type: "FinderStrokedStyle";
              };
              visible?: boolean;
          } & {
              _type: "ViewFinderConfiguration";
          } | {
              aspectRatio?: { readonly width?: number; readonly height?: number; };
              minimumInsets?: { top?: number; left?: number; bottom?: number; right?: number; };
              overlayColor?: string;
              preferredHeight?: number;
              style?: ({ strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) & {
                  _type: "FinderCorneredStyle";
              } | ({ strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) & {
                  _type: "FinderStrokedStyle";
              };
          } & {
              _type: "PermanentViewFinderConfiguration";
          };
          fpsLimit?: number;
          mirrored?: boolean;
          onBarcodesDetected?: ((e) => void);
          onError?: ((e) => void);
          overlay?: { visible?: boolean; textFormat?: SelectionOverlayTextFormat; automaticSelectionEnabled?: boolean; countingRepeatDelay?: number; style?: { polygonStrokeColor?: string; ... 10 more ...; highlightedTextBackgroundColor?: string; }; onBarcodeFound?: (code: BarcodeItem, polygon: IBarcodePolygonHandle, label: IBarcodePoly...;
          preferredCamera?: string;
          previewMode?: "FIT_IN" | "FILL_IN";
          scannerConfiguration?: Omit<DeepPartial<BarcodeScannerConfiguration>, "live">;
          spinnerColor?: string;
          userGuidance?: { visible?: boolean; title?: { visible?: boolean; text?: string; color?: string; useShadow?: boolean; }; background?: { strokeColor?: string; fillColor?: string; strokeWidth?: number; }; };
          videoConstraints?: any;
          zoom?: number;
      }
      • Optional backgroundColor?: string
      • Optional captureDelay?: number

        Capture delay in milliseconds after detecting barcodes. Defaults to 1000

      • Optional container?: { accessKey?: string; readonly accessKeyLabel?: string; autocapitalize?: string; dir?: string; draggable?: boolean; hidden?: boolean; inert?: boolean; innerText?: string; lang?: string; readonly offsetHeight?: number; ... 288 more ...; focus?: (options?: FocusOptions) => void; }

        The container HTML element of Scanbot Web SDK camera. Required when 'containerId' property is left undefined when calling any ScanbotSDK createScanner function. If both are provided, 'container' property takes precedence.

      • Optional containerId?: string

        The container HTML element id of Scanbot Web SDK camera. Required when 'container' property is left undefined when calling any ScanbotSDK createScanner function If both are provided, 'container' property takes precedence.

      • Optional desiredRecognitionResolution?: number

        If set, limit the resolution of the image that is used for barcode recognition. A lower value will result in faster processing times but may reduce recognition quality.

      • Optional enable4kStream?: boolean

        Determines whether the scanner should use the 4K video stream. This will enhance the recognition quality, but will also increase the CPU load and memory consumption.Should be enabled on devices that can handle the increased load. If the device does not support 4K, it will fall back to the highest available resolution. This setting overrides videoConstraints width and height settings. Defaults to false

      • Optional finder?: {
            aspectRatio?: { readonly width?: number; readonly height?: number; };
            minimumInsets?: { top?: number; left?: number; bottom?: number; right?: number; };
            overlayColor?: string;
            preferredHeight?: number;
            style?: ({ strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) & {
                _type: "FinderCorneredStyle";
            } | ({ strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) & {
                _type: "FinderStrokedStyle";
            };
            visible?: boolean;
        } & {
            _type: "ViewFinderConfiguration";
        } | {
            aspectRatio?: { readonly width?: number; readonly height?: number; };
            minimumInsets?: { top?: number; left?: number; bottom?: number; right?: number; };
            overlayColor?: string;
            preferredHeight?: number;
            style?: ({ strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) & {
                _type: "FinderCorneredStyle";
            } | ({ strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) & {
                _type: "FinderStrokedStyle";
            };
        } & {
            _type: "PermanentViewFinderConfiguration";
        }
      • Optional fpsLimit?: number

        The rate of detections/recognitions per second in normal performance mode. If the number is equal or greater than the video frame rate, no frames will be skipped. A lower value will result in improved overall performance on lower-end devices, but may reduce recognition speed. In seconds. Defaults to 60.

      • Optional mirrored?: boolean
      • Optional onBarcodesDetected?: ((e) => void)
      • Optional onError?: ((e) => void)
          • (e): void
          • Error callback of the SDK. If any error was reported, your scanner might not be scanning anymore, e.g. due to an out-of-memory error.

            Parameters

            • e: any

            Returns void

      • Optional overlay?: { visible?: boolean; textFormat?: SelectionOverlayTextFormat; automaticSelectionEnabled?: boolean; countingRepeatDelay?: number; style?: { polygonStrokeColor?: string; ... 10 more ...; highlightedTextBackgroundColor?: string; }; onBarcodeFound?: (code: BarcodeItem, polygon: IBarcodePolygonHandle, label: IBarcodePoly...
      • Optional preferredCamera?: string

        Camera id or camera label. A list of available cameras can be obtained from ScanbotSDK.cameras.

      • Optional previewMode?: "FIT_IN" | "FILL_IN"

        In FIT_IN – Fits the entire preview (camera) frame into the view. If aspect ratio does not fit, will contain black edges

      • Optional scannerConfiguration?: Omit<DeepPartial<BarcodeScannerConfiguration>, "live">
      • Optional spinnerColor?: string
      • Optional userGuidance?: { visible?: boolean; title?: { visible?: boolean; text?: string; color?: string; useShadow?: boolean; }; background?: { strokeColor?: string; fillColor?: string; strokeWidth?: number; }; }
      • Optional videoConstraints?: any

        ScanbotCameraView video constraints

      • Optional zoom?: number

        Digital zoom level of the video stream. Defaults to 1.0. Please note that this is not the same as the optical zoom of the camera.

    Returns void

  • Parameters

    • enabled: boolean

    Returns void

Generated using TypeDoc