UNPKG

@scandit/web-datacapture-core

Version:

Scandit Data Capture SDK for the Web

1,575 lines 66.9 kB
/// <reference types="emscripten" />
import { a as Camera, D as DeviceCamera, l as CameraSettings, b as CameraPosition, g as FrameSource, f as FrameSourceJSON } from './Camera-DhGjpcjv.js';
import { DataCaptureContextSettingsJSON, DataCaptureContextSettings } from './DataCaptureContextSettings.js';
import { MarginsWithUnitJSON, MarginsWithUnit } from './commons/MarginsWithUnit.js';
import { PointWithUnitJSON, PointWithUnit } from './commons/PointWithUnit.js';
import { Anchor } from './commons/Anchor.js';
import { Orientation } from './commons/Orientation.js';
import { Point, PointJSON } from './commons/Point.js';
import { Quadrilateral } from './commons/Quadrilateral.js';
import { Size } from './commons/Size.js';
import { LogoStyle, FocusGestureJSON, ZoomGestureJSON, FocusGesture, ZoomGesture } from './DataCaptureViewPlusRelated.js';
import { NotificationPresenter } from './NotificationPresenter/NotificationPresenter.js';
import { Serializable } from './private/Serializable.js';
import { DidTapCustomLocationsViewListener, StateToRender, StateToRenderDomView } from './private/CustomLocationsView.js';
import { nativeHandle } from './private/nativeHandle.js';
import { AnchorPositions } from './private/AnchorPositions.js';
import { JSONType } from './commons/JSONType.js';
import { OpenSourceSoftwareLicenseInfo } from './license/OpenSourceSoftwareLicenseInfo.js';
import { Logger } from './logger.js';
import { ColorType } from './private/FrameReaders/ColorType.js';
import { RectJSON, Rect } from './commons/Rect.js';
import { ProgressInfo } from './LoadingStatus.js';
import { ScanditIcon } from './ScanditIcon.js';
import { ScanditHTMLElement } from './private/utils/ScanditHTMLElement.js';
import { ImagePlane, ImageConverter_statics, ImageConverterInstance } from './private/djinni-types/index.js';
import { HTMLElementStateJSON } from './private/HtmlElementState.js';
import { AsyncStateMachine } from './private/utils/AsyncStateMachine.js';
import { Optional, MethodSignature } from './tsHelper.js';

type ControlType = "camera-fov" | "camera" | "shutter" | "torch";
interface SerializedControl {
    type: ControlType;
}
interface PrivateBaseControl {
    install: (view: DataCaptureView$1) => Promise<boolean>;
    remove: (definitiveRemoval?: boolean) => void;
    update?: (view: DataCaptureView$1) => void;
}
interface Control extends Serializable<SerializedControl> {
}
interface PrivateControl extends Control, PrivateBaseControl {
    view: DataCaptureView$1 | null;
}

interface DataCaptureOverlay extends Serializable {
    [nativeHandle]?: {
        className: string;
        id: number;
    };
    toJSONObject: () => any;
}
interface DataCaptureViewListener {
    didChangeSize?: (view: DataCaptureView$1, size: Size, orientation: Orientation) => void;
}
interface DataCaptureViewJSON {
    scanAreaMargins: MarginsWithUnitJSON;
    pointOfInterest: PointWithUnitJSON;
    logoAnchor: Anchor;
    logoOffset: PointWithUnitJSON;
    logoHidden: boolean;
    logoStyle: LogoStyle;
    overlays: ReturnType<DataCaptureOverlay["toJSONObject"]>[];
    controls: ReturnType<Control["toJSONObject"]>[];
    focusGesture: FocusGestureJSON | null;
    zoomGesture: ZoomGestureJSON | null;
}
interface DataCaptureViewConnectOptions {
    camera?: Camera;
}
declare class DataCaptureView$1 implements Serializable<DataCaptureViewJSON> {
    focusGesture: FocusGesture | null;
    zoomGesture: ZoomGesture | null;
    private _scanAreaMargins;
    private _pointOfInterest;
    private _logoStyle;
    private _logoAnchor;
    private _logoOffset;
    private _context;
    private readonly overlays;
    private readonly controls;
    private gestureRecognizer;
    private containerElement;
    private cameraPaintboardElement?;
    private singleImageUploaderPaintboardElement?;
    private frameSourceListener;
    private _previewCamera;
    private get videoElement();
    private visibilityListener;
    private cameraRecoveryListener;
    private controlsElement;
    private cameraRecoveryElement;
    private errorElement;
    private canvasElement;
    private frozenFrame;
    private frozenFrameCanvas;
    private _canvasDrawer;
    private readonly listeners;
    private htmlElement?;
    private htmlElementState?;
    private lastHtmlElementState;
    private isVideoElementDetached;
    private loadingOverlay;
    private customLocationsView;
    private lastFrameSourceState;
    private singleImageUploaderView;
    private orientation;
    private hiddenProperties;
    private orientationObserver;
    private onOrientationChangeListener;
    private hintPresenter;
    private onHintPresenterUpdateHandler;
    private onBeforeShowToastsHandler;
    private onWorkerMessageHandler;
    private localizationSubscription?;
    private htmlElementDidChangeHandler;
    private htmlElementDisconnectedHandler;
    private notificationPresenter;
    constructor();
    get scanAreaMargins(): MarginsWithUnit;
    set scanAreaMargins(margins: MarginsWithUnit);
    get pointOfInterest(): PointWithUnit;
    set pointOfInterest(pointOfInterest: PointWithUnit);
    get logoStyle(): LogoStyle;
    set logoStyle(logoStyle: LogoStyle);
    get logoAnchor(): Anchor;
    set logoAnchor(logoAnchor: Anchor);
    get logoOffset(): PointWithUnit;
    set logoOffset(logoOffset: PointWithUnit);
    private get cameraRecoveryText();
    private get width();
    private get height();
    private get canvasDrawer();
    /**
     * The current context as a PrivateDataCaptureContext
     */
    private get privateContext();
    static forContext(context: DataCaptureContext | null): Promise<DataCaptureView$1>;
    showProgressBar(): void;
    hideProgressBar(): void;
    setProgressBarPercentage(percentage: number | null): void;
    setProgressBarMessage(message: string): void;
    getContext(): DataCaptureContext | null;
    setContext(context: DataCaptureContext | null): Promise<void>;
    connectToElement(element: HTMLElement, options?: DataCaptureViewConnectOptions): void;
    detachFromElement(): void;
    addOverlay(overlay: DataCaptureOverlay): Promise<void>;
    removeOverlay(overlay: DataCaptureOverlay): Promise<void>;
    addListener(listener: DataCaptureViewListener): void;
    removeListener(listener: DataCaptureViewListener): void;
    /**
     * Converts a point in the coordinate system of the last visible frame and maps it to a coordinate in the view.
     * It does *not* take into account if the frameSource is mirrored.
     */
    viewPointForFramePoint(point: Point): Point;
    viewQuadrilateralForFrameQuadrilateral(quadrilateral: Quadrilateral): Quadrilateral;
    addControl(control: Control): void;
    removeControl(control: Control): void;
    toJSONObject(): DataCaptureViewJSON;
    isCameraRecoveryVisible(): boolean;
    setCameraRecoveryVisible(visible: boolean): void;
    allowPictureInPicture(allow: boolean): Promise<void>;
    protected viewAnchorPositionsForFrameAnchorPositions(anchorPositions: AnchorPositions): AnchorPositions;
    protected setDidTapCustomLocationsViewListener(didTapViewListener: DidTapCustomLocationsViewListener): void;
    protected renderCustomLocationsView(state: StateToRender | StateToRenderDomView): void;
    getNotificationPresenter(): NotificationPresenter;
    private removeStyles;
    private onHintPresenterUpdate;
    private clearHtmlElementContent;
    private setupHtmlElement;
    private setupHtmlElementSingleImageUploader;
    private setupHtmlElementVisibility;
    private createStyles;
    private onOrientationChange;
    private htmlElementDidChange;
    private htmlElementDisconnected;
    private handleVideoDisplay;
    private isCanvasDrawerWithMetrics;
    private onWorkerMessage;
    private onBeforeShowToasts;
    private drawEngineCommands;
    private displayError;
    private clearError;
    private updateControls;
    private onFrameSourceChange;
    private onCameraStateChanged;
    private setVideoElementOpacity;
    private onSingleImageUploaderSettingsChange;
    private setHiddenProperty;
    private onVisibilityChange;
    private cameraRecovery;
    private freezeFrame;
    private unfreezeFrame;
}

interface FrameData {
    readonly width: number;
    readonly height: number;
    readonly isFrameSourceMirrored: boolean;
    toBlob(type?: string, quality?: number): Promise<Blob | null>;
    getData(): Promise<Uint8ClampedArray | null>;
}
type PrivateLoadableFrameData = Omit<FrameData, "getData" | "toBlob"> & {
    frameId: number;
};
/**
 * Adds some function to the passed frame data object to let the user load the frame data.
 */
