UNPKG

scandit-web-datacapture-id

Version:

Scandit Data Capture SDK for the Web

22 lines (21 loc) 1.25 kB
/// <reference types="offscreencanvas" /> import type { ModuleHandler } from "scandit-web-datacapture-core/build/js/worker"; import { WorkerMain as CoreWorkerMain } from "scandit-web-datacapture-core/build/js/worker"; import { DataCaptureEngine } from "./dataCaptureEngine"; import type { AnyDataCaptureActionMessage, DataCaptureActionMessageKey, Module, WorkerResponse } from "./dataCaptureWorker+related"; declare const workerPathOrURLContent = "js/worker.js"; export default workerPathOrURLContent; declare type AugmentedWorker = Worker & { Module: Module; OffscreenCanvas: new (w: number, h: number) => OffscreenCanvas; }; export declare type EngineWorkerResponse<C extends DataCaptureActionMessageKey> = WorkerResponse<C> extends Promise<void> | void ? Promise<void> | void : { payload: WorkerResponse<C>; transferables?: Transferable[]; }; declare class WorkerMain extends CoreWorkerMain<DataCaptureEngine, Module> { constructor(workerSelf: AugmentedWorker, module: ModuleHandler<Module>); respondWith(command: DataCaptureActionMessageKey, requestId: number, executor: () => any): Promise<void>; onMessage(e: MessageEvent<AnyDataCaptureActionMessage>): boolean; } export declare const workerInstance: WorkerMain;