@incodetech/core 0.0.0-dev-20260218-e020e1c → 0.0.0-dev-20260219-dfbf2ff

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/StateMachine-DKxvdEuI.d.ts +2 -0
  2. package/dist/authentication.d.ts +4 -3
  3. package/dist/authentication.esm.js +6 -6
  4. package/dist/backCameraStream-DhKbn3gt.esm.js +337 -0
  5. package/dist/curp-validation.d.ts +1 -1
  6. package/dist/curp-validation.esm.js +2 -2
  7. package/dist/{deepsightLoader-Bf15_5Gk.esm.js → deepsightLoader-DRQJKHl8.esm.js} +3 -3
  8. package/dist/{deepsightService-B3FfuHt1.d.ts → deepsightService-BLejzhoL.d.ts} +1 -79
  9. package/dist/{deepsightService-jsdRuf0u.esm.js → deepsightService-CZC8YaHN.esm.js} +2 -2
  10. package/dist/email.esm.js +2 -2
  11. package/dist/{events-BvAMgEuE.esm.js → events-mFVnFpqq.esm.js} +1 -1
  12. package/dist/face-match.esm.js +2 -2
  13. package/dist/{faceCaptureManagerFactory-1AAwvEWC.d.ts → faceCaptureManagerFactory-BqvUNJXR.d.ts} +4 -2
  14. package/dist/{faceCaptureSetup-Cz44Uo-J.esm.js → faceCaptureSetup-Bxot-Bxs.esm.js} +8 -7
  15. package/dist/flow.d.ts +3 -2
  16. package/dist/flow.esm.js +1 -1
  17. package/dist/government-validation.esm.js +1 -1
  18. package/dist/{id-DtrUp5nz.esm.js → id-DHFXeDku.esm.js} +23 -263
  19. package/dist/id.d.ts +5 -5
  20. package/dist/id.esm.js +8 -8
  21. package/dist/{index-DDMN1YD_.d.ts → index-D0Zj8bRR.d.ts} +4 -60
  22. package/dist/index.d.ts +6 -5
  23. package/dist/index.esm.js +8 -8
  24. package/dist/phone.esm.js +2 -2
  25. package/dist/selfie.d.ts +82 -4
  26. package/dist/selfie.esm.js +6 -6
  27. package/dist/{stats-Bv2CLzQ0.esm.js → stats-C0Z_4KzW.esm.js} +1 -1
  28. package/dist/stats.esm.js +2 -2
  29. package/dist/{StateMachine-CvjqRbSg.d.ts → warmup-oXQm8EFM.d.ts} +1 -4
  30. package/package.json +1 -1
  31. package/dist/streamingEvents-Bl2HRhLD.esm.js +0 -104
  32. /package/dist/{api-CmRbOLxk.esm.js → api-Cqrn4bGi.esm.js} +0 -0
  33. /package/dist/{types-DFgUJtIJ.d.ts → types-DeUPfNsF.d.ts} +0 -0