declare function convertToPublicFrameData(loadableFrameData: PrivateLoadableFrameData, context: DataCaptureContext): FrameData;

interface ModuleLoader {
    moduleName: string;
    load(options: ModuleLoaderOptions): Promise<any>;
}

/**
 * MESSAGES (ACTIONS) SENT TO THE WORKER
 */
type DataCaptureActionMessageKey = "convertToJPEGResult" | "createContext" | "deleteFrameData" | "dispose" | "documentVisibility" | "extractCentaurusLicense" | "flushAnalytics" | "isFeatureSupported" | "loadLibrary" | "onTap" | "processFrame" | "reportCameraProperties" | "requestFrameData" | "setFrameSource" | "setLogLevel" | "updateContext" | "hintPresenterV2update" | "getViewfinderInfo" | "getOpenSourceSoftwareLicenseInfo" | "addNativeOverlay" | "removeNativeOverlay";
interface ExtractCentaurusLicenseResponse {
    centaurus: {
        licenseKey: string;
    };
}
type RequestFrameDataResponse = {
    data: Uint8ClampedArray;
    colorType: ColorType;
} | {
    data: null;
    colorType: null;
};
interface IsFeatureSupportedResponse {
    supported: boolean;
}
interface GetViewfinderInfo {
    isDisplayingViewfinder: boolean;
    rect: RectJSON;
}
interface GetOpenSourceSoftwareLicenseInfoResponse {
    licenseText: string;
}
type WorkerResponse<C> = C extends "processFrame" ? ProcessFrameParameters : C extends "extractCentaurusLicense" ? ExtractCentaurusLicenseResponse : C extends "requestFrameData" ? RequestFrameDataResponse : C extends "isFeatureSupported" ? IsFeatureSupportedResponse : C extends "getViewfinderInfo" ? GetViewfinderInfo : C extends "getOpenSourceSoftwareLicenseInfo" ? GetOpenSourceSoftwareLicenseInfoResponse : undefined;
interface DataCaptureActionMessage {
    command: DataCaptureActionMessageKey;
    id: number;
}
type LoadLibraryDataCaptureAction = DataCaptureActionMessage & LoadLibraryParameters & {
    command: "loadLibrary";
};
type ConvertToJPEGResultDataCaptureAction = DataCaptureActionMessage & {
    command: "convertToJPEGResult";
    imageId: number;
    result: Uint8Array;
};
type CreateContextDataCaptureAction = CreateContextParameters & DataCaptureActionMessage & {
    command: "createContext";
};
type SetFrameSourceDataCaptureAction = DataCaptureActionMessage & SetFrameSourceParameters & {
    command: "setFrameSource";
};
type ProcessFrameDataCaptureAction = DataCaptureActionMessage & ProcessFrameParameters & {
    command: "processFrame";
};
type RequestFrameDataDataCaptureAction = DataCaptureActionMessage & {
    command: "requestFrameData";
    frameId: number;
};
type DeleteFrameDataDataCaptureAction = DataCaptureActionMessage & {
    command: "deleteFrameData";
    frameId: number;
};
type VisibilityChangeAction = DataCaptureActionMessage & {
    command: "documentVisibility";
    state: DocumentVisibilityState;
};
type IsFeatureSupportedAction = DataCaptureActionMessage & {
    command: "isFeatureSupported";
    feature: LicensedFeature;
};
type UpdateContextDataCaptureAction = DataCaptureActionMessage & {
    command: "updateContext";
    context: DataCaptureContextJSON;
    view: UpdateContextParameters["view"];
};
type DisposeDataCaptureAction = DataCaptureActionMessage & {
    command: "dispose";
};
type FlushAnalyticsDataCaptureAction = DataCaptureActionMessage & {
    command: "flushAnalytics";
};
type ReportCameraPropertiesDataCaptureAction = DataCaptureActionMessage & ReportCameraPropertiesParameters & {
    command: "reportCameraProperties";
};
type SetLogLevelDataCaptureAction = DataCaptureActionMessage & {
    command: "setLogLevel";
    level: Logger.Level;
};
type ExtractCentaurusLicenseDataCaptureAction = DataCaptureActionMessage & {
    command: "extractCentaurusLicense";
    licenseKey: string;
};
type OnTapAction = DataCaptureActionMessage & {
    command: "onTap";
    point: PointJSON;
};
type HintPresenterV2updateAction = DataCaptureActionMessage & {
    command: "hintPresenterV2update";
};
type GetViewfinderInfoAction = DataCaptureActionMessage & {
    command: "getViewfinderInfo";
};
type GetOpenSourceSoftwareLicenseInfoAction = DataCaptureActionMessage & {
    command: "getOpenSourceSoftwareLicenseInfo";
};
type AddNativeOverlayAction = DataCaptureActionMessage & {
    command: "addNativeOverlay";
    overlayHandle: {
        className: string;
        id: number;
    };
};
type RemoveNativeOverlayAction = DataCaptureActionMessage & {
    command: "removeNativeOverlay";
    overlayHandle: {
        className: string;
        id: number;
    };
};
type AnyDataCaptureActionMessage = ConvertToJPEGResultDataCaptureAction | CreateContextDataCaptureAction | DeleteFrameDataDataCaptureAction | DisposeDataCaptureAction | ExtractCentaurusLicenseDataCaptureAction | FlushAnalyticsDataCaptureAction | IsFeatureSupportedAction | LoadLibraryDataCaptureAction | OnTapAction | ProcessFrameDataCaptureAction | ReportCameraPropertiesDataCaptureAction | RequestFrameDataDataCaptureAction | SetFrameSourceDataCaptureAction | SetLogLevelDataCaptureAction | UpdateContextDataCaptureAction | VisibilityChangeAction | HintPresenterV2updateAction | GetViewfinderInfoAction | GetOpenSourceSoftwareLicenseInfoAction | AddNativeOverlayAction | RemoveNativeOverlayAction;
/**
 * MESSAGES EMITTED BY THE WORKER
 */
type DataCaptureCallbackMessageKeys = "contextDidChangeStatus" | "didStartObservingContext" | "draw" | "hideHint" | "isFeatureSupported" | "loadLibraryProgress" | "performanceMetricsReport" | "showHint" | "successFeedback" | "updateHint" | "workerTaskId" | "onFrameProcessingStarted" | "onFrameProcessingFinished" | "onFrameSkipped" | "showToast" | "hideToast" | "showGuidance" | "hideGuidance" | "startUpdateTimer" | "stopUpdateTimer" | "setViewfinderRect";
interface BaseDataCaptureCallbackMessage {
    type: DataCaptureCallbackMessageKeys;
}
interface LoadLibraryProgressMessage {
    type: "loadLibraryProgress";
    payload: ProgressInfo;
}
interface ConsoleWorkerMessage {
    type: "console";
    payload: string;
}
interface ConvertToJPEGMessage {
    type: "convertToJPEG";
    imageId: number;
    width: number;
    height: number;
    data: Uint8Array;
    planes: ImagePlane[];
    orientation: number;
    quality: number;
}
interface WorkerTaskIdWorkerMessage extends BaseDataCaptureCallbackMessage {
    type: "workerTaskId";
    command: string;
    id: number;
    error?: unknown;
    payload?: unknown;
}
type DrawWorkerMessage = BaseDataCaptureCallbackMessage & {
    type: "draw";
    payload: Uint8Array;
};
type DidChangeStatusWorkerMessage = BaseDataCaptureCallbackMessage & {
    type: "contextDidChangeStatus";
    payload: ContextStatusJSON;
};
type StartObservingContextWorkerMessage = BaseDataCaptureCallbackMessage & {
    type: "didStartObservingContext";
};
type SuccessFeedbackWorkerMessage = BaseDataCaptureCallbackMessage & {
    type: "successFeedback";
};
type ShowHintWorkerMessage = BaseDataCaptureCallbackMessage & {
    type: "showHint";
    payload: {
        text: string;
        style: HintStyle;
    };
};
type UpdateHintWorkerMessage = BaseDataCaptureCallbackMessage & {
    type: "updateHint";
    payload: {
        style: HintStyle;
    };
};
type IsFeatureSupportedMessage = BaseDataCaptureCallbackMessage & {
    type: "isFeatureSupported";
    payload: {
        [key in LicensedFeature]: boolean;
    };
};
type HideHintWorkerMessage = BaseDataCaptureCallbackMessage & {
    type: "hideHint";
    payload: Record<string, never>;
};
type PerformanceMetricsReportMessage = BaseDataCaptureCallbackMessage & {
    type: "performanceMetricsReport";
    payload: PerformanceMetrics;
};
type DidTapTrackedBarcode = BaseDataCaptureCallbackMessage & {
    type: "didTapTrackedBarcode";
    payload: any;
};
type OnFrameProcessingStartedMessage = BaseDataCaptureCallbackMessage & {
    type: "onFrameProcessingStarted";
};
type OnFrameProcessingFinishedMessage = BaseDataCaptureCallbackMessage & {
    type: "onFrameProcessingFinished";
};
type OnFrameSkippedMessage = BaseDataCaptureCallbackMessage & {
    type: "onFrameSkipped";
};
type ShowToastMessage = BaseDataCaptureCallbackMessage & {
    type: "showToast";
    payload: GenericHint;
};
type HideToastMessage = BaseDataCaptureCallbackMessage & {
    type: "hideToast";
    payload: GenericHint;
};
type ShowGuidanceMessage = BaseDataCaptureCallbackMessage & {
    type: "showGuidance";
    payload: GenericHint;
};
type HideGuidanceMessage = BaseDataCaptureCallbackMessage & {
    type: "hideGuidance";
    payload: GenericHint;
};
type StartUpdateTimerMessage = BaseDataCaptureCallbackMessage & {
    type: "startUpdateTimer";
    payload: {
        duration: {
            unit: "ms";
            value: number;
        };
    };
};
type StopUpdateTimerMessage = BaseDataCaptureCallbackMessage & {
    type: "stopUpdateTimer";
};
type DataCaptureCallbackMessage = ConsoleWorkerMessage | ConvertToJPEGMessage | DidChangeStatusWorkerMessage | DrawWorkerMessage | HideHintWorkerMessage | IsFeatureSupportedMessage | LoadLibraryProgressMessage | PerformanceMetricsReportMessage | ShowHintWorkerMessage | StartObservingContextWorkerMessage | SuccessFeedbackWorkerMessage | UpdateHintWorkerMessage | WorkerTaskIdWorkerMessage | OnFrameProcessingStartedMessage | OnFrameProcessingFinishedMessage | OnFrameSkippedMessage | ShowToastMessage | HideToastMessage | ShowGuidanceMessage | HideGuidanceMessage | StartUpdateTimerMessage | StopUpdateTimerMessage;
/**
 * OTHERS
 */
