@microblink/blinkid-ux-manager 7.3.2 → 7.4.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 (36) hide show
  1. package/dist/blinkid-ux-manager.js +205 -28
  2. package/dist/blinkid-ux-manager.js.map +1 -1
  3. package/package.json +3 -3
  4. package/types/core/BlinkIdProcessingError.d.ts +5 -0
  5. package/types/core/BlinkIdProcessingError.d.ts.map +1 -1
  6. package/types/core/BlinkIdUxManager.d.ts +80 -25
  7. package/types/core/BlinkIdUxManager.d.ts.map +1 -1
  8. package/types/core/DocumentClassFilter.d.ts +5 -3
  9. package/types/core/DocumentClassFilter.d.ts.map +1 -1
  10. package/types/core/blinkid-ui-state.d.ts +38 -0
  11. package/types/core/blinkid-ui-state.d.ts.map +1 -1
  12. package/types/core/utils.d.ts +18 -0
  13. package/types/core/utils.d.ts.map +1 -1
  14. package/types/index.d.ts +14 -0
  15. package/types/index.d.ts.map +1 -1
  16. package/types/index.rollup.d.ts +242 -34
  17. package/types/ui/BlinkIdFeedbackUi.d.ts +8 -0
  18. package/types/ui/BlinkIdFeedbackUi.d.ts.map +1 -1
  19. package/types/ui/BlinkIdUiStoreContext.d.ts +44 -0
  20. package/types/ui/BlinkIdUiStoreContext.d.ts.map +1 -1
  21. package/types/ui/LocalizationContext.d.ts +14 -0
  22. package/types/ui/LocalizationContext.d.ts.map +1 -1
  23. package/types/ui/UiFeedbackOverlay.d.ts +6 -0
  24. package/types/ui/UiFeedbackOverlay.d.ts.map +1 -1
  25. package/types/ui/createBlinkIdFeedbackUi.d.ts +15 -0
  26. package/types/ui/createBlinkIdFeedbackUi.d.ts.map +1 -1
  27. package/types/ui/dialogs/ErrorModal.d.ts +9 -0
  28. package/types/ui/dialogs/ErrorModal.d.ts.map +1 -1
  29. package/types/ui/dialogs/HelpModal.d.ts +11 -0
  30. package/types/ui/dialogs/HelpModal.d.ts.map +1 -1
  31. package/types/ui/dialogs/OnboardingGuideModal.d.ts +5 -0
  32. package/types/ui/dialogs/OnboardingGuideModal.d.ts.map +1 -1
  33. package/types/ui/feedbackMessages.d.ts +3 -0
  34. package/types/ui/feedbackMessages.d.ts.map +1 -1
  35. package/types/ui/locales/en.d.ts +3 -0
  36. package/types/ui/locales/en.d.ts.map +1 -1
@@ -19,65 +19,99 @@ import { StringKeyOf } from 'type-fest';
19
19
  */
20
20
  export declare type BlinkIdProcessingError = "timeout" | "unknown";
21
21
 
22
+ /**
23
+ * The type of reticle to display.
24
+ */
22
25
  export declare type BlinkIdReticleType = "searching" | "processing" | "error" | "done" | "flip" | "move_top" | "move_left" | "move_right";
23
26
 
27
+ /**
28
+ * The UI state of BlinkID.
29
+ */
24
30
  export declare type BlinkIdUiState = BlinkIdUiStateMap[keyof BlinkIdUiStateMap];
25
31
 
32
+ /**
33
+ * The key of the UI state.
34
+ */
26
35
  export declare type BlinkIdUiStateKey = "FLIP_CARD" | "DOCUMENT_CAPTURED" | "SENSING_FRONT" | "SENSING_BACK" | "SENSING_DATA_PAGE" | "SENSING_TOP_PAGE" | "SENSING_LEFT_PAGE" | "SENSING_RIGHT_PAGE" | "MOVE_TOP" | "MOVE_LEFT" | "MOVE_RIGHT" | "DOCUMENT_FRAMING_CAMERA_TOO_FAR" | "DOCUMENT_FRAMING_CAMERA_TOO_CLOSE" | "DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP" | "DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE" | "BLUR_DETECTED" | "GLARE_DETECTED" | "TOO_DARK" | "TOO_BRIGHT" | "OCCLUDED" | "FACE_PHOTO_OCCLUDED" | "UNSUPPORTED_DOCUMENT" | "SCAN_BARCODE" | "WRONG_TOP_PAGE" | "WRONG_LEFT_PAGE" | "WRONG_RIGHT_PAGE" | "WRONG_SIDE";
27
36
 
28
37
  /**
29
38
  * Extended UI state for BlinkID.
39
+ *
40
+ * @template K - The key of the UI state.
30
41
  */
