scandit-web-datacapture-barcode
Version:
Scandit Data Capture SDK for the Web
45 lines (44 loc) • 2.24 kB
TypeScript
import type { DataCaptureContext, DataCaptureMode, DataCaptureModeJSON, FrameData, PrivateDataCaptureMode } from "scandit-web-datacapture-core";
import { CameraSettings } from "scandit-web-datacapture-core";
import type { Serializable } from "scandit-web-datacapture-core/build/js/private/Serializable";
import { BarcodeCaptureFeedback } from "./BarcodeCaptureFeedback";
import type { BarcodeCaptureFeedbackJSON } from "./BarcodeCaptureFeedback";
import { BarcodeCaptureSession } from "./BarcodeCaptureSession";
import type { BarcodeCaptureSettings, BarcodeCaptureSettingsJSON } from "./BarcodeCaptureSettings";
export interface PrivateBarcodeCapture extends PrivateDataCaptureMode {
notifyContext: () => Promise<void>;
}
export interface BarcodeCaptureListener {
didScan?: (barcodeCapture: BarcodeCapture, session: BarcodeCaptureSession, frameData: FrameData) => void;
didUpdateSession?: (barcodeCapture: BarcodeCapture, session: BarcodeCaptureSession) => void;
}
declare type BarcodeCaptureJSON = DataCaptureModeJSON<BarcodeCaptureSettingsJSON> & {
feedback: BarcodeCaptureFeedbackJSON;
};
export declare class BarcodeCapture implements DataCaptureMode, Serializable<BarcodeCaptureJSON> {
private readonly type;
private _isEnabled;
private _feedback;
private settings;
private _context;
private readonly listeners;
private allowedRemainingWorkerMessages;
private readonly workerMessageListener;
isEnabled(): boolean;
setEnabled(enabled: boolean): Promise<void>;
get context(): DataCaptureContext | null;
get feedback(): BarcodeCaptureFeedback;
set feedback(feedback: BarcodeCaptureFeedback);
static get recommendedCameraSettings(): CameraSettings;
static forContext(context: DataCaptureContext | null, settings: BarcodeCaptureSettings): Promise<BarcodeCapture>;
applySettings(settings: BarcodeCaptureSettings): Promise<void>;
addListener(listener: BarcodeCaptureListener): void;
removeListener(listener: BarcodeCaptureListener): void;
private attachedToContext;
private detachedFromContext;
private sendClearFrameDataRequest;
private onWorkerMessage;
private notifyContext;
toJSONObject(): BarcodeCaptureJSON;
}
export {};