@microblink/blinkid-verify-core 3.20.0-rc.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.
- package/README.md +71 -0
- package/dist/blinkid-verify-core.js +1229 -0
- package/dist/resources/DO_NOT_MODIFY_THIS_DIRECTORY.md +2 -0
- package/dist/resources/advanced/BlinkIdVerifyModule.data +0 -0
- package/dist/resources/advanced/BlinkIdVerifyModule.js +125 -0
- package/dist/resources/advanced/BlinkIdVerifyModule.wasm +0 -0
- package/dist/resources/advanced-threads/BlinkIdVerifyModule.data +0 -0
- package/dist/resources/advanced-threads/BlinkIdVerifyModule.js +146 -0
- package/dist/resources/advanced-threads/BlinkIdVerifyModule.wasm +0 -0
- package/dist/resources/blinkid-verify-worker.js +924 -0
- package/dist/resources/size-manifest.json +10 -0
- package/package.json +33 -0
- package/types/BlinkIdVerifyCore.d.ts +30 -0
- package/types/BlinkIdVerifyCore.d.ts.map +1 -0
- package/types/generatePayloadForBlinkIdVerifyCloudApi.d.ts +238 -0
- package/types/generatePayloadForBlinkIdVerifyCloudApi.d.ts.map +1 -0
- package/types/index.d.ts +28 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.rollup.d.ts +1537 -0
|
@@ -0,0 +1,1537 @@
|
|
|
1
|
+
import { finalizer } from 'comlink';
|
|
2
|
+
import { ProxyMarked } from 'comlink';
|
|
3
|
+
import { Remote } from 'comlink';
|
|
4
|
+
import type { SetOptional } from 'type-fest';
|
|
5
|
+
import type { Simplify } from 'type-fest';
|
|
6
|
+
|
|
7
|
+
declare type AlertType = "InvalidLicenseKey" | "NetworkError" | "DocumentClassNotAllowed" | "StepTimeout";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Analytic service
|
|
11
|
+
* Provides a clean interface for tracking user interactions and events
|
|
12
|
+
*/
|
|
13
|
+
export declare class AnalyticService {
|
|
14
|
+
#private;
|
|
15
|
+
constructor({ pingFn, sendPingletsFn, }: {
|
|
16
|
+
pingFn: (ping: Ping) => Promise<void>;
|
|
17
|
+
sendPingletsFn: () => Promise<void>;
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Safely send queued pinglets, handling errors gracefully
|
|
21
|
+
*/
|
|
22
|
+
sendPinglets(): Promise<void>;
|
|
23
|
+
logCameraStartedEvent(): Promise<void>;
|
|
24
|
+
logCameraClosedEvent(): Promise<void>;
|
|
25
|
+
logHelpOpenedEvent(): Promise<void>;
|
|
26
|
+
logHelpClosedEvent(contentFullyViewed: boolean): Promise<void>;
|
|
27
|
+
logHelpTooltipDisplayedEvent(): Promise<void>;
|
|
28
|
+
logCloseButtonClickedEvent(): Promise<void>;
|
|
29
|
+
logOnboardingDisplayedEvent(): Promise<void>;
|
|
30
|
+
logAlertDisplayedEvent(alertType: NonNullable<PingUxEventData["alertType"]>): Promise<void>;
|
|
31
|
+
logErrorMessageEvent(errorMessageType: PingUxEventData["errorMessageType"]): Promise<void>;
|
|
32
|
+
logAppMovedToBackgroundEvent(): Promise<void>;
|
|
33
|
+
logStepTimeoutEvent(): Promise<void>;
|
|
34
|
+
logCameraInputInfo(pingData: PingCameraInputInfoData): Promise<void>;
|
|
35
|
+
logHardwareCameraInfo(cameras: PingCameraHardwareInfoData["availableCameras"]): Promise<void>;
|
|
36
|
+
logCameraPermissionCheck(granted: boolean): Promise<void>;
|
|
37
|
+
logCameraPermissionRequest(): Promise<void>;
|
|
38
|
+
logCameraPermissionUserResponse(granted: boolean): Promise<void>;
|
|
39
|
+
logDeviceOrientation(orientation: PingScanningConditionsData["deviceOrientation"]): Promise<void>;
|
|
40
|
+
logFlashlightState(flashlightOn: boolean): Promise<void>;
|
|
41
|
+
logDeviceInfo(pingData: PingBrowserDeviceInfoData): Promise<void>;
|
|
42
|
+
logErrorEvent({ origin, error, errorType, sessionNumber, }: {
|
|
43
|
+
origin: string;
|
|
44
|
+
error: unknown;
|
|
45
|
+
errorType: PingErrorData["errorType"];
|
|
46
|
+
sessionNumber?: number;
|
|
47
|
+
}): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare type AvailableCamerasItem = {
|
|
51
|
+
deviceId: string;
|
|
52
|
+
cameraFacing: CameraFacing;
|
|
53
|
+
focus?: Focus;
|
|
54
|
+
availableResolutions?: AvailableResolutionsItem[];
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
declare type AvailableResolutionsItem = {
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Base interface for a scanning session.
|
|
64
|
+
* All SDK scanning sessions must implement this interface to work with the proxy worker.
|
|
65
|
+
*/
|
|
66
|
+
declare interface BaseScanningSession {
|
|
67
|
+
/**
|
|
68
|
+
* Processes an image frame and returns a result.
|
|
69
|
+
* @param image - The image data to process
|
|
70
|
+
* @returns The processing result (type varies by SDK)
|
|
71
|
+
*/
|
|
72
|
+
process: (image: ImageData) => unknown;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Base interface for an SDK worker proxy.
|
|
77
|
+
* All SDK worker proxies must implement this interface to work with the auto-transfer wrapper.
|
|
78
|
+
*
|
|
79
|
+
* Note: The return type can be sync or async (Promise) because Comlink wraps synchronous
|
|
80
|
+
* methods as async when accessed remotely.
|
|
81
|
+
*/
|
|
82
|
+
declare interface BaseSdkWorkerProxy {
|
|
83
|
+
/**
|
|
84
|
+
* Creates a new scanning session.
|
|
85
|
+
* @param args - Session configuration arguments (varies by SDK)
|
|
86
|
+
* @returns A scanning session (sync or Promise-wrapped)
|
|
87
|
+
*/
|
|
88
|
+
createScanningSession: (...args: never[]) => BaseScanningSession | Promise<BaseScanningSession>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The BlinkIdVerify bindings.
|
|
93
|
+
*
|
|
94
|
+
* @ignore
|
|
95
|
+
*/
|
|
96
|
+
export declare interface BlinkIdVerifyBindings extends WasmBindings<BlinkIdVerifySessionSettings, BlinkIdVerifyScanningSession> {
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Represents the BlinkIdVerify core instance.
|
|
101
|
+
*
|
|
102
|
+
* This type extends the Remote type from Comlink, which is used to proxy calls to the BlinkIdVerify worker.
|
|
103
|
+
* It simplifies the type to remove unnecessary complexity.
|
|
104
|
+
*/
|
|
105
|
+
export declare type BlinkIdVerifyCore = Simplify<Remote<BlinkIdVerifyWorkerProxy>>;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Configuration options for initializing the BlinkIdVerify core.
|
|
109
|
+
*
|
|
110
|
+
* This type extends the BlinkIdVerifyWorkerInitSettings type by making the userId and useLightweightBuild properties optional.
|
|
111
|
+
* It allows for partial configuration of the initialization settings.
|
|
112
|
+
*/
|
|
113
|
+
export declare type BlinkIdVerifyInitSettings = SetOptional<BlinkIdVerifyWorkerInitSettings, "userId">;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The request payload sent to the BlinkID Verify API.
|
|
117
|
+
*
|
|
118
|
+
* Contains the captured document images, verification options, and use-case
|
|
119
|
+
* configuration derived from the scanning result and session settings.
|
|
120
|
+
*/
|
|
121
|
+
declare type BlinkIdVerifyPayload = {
|
|
122
|
+
/** The front-side image of the document. */
|
|
123
|
+
imageFront?: BlinkIdVerifyRequestDocumentVerificationImageSource;
|
|
124
|
+
/** The back-side image of the document. */
|
|
125
|
+
imageBack?: BlinkIdVerifyRequestDocumentVerificationImageSource;
|
|
126
|
+
/** The barcode image extracted from the document. */
|
|
127
|
+
imageBarcode?: BlinkIdVerifyRequestDocumentVerificationImageSource;
|
|
128
|
+
/** Verification options that control check strictness and returned data. */
|
|
129
|
+
options?: {
|
|
130
|
+
/** Whether an expired document should be treated as fraudulent. */
|
|
131
|
+
treatExpirationAsFraud?: boolean;
|
|
132
|
+
/** Controls which parts of the result are anonymized. */
|
|
133
|
+
anonymizationMode?: BlinkIdVerifyRequestAnonymizationMode;
|
|
134
|
+
/** How image quality issues affect the overall verification outcome. */
|
|
135
|
+
imageQualityInterpretation?: BlinkIdVerifyRequestImageQualityInterpretation;
|
|
136
|
+
/** Match level threshold for detecting that the document was displayed on a screen. */
|
|
137
|
+
screenMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
138
|
+
/** Match level threshold for detecting photocopy fraud. */
|
|
139
|
+
photocopyMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
140
|
+
/** Match level threshold for detecting barcode anomalies. */
|
|
141
|
+
barcodeAnomalyMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
142
|
+
/** Match level threshold for detecting photo forgery. */
|
|
143
|
+
photoForgeryMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
144
|
+
/** Match level threshold for verifying static security features. */
|
|
145
|
+
staticSecurityFeaturesMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
146
|
+
/** Match level threshold for data consistency checks across document fields. */
|
|
147
|
+
dataMatchMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
148
|
+
/** Match level threshold for the blur image quality check. */
|
|
149
|
+
blurMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
150
|
+
/** Match level threshold for the glare image quality check. */
|
|
151
|
+
glareMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
152
|
+
/** Match level threshold for the lighting image quality check. */
|
|
153
|
+
lightingMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
154
|
+
/** Match level threshold for the sharpness image quality check. */
|
|
155
|
+
sharpnessMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
156
|
+
/** Match level threshold for the hand occlusion image quality check. */
|
|
157
|
+
handOcclusionMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
158
|
+
/** Match level threshold for the DPI (dots per inch) image quality check. */
|
|
159
|
+
dpiMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
160
|
+
/** Match level threshold for the document tilt image quality check. */
|
|
161
|
+
tiltMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
162
|
+
/** Whether to include the face image in the API response. */
|
|
163
|
+
returnFaceImage?: boolean;
|
|
164
|
+
/** Whether to include the full document image in the API response. */
|
|
165
|
+
returnFullDocumentImage?: boolean;
|
|
166
|
+
/** Whether to include the signature image in the API response. */
|
|
167
|
+
returnSignatureImage?: boolean;
|
|
168
|
+
/** The image format used for returned images. */
|
|
169
|
+
returnImageFormat?: "Jpg" | "Png" | "Qoi";
|
|
170
|
+
/** Match level threshold for the generative AI–based fraud detection check. */
|
|
171
|
+
generativeAiMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
172
|
+
};
|
|
173
|
+
/** Use-case configuration that tailors the verification policy to the deployment context. */
|
|
174
|
+
useCase?: {
|
|
175
|
+
/** The overall strictness policy applied during document verification. */
|
|
176
|
+
documentVerificationPolicy?: BlinkIdVerifyRequestDocumentVerificationPolicy;
|
|
177
|
+
/** The physical context in which the document is being verified. */
|
|
178
|
+
verificationContext?: BlinkIdVerifyRequestVerificationContext;
|
|
179
|
+
/** Which verification outcomes are escalated for manual human review. */
|
|
180
|
+
manualReviewStrategy?: BlinkIdVerifyRequestManualReviewStrategy;
|
|
181
|
+
/** The sensitivity threshold for triggering manual review. */
|
|
182
|
+
manualReviewSensitivity?: BlinkIdVerifyRequestManualReviewSensitivity;
|
|
183
|
+
/** The level of control over image capture conditions. */
|
|
184
|
+
captureConditions?: BlinkIdVerifyRequestCaptureConditions;
|
|
185
|
+
};
|
|
186
|
+
/** The unique identifier of the capture session, used to correlate the request with SDK telemetry. */
|
|
187
|
+
captureSessionId: string;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Represents the analysis and processing results of an input frame. Provides
|
|
192
|
+
* real-time feedback on the document's state, identifying any obstacles
|
|
193
|
+
* preventing successful processing. It also contains extracted data used to
|
|
194
|
+
* determine the next steps in the scanning workflow.
|
|
195
|
+
*/
|
|
196
|
+
export declare type BlinkIdVerifyProcessResult = {
|
|
197
|
+
/**
|
|
198
|
+
* The result of analyzing the frame. Indicating any issues with the currently
|
|
199
|
+
* processed frame as well as giving some information about the document
|
|
200
|
+
*/
|
|
201
|
+
inputImageAnalysisResult: InputImageAnalysisResult;
|
|
202
|
+
/**
|
|
203
|
+
* Tracking information for the scanning lifecycle. Indicates when the session
|
|
204
|
+
* has gathered enough data to produce a final result.
|
|
205
|
+
*/
|
|
206
|
+
resultCompleteness: ResultCompleteness;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Controls which parts of the verification result are anonymized in the API response.
|
|
211
|
+
*
|
|
212
|
+
* - `"ImageOnly"` — redacts only the document images.
|
|
213
|
+
* - `"ResultFieldsOnly"` — redacts only the parsed data fields.
|
|
214
|
+
* - `"FullResult"` — redacts both images and data fields.
|
|
215
|
+
* - `"None"` — no anonymization is applied.
|
|
216
|
+
*/
|
|
217
|
+
export declare type BlinkIdVerifyRequestAnonymizationMode = "ImageOnly" | "ResultFieldsOnly" | "FullResult" | "None";
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Defines the conditions under which the document is captured as part of the
|
|
221
|
+
* `UseCase` settings.
|
|
222
|
+
*
|
|
223
|
+
* - `"NoControl"`: Is the same as `"Basic"`, it will be removed in
|
|
224
|
+
* the future.
|
|
225
|
+
* - `"Basic"`: Allows for processing of fully cropped documents. The integrator
|
|
226
|
+
* has no control over the capture process on the user's side and is limited
|
|
227
|
+
* by the lack of a robust SDK. It is not possible for a cropped document to
|
|
228
|
+
* get a `Pass` or `Accept` in the overall result. Liveness checks will not be
|
|
229
|
+
* performed if the document is fully cropped.
|
|
230
|
+
* - `"Hybrid"`: Allows for processing of fully cropped documents. The integrator
|
|
231
|
+
* has no control over the capture process on the user's side and is limited
|
|
232
|
+
* by the lack of a robust SDK. It is possible for a cropped document to get a
|
|
233
|
+
* `Pass` or `Accept` in the overall result. Liveness checks will not be
|
|
234
|
+
* performed if the document is fully cropped.
|
|
235
|
+
*/
|
|
236
|
+
export declare type BlinkIdVerifyRequestCaptureConditions = "NoControl" | "Basic" | "Hybrid";
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Represents a document image submitted to the BlinkID Verify API.
|
|
240
|
+
*/
|
|
241
|
+
declare type BlinkIdVerifyRequestDocumentVerificationImageSource = {
|
|
242
|
+
/** Base64-encoded JPEG image data, or `null` if no image is available. */
|
|
243
|
+
base64: string | null;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Defines the strictness of checks performed by BlinkID Verify API as part of the
|
|
248
|
+
* `UseCase` settings.
|
|
249
|
+
*
|
|
250
|
+
* - `"Permissive"`: Optimized for letting real users through. In cases of doubt
|
|
251
|
+
* or lower confidence, BlinkID Verify API will avoid failing the document.
|
|
252
|
+
* - `"Standard"`: Default policy. It is more strict compared to `Permissive` but
|
|
253
|
+
* still optimized for accepting real users.
|
|
254
|
+
* - `"Strict"`: Users with damaged documents, bad lighting conditions or lower
|
|
255
|
+
* image quality will probably be rejected. In cases of doubt or lower
|
|
256
|
+
* confidence, the document will more often be rejected.
|
|
257
|
+
* - `"VeryStrict"`: Reasonable only for the most sensitive use cases.
|
|
258
|
+
* Significant user friction is added to stop as much fraud as possible.
|
|
259
|
+
*/
|
|
260
|
+
declare type BlinkIdVerifyRequestDocumentVerificationPolicy = "Permissive" | "Standard" | "Strict" | "VeryStrict";
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Specifies the strictness of the model when marking the quality of the image.
|
|
264
|
+
* Includes a range of values that allow for more or less conservative
|
|
265
|
+
* approach.
|
|
266
|
+
*
|
|
267
|
+
* - `"Ignore"`: Ensures that BlinkID Verify API returns a `Pass` or `Fail` verdict
|
|
268
|
+
* even if image quality is not good enough.
|
|
269
|
+
* - `"Conservative"`: If image quality is not good enough, BlinkID Verify API will
|
|
270
|
+
* refuse to process the image and a `NotPerformed` verdict will be returned.
|
|
271
|
+
* When a `NotPerformed` verdict is returned, BlinkID Verify API will prompt the
|
|
272
|
+
* user to repeat the capture process. This is indicated by the `Retry` value
|
|
273
|
+
* under `RecommendedOutcome` in the response.
|
|
274
|
+
* - `"HighAssurance"`: A `Fail` verdict can be returned even if image quality is
|
|
275
|
+
* not good enough, but occasionally a `Pass` verdict will not be returned if
|
|
276
|
+
* image quality is not satisfactory.
|
|
277
|
+
* - `"HighConversion"`: A `Pass` verdict can be returned even if image quality
|
|
278
|
+
* is not good enough, but occasionally a `Fail` verdict will not be returned
|
|
279
|
+
* if image quality is not satisfactory.
|
|
280
|
+
* - `"VeryHighConversion"`: A `Pass` verdict can be returned even if image
|
|
281
|
+
* quality is significantly unsatisfactory, but a `Fail` verdict will not be
|
|
282
|
+
* returned if image quality is really poor.
|
|
283
|
+
*/
|
|
284
|
+
export declare type BlinkIdVerifyRequestImageQualityInterpretation = "Ignore" | "Conservative" | "HighAssurance" | "HighConversion" | "VeryHighConversion";
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Defines the volume of documents that will be sent for manual review as part
|
|
288
|
+
* of the `UseCase` settings. The outcome depends on the selected policy and
|
|
289
|
+
* varies according to the overall verification `CertaintyLevel`.
|
|
290
|
+
*
|
|
291
|
+
* If manual review is not used, this setting is ignored.
|
|
292
|
+
*
|
|
293
|
+
* - `"Low"`: Only borderline cases are sent for manual review. <br/> Documents
|
|
294
|
+
* where certainty is `Low` alongside a `SuspiciousDataCheck` fail will be
|
|
295
|
+
* sent for manual review.
|
|
296
|
+
* - `"Default"`: The manual review process is default.
|
|
297
|
+
* - `"High"`: The manual review process is high.
|
|
298
|
+
*/
|
|
299
|
+
export declare type BlinkIdVerifyRequestManualReviewSensitivity = "Low" | "Default" | "High";
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Defines the manual review strategy used during document verification as part
|
|
303
|
+
* of the `UseCase` settings.
|
|
304
|
+
*
|
|
305
|
+
* - `"Never"`: No documents will be sent for manual review.
|
|
306
|
+
* - `"RejectedAndAccepted"`: Both rejected and accepted documents will be sent
|
|
307
|
+
* for manual review.
|
|
308
|
+
* - `"RejectedOnly"`: Only rejected documents will be sent for manual review.
|
|
309
|
+
* - `"AcceptedOnly"`: Only accepted documents will be sent for manual review.
|
|
310
|
+
*/
|
|
311
|
+
export declare type BlinkIdVerifyRequestManualReviewStrategy = "Never" | "RejectedAndAccepted" | "RejectedOnly" | "AcceptedOnly";
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Specifies the strictness level for a particular match check sent to the BlinkID Verify Cloud API.
|
|
315
|
+
*
|
|
316
|
+
* Higher levels apply stricter thresholds. Use `"Disabled"` to skip a check entirely.
|
|
317
|
+
*/
|
|
318
|
+
export declare type BlinkIdVerifyRequestMatchLevel = "Disabled" | "Level1" | "Level2" | "Level3" | "Level4" | "Level5" | "Level6" | "Level7" | "Level8" | "Level9" | "Level10";
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Caller-supplied options for the BlinkID Verify Cloud API request.
|
|
322
|
+
*
|
|
323
|
+
* These options are merged with settings derived from the scanning session to
|
|
324
|
+
* produce the final {@link BlinkIdVerifyPayload}. Only the subset of options
|
|
325
|
+
* that are relevant to the caller are exposed here.
|
|
326
|
+
*/
|
|
327
|
+
export declare type BlinkIdVerifyRequestOptions = {
|
|
328
|
+
/** Controls which parts of the result are anonymized in the API response. */
|
|
329
|
+
anonymizationMode?: BlinkIdVerifyRequestAnonymizationMode;
|
|
330
|
+
/** Match level threshold for detecting photocopy fraud. */
|
|
331
|
+
photocopyMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
332
|
+
/** Match level threshold for detecting photo forgery. */
|
|
333
|
+
photoForgeryMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
334
|
+
/** Whether to include the face image in the API response. */
|
|
335
|
+
returnFaceImage?: boolean;
|
|
336
|
+
/** Whether to include the full document image in the API response. */
|
|
337
|
+
returnFullDocumentImage?: boolean;
|
|
338
|
+
/** Whether to include the signature image in the API response. */
|
|
339
|
+
returnSignatureImage?: boolean;
|
|
340
|
+
/** The image format used for returned images. */
|
|
341
|
+
returnImageFormat?: ReturnImageFormat;
|
|
342
|
+
/** Match level threshold for the generative AI–based fraud detection check. */
|
|
343
|
+
generativeAiMatchLevel?: BlinkIdVerifyRequestMatchLevel;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Defines the context under which document verification is performed as part of
|
|
348
|
+
* the `UseCase` settings. It describes the setup and conditions in which
|
|
349
|
+
* verification occurs.
|
|
350
|
+
*
|
|
351
|
+
* - `"Remote"`: Default policy. Document verification is performed in a remote
|
|
352
|
+
* setting where a user is scanning the document in their own space,
|
|
353
|
+
* unsupervised.
|
|
354
|
+
* - `"InPerson"`: Document verification is performed in an in-person environment
|
|
355
|
+
* in which a trained employee is scanning the document. <br/> Document
|
|
356
|
+
* liveness checks are not performed when `InPerson` policy is set.
|
|
357
|
+
*/
|
|
358
|
+
export declare type BlinkIdVerifyRequestVerificationContext = "Remote" | "InPerson";
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Represents the final result of scanning both sides of the document. It
|
|
362
|
+
* potentially contains the captured frames for the front, back, and barcode.
|
|
363
|
+
*/
|
|
364
|
+
export declare type BlinkIdVerifyScanningResult = EmbindObject_2<{
|
|
365
|
+
/** The captured frame of the front side of the document, if available. */
|
|
366
|
+
frontFrame: CapturedFrame | undefined;
|
|
367
|
+
/** The captured frame of the back side of the document, if available. */
|
|
368
|
+
backFrame: CapturedFrame | undefined;
|
|
369
|
+
/** The captured frame of the barcode, if available. */
|
|
370
|
+
barcodeFrame: CapturedFrame | undefined;
|
|
371
|
+
}>;
|
|
372
|
+
|
|
373
|
+
/** Represents a scanning session for BlinkID Verify. */
|
|
374
|
+
export declare type BlinkIdVerifyScanningSession = EmbindObject_2<{
|
|
375
|
+
/**
|
|
376
|
+
* Processes the given image data.
|
|
377
|
+
*
|
|
378
|
+
* @param img The image data to process.
|
|
379
|
+
* @returns The result of the processing.
|
|
380
|
+
*/
|
|
381
|
+
process(img: ImageData): BlinkIdVerifyProcessResult;
|
|
382
|
+
/**
|
|
383
|
+
* Retrieves the current scanning result.
|
|
384
|
+
*
|
|
385
|
+
* @returns The scanning result containing captured frames.
|
|
386
|
+
*/
|
|
387
|
+
getResult(): BlinkIdVerifyScanningResult;
|
|
388
|
+
/** Returns the session settings. */
|
|
389
|
+
getSettings(): BlinkIdVerifySessionSettings;
|
|
390
|
+
/** Returns the session ID. This info is required for BlinkID Verify Cloud API */
|
|
391
|
+
getSessionId(): string;
|
|
392
|
+
/**
|
|
393
|
+
* Allows the barcode step to be performed during scanning. If during the
|
|
394
|
+
* scanning process the barcode is unreadable BlinkIdVerifyProcessResult will
|
|
395
|
+
* return a Scanning status for barcode scanning only.
|
|
396
|
+
*/
|
|
397
|
+
allowBarcodeStep(): void;
|
|
398
|
+
/**
|
|
399
|
+
* Resets the scanning session.
|
|
400
|
+
*
|
|
401
|
+
* @returns An error message if reset fails, otherwise undefined.
|
|
402
|
+
*/
|
|
403
|
+
reset(): void;
|
|
404
|
+
}>;
|
|
405
|
+
|
|
406
|
+
/** Settings configuring the whole session */
|
|
407
|
+
export declare type BlinkIdVerifySessionSettings = Partial<{
|
|
408
|
+
/** Defines the source of the input image. */
|
|
409
|
+
inputImageSource: InputImageSource;
|
|
410
|
+
/**
|
|
411
|
+
* Specific settings for the scanning process. If no settings are provided,
|
|
412
|
+
* defaults will be used.
|
|
413
|
+
*/
|
|
414
|
+
scanningSettings: ScanningSettings;
|
|
415
|
+
}>;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* The BlinkIdVerify Wasm module.
|
|
419
|
+
*
|
|
420
|
+
* @ignore
|
|
421
|
+
*/
|
|
422
|
+
export declare interface BlinkIdVerifyWasmModule extends WasmModule<BlinkIdVerifySessionSettings | undefined, BlinkIdVerifyScanningSession> {
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* The BlinkID Verify worker.
|
|
427
|
+
*/
|
|
428
|
+
export declare class BlinkIdVerifyWorker {
|
|
429
|
+
#private;
|
|
430
|
+
/**
|
|
431
|
+
* The progress status callback.
|
|
432
|
+
*/
|
|
433
|
+
progressStatusCallback?: ProgressStatusCallback;
|
|
434
|
+
constructor();
|
|
435
|
+
reportPinglet({ data, schemaName, schemaVersion, sessionNumber }: Ping): void;
|
|
436
|
+
sendPinglets(): void;
|
|
437
|
+
/**
|
|
438
|
+
* This method initializes everything.
|
|
439
|
+
*/
|
|
440
|
+
initBlinkIdVerify(settings: BlinkIdVerifyWorkerInitSettings, progressCallback?: ProgressStatusCallback): Promise<void>;
|
|
441
|
+
/**
|
|
442
|
+
* This method creates a BlinkIdVerify scanning session.
|
|
443
|
+
*
|
|
444
|
+
* @param sessionSettings - The options for the session.
|
|
445
|
+
* @returns The session.
|
|
446
|
+
*/
|
|
447
|
+
createScanningSession(sessionSettings?: BlinkIdVerifySessionSettings): WorkerScanningSession & ProxyMarked;
|
|
448
|
+
/**
|
|
449
|
+
* This method is called when the worker is terminated.
|
|
450
|
+
*/
|
|
451
|
+
[finalizer](): void;
|
|
452
|
+
/**
|
|
453
|
+
* Terminates the workers and the Wasm runtime.
|
|
454
|
+
*/
|
|
455
|
+
terminate(): Promise<void>;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Initialization settings for the BlinkIdVerify worker.
|
|
460
|
+
*
|
|
461
|
+
* These settings control how the BlinkIdVerify worker is initialized and configured,
|
|
462
|
+
* including resource locations, memory allocation, and build variants.
|
|
463
|
+
*/
|
|
464
|
+
export declare type BlinkIdVerifyWorkerInitSettings = {
|
|
465
|
+
/**
|
|
466
|
+
* The license key required to unlock and use the BlinkIdVerify SDK.
|
|
467
|
+
* This must be a valid license key obtained from Microblink.
|
|
468
|
+
*/
|
|
469
|
+
licenseKey: string;
|
|
470
|
+
/**
|
|
471
|
+
* The URL of the Microblink proxy server. This proxy handles requests to Microblink's Baltazar and Ping servers.
|
|
472
|
+
*
|
|
473
|
+
* **Requirements:**
|
|
474
|
+
* - Must be a valid HTTPS URL
|
|
475
|
+
* - The proxy server must implement the expected Microblink API endpoints
|
|
476
|
+
* - This feature is only available if explicitly permitted by your license
|
|
477
|
+
*
|
|
478
|
+
* **Endpoints:**
|
|
479
|
+
* - Ping: `{proxyUrl}/ping`
|
|
480
|
+
* - Baltazar: `{proxyUrl}/api/v2/status/check`
|
|
481
|
+
*
|
|
482
|
+
* @example "https://your-proxy.example.com"
|
|
483
|
+
*/
|
|
484
|
+
microblinkProxyUrl?: string;
|
|
485
|
+
/**
|
|
486
|
+
* The parent directory where the `/resources` directory is hosted.
|
|
487
|
+
* Defaults to `window.location.href`, at the root of the current page.
|
|
488
|
+
*/
|
|
489
|
+
resourcesLocation?: string;
|
|
490
|
+
/**
|
|
491
|
+
* A unique identifier for the user/session.
|
|
492
|
+
* Used for analytics and tracking purposes.
|
|
493
|
+
*/
|
|
494
|
+
userId: string;
|
|
495
|
+
/**
|
|
496
|
+
* The WebAssembly module variant to use.
|
|
497
|
+
* Different variants may offer different performance/size tradeoffs.
|
|
498
|
+
*/
|
|
499
|
+
wasmVariant?: WasmSimdVariant;
|
|
500
|
+
/**
|
|
501
|
+
* The initial memory allocation for the Wasm module, in megabytes.
|
|
502
|
+
* Larger values may improve performance but increase memory usage.
|
|
503
|
+
*/
|
|
504
|
+
initialMemory?: number;
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* The BlinkIdVerify worker proxy.
|
|
509
|
+
*/
|
|
510
|
+
export declare type BlinkIdVerifyWorkerProxy = Omit<BlinkIdVerifyWorker, typeof finalizer>;
|
|
511
|
+
|
|
512
|
+
declare type BrandsItem = {
|
|
513
|
+
brand: string;
|
|
514
|
+
version: string;
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
declare type Browser = {
|
|
518
|
+
brand: string;
|
|
519
|
+
version: string;
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
export declare type BrowserStorageSupport = {
|
|
523
|
+
cookieEnabled: boolean;
|
|
524
|
+
localStorageEnabled: boolean;
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
declare type BrowserStorageSupport_2 = {
|
|
528
|
+
cookieEnabled: boolean;
|
|
529
|
+
localStorageEnabled: boolean;
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
declare type CameraFacing = "Front" | "Back" | "Unknown";
|
|
533
|
+
|
|
534
|
+
declare type CameraFacing_2 = "Front" | "Back" | "Unknown";
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Defines the conditions under which the document is captured as part of the
|
|
538
|
+
* `UseCase` settings.
|
|
539
|
+
*
|
|
540
|
+
* - `"no-control"`: _Deprecated_: Is the same as `"basic"`, it will be removed in
|
|
541
|
+
* the future.
|
|
542
|
+
* - `"basic"`: Allows for processing of fully cropped documents. The integrator
|
|
543
|
+
* has no control over the capture process on the user's side and is limited
|
|
544
|
+
* by the lack of a robust SDK. It is not possible for a cropped document to
|
|
545
|
+
* get a `Pass` or `Accept` in the overall result. Liveness checks will not be
|
|
546
|
+
* performed if the document is fully cropped.
|
|
547
|
+
* - `"hybrid"`: Allows for processing of fully cropped documents. The integrator
|
|
548
|
+
* has no control over the capture process on the user's side and is limited
|
|
549
|
+
* by the lack of a robust SDK. It is possible for a cropped document to get a
|
|
550
|
+
* `Pass` or `Accept` in the overall result. Liveness checks will not be
|
|
551
|
+
* performed if the document is fully cropped.
|
|
552
|
+
*/
|
|
553
|
+
export declare type CaptureConditions = "no-control" | "basic" | "hybrid";
|
|
554
|
+
|
|
555
|
+
/** Represents a captured frame */
|
|
556
|
+
export declare interface CapturedFrame {
|
|
557
|
+
readonly jpegBytes: Uint8Array;
|
|
558
|
+
orientation: "portrait" | "landscape-left" | "upside-portrait" | "landscape-right";
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Options for a C call.
|
|
563
|
+
*
|
|
564
|
+
* @ignore
|
|
565
|
+
*/
|
|
566
|
+
export declare interface CCallOpts {
|
|
567
|
+
async?: boolean | undefined;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export declare function createDerivedDeviceInfo(userAgent: string, userAgentData?: UADataValues): DerivedDeviceInfo;
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Creates a Comlink-proxied Web Worker (generic) with automatic ImageData buffer transfer.
|
|
574
|
+
*
|
|
575
|
+
* This function wraps the worker proxy to automatically transfer ImageData buffers when calling
|
|
576
|
+
* `session.process()`, eliminating ~8MB copy per frame during scanning.
|
|
577
|
+
*
|
|
578
|
+
* The wrapper intercepts `createScanningSession` and wraps the returned session to auto-transfer
|
|
579
|
+
* ImageData buffers when `process()` is called. This pattern is common across all Microblink SDKs.
|
|
580
|
+
*
|
|
581
|
+
* @param resourcesLocation - Where the "resources" directory is placed.
|
|
582
|
+
* @param workerScriptName - The worker script filename.
|
|
583
|
+
* @returns A promise that resolves with a Comlink-proxied instance of the Web Worker.
|
|
584
|
+
*/
|
|
585
|
+
export declare function createProxyWorker<T extends BaseSdkWorkerProxy>(resourcesLocation: string, workerScriptName: string): Promise<Remote<T>>;
|
|
586
|
+
|
|
587
|
+
export declare type DerivedDeviceInfo = {
|
|
588
|
+
model: string;
|
|
589
|
+
formFactors: FormFactor[];
|
|
590
|
+
platform: string;
|
|
591
|
+
browser: {
|
|
592
|
+
brand: string;
|
|
593
|
+
version: string;
|
|
594
|
+
};
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
declare type DerivedDeviceInfo_2 = {
|
|
598
|
+
model: string;
|
|
599
|
+
formFactors: FormFactorsItem[];
|
|
600
|
+
platform: string;
|
|
601
|
+
browser: Browser;
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
/** DetectionStatus defines all possible states of detection */
|
|
605
|
+
export declare type DetectionStatus = "failed" | "sucess" | "camera-too-far" | "camera-too-close" | "camera-angle-too-steep" | "document-too-close-to-camera-edge" | "document-partially-visible";
|
|
606
|
+
|
|
607
|
+
export declare type DeviceInfo = {
|
|
608
|
+
userAgentData?: UADataValues;
|
|
609
|
+
userAgent: string;
|
|
610
|
+
threads: number;
|
|
611
|
+
memory?: number;
|
|
612
|
+
gpu?: GpuInfo;
|
|
613
|
+
screen: DeviceScreenInfo;
|
|
614
|
+
browserStorageSupport: BrowserStorageSupport;
|
|
615
|
+
derivedDeviceInfo: DerivedDeviceInfo;
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
declare type DeviceOrientation = "Portrait" | "LandscapeRight" | "LandscapeLeft" | "PortraitUpside";
|
|
619
|
+
|
|
620
|
+
export declare type DeviceScreenInfo = {
|
|
621
|
+
screenWidth: number;
|
|
622
|
+
screenHeight: number;
|
|
623
|
+
devicePixelRatio: number;
|
|
624
|
+
physicalScreenWidth: number;
|
|
625
|
+
physicalScreenHeight: number;
|
|
626
|
+
maxTouchPoints: number;
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
export declare type DocumentOrientation = "not-available" | "horizontal" | "vertical";
|
|
630
|
+
|
|
631
|
+
export declare type DocumentRotation = "not-available" | "zero" | "clockwise-90" | "counter-clockwise-90" | "upside-down";
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Progress reported during a resource download.
|
|
635
|
+
*/
|
|
636
|
+
export declare type DownloadProgress = {
|
|
637
|
+
loaded: number;
|
|
638
|
+
contentLength: number;
|
|
639
|
+
progress: number;
|
|
640
|
+
finished: boolean;
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Specifies an abstract object placed on the WebAssembly heap. Objects placed
|
|
645
|
+
* on the WebAssembly heap are not cleaned up by the garbage collector of the
|
|
646
|
+
* JavaScript engine. The memory used by the object must be cleaned up manually
|
|
647
|
+
* by calling the delete() method.
|
|
648
|
+
*
|
|
649
|
+
* @ignore
|
|
650
|
+
* @see https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#memory-management for more details.
|
|
651
|
+
*/
|
|
652
|
+
export declare type EmbindObject<T extends {}> = T & {
|
|
653
|
+
delete: () => void;
|
|
654
|
+
isDeleted: () => boolean;
|
|
655
|
+
deleteLater: () => void;
|
|
656
|
+
isAliasOf: (other: any) => boolean;
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Specifies an abstract object placed on the WebAssembly heap. Objects placed
|
|
661
|
+
* on the WebAssembly heap are not cleaned up by the garbage collector of the
|
|
662
|
+
* JavaScript engine. The memory used by the object must be cleaned up manually
|
|
663
|
+
* by calling the delete() method.
|
|
664
|
+
*
|
|
665
|
+
* @see https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#memory-management for more details.
|
|
666
|
+
*/
|
|
667
|
+
declare type EmbindObject_2<T extends NonNullable<unknown>> = T & {
|
|
668
|
+
/** Free emscripten memory */
|
|
669
|
+
delete: () => void;
|
|
670
|
+
/** Check if emscripten memory is freed */
|
|
671
|
+
isDeleted: () => boolean;
|
|
672
|
+
/** @ignore */
|
|
673
|
+
deleteLater: () => void;
|
|
674
|
+
/** @ignore */
|
|
675
|
+
isAliasOf: (other: unknown) => boolean;
|
|
676
|
+
/**
|
|
677
|
+
* @ignore
|
|
678
|
+
* @see https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#cloning-and-reference-counting
|
|
679
|
+
*/
|
|
680
|
+
clone: () => T;
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* The main EmscriptenModule interface.
|
|
685
|
+
*
|
|
686
|
+
* @ignore
|
|
687
|
+
*/
|
|
688
|
+
export declare interface EmscriptenModule {
|
|
689
|
+
print(str: string): void;
|
|
690
|
+
printErr(str: string): void;
|
|
691
|
+
arguments: string[];
|
|
692
|
+
environment: EnvironmentType;
|
|
693
|
+
preInit: Array<{
|
|
694
|
+
(): void;
|
|
695
|
+
}>;
|
|
696
|
+
preRun: Array<{
|
|
697
|
+
(): void;
|
|
698
|
+
}>;
|
|
699
|
+
postRun: Array<{
|
|
700
|
+
(): void;
|
|
701
|
+
}>;
|
|
702
|
+
onAbort: {
|
|
703
|
+
(what: any): void;
|
|
704
|
+
};
|
|
705
|
+
onRuntimeInitialized: {
|
|
706
|
+
(): void;
|
|
707
|
+
};
|
|
708
|
+
preinitializedWebGLContext: WebGLRenderingContext;
|
|
709
|
+
noInitialRun: boolean;
|
|
710
|
+
noExitRuntime: boolean;
|
|
711
|
+
logReadFiles: boolean;
|
|
712
|
+
filePackagePrefixURL: string;
|
|
713
|
+
wasmBinary: ArrayBuffer;
|
|
714
|
+
mainScriptUrlOrBlob?: string;
|
|
715
|
+
setStatus: (text: string) => void;
|
|
716
|
+
/**
|
|
717
|
+
* Allows you to provide your own WebAssembly.Memory to use as the memory. The
|
|
718
|
+
* properties used to initialize the memory should match the compiler options.
|
|
719
|
+
* For example, if you set INITIAL_MEMORY to 8MB without memory growth, then
|
|
720
|
+
* the wasmMemory you provide (if any) should have both the 'initial' and
|
|
721
|
+
* 'maximum' set to 128 (due to WASM page sizes being 64KB).
|
|
722
|
+
*/
|
|
723
|
+
wasmMemory: WebAssembly.Memory;
|
|
724
|
+
destroy(object: object): void;
|
|
725
|
+
getPreloadedPackage(remotePackageName: string, remotePackageSize: number): ArrayBuffer;
|
|
726
|
+
instantiateWasm(imports: WebAssembly.Imports, successCallback: (module: WebAssembly.Instance) => void): WebAssembly.Exports | undefined;
|
|
727
|
+
locateFile(url: string, scriptDirectory: string): string;
|
|
728
|
+
onCustomMessage(event: MessageEvent): void;
|
|
729
|
+
HEAP: Int32Array;
|
|
730
|
+
IHEAP: Int32Array;
|
|
731
|
+
FHEAP: Float64Array;
|
|
732
|
+
HEAP8: Int8Array;
|
|
733
|
+
HEAP16: Int16Array;
|
|
734
|
+
HEAP32: Int32Array;
|
|
735
|
+
HEAPU8: Uint8Array;
|
|
736
|
+
HEAPU16: Uint16Array;
|
|
737
|
+
HEAPU32: Uint32Array;
|
|
738
|
+
HEAPF32: Float32Array;
|
|
739
|
+
HEAPF64: Float64Array;
|
|
740
|
+
HEAP64: BigInt64Array;
|
|
741
|
+
HEAPU64: BigUint64Array;
|
|
742
|
+
TOTAL_STACK: number;
|
|
743
|
+
TOTAL_MEMORY: number;
|
|
744
|
+
FAST_MEMORY: number;
|
|
745
|
+
addOnPreRun(cb: () => any): void;
|
|
746
|
+
addOnInit(cb: () => any): void;
|
|
747
|
+
addOnPreMain(cb: () => any): void;
|
|
748
|
+
addOnExit(cb: () => any): void;
|
|
749
|
+
addOnPostRun(cb: () => any): void;
|
|
750
|
+
preloadedImages: any;
|
|
751
|
+
preloadedAudios: any;
|
|
752
|
+
_malloc(size: number): number;
|
|
753
|
+
_free(ptr: number): void;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* A factory function is generated when setting the `MODULARIZE` build option to
|
|
758
|
+
* `1` in your Emscripten build. It return a Promise that resolves to an
|
|
759
|
+
* initialized, ready-to-call `EmscriptenModule` instance.
|
|
760
|
+
*
|
|
761
|
+
* By default, the factory function will be named `Module`. It's recommended to
|
|
762
|
+
* use the `EXPORT_ES6` option, in which the factory function will be the
|
|
763
|
+
* default export. If used without `EXPORT_ES6`, the factory function will be a
|
|
764
|
+
* global variable. You can rename the variable using the `EXPORT_NAME` build
|
|
765
|
+
* option. It's left to you to declare any global variables as needed in your
|
|
766
|
+
* application's types.
|
|
767
|
+
*
|
|
768
|
+
* @ignore
|
|
769
|
+
* @param moduleOverrides Default properties for the initialized module.
|
|
770
|
+
*/
|
|
771
|
+
export declare type EmscriptenModuleFactory<T extends EmscriptenModule = EmscriptenModule> = (moduleOverrides?: Partial<T>) => Promise<T>;
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* The environment type.
|
|
775
|
+
*
|
|
776
|
+
* @ignore
|
|
777
|
+
*/
|
|
778
|
+
export declare type EnvironmentType = "WEB" | "NODE" | "SHELL" | "WORKER";
|
|
779
|
+
|
|
780
|
+
declare type ErrorMessageType = "MoveCloser" | "MoveFarther" | "KeepVisible" | "FlipSide" | "AlignDocument" | "MoveFromEdge" | "IncreaseLighting" | "DecreaseLighting" | "EliminateBlur" | "EliminateGlare";
|
|
781
|
+
|
|
782
|
+
declare type ErrorType = "NonFatal" | "Crash";
|
|
783
|
+
|
|
784
|
+
declare type EventType = "CameraPermissionCheck" | "CameraPermissionRequest" | "CameraPermissionUserResponse";
|
|
785
|
+
|
|
786
|
+
declare type EventType_2 = "CameraStarted" | "CameraClosed" | "OnboardingInfoDisplayed" | "CloseButtonClicked" | "HelpTooltipDisplayed" | "HelpOpened" | "HelpClosed" | "AlertDisplayed" | "ErrorMessage" | "StepTimeout" | "AppMovedToBackground";
|
|
787
|
+
|
|
788
|
+
declare type Focus = "Auto" | "Fixed";
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Common form-factor values as per spec.
|
|
792
|
+
*
|
|
793
|
+
* @see https://wicg.github.io/ua-client-hints/#sec-ch-ua-form-factors
|
|
794
|
+
*/
|
|
795
|
+
export declare type FormFactor = "Desktop" | "Automotive" | "Mobile" | "Tablet" | "XR" | "EInk" | "Watch";
|
|
796
|
+
|
|
797
|
+
declare type FormFactorsItem = "Desktop" | "Automotive" | "Mobile" | "Tablet" | "XR" | "EInk" | "Watch";
|
|
798
|
+
|
|
799
|
+
declare type FullVersionListItem = {
|
|
800
|
+
brand: string;
|
|
801
|
+
version: string;
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Builds the JSON payload for the BlinkID Verify Cloud API from a completed scanning result.
|
|
806
|
+
*
|
|
807
|
+
* Maps internal SDK enum values (kebab-case) to their API-facing PascalCase equivalents
|
|
808
|
+
* and encodes captured document frames as base64 JPEG strings.
|
|
809
|
+
*
|
|
810
|
+
* @param result - The scanning result produced by the BlinkIdVerify SDK.
|
|
811
|
+
* @param sessionId - The unique identifier of the capture session to include in the payload.
|
|
812
|
+
* @param settings - The scanning settings used during the session, used to derive verification options.
|
|
813
|
+
* @param options - Optional caller-supplied overrides for anonymization, image return, and match levels.
|
|
814
|
+
* @returns The fully constructed payload ready to be submitted to the BlinkID Verify Cloud API.
|
|
815
|
+
*/
|
|
816
|
+
export declare function GeneratePayloadForBlinkidVerifyRequest(result: BlinkIdVerifyScanningResult, sessionId: string, settings: ScanningSettings, options?: BlinkIdVerifyRequestOptions): BlinkIdVerifyPayload;
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Gets a cross-origin worker URL as a data URL or blob URL. If the URL is same-origin, it will return the original URL.
|
|
820
|
+
*
|
|
821
|
+
* @param originalWorkerUrl - The original worker URL.
|
|
822
|
+
* @param _options - The options for the worker.
|
|
823
|
+
* @returns A promise that resolves with the cross-origin worker URL.
|
|
824
|
+
*/
|
|
825
|
+
export declare const getCrossOriginWorkerURL: (originalWorkerUrl: string, _options?: Options) => Promise<string>;
|
|
826
|
+
|
|
827
|
+
export declare function getDeviceInfo(): Promise<DeviceInfo>;
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Get granular device info from `navigator.userAgentData.getHighEntropyValues`
|
|
831
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/getHighEntropyValues
|
|
832
|
+
*/
|
|
833
|
+
export declare function getUserAgentData(): Promise<UADataValues | undefined>;
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Copyright (c) 2026 Microblink Ltd. All rights reserved.
|
|
837
|
+
*/
|
|
838
|
+
/**
|
|
839
|
+
* Gets the user id from local storage, or generates a new one.
|
|
840
|
+
*
|
|
841
|
+
* This is a workaround for the lack of a user id in the worker scope.
|
|
842
|
+
*
|
|
843
|
+
* @param storageKey - The localStorage key to use for persisting the user id.
|
|
844
|
+
* @returns a unique user id
|
|
845
|
+
*/
|
|
846
|
+
export declare function getUserId(storageKey: string): string;
|
|
847
|
+
|
|
848
|
+
declare type Gpu = {
|
|
849
|
+
renderer: string;
|
|
850
|
+
shadingLanguageVersion: string;
|
|
851
|
+
vendor: string;
|
|
852
|
+
version: string;
|
|
853
|
+
};
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParameter
|
|
857
|
+
*/
|
|
858
|
+
export declare type GpuInfo = {
|
|
859
|
+
renderer: string;
|
|
860
|
+
shadingLanguageVersion: string;
|
|
861
|
+
vendor: string;
|
|
862
|
+
version: string;
|
|
863
|
+
};
|
|
864
|
+
|
|
865
|
+
declare type HelpCloseType = "ContentSkipped" | "ContentFullyViewed";
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Specifies the strictness of the model when marking the quality of the image.
|
|
869
|
+
* Includes a range of values that allow for more or less conservative
|
|
870
|
+
* approach.
|
|
871
|
+
*
|
|
872
|
+
* - `"ignore"`: Ensures that BlinkID Verify returns a `Pass` or `Fail` verdict
|
|
873
|
+
* even if image quality is not good enough.
|
|
874
|
+
* - `"conservative"`: If image quality is not good enough, BlinkID Verify will
|
|
875
|
+
* refuse to process the image and a `NotPerformed` verdict will be returned.
|
|
876
|
+
* When a `NotPerformed` verdict is returned, BlinkID Verify will prompt the
|
|
877
|
+
* user to repeat the capture process. This is indicated by the `Retry` value
|
|
878
|
+
* under `RecommendedOutcome` in the response.
|
|
879
|
+
* - `"high-assurance"`: A `Fail` verdict can be returned even if image quality is
|
|
880
|
+
* not good enough, but occasionally a `Pass` verdict will not be returned if
|
|
881
|
+
* image quality is not satisfactory.
|
|
882
|
+
* - `"high-conversion"`: A `Pass` verdict can be returned even if image quality
|
|
883
|
+
* is not good enough, but occasionally a `Fail` verdict will not be returned
|
|
884
|
+
* if image quality is not satisfactory.
|
|
885
|
+
* - `"very-high-conversion"`: A `Pass` verdict can be returned even if image
|
|
886
|
+
* quality is significantly unsatisfactory, but a `Fail` verdict will not be
|
|
887
|
+
* returned if image quality is really poor.
|
|
888
|
+
*/
|
|
889
|
+
export declare type ImageQualityInterpretation = "ignore" | "conservative" | "high-assurance" | "high-conversion" | "very-high-conversion";
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* Options for image quality settings. Stricter settings will provide better
|
|
893
|
+
* quality images as the scan will not complete until they are met. If not
|
|
894
|
+
* defined internal defaults will be used.
|
|
895
|
+
*/
|
|
896
|
+
export declare type ImageQualitySettings = Partial<{
|
|
897
|
+
/**
|
|
898
|
+
* Threshold for detecting blur on the document. Higher levels provide
|
|
899
|
+
* stricter requirements.
|
|
900
|
+
*/
|
|
901
|
+
blurMatchLevel: MatchLevel;
|
|
902
|
+
/**
|
|
903
|
+
* Threshold for detecting glare on the document. Higher levels provide
|
|
904
|
+
* stricter requirements.
|
|
905
|
+
*/
|
|
906
|
+
glareMatchLevel: MatchLevel;
|
|
907
|
+
/**
|
|
908
|
+
* Threshold for expected lighting level of a document on screen. Higher
|
|
909
|
+
* levels provide stricter requirements.
|
|
910
|
+
*/
|
|
911
|
+
lightingMatchLevel: MatchLevel;
|
|
912
|
+
/**
|
|
913
|
+
* Threshold for detecting the sharpness of the document. Higher levels
|
|
914
|
+
* provide stricter requirements.
|
|
915
|
+
*/
|
|
916
|
+
sharpnessMatchLevel: MatchLevel;
|
|
917
|
+
/**
|
|
918
|
+
* Threshold for detecting hand occlusion on the document. Higher levels
|
|
919
|
+
* provide stricter requirements.
|
|
920
|
+
*/
|
|
921
|
+
handOcclusionMatchLevel: MatchLevel;
|
|
922
|
+
/**
|
|
923
|
+
* Threshold for detecting the DPI of the document. Higher levels provide
|
|
924
|
+
* stricter requirements.
|
|
925
|
+
*/
|
|
926
|
+
dpiMatchLevel: MatchLevel;
|
|
927
|
+
/**
|
|
928
|
+
* Threshold for detecting the tilt of the document in screen. Higher levels
|
|
929
|
+
* provide stricter requirements.
|
|
930
|
+
*/
|
|
931
|
+
tiltMatchLevel: MatchLevel;
|
|
932
|
+
/**
|
|
933
|
+
* Specifies the strictness of the model when marking the quality of the
|
|
934
|
+
* image. Includes a range of values that allow for more or less conservative
|
|
935
|
+
* approach.
|
|
936
|
+
*/
|
|
937
|
+
interpretation: ImageQualityInterpretation;
|
|
938
|
+
}>;
|
|
939
|
+
|
|
940
|
+
export declare type InputImageAnalysisResult = {
|
|
941
|
+
blurDetected: boolean;
|
|
942
|
+
glareDetected: boolean;
|
|
943
|
+
occlusionDetected: boolean;
|
|
944
|
+
tiltDetected: boolean;
|
|
945
|
+
hasBarcodeReadingIssue: boolean;
|
|
946
|
+
/** Information extracted from the currently processed frame */
|
|
947
|
+
extractionInputImageAnalysisResult: {
|
|
948
|
+
/** The location of the document quadrilateral in the frame. */
|
|
949
|
+
documentLocation: Quadrilateral;
|
|
950
|
+
/**
|
|
951
|
+
* The status of the processing. Beeing either `success` or a potential
|
|
952
|
+
* `issue in the scannign process`
|
|
953
|
+
*/
|
|
954
|
+
processingStatus: ProcessingStatus;
|
|
955
|
+
/**
|
|
956
|
+
* The status of the detection. This status is used for guidance of the
|
|
957
|
+
* document placement. Giving instructions to the user on how to position
|
|
958
|
+
* the document in the frame.
|
|
959
|
+
*/
|
|
960
|
+
detectionStatus: DetectionStatus;
|
|
961
|
+
/** Categorieses the document as a passport */
|
|
962
|
+
isPassport: boolean;
|
|
963
|
+
/** Categorieses the document as a passport with barcode */
|
|
964
|
+
isPassportWithBarcode: boolean;
|
|
965
|
+
documentOrientation: DocumentOrientation;
|
|
966
|
+
documentRotation: DocumentRotation;
|
|
967
|
+
};
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* The source of the input image.
|
|
972
|
+
*
|
|
973
|
+
* - `photo`: A single image will be provided to the sdk for analysis per side of
|
|
974
|
+
* document. This feature is currently not supported.
|
|
975
|
+
* - `video`: A consecutive stream of images will be provided to the sdk.
|
|
976
|
+
*/
|
|
977
|
+
export declare type InputImageSource = "photo" | "video";
|
|
978
|
+
|
|
979
|
+
/** The license request. */
|
|
980
|
+
export declare type LicenseRequest = Readonly<{
|
|
981
|
+
/** The license id. */
|
|
982
|
+
licenseId: string;
|
|
983
|
+
/** The licensee. */
|
|
984
|
+
licensee: string;
|
|
985
|
+
/** The application ids. */
|
|
986
|
+
applicationIds: Array<string>;
|
|
987
|
+
/** The package name. */
|
|
988
|
+
packageName: string;
|
|
989
|
+
/** The platform. */
|
|
990
|
+
platform: string;
|
|
991
|
+
/** The sdk name. */
|
|
992
|
+
sdkName: string;
|
|
993
|
+
/** The sdk version. */
|
|
994
|
+
sdkVersion: string;
|
|
995
|
+
}>;
|
|
996
|
+
|
|
997
|
+
/** The license token state. */
|
|
998
|
+
export declare type LicenseTokenState = "invalid" | "requires-server-permission" | "valid";
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* Copyright (c) 2026 Microblink Ltd. All rights reserved.
|
|
1002
|
+
*/
|
|
1003
|
+
/** The license unlock result. */
|
|
1004
|
+
export declare type LicenseUnlockResult = Readonly<{
|
|
1005
|
+
/** Whether the license is a trial license. */
|
|
1006
|
+
isTrial: boolean;
|
|
1007
|
+
/** Whether the license has ping enabled. */
|
|
1008
|
+
hasPing: boolean;
|
|
1009
|
+
/** The license id. */
|
|
1010
|
+
licenseId: string;
|
|
1011
|
+
/** The licensee. */
|
|
1012
|
+
licensee: string;
|
|
1013
|
+
/** The application ids. */
|
|
1014
|
+
applicationIds: Array<string>;
|
|
1015
|
+
/** The package name. */
|
|
1016
|
+
packageName: string;
|
|
1017
|
+
/** The sdk name. */
|
|
1018
|
+
sdkName: string;
|
|
1019
|
+
/** The sdk version. */
|
|
1020
|
+
sdkVersion: string;
|
|
1021
|
+
/** The unlock result. */
|
|
1022
|
+
unlockResult: LicenseTokenState;
|
|
1023
|
+
/** The license error. */
|
|
1024
|
+
licenseError: string;
|
|
1025
|
+
/** Whether to show the demo overlay. */
|
|
1026
|
+
showDemoOverlay: boolean;
|
|
1027
|
+
/** Whether to show the production overlay. */
|
|
1028
|
+
showProductionOverlay: boolean;
|
|
1029
|
+
/** Whether to allow baltazar proxy. */
|
|
1030
|
+
allowBaltazarProxy: boolean;
|
|
1031
|
+
/** Whether to allow ping proxy. */
|
|
1032
|
+
allowPingProxy: boolean;
|
|
1033
|
+
}>;
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Creates and initializes a BlinkIdVerify core instance.
|
|
1037
|
+
*
|
|
1038
|
+
* @param settings - Configuration for BlinkIdVerify initialization including license key and resources location
|
|
1039
|
+
* @param progressCallback - Optional callback for tracking resource download progress (WASM, data files)
|
|
1040
|
+
* @returns Promise that resolves with initialized BlinkIdVerify core instance
|
|
1041
|
+
* @throws Error if initialization fails
|
|
1042
|
+
*/
|
|
1043
|
+
export declare function loadBlinkIdVerifyCore(settings: BlinkIdVerifyInitSettings, progressCallback?: ProgressStatusCallback): Promise<BlinkIdVerifyCore>;
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* The load Wasm params.
|
|
1047
|
+
*/
|
|
1048
|
+
export declare type LoadWasmParams = {
|
|
1049
|
+
resourceUrl: string;
|
|
1050
|
+
wasmVariant: WasmSimdVariant;
|
|
1051
|
+
initialMemory?: number;
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1054
|
+
declare type LogLevel = "Info" | "Warning";
|
|
1055
|
+
|
|
1056
|
+
/**
|
|
1057
|
+
* Defines the volume of documents that will be sent for manual review as part
|
|
1058
|
+
* of the `UseCase` settings. The outcome depends on the selected policy and
|
|
1059
|
+
* varies according to the overall verification `CertaintyLevel`.
|
|
1060
|
+
*
|
|
1061
|
+
* If manual review is not used, this setting is ignored.
|
|
1062
|
+
*
|
|
1063
|
+
* - `"low"`: Only borderline cases are sent for manual review. <br/> Documents
|
|
1064
|
+
* where certainty is `Low` alongside a `SuspiciousDataCheck` fail will be
|
|
1065
|
+
* sent for manual review.
|
|
1066
|
+
* - `"default"`: The manual review process is default.
|
|
1067
|
+
* - `"high"`: The manual review process is high.
|
|
1068
|
+
*/
|
|
1069
|
+
export declare type ManualReviewSensitivity = "low" | "default" | "high";
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* Defines the manual review strategy used during document verification as part
|
|
1073
|
+
* of the `UseCase` settings.
|
|
1074
|
+
*
|
|
1075
|
+
* - `"never"`: No documents will be sent for manual review.
|
|
1076
|
+
* - `"rejected-and-accepted"`: Both rejected and accepted documents will be sent
|
|
1077
|
+
* for manual review.
|
|
1078
|
+
* - `"rejected-only"`: Only rejected documents will be sent for manual review.
|
|
1079
|
+
* - `"accepted-only"`: Only accepted documents will be sent for manual review.
|
|
1080
|
+
*/
|
|
1081
|
+
export declare type ManualReviewStrategy = "never" | "rejected-and-accepted" | "rejected-only" | "accepted-only";
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* Represents the level of strictness for a matching check during the document
|
|
1085
|
+
* verification process. This enum defines the different levels that can be
|
|
1086
|
+
* configured for various checks, such as photocopy or barcode anomaly
|
|
1087
|
+
* detection. Higher levels indicate stricter requirements, leading to fewer
|
|
1088
|
+
* false positives but potentially more false negatives.
|
|
1089
|
+
*
|
|
1090
|
+
* - `"disabled"`: The matching check is disabled, that check will not be
|
|
1091
|
+
* performed.
|
|
1092
|
+
* - `"level-1" to "level-10"`: Increasing levels of strictness, from least to
|
|
1093
|
+
* most strict.
|
|
1094
|
+
*/
|
|
1095
|
+
export declare type MatchLevel = "disabled" | "level-1" | "level-2" | "level-3" | "level-4" | "level-5" | "level-6" | "level-7" | "level-8" | "level-9" | "level-10";
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* @see https://wicg.github.io/ua-client-hints/#dictdef-navigatoruabrandversion
|
|
1099
|
+
*/
|
|
1100
|
+
declare interface NavigatorUABrandVersion {
|
|
1101
|
+
readonly brand: string;
|
|
1102
|
+
readonly version: string;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* Copyright (c) 2026 Microblink Ltd. All rights reserved.
|
|
1107
|
+
*/
|
|
1108
|
+
/**
|
|
1109
|
+
* Options for the getCrossOriginWorkerURL function.
|
|
1110
|
+
*
|
|
1111
|
+
* @param skipSameOrigin - If true, the function will return the original URL if it is same-origin.
|
|
1112
|
+
* @param useBlob - If true, the function will return a blob URL.
|
|
1113
|
+
*/
|
|
1114
|
+
declare type Options = {
|
|
1115
|
+
/** If true, the function will return the original URL if it is same-origin. */
|
|
1116
|
+
skipSameOrigin?: boolean;
|
|
1117
|
+
/** If true, the function will return a blob URL if not same-origin. */
|
|
1118
|
+
useBlob?: boolean;
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
export declare type Ping = PingBrowserDeviceInfo | PingError | PingCameraHardwareInfo | PingLog | PingCameraInputInfo | PingCameraPermission | PingSdkInitStart | PingScanningConditions | PingUxEvent | PingWrapperProductInfo;
|
|
1122
|
+
|
|
1123
|
+
/** Generated base structure for a ping event. */
|
|
1124
|
+
export declare interface PingBase<TSchemaName extends SchemaName, TSchemaVersion extends Semver = "1.0.0", TData extends object = {}, TSessionNumber extends number = number> {
|
|
1125
|
+
schemaName: TSchemaName;
|
|
1126
|
+
schemaVersion: TSchemaVersion;
|
|
1127
|
+
data: TData;
|
|
1128
|
+
sessionNumber?: TSessionNumber;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Ping type for ping.browser.device.info
|
|
1133
|
+
*/
|
|
1134
|
+
export declare type PingBrowserDeviceInfo = PingBase<"ping.browser.device.info", "1.0.0", PingBrowserDeviceInfoData>;
|
|
1135
|
+
|
|
1136
|
+
export declare type PingBrowserDeviceInfoData = {
|
|
1137
|
+
userAgentData?: UserAgentData;
|
|
1138
|
+
userAgent: string;
|
|
1139
|
+
threads: number;
|
|
1140
|
+
memory?: number;
|
|
1141
|
+
gpu?: Gpu;
|
|
1142
|
+
screen: Screen_2;
|
|
1143
|
+
browserStorageSupport: BrowserStorageSupport_2;
|
|
1144
|
+
derivedDeviceInfo: DerivedDeviceInfo_2;
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* Ping type for ping.hardware.camera.info
|
|
1149
|
+
*/
|
|
1150
|
+
export declare type PingCameraHardwareInfo = PingBase<"ping.hardware.camera.info", "1.0.3", PingCameraHardwareInfoData>;
|
|
1151
|
+
|
|
1152
|
+
export declare type PingCameraHardwareInfoData = {
|
|
1153
|
+
availableCameras: AvailableCamerasItem[];
|
|
1154
|
+
};
|
|
1155
|
+
|
|
1156
|
+
/**
|
|
1157
|
+
* Ping type for ping.sdk.camera.input.info
|
|
1158
|
+
*/
|
|
1159
|
+
export declare type PingCameraInputInfo = PingBase<"ping.sdk.camera.input.info", "1.0.2", PingCameraInputInfoData>;
|
|
1160
|
+
|
|
1161
|
+
export declare type PingCameraInputInfoData = {
|
|
1162
|
+
deviceId: string;
|
|
1163
|
+
cameraFacing: CameraFacing_2;
|
|
1164
|
+
cameraFrameWidth: number;
|
|
1165
|
+
cameraFrameHeight: number;
|
|
1166
|
+
roiWidth: number;
|
|
1167
|
+
roiHeight: number;
|
|
1168
|
+
viewPortAspectRatio: number;
|
|
1169
|
+
};
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* Ping type for ping.sdk.camera.permission
|
|
1173
|
+
*/
|
|
1174
|
+
export declare type PingCameraPermission = PingBase<"ping.sdk.camera.permission", "1.0.0", PingCameraPermissionData>;
|
|
1175
|
+
|
|
1176
|
+
export declare type PingCameraPermissionData = {
|
|
1177
|
+
eventType: EventType;
|
|
1178
|
+
cameraPermissionGranted?: boolean;
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* Ping type for ping.error
|
|
1183
|
+
*/
|
|
1184
|
+
export declare type PingError = PingBase<"ping.error", "1.0.0", PingErrorData>;
|
|
1185
|
+
|
|
1186
|
+
export declare type PingErrorData = {
|
|
1187
|
+
errorType: ErrorType;
|
|
1188
|
+
errorMessage: string;
|
|
1189
|
+
stackTrace?: string;
|
|
1190
|
+
};
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* Ping type for ping.log
|
|
1194
|
+
*/
|
|
1195
|
+
export declare type PingLog = PingBase<"ping.log", "1.0.0", PingLogData>;
|
|
1196
|
+
|
|
1197
|
+
export declare type PingLogData = {
|
|
1198
|
+
logLevel: LogLevel;
|
|
1199
|
+
logMessage: string;
|
|
1200
|
+
};
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* Ping type for ping.sdk.scan.conditions
|
|
1204
|
+
*/
|
|
1205
|
+
export declare type PingScanningConditions = PingBase<"ping.sdk.scan.conditions", "1.0.0", PingScanningConditionsData>;
|
|
1206
|
+
|
|
1207
|
+
export declare type PingScanningConditionsData = {
|
|
1208
|
+
updateType: UpdateType;
|
|
1209
|
+
deviceOrientation?: DeviceOrientation;
|
|
1210
|
+
flashlightOn?: boolean;
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Ping type for ping.sdk.init.start
|
|
1215
|
+
*/
|
|
1216
|
+
export declare type PingSdkInitStart = PingBase<"ping.sdk.init.start", "1.1.0", PingSdkInitStartData>;
|
|
1217
|
+
|
|
1218
|
+
export declare type PingSdkInitStartData = {
|
|
1219
|
+
product: Product;
|
|
1220
|
+
platform: Platform;
|
|
1221
|
+
platformDetails?: PlatformDetails;
|
|
1222
|
+
packageName: string;
|
|
1223
|
+
userId: string;
|
|
1224
|
+
};
|
|
1225
|
+
|
|
1226
|
+
/**
|
|
1227
|
+
* Ping type for ping.sdk.ux.event
|
|
1228
|
+
*/
|
|
1229
|
+
export declare type PingUxEvent = PingBase<"ping.sdk.ux.event", "1.0.0", PingUxEventData>;
|
|
1230
|
+
|
|
1231
|
+
export declare type PingUxEventData = {
|
|
1232
|
+
eventType: EventType_2;
|
|
1233
|
+
errorMessageType?: ErrorMessageType;
|
|
1234
|
+
alertType?: AlertType;
|
|
1235
|
+
helpCloseType?: HelpCloseType;
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* Ping type for ping.sdk.wrapper.product
|
|
1240
|
+
*/
|
|
1241
|
+
export declare type PingWrapperProductInfo = PingBase<"ping.sdk.wrapper.product", "1.0.0", PingWrapperProductInfoData>;
|
|
1242
|
+
|
|
1243
|
+
export declare type PingWrapperProductInfoData = {
|
|
1244
|
+
wrapperProduct: WrapperProduct;
|
|
1245
|
+
correlationId?: string;
|
|
1246
|
+
};
|
|
1247
|
+
|
|
1248
|
+
declare type Platform = "iOS" | "Android" | "Emscripten" | "MacOS" | "Linux" | "Windows";
|
|
1249
|
+
|
|
1250
|
+
declare type PlatformDetails = "basic" | "advanced" | "advanced-threads" | "full-basic" | "full-advanced" | "full-advanced-threads" | "lightweight-basic" | "lightweight-advanced" | "lightweight-advanced-threads";
|
|
1251
|
+
|
|
1252
|
+
/** Represents a point in 2D space. */
|
|
1253
|
+
export declare type Point = {
|
|
1254
|
+
x: number;
|
|
1255
|
+
y: number;
|
|
1256
|
+
};
|
|
1257
|
+
|
|
1258
|
+
/**
|
|
1259
|
+
* Copyright (c) 2026 Microblink Ltd. All rights reserved.
|
|
1260
|
+
*/
|
|
1261
|
+
/**
|
|
1262
|
+
* Represents the status of the document processing. This enum defines various
|
|
1263
|
+
* statuses that can occur during the processing of a document, indicating the
|
|
1264
|
+
* success or failure of different stages of the recognition and extraction
|
|
1265
|
+
* process.
|
|
1266
|
+
*/
|
|
1267
|
+
export declare type ProcessingStatus = "success" | "detection-failed" | "image-preprocessing-failed" | "stability-test-failed" | "scanning-wrong-side" | "field-identification-failed" | "mandatory-field-missing" | "invalid-characters-found" | "image-return-failed" | "barcode-recognition-failed" | "mrz-parsing-failed" | "document-filtered" | "unsupported-document" | "awaiting-other-side" | "not-scanned" | "barcode-detection-failed";
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* The process result with buffer.
|
|
1271
|
+
*/
|
|
1272
|
+
export declare type ProcessResultWithBuffer = BlinkIdVerifyProcessResult & {
|
|
1273
|
+
arrayBuffer: ArrayBuffer;
|
|
1274
|
+
};
|
|
1275
|
+
|
|
1276
|
+
declare type Product = "BlinkCard" | "BlinkID" | "BlinkInput" | "Capture" | "DocumentVerification" | "Pdf417Mobi" | "PhotoPay";
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* The progress status callback.
|
|
1280
|
+
*/
|
|
1281
|
+
export declare type ProgressStatusCallback = (progress: DownloadProgress) => void;
|
|
1282
|
+
|
|
1283
|
+
/** Represents a Quadrilateral */
|
|
1284
|
+
export declare type Quadrilateral = {
|
|
1285
|
+
upperLeft: Point;
|
|
1286
|
+
upperRight: Point;
|
|
1287
|
+
lowerLeft: Point;
|
|
1288
|
+
lowerRight: Point;
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1291
|
+
/** Represents a remote scanning session. */
|
|
1292
|
+
export declare type RemoteScanningSession = Remote<WorkerScanningSession>;
|
|
1293
|
+
|
|
1294
|
+
/**
|
|
1295
|
+
* Removes the internals of an Embind object.
|
|
1296
|
+
*
|
|
1297
|
+
* @ignore
|
|
1298
|
+
* @param T - The type of the object to remove the internals from.
|
|
1299
|
+
* @returns The object with the internals removed.
|
|
1300
|
+
*/
|
|
1301
|
+
export declare type RemoveEmbindInternals<T> = Omit<T, "delete" | "isDeleted" | "deleteLater" | "isAliasOf">;
|
|
1302
|
+
|
|
1303
|
+
export declare type ResourceFileType = (typeof resourceFileTypes)[number];
|
|
1304
|
+
|
|
1305
|
+
/**
|
|
1306
|
+
* Copyright (c) 2026 Microblink Ltd. All rights reserved.
|
|
1307
|
+
*/
|
|
1308
|
+
export declare const resourceFileTypes: readonly ["wasm", "data"];
|
|
1309
|
+
|
|
1310
|
+
export declare type ResultCompleteness = {
|
|
1311
|
+
/**
|
|
1312
|
+
* The current phase of the scanning state machine, driving the progression
|
|
1313
|
+
* toward session completion.
|
|
1314
|
+
*/
|
|
1315
|
+
scanningStatus: ScanningStatus;
|
|
1316
|
+
};
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* The image format used when requesting document images in the API response.
|
|
1320
|
+
*/
|
|
1321
|
+
export declare type ReturnImageFormat = "Jpg" | "Png" | "Qoi";
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* Copyright (c) 2026 Microblink Ltd. All rights reserved.
|
|
1325
|
+
*/
|
|
1326
|
+
/** Represents the configurable settings for scanning a document. */
|
|
1327
|
+
export declare type ScanningSettings = Partial<{
|
|
1328
|
+
/** Whether to treat expired documents as fraudulent. */
|
|
1329
|
+
treatExpirationAsFraud: boolean;
|
|
1330
|
+
/**
|
|
1331
|
+
* Threshold for detecting screen-displayed documents. Higher levels provide
|
|
1332
|
+
* stricter detection.
|
|
1333
|
+
*/
|
|
1334
|
+
screenAnalysisMatchLevel: MatchLevel;
|
|
1335
|
+
/**
|
|
1336
|
+
* Threshold for verifying static security features. Higher levels require
|
|
1337
|
+
* more security features to be present.
|
|
1338
|
+
*/
|
|
1339
|
+
staticSecurityFeaturesMatchLevel: MatchLevel;
|
|
1340
|
+
/**
|
|
1341
|
+
* Threshold for detecting anomalies in document barcodes. Higher levels
|
|
1342
|
+
* provide stricter detection.
|
|
1343
|
+
*/
|
|
1344
|
+
barcodeAnomalyMatchLevel: MatchLevel;
|
|
1345
|
+
/**
|
|
1346
|
+
* Threshold for matching data between different parts of the document. Higher
|
|
1347
|
+
* levels require closer matches.
|
|
1348
|
+
*/
|
|
1349
|
+
dataMatchMatchLevel: MatchLevel;
|
|
1350
|
+
/** Defines the settings for image quality. */
|
|
1351
|
+
imageQualitySettings: ImageQualitySettings;
|
|
1352
|
+
/** Defines the use case for the scanning process. */
|
|
1353
|
+
useCase: UseCase;
|
|
1354
|
+
}>;
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* Defines the progression of the scanning state machine. This status determines
|
|
1358
|
+
* the instructions and visual cues displayed to the user throughout the
|
|
1359
|
+
* multi-step scanning sequence.
|
|
1360
|
+
*/
|
|
1361
|
+
export declare type ScanningStatus = "scanning-first" | "scanned-first" | "scanning-second" | "scanned-second" | "scanning-barcode" | "document-scanned" | "cancelled";
|
|
1362
|
+
|
|
1363
|
+
export declare type SchemaName = Ping["schemaName"];
|
|
1364
|
+
|
|
1365
|
+
declare type Screen_2 = {
|
|
1366
|
+
screenWidth: number;
|
|
1367
|
+
screenHeight: number;
|
|
1368
|
+
devicePixelRatio: number;
|
|
1369
|
+
physicalScreenWidth: number;
|
|
1370
|
+
physicalScreenHeight: number;
|
|
1371
|
+
maxTouchPoints: number;
|
|
1372
|
+
};
|
|
1373
|
+
|
|
1374
|
+
declare type Semver = `${number}.${number}.${number}` | `${number}.${number}.${number}-${string}`;
|
|
1375
|
+
|
|
1376
|
+
/** The server permission error. */
|
|
1377
|
+
export declare type ServerPermissionErrorReason = "network-error" | "remote-lock" | "permission-expired" | "payload-corrupted" | "payload-signature-verification-failed" | "incorrect-token-state" | "detected-skewed-clock";
|
|
1378
|
+
|
|
1379
|
+
/** The server permission submit error. */
|
|
1380
|
+
export declare type ServerPermissionSubmitError = Readonly<{
|
|
1381
|
+
/** The error. */
|
|
1382
|
+
error: ServerPermissionErrorReason;
|
|
1383
|
+
/** The lease. */
|
|
1384
|
+
lease: number;
|
|
1385
|
+
/** The network error description. */
|
|
1386
|
+
networkErrorDescription?: string;
|
|
1387
|
+
}>;
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* @see https://wicg.github.io/ua-client-hints/#dictdef-uadatavalues
|
|
1391
|
+
*/
|
|
1392
|
+
export declare interface UADataValues {
|
|
1393
|
+
readonly brands?: NavigatorUABrandVersion[];
|
|
1394
|
+
readonly mobile?: boolean;
|
|
1395
|
+
readonly platform?: string;
|
|
1396
|
+
readonly architecture?: string;
|
|
1397
|
+
readonly bitness?: string;
|
|
1398
|
+
readonly formFactors?: FormFactor[];
|
|
1399
|
+
readonly model?: string;
|
|
1400
|
+
readonly platformVersion?: string;
|
|
1401
|
+
/** @deprecated in favour of fullVersionList */
|
|
1402
|
+
readonly uaFullVersion?: string;
|
|
1403
|
+
readonly fullVersionList?: NavigatorUABrandVersion[];
|
|
1404
|
+
readonly wow64?: boolean;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
declare type UpdateType = "DeviceOrientation" | "FlashlightState";
|
|
1408
|
+
|
|
1409
|
+
export declare type UseCase = Partial<{
|
|
1410
|
+
/**
|
|
1411
|
+
* The strictness policy that defines the rules and requirements for document
|
|
1412
|
+
* verification
|
|
1413
|
+
*/
|
|
1414
|
+
verificationPolicy: VerificationPolicy;
|
|
1415
|
+
/** The strategy for handling manual reviews of documents, if required. */
|
|
1416
|
+
manualReviewStrategy: ManualReviewStrategy;
|
|
1417
|
+
/** The level of sensitivity applied to the manual review process */
|
|
1418
|
+
manualReviewSensitivity: ManualReviewSensitivity;
|
|
1419
|
+
/** The context of the verification, done either in-person or remote. */
|
|
1420
|
+
verificationContext: VerificationContext;
|
|
1421
|
+
/** The conditions under which the document is being captured. */
|
|
1422
|
+
captureConditions: CaptureConditions;
|
|
1423
|
+
}>;
|
|
1424
|
+
|
|
1425
|
+
declare type UserAgentData = {
|
|
1426
|
+
brands?: BrandsItem[];
|
|
1427
|
+
mobile?: boolean;
|
|
1428
|
+
platform?: string;
|
|
1429
|
+
architecture?: string;
|
|
1430
|
+
bitness?: string;
|
|
1431
|
+
formFactors?: FormFactorsItem[];
|
|
1432
|
+
model?: string;
|
|
1433
|
+
platformVersion?: string;
|
|
1434
|
+
fullVersionList?: FullVersionListItem[];
|
|
1435
|
+
wow64?: boolean;
|
|
1436
|
+
};
|
|
1437
|
+
|
|
1438
|
+
/**
|
|
1439
|
+
* Defines the context under which document verification is performed as part of
|
|
1440
|
+
* the `UseCase` settings. It describes the setup and conditions in which
|
|
1441
|
+
* verification occurs.
|
|
1442
|
+
*
|
|
1443
|
+
* - `"remote"`: Default policy. Document verification is performed in a remote
|
|
1444
|
+
* setting where a user is scanning the document in their own space,
|
|
1445
|
+
* unsupervised.
|
|
1446
|
+
* - `"in-person"`: Document verification is performed in an in-person environment
|
|
1447
|
+
* in which a trained employee is scanning the document. <br/> Document
|
|
1448
|
+
* liveness checks are not performed when `InPerson` policy is set.
|
|
1449
|
+
*/
|
|
1450
|
+
export declare type VerificationContext = "remote" | "in-person";
|
|
1451
|
+
|
|
1452
|
+
/**
|
|
1453
|
+
* Defines the strictness of checks performed by BlinkID Verify as part of the
|
|
1454
|
+
* `UseCase` settings.
|
|
1455
|
+
*
|
|
1456
|
+
* - `"permissive"`: Optimized for letting real users through. In cases of doubt
|
|
1457
|
+
* or lower confidence, BlinkID Verify will avoid failing the document.
|
|
1458
|
+
* - `"standard"`: Default policy. It is more strict compared to `Permissive` but
|
|
1459
|
+
* still optimized for accepting real users.
|
|
1460
|
+
* - `"strict"`: Users with damaged documents, bad lighting conditions or lower
|
|
1461
|
+
* image quality will probably be rejected. In cases of doubt or lower
|
|
1462
|
+
* confidence, the document will more often be rejected.
|
|
1463
|
+
* - `"very-strict"`: Reasonable only for the most sensitive use cases.
|
|
1464
|
+
* Significant user friction is added to stop as much fraud as possible.
|
|
1465
|
+
*/
|
|
1466
|
+
export declare type VerificationPolicy = "permissive" | "standard" | "strict" | "very-strict";
|
|
1467
|
+
|
|
1468
|
+
export declare interface WasmBindings<TSessionSettings, TScanningSession> {
|
|
1469
|
+
createScanningSession: (sessionSettings: TSessionSettings, userId: string) => TScanningSession;
|
|
1470
|
+
initializeWithLicenseKey: (licenceKey: string, userId: string, allowHelloMessage: boolean) => LicenseUnlockResult;
|
|
1471
|
+
submitServerPermission: (serverPermission: string) => ServerPermissionSubmitError | undefined;
|
|
1472
|
+
getActiveLicenseTokenInfo: () => LicenseUnlockResult;
|
|
1473
|
+
setPingProxyUrl: (url: string) => void;
|
|
1474
|
+
initializeSdk: (userId: string) => void;
|
|
1475
|
+
terminateSdk: () => void;
|
|
1476
|
+
sendPinglets: () => void;
|
|
1477
|
+
arePingRequestsInProgress: () => boolean;
|
|
1478
|
+
queuePinglet: (data: string, schemaName: string, schemaVersion: string, sessionNumber: number) => void;
|
|
1479
|
+
isPingEnabled: () => boolean;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
export declare type WasmBuildType = (typeof wasmBuildTypes)[number];
|
|
1483
|
+
|
|
1484
|
+
export declare const wasmBuildTypes: readonly ["full", "lightweight"];
|
|
1485
|
+
|
|
1486
|
+
export declare interface WasmModule<TSessionSettings, TScanningSession> extends WasmBindings<TSessionSettings, TScanningSession>, EmscriptenModule {
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
export declare type WasmSimdVariant = (typeof wasmSimdVariants)[number];
|
|
1490
|
+
|
|
1491
|
+
export declare const wasmSimdVariants: readonly ["advanced", "advanced-threads"];
|
|
1492
|
+
|
|
1493
|
+
export declare type WasmVariant = (typeof wasmVariants)[number];
|
|
1494
|
+
|
|
1495
|
+
export declare const wasmVariants: readonly ["basic", "advanced", "advanced-threads"];
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* Copyright (c) 2026 Microblink Ltd. All rights reserved.
|
|
1499
|
+
*/
|
|
1500
|
+
/**
|
|
1501
|
+
* The WebAssembly module, for compatibility.
|
|
1502
|
+
*
|
|
1503
|
+
* @ignore
|
|
1504
|
+
*/
|
|
1505
|
+
export declare interface WebAssemblyModule {
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
/**
|
|
1509
|
+
* The worker scanning session.
|
|
1510
|
+
*/
|
|
1511
|
+
export declare type WorkerScanningSession = Omit<BlinkIdVerifyScanningSession, "process" | "deleteLater" | "isAliasOf" | "clone"> & {
|
|
1512
|
+
process: (image: ImageData) => ProcessResultWithBuffer;
|
|
1513
|
+
/**
|
|
1514
|
+
* Gets the settings.
|
|
1515
|
+
*
|
|
1516
|
+
* @returns The settings.
|
|
1517
|
+
*/
|
|
1518
|
+
getSettings: () => BlinkIdVerifySessionSettings;
|
|
1519
|
+
/**
|
|
1520
|
+
* Shows the demo overlay.
|
|
1521
|
+
*
|
|
1522
|
+
* @returns Whether the demo overlay is shown.
|
|
1523
|
+
*/
|
|
1524
|
+
showDemoOverlay: () => boolean;
|
|
1525
|
+
/**
|
|
1526
|
+
* Shows the production overlay.
|
|
1527
|
+
*
|
|
1528
|
+
* @returns Whether the production overlay is shown.
|
|
1529
|
+
*/
|
|
1530
|
+
showProductionOverlay: () => boolean;
|
|
1531
|
+
ping: BlinkIdVerifyWorker["reportPinglet"];
|
|
1532
|
+
sendPinglets: BlinkIdVerifyWorker["sendPinglets"];
|
|
1533
|
+
};
|
|
1534
|
+
|
|
1535
|
+
declare type WrapperProduct = "CrossplatformFlutter" | "CrossplatformReactNative" | "IdentityVerification";
|
|
1536
|
+
|
|
1537
|
+
export { }
|