31
42
  export declare type BlinkIdUiStateMap = {
32
43
  [K in BlinkIdUiStateKey]: UiState & {
44
+ /** The key of the UI state. */
33
45
  key: K;
46
+ /** The type of the reticle. */
34
47
  reticleType: BlinkIdReticleType;
35
48
  };
36
49
  };
37
50
 
51
+ /**
52
+ * The UI state map of BlinkID.
53
+ */
38
54
  export declare const blinkIdUiStateMap: BlinkIdUiStateMap;
39
55
 
40
56
  /**
41
- * Manages the UX of the BlinkID SDK.
57
+ * The BlinkIdUxManager class. This is the main class that manages the UX of
58
+ * the BlinkID SDK. It is responsible for handling the UI state, the timeout,
59
+ * the help tooltip, and the document class filter.
42
60
  */
43
61
  export declare class BlinkIdUxManager {
44
62
  #private;
63
+ /** The camera manager. */
45
64
  cameraManager: CameraManager;
65
+ /** The scanning session. */
46
66
  scanningSession: RemoteScanningSession;
67
+ /** Whether the demo overlay should be shown. */
47
68
  showDemoOverlay: boolean;
69
+ /** Whether the production overlay should be shown. */
48
70
  showProductionOverlay: boolean;
71
+ /** The current UI state. */
49
72
  uiState: BlinkIdUiState;
73
+ /** The raw UI state key. */
50
74
  rawUiStateKey: BlinkIdUiStateKey;
75
+ /** The feedback stabilizer. */
51
76
  feedbackStabilizer: FeedbackStabilizer<typeof blinkIdUiStateMap>;
77
+ /** The session settings. */
52
78
  sessionSettings: BlinkIdSessionSettings;
79
+ /**
80
+ * The constructor for the BlinkIdUxManager class.
81
+ *
82
+ * @param cameraManager - The camera manager.
83
+ * @param scanningSession - The scanning session.
84
+ */
53
85
  constructor(cameraManager: CameraManager, scanningSession: RemoteScanningSession);
54
86
  /**
55
- * Indicates whether the UI should display the demo overlay. Controlled by the license property.
87
+ * Indicates whether the UI should display the demo overlay. Controlled by the
88
+ * license property.
56
89
  */
57
90
  getShowDemoOverlay(): boolean;
58
91
  /**
59
- * Indicates whether the UI should display the production overlay. Controlled by the license property.
92
+ * Indicates whether the UI should display the production overlay. Controlled by
93
+ * the license property.
60
94
  */
61
95
  getShowProductionOverlay(): boolean;
62
96
  /**
63
97
  * Returns the timeout duration in ms. Null if timeout won't be triggered ever.
64
- * @returns The timeout duration in ms.
65
98
  */
66
99
  getTimeoutDuration(): number | null;
67
100
  /**
68
101
  * Returns the time in ms before the help tooltip is shown. Null if tooltip won't be auto shown.
69
- * @returns The time in ms before the help tooltip is shown.
70
102
  */
71
103
  getHelpTooltipShowDelay(): number | null;
72
104
  /**
73
105
  * Returns the time in ms before the help tooltip is hidden. Null if tooltip won't be auto hidden.
74
- * @returns The time in ms before the help tooltip is hidden.
75
106
  */
76
107
  getHelpTooltipHideDelay(): number | null;
77
108
  /**
78
109
  * Adds a callback function to be executed when the UI state changes.
79
- * @param callback - Function to be called when UI state changes. Receives the new UI state as parameter.
110
+ *
111
+ * @param callback - Function to be called when UI state changes. Receives the
112
+ * new UI state as parameter.
80
113
  * @returns A cleanup function that removes the callback when called.
114
+ *
81
115
  * @example
82
116
  * const cleanup = manager.addOnUiStateChangedCallback((newState) => {
83
117
  * console.log('UI state changed to:', newState);
@@ -88,8 +122,10 @@ export declare class BlinkIdUxManager {
88
122
  addOnUiStateChangedCallback(callback: (uiState: BlinkIdUiState) => void): () => void;
89
123
  /**
90
124
  * Registers a callback function to be called when a scan result is available.
125
+ *
91
126
  * @param callback - A function that will be called with the scan result.
92
- * @returns A cleanup function that, when called, will remove the registered callback.
127
+ * @returns A cleanup function that, when called, will remove the registered
128
+ * callback.
93
129
  *
94
130
  * @example
95
131
  *
@@ -103,8 +139,11 @@ export declare class BlinkIdUxManager {
103
139
  addOnResultCallback(callback: (result: BlinkIdScanningResult) => void): () => void;
104
140
  /**
105
141
  * Registers a callback function to filter document classes.
106
- * @param callback - A function that will be called with the document class info.
107
- * @returns A cleanup function that, when called, will remove the registered callback.
142
+ *
143
+ * @param callback - A function that will be called with the document class
144
+ * info.
145
+ * @returns A cleanup function that, when called, will remove the registered
146
+ * callback.
108
147
  *
109
148
  * @example
110
149
  * const cleanup = manager.addDocumentClassFilter((docClassInfo) => {
@@ -117,8 +156,11 @@ export declare class BlinkIdUxManager {
117
156
  addDocumentClassFilter(callback: DocumentClassFilter): () => void;
118
157
  /**
119
158
  * Registers a callback function to be called when a frame is processed.
120
- * @param callback - A function that will be called with the frame analysis result.
121
- * @returns A cleanup function that, when called, will remove the registered callback.
159
+ *
160
+ * @param callback - A function that will be called with the frame analysis
161
+ * result.
162
+ * @returns A cleanup function that, when called, will remove the registered
163
+ * callback.
122
164
  *
123
165
  * @example
124
166
  * const cleanup = manager.addOnFrameProcessCallback((frameResult) => {
@@ -130,9 +172,12 @@ export declare class BlinkIdUxManager {
130
172
  */
131
173
  addOnFrameProcessCallback(callback: (frameResult: ProcessResultWithBuffer) => void): () => void;
132
174
  /**
133
- * Registers a callback function to be called when an error occurs during processing.
175
+ * Registers a callback function to be called when an error occurs during
176
+ * processing.
177
+ *
134
178
  * @param callback - A function that will be called with the error state.
135
- * @returns A cleanup function that, when called, will remove the registered callback.
179
+ * @returns A cleanup function that, when called, will remove the registered
180
+ * callback.
136
181
  *
137
182
  * @example
138
183
  * const cleanup = manager.addOnErrorCallback((error) => {
@@ -143,46 +188,81 @@ export declare class BlinkIdUxManager {
143
188
  * cleanup();
144
189
  */
145
190
  addOnErrorCallback(callback: (errorState: BlinkIdProcessingError) => void): () => void;
191
+ /**
192
+ * Registers a callback function to be called when a document is filtered.
193
+ *
194
+ * @param callback - A function that will be called with the document class
195
+ * info.
196
+ * @returns A cleanup function that, when called, will remove the registered
197
+ * callback.
198
+ *
199
+ * @example
200
+ * const cleanup = manager.addOnDocumentFilteredCallback((docClassInfo) => {
201
+ * console.log('Document filtered:', docClassInfo);
202
+ * });
203
+ *
204
+ * // Later, to remove the callback:
205
+ * cleanup();
206
+ */
146
207
  addOnDocumentFilteredCallback(callback: (documentClassInfo: DocumentClassInfo) => void): () => void;
147
208
  /**
148
- * Sets the duration after which the scanning session will timeout. The timeout can occur in various scenarios
149
- * and may be restarted by different scanning events.
209
+ * Sets the duration after which the scanning session will timeout. The
210
+ * timeout can occur in various scenarios and may be restarted by different
211
+ * scanning events.
150
212
  *
151
- * @param duration The timeout duration in milliseconds. If null, timeout won't be triggered ever.
152
- * @param setHelpTooltipShowDelay If true, also sets the help tooltip show delay to half of the provided duration. If timeout duration is null, help tooltip show delay will be set to null. Defaults to true.
213
+ * @param duration The timeout duration in milliseconds. If null, timeout won't
214
+ * be triggered ever.
215
+ * @param setHelpTooltipShowDelay If true, also sets the help tooltip show
216
+ * delay to half of the provided duration. If timeout duration is null, help
217
+ * tooltip show delay will be set to null. Defaults to true.
153
218
  * @throws {Error} Throws an error if duration is less than or equal to 0 when not null.
154
219
  */
155
220
  setTimeoutDuration(duration: number | null, setHelpTooltipShowDelay?: boolean): void;
156
221
  /**
157
222
  * Sets the duration in milliseconds before the help tooltip is shown.
158
223
  * A value of null means the help tooltip will not be auto shown.
159
- * @param duration The duration in milliseconds before the help tooltip is shown. If null, tooltip won't be auto shown.
160
- * @throws {Error} Throws an error if duration is less than or equal to 0 when not null.
224
+ *
225
+ * @param duration The duration in milliseconds before the help tooltip is
226
+ * shown. If null, tooltip won't be auto shown.
227
+ * @throws {Error} Throws an error if duration is less than or equal to 0 when
228
+ * not null.
161
229
  */
162
230
  setHelpTooltipShowDelay(duration: number | null): void;
163
231
  /**
164
232
  * Sets the duration in milliseconds before the help tooltip is hidden.
165
233
  * A value of null means the help tooltip will not be auto hidden.
166
- * @param duration The duration in milliseconds before the help tooltip is hidden. If null, tooltip won't be auto hidden.
167
- * @throws {Error} Throws an error if duration is less than or equal to 0 when not null.
234
+ *
235
+ * @param duration The duration in milliseconds before the help tooltip is
236
+ * hidden. If null, tooltip won't be auto hidden.
237
+ * @throws {Error} Throws an error if duration is less than or equal to 0 when
238
+ * not null.
168
239
  */
169
240
  setHelpTooltipHideDelay(duration: number | null): void;
170
241
  /**
171
- * Clears any active timeout.
242
+ * Clears the scanning session timeout.
172
243
  */
173
244
  clearScanTimeout: () => void;
174
245
  /**
175
- * Resets the manager and clears all callbacks.
246
+ * Resets the BlinkIdUxManager.
176
247
  *
177
- * Does not reset the camera manager or the BlinkID core instance.
248
+ * Does not reset the camera manager or the scanning session.
178
249
  */
179
250
  reset(): void;
180
251
  }