@@ -1,17 +1,11 @@
1
- import { d as addEvent, m as revokeObjectURL, n as eventModuleNames } from "./events-BvAMgEuE.esm.js";
2
- import { C as enumerateVideoDevices, E as createManager, F as isSafari, M as isDesktop, N as isIOS, P as isIPhone14OrHigher, S as applyTrackConstraints, T as stopCameraStream, _ as StreamCanvasProcessingSession, c as OpenViduRecordingProvider, d as IpifyProvider, f as FingerprintProvider, g as BrowserEnvironmentProvider, h as BrowserInfoProvider, j as isAndroid, k as getWindowDimensions, m as BrowserStorageProvider, n as DEFAULT_ID_CAPTURE_THRESHOLDS, p as BrowserTimerProvider, t as DEFAULT_ID_CAPTURE_MODEL_VERSION, v as StreamCanvasCapture, w as requestCameraAccess, x as IncodeCanvas } from "./src-CKB3MNL0.esm.js";
1
+ import { d as addEvent, m as revokeObjectURL, n as eventModuleNames } from "./events-mFVnFpqq.esm.js";
2
+ import { a as stopRecording$1, c as requestPermission, i as startRecording, l as getDeviceClass, n as streamingEvents, r as createRecordingSession, s as checkPermission, t as getBackCameraStream } from "./backCameraStream-DhKbn3gt.esm.js";
3
+ import { E as createManager, M as isDesktop, _ as StreamCanvasProcessingSession, c as OpenViduRecordingProvider, d as IpifyProvider, f as FingerprintProvider, g as BrowserEnvironmentProvider, h as BrowserInfoProvider, i as IdCaptureProvider, k as getWindowDimensions, m as BrowserStorageProvider, n as DEFAULT_ID_CAPTURE_THRESHOLDS, p as BrowserTimerProvider, t as DEFAULT_ID_CAPTURE_MODEL_VERSION, v as StreamCanvasCapture, x as IncodeCanvas } from "./src-CKB3MNL0.esm.js";
3
4
  import { a as fromPromise, i as fromCallback, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
4
- import { c as getDeviceClass, i as stopRecording$1, n as createRecordingSession, o as checkPermission, r as startRecording, s as requestPermission, t as streamingEvents } from "./streamingEvents-Bl2HRhLD.esm.js";
5
- import { n as isBrowserSimulation } from "./deepsightService-jsdRuf0u.esm.js";
6
- import { n as getApi, r as getToken, t as api } from "./api-CmRbOLxk.esm.js";
7
- import { t as addDeviceStats } from "./stats-Bv2CLzQ0.esm.js";
5
+ import { n as isBrowserSimulation } from "./deepsightService-CZC8YaHN.esm.js";
6
+ import { n as getApi, r as getToken, t as api } from "./api-Cqrn4bGi.esm.js";
7
+ import { t as addDeviceStats } from "./stats-C0Z_4KzW.esm.js";
8
8
 
9
- //#region ../infra/src/capabilities/ITimerCapability.ts
10
- function sleep(ms) {
11
- return new Promise((resolve) => setTimeout(resolve, ms));
12
- }
13
-
14
- //#endregion
15
9
  //#region src/internal/session/sessionService.ts
16
10
  /**
17
11
  * Creates a new onboarding session.
@@ -258,230 +252,8 @@ async function postDeviceStats(stats) {
258
252
 
259
253
  //#endregion
260
254
  //#region src/modules/id/idCameraStream.ts
261
- const BACK_CAMERA_KEYWORDS = [
262
- "rear",
263
- "back",
264
- "rück",
265
- "arrière",
266
- "trasera",
267
- "trás",
268
- "traseira",
269
- "posteriore",
270
- "后面",
271
- "後面",
272
- "背面",
273
- "后置",
274
- "後置",
275
- "背置",
276
- "задней",
277
- "الخلفية",
278
- "후",
279
- "arka",
280
- "achterzijde",
281
- "หลัง",
282
- "baksidan",
283
- "bagside",
284
- "sau",
285
- "bak",
286
- "tylny",
287
- "takakamera",
288
- "belakang",
289
- "אחורית",
290
- "πίσω",
291
- "spate",
292
- "hátsó",
293
- "zadní",
294
- "darrere",
295
- "zadná",
296
- "задня",
297
- "stražnja",
298
- "बैक"
299
- ];
300
- function isBackCameraLabel(label) {
301
- const lowercaseLabel = label.toLowerCase();
302
- return BACK_CAMERA_KEYWORDS.some((keyword) => lowercaseLabel.includes(keyword));
303
- }
304
- function classifyCamera(device, index, totalDevices) {
305
- let cameraType;
306
- if (device.label === "") cameraType = totalDevices === 1 || index + 1 <= totalDevices / 2 ? "front" : "back";
307
- else cameraType = isBackCameraLabel(device.label) ? "back" : "front";
308
- return {
309
- deviceId: device.deviceId,
310
- label: device.label,
311
- cameraType
312
- };
313
- }
314
- async function getCameras() {
315
- const videoDevices = await enumerateVideoDevices();
316
- const cameras = videoDevices.map((d, i) => classifyCamera(d, i, videoDevices.length));
317
- if (cameras.length > 1 && !cameras.some((c) => c.cameraType === "back")) {
318
- const resolutions = cameras.map((c) => {
319
- const match = c.label.match(/\b([0-9]+)MP?\b/i);
320
- return match ? parseInt(match[1], 10) : NaN;
321
- });
322
- let backCameraIndex = cameras.length - 1;
323
- if (!resolutions.some(isNaN)) backCameraIndex = resolutions.lastIndexOf(Math.max(...resolutions));
324
- cameras[backCameraIndex].cameraType = "back";
325
- }
326
- return cameras;
327
- }
328
- function selectMainCameraFromStream(track, cameras) {
329
- const settings = track.getSettings();
330
- const activeCamera = cameras.find((c) => c.deviceId === settings.deviceId || c.label !== "" && c.label === track.label);
331
- if (!activeCamera) return void 0;
332
- if ((settings.facingMode === "environment" || isBackCameraLabel(track.label)) && cameras.length > 1) {
333
- cameras.forEach((camera) => {
334
- if (camera.deviceId === activeCamera.deviceId) camera.cameraType = "back";
335
- else if (!isBackCameraLabel(camera.label)) camera.cameraType = "front";
336
- });
337
- return cameras.filter((c) => c.cameraType === "back").sort((a, b) => a.label.localeCompare(b.label))[0];
338
- }
339
- if (cameras.length === 1) return activeCamera;
340
- }
341
- function getAndroidVideoConstraints(level) {
342
- const base = {
343
- resizeMode: "none",
344
- facingMode: "environment"
345
- };
346
- switch (level) {
347
- case 0: return {
348
- ...base,
349
- height: { ideal: 720 },
350
- aspectRatio: { ideal: 19.5 / 9 }
351
- };
352
- case 1: return {
353
- ...base,
354
- width: {
355
- min: 3200,
356
- ideal: 3840,
357
- max: 4096
358
- },
359
- height: {
360
- min: 1800,
361
- ideal: 2160,
362
- max: 2400
363
- }
364
- };
365
- case 2: return {
366
- ...base,
367
- width: {
368
- min: 1400,
369
- ideal: 1920,
370
- max: 2160
371
- },
372
- height: {
373
- min: 900,
374
- ideal: 1080,
375
- max: 1440
376
- }
377
- };
378
- case 3: return {
379
- ...base,
380
- width: {
381
- min: 640,
382
- ideal: 640,
383
- max: 800
384
- },
385
- height: {
386
- min: 480,
387
- ideal: 480,
388
- max: 600
389
- }
390
- };
391
- case 4: return {
392
- ...base,
393
- width: {
394
- min: 640,
395
- ideal: 800,
396
- max: 960
397
- },
398
- height: {
399
- min: 480,
400
- ideal: 480,
401
- max: 480
402
- }
403
- };
404
- default: return {};
405
- }
406
- }
407
- async function getAndroidBackCameraStream(fallbackLevel = 0) {
408
- if (fallbackLevel > 4) throw new Error("Failed to get camera after all fallback attempts");
409
- try {
410
- const initialStream = await requestCameraAccess({ video: getAndroidVideoConstraints(fallbackLevel) });
411
- const track = initialStream.getVideoTracks()[0];
412
- const mainCamera = selectMainCameraFromStream(track, await getCameras());
413
- stopCameraStream(initialStream);
414
- if (!mainCamera) throw new Error("Could not identify main camera");
415
- let idealWidth = 1280;
416
- let idealHeight = 720;
417
- if (fallbackLevel > 1) {
418
- const constraints = getAndroidVideoConstraints(fallbackLevel);
419
- const width = constraints.width;
420
- const height = constraints.height;
421
- idealWidth = width?.ideal ?? 1280;
422
- idealHeight = height?.ideal ?? 720;
423
- }
424
- return await requestCameraAccess({ video: {
425
- deviceId: { exact: mainCamera.deviceId },
426
- width: { ideal: idealWidth },
427
- height: { ideal: idealHeight }
428
- } });
429
- } catch (error) {
430
- const errorName = error instanceof Error ? error.name : "UnknownError";
431
- const nextLevel = Math.min(fallbackLevel + 1, 4);
432
- if (errorName === "NotReadableError") {
433
- await sleep(300);
434
- return getAndroidBackCameraStream(nextLevel);
435
- }
436
- if (errorName === "AbortError") {
437
- await sleep(300);
438
- return getAndroidBackCameraStream(fallbackLevel);
439
- }
440
- return getAndroidBackCameraStream(nextLevel);
441
- }
442
- }
443
- async function applyIOSFocusHack(stream) {
444
- const videoTrack = stream.getVideoTracks()[0];
445
- try {
446
- await applyTrackConstraints(videoTrack, { advanced: [{ focusDistance: 1 }] });
447
- } catch {}
448
- }
449
- function getIOSConstraints() {
450
- return {
451
- audio: false,
452
- video: {
453
- resizeMode: "none",
454
- facingMode: "environment",
455
- height: { ideal: isIPhone14OrHigher() ? 1080 : 720 },
456
- aspectRatio: { ideal: 19.5 / 9 }
457
- }
458
- };
459
- }
460
- async function getIOSCameraStream() {
461
- const stream = await requestCameraAccess(getIOSConstraints());
462
- await applyIOSFocusHack(stream);
463
- return stream;
464
- }
465
- function getDesktopConstraints(options) {
466
- const { deviceId } = options;
467
- return {
468
- audio: isSafari(),
469
- video: {
470
- facingMode: "user",
471
- deviceId: deviceId ? { exact: deviceId } : void 0,
472
- height: { ideal: 1080 },
473
- width: { ideal: 1920 }
474
- }
475
- };
476
- }
477
- async function getDesktopCameraStream(options) {
478
- return requestCameraAccess(getDesktopConstraints(options));
479
- }
480
255
  async function getIdCameraStream(deviceId) {
481
- if (isIOS()) return getIOSCameraStream();
482
- if (isAndroid()) return getAndroidBackCameraStream(0);
483
- if (isDesktop()) return getDesktopCameraStream({ deviceId });
484
- return getDesktopCameraStream({ deviceId });
256
+ return getBackCameraStream(deviceId);
485
257
  }
486
258
 
487
259
  //#endregion
@@ -528,7 +300,8 @@ const DEFAULT_ID_CAPTURE_SETTINGS = {
528
300
  iouCheckEnabled: true
529
301
  };
530
302
  async function initializeIdCapture(params) {
531
- const { provider, config, deepsightService } = params;
303
+ const { config, deepsightService } = params;
304
+ const provider = new IdCaptureProvider();
532
305
  await provider.initialize({});
533
306
  provider.setThresholds({
534
307
  ...DEFAULT_ID_CAPTURE_THRESHOLDS$1,
@@ -1125,7 +898,7 @@ const checkMotionSensorActor = fromCallback(({ input, sendBack }) => {
1125
898
  });
1126
899
  const initializeDeepsightSessionActor = fromPromise(async ({ input }) => {
1127
900
  if (!input.dependencies) return;
1128
- const { loadDeepsightSession } = await import("./deepsightLoader-Bf15_5Gk.esm.js");
901
+ const { loadDeepsightSession } = await import("./deepsightLoader-DRQJKHl8.esm.js");
1129
902
  return loadDeepsightSession({
1130
903
  ds: input.ds,
1131
904
  storage: input.dependencies.storage,
@@ -1562,7 +1335,7 @@ const _idCaptureMachine = setup({
1562
1335
  currentMode,
1563
1336
  selectedDocumentType: void 0,
1564
1337
  stream: void 0,
1565
- provider: input.provider,
1338
+ provider: void 0,
1566
1339
  frameCapturer: void 0,
1567
1340
  error: void 0,
1568
1341
  detectionStatus: "idle",
@@ -1719,14 +1492,10 @@ const _idCaptureMachine = setup({
1719
1492
  initializingStream: { invoke: {
1720
1493
  id: "tutorialInitCamera",
1721
1494
  src: "initializeCamera",
1722
- input: ({ context }) => {
1723
- if (!context.provider) throw new Error("Provider is required");
1724
- return {
1725
- provider: context.provider,
1726
- config: context.config,
1727
- deepsightService: context.deepsightService
1728
- };
1729
- },
1495
+ input: ({ context }) => ({
1496
+ config: context.config,
1497
+ deepsightService: context.deepsightService
1498
+ }),
1730
1499
  onDone: {
1731
1500
  target: "ready",
1732
1501
  actions: "setStreamAndCapturer"
@@ -1894,14 +1663,10 @@ const _idCaptureMachine = setup({
1894
1663
  initializing: { invoke: {
1895
1664
  id: "initializeCamera",
1896
1665
  src: "initializeCamera",
1897
- input: ({ context }) => {
1898
- if (!context.provider) throw new Error("Provider is required");
1899
- return {
1900
- provider: context.provider,
1901
- config: context.config,
1902
- deepsightService: context.deepsightService
1903
- };
1904
- },
1666
+ input: ({ context }) => ({
1667
+ config: context.config,
1668
+ deepsightService: context.deepsightService
1669
+ }),
1905
1670
  onDone: {
1906
1671
  target: "detecting",
1907
1672
  actions: "setStreamAndCapturer"
@@ -2084,14 +1849,10 @@ const _idCaptureMachine = setup({
2084
1849
  initializingStream: { invoke: {
2085
1850
  id: "frontFinishedInitCamera",
2086
1851
  src: "initializeCamera",
2087
- input: ({ context }) => {
2088
- if (!context.provider) throw new Error("Provider is required");
2089
- return {
2090
- provider: context.provider,
2091
- config: context.config,
2092
- deepsightService: context.deepsightService
2093
- };
2094
- },
1852
+ input: ({ context }) => ({
1853
+ config: context.config,
1854
+ deepsightService: context.deepsightService
1855
+ }),
2095
1856
  onDone: {
2096
1857
  target: "ready",
2097
1858
  actions: "setStreamAndCapturer"
@@ -2191,7 +1952,6 @@ function createIdCaptureActor(options) {
2191
1952
  const dependencies = options.dependencies ?? { storage: new BrowserStorageProvider() };
2192
1953
  return createActor(idCaptureMachine, { input: {
2193
1954
  config: options.config,
2194
- provider: options.provider,
2195
1955
  dependencies
2196
1956
  } }).start();
2197
1957
  }
package/dist/id.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { A as IdCaptureGeometry, B as IdCaptureProvider, C as DetectionArea, D as IdCaptureContext, E as IdCaptureConfig, F as IdError, H as IIdCaptureCapability, I as IdErrorCode, L as IdFlowStep, M as IdCaptureMode, N as IdCaptureThresholds, O as IdCaptureDependencies, P as IdDocumentType, R as RecordingSession, S as CapturedImage, T as ID_ERROR_CODES, U as IdCaptureSettings, V as DetectionOrientation, _ as IdCaptureActor, a as InitializeIdCaptureParams, b as idCaptureMachine, c as ValidationError, d as startRecordingSession, f as stopRecording, g as CreateIdCaptureActorOptions, h as validateUploadResponse, i as IdCaptureInitResult, j as IdCaptureInput, k as IdCaptureEvent, l as initializeIdCapture, m as uploadIdImage, n as IdCaptureState, o as StartRecordingParams, p as stopStream, r as createIdCaptureManager, s as UploadIdImageParams, t as IdCaptureManager, u as processId, v as createIdCaptureActor, w as DetectionStatus, x as CaptureIdResponse, y as IdCaptureMachine, z as UploadIdResponse } from "./index-DDMN1YD_.js";
2
- import "./deepsightService-B3FfuHt1.js";
1
+ import { A as IdCaptureGeometry, B as DetectionOrientation, C as DetectionArea, D as IdCaptureContext, E as IdCaptureConfig, F as IdError, I as IdErrorCode, L as IdFlowStep, M as IdCaptureMode, N as IdCaptureThresholds, O as IdCaptureDependencies, P as IdDocumentType, R as RecordingSession, S as CapturedImage, T as ID_ERROR_CODES, V as IdCaptureSettings, _ as IdCaptureActor, a as InitializeIdCaptureParams, b as idCaptureMachine, c as ValidationError, d as startRecordingSession, f as stopRecording, g as CreateIdCaptureActorOptions, h as validateUploadResponse, i as IdCaptureInitResult, j as IdCaptureInput, k as IdCaptureEvent, l as initializeIdCapture, m as uploadIdImage, n as IdCaptureState, o as StartRecordingParams, p as stopStream, r as createIdCaptureManager, s as UploadIdImageParams, t as IdCaptureManager, u as processId, v as createIdCaptureActor, w as DetectionStatus, x as CaptureIdResponse, y as IdCaptureMachine, z as UploadIdResponse } from "./index-D0Zj8bRR.js";
2
+ import "./deepsightService-BLejzhoL.js";
3
3
  import { n as PermissionStatus, r as CameraStream, t as PermissionResult } from "./types-Dl8aaniO.js";
4
- import "./StateMachine-CvjqRbSg.js";
5
4
  import "./Manager-DZLpIRan.js";
6
5
  import "./Actor-DniIAF8X.js";
7
- import "./types-DFgUJtIJ.js";
8
- export { CameraStream, CaptureIdResponse, CapturedImage, CreateIdCaptureActorOptions, DetectionArea, DetectionOrientation, DetectionStatus, ID_ERROR_CODES, IIdCaptureCapability, IdCaptureActor, IdCaptureConfig, IdCaptureContext, IdCaptureDependencies, IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, IdCaptureInput, IdCaptureMachine, IdCaptureManager, IdCaptureMode, IdCaptureProvider, IdCaptureSettings, IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, PermissionResult, PermissionStatus, RecordingSession, StartRecordingParams, UploadIdImageParams, UploadIdResponse, ValidationError, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse };
6
+ import "./StateMachine-DKxvdEuI.js";
7
+ import "./types-DeUPfNsF.js";
8
+ export { CameraStream, CaptureIdResponse, CapturedImage, CreateIdCaptureActorOptions, DetectionArea, DetectionOrientation, DetectionStatus, ID_ERROR_CODES, IdCaptureActor, IdCaptureConfig, IdCaptureContext, IdCaptureDependencies, IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, IdCaptureInput, IdCaptureMachine, IdCaptureManager, IdCaptureMode, IdCaptureSettings, IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, PermissionResult, PermissionStatus, RecordingSession, StartRecordingParams, UploadIdImageParams, UploadIdResponse, ValidationError, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse };
package/dist/id.esm.js CHANGED
@@ -1,10 +1,10 @@
1
- import "./events-BvAMgEuE.esm.js";
2
- import { a as processId, c as stopStream, d as ID_ERROR_CODES, i as initializeIdCapture, l as uploadIdImage, n as createIdCaptureActor, o as startRecordingSession, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-DtrUp5nz.esm.js";
3
- import { i as IdCaptureProvider } from "./src-CKB3MNL0.esm.js";
1
+ import "./events-mFVnFpqq.esm.js";
2
+ import "./backCameraStream-DhKbn3gt.esm.js";
3
+ import "./src-CKB3MNL0.esm.js";
4
4
  import "./endpoints-CAXIQnl3.esm.js";
5
- import "./streamingEvents-Bl2HRhLD.esm.js";
6
- import "./deepsightService-jsdRuf0u.esm.js";
7
- import "./api-CmRbOLxk.esm.js";
8
- import "./stats-Bv2CLzQ0.esm.js";
5
+ import "./deepsightService-CZC8YaHN.esm.js";
6
+ import "./api-Cqrn4bGi.esm.js";
7
+ import { a as processId, c as stopStream, d as ID_ERROR_CODES, i as initializeIdCapture, l as uploadIdImage, n as createIdCaptureActor, o as startRecordingSession, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-DHFXeDku.esm.js";
8
+ import "./stats-C0Z_4KzW.esm.js";
9
9
 
10
- export { ID_ERROR_CODES, IdCaptureProvider, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse };
10
+ export { ID_ERROR_CODES, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse };
@@ -1,9 +1,9 @@
1
- import { a as IncodeCanvas, i as IMotionSensorCapability, n as BaseWasmProvider, r as StreamCanvasCapture, t as DeepsightService } from "./deepsightService-B3FfuHt1.js";
1
+ import { i as IncodeCanvas, n as StreamCanvasCapture, r as IMotionSensorCapability, t as DeepsightService } from "./deepsightService-BLejzhoL.js";
2
2
  import { a as IRecordingCapability, c as MLProviderConfig, i as IStorageCapability, n as PermissionStatus, o as RecordingConnection, r as CameraStream, s as IMLProviderCapability, t as PermissionResult } from "./types-Dl8aaniO.js";
3
- import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-CvjqRbSg.js";
4
3
  import { t as Manager } from "./Manager-DZLpIRan.js";
5
4
  import { t as ActorRefFrom } from "./Actor-DniIAF8X.js";
6
- import { i as TutorialIdConfig, t as Flow } from "./types-DFgUJtIJ.js";
5
+ import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-DKxvdEuI.js";
6
+ import { i as TutorialIdConfig, t as Flow } from "./types-DeUPfNsF.js";
7
7
 
8
8
  //#region ../infra/src/capabilities/IAnalyticsCapability.d.ts
9
9
  interface IAnalyticsCapability {
@@ -162,59 +162,6 @@ interface IIdCaptureCapability extends IMLProviderCapability<IdCaptureConfig$1>
162
162
  setCapturedCanvases(original: IncodeCanvas, transformed: IncodeCanvas): void;
163
163
  }
164
164
  //#endregion
165
- //#region ../infra/src/providers/wasm/IdCaptureProvider.d.ts
166
- declare class IdCaptureProvider extends BaseWasmProvider implements IIdCaptureCapability {
167
- private lastProcessResult;
168
- private capturedCanvas;
169
- private originalCapturedCanvas;
170
- constructor();
171
- initialize(config: IdCaptureConfig$1): Promise<void>;
172
- setCallbacks(callbacks: IdCaptureCallbacks): void;
173
- setThresholds(thresholds: IdCaptureThresholds$1): void;
174
- setGeometry(geometry: IdCaptureGeometry$1): void;
175
- setSettings(settings: IdCaptureSettings): void;
176
- setModelType(modelType: 'v1' | 'v2' | 'v3'): void;
177
- /**
178
- * Processes a frame through the WASM pipeline and stores the result.
179
- */
180
- processFrame(image: ImageData): Promise<void>;
181
- /**
182
- * Gets the last process result from the most recent frame processing.
183
- * @returns The last process result with quad coordinates, or null if not available
184
- */
185
- getLastProcessResult(): IdCaptureProcessResult | null;
186
- transformPerspective(canvas: IncodeCanvas, frameRect: {
187
- x: number;
188
- y: number;
189
- w: number;
190
- h: number;
191
- }): IncodeCanvas;
192
- /**
193
- * Crops a canvas to the specified rectangle region.
194
- * @param canvas - The canvas to crop
195
- * @param rect - The rectangle to crop to (x, y, w, h)
196
- * @returns A new IncodeCanvas with the cropped region, or null if cropping fails
197
- */
198
- private cropCanvasToRect;
199
- /**
200
- * Gets the captured canvas (transformed for preview).
201
- * @returns The captured canvas, or null if not available
202
- */
203
- getCapturedCanvas(): IncodeCanvas | null;
204
- /**
205
- * Gets the original captured canvas (full frame for upload).
206
- * @returns The original captured canvas, or null if not available
207
- */
208
- getOriginalCapturedCanvas(): IncodeCanvas | null;
209
- /**
210
- * Sets the captured canvases (original and transformed).
211
- * @param original - The original full-frame canvas (for upload)
212
- * @param transformed - The transformed canvas (for preview)
213
- */
214
- setCapturedCanvases(original: IncodeCanvas, transformed: IncodeCanvas): void;
215
- reset(): void;
216
- }
217
- //#endregion
218
165
  //#region src/modules/id/types.d.ts