type PayloadForCommand<A, C> = A extends {
    command: C;
} ? A : never;
interface DataCaptureWorker extends Omit<Worker, "postMessage"> {
    onmessage: ((this: Worker, event_: MessageEvent & {
        data: unknown;
    }) => void) | null;
    postMessage: <C extends AnyDataCaptureActionMessage["command"]>(message: PayloadForCommand<AnyDataCaptureActionMessage, C>, transfer?: Transferable[]) => void;
}
interface EmscriptenClassHandle<Self = EmscriptenClassHandle<unknown>> {
    clone: () => Self;
    delete: () => void;
    isDeleted: () => boolean;
    deleteLater: () => void;
    isAliasOf: () => Self;
}
interface DataCaptureContext$1 extends EmscriptenClassHandle {
    setCameraProperties: (deviceId: string, isFrontFacing: boolean, hasAutofocus: boolean) => void;
    addListener: (function_: unknown) => void;
    addFrameListener: (listener: unknown) => void;
    dispose: () => void;
    setFrameSource: (source: EmscriptenClassHandle) => void;
    flushAnalytics: () => void;
    isFeatureSupported: (feature: LicensedFeature) => boolean;
}
interface DataCaptureImageBufferFrameSource extends EmscriptenClassHandle {
    outputFrame: (address: number, width: number, height: number, format: unknown) => void;
}
interface GestureListener extends EmscriptenClassHandle<GestureListener> {
    onTap(point: string): void;
}
interface GestureRecognizer extends EmscriptenClassHandle {
    setGestureListener(gestureListener: GestureListener, flags: number): void;
}
interface DataCaptureView extends EmscriptenClassHandle {
    setViewSize: (w: number, h: number, orientation: Orientation) => void;
    setNeedsRedrawDelegate: (delegate: unknown) => void;
    draw: () => void;
    getDrawCommands: () => Uint8Array;
    isViewRefreshHandlerSet: boolean;
    hintPresenterInitialized: () => boolean;
    setHintPresenter: (hintPresenter: unknown) => void;
    setHintPresenterV2: (hintPresenterV2: HintPresenterV2) => void;
    setGestureRecognizer: (recognizer: GestureRecognizer) => void;
    isDisplayingViewfinder: () => boolean;
    getViewfinderRect: () => string;
    addOverlay: (overlay: EmscriptenClassHandle) => void;
    removeOverlay: (overlay: EmscriptenClassHandle) => void;
}
interface JSONParseable extends EmscriptenClassHandle {
    toJson: () => string;
}
interface DataCaptureContextDeserializerResult extends EmscriptenClassHandle {
    getContext: () => DataCaptureContext$1;
    getView: () => DataCaptureView | undefined;
}
interface DataCaptureContextDeserializer extends EmscriptenClassHandle {
    contextFromJson: (json: string) => DataCaptureContextDeserializerResult | null;
    updateContextFromJson: (context: DataCaptureContext$1, view: DataCaptureView | undefined, json: string) => DataCaptureContextDeserializerResult | null;
    getLastError: () => string;
}
interface CaptureModeDeserializerInstance extends EmscriptenClassHandle {
    setListener: (listener: unknown) => void;
}
interface ModuleMirrorAxis {
    None: unknown;
    X: unknown;
    Y: unknown;
}
interface Vector<T = unknown> {
    push_back: (element: unknown) => void;
    get: (index: number) => T;
    size: () => number;
}
interface WasmFrameData extends EmscriptenClassHandle {
    getFrameData: () => Uint8ClampedArray;
    getWidth: () => number;
    getHeight: () => number;
    getMirrorAxis: () => unknown;
    getOrientation: () => unknown;
}
declare enum HintFont {
    Body = "body",
    Footnote = "footnote"
}
declare enum HintTextAlignment {
    Start = "start",
    Center = "center",
    End = "end"
}
declare enum HintWidth {
    Normal = "normal",
    Wider = "wider",
    FitText = "fitText"
}
declare enum HintHeight {
    Normal = "normal",
    Taller = "taller"
}
declare enum HintCornerStyle {
    Square = "square",
    Rounded = "rounded"
}
declare enum HintIcon {
    None = "none",
    Check = "check",
    ExclamationMark = "exclamationMark"
}
declare enum HintAnchor {
    Top = "top",
    AboveViewFinder = "aboveViewFinder",
    BelowViewFinder = "belowViewFinder"
}
interface HintStyle {
    textColor: string;
    textAlignment: HintTextAlignment;
    backgroundColor: string;
    hintIcon: HintIcon;
    isAnimatedToView: boolean;
    hintAnchor: HintAnchor;
    hintAnchorOffset: number;
    horizontalMargin: number;
    maxWidthFraction: number;
    textSize: number;
    textWeight: number;
    lineHeight: number;
    iconColor: string;
    maxLines: number;
    cornerRadius: number;
    fitToText: boolean;
}
declare enum GuidanceHintAnchor {
    AboveViewFinder = "aboveViewFinder",
    BelowViewFinder = "belowViewFinder"
}
declare enum GuidanceHintStyle {
    BlackOnWhite = "blackOnWhite",
    WhiteOnBlack = "whiteOnBlack",
    Transparent = "transparent"
}
interface GuidanceHint {
    text: string;
    guidanceHintStyle: GuidanceHintStyle;
    guidanceHintAnchor: GuidanceHintAnchor;
    hintStyle?: HintStyle;
    moveCloserAnimation?: boolean;
}
declare enum ToastHintStyle {
    Success = "success",
    Error = "error",
    Warning = "warning",
    Info = "info",
    Notification = "notification"
}
interface ToastHint {
    text: string;
    tag: string;
    toastHintStyle: ToastHintStyle;
    hintStyle?: HintStyle;
}
interface GenericHint {
    text: string;
    tag?: string;
    hintStyle: Omit<HintStyle, "anchor" | "verticalOffsetRatio" | "font" | "hintWidth" | "hintHeight" | "hintCornerStyle">;
}
interface PerformanceMetrics {
    processedFramesCount: number;
    redrawRequestsCount: number;
    actualRedrawsCount: number;
    frameDataPoolSize: number;
}
declare enum LicensedFeature {
    Ocr = 0,
    HideLogo = 1,
    ShowTestLicenseMessage = 2,
    AugmentedReality = 5,
    ActivityPingStatsAddon = 8,
    ActivityPing = 9,
    Registration = 10,
    Parser = 11,
    BarcodeCapture = 14,
    Analytics = 17,
    AnalyticsBatchMode = 18,
    AnalyticsScanContent = 19,
    AnalyticsOnlineVerification = 20,
    SparkScan = 21,
    AamvaIdBarcodeVerification = 22,
    MappingForTracking = 23,
    BarcodeFind = 24,
    MandatoryRegistration = 25,
    FeatureTracking = 26,
    IdCaptureViz = 27,
    IdCaptureMrz = 28,
    IdCaptureBarcode = 29,
    BarcodeSelectionAimToScan = 30,
    BarcodeSelectionTapToScan = 31,
    BarcodeCount = 32,
    BarcodePick = 33,
    IdVerificationDataComparison = 34,
    SmartLabelBarcode = 35,
    SmartLabelText = 36,
    VoidedIdDetection = 37,
    BarcodeArFull = 38,
    BarcodeSequence = 39
}
interface HintPresenterV2 extends EmscriptenClassHandle {
    showToast: (toastHint: string) => void;
    hideToast: (tag: string) => void;
    hideAllToasts: () => void;
    showGuidance: (guidanceHint: string) => void;
    hideCurrentGuidance: () => void;
    update: () => void;
}
interface PlatformHintPresenter extends EmscriptenClassHandle {
    setHintPresenter(presenter: HintPresenterV2): void;
    showToast(toast: string): void;
    hideToast(toast: string): void;
    showGuidance(guidanceHint: string): void;
    hideGuidance(guidanceHint: string): void;
    startUpdateTimer(intervalMs: number): void;
    stopUpdateTimer(): void;
}
interface Module extends EmscriptenModule {
    ImageConverter: ImageConverter_statics;
    ImageConverterInstance: ImageConverterInstance;
    callMain: () => void;
    canvas: OffscreenCanvas | undefined;
    __emscripten_proxy_main?: Record<number | string | symbol, unknown>;
    mainScriptUrlOrBlob: string;
    DataCaptureContextDeserializer: new (fsFolderPath: string, deviceId: string, deviceModel: string, domain: string, parentDomain: string, modeDeserializer: Vector, delayedRegistration: boolean, highEndBlurryRecognition: boolean, resourcePath: string) => DataCaptureContextDeserializer;
    DataCaptureContextListener: {
        extend: (target: "DataCaptureContextListener", parameters: {
            didChangeStatus: (context: DataCaptureContext$1, contextStatus: {
                toJson: () => string;
            }) => void;
            didStartObservingContext: (context: DataCaptureContext$1) => void;
            didStopObservingContext: (context: DataCaptureContext$1) => void;
        }) => new () => EmscriptenClassHandle;
    };
    DataCaptureContextFrameListener: {
        extend: (target: "DataCaptureContextFrameListener", parameters: {
            onObservationStarted: (context: DataCaptureContext$1) => void;
            onObservationStopped: (context: DataCaptureContext$1) => void;
            onFrameProcessingStarted: (context: DataCaptureContext$1, frameData: WasmFrameData) => void;
            onFrameProcessingFinished: (context: DataCaptureContext$1, frameData: WasmFrameData) => void;
            onFrameSkipped: (context: DataCaptureContext$1, frameData: WasmFrameData) => void;
        }) => new () => EmscriptenClassHandle;
    };
    HintPresenter: {
        extend: (target: "HintPresenter", parameters: {
            showHint: (hint: string, style: string) => void;
            updateHint: (style: string) => void;
            hideHint: () => void;
        }) => new () => EmscriptenClassHandle;
    };
    PlatformHintPresenter: {
        extend: (target: "PlatformHintPresenter", parameters: {
            setHintPresenter(presenter: HintPresenterV2): void;
            showToast(toastHint: string): void;
            hideToast(toastHint: string): void;
            showGuidance(guidanceHint: string): void;
            hideGuidance(guidanceHint: string): void;
            startUpdateTimer(intervalMs: number): void;
            stopUpdateTimer(): void;
        }) => new () => PlatformHintPresenter;
    };
    HintPresenterV2: new (platformHintPresenter: PlatformHintPresenter) => HintPresenterV2;
    ImageBufferFrameSource: new (mirroredAxis: unknown, isCameraFrameSource: boolean, orientation?: number) => DataCaptureImageBufferFrameSource;
    ImageBufferFormat: {
        Grayscale8: unknown;
        Rgb888: unknown;
        Rgba8888: unknown;
    };
    Axis: ModuleMirrorAxis;
    NeedsRedrawDelegate: {
        extend: (target: "NeedsRedrawDelegate", parameters: {
            setNeedsRedrawIn: (inMs: number) => void;
        }) => new () => EmscriptenClassHandle;
    };
    GestureRecognizer: {
        extend: (target: "GestureRecognizer", parameters: {
            setGestureListener(gestureListener: GestureListener, flags: number): void;
        }) => new () => GestureRecognizer;
    };
    VectorDataCaptureModeDeserializer: new () => Vector;
    allocateUint8Array: (length: number) => number;
    deleteUint8Array: (adress: number) => void;
    DataDecoding: {
        extend: (target: "DataDecoding", options: {
            decode: (rawData: ArrayBuffer, encodingRanges: string) => string;
        }) => new () => EmscriptenClassHandle;
    };
    setDataDecoding: (decoder: unknown) => void;
    LicenseUtils: {
        getBlinkIdLicenseKey: (scanditLicense: string) => string;
    };
    Feedback: {
        extend: (target: "Feedback", parameters: {
            emit: () => void;
        }) => new () => EmscriptenClassHandle;
    };
    dispose: () => void;
    LicenseFeature: LicensedFeature;
    addBarcodeFindToContext: (context: DataCaptureContext$1, mode: EmscriptenClassHandle) => void;
    removeBarcodeFindFromContext: (context: DataCaptureContext$1, mode: EmscriptenClassHandle) => void;
    addBarcodeFindBasicOverlayToView: (view: DataCaptureView, overlay: EmscriptenClassHandle) => void;
    removeBarcodeFindBasicOverlayFromView: (view: DataCaptureView, overlay: EmscriptenClassHandle) => void;
    addBarcodeArToContext: (context: DataCaptureContext$1, mode: EmscriptenClassHandle) => void;
    removeBarcodeArFromContext: (context: DataCaptureContext$1, mode: EmscriptenClassHandle) => void;
    OpenSourceSoftwareLicenseInfo: {
        getLicenseText(): string;
    };
}
type AugmentedWorker<M extends EmscriptenModule> = Worker & {
    Module: M;
    OffscreenCanvas: new (w: number, h: number) => OffscreenCanvas;
};
type EngineWorkerResponse<C extends DataCaptureActionMessageKey> = WorkerResponse<C> extends Promise<void> | void ? Promise<void> | void : {
    payload: WorkerResponse<C>;
    transferables?: Transferable[];
};
interface ModuleHandler<M extends Module> {
    get: () => M;
    set: (v: M) => void;
}

