@incodetech/core 2.0.0-rc.0 → 2.0.0

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 (178) hide show
  1. package/package.json +3 -3
  2. package/dist/Actor-CI32dTbG.d.ts +0 -2
  3. package/dist/BaseWasmProvider-C_DLEI40.esm.js +0 -1118
  4. package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +0 -55
  5. package/dist/BrowserTimerProvider-DhNc_x02.esm.js +0 -22
  6. package/dist/ITimerCapability-C67ZRskg.esm.js +0 -7
  7. package/dist/IpifyProvider-D7jx52AL.esm.js +0 -139
  8. package/dist/Manager-C8PrhBOx.d.ts +0 -19
  9. package/dist/MotionSensorProvider-4v7xkqAp.esm.js +0 -254
  10. package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +0 -87
  11. package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
  12. package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
  13. package/dist/addressSearch-BpTbTWCa.esm.js +0 -430
  14. package/dist/ae-signature-DDDZmWXj.esm.js +0 -12
  15. package/dist/ae-signature.d.ts +0 -25
  16. package/dist/ae-signature.esm.js +0 -8
  17. package/dist/antifraud.d.ts +0 -57
  18. package/dist/antifraud.esm.js +0 -45
  19. package/dist/antifraudStateMachine-O0TMf6yc.esm.js +0 -39
  20. package/dist/api-CESGtpbH.esm.js +0 -53
  21. package/dist/authentication.d.ts +0 -12
  22. package/dist/authentication.esm.js +0 -25
  23. package/dist/authenticationManager-5M-fKzXx.esm.js +0 -67
  24. package/dist/authenticationManager-C83GNIhl.d.ts +0 -66
  25. package/dist/authenticationStateMachine-BMZqatiF.esm.js +0 -139
  26. package/dist/backCameraStream-DMdMeGk2.esm.js +0 -346
  27. package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
  28. package/dist/camera-DBSxa6ML.d.ts +0 -4
  29. package/dist/camera-PA2Ljri3.esm.js +0 -22
  30. package/dist/camera.d.ts +0 -15
  31. package/dist/camera.esm.js +0 -5
  32. package/dist/chunk-CRF6K_H_.esm.js +0 -49
  33. package/dist/consent.d.ts +0 -398
  34. package/dist/consent.esm.js +0 -79
  35. package/dist/consentStateMachine-CCT-B60O.esm.js +0 -151
  36. package/dist/cpf-PPz2Njto.esm.js +0 -38
  37. package/dist/cpf-ocr.d.ts +0 -204
  38. package/dist/cpf-ocr.esm.js +0 -177
  39. package/dist/cross-document-data-match.d.ts +0 -34
  40. package/dist/cross-document-data-match.esm.js +0 -71
  41. package/dist/curp-validation.d.ts +0 -188
  42. package/dist/curp-validation.esm.js +0 -110
  43. package/dist/curpValidationStateMachine-CitWLr2c.esm.js +0 -595
  44. package/dist/custom-fields.d.ts +0 -115
  45. package/dist/custom-fields.esm.js +0 -177
  46. package/dist/custom-watchlist.d.ts +0 -66
  47. package/dist/custom-watchlist.esm.js +0 -86
  48. package/dist/dateUtils-UoN5xswP.esm.js +0 -23
  49. package/dist/deepsightLoader-Cm4JIT_z.esm.js +0 -52
  50. package/dist/deepsightService-CEVxzehb.d.ts +0 -412
  51. package/dist/deepsightService-O74l4Y__.esm.js +0 -489
  52. package/dist/device.d.ts +0 -46
  53. package/dist/device.esm.js +0 -106
  54. package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
  55. package/dist/document-capture.d.ts +0 -906
  56. package/dist/document-capture.esm.js +0 -156
  57. package/dist/document-upload.d.ts +0 -331
  58. package/dist/document-upload.esm.js +0 -203
  59. package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +0 -394
  60. package/dist/dynamic-forms.d.ts +0 -178
  61. package/dist/dynamic-forms.esm.js +0 -323
  62. package/dist/ekyb.d.ts +0 -148
  63. package/dist/ekyb.esm.js +0 -127
  64. package/dist/ekybStateMachine-B59rQjgj.esm.js +0 -674
  65. package/dist/ekyc.d.ts +0 -164
  66. package/dist/ekyc.esm.js +0 -104
  67. package/dist/ekycStateMachine-oeO0Iekd.esm.js +0 -10626
  68. package/dist/electronic-signature.d.ts +0 -4
  69. package/dist/electronic-signature.esm.js +0 -7
  70. package/dist/electronicSignatureManager-D9OHzTpG.esm.js +0 -428
  71. package/dist/email.d.ts +0 -4
  72. package/dist/email.esm.js +0 -9
  73. package/dist/emailManager-DIfnS5g1.d.ts +0 -352
  74. package/dist/emailManager-wAV0LE-H.esm.js +0 -238
  75. package/dist/emailStateMachine-DOf4j58N.esm.js +0 -292
  76. package/dist/endpoints-CnN3SyDa.esm.js +0 -87
  77. package/dist/events-D6-e4vok.esm.js +0 -596
  78. package/dist/events.d.ts +0 -265
  79. package/dist/events.esm.js +0 -4
  80. package/dist/extensibility.d.ts +0 -122
  81. package/dist/extensibility.esm.js +0 -43
  82. package/dist/face-match.d.ts +0 -228
  83. package/dist/face-match.esm.js +0 -173
  84. package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +0 -290
  85. package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +0 -690
  86. package/dist/faceCaptureSetup-B3faSpYA.esm.js +0 -873
  87. package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +0 -127
  88. package/dist/flow-events.d.ts +0 -6
  89. package/dist/flow-events.esm.js +0 -0
  90. package/dist/flow.d.ts +0 -358
  91. package/dist/flow.esm.js +0 -825
  92. package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
  93. package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
  94. package/dist/flowServices-DTsm-Vf1.esm.js +0 -188
  95. package/dist/geolocation.d.ts +0 -127
  96. package/dist/geolocation.esm.js +0 -89
  97. package/dist/geolocationStateMachine-asasuHY2.esm.js +0 -105
  98. package/dist/getBrowser-BSXUTWXw.esm.js +0 -41
  99. package/dist/getDeviceClass-BSntT9_j.esm.js +0 -14
  100. package/dist/government-validation.d.ts +0 -67
  101. package/dist/government-validation.esm.js +0 -81
  102. package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +0 -271
  103. package/dist/home.d.ts +0 -99
  104. package/dist/home.esm.js +0 -61
  105. package/dist/http.d.ts +0 -68
  106. package/dist/http.esm.js +0 -3
  107. package/dist/id-ocr.d.ts +0 -635
  108. package/dist/id-ocr.esm.js +0 -86
  109. package/dist/id-verification.d.ts +0 -190
  110. package/dist/id-verification.esm.js +0 -43
  111. package/dist/id.d.ts +0 -24
  112. package/dist/id.esm.js +0 -164
  113. package/dist/idCaptureManager-B9TGA5dq.d.ts +0 -956
  114. package/dist/idCaptureManager-DMK0GIt3.esm.js +0 -581
  115. package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +0 -2954
  116. package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +0 -388
  117. package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +0 -71
  118. package/dist/identity-reuse.d.ts +0 -530
  119. package/dist/identity-reuse.esm.js +0 -274
  120. package/dist/index-BLKtMA0g.d.ts +0 -1177
  121. package/dist/index-BcRG8rtJ.d.ts +0 -97
  122. package/dist/index.d.ts +0 -3
  123. package/dist/index.esm.js +0 -12
  124. package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +0 -30
  125. package/dist/lib-BB0B_qQX.esm.js +0 -12499
  126. package/dist/mandatory-consent.d.ts +0 -412
  127. package/dist/mandatory-consent.esm.js +0 -78
  128. package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +0 -126
  129. package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
  130. package/dist/openviduLazy-Cok70ZSg.esm.js +0 -12
  131. package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
  132. package/dist/phone.d.ts +0 -4
  133. package/dist/phone.esm.js +0 -9
  134. package/dist/phoneManager-B6M30hKE.d.ts +0 -397
  135. package/dist/phoneManager-DAJbGhlY.esm.js +0 -256
  136. package/dist/phoneStateMachine-CuPARRaT.esm.js +0 -351
  137. package/dist/platform-CfrjKhmi.esm.js +0 -83
  138. package/dist/qe-signature-DFo_Cc-I.esm.js +0 -12
  139. package/dist/qe-signature.d.ts +0 -25
  140. package/dist/qe-signature.esm.js +0 -8
  141. package/dist/recordingService-Ig2UgbLv.esm.js +0 -1003
  142. package/dist/redirect-to-mobile.d.ts +0 -107
  143. package/dist/redirect-to-mobile.esm.js +0 -102
  144. package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +0 -249
  145. package/dist/runChildModule-CqqwqAkW.esm.js +0 -219
  146. package/dist/selfie.d.ts +0 -26
  147. package/dist/selfie.esm.js +0 -146
  148. package/dist/selfieManager-D0lSgd-J.d.ts +0 -68
  149. package/dist/selfieManager-Duisl7qN.esm.js +0 -60
  150. package/dist/selfieStateMachine-D76whWEf.esm.js +0 -68
  151. package/dist/session-BS-d_vuE.esm.js +0 -3206
  152. package/dist/session.d.ts +0 -217
  153. package/dist/session.esm.js +0 -9
  154. package/dist/setup-Buy-hyj4.esm.js +0 -887
  155. package/dist/setup-C5AITV8m.d.ts +0 -254
  156. package/dist/signature.d.ts +0 -94
  157. package/dist/signature.esm.js +0 -66
  158. package/dist/signatureStateMachine-B5-QVUve.esm.js +0 -132
  159. package/dist/stats-CIfiPzb1.esm.js +0 -16
  160. package/dist/stats.d.ts +0 -16
  161. package/dist/stats.esm.js +0 -4
  162. package/dist/trust-graph.d.ts +0 -54
  163. package/dist/trust-graph.esm.js +0 -56
  164. package/dist/types-B06Ypu2F.d.ts +0 -49
  165. package/dist/types-BP1m8VRw.d.ts +0 -340
  166. package/dist/types-CAD4va6a.d.ts +0 -5
  167. package/dist/types-CFV9G_7j.d.ts +0 -24
  168. package/dist/warmup-CEcppFiS.d.ts +0 -63
  169. package/dist/wasm.d.ts +0 -15
  170. package/dist/wasm.esm.js +0 -12
  171. package/dist/watchlist-for-business.d.ts +0 -79
  172. package/dist/watchlist-for-business.esm.js +0 -148
  173. package/dist/watchlist.d.ts +0 -62
  174. package/dist/watchlist.esm.js +0 -86
  175. package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
  176. package/dist/workflow.d.ts +0 -907
  177. package/dist/workflow.esm.js +0 -702
  178. package/dist/xstate.esm-B70JrNqo.esm.js +0 -3404