219
166
  type IdCaptureMode = 'front' | 'back' | 'passport';
220
167
  type IdDocumentType = 'id' | 'passport';
@@ -475,7 +422,6 @@ type IdCaptureDependencies = {
475
422
  };
476
423
  type IdCaptureInput = {
477
424
  config: IdCaptureConfig;
478
- provider: IIdCaptureCapability;
479
425
  motionProvider?: IMotionSensorCapability;
480
426
  analyticsProvider?: IAnalyticsCapability;
481
427
  dependencies?: IdCaptureDependencies;
@@ -488,7 +434,6 @@ type IdCaptureMachine = StateMachine<IdCaptureContext, IdCaptureEvent, any, any,
488
434
  //#region src/modules/id/idCaptureActor.d.ts
489
435
  type CreateIdCaptureActorOptions = {
490
436
  config: IdCaptureConfig;
491
- provider: IIdCaptureCapability;
492
437
  dependencies?: IdCaptureDependencies;
493
438
  };
494
439
  type IdCaptureActor = ActorRefFrom<IdCaptureMachine>;
@@ -500,7 +445,6 @@ type IdCaptureInitResult = {
500
445
  provider: IIdCaptureCapability;
501
446
  };
502
447
  type InitializeIdCaptureParams = {
503
- provider: IIdCaptureCapability;
504
448
  config: IdCaptureConfig;
505
449
  deepsightService?: DeepsightService;
506
450
  };
@@ -635,4 +579,4 @@ declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): M
635
579
  };