declare enum MeteringMode {
    CONTINUOUS = "continuous",
    MANUAL = "manual",
    NONE = "none",
    SINGLE_SHOT = "single-shot"
}
declare enum CameraResolutionConstraint {
    ULTRA_HD = 0,
    FULL_HD = 1,
    HD = 2,
    SD = 3,
    NONE = 4
}
interface ExtendedMediaTrackCapabilities extends MediaTrackCapabilities {
    exposureCompensation?: DoubleRange;
    exposureMode?: MeteringMode[];
    exposureTime?: DoubleRange;
    focusDistance?: DoubleRange;
    focusMode?: MeteringMode[];
    torch?: boolean;
    zoom?: DoubleRange;
}
interface ExtendedMediaTrackConstraintSet extends MediaTrackConstraintSet {
    exposureCompensation?: ConstrainDouble | number;
    exposureMode?: MeteringMode;
    exposureTime?: ConstrainDouble | number;
    focusDistance?: ConstrainDouble | number;
    focusMode?: MeteringMode;
    torch?: boolean;
    zoom?: ConstrainDouble | number;
}
interface GUI {
    isCameraRecoveryVisible: () => boolean;
    setCameraRecoveryVisible: (visible: boolean) => void;
}
interface FrameCapture {
    colorType?: ColorType;
    data: Uint8ClampedArray;
    height: number;
    width: number;
}
declare enum CameraManagerEvent {
    CAMERA_PROPERTIES = "cameraProperties",
    CAMERA_ACCESS_ERROR = "cameraAccessError"
}
type CameraManagerEventParameters<C> = C extends CameraManagerEvent.CAMERA_PROPERTIES ? ReportCameraPropertiesParameters : C extends CameraManagerEvent.CAMERA_ACCESS_ERROR ? any : never;
/**
 * A barcode picker utility class used to handle camera interaction.
 */
