scandit-web-datacapture-id
Advanced tools
Comparing version 6.25.0 to 6.26.0-beta.1
@@ -1,1 +0,1 @@ | ||
SDC_WASM_JS_VERSION="6.25.0";"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:f=>(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f),postMessage:msg=>parentPort.postMessage(msg),performance:global.performance||{now:Date.now}})}var initializedJS=false;function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+"\n");return}console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var module=Module["wasmModule"];Module["wasmModule"]=null;var instance=new WebAssembly.Instance(module,info);return receiveInstance(instance)};self.onunhandledrejection=e=>{throw e.reason||e};function handleMessage(e){try{if(e.data.cmd==="load"){let messageQueue=[];self.onmessage=e=>messageQueue.push(e);self.startWorker=instance=>{postMessage({"cmd":"loaded"});for(let msg of messageQueue){handleMessage(msg)}self.onmessage=handleMessage};Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=(...args)=>{postMessage({cmd:"callHandler",handler:handler,args:args})}}Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob=="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["__emscripten_thread_mailbox_await"](e.data.pthread_ptr);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){Module["__embind_initialize_bindings"]();initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){throw ex}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="checkMailbox"){if(initializedJS){Module["checkMailbox"]()}}else if(e.data.cmd){err(`worker.js received unknown command ${e.data.cmd}`);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}}self.onmessage=handleMessage; | ||
SDC_WASM_JS_VERSION="6.26.0-beta.1";"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:f=>(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f),postMessage:msg=>parentPort.postMessage(msg),performance:global.performance||{now:Date.now}})}var initializedJS=false;function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+"\n");return}console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var module=Module["wasmModule"];Module["wasmModule"]=null;var instance=new WebAssembly.Instance(module,info);return receiveInstance(instance)};self.onunhandledrejection=e=>{throw e.reason||e};function handleMessage(e){try{if(e.data.cmd==="load"){let messageQueue=[];self.onmessage=e=>messageQueue.push(e);self.startWorker=instance=>{postMessage({"cmd":"loaded"});for(let msg of messageQueue){handleMessage(msg)}self.onmessage=handleMessage};Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=(...args)=>{postMessage({cmd:"callHandler",handler:handler,args:args})}}Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob=="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["__emscripten_thread_mailbox_await"](e.data.pthread_ptr);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){Module["__embind_initialize_bindings"]();initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){throw ex}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="checkMailbox"){if(initializedJS){Module["checkMailbox"]()}}else if(e.data.cmd){err(`worker.js received unknown command ${e.data.cmd}`);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}}self.onmessage=handleMessage; |
@@ -1,1 +0,1 @@ | ||
SDC_WASM_JS_VERSION="6.25.0";"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:f=>(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f),postMessage:msg=>parentPort.postMessage(msg),performance:global.performance||{now:Date.now}})}var initializedJS=false;function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+"\n");return}console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var module=Module["wasmModule"];Module["wasmModule"]=null;var instance=new WebAssembly.Instance(module,info);return receiveInstance(instance)};self.onunhandledrejection=e=>{throw e.reason||e};function handleMessage(e){try{if(e.data.cmd==="load"){let messageQueue=[];self.onmessage=e=>messageQueue.push(e);self.startWorker=instance=>{postMessage({"cmd":"loaded"});for(let msg of messageQueue){handleMessage(msg)}self.onmessage=handleMessage};Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=(...args)=>{postMessage({cmd:"callHandler",handler:handler,args:args})}}Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob=="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["__emscripten_thread_mailbox_await"](e.data.pthread_ptr);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){Module["__embind_initialize_bindings"]();initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){throw ex}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="checkMailbox"){if(initializedJS){Module["checkMailbox"]()}}else if(e.data.cmd){err(`worker.js received unknown command ${e.data.cmd}`);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}}self.onmessage=handleMessage; | ||
SDC_WASM_JS_VERSION="6.26.0-beta.1";"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:f=>(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f),postMessage:msg=>parentPort.postMessage(msg),performance:global.performance||{now:Date.now}})}var initializedJS=false;function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+"\n");return}console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var module=Module["wasmModule"];Module["wasmModule"]=null;var instance=new WebAssembly.Instance(module,info);return receiveInstance(instance)};self.onunhandledrejection=e=>{throw e.reason||e};function handleMessage(e){try{if(e.data.cmd==="load"){let messageQueue=[];self.onmessage=e=>messageQueue.push(e);self.startWorker=instance=>{postMessage({"cmd":"loaded"});for(let msg of messageQueue){handleMessage(msg)}self.onmessage=handleMessage};Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=(...args)=>{postMessage({cmd:"callHandler",handler:handler,args:args})}}Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob=="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["__emscripten_thread_mailbox_await"](e.data.pthread_ptr);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){Module["__embind_initialize_bindings"]();initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){throw ex}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="checkMailbox"){if(initializedJS){Module["checkMailbox"]()}}else if(e.data.cmd){err(`worker.js received unknown command ${e.data.cmd}`);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}}self.onmessage=handleMessage; |
import type { Serializable } from "scandit-web-datacapture-core/build/js/private/Serializable"; | ||
import type { SupportedSides } from "../Enums"; | ||
import { DrivingLicenseDetails } from "./DrivingLicenseDetails"; | ||
import type { VIZResultJSON } from "../SerializedTypes"; | ||
export declare class VIZResult implements Serializable<VIZResultJSON> { | ||
protected json: VIZResultJSON; | ||
get firstName(): string | null; | ||
get lastName(): string | null; | ||
get secondaryLastName(): string | null; | ||
get fullName(): string; | ||
get additionalAddressInformation(): string | null; | ||
@@ -24,4 +29,5 @@ get additionalNameInformation(): string | null; | ||
get isBackSideCaptureSupported(): boolean; | ||
get drivingLicenseDetails(): DrivingLicenseDetails | null; | ||
private static fromJSON; | ||
toJSONObject(): VIZResultJSON; | ||
} |
@@ -93,2 +93,3 @@ export declare enum CapturedResultType { | ||
DLVIZ = "dlViz", | ||
HealthInsuranceCardVIZ = "healthInsuranceCardViz", | ||
IdCardMRZ = "idCardMrz", | ||
@@ -119,2 +120,6 @@ IdCardVIZ = "idCardViz", | ||
} | ||
export declare enum IdCaptureTrigger { | ||
Auto = "auto", | ||
ButtonTap = "buttonTap" | ||
} | ||
export declare enum IdLayout { | ||
@@ -121,0 +126,0 @@ TD1 = "td1", |
@@ -8,5 +8,12 @@ import type { DataCaptureContext, DataCaptureMode, DataCaptureModeJSON, FrameData } from "scandit-web-datacapture-core"; | ||
import type { IdCaptureSettings, IdCaptureSettingsJSON } from "./IdCaptureSettings"; | ||
import { CapturedId } from "./captured-id/CapturedId"; | ||
type IdCaptureJSON = DataCaptureModeJSON<IdCaptureSettingsJSON>; | ||
export declare const STATE: { | ||
readonly Available: "Available"; | ||
readonly ProcessingFrame: "ProcessingFrame"; | ||
readonly ProcessingQueue: "ProcessingQueue"; | ||
}; | ||
export declare class IdCapture implements DataCaptureMode, Serializable<IdCaptureJSON> { | ||
private readonly type; | ||
private state; | ||
private _isEnabled; | ||
@@ -16,3 +23,5 @@ private settings; | ||
private listeners; | ||
private overlayListeners; | ||
private _centaurusConnector?; | ||
private _endOfCycleTasks; | ||
private _feedback; | ||
@@ -25,4 +34,5 @@ private readonly _onProcessFrameListener; | ||
get feedback(): IdCaptureFeedback; | ||
private get privateContext(); | ||
static forContext(context: DataCaptureContext | null, settings: IdCaptureSettings): Promise<IdCapture>; | ||
setFeedback(feedback: IdCaptureFeedback): Promise<void>; | ||
static forContext(context: DataCaptureContext | null, settings: IdCaptureSettings): Promise<IdCapture>; | ||
addListener(listener: IdCaptureListener): void; | ||
@@ -33,6 +43,10 @@ removeListener(listener: IdCaptureListener): void; | ||
reset(): Promise<void>; | ||
setScanning(isScanning: boolean): Promise<void>; | ||
isScanning(): Promise<boolean>; | ||
applySettings(settings: IdCaptureSettings): Promise<void>; | ||
parse(code: string): Promise<CapturedId | null>; | ||
toJSONObject(): IdCaptureJSON; | ||
private moveToState; | ||
private doReset; | ||
private doApplySettings; | ||
private addOverlayListener; | ||
private removeOverlayListener; | ||
/** | ||
@@ -42,5 +56,20 @@ * If settings include VIZ document but the SDK was not configured with "VIZEnabled: true", we throw. | ||
private checkCaptureSettingsAgainstSDKConfiguration; | ||
/** | ||
* Called many times by the DataCaptureContext when it receives a frame to process. | ||
* | ||
* To avoid any synchronization issue between Centaurus and SDC, we only process one frame at a time and don't allow | ||
* any other asynchronous operation (like reset()) while a frame is being processed both by Centaurus and SDC. | ||
* Any incoming async operation should be performed after the frame was processed, or before we process the next | ||
* frame. | ||
* The end of the frame processing is notified by the DataCaptureContext through the "onFrameProcessingFinished" | ||
* event. | ||
* @param frame FrameCapture | ||
* @returns A promise informing the Context on the next steps to undertake. | ||
*/ | ||
private onProcessFrame; | ||
private doProcessFrame; | ||
private onAfterProcessFrame; | ||
private enqueueTask; | ||
private processQueue; | ||
private documentsIncludeVIZDocuments; | ||
private runWorkerCommand; | ||
private attachedToContext; | ||
@@ -47,0 +76,0 @@ private detachedFromContext; |
@@ -5,3 +5,4 @@ export declare enum IdCaptureErrorCode { | ||
InvalidLicenseKeyForVIZProcessing = "InvalidLicenseKeyForVIZProcessing", | ||
InvalidSettingsForVIZProcessing = "InvalidSettingsForVIZProcessing" | ||
InvalidSettingsForVIZProcessing = "InvalidSettingsForVIZProcessing", | ||
InvalidLicenseKeyForParser = "InvalidLicenseKeyForParser" | ||
} | ||
@@ -8,0 +9,0 @@ export declare class IdCaptureError extends Error { |
@@ -19,2 +19,5 @@ import type { BrushJSON, DataCaptureOverlay, DataCaptureView } from "scandit-web-datacapture-core"; | ||
moveFurtherAwayTextHint: string; | ||
tapShutterToScanTextHint: string; | ||
lookingForDocumentTextHint: string; | ||
holdStillTextHint: string; | ||
} | ||
@@ -24,2 +27,3 @@ export declare class IdCaptureOverlay implements DataCaptureOverlay, Serializable<IdCaptureOverlayJSON> { | ||
private idCapture; | ||
private view?; | ||
private _idLayout; | ||
@@ -39,2 +43,10 @@ private _idLayoutStyle; | ||
private _moveFurtherAwayTextHint; | ||
private _tapShutterToScanTextHint; | ||
private _lookingForDocumentTextHint; | ||
private _holdStillTextHint; | ||
private shutterWidget; | ||
private onShutterPositionUpdateListener; | ||
private onShutterButtonStateChangedListener; | ||
private readonly onContextUpdatedListener; | ||
private readonly overlayListener; | ||
get idLayoutStyle(): IdLayoutStyle; | ||
@@ -75,2 +87,6 @@ set idLayoutStyle(style: IdLayoutStyle); | ||
toJSONObject(): IdCaptureOverlayJSON; | ||
private installShutterButton; | ||
private onContextUpdated; | ||
private onShutterPositionUpdate; | ||
private onShutterButtonStateChanged; | ||
} |
import type { JSONType } from "scandit-web-datacapture-core"; | ||
import type { Serializable } from "scandit-web-datacapture-core/build/js/private/Serializable"; | ||
import type { IdDocumentType, IdImageType } from "./Enums"; | ||
import { IdAnonymizationMode, SupportedSides } from "./Enums"; | ||
import { IdAnonymizationMode, SupportedSides, IdCaptureTrigger } from "./Enums"; | ||
export interface IdCaptureSettingsJSON { | ||
@@ -12,3 +12,5 @@ licenseKey: string; | ||
anonymizationMode: IdAnonymizationMode; | ||
captureTrigger: IdCaptureTrigger; | ||
rejectVoidedIds: boolean; | ||
decodeBackOfEuropeanDrivingLicense: boolean; | ||
properties: Record<string, JSONType>; | ||
@@ -20,3 +22,5 @@ } | ||
anonymizationMode: IdAnonymizationMode; | ||
captureTrigger: IdCaptureTrigger; | ||
rejectVoidedIds: boolean; | ||
decodeBackOfEuropeanDrivingLicense: boolean; | ||
private properties; | ||
@@ -23,0 +27,0 @@ private imageToResult; |
@@ -24,2 +24,4 @@ import "./scandit-web-datacapture-id-private"; | ||
export * from "./captured-id/DateResult"; | ||
export * from "./captured-id/DrivingLicenseCategory"; | ||
export * from "./captured-id/DrivingLicenseDetails"; | ||
export * from "./captured-id/ImageInfo"; | ||
@@ -26,0 +28,0 @@ export * from "./captured-id/LocalizedOnlyId"; |
/* This file is auto-generated by the build process */ | ||
declare module "scandit-web-datacapture-id-private" { | ||
type CentaurusLoader<C = any> = any; | ||
type ShutterButtonState<C = any> = any; | ||
} |
@@ -17,2 +17,12 @@ import type { QuadrilateralJSON } from "scandit-web-datacapture-core"; | ||
} | ||
export interface DrivingLicenseCategoryJSON { | ||
code: string; | ||
dateOfIssue: DateResultJSON | null; | ||
dateOfExpiry: DateResultJSON | null; | ||
} | ||
export interface DrivingLicenseDetailsJSON { | ||
drivingLicenseCategories: DrivingLicenseCategoryJSON[]; | ||
restrictions: string | null; | ||
endorsements: string | null; | ||
} | ||
export interface ImageInfoJSON { | ||
@@ -26,2 +36,3 @@ face: string | null; | ||
lastName: string | null; | ||
secondaryLastName: string | null; | ||
fullName: string; | ||
@@ -264,2 +275,3 @@ sex: string | null; | ||
isBackSideCaptureSupported: boolean; | ||
drivingLicenseDetails: DrivingLicenseDetailsJSON | null; | ||
} | ||
@@ -266,0 +278,0 @@ export interface IdCaptureErrorJSON { |
@@ -6,3 +6,6 @@ export declare const translations: { | ||
"id.idCaptureOverlay.moveFurtherAwayTextHint": string; | ||
"id.idCaptureOverlay.tapShutterToScan": string; | ||
"id.idCaptureOverlay.lookingForDocument": string; | ||
"id.idCaptureOverlay.holdStill": string; | ||
}; | ||
export type Translations = typeof translations; |
@@ -1,4 +0,4 @@ | ||
import { DataCaptureEngine as CoreDataCaptureEngine } from "scandit-web-datacapture-core/build/js/worker/index"; | ||
import type { UpdateContextParameters, CaptureModeDeserializerInstance, ModuleHandler, Vector, WorkerFunctions as BaseWorkerFunctions, ProcessFrameParameters, WasmFrameData } from "scandit-web-datacapture-core/build/js/worker/index"; | ||
import type { CapturedIdJSONWithoutCommonFieldsJSON, DataCaptureCallbackMessage, EngineWorkerResponse, IdCaptureSessionHolder, Module } from "./dataCaptureWorkerRelated"; | ||
import { DataCaptureEngine as CoreDataCaptureEngine } from "scandit-web-datacapture-core/build/js/worker/index.js"; | ||
import type { CapturedIdCommonFieldsGetters, CapturedIdJSONWithoutCommonFieldsJSON, DataCaptureCallbackMessage, EngineWorkerResponse, IdCaptureSessionHolder, Module, ParseResult } from "./dataCaptureWorkerRelated"; | ||
import type { IdCaptureSettingsJSON } from "../IdCaptureSettings"; | ||
@@ -25,5 +25,4 @@ import type { AamvaBarcodeVerificationResultJSON, AamvaVizBarcodeComparisonResultJSON, CapturedIdJSON, IdCaptureSessionJSON, VizMrzComparisonResultJSON } from "../SerializedTypes"; | ||
idCaptureReset(): Promise<void>; | ||
idCaptureSetScanning(isScanning: boolean): void; | ||
idCaptureIsScanning(): boolean; | ||
idCaptureApplySettings(settings: IdCaptureSettingsJSON): Promise<void>; | ||
idCaptureParse(code: string): Promise<EngineWorkerResponse<"idCaptureParse">>; | ||
idCaptureVerifyAamvaCapture(capturedId: CapturedIdJSON): EngineWorkerResponse<"idCaptureVerifyAamvaCapture">; | ||
@@ -49,4 +48,2 @@ idCaptureVerifyVizMrzCapture(capturedId: CapturedIdJSON): EngineWorkerResponse<"idCaptureVerifyVizMrzCapture">; | ||
private lastDetectionIssue; | ||
private resetRequestDeferred?; | ||
private forceResetTimer; | ||
private readonly coreEngine; | ||
@@ -65,5 +62,4 @@ private readonly Module; | ||
applySettings(settings: IdCaptureSettingsJSON): Promise<void>; | ||
reset(): Promise<void>; | ||
setScanning(isScanning: boolean): void; | ||
isScanning(): boolean; | ||
reset(): void; | ||
parse(code: string): ParseResult | null; | ||
idCaptureVerifyAamvaCapture(capturedId: CapturedIdJSON): AamvaVizBarcodeComparisonResultJSON | null; | ||
@@ -78,2 +74,3 @@ idCaptureVerifyVizMrzCapture(capturedId: CapturedIdJSON): VizMrzComparisonResultJSON | null; | ||
onResetFromSDC(): void; | ||
setDetectionOnlyMode(detectionOnlyMode: boolean): void; | ||
onSessionUpdated(session: IdCaptureSessionHolder, frameData: WasmFrameData): void; | ||
@@ -86,5 +83,8 @@ onIdCapturedCallback(session: IdCaptureSessionHolder, frameData: WasmFrameData): void; | ||
buildCapturedIdFromSession(session: IdCaptureSessionHolder, partialCapturedId: CapturedIdJSONWithoutCommonFieldsJSON | null): CapturedIdJSON | null; | ||
buildCapturedIdFromCommonFields(capturedIdCommonFields: CapturedIdCommonFieldsGetters | null, partialCapturedId: CapturedIdJSONWithoutCommonFieldsJSON | null): CapturedIdJSON | null; | ||
onIdLocalizedCallback(session: IdCaptureSessionHolder, frameData: WasmFrameData): void; | ||
onIdRejectedCallback(session: IdCaptureSessionHolder, frameData: WasmFrameData): void; | ||
onIdCaptureTimedOutCallback(session: IdCaptureSessionHolder, frameData: WasmFrameData): void; | ||
onShutterButtonPositionChangedCallback(position: string): void; | ||
onShutterButtonStateChangedCallback(state: string): void; | ||
/** | ||
@@ -91,0 +91,0 @@ * The session holder contains everything except the common fields for the captured id, which have to be |
@@ -1,12 +0,16 @@ | ||
import type { PrivateLoadableFrameData } from "scandit-web-datacapture-core"; | ||
import type { PrivateLoadableFrameData, Rect } from "scandit-web-datacapture-core"; | ||
import type { AnyDataCaptureActionMessage as CoreAnyDataCaptureActionMessage, CaptureModeDeserializerInstance, DataCaptureActionMessageKey as CoreDataCaptureActionMessageKey, DataCaptureCallbackMessage as CoreDataCaptureCallbackMessage, DataCaptureCallbackMessageKeys as CoreDataCaptureCallbackMessageKeys, EmscriptenClassHandle, Module as CoreModule, WasmFrameData, WorkerResponse as CoreWorkerResponse } from "scandit-web-datacapture-core/build/js/worker/index"; | ||
import type { IdCaptureSettingsJSON } from "../IdCaptureSettings"; | ||
import type { CapturedIdCommonFieldsJSON, AamvaBarcodeVerificationResultJSON, AamvaVizBarcodeComparisonResultJSON, CapturedIdJSON, IdCaptureSessionJSON, VizMrzComparisonResultJSON } from "../SerializedTypes"; | ||
import type { ShutterButtonState } from "scandit-web-datacapture-id-private"; | ||
/** | ||
* MESSAGES (ACTIONS) SENT TO THE WORKER | ||
*/ | ||
export type DataCaptureActionMessageKey = CoreDataCaptureActionMessageKey | "idCaptureApplySettings" | "idCaptureBarcodeVerifyAamvaCapture" | "idCaptureReset" | "idCaptureSetLastDetectionIssue" | "idCaptureSetLastError" | "idCaptureSetLastLocalizedId" | "idCaptureSetLastResult" | "idCaptureVerifyAamvaCapture" | "idCaptureVerifyVizMrzCapture" | "idCaptureSetScanning" | "idCaptureIsScanning"; | ||
export type DataCaptureActionMessageKey = CoreDataCaptureActionMessageKey | "idCaptureApplySettings" | "idCaptureBarcodeVerifyAamvaCapture" | "idCaptureParse" | "idCaptureReset" | "idCaptureSetLastDetectionIssue" | "idCaptureSetLastError" | "idCaptureSetLastLocalizedId" | "idCaptureSetLastResult" | "idCaptureVerifyAamvaCapture" | "idCaptureVerifyVizMrzCapture"; | ||
export interface IdCaptureVerifyAamvaCaptureResponse { | ||
result: AamvaVizBarcodeComparisonResultJSON | null; | ||
} | ||
export interface IdCaptureParseResponse { | ||
result: ParseResult | null; | ||
} | ||
export interface IdCaptureVerifyVizMrzCaptureResponse { | ||
@@ -22,3 +26,3 @@ result: VizMrzComparisonResultJSON | null; | ||
} | ||
export type WorkerResponse<C extends DataCaptureActionMessageKey> = C extends "idCaptureVerifyAamvaCapture" ? IdCaptureVerifyAamvaCaptureResponse : C extends "idCaptureBarcodeVerifyAamvaCapture" ? IdCaptureBarcodeVerifyAamvaCaptureResponse : C extends "idCaptureVerifyVizMrzCapture" ? IdCaptureVerifyVizMrzCaptureResponse : CoreWorkerResponse<C>; | ||
export type WorkerResponse<C extends DataCaptureActionMessageKey> = C extends "idCaptureVerifyAamvaCapture" ? IdCaptureVerifyAamvaCaptureResponse : C extends "idCaptureBarcodeVerifyAamvaCapture" ? IdCaptureBarcodeVerifyAamvaCaptureResponse : C extends "idCaptureVerifyVizMrzCapture" ? IdCaptureVerifyVizMrzCaptureResponse : C extends "idCaptureParse" ? IdCaptureParseResponse : CoreWorkerResponse<C>; | ||
interface DataCaptureActionMessage { | ||
@@ -51,2 +55,6 @@ command: DataCaptureActionMessageKey; | ||
} | ||
export interface IdCaptureParseDataCaptureAction extends DataCaptureActionMessage { | ||
command: "idCaptureParse"; | ||
code: string; | ||
} | ||
export interface IdCaptureVerifyAamvaCaptureDataCaptureAction extends DataCaptureActionMessage { | ||
@@ -64,14 +72,7 @@ command: "idCaptureVerifyAamvaCapture"; | ||
} | ||
export interface IdCaptureSetScanningDataCaptureAction extends DataCaptureActionMessage { | ||
command: "idCaptureSetScanning"; | ||
isScanning: boolean; | ||
} | ||
export interface IdCaptureIsScanningDataCaptureAction extends DataCaptureActionMessage { | ||
command: "idCaptureIsScanning"; | ||
} | ||
export type AnyDataCaptureActionMessage = CoreAnyDataCaptureActionMessage | IdCaptureApplySettingsDataCaptureAction | IdCaptureBarcodeVerifyAamvaCaptureDataCaptureAction | IdCaptureResetDataCaptureAction | IdCaptureSetLastDetectionIssueDataCaptureAction | IdCaptureSetLastErrorDataCaptureAction | IdCaptureSetLastLocalizedIdDataCaptureAction | IdCaptureSetLastResultDataCaptureAction | IdCaptureVerifyAamvaCaptureDataCaptureAction | IdCaptureVerifyVizMrzCaptureDataCaptureAction | IdCaptureSetScanningDataCaptureAction | IdCaptureIsScanningDataCaptureAction; | ||
export type AnyDataCaptureActionMessage = CoreAnyDataCaptureActionMessage | IdCaptureApplySettingsDataCaptureAction | IdCaptureBarcodeVerifyAamvaCaptureDataCaptureAction | IdCaptureParseDataCaptureAction | IdCaptureResetDataCaptureAction | IdCaptureSetLastDetectionIssueDataCaptureAction | IdCaptureSetLastErrorDataCaptureAction | IdCaptureSetLastLocalizedIdDataCaptureAction | IdCaptureSetLastResultDataCaptureAction | IdCaptureVerifyAamvaCaptureDataCaptureAction | IdCaptureVerifyVizMrzCaptureDataCaptureAction; | ||
/** | ||
* MESSAGES EMITTED BY THE WORKER | ||
*/ | ||
type DataCaptureCallbackMessageKeys = CoreDataCaptureCallbackMessageKeys | "idCaptureDidCaptureId" | "idCaptureDidLocalizeId" | "idCaptureDidRejectId" | "idCaptureDidTimedOut" | "idCaptureDidUpdateSession" | "idCaptureIdCapturedFeedback" | "idCaptureIdCaptureTimeoutFeedback" | "idCaptureIdRejectedFeedback" | "idCaptureBackendReset"; | ||
type DataCaptureCallbackMessageKeys = CoreDataCaptureCallbackMessageKeys | "idCaptureBackendReset" | "idCaptureDetectionOnlyMode" | "idCaptureDidCaptureId" | "idCaptureDidLocalizeId" | "idCaptureDidRejectId" | "idCaptureDidShutterButtonPositionChanged" | "idCaptureDidShutterButtonStateChanged" | "idCaptureDidTimedOut" | "idCaptureDidUpdateSession" | "idCaptureIdCapturedFeedback" | "idCaptureIdCaptureTimeoutFeedback" | "idCaptureIdRejectedFeedback" | "IdCaptureProcessFrameWithCentaurus"; | ||
interface BaseDataCaptureCallbackMessage { | ||
@@ -115,2 +116,14 @@ type: DataCaptureCallbackMessageKeys; | ||
} | ||
interface IdCaptureDidShutterButtonPositionChanged extends BaseDataCaptureCallbackMessage { | ||
type: "idCaptureDidShutterButtonPositionChanged"; | ||
payload: { | ||
position: Rect; | ||
}; | ||
} | ||
interface IdCaptureDidShutterButtonStateChanged extends BaseDataCaptureCallbackMessage { | ||
type: "idCaptureDidShutterButtonStateChanged"; | ||
payload: { | ||
state: ShutterButtonState; | ||
}; | ||
} | ||
interface IdCaptureIdCapturedFeedback extends BaseDataCaptureCallbackMessage { | ||
@@ -128,5 +141,18 @@ type: "idCaptureIdCapturedFeedback"; | ||
} | ||
export type DataCaptureCallbackMessage = CoreDataCaptureCallbackMessage | IdCaptureDidCapture | IdCaptureDidLocalizeId | IdCaptureDidReject | IdCaptureDidTimedOut | IdCaptureDidUpdateSession | IdCaptureIdCapturedFeedback | IdCaptureIdCaptureTimeoutFeedback | IdCaptureIdRejectedFeedback | IdCaptureBackendReset; | ||
interface IdCaptureDetectionOnlyMode extends BaseDataCaptureCallbackMessage { | ||
type: "idCaptureDetectionOnlyMode"; | ||
payload: { | ||
detectionOnlyMode: boolean; | ||
}; | ||
} | ||
export type DataCaptureCallbackMessage = CoreDataCaptureCallbackMessage | IdCaptureBackendReset | IdCaptureDetectionOnlyMode | IdCaptureDidCapture | IdCaptureDidLocalizeId | IdCaptureDidReject | IdCaptureDidShutterButtonPositionChanged | IdCaptureDidShutterButtonStateChanged | IdCaptureDidTimedOut | IdCaptureDidUpdateSession | IdCaptureIdCapturedFeedback | IdCaptureIdCaptureTimeoutFeedback | IdCaptureIdRejectedFeedback; | ||
export type PayloadByType<T> = T extends "didCaptureId" ? IdCaptureDidCapture["payload"] : T extends "didRejectId" ? IdCaptureDidReject["payload"] : T extends "didLocalizeId" ? IdCaptureDidLocalizeId["payload"] : never; | ||
export type CapturedIdJSONWithoutCommonFieldsJSON = Omit<CapturedIdJSON, keyof CapturedIdCommonFieldsJSON>; | ||
export type ParseResult = { | ||
status: "success"; | ||
capturedId: CapturedIdJSON; | ||
} | { | ||
status: "error"; | ||
error: string; | ||
}; | ||
/** | ||
@@ -153,3 +179,3 @@ * OTHERS | ||
} | ||
interface CapturedIdCommonFieldsGetters extends Pick<EmscriptenClassHandle, "delete"> { | ||
export interface CapturedIdCommonFieldsGetters extends Pick<EmscriptenClassHandle, "delete"> { | ||
getFirstName: () => OptionalValueHolder<string>; | ||
@@ -173,2 +199,11 @@ getLastName: () => OptionalValueHolder<string>; | ||
} | ||
interface ResultOk<T> { | ||
ok: () => true; | ||
value: () => T; | ||
} | ||
interface ResultFail<E> { | ||
ok: () => false; | ||
error: () => E; | ||
} | ||
export type FailableResult<T, E> = ResultFail<E> | ResultOk<T>; | ||
interface HasValueHolder<T> { | ||
@@ -188,9 +223,11 @@ has_value: () => true; | ||
} | ||
export interface CapturedIdHolder extends CapturedIdCommonFieldsGetters { | ||
toJson: () => string; | ||
} | ||
export interface SDCIdCaptureMode extends EmscriptenClassHandle { | ||
reset: () => void; | ||
setScanning: (isScanning: boolean) => void; | ||
isScanning: () => boolean; | ||
applySettings: (settings: string) => void; | ||
addListener: (listener: unknown) => void; | ||
setFeedbacks: (idCaptured: unknown, idRejected: unknown, idCaptureTimeout: unknown) => void; | ||
parse: (code: string) => FailableResult<CapturedIdHolder | null, string>; | ||
} | ||
@@ -212,2 +249,4 @@ interface BarcodeVerificationResponse { | ||
onIdCaptureTimedOut: (idCapture: unknown, session: IdCaptureSessionHolder, frameData: WasmFrameData) => void; | ||
onShutterButtonPositionChanged: (position: string) => void; | ||
onShutterButtonStateChanged: (state: string) => void; | ||
}) => new () => EmscriptenClassHandle; | ||
@@ -231,2 +270,3 @@ }; | ||
reset: () => void; | ||
setDetectionOnlyMode: (detectionOnly: boolean) => void; | ||
}) => new () => { | ||
@@ -265,2 +305,4 @@ delete: () => void; | ||
} | ||
export declare function getValueFromFailable<T, E, U>(holder: FailableResult<T, E>, defaultValue: U): T | U; | ||
export declare function getErrorFromFailable<T, E, U>(holder: FailableResult<T, E>, defaultValue: U): E | U; | ||
export declare function getValueFromOptional<T, U>(holder: OptionalValueHolder<T>, defaultValue: U): T | U; | ||
@@ -267,0 +309,0 @@ export type EngineWorkerResponse<C extends DataCaptureActionMessageKey> = WorkerResponse<C> extends Promise<void> | void ? Promise<void> | void : { |
import type { ModuleHandler } from "scandit-web-datacapture-core/build/js/worker/index"; | ||
import { WorkerMain as CoreWorkerMain } from "scandit-web-datacapture-core/build/js/worker/index"; | ||
import { WorkerMain as CoreWorkerMain } from "scandit-web-datacapture-core/build/js/worker/index.js"; | ||
import { DataCaptureEngine } from "./dataCaptureEngine"; | ||
@@ -4,0 +4,0 @@ import type { AnyDataCaptureActionMessage, AugmentedWorker, DataCaptureActionMessageKey, Module } from "./dataCaptureWorkerRelated"; |
{ | ||
"name": "scandit-web-datacapture-id", | ||
"version": "6.25.0", | ||
"version": "6.26.0-beta.1", | ||
"description": "Scandit Data Capture SDK for the Web", | ||
@@ -104,4 +104,4 @@ "license": "SEE LICENSE IN LICENSE", | ||
"peerDependencies": { | ||
"scandit-web-datacapture-core": "6.25.0" | ||
"scandit-web-datacapture-core": "6.26.0-beta.1" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
72327342
88
5833
7
210