636
580
  type IdCaptureManager = ReturnType<typeof createIdCaptureManager>;
637
581
  //#endregion
638
- export { IdCaptureGeometry as A, IdCaptureProvider as B, DetectionArea as C, IdCaptureContext as D, IdCaptureConfig as E, IdError as F, IIdCaptureCapability as H, IdErrorCode as I, IdFlowStep as L, IdCaptureMode as M, IdCaptureThresholds as N, IdCaptureDependencies as O, IdDocumentType as P, RecordingSession as R, CapturedImage as S, ID_ERROR_CODES as T, IdCaptureSettings as U, DetectionOrientation as V, IdCaptureActor as _, InitializeIdCaptureParams as a, idCaptureMachine as b, ValidationError as c, startRecordingSession as d, stopRecording as f, CreateIdCaptureActorOptions as g, validateUploadResponse as h, IdCaptureInitResult as i, IdCaptureInput as j, IdCaptureEvent as k, initializeIdCapture as l, uploadIdImage as m, IdCaptureState as n, StartRecordingParams as o, stopStream as p, createIdCaptureManager as r, UploadIdImageParams as s, IdCaptureManager as t, processId as u, createIdCaptureActor as v, DetectionStatus as w, CaptureIdResponse as x, IdCaptureMachine as y, UploadIdResponse as z };
582
+ export { IdCaptureGeometry as A, DetectionOrientation as B, DetectionArea as C, IdCaptureContext as D, IdCaptureConfig as E, IdError as F, IdErrorCode as I, IdFlowStep as L, IdCaptureMode as M, IdCaptureThresholds as N, IdCaptureDependencies as O, IdDocumentType as P, RecordingSession as R, CapturedImage as S, ID_ERROR_CODES as T, IdCaptureSettings as V, IdCaptureActor as _, InitializeIdCaptureParams as a, idCaptureMachine as b, ValidationError as c, startRecordingSession as d, stopRecording as f, CreateIdCaptureActorOptions as g, validateUploadResponse as h, IdCaptureInitResult as i, IdCaptureInput as j, IdCaptureEvent as k, initializeIdCapture as l, uploadIdImage as m, IdCaptureState as n, StartRecordingParams as o, stopStream as p, createIdCaptureManager as r, UploadIdImageParams as s, IdCaptureManager as t, processId as u, createIdCaptureActor as v, DetectionStatus as w, CaptureIdResponse as x, IdCaptureMachine as y, UploadIdResponse as z };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { A as IdCaptureGeometry, B as IdCaptureProvider, C as DetectionArea, D as IdCaptureContext, E as IdCaptureConfig, F as IdError, H as IIdCaptureCapability, I as IdErrorCode, L as IdFlowStep, M as IdCaptureMode, N as IdCaptureThresholds, O as IdCaptureDependencies, P as IdDocumentType, R as RecordingSession, S as CapturedImage, T as ID_ERROR_CODES, U as IdCaptureSettings, V as DetectionOrientation, _ as IdCaptureActor, a as InitializeIdCaptureParams, b as idCaptureMachine, c as ValidationError, d as startRecordingSession, f as stopRecording, g as CreateIdCaptureActorOptions, h as validateUploadResponse, i as IdCaptureInitResult, j as IdCaptureInput, k as IdCaptureEvent, l as initializeIdCapture, m as uploadIdImage, n as IdCaptureState, o as StartRecordingParams, p as stopStream, r as createIdCaptureManager, s as UploadIdImageParams, t as IdCaptureManager, u as processId, v as createIdCaptureActor, w as DetectionStatus, x as CaptureIdResponse, y as IdCaptureMachine, z as UploadIdResponse } from "./index-DDMN1YD_.js";
2
- import "./deepsightService-B3FfuHt1.js";
1
+ import { A as IdCaptureGeometry, B as DetectionOrientation, C as DetectionArea, D as IdCaptureContext, E as IdCaptureConfig, F as IdError, I as IdErrorCode, L as IdFlowStep, M as IdCaptureMode, N as IdCaptureThresholds, O as IdCaptureDependencies, P as IdDocumentType, R as RecordingSession, S as CapturedImage, T as ID_ERROR_CODES, V as IdCaptureSettings, _ as IdCaptureActor, a as InitializeIdCaptureParams, b as idCaptureMachine, c as ValidationError, d as startRecordingSession, f as stopRecording, g as CreateIdCaptureActorOptions, h as validateUploadResponse, i as IdCaptureInitResult, j as IdCaptureInput, k as IdCaptureEvent, l as initializeIdCapture, m as uploadIdImage, n as IdCaptureState, o as StartRecordingParams, p as stopStream, r as createIdCaptureManager, s as UploadIdImageParams, t as IdCaptureManager, u as processId, v as createIdCaptureActor, w as DetectionStatus, x as CaptureIdResponse, y as IdCaptureMachine, z as UploadIdResponse } from "./index-D0Zj8bRR.js";
2
+ import "./deepsightService-BLejzhoL.js";
3
3
  import { n as PermissionStatus, r as CameraStream, t as PermissionResult } from "./types-Dl8aaniO.js";