declare class CameraManager {
    private static readonly autofocusIntervalMs;
    private static readonly cameraAccessTimeoutMs;
    private static readonly getCapabilitiesTimeoutMs;
    private static readonly manualFocusWaitTimeoutMs;
    private static readonly manualToAutofocusResumeTimeoutMs;
    private static readonly noCameraErrorParameters;
    private static readonly notReadableErrorParameters;
    private static readonly videoMetadataCheckIntervalMs;
    private static readonly videoMetadataCheckTimeoutMs;
    private static MIRRORED_CLASS_NAME;
    private static _instance;
    activeCamera?: DeviceCamera;
    activeCameraSettings?: CameraSettings;
    canvas: HTMLCanvasElement;
    gui: GUI;
    selectedCamera?: DeviceCamera;
    videoElement: HTMLVideoElement;
    private constraint;
    private clipArea?;
    private readonly checkCameraVideoStreamAccessIfVisibleListener;
    private readonly handleWebGLContextLostListener;
    private readonly listeners;
    private readonly mirrorImageOverrides;
    private readonly postStreamInitializationListener;
    private readonly triggerFatalError;
    private readonly triggerManualFocusListener;
    private readonly triggerZoomMoveListener;
    private readonly triggerZoomStartListener;
    private readonly videoResizeListener;
    private readonly videoTrackEndedListener;
    private readonly videoTrackMuteListener;
    private _canvas2dContext;
    private _canvasWebGLContext;
    private _synchronousFrameHandling;
    private _frameReaderOptions;
    private _glFrameReaders;
    private _frameReaderType;
    private _mediaStream?;
    private abortedCameraInitializationResolveCallback?;
    private autofocusInterval;
    private cameraAccessRejectCallback?;
    private cameraAccessTimeout;
    private cameraInitializationPromise?;
    private cameraPosition;
    private cameraSetupPromise?;
    private getCapabilitiesTimeout;
    private manualFocusWaitTimeout;
    private manualToAutofocusResumeTimeout;
    private mediaTrackCapabilities?;
    private mediaTrackCapabilitiesPromise?;
    private mediaTrackCapabilitiesPromiseResolver?;
    private pinchToZoomDistance?;
    private pinchToZoomEnabled;
    private pinchToZoomInitialZoom;
    private selectedCameraSettings?;
    private tapToFocusEnabled;
    private torchEnabled;
    private torchToggleEnabled;
    private videoMetadataCheckInterval;
    private isWebGLSupported;
    private clippedFrameRequestID?;
    private isVideoStreamPaused;
    private handleVideoPauseHandler;
    constructor();
    get mediaStream(): MediaStream | undefined;
    set mediaStream(stream: MediaStream | undefined);
    get synchronousFrameHandling(): boolean;
    private get canvas2dContext();
    private get canvasWebGLContext();
    static instance(): CameraManager;
    recycle(pixelsData: Uint8ClampedArray): void;
    getCurrentFrame(): FrameCapture | undefined;
    requestVideoFrame(scheduledFunction: FrameRequestCallback | VideoFrameRequestCallback, videoElement?: HTMLVideoElement): number;
    cancelVideoFrame(id: number, videoElement?: HTMLVideoElement): void;
    addListener<E extends CameraManagerEvent>(event: CameraManagerEvent, listener: (details: CameraManagerEventParameters<E>) => void): void;
    applyCameraSettings(cameraSettings?: CameraSettings): Promise<void>;
    captureImage(): FrameCapture | null;
    initializeCameraWithSettings(camera?: DeviceCamera, cameraSettings?: CameraSettings): Promise<void>;
    isMirrorImageEnabled(): boolean;
    isPinchToZoomEnabled(): boolean;
    isTapToFocusEnabled(): boolean;
    isTorchAvailable(): Promise<boolean>;
    playVideo(): Promise<void>;
    reinitializeCamera(): Promise<void>;
    removeListener<E extends CameraManagerEvent>(event: CameraManagerEvent, listenerToRemove?: (details: CameraManagerEventParameters<E>) => void): void;
    setCameraPosition(cameraPosition: CameraPosition): Promise<void>;
    setExposure(exposure: {
        compensation?: number;
        time?: number;
    }): Promise<void>;
    setFocus(manualLensPosition: number): Promise<void>;
    setFrameRate(frameRate: {
        min?: number;
        max?: number;
    }): Promise<void>;
    setInitialCameraPosition(cameraPosition: CameraPosition): void;
    setInteractionOptions(torchToggleEnabled: boolean, tapToFocusEnabled: boolean, pinchToZoomEnabled: boolean): void;
    setMirrorImageEnabled(enabled: boolean, override: boolean): void;
    setPinchToZoomEnabled(enabled: boolean): void;
    setSelectedCamera(camera?: DeviceCamera): void;
    setSelectedCameraSettings(cameraSettings?: CameraSettings): void;
    setTapToFocusEnabled(enabled: boolean): void;
    setTorchEnabled(enabled: boolean): Promise<void>;
    setZoom(zoomFactor: number): Promise<void>;
    setupCameras(): Promise<void>;
    pauseStream(): void;
    resumeStream(): void;
    stopStream(cameraInitializationFailure?: boolean): Promise<void>;
    stopVideoTracks(): void;
    toggleTorch(): Promise<void>;
    updateCanvasVideoImage(): void;
    waitForCapabilities(): Promise<void>;
    setFrameReaderType(type: ColorType): void;
    allowPictureInPicture(allow: boolean): Promise<void>;
    setFrameHandling(synchronous: boolean): void;
    setClipArea(clipArea?: Rect): Promise<void>;
    /**
     * Converts a rectangle in DataCaptureView coordinates to camera frame coordinates.
     */
    private frameRectFromViewRect;
    private accessAutoselectedCamera;
    private getFrameReaderOptions;
    private getFrameReader;
    private accessInitialCamera;
    /**
     * When a context has been created for a canvas, it is not possible to get another one from another type.
     * This function re-creates a new canvas based on the existing one.
     */
    private recreateCanvas;
    private captureImageFor2dContext;
    private areVideoAndWebGLSizeMismatching;
    private captureImageForWebGLContext;
    private checkCameraAccess;
    private checkCameraVideoStreamAccessIfVisible;
    private checkVideoMetadata;
    private disablePinchToZoomListeners;
    private disableTapToFocusListeners;
    private emit;
    private enablePinchToZoomListeners;
    private enableTapToFocusListeners;
    private getActiveCamera;
    private getInitialCameraResolutionConstraint;
    private handleCameraInitializationError;
    private handleVideoResize;
    private handleWebGLContextLost;
    private initializeCameraAndCheckUpdatedSettings;
    private initializeCameraForResolution;
    private initializeStreamForResolution;
    private isVideoAndContextStateValid;
    private postStreamInitialization;
    private recoverStreamIfNeeded;
    private reportCameraProperties;
    private setCameraAccessTimeout;
    private setupAutofocus;
    private setupCameraStreamVideo;
    private setupCamerasAndStream;
    private storeStreamCapabilities;
    private triggerAutoFocus;
    private triggerFocusMode;
    private triggerManualFocus;
    private triggerManualFocusForContinuous;
    private triggerManualFocusForSingleShot;
    private triggerZoomMove;
    private triggerZoomStart;
    private updateActiveCameraCurrentResolution;
    private updateStreamForResolution;
    private videoTrackEndedRecovery;
    private videoTrackMuteRecovery;
    private clipMediaStreamIfNeeded;
    private drawClippedFrame;
    private cleanupClippedStream;
    connectedCallback(mountLocation: HTMLElement): void;
    disconnectedCallback(): void;
    getVideoElement(): HTMLVideoElement;
    private handleVideoPause;
}

interface LoadLibraryParameters {
    libraryLocation: string;
    locationPath: string;
    writableDataPathOverride?: string;
    verifyResponseHash: boolean;
    onProgress?: (info: ProgressInfo) => void;
    referredOrigin?: string;
    fixedWasmMemory: number | null;
    simdSupport: boolean;
    threadsSupport: boolean;
}
interface CreateContextParameters {
    context: DataCaptureContextJSON;
    deviceId: string;
    delayedRegistration: boolean;
    highEndBlurryRecognition: boolean;
    appName: string | null;
    parentDomain: string;
}
interface UpdateContextParameters {
    context: DataCaptureContextJSON;
    view: {
        width: number;
        height: number;
        visible: boolean;
        orientation: Orientation;
    } | null;
}
interface SetFrameSourceParameters {
    mirrorAxis: PrivateMirrorAxis;
    isCameraFrameSource: boolean;
}
type ProcessFrameParameters = FrameCapture;
interface ReportCameraPropertiesParameters {
    deviceId: string;
    hasAutofocus: boolean;
    isFrontFacing: boolean;
}
interface WorkerFunctions {
    getOffscreenCanvas: () => OffscreenCanvas | undefined;
    postMessage: (message: DataCaptureCallbackMessage, transfer?: Transferable[]) => void;
}
/**
 * DataCaptureEngine is an abstraction of the engine, it is created by the engine worker
 * and should be used as a singleton. It calls the underlying engine methods directly.
 */