181
252
 
253
+ /**
254
+ * Creates the BlinkID feedback UI.
255
+ *
256
+ * @param blinkIdUxManager - The BlinkID Ux Manager.
257
+ * @param cameraManagerComponent - The Camera Manager Component.
258
+ * @param options - The options for the createBlinkIdFeedbackUi function.
259
+ *
260
+ * @returns The function to unmount the feedback UI.
261
+ */
182
262
  export declare function createBlinkIdFeedbackUi(blinkIdUxManager: BlinkIdUxManager, cameraManagerComponent: CameraManagerComponent, { localizationStrings, preserveSdkInstance, showOnboardingGuide, showHelpButton, }?: FeedbackUiOptions): () => void;
183
263
 
184
264
  /**
185
- * Copyright (c) 2025 Microblink Ltd. All rights reserved.
265
+ * The English localization strings.
186
266
  */
187
267
  declare const _default: {
188
268
  readonly scan_the_front_side: "Scan the front side of the document";
@@ -237,10 +317,12 @@ declare const _default: {
237
317
  /**
238
318
  * A type representing a filter function for document classification.
239
319
  *
240
- * This function is used to determine whether a document class is supported or not.
241
- * It takes a `DocumentClassInfo` object as input and returns a boolean value:
320
+ * This function is used to determine whether a document class is supported or
321
+ * not. It takes a `DocumentClassInfo` object as input and returns a boolean
322
+ * value:
242
323
  * - `true`: The document class is supported.
243
- * - `false`: The document class is not supported, and the document will be marked as "unsupported-document".
324
+ * - `false`: The document class is not supported, and the document will be
325
+ * marked as "unsupported-document".
244
326
  *
245
327
  * @param documentClassInfo - Information about the document class, such as country and type.
246
328
  *
@@ -248,33 +330,111 @@ declare const _default: {
248
330
  */
249
331
  export declare type DocumentClassFilter = (documentClassInfo: DocumentClassInfo) => boolean;
250
332
 
333
+ /**
334
+ * FeedbackStabilizer provides UI state management with temporal smoothing.
335
+ *
336
+ * It helps prevent UI "flickering" by:
337
+ * - Maintaining a time-windowed history of UI state changes
338
+ * - Applying weighted averaging to determine the most appropriate state
339
+ * - Supporting immediate state changes through single-emit events
340
+ * - Enforcing minimum display durations for states
341
+ *
342
+ * @typeParam SdkSpecificStateMap - Type extending UiStateMap for SDK-specific states
343
+ */
251
344
  export declare class FeedbackStabilizer<SdkSpecificStateMap extends UiStateMap> {
345
+ /** The initial key. */
252
346
  private initialKey;
347
+ /** The UI state map. */
253
348
  private uiStateMap;
349
+ /** Time window (in ms) for considering UI state events. */
254
350
  private timeWindow;
351
+ /** The decay rate. */
352
+ /** Rate at which event weights decay over time */
255
353
  private decayRate;
354
+ /** Queue of regular UI state events within the time window */
256
355
  private eventQueue;
257
- /** this is a special queue as min duration of the event can be longer than the `timeWindow` */
356
+ /** Special queue for single-emit events that bypass normal stabilization */
258
357
  private singleEventQueue;
358
+ /** Currently displayed state key */
259
359
  private currentKey;
360
+ /** Timestamp when current state started displaying */
260
361
  private currentStateStartTime;
362
+ /** Accumulated scores for each state in current calculation */
261
363
  private summedScores;
364
+ /** History of scores for each state */
262
365
  private scoreBoard;
366
+ /**
367
+ * Gets the currently active UI state configuration.
368
+ *
369
+ * @returns The currently active UI state configuration.
370
+ */
263
371
  get currentState(): SdkSpecificStateMap[`${Extract<keyof SdkSpecificStateMap, string | number>}`];
372
+ /**
373
+ * Gets a copy of the current event queue for debugging.
374
+ *
375
+ * @returns A copy of the current event queue.
376
+ */
264
377
  getEventQueue(): UiStateEvent[];
378
+ /**
379
+ * Gets the current summed scores for each state.
380
+ *
381
+ * @returns The current summed scores for each state.
382
+ */
265
383
  getScores(): Record<string, number>;
384
+ /**
385
+ * Gets the score history for each state.
386
+ *
387
+ * @returns The score history for each state.
388
+ */
266
389
  getScoreBoard(): Record<string, number[]>;
390
+ /**
391
+ * Updates the time window used for state stabilization
392
+ *
393
+ * @param timeWindow - New time window in milliseconds
394
+ */
267
395
  setTimeWindow(timeWindow: number): void;
396
+ /**
397
+ * Creates a new FeedbackStabilizer instance.
398
+ *
399
+ * @param uiStateMap - Map of all possible UI states and their configurations
400
+ * @param initialKey - Key of the initial UI state to display
401
+ * @param timeWindow - Optional custom time window (in ms) for state averaging
402
+ * @param decayRate - Optional custom decay rate for event weights
403
+ */
268
404
  constructor(uiStateMap: SdkSpecificStateMap, initialKey: StringKeyOf<SdkSpecificStateMap>, timeWindow?: number, decayRate?: number);
405
+ /**
406
+ * Resets the stabilizer to its initial state.
407
+ *
408
+ * @returns The initial state.
409
+ */
269
410
  reset(): void;
411
+ /**
412
+ * Checks if enough time has passed to show a new UI state
413
+ *
414
+ * @returns true if the current state's minimum duration has elapsed
415
+ */
270
416
  canShowNewUiState: () => boolean;
271
417
  /**
272
- * Returns a weighted UI state based on the history
418
+ * Processes a new UI state event and determines the state to display.
419
+ *
420
+ * This method:
421
+ * 1. Handles single-emit events that bypass normal stabilization
422
+ * 2. Maintains a time-windowed queue of regular events
423
+ * 3. Applies temporal averaging with decay to determine the winning state
424
+ *
425
+ * @param incomingUiStateKey - Key of the new UI state event
426
+ * @returns The UI state that should be displayed.
273
427
  */
274
428
  getNewUiState(incomingUiStateKey: StringKeyOf<SdkSpecificStateMap>): SdkSpecificStateMap[StringKeyOf<SdkSpecificStateMap>];
275
429
  }
276
430
 
431
+ /**
432
+ * The options for the createBlinkIdFeedbackUi function.
433
+ */
277
434
  export declare type FeedbackUiOptions = {
435
+ /**
436
+ * The localization strings.
437
+ */
278
438
  localizationStrings?: Partial<LocalizationStrings>;
279
439
  /**
280
440
  * If set to `true`, the BlinkID instance will not be terminated when the
@@ -297,43 +457,91 @@ export declare type FeedbackUiOptions = {
297
457
  showHelpButton?: boolean;
298
458
  };
299
459
 
460
+ /**
461
+ * The states that are captured when the first side is captured.
462
+ */
300
463
  export declare const firstSideCapturedStates: BlinkIdUiStateKey[];
301
464
 
465
+ /**
466
+ * Determines the appropriate UI state key based on the current frame processing
467
+ * result and scanning settings.
468
+ *
469
+ * This function acts as a state machine, translating the low-level analysis and
470
+ * completeness results into a high-level UI state that drives the user
471
+ * interface.
472
+ *
473
+ * @param frameProcessResult - The current (possibly partial) result of frame
474
+ * processing, including image analysis and completeness.
475
+ * @param settings - Optional scanning settings that may influence state
476
+ * selection.
477
+ * @returns The UI state key representing what should be shown to the user.
478
+ */
302
479
  export declare function getUiStateKey(frameProcessResult: PartialProcessResult, settings?: Partial<ScanningSettings>): BlinkIdUiStateKey;
303
480
 
481
+ /**
482
+ * The locale record type.
483
+ */
304
484
  export declare type LocaleRecord = typeof _default;
305
485
 
486
+ /**
487
+ * The localization strings type.
488
+ */
306
489
  export declare type LocalizationStrings = {
307
490
  [K in keyof LocaleRecord]: LocaleRecord[K] | (string & {});
308
491
  };
309
492
 
493
+ /**
494
+ * The partial process result.
495
+ */
310
496
  export declare type PartialProcessResult = {
497
+ /** The input image analysis result. */
311
498
  inputImageAnalysisResult: Partial<InputImageAnalysisResult>;
499
+ /** The result completeness. */
312
500
  resultCompleteness: Partial<ResultCompleteness>;
313
501
  };
314
502
 
503
+ /**
504
+ * Represents a UI state configuration with timing and weight parameters.
505
+ * Used to define how different UI states should behave in the stabilization process.
506
+ */
315
507
  export declare type UiState = {
508
+ /** Unique identifier for the UI state */
316
509
  key: string;
510
+ /** Minimum duration (in milliseconds) this state should be displayed */
317
511
  minDuration: number;
318
512
  /**
319
513
  * If true, the event will be emitted once the previous event is done.
320
- * It's not going through the averaging process
514
+ * It bypasses the averaging process and is handled separately.
321
515
  */
322
516
  singleEmit?: boolean;
517
+ /**
518
+ * Initial weight for this state when it enters the stabilization queue.
519
+ * Higher values give the state more influence in the averaging process.
520
+ */
323
521
  initialWeight?: number;
324
522
  };
325
523
 
524
+ /**
525
+ * Represents a UI state event in the stabilization queue.
526
+ * These events are processed to determine which UI state should be displayed.
527
+ */
326
528
  export declare type UiStateEvent = {
529
+ /** Identifier matching a UI state key */
327
530
  key: string;
531
+ /** High-resolution timestamp when the event occurred */
328
532
  timeStamp: DOMHighResTimeStamp;
533
+ /** Current weight of this event in the stabilization process */
329
534
  currentWeight: number;
330
535
  /**
331
- * If true, the event will be emitted once the previous event is done.
332
- * It's not going through the averaging process
536
+ * If true, this event will be emitted once the previous event completes.
537
+ * It bypasses the normal stabilization process.
333
538
  */
334
539
  singleEmit?: boolean;
335
540
  };
336
541
 
542
+ /**
543
+ * Maps state keys to their corresponding UI state configurations.
544
+ */
337
545
  export declare type UiStateMap = Record<string, UiState>;
338
546
 
339
547
  export { }
@@ -4,6 +4,14 @@
4
4
  import type { Component } from "solid-js";
5
5
  import { LocalizationStrings } from "./LocalizationContext";
6
6
  import "virtual:uno.css";
7
+ /**
8
+ * The BlinkIdFeedbackUi component. This is the main component that renders the
9
+ * feedback UI for the BlinkID SDK. It is responsible for rendering the feedback
10
+ * UI, the overlays, and the help button.
11
+ *
12
+ * @param props - The props for the BlinkIdFeedbackUi component.
13
+ * @returns The BlinkIdFeedbackUi component.
14
+ */
7
15
  export declare const BlinkIdFeedbackUi: Component<{
8
16
  localization?: Partial<LocalizationStrings>;
9
17
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"BlinkIdFeedbackUi.d.ts","sourceRoot":"","sources":["../../src/ui/BlinkIdFeedbackUi.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAc1C,OAAO,EAEL,mBAAmB,EAEpB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,iBAAiB,CAAC;AAazB,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC;IACxC,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC7C,CAqIA,CAAC"}
1
+ {"version":3,"file":"BlinkIdFeedbackUi.d.ts","sourceRoot":"","sources":["../../src/ui/BlinkIdFeedbackUi.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAc1C,OAAO,EAEL,mBAAmB,EAEpB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,iBAAiB,CAAC;AAYzB;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC;IACxC,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC7C,CAwIA,CAAC"}
@@ -6,21 +6,60 @@ import { type ParentComponent } from "solid-js";
6
6
  import { SetStoreFunction } from "solid-js/store";
7
7
  import type { BlinkIdProcessingError } from "../core/BlinkIdProcessingError";
8
8
  import type { BlinkIdUxManager } from "../core/BlinkIdUxManager";
9
+ /**
10
+ * The BlinkIdUiStore type.
11
+ */
9
12
  export type BlinkIdUiStore = {
13
+ /**
14
+ * The BlinkIdUxManager instance.
15
+ */
10
16
  blinkIdUxManager: BlinkIdUxManager;
17
+ /**
18
+ * The CameraManagerComponent instance.
19
+ */
11
20
  cameraManagerComponent: CameraManagerComponent;
21
+ /**
22
+ * The error state.
23
+ */
12
24
  errorState?: BlinkIdProcessingError;
25
+ /**
26
+ * Whether the document has been filtered.
27
+ */
13
28
  documentFiltered: boolean;
29
+ /**
30
+ * Whether the onboarding guide should be shown.
31
+ */
14
32
  showOnboardingGuide?: boolean;
33
+ /**
34
+ * The timeout for the help tooltip.
35
+ */
15
36
  showHelpTooltipTimeout?: number;
37
+ /**
38
+ * Whether the help modal should be shown.
39
+ */
16
40
  showHelpModal?: boolean;
41
+ /**
42
+ * Whether the help button should be shown.
43
+ */
17
44
  showHelpButton?: boolean;
45
+ /**
46
+ * The function to dismount the feedback UI.
47
+ */
18
48
  dismountFeedbackUi: () => void;
19
49
  };
50
+ /**
51
+ * The BlinkIdUiStoreContextValue type.
52
+ */
20
53
  type BlinkIdUiStoreContextValue = {
21
54
  store: BlinkIdUiStore;
22
55
  updateStore: SetStoreFunction<BlinkIdUiStore>;
23
56
  };
57
+ /**
58
+ * The BlinkIdUiStoreProvider component.
59
+ *
60
+ * @param props - The props for the BlinkIdUiStoreProvider component.
61
+ * @returns The BlinkIdUiStoreProvider component.
62
+ */
24
63
  export declare const BlinkIdUiStoreProvider: ParentComponent<{
25
64
  blinkIdUxManager: BlinkIdUxManager;
26
65
  cameraManagerComponent: CameraManagerComponent;
@@ -29,6 +68,11 @@ export declare const BlinkIdUiStoreProvider: ParentComponent<{
29
68
  showHelpTooltipTimeout?: number;
30
69
  dismountFeedbackUi: () => void;
31
70
  }>;
71
+ /**
72
+ * The useBlinkIdUiStore function.
73
+ *
74
+ * @returns The BlinkIdUiStore.
75
+ */
32
76
  export declare function useBlinkIdUiStore(): BlinkIdUiStoreContextValue;
33
77
  export {};
34
78
  //# sourceMappingURL=BlinkIdUiStoreContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlinkIdUiStoreContext.d.ts","sourceRoot":"","sources":["../../src/ui/BlinkIdUiStoreContext.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,MAAM,cAAc,GAAG;IAC3B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,sBAAsB,EAAE,sBAAsB,CAAC;IAE/C,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,cAAc,CAAC;IACtB,WAAW,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAC/C,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,eAAe,CAAC;IACnD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC,CAgCA,CAAC;AAEF,wBAAgB,iBAAiB,+BAOhC"}
1
+ {"version":3,"file":"BlinkIdUiStoreContext.d.ts","sourceRoot":"","sources":["../../src/ui/BlinkIdUiStoreContext.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;IACnC;;OAEG;IACH,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C;;OAEG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC;;OAEG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,KAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,cAAc,CAAC;IACtB,WAAW,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAC/C,CAAC;AAOF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,eAAe,CAAC;IACnD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC,CAgCA,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,+BAOhC"}
@@ -4,13 +4,27 @@
4
4
  import { ParentComponent } from "solid-js";
5
5
  import { SetStoreFunction } from "solid-js/store";
6
6
  import enLocaleStrings from "./locales/en";
7
+ /**
8
+ * The locale record type.
9
+ */
7
10
  export type LocaleRecord = typeof enLocaleStrings;
11
+ /**
12
+ * The localization strings type.
13
+ */
8
14
  export type LocalizationStrings = {
9
15
  [K in keyof LocaleRecord]: LocaleRecord[K] | (string & {});
10
16
  };
17
+ /**
18
+ * The localization provider.
19
+ */
11
20
  export declare const LocalizationProvider: ParentComponent<{
12
21
  userStrings?: Partial<LocalizationStrings>;
13
22
  }>;
23
+ /**
24
+ * The use localization hook.
25
+ *
26
+ * @returns The localization strings.
27
+ */
14
28
  export declare function useLocalization(): {
15
29
  t: LocalizationStrings;
16
30
  updateLocalization: SetStoreFunction<LocalizationStrings>;
@@ -1 +1 @@
1
- {"version":3,"file":"LocalizationContext.d.ts","sourceRoot":"","sources":["../../src/ui/LocalizationContext.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,eAAe,EAIhB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,gBAAgB,EAAe,MAAM,gBAAgB,CAAC;AAE/D,OAAO,eAAe,MAAM,cAAc,CAAC;AAE3C,MAAM,MAAM,YAAY,GAAG,OAAO,eAAe,CAAC;AAElD,MAAM,MAAM,mBAAmB,GAAG;KAI/B,CAAC,IAAI,MAAM,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;CAC3D,CAAC;AAOF,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC5C,CA0BA,CAAC;AAEF,wBAAgB,eAAe;OAlC1B,mBAAmB;wBACF,gBAAgB,CAAC,mBAAmB,CAAC;EAuC1D"}
1
+ {"version":3,"file":"LocalizationContext.d.ts","sourceRoot":"","sources":["../../src/ui/LocalizationContext.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,eAAe,EAIhB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,gBAAgB,EAAe,MAAM,gBAAgB,CAAC;AAE/D,OAAO,eAAe,MAAM,cAAc,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,eAAe,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;KAI/B,CAAC,IAAI,MAAM,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;CAC3D,CAAC;AAUF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC5C,CA0BA,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe;OA1C1B,mBAAmB;wBACF,gBAAgB,CAAC,mBAAmB,CAAC;EA+C1D"}
@@ -3,6 +3,12 @@
3
3
  */
4
4
  import { Component } from "solid-js";
5
5
  import { BlinkIdUiState } from "../core/blinkid-ui-state";
6
+ /**
7
+ * The UiFeedbackOverlay component.
8
+ *
9
+ * @param props - The props for the UiFeedbackOverlay component.
10
+ * @returns The UiFeedbackOverlay component.
11
+ */
6
12
  export declare const UiFeedbackOverlay: Component<{
7
13
  uiState: BlinkIdUiState;
8
14
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"UiFeedbackOverlay.d.ts","sourceRoot":"","sources":["../../src/ui/UiFeedbackOverlay.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,SAAS,EAQV,MAAM,UAAU,CAAC;AAIlB,OAAO,EACL,cAAc,EAGf,MAAM,0BAA0B,CAAC;AAelC,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC;IACxC,OAAO,EAAE,cAAc,CAAC;CACzB,CAiHA,CAAC"}
1
+ {"version":3,"file":"UiFeedbackOverlay.d.ts","sourceRoot":"","sources":["../../src/ui/UiFeedbackOverlay.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,SAAS,EAQV,MAAM,UAAU,CAAC;AAIlB,OAAO,EACL,cAAc,EAGf,MAAM,0BAA0B,CAAC;AAelC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC;IACxC,OAAO,EAAE,cAAc,CAAC;CACzB,CAiHA,CAAC"}
@@ -4,7 +4,13 @@
4
4
  import { BlinkIdUxManager } from "../core/BlinkIdUxManager";
5
5
  import { CameraManagerComponent } from "@microblink/camera-manager";
6
6
  import { LocalizationStrings } from "./LocalizationContext";
7
+ /**
8
+ * The options for the createBlinkIdFeedbackUi function.
9
+ */
7
10
  export type FeedbackUiOptions = {
11
+ /**
12
+ * The localization strings.
13
+ */
8
14
  localizationStrings?: Partial<LocalizationStrings>;
9
15
  /**
10
16
  * If set to `true`, the BlinkID instance will not be terminated when the
@@ -26,5 +32,14 @@ export type FeedbackUiOptions = {
26
32
  */
27
33
  showHelpButton?: boolean;
28
34
  };
35
+ /**
36
+ * Creates the BlinkID feedback UI.
37
+ *
38
+ * @param blinkIdUxManager - The BlinkID Ux Manager.
39
+ * @param cameraManagerComponent - The Camera Manager Component.
40
+ * @param options - The options for the createBlinkIdFeedbackUi function.
41
+ *
42
+ * @returns The function to unmount the feedback UI.
43
+ */
29
44
  export declare function createBlinkIdFeedbackUi(blinkIdUxManager: BlinkIdUxManager, cameraManagerComponent: CameraManagerComponent, { localizationStrings, preserveSdkInstance, showOnboardingGuide, showHelpButton, }?: FeedbackUiOptions): () => void;
30
45
  //# sourceMappingURL=createBlinkIdFeedbackUi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createBlinkIdFeedbackUi.d.ts","sourceRoot":"","sources":["../../src/ui/createBlinkIdFeedbackUi.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAIpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACnD;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,gBAAgB,EAClC,sBAAsB,EAAE,sBAAsB,EAC9C,EACE,mBAAmB,EAEnB,mBAAmB,EACnB,mBAA0B,EAC1B,cAAqB,GACtB,GAAE,iBAAsB,cAgC1B"}
1
+ {"version":3,"file":"createBlinkIdFeedbackUi.d.ts","sourceRoot":"","sources":["../../src/ui/createBlinkIdFeedbackUi.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAIpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACnD;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,gBAAgB,EAClC,sBAAsB,EAAE,sBAAsB,EAC9C,EACE,mBAAmB,EAEnB,mBAAmB,EACnB,mBAA0B,EAC1B,cAAqB,GACtB,GAAE,iBAAsB,cAgC1B"}