4
- import { i as warmupWasm, r as WasmPipeline } from "./StateMachine-CvjqRbSg.js";
4
+ import { n as warmupWasm, t as WasmPipeline } from "./warmup-oXQm8EFM.js";
5
5
  import "./Manager-DZLpIRan.js";
6
6
  import "./Actor-DniIAF8X.js";
7
- import "./types-DFgUJtIJ.js";
7
+ import "./StateMachine-DKxvdEuI.js";
8
+ import "./types-DeUPfNsF.js";
8
9
 
9
10
  //#region ../infra/src/http/types.d.ts
10
11
  type CreateApiConfig = {
@@ -520,4 +521,4 @@ declare function moduleClosed(module: EventModule | string, screen?: EventScreen
520
521
  declare function screenOpened(module: EventModule | string, screen: EventScreen | string, payload?: Record<string, unknown>): void;
521
522
  declare function screenClosed(module: EventModule | string, screen: EventScreen | string, payload?: Record<string, unknown>): void;
522
523
  //#endregion
523
- export { type Browser, CameraStream, CaptureIdResponse, CapturedImage, CreateIdCaptureActorOptions, type CreateSessionOptions, DetectionArea, DetectionOrientation, DetectionStatus, type DeviceClass, type Event, type EventModule, type EventScreen, type HttpClient, ID_ERROR_CODES, IIdCaptureCapability, IdCaptureActor, IdCaptureConfig, IdCaptureContext, IdCaptureDependencies, IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, IdCaptureInput, IdCaptureMachine, IdCaptureManager, IdCaptureMode, IdCaptureProvider, IdCaptureSettings, IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, type PermissionResult, type PermissionStatus, RecordingSession, type Session, type SessionInitOptions, type SessionInitResult, type SetupOptions, StartRecordingParams, UploadIdImageParams, UploadIdResponse, ValidationError, type WasmConfig, type WasmPipeline, addEvent, api, cameraScreenNamesMapper, checkPermission as checkCameraPermission, createApi, createIdCaptureActor, createIdCaptureManager, createSession, eventModuleNames, eventScreenNames, flushEventQueue, getApi, getBrowser, getDeviceClass, getDisableIpify, getSessionFeatures, idCaptureMachine, initializeIdCapture, initializeSession, initializeWasmUtil, isConfigured, isSessionInitialized, moduleClosed, moduleOpened, processId, requestPermission as requestCameraPermission, reset, resetSessionInit, screenClosed, screenEvent, screenOpened, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, subscribeEvent, tutorialScreenNamesMapper, uploadIdImage, validateUploadResponse, videoSelfieEvents, warmupWasm };
524
+ export { type Browser, CameraStream, CaptureIdResponse, CapturedImage, CreateIdCaptureActorOptions, type CreateSessionOptions, DetectionArea, DetectionOrientation, DetectionStatus, type DeviceClass, type Event, type EventModule, type EventScreen, type HttpClient, ID_ERROR_CODES, IdCaptureActor, IdCaptureConfig, IdCaptureContext, IdCaptureDependencies, IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, IdCaptureInput, IdCaptureMachine, IdCaptureManager, IdCaptureMode, IdCaptureSettings, IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, type PermissionResult, type PermissionStatus, RecordingSession, type Session, type SessionInitOptions, type SessionInitResult, type SetupOptions, StartRecordingParams, UploadIdImageParams, UploadIdResponse, ValidationError, type WasmConfig, type WasmPipeline, addEvent, api, cameraScreenNamesMapper, checkPermission as checkCameraPermission, createApi, createIdCaptureActor, createIdCaptureManager, createSession, eventModuleNames, eventScreenNames, flushEventQueue, getApi, getBrowser, getDeviceClass, getDisableIpify, getSessionFeatures, idCaptureMachine, initializeIdCapture, initializeSession, initializeWasmUtil, isConfigured, isSessionInitialized, moduleClosed, moduleOpened, processId, requestPermission as requestCameraPermission, reset, resetSessionInit, screenClosed, screenEvent, screenOpened, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, subscribeEvent, tutorialScreenNamesMapper, uploadIdImage, validateUploadResponse, videoSelfieEvents, warmupWasm };
package/dist/index.esm.js CHANGED
@@ -1,11 +1,11 @@
1
- import { a as videoSelfieEvents, c as screenClosed, d as addEvent, f as flushEventQueue, i as tutorialScreenNamesMapper, l as screenEvent, n as eventModuleNames, o as moduleClosed, p as subscribeEvent, r as eventScreenNames, s as moduleOpened, t as cameraScreenNamesMapper, u as screenOpened } from "./events-BvAMgEuE.esm.js";
2
- import { _ as createSession, a as processId, c as stopStream, d as ID_ERROR_CODES, f as getDisableIpify, g as resetSessionInit, h as isSessionInitialized, i as initializeIdCapture, l as uploadIdImage, m as initializeSession, n as createIdCaptureActor, o as startRecordingSession, p as getSessionFeatures, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-DtrUp5nz.esm.js";
3
- import { D as createApi_default, i as IdCaptureProvider, o as warmupWasm, r as WasmUtilProvider } from "./src-CKB3MNL0.esm.js";
1
+ import { a as videoSelfieEvents, c as screenClosed, d as addEvent, f as flushEventQueue, i as tutorialScreenNamesMapper, l as screenEvent, n as eventModuleNames, o as moduleClosed, p as subscribeEvent, r as eventScreenNames, s as moduleOpened, t as cameraScreenNamesMapper, u as screenOpened } from "./events-mFVnFpqq.esm.js";
2
+ import { c as requestPermission, l as getDeviceClass, s as checkPermission, u as getBrowser } from "./backCameraStream-DhKbn3gt.esm.js";
3
+ import { D as createApi_default, o as warmupWasm, r as WasmUtilProvider } from "./src-CKB3MNL0.esm.js";
4
4
  import "./endpoints-CAXIQnl3.esm.js";
5
- import { c as getDeviceClass, l as getBrowser, o as checkPermission, s as requestPermission } from "./streamingEvents-Bl2HRhLD.esm.js";
6
- import "./deepsightService-jsdRuf0u.esm.js";
7
- import { a as resetApi, n as getApi, o as setClient, s as setToken, t as api } from "./api-CmRbOLxk.esm.js";
8
- import "./stats-Bv2CLzQ0.esm.js";
5
+ import "./deepsightService-CZC8YaHN.esm.js";
6
+ import { a as resetApi, n as getApi, o as setClient, s as setToken, t as api } from "./api-Cqrn4bGi.esm.js";
7
+ import { _ as createSession, a as processId, c as stopStream, d as ID_ERROR_CODES, f as getDisableIpify, g as resetSessionInit, h as isSessionInitialized, i as initializeIdCapture, l as uploadIdImage, m as initializeSession, n as createIdCaptureActor, o as startRecordingSession, p as getSessionFeatures, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-DHFXeDku.esm.js";
8
+ import "./stats-C0Z_4KzW.esm.js";
9
9
 
10
10
  //#region src/setup.ts
11
11
  let wasmConfig;
@@ -126,4 +126,4 @@ function reset() {
126
126
  }
127
127
 
128
128
  //#endregion
129
- export { ID_ERROR_CODES, IdCaptureProvider, addEvent, api, cameraScreenNamesMapper, checkPermission as checkCameraPermission, createApi_default as createApi, createIdCaptureActor, createIdCaptureManager, createSession, eventModuleNames, eventScreenNames, flushEventQueue, getApi, getBrowser, getDeviceClass, getDisableIpify, getSessionFeatures, idCaptureMachine, initializeIdCapture, initializeSession, initializeWasmUtil, isConfigured, isSessionInitialized, moduleClosed, moduleOpened, processId, requestPermission as requestCameraPermission, reset, resetSessionInit, screenClosed, screenEvent, screenOpened, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, subscribeEvent, tutorialScreenNamesMapper, uploadIdImage, validateUploadResponse, videoSelfieEvents, warmupWasm };
129
+ export { ID_ERROR_CODES, addEvent, api, cameraScreenNamesMapper, checkPermission as checkCameraPermission, createApi_default as createApi, createIdCaptureActor, createIdCaptureManager, createSession, eventModuleNames, eventScreenNames, flushEventQueue, getApi, getBrowser, getDeviceClass, getDisableIpify, getSessionFeatures, idCaptureMachine, initializeIdCapture, initializeSession, initializeWasmUtil, isConfigured, isSessionInitialized, moduleClosed, moduleOpened, processId, requestPermission as requestCameraPermission, reset, resetSessionInit, screenClosed, screenEvent, screenOpened, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, subscribeEvent, tutorialScreenNamesMapper, uploadIdImage, validateUploadResponse, videoSelfieEvents, warmupWasm };
package/dist/phone.esm.js CHANGED
@@ -1,7 +1,7 @@
1
- import { d as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-BvAMgEuE.esm.js";
1
+ import { d as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-mFVnFpqq.esm.js";
2
2
  import { E as createManager, p as BrowserTimerProvider } from "./src-CKB3MNL0.esm.js";
3
3
  import { a as fromPromise, i as fromCallback, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
4
- import { t as api } from "./api-CmRbOLxk.esm.js";
4
+ import { t as api } from "./api-Cqrn4bGi.esm.js";
5
5
 
6
6
  //#region src/modules/phone/phoneServices.ts
7
7
  async function fetchPhone(signal) {
package/dist/selfie.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { a as IncodeCanvas, n as BaseWasmProvider, r as StreamCanvasCapture, t as DeepsightService } from "./deepsightService-B3FfuHt1.js";
1
+ import { i as IncodeCanvas, n as StreamCanvasCapture, t as DeepsightService } from "./deepsightService-BLejzhoL.js";
2
2
  import { c as MLProviderConfig, n as PermissionStatus, r as CameraStream, s as IMLProviderCapability, t as PermissionResult } from "./types-Dl8aaniO.js";
3
- import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-CvjqRbSg.js";
4
- import { a as FaceCaptureDependencies, i as DetectionStatus, n as FaceCaptureManagerState, o as FaceErrorCode, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-1AAwvEWC.js";
3
+ import { t as WasmPipeline } from "./warmup-oXQm8EFM.js";
4
+ import { a as FaceCaptureDependencies, i as DetectionStatus, n as FaceCaptureManagerState, o as FaceErrorCode, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-BqvUNJXR.js";
5
5
  import { t as Manager } from "./Manager-DZLpIRan.js";
6
- import { r as FlowModuleConfig } from "./types-DFgUJtIJ.js";
6
+ import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-DKxvdEuI.js";
7
+ import { r as FlowModuleConfig } from "./types-DeUPfNsF.js";
7
8
 
8
9
  //#region ../infra/src/capabilities/IFaceDetectionCapability.d.ts
9
10
  /**
@@ -145,6 +146,83 @@ interface IFaceDetectionCapability extends IMLProviderCapability<FaceDetectionCo
145
146
  setVideoSelfieMode(enabled: boolean): void;
146
147
  }
147
148
  //#endregion
149
+ //#region ../infra/src/wasm/WasmPipelineType.d.ts
150
+ declare enum WasmPipelineType {
151
+ IdBlurGlarePipeline = 0,
152
+ IdBarcodeAndTextQualityPipeline = 1,
153
+ IdVideoSelfiePipeline = 2,
154
+ SelfieWithAggregationMetrics = 3,
155
+ SelfieWithQualityMetrics = 4,
156
+ IdFaceDetectionPipeline = 5,
157
+ }
158
+ //#endregion
159
+ //#region ../infra/src/providers/wasm/BaseWasmProvider.d.ts
160
+ /**
161
+ * Base configuration for WASM providers
162
+ */
163
+ interface BaseWasmConfig {
164
+ /** Path to the WASM binary */
165
+ wasmPath?: string;
166
+ /** Path to the SIMD-optimized WASM binary (optional) */
167
+ wasmSimdPath?: string;
168
+ /** Path to the WASM glue code */
169
+ glueCodePath?: string;
170
+ /** Whether to use SIMD optimizations (default: true) */
171
+ useSimd?: boolean;
172
+ /**
173
+ * Base path for ML model files. Models will be loaded from `${modelsBasePath}/${modelFileName}`.
174
+ * If not provided, models are expected in a 'models' subdirectory relative to the WASM binary.
175
+ */
176
+ modelsBasePath?: string;
177
+ }
178
+ /**
179
+ * Base provider class that abstracts common WASM functionality.
180
+ * This serves as a foundation for specific ML capability providers
181
+ * like FaceDetectionProvider and IdCaptureProvider.
182
+ */
183
+ declare abstract class BaseWasmProvider {
184
+ private _isInitialized;
185
+ protected pipelineType: WasmPipelineType | undefined;
186
+ /**
187
+ * Creates a new BaseWasmProvider
188
+ * @param pipelineType - The WASM pipeline type this provider uses
189
+ */
190
+ constructor(pipelineType?: WasmPipelineType);
191
+ /**
192
+ * Returns whether this provider has been initialized.
193
+ */
194
+ get initialized(): boolean;
195
+ protected getPipelineType(): WasmPipelineType;
196
+ /**
197
+ * Initializes the provider by ensuring WASM is loaded
198
+ * @param config - Provider configuration
199
+ * @param pipeline - The pipeline type to warm up ('selfie', 'idCapture', etc.)
200
+ */
201
+ protected initializeBase(config: BaseWasmConfig, pipeline: WasmPipeline): Promise<void>;
202
+ /**
203
+ * Ensures the provider is initialized before performing operations.
204
+ * @throws Error if not initialized
205
+ */
206
+ protected ensureInitialized(): void;
207
+ /**
208
+ * Processes a frame through the WASM pipeline
209
+ * @param image - Image data to process
210
+ * @returns The pipeline result (type depends on pipeline - WASM returns any)
211
+ */
212
+ protected processFrameWasm(image: ImageData): Promise<any>;
213
+ abstract processFrame(image: ImageData): Promise<void>;
214
+ /**
215
+ * Resets the pipeline to its initial state.
216
+ * Safe to call even if not initialized (no-op in that case).
217
+ */
218
+ reset(): void;
219
+ /**
220
+ * Disposes of resources and resets initialization state.
221
+ * Safe to call even if not initialized.
222
+ */
223
+ dispose(): Promise<void>;
224
+ }
225
+ //#endregion
148
226
  //#region ../infra/src/providers/wasm/FaceDetectionProvider.d.ts
149
227
  declare class FaceDetectionProvider extends BaseWasmProvider implements IFaceDetectionCapability {
150
228
  private defaultThresholds;