declare class DataCaptureEngine<M extends Module> {
    private static get3dPartyLicenseKeyMethodName;
    context: DataCaptureContext$1;
    lastUsedModuleMirrorAxis: unknown;
    view: DataCaptureView | undefined;
    hintPresenterV2: HintPresenterV2 | null;
    protected readonly MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL: number;
    protected readonly moduleHandler: ModuleHandler<M>;
    protected readonly redrawInterval: number;
    protected readonly redrawRequests: number[];
    protected readonly workerFunctions: WorkerFunctions;
    protected _isDrawLoopRunning: boolean;
    protected contextDeserializer: DataCaptureContextDeserializer | undefined;
    protected frameDataPool: Map<number, {
        data: Uint8ClampedArray;
        colorType: ColorType;
    }>;
    protected lastFrameColorType: ColorType;
    protected imageFrameSource?: DataCaptureImageBufferFrameSource;
    protected lastFrameCounter: number;
    protected libraryLoadingPromise: Promise<void> | undefined;
    protected loopTimeoutId?: ReturnType<typeof setTimeout>;
    protected resourcePath: string;
    protected writableDataPath: string;
    protected poorMansBenchmarkLogs: boolean;
    protected parentDomain: string;
    protected readonly writableDataPathStandard: string;
    protected readonly resourceFilesSubfolder: string;
    protected performanceMetricsReporterTimer: ReturnType<typeof setTimeout> | undefined;
    protected performanceMetrics: PerformanceMetrics;
    protected gestureRecognizer: GestureRecognizer | null;
    private gestureListener;
    private webPlatformHintPresenter;
    private webImageConverterInstance;
    constructor(moduleHandler: ModuleHandler<M>, workerFunctions: WorkerFunctions);
    get Module(): M;
    set isDrawLoopRunning(newValue: boolean);
    get isDrawLoopRunning(): boolean;
    convertToLoadableFrameData(frameData: WasmFrameData): PrivateLoadableFrameData;
    createContext(createContextJSON: CreateContextParameters): EngineWorkerResponse<"createContext">;
    convertToJPEGResult(imageId: number, result: Uint8Array): void;
    /**
     * Returns the ImageConverterInstance to be used in the worker thread. Depending on the availability of
     * OffscreenCanvas, a different implementation is returned.
     */
    protected getImageConverterInstance(options: {
        quality: number;
    }): ImageConverterInstance;
    onTap(point: PointJSON): void;
    hintPresenterV2Update(): void;
    startReportingPerformanceMetrics(): void;
    reportPerformanceMetrics(): Promise<void>;
    deleteFrameData(frameId: number): void;
    dispose(): EngineWorkerResponse<"dispose">;
    flushAnalytics(): void;
    extractCentaurusLicense(scanditLicenseKey: string): EngineWorkerResponse<"extractCentaurusLicense">;
    getModeDeserializers(): Vector;
    loadLibrary(parameters: LoadLibraryParameters): EngineWorkerResponse<"loadLibrary">;
    processFrame(parameters: ProcessFrameParameters): EngineWorkerResponse<"processFrame">;
    reportCameraProperties(properties: ReportCameraPropertiesParameters): EngineWorkerResponse<"reportCameraProperties">;
    requestFrameData(frameId: number): EngineWorkerResponse<"requestFrameData">;
    scheduleRedraw(view: DataCaptureView, redrawInMs: number): void;
    sendViewRefreshCommands(commands: Uint8Array): void;
    setFrameSource(mirrorAxis: PrivateMirrorAxis, isCameraFrameSource: boolean): EngineWorkerResponse<"setFrameSource">;
    /**
     * The draw loop check at regular interval if any redraw request were made by the engine.
     * If a redraw is necessary, it gathers and sends drawing commands to the main thread.
     */
    startDrawLoop(view: DataCaptureView): void;
    updateContext(contextUpdateParameters: UpdateContextParameters): EngineWorkerResponse<"updateContext">;
    /**
     * Called before updateContextFromJson
     *
     * @protected
     * @param {UpdateContextParameters} contextUpdateParameters
     * @returns {UpdateContextParameters}
     */
    protected onBeforeUpdateContextHook(contextUpdateParameters: UpdateContextParameters): UpdateContextParameters;
    onDocumentVisibilityChange(state: DocumentVisibilityState): void;
    isFeatureSupported(feature: LicensedFeature): EngineWorkerResponse<"isFeatureSupported">;
    getViewfinderInfo(): EngineWorkerResponse<"getViewfinderInfo">;
    getOpenSourceSoftwareLicenseInfo(): EngineWorkerResponse<"getOpenSourceSoftwareLicenseInfo">;
    protected getNextFrameId(): number;
    protected getWasmDynamicLibraries(coreWasmURI: string): string[];
    protected getWasmCoreExpectedHash(simdSupport: boolean, threadsSupport: boolean): string;
    protected getWasmCoreFileName(simdSupport: boolean, threadsSupport: boolean): string;
    protected getWasmMetadata(): Record<string, {
        bytes: number;
    }>;
    protected getWasmSideModuleFileName(): string;
    private _loadProgressCallback;
    /**
     * Redraw requests are scheduled at [now + redrawInMs], so when pushed they must be sorted
     * in chronological order so that we can later easily check if we need to redraw by checking
     * the first element.
     * @param redrawInMs
     */
    private addRedrawRequest;
    private contextDidChangeStatus;
    private didStartObservingContext;
    private mapMirrorAxisOnModule;
    protected setView(view: DataCaptureView | undefined): void;
    /**
     * Add a native overlay to the view without passing from the deserializer.
     * must be implemented in the specific module.
     * @param event - The message event containing the overlay handle.
     */
    addNativeOverlay(event: MessageEvent<AnyDataCaptureActionMessage>): void;
    /**
     * Remove a native overlay from the view.
     * must be implemented in the specific module.
     * @param event - The message event containing the overlay handle.
     */
    removeNativeOverlay(event: MessageEvent<AnyDataCaptureActionMessage>): void;
    private setViewRefreshHandler;
    private setupDataDecoding;
    private start;
    private getWritableDataPath;
    private numOfMBToPages;
    private setup;
}

type CommandAndPayload<A, C> = A extends {
    command: C;
} ? A : never;
type WorkerCommandPayload<C> = Omit<CommandAndPayload<AnyDataCaptureActionMessage, C>, "command" | "id">;
type WorkerListener = (event: DataCaptureCallbackMessage) => any;
interface DataCaptureLoaderOptions {
    libraryLocation: string;
    verifyResponseHash: boolean;
    loadProgressNotifier?: (info: ProgressInfo) => void;
    logLevel?: Logger.Level;
    highEndBlurryRecognition?: boolean;
    simdSupport: boolean;
    threadsSupport: boolean;
}
/**
 * The DataCaptureLoader class is used by the main thread, it instantiates the worker
 * and sends commands to it. It represents thus the main communication channel
 * between the main thread and the engine running in the worker.
 */
declare class DataCaptureLoader {
    highEndBlurryRecognition?: boolean;
    protected verifyResponseHash: boolean;
    protected simdSupport: boolean;
    protected threadsSupport: boolean;
    protected _dataCaptureWorker?: DataCaptureWorker;
    protected readonly libraryLocation: string;
    protected workerCommandId: number;
    protected readonly workerTasks: Map<number, {
        resolve: (...arguments_: any[]) => any;
        reject: (...arguments_: any[]) => any;
        command: string;
    }>;
    protected readonly workerListeners: WorkerListener[];
    protected workerMessageListener: (event_: MessageEvent<DataCaptureCallbackMessage>) => void;
    protected constructor(options: DataCaptureLoaderOptions);
    get dataCaptureWorker(): DataCaptureWorker;
    protected get name(): string;
    protected get fixedWasmMemory(): number | null;
    static create(options: DataCaptureLoaderOptions): Promise<DataCaptureLoader>;
    load(): Promise<WorkerResponse<"loadLibrary">>;
    /**
     * Send a task (i.e. a command) to the worker. Every task sent has a corresponding Promise object which
     * gets resolved when the worker has processed the request. The tasks are identified by an id which is
     * sent along with the data by both sides.
     */
    workerCommand<C extends DataCaptureActionMessageKey>(command: C, payload: WorkerCommandPayload<C>, transferables?: Transferable[]): Promise<WorkerResponse<C>>;
    terminateDataCaptureWorker(disposeContext?: boolean): Promise<void>;
    addWorkerListener(listener: WorkerListener): void;
    removeWorkerListener(listener: WorkerListener): void;
    getOptions(): Pick<DataCaptureLoaderOptions, "libraryLocation" | "simdSupport" | "threadsSupport" | "verifyResponseHash">;
    protected onWorkerMessage(event_: MessageEvent<DataCaptureCallbackMessage>): void;
}