@@ -1,956 +0,0 @@
1
- import { t as Manager } from "./Manager-C8PrhBOx.js";
2
- import { t as ActorRefFrom } from "./Actor-CI32dTbG.js";
3
- import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-BCQrZJhf.js";
4
- import { t as CameraStream } from "./camera-DBSxa6ML.js";
5
- import { a as RegulationTypes, n as Flow, o as TutorialIdConfig } from "./types-BP1m8VRw.js";
6
- import { c as IMLProviderCapability, d as IRecordingCapability, f as RecordingConnection, i as IncodeCanvas, l as MLProviderConfig, n as IMotionSensorCapability, r as StreamCanvasCapture, t as DeepsightService, u as IStorageCapability } from "./deepsightService-CEVxzehb.js";
7
- import { n as PermissionStatus, t as PermissionResult } from "./types-CAD4va6a.js";
8
-
9
- //#region ../infra/src/capabilities/IIdCaptureCapability.d.ts
10
- /**
11
- * Configuration for ID capture provider.
12
- * Extends base ML provider config with ID-capture specific options.
13
- */
14
- type IdCaptureConfig$1 = MLProviderConfig;
15
- interface IdCaptureThresholds$1 {
16
- blurThreshold: number;
17
- blurChangeThreshold: number;
18
- glareThreshold: number;
19
- clsThreshold: number;
20
- sideThreshold: number;
21
- iouThreshold: number;
22
- idDetectedTimeout: number;
23
- autocaptureTimeout: number;
24
- framesAggregationInterval: number;
25
- }
26
- interface IdCaptureGeometry$1 {
27
- areaDown: number;
28
- areaUp: number;
29
- areaIOSPassportUp: number;
30
- areaIOSPassportDown: number;
31
- widthIOSUp: number;
32
- widthIOSDown: number;
33
- widthDown: number;
34
- widthUp: number;
35
- windowOuterWidth: number;
36
- windowOuterHeight: number;
37
- windowInnerWidth: number;
38
- windowInnerHeight: number;
39
- }
40
- interface IdCaptureSettings {
41
- isFixedMask: boolean;
42
- isIPhone14OrHigher: boolean;
43
- idType: string;
44
- blurCheckEnabled: boolean;
45
- glareCheckEnabled: boolean;
46
- faceQualityCheckEnabled: boolean;
47
- iouCheckEnabled: boolean;
48
- fpsLimitEnabled: boolean;
49
- }
50
- type IdCaptureModelType = 'v1' | 'v2' | 'v3';
51
- type DetectionOrientation = 'horizontal' | 'vertical';
52
- interface IdCaptureCallbacks {
53
- onFarAway?: () => void;
54
- onDetectionStarted?: () => void;
55
- onMaskChange?: (show: boolean, mask: boolean, top: number, orientation: DetectionOrientation) => void;
56
- onBlur?: () => void;
57
- onGlare?: () => void;
58
- onCapturing?: () => void;
59
- onCapture?: () => void;
60
- onBestFrame?: (blur: number, glare: number, orientation: string) => void;
61
- onIdNotDetected?: () => void;
62
- onSwitchToManualCapture?: () => void;
63
- onIdTypeChange?: (idType: string) => void;
64
- onIdSideChange?: (side: string) => void;
65
- onCapturingCounterValueChange?: (value: number) => void;
66
- }
67
- /**
68
- * WASM array type for quad coordinates.
69
- * Use .get(index) instead of [index] to access elements.
70
- */
71
- interface QuadArray {
72
- get(index: number): {
73
- x: number;
74
- y: number;
75
- };
76
- size?(): number;
77
- length?: number;
78
- }
79
- interface IdCaptureProcessResult {
80
- cls: number;
81
- blur: number;
82
- glare: number;
83
- quad: QuadArray;
84
- barQuad: QuadArray;
85
- side: string;
86
- size: number;
87
- idType: string;
88
- networkInferenceTime: number;
89
- }
90
- /**
91
- * Capability interface for ID document capture.
92
- * Extends the base ML provider capability with ID-capture specific methods.
93
- */
94
- interface IIdCaptureCapability extends IMLProviderCapability<IdCaptureConfig$1> {
95
- /**
96
- * Sets callbacks for ID capture events.
97
- * @param callbacks - Object containing callback functions for various capture events
98
- */
99
- setCallbacks(callbacks: IdCaptureCallbacks): void;
100
- /**
101
- * Sets detection thresholds for quality checks.
102
- * @param thresholds - Threshold values for blur, glare, and other quality metrics
103
- */
104
- setThresholds(thresholds: IdCaptureThresholds$1): void;
105
- /**
106
- * Sets geometry constraints for ID detection.
107
- * @param geometry - Geometry parameters for ID positioning
108
- */
109
- setGeometry(geometry: IdCaptureGeometry$1): void;
110
- /**
111
- * Sets capture settings.
112
- * @param settings - Configuration for capture behavior
113
- */
114
- setSettings(settings: IdCaptureSettings): void;
115
- /**
116
- * Sets the ML model type to use for ID detection.
117
- * @param modelType - Model version ('v1', 'v2', or 'v3')
118
- */
119
- setModelType(modelType: IdCaptureModelType): void;
120
- /**
121
- * Gets the last process result from the most recent frame processing.
122
- * Returns null if no frame has been processed yet.
123
- * @returns The last process result with quad coordinates, or null if not available
124
- */
125
- getLastProcessResult(): IdCaptureProcessResult | null;
126
- /**
127
- * Transforms the canvas using perspective correction based on frame coordinates.
128
- * @param canvas - The canvas to transform
129
- * @param frameRect - Frame rectangle in canvas coordinates (x, y, w, h)
130
- * @returns The transformed canvas
131
- */
132
- transformPerspective(canvas: IncodeCanvas, frameRect: {
133
- x: number;
134
- y: number;
135
- w: number;
136
- h: number;
137
- }): IncodeCanvas;
138
- /**
139
- * Gets the captured canvas (transformed for preview).
140
- * @returns The captured canvas, or null if not available
141
- */
142
- getCapturedCanvas(): IncodeCanvas | null;
143
- /**
144
- * Gets the original captured canvas (full frame for upload).
145
- * @returns The original captured canvas, or null if not available
146
- */
147
- getOriginalCapturedCanvas(): IncodeCanvas | null;
148
- /**
149
- * Sets the captured canvases (original and transformed).
150
- * Called by the state machine after capture and transformation.
151
- * @param original - The original full-frame canvas (for upload)
152
- * @param transformed - The transformed canvas (for preview)
153
- */
154
- setCapturedCanvases(original: IncodeCanvas, transformed: IncodeCanvas): void;
155
- }
156
- //#endregion
157
- //#region src/modules/id/manualUpload/types.d.ts
158
- type ManualUploadTab = 'id' | 'passport';
159
- type ManualUploadSide = 'front' | 'back' | 'passport';
160
- type ManualUploadContext = {
161
- /** Passed from parent machine input — used by guards and actor inputs. */
162
- onlyFront: boolean;
163
- isSecondId: boolean;
164
- /** Retry budget for this manual upload (sourced from `config.captureAttempts`). */
165
- captureAttempts: number;
166
- frontFile: File | null;
167
- backFile: File | null;
168
- passportFile: File | null;
169
- activeTab: ManualUploadTab;
170
- retriesLeft: number;
171
- errorMessage: string | null;
172
- /** Set from the front upload response; when true the back slot is auto-completed */
173
- skipBackFromServer: boolean;
174
- /** Whether each side has been successfully uploaded (for Continue gating) */
175
- frontUploaded: boolean;
176
- backUploaded: boolean;
177
- passportUploaded: boolean;
178
- };
179
- declare const MANUAL_UPLOAD_MAX_RETRIES = 3;
180
- declare const MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES: number;
181
- declare const MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS = 5000;
182
- //#endregion
183
- //#region ../infra/src/capabilities/IAnalyticsCapability.d.ts
184
- interface IAnalyticsCapability {
185
- analyzeFrame(image: ImageData): Promise<void>;
186
- update(): void;
187
- getAnalysisStatus(): string;
188
- getMotionStatus(): string;
189
- getMetadata(): string;
190
- }
191
- //#endregion
192
- //#region src/modules/id/types.d.ts
193
- type IdCaptureMode = 'front' | 'back' | 'passport';
194
- /**
195
- * Document type options for the ID capture chooser (ID, passport, manual ID upload, digital ID upload, digital ID from device wallet).
196
- * Used for selection and for the list of available options derived from config.
197
- */
198
- type IdDocumentType = 'id' | 'passport' | 'manualIdUpload' | 'digitalIdUpload' | 'digitalId';
199
- type IdFlowStep = 'chooser' | 'ageVerification' | 'tutorial' | 'permissions' | 'capture' | 'mandatoryConsent' | 'frontFinished' | 'backFinished' | 'success' | 'processing' | 'expired' | 'finished' | 'error' | 'closed' | 'manualIdUpload' | 'digitalIdUpload';
200
- type DetectionStatus = 'idle' | 'detecting' | 'farAway' | 'blur' | 'glare' | 'wrongSide' | 'capturing' | 'manualCapture' | 'idNotDetected' | 'offline';
201
- /**
202
- * Represents the detection area dimensions in pixels.
203
- * Used by UI to communicate the expected ID position and size to the WASM detection.
204
- */
205
- type DetectionArea = {
206
- x: number;
207
- y: number;
208
- width: number;
209
- height: number;
210
- };
211
- type IdCaptureGeometry = {
212
- areaDown: number;
213
- areaUp: number;
214
- areaIOSPassportUp: number;
215
- areaIOSPassportDown: number;
216
- widthIOSUp: number;
217
- widthIOSDown: number;
218
- widthDown: number;
219
- widthUp: number;
220
- windowOuterWidth: number;
221
- windowOuterHeight: number;
222
- windowInnerWidth: number;
223
- windowInnerHeight: number;
224
- };
225
- type IdCaptureThresholds = {
226
- blurThreshold: number;
227
- blurChangeThreshold: number;
228
- glareThreshold: number;
229
- clsThreshold: number;
230
- sideThreshold: number;
231
- iouThreshold: number;
232
- framesAggregationInterval: number;
233
- idDetectedTimeout: number;
234
- autocaptureTimeout: number;
235
- };
236
- type IdCaptureConfig = TutorialIdConfig & {
237
- recording?: {
238
- capability?: IRecordingCapability;
239
- };
240
- ageAssurance?: boolean;
241
- mergeSessionRecordings?: boolean;
242
- isDeepsightEnabled?: boolean;
243
- isSecondId?: boolean;
244
- geometry?: IdCaptureGeometry;
245
- detectionArea?: DetectionArea;
246
- thresholds?: Partial<IdCaptureThresholds>;
247
- settings?: Partial<IdCaptureSettings>;
248
- modelVersion?: 'v1' | 'v2' | 'v3';
249
- ds?: Flow['ds'];
250
- /**
251
- * When true, the capture machine reaches `finished` immediately after
252
- * back-side / manual-upload completion instead of invoking `/process/id`.
253
- * Used by engines where verification is owned by a downstream node — the
254
- * Workflow engine's `ID` node (handled by `idVerificationMachine`). Flow and
255
- * any other single-step caller leave this `false` so the inline verification
256
- * + recapture-on-expired UX continues to work.
257
- */
258
- skipProcessId?: boolean;
259
- };
260
- /**
261
- * Public ID capture configuration for the captureOnly flow.
262
- *
263
- * Differs from {@link IdCaptureConfig} by requiring an `onCapture` callback —
264
- * captureOnly bypasses the Incode upload pipeline and delivers the rich
265
- * capture payload locally instead. Compile-time enforcement (vs. a runtime
266
- * check) prevents shipping a captureOnly flow with no destination for the
267
- * payload.
268
- */
269
- type IdCaptureOnlyConfig = IdCaptureConfig & {
270
- onCapture: (response: CaptureOnlyResponse) => void | Promise<void>;
271
- };
272
- type IdErrorCode = 'UPLOAD_ERROR' | 'CLASSIFICATION_FAILED' | 'LOW_SHARPNESS' | 'GLARE_DETECTED' | 'WRONG_DOCUMENT_SIDE' | 'ID_TYPE_UNACCEPTABLE' | 'READABILITY_ISSUE' | 'RETRY_EXHAUSTED_CONTINUE_TO_BACK' | 'RETRY_EXHAUSTED_SKIP_BACK' | 'NO_MORE_TRIES' | 'UNEXPECTED_ERROR' | 'NO_TOKEN' | 'PERMISSION_DENIED' | 'USER_CANCELLED' | 'SERVER_ERROR';
273
- type IdError = {
274
- code: IdErrorCode;
275
- message: string;
276
- messageDescription?: string;
277
- };
278
- type UploadIdResponse = {
279
- sharpness: number;
280
- correctSharpness: boolean;
281
- glare: number;
282
- correctGlare: boolean;
283
- horizontalResolution: number;
284
- classification: boolean;
285
- readability: boolean;
286
- typeOfId: string;
287
- issueYear: number;
288
- issueName: string;
289
- curpCheck?: boolean;
290
- sessionStatus: string;
291
- countryCode: string;
292
- state?: string;
293
- skipBackIdCapture?: boolean;
294
- skipGlareFront?: boolean;
295
- skipGlareBack?: boolean;
296
- documentIsOnTheEdge?: boolean;
297
- acceptedDocuments?: Array<{
298
- type: string;
299
- name: string;
300
- }>;
301
- forceFrontIdCapture?: boolean;
302
- showMandatoryConsent?: boolean;
303
- regulationType?: RegulationTypes;
304
- failReason?: string;
305
- side?: 'front' | 'back';
306
- idQualityAttemptApproved?: boolean;
307
- isDocumentExpired?: boolean;
308
- };
309
- type CaptureIdResponse = UploadIdResponse & {
310
- croppedIDFace?: string;
311
- croppedFrontID?: string;
312
- croppedBackID?: string;
313
- originalImage?: string;
314
- frontIdImage?: string;
315
- backIdImage?: string;
316
- };
317
- type CapturedImage = {
318
- imageBase64: string;
319
- };
320
- /**
321
- * Rich captured image shape used by the captureOnly flow.
322
- *
323
- * `imageBase64`/`blob`/`url` reference the unprocessed full frame — always
324
- * present and the safest input for integrator-side processing.
325
- *
326
- * `croppedImage` is a best-effort approximate document crop produced by a
327
- * bilinear quad map (not a true perspective/homography warp). It is
328
- * populated only when on-device quad detection succeeds, and will visibly
329
- * diverge from the correct projective result for strongly tilted captures.
330
- * Prefer `imageBase64` when fidelity matters.
331
- */
332
- type IdCapturedImageData = {
333
- imageBase64: string;
334
- blob: Blob;
335
- url: string;
336
- metadata: string;
337
- croppedImage?: {
338
- imageBase64: string;
339
- blob: Blob;
340
- url: string;
341
- };
342
- };
343
- /**
344
- * Payload delivered to `IdCaptureConfig.onCapture` when `captureOnly` is enabled.
345
- */
346
- type CaptureOnlyResponse = {
347
- frontImage: IdCapturedImageData;
348
- backImage: IdCapturedImageData | undefined;
349
- };
350
- type RecordingSession = {
351
- token: string;
352
- sessionId: string;
353
- videoRecordingId: string;
354
- connection: RecordingConnection;
355
- resolution?: string;
356
- hasAudio: boolean;
357
- };
358
- declare const ID_ERROR_CODES: {
359
- readonly UPLOAD_ERROR: "UPLOAD_ERROR";
360
- readonly CLASSIFICATION_FAILED: "CLASSIFICATION_FAILED";
361
- readonly LOW_SHARPNESS: "LOW_SHARPNESS";
362
- readonly GLARE_DETECTED: "GLARE_DETECTED";
363
- readonly WRONG_DOCUMENT_SIDE: "WRONG_DOCUMENT_SIDE";
364
- readonly ID_TYPE_UNACCEPTABLE: "ID_TYPE_UNACCEPTABLE";
365
- readonly READABILITY_ISSUE: "READABILITY_ISSUE";
366
- readonly RETRY_EXHAUSTED_CONTINUE_TO_BACK: "RETRY_EXHAUSTED_CONTINUE_TO_BACK";
367
- readonly RETRY_EXHAUSTED_SKIP_BACK: "RETRY_EXHAUSTED_SKIP_BACK";
368
- readonly NO_MORE_TRIES: "NO_MORE_TRIES";
369
- readonly UNEXPECTED_ERROR: "UNEXPECTED_ERROR";
370
- readonly NO_TOKEN: "NO_TOKEN";
371
- readonly PERMISSION_DENIED: "PERMISSION_DENIED";
372
- readonly USER_CANCELLED: "USER_CANCELLED";
373
- readonly SERVER: "SERVER_ERROR";
374
- };
375
- type IdCaptureContext = {
376
- config: IdCaptureConfig;
377
- currentMode: IdCaptureMode;
378
- selectedDocumentType: IdDocumentType | undefined;
379
- stream: CameraStream | undefined;
380
- provider: IIdCaptureCapability | undefined;
381
- frameCapturer: StreamCanvasCapture | undefined;
382
- error: string | undefined;
383
- detectionStatus: DetectionStatus;
384
- counterValue: number;
385
- orientation: DetectionOrientation | undefined;
386
- capturedImages: {
387
- front?: CapturedImage;
388
- back?: CapturedImage;
389
- };
390
- /**
391
- * Rich capture payload used only by the captureOnly flow.
392
- * Populated by `finalizeIdCaptureOnly` actor; consumed by `finished.entry`
393
- * when firing `config.onCapture`. Remains empty in the regular upload flow.
394
- */
395
- captureOnlyImages: {
396
- front?: IdCapturedImageData;
397
- back?: IdCapturedImageData;
398
- };
399
- uploadResponse: CaptureIdResponse | undefined;
400
- recordingSession: RecordingSession | undefined;
401
- attemptsRemaining: number;
402
- /**
403
- * Number of consecutive `isDocumentExpired === true` upload responses for
404
- * the current side. Reset on side change; preserved across the soft-retry
405
- * cycle (`expired → capture`). Compared against `config.captureAttempts`.
406
- */
407
- expiredAttempts: number;
408
- /**
409
- * Number of times `processId` (end-of-flow expired detection) has returned
410
- * `isDocumentExpired === true` in this session. Persists across the full
411
- * `resetContext`-driven retry loop (Figma Story #2.2, 2-cap on the
412
- * digital-upload / multi-side path).
413
- */
414
- processingExpiredAttempts: number;
415
- /**
416
- * Set when the user has reached `expiredExhausted` and clicks Continue.
417
- * Tells the `processing` state to bypass `processId` (V1 parity: no
418
- * `/omni/process-id` call after force-back).
419
- */
420
- skipProcessId: boolean;
421
- /**
422
- * Distinguishes the two entry paths into the `expired` screen:
423
- * `true` for per-upload (camera) expired, `false` for `processing.onDone`
424
- * (digital-upload / end-of-flow expired). Drives the soft-retry branch.
425
- */
426
- expiredFromUpload: boolean;
427
- /**
428
- * `true` once a Digital ID upload has succeeded for this session. Digital
429
- * IDs are single-side documents (semantically like a passport), so back
430
- * capture must be skipped regardless of `alwaysCaptureBackOfId`. Used by
431
- * the manager mapper's `shouldCaptureBack` to suppress `needsBackCapture`
432
- * for the workflow orchestrator.
433
- */
434
- isDigitalUpload: boolean;
435
- /**
436
- * Set when `expiredExhausted` was reached via the per-upload (camera)
437
- * exhaustion path. Used by `CONTINUE_EXHAUSTED` to decide whether to run
438
- * `processId` once before finishing — required so the backend processes
439
- * whatever sides were uploaded (e.g. valid front + expired back).
440
- */
441
- exhaustedFromUpload: boolean;
442
- /**
443
- * Tells the `processing` state to skip the per-upload-expired retry/exhaustion
444
- * branches and go straight to `finished` after `processId.onDone`. Set
445
- * when entering `processing` from the `expiredExhausted → Continue` path
446
- * so we don't loop back to the Expired screen after we've already shown
447
- * the terminal "No attempts remaining" view.
448
- */
449
- forceFinishAfterProcessing: boolean;
450
- uploadError: IdErrorCode | undefined;
451
- permissionResult: PermissionResult | 'refresh' | undefined;
452
- resetDetection: (() => void) | undefined;
453
- idType: string | undefined;
454
- qualityElements: {
455
- glare?: number;
456
- sharpness?: number;
457
- } | undefined;
458
- debugFrame: ImageData | undefined;
459
- frameRect: {
460
- x: number;
461
- y: number;
462
- w: number;
463
- h: number;
464
- } | undefined;
465
- detectionArea: DetectionArea | undefined;
466
- previewImageUrl?: string;
467
- uploadProgress?: number;
468
- motionStatus?: 'PASS' | 'FAIL' | 'UNCLEAR';
469
- manualCaptureTriggered: boolean;
470
- deepsightService: DeepsightService | undefined;
471
- analyticsProvider: IAnalyticsCapability | undefined;
472
- dependencies: IdCaptureDependencies | undefined;
473
- disableIpify: boolean;
474
- deepsightInitAttempted: boolean;
475
- availableDocumentTypes: IdDocumentType[];
476
- /** Negotiated camera resolution (e.g. "1920x1080") for telemetry */
477
- captureResolution?: string;
478
- /** Android camera access fallback level that succeeded */
479
- cameraFallbackLevel?: number;
480
- };
481
- type IdCaptureEvent = {
482
- type: 'LOAD';
483
- } | {
484
- type: 'SELECT_DOCUMENT';
485
- documentType: IdDocumentType;
486
- } | {
487
- type: 'NEXT_STEP';
488
- } | {
489
- type: 'REQUEST_PERMISSION';
490
- } | {
491
- type: 'GO_TO_LEARN_MORE';
492
- } | {
493
- type: 'BACK';
494
- } | {
495
- type: 'QUIT';
496
- } | {
497
- type: 'RESET';
498
- } | {
499
- type: 'MANUAL_CAPTURE';
500
- } | {
501
- type: 'SWITCH_TO_MANUAL_CAPTURE';
502
- } | {
503
- type: 'DETECTION_UPDATE';
504
- status: DetectionStatus;
505
- } | {
506
- type: 'DETECTION_FRAME';
507
- frame: ImageData;
508
- } | {
509
- type: 'DETECTION_SUCCESS';
510
- canvas: IncodeCanvas;
511
- qualityElements?: {
512
- glare?: number;
513
- sharpness?: number;
514
- };
515
- } | {
516
- type: 'DETECTION_RESET_READY';
517
- reset: () => void;
518
- } | {
519
- type: 'COUNTER_VALUE_CHANGE';
520
- value: number;
521
- } | {
522
- type: 'ID_TYPE_CHANGE';
523
- idType: string;
524
- } | {
525
- type: 'ID_SIDE_CHANGE';
526
- side: string;
527
- } | {
528
- type: 'ORIENTATION_CHANGE';
529
- orientation: DetectionOrientation;
530
- } | {
531
- type: 'RETRY_CAPTURE';
532
- } | {
533
- type: 'CONTINUE_EXHAUSTED';
534
- } | {
535
- type: 'CONTINUE_FROM_ERROR';
536
- } | {
537
- type: 'FRONT_COMPLETE';
538
- } | {
539
- type: 'CONTINUE_TO_BACK';
540
- } | {
541
- type: 'CONTINUE_TO_FRONT';
542
- } | {
543
- type: 'PROCESS_COMPLETE';
544
- } | {
545
- type: 'PROCESS_EXPIRED';
546
- } | {
547
- type: 'CONSENT_ACCEPT';
548
- } | {
549
- type: 'CONSENT_CANCEL';
550
- } | {
551
- type: 'SKIP_BACK';
552
- } | {
553
- type: 'UPLOAD_PROGRESS';
554
- progress: number;
555
- } | {
556
- type: 'SET_FRAME_RECT';
557
- frameRect: {
558
- x: number;
559
- y: number;
560
- w: number;
561
- h: number;
562
- };
563
- } | {
564
- type: 'UPDATE_DETECTION_AREA';
565
- detectionArea: {
566
- x: number;
567
- y: number;
568
- width: number;
569
- height: number;
570
- };
571
- } | {
572
- type: 'MOTION_STATUS';
573
- status: 'PASS' | 'FAIL' | 'UNCLEAR';
574
- } | {
575
- type: 'MANUAL_UPLOAD_TAB_CHANGED';
576
- tab: ManualUploadTab;
577
- } | {
578
- type: 'MANUAL_UPLOAD_FILE_SELECTED';
579
- side: ManualUploadSide;
580
- file: File;
581
- } | {
582
- type: 'MANUAL_UPLOAD_CONTINUE';
583
- } | {
584
- type: 'MANUAL_UPLOAD_RESET';
585
- } | {
586
- type: 'DIGITAL_UPLOAD_NEXT_STEP';
587
- } | {
588
- type: 'DIGITAL_UPLOAD_FILE_PICKED';
589
- file: File;
590
- } | {
591
- type: 'DIGITAL_UPLOAD_CONFIRM';
592
- } | {
593
- type: 'DIGITAL_UPLOAD_REPLACE';
594
- } | {
595
- type: 'DIGITAL_UPLOAD_RETRY';
596
- } | {
597
- type: 'DIGITAL_UPLOAD_SCAN_INSTEAD';
598
- } | {
599
- type: 'DIGITAL_UPLOAD_CHOOSE_ANOTHER';
600
- };
601
- type IdCaptureDependencies = {
602
- storage: IStorageCapability;
603
- trackCaptureAttemptFinished?: (payload: {
604
- logs: string;
605
- resolution?: string;
606
- fallbackLevel?: number;
607
- }) => void;
608
- };
609
- type IdCaptureInput = {
610
- config: IdCaptureConfig;
611
- motionProvider?: IMotionSensorCapability;
612
- analyticsProvider?: IAnalyticsCapability;
613
- dependencies?: IdCaptureDependencies;
614
- };
615
- //#endregion
616
- //#region src/modules/id/idCaptureStateMachine.d.ts
617
- declare const idCaptureMachine: AnyStateMachine;
618
- type IdCaptureMachine = StateMachine<IdCaptureContext, IdCaptureEvent, any, any, any, any, any, any, any, IdCaptureInput, any, any, any, any>;
619
- //#endregion
620
- //#region src/modules/id/idCaptureActor.d.ts
621
- type CreateIdCaptureActorOptions = {
622
- config: IdCaptureConfig;
623
- dependencies?: IdCaptureDependencies;
624
- };
625
- type IdCaptureActor = ActorRefFrom<IdCaptureMachine>;
626
- declare function createIdCaptureActor(options: CreateIdCaptureActorOptions): IdCaptureActor;
627
- //#endregion
628
- //#region src/modules/id/idCaptureOnlyStateMachine.d.ts
629
- type IdCaptureOnlyContext = IdCaptureContext;
630
- type IdCaptureOnlyEvent = IdCaptureEvent;
631
- type IdCaptureOnlyInput = IdCaptureInput;
632
- /**
633
- * ID capture state machine variant for the captureOnly flow. Shares the full
634
- * base ID-capture state tree (chooser, tutorial, permissions, capture,
635
- * front/back finished, processing, finished); only the upload, process, and
636
- * recording steps are local instead of remote.
637
- */
638
- declare const idCaptureOnlyMachine: AnyStateMachine;
639
- type IdCaptureOnlyMachine = StateMachine<IdCaptureOnlyContext, IdCaptureOnlyEvent, any, any, any, any, any, any, any, IdCaptureOnlyInput, any, any, any, any>;
640
- //#endregion
641
- //#region src/modules/id/idCaptureOnlyActor.d.ts
642
- type CreateIdCaptureOnlyActorOptions = {
643
- config: IdCaptureOnlyConfig;
644
- dependencies?: IdCaptureDependencies;
645
- };
646
- type IdCaptureOnlyActor = ActorRefFrom<IdCaptureOnlyMachine>;
647
- declare function createIdCaptureOnlyActor(options: CreateIdCaptureOnlyActorOptions): IdCaptureOnlyActor;
648
- //#endregion
649
- //#region src/modules/id/idCaptureServices.d.ts
650
- type IdCaptureInitResult = {
651
- stream: CameraStream;
652
- provider: IIdCaptureCapability;
653
- captureResolution?: string;
654
- cameraFallbackLevel?: number;
655
- };
656
- type InitializeIdCaptureParams = {
657
- config: IdCaptureConfig;
658
- deepsightService?: DeepsightService;
659
- };
660
- declare function initializeIdCapture(params: InitializeIdCaptureParams): Promise<IdCaptureInitResult>;
661
- declare function stopStream(stream: CameraStream): void;
662
- type UploadIdImageParams = {
663
- image: string;
664
- type: 'front' | 'back';
665
- sendBase64?: boolean;
666
- isSecondId?: boolean;
667
- onlyFront?: boolean;
668
- glare?: number;
669
- sharpness?: number;
670
- shouldSkipGlareBack?: boolean;
671
- shouldSkipGlareFront?: boolean;
672
- captureType?: string;
673
- ageAssurance?: boolean;
674
- onProgress?: (progress: number) => void;
675
- metadata?: string;
676
- signal?: AbortSignal;
677
- analyticsProvider?: IAnalyticsCapability;
678
- imageData?: ImageData;
679
- };
680
- type ValidationError = {
681
- error: boolean;
682
- message: string;
683
- messageDescription?: string;
684
- errorKey: IdErrorCode;
685
- };
686
- declare function validateUploadResponse(response: UploadIdResponse & {
687
- failReason?: string;
688
- side?: 'front' | 'back';
689
- }, sessionState?: {
690
- skipGlareFront?: boolean;
691
- skipGlareBack?: boolean;
692
- }): ValidationError | undefined;
693
- declare function uploadIdImage(params: UploadIdImageParams): Promise<CaptureIdResponse>;
694
- type StartRecordingParams = {
695
- config: IdCaptureConfig;
696
- stream: CameraStream;
697
- existing?: RecordingSession;
698
- type: 'frontId' | 'backId';
699
- };
700
- declare function preloadIdRecordingProvider(config: IdCaptureConfig): void;
701
- declare function startRecordingSession(params: StartRecordingParams): Promise<RecordingSession | undefined>;
702
- declare function stopRecording(session: RecordingSession): void;
703
- declare function processId(isSecondId?: boolean, queueName?: string, signal?: AbortSignal): Promise<{
704
- isDocumentExpired: boolean;
705
- }>;
706
- type UploadManualIdFileParams = {
707
- side: 'front' | 'back' | 'passport';
708
- /**
709
- * Raw base64 payload (no `data:<mime>;base64,` prefix). Callers must strip
710
- * the data-URL prefix — the v2 backend rejects data URLs with
711
- * `IllegalArgumentException: Illegal base64 character 3a`.
712
- */
713
- base64Image: string;
714
- retry?: boolean;
715
- onlyFront?: boolean;
716
- signal?: AbortSignal;
717
- isSecondId?: boolean;
718
- };
719
- /**
720
- * Upload a user-selected image as front / back / passport ID.
721
- *
722
- * Uses the same request shape as the live-camera path (`uploadIdImage`):
723
- * JSON body `{ base64Image }` with default application/json Content-Type,
724
- * `captureType=UPLOAD` query param, `retry=true` when retrying.
725
- * Back is POSTed to `/omni/add/back-id/v2` (or `/omni/add/back-second-id/v2`
726
- * when `isSecondId`); front and passport go to `/omni/add/front-id/v2` (or
727
- * `/omni/add/front-second-id/v2` when `isSecondId`).
728
- *
729
- * The v2 endpoints reject raw `image/jpeg` bodies with 415, so the caller
730
- * must convert the File to base64 before calling this service.
731
- */
732
- declare function uploadManualIdFile(params: UploadManualIdFileParams): Promise<UploadIdResponse>;
733
- //#endregion
734
- //#region src/modules/id/digitalUpload/types.d.ts
735
- type DigitalUploadFailReason = 'DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED' | 'ID_TYPE_UNACCEPTABLE' | 'FILE_CHANGED_ERROR' | 'INVALID_FILE_TYPE' | 'NETWORK_ERROR' | 'GENERIC';
736
- //#endregion
737
- //#region src/internal/idCapture/idCaptureManagerFactory.d.ts
738
- type CaptureStatus = 'initializing' | 'detecting' | 'capturing' | 'uploading' | 'uploadError' | 'success';
739
- type IdCaptureIdleState = {
740
- status: 'idle';
741
- };
742
- type IdCaptureChooserState = {
743
- status: 'chooser';
744
- availableDocumentTypes: IdDocumentType[];
745
- };
746
- type IdCaptureLoadingState = {
747
- status: 'loading';
748
- };
749
- type IdCaptureTutorialState = {
750
- status: 'tutorial';
751
- selectedDocumentType: IdDocumentType | undefined;
752
- currentMode: IdCaptureMode;
753
- };
754
- type IdCaptureAgeVerificationState = {
755
- status: 'ageVerification';
756
- };
757
- type IdCapturePermissionsState = {
758
- status: 'permissions';
759
- permissionStatus: PermissionStatus;
760
- };
761
- type IdCaptureCaptureState = {
762
- status: 'capture';
763
- captureStatus: CaptureStatus;
764
- stream: CameraStream | undefined;
765
- detectionStatus: DetectionStatus;
766
- debugFrame: ImageData | undefined;
767
- attemptsRemaining: number;
768
- uploadError: IdErrorCode | undefined;
769
- currentMode: IdCaptureMode;
770
- counterValue: number;
771
- orientation: DetectionOrientation | undefined;
772
- idType: string | undefined;
773
- previewImageUrl?: string;
774
- uploadProgress?: number;
775
- ageAssurance: boolean;
776
- uploadErrorMessage?: string;
777
- uploadErrorDescription?: string;
778
- /** Whether back capture is needed after front capture completes */
779
- needsBackCapture: boolean;
780
- /** Whether front capture is needed after back capture (usSmartCapture + forceFrontIdCapture) */
781
- needsFrontCapture: boolean;
782
- showCaptureButtonInAuto: boolean;
783
- /** Whether retry is available (attemptsRemaining > 0) */
784
- canRetry: boolean;
785
- };
786
- type IdCaptureMandatoryConsentState = {
787
- status: 'mandatoryConsent';
788
- regulationType: RegulationTypes;
789
- };
790
- type IdCaptureFrontFinishedState = {
791
- status: 'frontFinished';
792
- };
793
- type IdCaptureBackFinishedState = {
794
- status: 'backFinished';
795
- };
796
- type IdCaptureProcessingState = {
797
- status: 'processing';
798
- };
799
- type IdCaptureExpiredState = {
800
- status: 'expired';
801
- /**
802
- * Remaining attempts after this expired result. Mirrors V1's
803
- * `idv2.capture.processing.attemptsRemainingLabel` counter and Figma's
804
- * "X attempts remaining" line on `1-9-11-id-documenterror`.
805
- */
806
- attemptsRemaining: number;
807
- };
808
- type IdCaptureExpiredExhaustedState = {
809
- status: 'expiredExhausted';
810
- };
811
- type IdCaptureFinishedState = {
812
- status: 'finished';
813
- };
814
- type IdCaptureClosedState = {
815
- status: 'closed';
816
- };
817
- type IdCaptureErrorState = {
818
- status: 'error';
819
- error: string;
820
- };
821
- type ManualUploadUploadingSide = ManualUploadSide;
822
- type IdCaptureManualUploadState = {
823
- status: 'manualUpload';
824
- phase: 'selecting' | 'uploading' | 'exhausted';
825
- /** Which side is currently uploading (undefined in `selecting`/`exhausted`). */
826
- uploadingSide: ManualUploadUploadingSide | undefined;
827
- activeTab: ManualUploadTab;
828
- showIdTab: boolean;
829
- showPassportTab: boolean;
830
- /** Whether the ID tab should render a back-of-ID slot. */
831
- showBackSlot: boolean;
832
- frontFileName: string | undefined;
833
- backFileName: string | undefined;
834
- passportFileName: string | undefined;
835
- frontUploaded: boolean;
836
- backUploaded: boolean;
837
- passportUploaded: boolean;
838
- canContinue: boolean;
839
- retriesLeft: number;
840
- /** i18n key for the current error message, if any. */
841
- errorKey: string | null;
842
- };
843
- type IdCaptureDigitalUploadState = {
844
- status: 'digitalIdUpload';
845
- phase: 'tutorial' | 'selecting' | 'reviewing' | 'uploading' | 'holding' | 'success' | 'error' | 'fileTooLarge' | 'exhausted';
846
- file: File | null;
847
- fileName: string | undefined;
848
- failReason: DigitalUploadFailReason | null;
849
- attemptsRemaining: number;
850
- uploadProgress: number;
851
- pickerRequestId: number;
852
- };
853
- type IdCaptureState = IdCaptureIdleState | IdCaptureChooserState | IdCaptureLoadingState | IdCaptureTutorialState | IdCaptureAgeVerificationState | IdCapturePermissionsState | IdCaptureCaptureState | IdCaptureMandatoryConsentState | IdCaptureFrontFinishedState | IdCaptureBackFinishedState | IdCaptureProcessingState | IdCaptureExpiredState | IdCaptureExpiredExhaustedState | IdCaptureFinishedState | IdCaptureClosedState | IdCaptureErrorState | IdCaptureManualUploadState | IdCaptureDigitalUploadState;
854
- /**
855
- * Union of all `idCaptureMachine` variants' actor types. Variants share the
856
- * same state tree and context shape, so the manager helpers
857
- * (`mapState`, `createApi`) work uniformly for either flavor at runtime.
858
- */
859
- type AnyIdCaptureActor = IdCaptureActor | IdCaptureOnlyActor;
860
- /**
861
- * Builds the public ID capture manager from an already-created actor.
862
- * Used by both `createIdCaptureManager` and `createIdCaptureOnlyManager`.
863
- *
864
- * The internal cast to `IdCaptureActor` narrows the union for `createManager`,
865
- * which is typed against the regular machine. Variants produced via
866
- * `idCaptureMachine.provide({...})` share the same context and event types,
867
- * so the cast is sound at runtime — only the actor implementation differs.
868
- */
869
- declare function createIdCaptureManagerFromActor(actor: AnyIdCaptureActor): Manager<IdCaptureState> & {
870
- load(): void;
871
- selectDocument(documentType: IdDocumentType): void;
872
- nextStep(): void;
873
- requestPermission(): void;
874
- goToLearnMore(): void;
875
- back(): void;
876
- close(): void;
877
- reset(): void;
878
- retryCapture(): void;
879
- continueExhausted(): void;
880
- continueFromError(): void;
881
- capture(): void;
882
- switchToManualCapture(): void;
883
- continueToBack(): void;
884
- continueToFront(): void;
885
- skipBack(): void;
886
- acceptMandatoryConsent(): void;
887
- cancelMandatoryConsent(): void;
888
- /**
889
- * Updates the detection area used for WASM geometry calculation.
890
- * Call this when the UI detection area dimensions change (e.g., on resize or orientation change).
891
- */
892
- updateDetectionArea(detectionArea: DetectionArea): void;
893
- /**
894
- * Manual upload: tab change (ID / Passport). Resets per-tab file selections.
895
- * Note: there is intentionally no `switchToManualUpload` method — entry to
896
- * the manual-upload flow is gated by config + Chooser to prevent a
897
- * dev-console bypass of live camera capture.
898
- */
899
- manualUploadChangeTab(tab: ManualUploadTab): void;
900
- manualUploadSelectFile(side: ManualUploadSide, file: File): void;
901
- manualUploadContinue(): void;
902
- manualUploadReset(): void;
903
- digitalUploadNextStep(): void;
904
- digitalUploadPickFile(file: File): void;
905
- digitalUploadConfirm(): void;
906
- digitalUploadReplace(): void;
907
- digitalUploadRetry(): void;
908
- digitalUploadScanInstead(): void;
909
- digitalUploadChooseAnother(): void;
910
- };
911
- type IdCaptureManager = ReturnType<typeof createIdCaptureManagerFromActor>;
912
- //#endregion
913
- //#region src/modules/id/idCaptureManager.d.ts
914
- /**
915
- * Creates a manager for the regular ID capture flow. The shared
916
- * `mapState`/`createApi`/state-types live in
917
- * `internal/idCapture/idCaptureManagerFactory.ts`; this file is a thin
918
- * wrapper that creates the actor and delegates to the factory.
919
- *
920
- * For the captureOnly flow (rich payload delivered locally via `onCapture`),
921
- * use `createIdCaptureOnlyManager`.
922
- */
923
- declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): Manager<IdCaptureState> & {
924
- load(): void;
925
- selectDocument(documentType: IdDocumentType): void;
926
- nextStep(): void;
927
- requestPermission(): void;
928
- goToLearnMore(): void;
929
- back(): void;
930
- close(): void;
931
- reset(): void;
932
- retryCapture(): void;
933
- continueExhausted(): void;
934
- continueFromError(): void;
935
- capture(): void;
936
- switchToManualCapture(): void;
937
- continueToBack(): void;
938
- continueToFront(): void;
939
- skipBack(): void;
940
- acceptMandatoryConsent(): void;
941
- cancelMandatoryConsent(): void;
942
- updateDetectionArea(detectionArea: DetectionArea): void;
943
- manualUploadChangeTab(tab: ManualUploadTab): void;
944
- manualUploadSelectFile(side: ManualUploadSide, file: File): void;
945
- manualUploadContinue(): void;
946
- manualUploadReset(): void;
947
- digitalUploadNextStep(): void;
948
- digitalUploadPickFile(file: File): void;
949
- digitalUploadConfirm(): void;
950
- digitalUploadReplace(): void;
951
- digitalUploadRetry(): void;
952
- digitalUploadScanInstead(): void;
953
- digitalUploadChooseAnother(): void;
954
- };
955
- //#endregion
956
- export { MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES as $, CaptureIdResponse as A, IdCaptureGeometry as B, IdCaptureOnlyMachine as C, createIdCaptureActor as D, IdCaptureActor as E, ID_ERROR_CODES as F, IdCapturedImageData as G, IdCaptureMode as H, IdCaptureConfig as I, IdErrorCode as J, IdDocumentType as K, IdCaptureContext as L, CapturedImage as M, DetectionArea as N, IdCaptureMachine as O, DetectionStatus as P, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS as Q, IdCaptureDependencies as R, createIdCaptureOnlyActor as S, CreateIdCaptureActorOptions as T, IdCaptureOnlyConfig as U, IdCaptureInput as V, IdCaptureThresholds as W, RecordingSession as X, IdFlowStep as Y, UploadIdResponse as Z, uploadIdImage as _, IdCaptureInitResult as a, IdCaptureSettings as at, CreateIdCaptureOnlyActorOptions as b, UploadIdImageParams as c, initializeIdCapture as d, MANUAL_UPLOAD_MAX_RETRIES as et, preloadIdRecordingProvider as f, stopStream as g, stopRecording as h, createIdCaptureManagerFromActor as i, DetectionOrientation as it, CaptureOnlyResponse as j, idCaptureMachine as k, UploadManualIdFileParams as l, startRecordingSession as m, IdCaptureManager as n, ManualUploadSide as nt, InitializeIdCaptureParams as o, processId as p, IdError as q, IdCaptureState as r, ManualUploadTab as rt, StartRecordingParams as s, createIdCaptureManager as t, ManualUploadContext as tt, ValidationError as u, uploadManualIdFile as v, idCaptureOnlyMachine as w, IdCaptureOnlyActor as x, validateUploadResponse as y, IdCaptureEvent as z };