UNPKG

@scandit/web-datacapture-id

Version:

Scandit Data Capture SDK for the Web

59 lines (58 loc) 3.29 kB
import type { EmscriptenClassHandle } from "@scandit/web-datacapture-core/build/js/worker/dataCaptureWorkerRelated"; import type { CapturedIdJSONWithoutCommonFieldsJSON, IdCaptureSessionHolder, ParseResult, SDCIdCaptureMode, WasmCaptureId } from "./dataCaptureWorkerRelated"; import type { IdCaptureSettingsJSON } from "../IdCaptureSettings"; import type { AamvaBarcodeVerificationResultJSON, CapturedIdJSON, CapturedIdJSONWithRawImageInfo, CentaurusSettingsJSON, DataConsistencyResultJSON, IdCaptureSessionJSON } from "../SerializedTypes"; import type { SafariOOMEventData } from "../safariOOMDetection/types"; import type { DataCaptureEngine } from "./dataCaptureEngine"; export declare class IdCaptureMode { private SDCIdCaptureMode; private lastResult; private lastError; private lastLocalizedId; private lastDetectionIssue; private readonly coreEngine; private readonly Module; private readonly workerFunctions; constructor(coreEngine: DataCaptureEngine, SDCContext: EmscriptenClassHandle, SDCSettings: EmscriptenClassHandle); /** * Initializes the new IdCaptureMode, on the SDC side as well. */ private start; getSDCIdCaptureMode(): SDCIdCaptureMode; backendGetLastResult(): string; setLastResult(result: string): void; setLastError(error: string): void; setLastLocalizedId(localizedId: string): void; setLastDetectionIssue(issue: string): void; applySettings(settings: IdCaptureSettingsJSON): void; /** * Reset everything on the SDC side. Once done, it will call IdCaptureBackend.reset(), which * calls onResetFromSDC(), which finally notify the main thread that the reset is done. */ reset(): void; setExternalTransactionId(transactionId: string | null): void; getExternalTransactionId(): string | undefined; parseCode(code: string): ParseResult | null; getCentaurusSettings(): CentaurusSettingsJSON; dataConsistencyVerifyCapture(capturedId: CapturedIdJSON): DataConsistencyResultJSON | null; barcodeVerifyAamvaCapture(capturedId: CapturedIdJSON, endpoint: string | null): Promise<AamvaBarcodeVerificationResultJSON>; onResetFromSDC(hardReset: boolean): void; setDetectionOnlyMode(detectionOnlyMode: boolean): void; onIdCapturedCallback(capturedId: WasmCaptureId): void; onIdPartiallyCapturedCallback(capturedId: WasmCaptureId): void; onIdRejectedCallback(capturedId: WasmCaptureId | null, rejectionReason: string): void; onIdLocalizedCallback(localization: string): void; extractCaptureId(wasmCapturedId: WasmCaptureId | null): CapturedIdJSONWithRawImageInfo | null; onShutterButtonPositionChangedCallback(position: string): void; onShutterButtonStateChangedCallback(state: string): void; reportSafariAbruptReload(environmentData: SafariOOMEventData): Promise<void>; /** * The session holder contains everything except the common fields for the captured id, which have to be * gathered manually. */ parseIdCaptureSession(session: IdCaptureSessionHolder): Omit<IdCaptureSessionJSON, keyof CapturedIdJSONWithoutCommonFieldsJSON>; dispose(): void; private extractImageTransferablesFromCapturedId; private isReadyToDisplayHints; private initHintPresenterIfNotInitialized; }