declare enum HintPresenterEvents {
    Update = "hintpresenterupdate"
}
declare class HintPresenter extends ScanditHTMLElement {
    static readonly tag: "scandit-hints";
    private intervalId;
    private root;
    private _viewFinderRect;
    private onDidToastHideHandler;
    private orientationObserver;
    private onOrientationChangeHandler;
    constructor();
    private static createStyleElement;
    static register(): void;
    static create(): HintPresenter;
    connectedCallback(): void;
    disconnectedCallback(): void;
    setViewFinderRect(rect: Rect | null): void;
    handleMessage(message: DataCaptureCallbackMessage): Promise<void>;
    private setHintStyleToToast;
    private onDidToastHide;
    private getToastElementFromIdOrTag;
    showToast(toast: GenericHint): Promise<void>;
    showToastWithCustomIcon(hintStyle: GenericHint, icon: ScanditIcon): Promise<void>;
    hideToast(hintStyle: GenericHint): Promise<void>;
    private showGuidance;
    private hideGuidance;
    private startUpdateTimer;
    private stopUpdateTimer;
    private idFromHint;
    private onOrientationChange;
}
declare global {
    interface HTMLElementTagNameMap {
        [HintPresenter.tag]: HintPresenter;
    }
    interface HTMLElementEventMap {
        [HintPresenterEvents.Update]: CustomEvent<void>;
    }
}

interface DataCaptureContextListener {
    didChangeStatus?: (context: DataCaptureContext, contextStatus: ContextStatus) => void;
    didStartObservingContext?: (context: DataCaptureContext) => void;
    didChangeFrameSource?: (context: DataCaptureContext, frameSource: FrameSource | null) => void;
}
interface ContextStatusJSON {
    code: number;
    isValid: boolean;
    message: string;
}
declare class ContextStatus {
    private _message;
    private _code;
    private _isValid;
    private static fromJSON;
    get message(): string;
    get code(): number;
    get isValid(): boolean;
}
declare enum PrivateMirrorAxis {
    None = "None",
    X = "X",
    Y = "Y"
}

type DataCaptureContextState = "unconfigured" | "configuring" | "configured" | "creating-context" | "ready";

type Change = {
    type: "modeEnabled";
    newValue: boolean;
} | {
    type: "addControl";
    newValue: any;
} | {
    type: "addOverlay";
    newValue: DataCaptureOverlay;
    view: DataCaptureView$1;
} | {
    type: "cameraSettings";
    newValue: any;
} | {
    type: "frameSourceState";
    newValue: any;
} | {
    type: "removeControl";
    newValue: any;
} | {
    type: "removeOverlay";
    newValue: DataCaptureOverlay;
    view: DataCaptureView$1;
} | {
    type: "singleImageModeUploaderSettings";
    newValue: any;
} | {
    type: "torchState";
    newValue: any;
} | {
    type: "viewChange";
    newValue: {
        orientation: Orientation;
    } & Partial<HTMLElementStateJSON>;
} | {
    type: "viewSet";
    newValue: DataCaptureView$1 | null;
};
type PrivateChangeSet = Change[];
interface DataCaptureMode extends Serializable {
    isEnabled(): boolean;
    setEnabled(enabled: boolean): Promise<void>;
    context: Optional<DataCaptureContext>;
}
interface PrivateDataCaptureMode extends DataCaptureMode {
    type: "barcodeCapture" | "idCapture";
    skipSerialization?: boolean;
    [nativeHandle]?: symbol;
    _context: Optional<DataCaptureContext>;
    attachedToContext: (context: DataCaptureContext) => Promise<void>;
    detachedFromContext: () => Promise<void>;
    _synchronousFrameFlow?: boolean;
}
interface DataCaptureModeJSON<S = JSONType> {
    type: "barcodeCapture" | "barcodeTracking" | "idCapture" | "parser" | "sparkScan" | "barcodeFind" | "barcodeAr" | "labelCapture";
    enabled: boolean;
    settings: S;
}
interface PrivateDataCaptureComponent {
    _context: DataCaptureContext;
}
type DataCaptureComponentJSON = JSONType;
interface DataCaptureComponent extends Serializable<DataCaptureComponentJSON> {
    readonly id: string;
}
interface PrivateDataCaptureContextOptions {
    deviceName?: string | null;
    dataCaptureInstance?: DataCaptureLoader;
    delayedRegistration?: boolean;
    licenseKey?: string;
    settings?: DataCaptureContextSettings;
}
interface PrivateDataCaptureContext<W extends (...parameters: any[]) => unknown = DataCaptureLoader["workerCommand"]> {
    _frameSource?: FrameSource | null;
    _useSynchronousFrameFlow: boolean;
    capabilityInfo: PrivateCapabilityInfo;
    modes: Set<DataCaptureMode>;
    components: DataCaptureComponent[];
    createContext: () => Promise<void>;
    update: (changeSet?: PrivateChangeSet, { updateContext }?: {
        updateContext?: boolean;
    }) => Promise<void>;
    addNativeOverlay: (overlay: DataCaptureOverlay) => Promise<void>;
    removeNativeOverlay: (overlay: DataCaptureOverlay) => Promise<void>;
    addComponent: (component: DataCaptureComponent) => Promise<void>;
    dataCaptureInstance: DataCaptureLoader;
    sendFrameToProcessor: (capture: FrameCapture) => Promise<WorkerResponse<"processFrame">>;
    subscribeToWorkerMessages: (listener: (message: DataCaptureCallbackMessage) => void) => void;
    unsubscribeToWorkerMessages: (listener: (message: DataCaptureCallbackMessage) => void) => void;
    hasEnabledMode: () => boolean;
    hasModes: () => boolean;
    workerCommand: MethodSignature<W>;
    performanceMark: MethodSignature<DataCaptureContext["performanceMark"]>;
    isFeatureSupported: (feature: LicensedFeature) => Promise<boolean>;
    new (): DataCaptureContext;
    updateListeners: Set<(change: Change) => void>;
    updateCameraFrameFlow: (synchronous: boolean) => void;
    getView: () => DataCaptureView$1 | null;
}
interface DataCaptureContextCreationOptions {
    libraryLocation: string;
    moduleLoaders: ModuleLoader[];
    deviceName?: string;
    settings?: DataCaptureContextSettings;
    logLevel?: Logger.Level;
}
/**
 * Configuration options for initializing the DataCapture SDK.
 *
 * @public
 */
interface ModuleLoaderOptions {
    licenseKey: string;
    libraryLocation: string;
    moduleLoaders: ModuleLoader[];
    logLevel: Logger.Level;
}
interface RuntimeEnvironment {
    deviceOS: string;
    browser: string;
    browserVersion: string;
    deviceModelName: string;
}
interface PrivateCapabilityInfo {
    simdSupport: boolean;
    threadsSupport: boolean;
}
interface DataCaptureContextJSON extends RuntimeEnvironment {
    framework: string;
    settings: DataCaptureContextSettingsJSON;
    licenseKey: string;
    deviceName: string;
    frameSource: FrameSourceJSON | null;
    modes: DataCaptureModeJSON[];
    components: DataCaptureComponentJSON[];
    view: DataCaptureViewJSON | null;
}
type PrivateFrameHandlerResponse = {
    action: "continue" | "skip";
    frame: FrameCapture;
};
type PrivateFrameHandler = (frame: FrameCapture) => Promise<PrivateFrameHandlerResponse>;
declare class DataCaptureContext implements Serializable<DataCaptureContextJSON> {
    static deviceID: string;
    protected static stateMachine: AsyncStateMachine<DataCaptureContextState>;
    protected static mainDataCaptureLoader: DataCaptureLoader | undefined;
    protected static dataCaptureLoaders: Map<string, DataCaptureLoader>;
    protected static libraryLocation: string | undefined;
    private static userLicenseKey;
    /**
     * Threads and SIMD support detected during initialization
     */
    protected static capabilityInfo: PrivateCapabilityInfo | undefined;
    private _asyncImageConverterInstance;
    private static get moduleLicenseTextProviders();
    private readonly framework;
    private readonly runtimeEnvironment;
    private settings;
    private licenseKey;
    private deviceName;
    private _frameSource;
    private _view;
    private readonly modes;
    private readonly components;
    private listeners;
    private readonly updateListeners;
    private readonly cameraPropertiesReportListener;
    private readonly cameraAccessErrorListener;
    private readonly onWorkerMessageListener;
    private readonly onVisibilityChangeListener;
    private dataCaptureInstance;
    private readonly pendingWorkerMessageListeners;
    private delayedRegistration;
    private highEndBlurryRecognition;
    private readonly _frameHandlers;
    /**
     * When synchronous, only one frame is processed at a time by the capture mode, the frame source will wait until the
     * frame data is back to send the next frame.
     *
     * IdCapture uses the synchronous flow because BlinkID only processes one frame at a time.
     * MatrixScan and other barcode modes usually use the asynchronous flow because they can use multi-threading.
     */
    private _useSynchronousFrameFlow;
    private static _sharedInstance;
    static get sharedInstance(): DataCaptureContext;
    /**
     * Get the current state of the DataCaptureContext initialization
     */
    protected static get currentState(): DataCaptureContextState;
    /**
     * Check if the context is ready for use
     */
    protected static get isReady(): boolean;
    /**
     * Check if initialization is in progress
     */
    protected static get isInitializing(): boolean;
    /**
     * Add a listener to state changes
     */
    protected static addStateListener(listener: (currentState: DataCaptureContextState, previousState: DataCaptureContextState, context?: any) => void): void;
    /**
     * Remove a state change listener
     */
    protected static removeStateListener(listener: (currentState: DataCaptureContextState, previousState: DataCaptureContextState, context?: any) => void): void;
    private initializeWithOptions;
    get frameSource(): FrameSource | null;
    private get workerCommand();
    static forLicenseKey(licenseKey: string, options: DataCaptureContextCreationOptions): Promise<DataCaptureContext>;
    private static internalConfigure;
    /**
     * Initialize the DataCapture SDK for Electron applications using a license data path.
     * This method handles the Electron-specific license key retrieval logic.
     *
     * @param licenseDataPath - Path to the license data file in the Electron app
     * @param options - Configuration options for the DataCapture SDK
     * @returns Promise resolving to the DataCaptureContext instance
     */
    static forLicenseKeyInElectronPath(licenseDataPath: string, options: DataCaptureContextCreationOptions): Promise<DataCaptureContext>;
    private static updateViewsWithProgress;
    private static getOverridesFromQueryString;
    private static validateOptions;
    private static loadModules;
    static getOpenSourceSoftwareLicenseInfo(): Promise<OpenSourceSoftwareLicenseInfo>;
    /**
     * Disconnect the current frame source from the context and connect the new one. This process can happen multiple
     * times for the same frame source because of its initialisation (The mirroring info of a camera is only available
     * when it has started for example).
     * Trigger the "didChangeFrameSource" listeners only if the new frame source is different than the old one.
     */
    setFrameSource(frameSource: FrameSource | null): Promise<void>;
    addListener(listener: DataCaptureContextListener): void;
    flushAnalytics(): Promise<void>;
    removeListener(listener: DataCaptureContextListener): void;
    addMode(mode: DataCaptureMode): Promise<void>;
    removeMode(mode: DataCaptureMode): Promise<void>;
    setMode(mode: DataCaptureMode): Promise<void>;
    removeCurrentMode(): Promise<void>;
    removeAllModes(): Promise<void>;
    dispose(): Promise<void>;
    applySettings(settings: DataCaptureContextSettings): Promise<void>;
    toJSONObject(): DataCaptureContextJSON;
    private getView;
    private setView;
    private getAppName;
    private urlToHostname;
    private getParentDomain;
    private createContext;
    private subscribeToVisibilityChange;
    private unsubscribeToVisibilityChange;
    private requestFrameData;
    private performanceMark;
    private sendFrameToProcessor;
    private sendFrameToHandlers;
    private sendFrameToSDC;
    private registerFrameHandler;
    private unregisterFrameHandler;
    private onVisibilityChange;
    private getImageConverterInstance;
    private onWorkerMessage;
    /**
     * This method is only called from the worker thread when OffscreenCanvas is not available there.
     */
    private convertImageToJPEG;
    private subscribeToCameraManagerEvents;
    private reportCameraProperties;
    private onCameraAccessError;
    private update;
    private updateContext;
    private getViewInfo;
    private getMirrorAxisForFrameSource;
    private addComponent;
    private addNativeOverlay;
    private removeNativeOverlay;
    private subscribeToWorkerMessages;
    private unsubscribeToWorkerMessages;
    private hasEnabledMode;
    /**
     * Some capture modes process frames synchronously, like IdCapture. Other can process multiple frames
     * in parallel, like MatrixScan. We inform the CameraManager how to process frames.
     */
    private updateCameraFrameFlow;
    protected isFeatureSupported(feature: LicensedFeature): Promise<boolean>;
}

export { type WorkerResponse as $, convertToPublicFrameData as A, type ModuleLoader as B, type Control as C, type DataCaptureContextState as D, type DataCaptureLoaderOptions as E, type FrameData as F, DataCaptureLoader as G, HintPresenter as H, type PerformanceMetrics as I, DataCaptureEngine as J, type Module as K, type GenericHint as L, type ModuleLoaderOptions as M, type FrameCapture as N, type AnyDataCaptureActionMessage as O, type PrivateChangeSet as P, type AugmentedWorker as Q, type ModuleHandler as R, type DataCaptureCallbackMessage as S, type DataCaptureActionMessageKey as T, type EngineWorkerResponse as U, type ExtractCentaurusLicenseResponse as V, type WorkerFunctions as W, type RequestFrameDataResponse as X, type IsFeatureSupportedResponse as Y, type GetViewfinderInfo as Z, type GetOpenSourceSoftwareLicenseInfoResponse as _, type ControlType as a, type GuidanceHint as a$, type LoadLibraryDataCaptureAction as a0, type ConvertToJPEGResultDataCaptureAction as a1, type CreateContextDataCaptureAction as a2, type SetFrameSourceDataCaptureAction as a3, type ProcessFrameDataCaptureAction as a4, type RequestFrameDataDataCaptureAction as a5, type DeleteFrameDataDataCaptureAction as a6, type VisibilityChangeAction as a7, type IsFeatureSupportedAction as a8, type UpdateContextDataCaptureAction as a9, type StartUpdateTimerMessage as aA, type StopUpdateTimerMessage as aB, type PayloadForCommand as aC, type DataCaptureWorker as aD, type EmscriptenClassHandle as aE, type DataCaptureContext$1 as aF, type DataCaptureImageBufferFrameSource as aG, type GestureListener as aH, type GestureRecognizer as aI, type DataCaptureView as aJ, type JSONParseable as aK, type DataCaptureContextDeserializerResult as aL, type DataCaptureContextDeserializer as aM, type CaptureModeDeserializerInstance as aN, type ModuleMirrorAxis as aO, type Vector as aP, type WasmFrameData as aQ, HintFont as aR, HintTextAlignment as aS, HintWidth as aT, HintHeight as aU, HintCornerStyle as aV, HintIcon as aW, HintAnchor as aX, type HintStyle as aY, GuidanceHintAnchor as aZ, GuidanceHintStyle as a_, type DisposeDataCaptureAction as aa, type FlushAnalyticsDataCaptureAction as ab, type ReportCameraPropertiesDataCaptureAction as ac, type SetLogLevelDataCaptureAction as ad, type ExtractCentaurusLicenseDataCaptureAction as ae, type OnTapAction as af, type HintPresenterV2updateAction as ag, type GetViewfinderInfoAction as ah, type GetOpenSourceSoftwareLicenseInfoAction as ai, type AddNativeOverlayAction as aj, type RemoveNativeOverlayAction as ak, type DataCaptureCallbackMessageKeys as al, type SuccessFeedbackWorkerMessage as am, type ShowHintWorkerMessage as an, type UpdateHintWorkerMessage as ao, type IsFeatureSupportedMessage as ap, type HideHintWorkerMessage as aq, type PerformanceMetricsReportMessage as ar, type DidTapTrackedBarcode as as, type OnFrameProcessingStartedMessage as at, type OnFrameProcessingFinishedMessage as au, type OnFrameSkippedMessage as av, type ShowToastMessage as aw, type HideToastMessage as ax, type ShowGuidanceMessage as ay, type HideGuidanceMessage as az, type Change as b, ToastHintStyle as b0, type ToastHint as b1, LicensedFeature as b2, type HintPresenterV2 as b3, type PlatformHintPresenter as b4, type LoadLibraryParameters as b5, type CreateContextParameters as b6, type UpdateContextParameters as b7, type SetFrameSourceParameters as b8, type ProcessFrameParameters as b9, type ReportCameraPropertiesParameters as ba, type PrivateBaseControl as bb, type PrivateControl as bc, MeteringMode as bd, CameraResolutionConstraint as be, type ExtendedMediaTrackCapabilities as bf, type ExtendedMediaTrackConstraintSet as bg, type GUI as bh, CameraManagerEvent as bi, type CameraManagerEventParameters as bj, CameraManager as bk, HintPresenterEvents as bl, type DataCaptureMode as c, type PrivateDataCaptureMode as d, type DataCaptureModeJSON as e, type PrivateDataCaptureComponent as f, type DataCaptureComponentJSON as g, type DataCaptureComponent as h, type PrivateDataCaptureContextOptions as i, type PrivateDataCaptureContext as j, type DataCaptureContextCreationOptions as k, type PrivateCapabilityInfo as l, type DataCaptureContextJSON as m, type PrivateFrameHandlerResponse as n, type PrivateFrameHandler as o, DataCaptureContext as p, type DataCaptureContextListener as q, type ContextStatusJSON as r, ContextStatus as s, PrivateMirrorAxis as t, type DataCaptureOverlay as u, type DataCaptureViewListener as v, type DataCaptureViewJSON as w, type DataCaptureViewConnectOptions as x, DataCaptureView$1 as y, type PrivateLoadableFrameData as z };