@microblink/blinkid-ux-manager 7.4.2 → 7.4.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microblink/blinkid-ux-manager",
3
- "version": "7.4.2",
3
+ "version": "7.4.3",
4
4
  "author": "Microblink",
5
5
  "type": "module",
6
6
  "main": "./dist/blinkid-ux-manager.js",
@@ -11,8 +11,8 @@
11
11
  "types"
12
12
  ],
13
13
  "dependencies": {
14
- "@microblink/blinkid-core": "^7.4.2",
15
- "@microblink/camera-manager": "^7.2.4",
14
+ "@microblink/blinkid-core": "^7.4.3",
15
+ "@microblink/camera-manager": "^7.2.5",
16
16
  "type-fest": "^4.35.0"
17
17
  },
18
18
  "access": "public",
@@ -0,0 +1,584 @@
1
+ import { BlinkIdScanningResult } from '@microblink/blinkid-core';
2
+ import { BlinkIdSessionSettings } from '@microblink/blinkid-core';
3
+ import { CameraManager } from '@microblink/camera-manager';
4
+ import { CameraManagerComponent } from '@microblink/camera-manager';
5
+ import { DocumentClassInfo } from '@microblink/blinkid-core';
6
+ import { InputImageAnalysisResult } from '@microblink/blinkid-core';
7
+ import { ProcessResultWithBuffer } from '@microblink/blinkid-core';
8
+ import { RemoteScanningSession } from '@microblink/blinkid-core';
9
+ import { ResultCompleteness } from '@microblink/blinkid-core';
10
+ import { ScanningSettings } from '@microblink/blinkid-core';
11
+ import { StringKeyOf } from 'type-fest';
12
+
13
+ /**
14
+ * Copyright (c) 2025 Microblink Ltd. All rights reserved.
15
+ */
16
+ /**
17
+ * BlinkID processing error. These errors are usually unrecoverable and require
18
+ * the user to retry the scanning process.
19
+ */
20
+ export declare type BlinkIdProcessingError = "timeout" | "unknown";
21
+
22
+ /**
23
+ * The type of reticle to display.
24
+ */
25
+ export declare type BlinkIdReticleType = "searching" | "processing" | "error" | "done" | "flip" | "move_top" | "move_left" | "move_right";
26
+
27
+ /**
28
+ * The UI state of BlinkID.
29
+ */
30
+ export declare type BlinkIdUiState = BlinkIdUiStateMap[keyof BlinkIdUiStateMap];
31
+
32
+ /**
33
+ * The key of the UI state.
34
+ */
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";
36
+
37
+ /**
38
+ * Extended UI state for BlinkID.
39
+ *
40
+ * @template K - The key of the UI state.
41
+ */
42
+ export declare type BlinkIdUiStateMap = {
43
+ [K in BlinkIdUiStateKey]: UiState & {
44
+ /** The key of the UI state. */
45
+ key: K;
46
+ /** The type of the reticle. */
47
+ reticleType: BlinkIdReticleType;
48
+ };
49
+ };
50
+
51
+ /**
52
+ * The UI state map of BlinkID.
53
+ */
54
+ export declare const blinkIdUiStateMap: BlinkIdUiStateMap;
55
+
56
+ /**
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.
60
+ */
61
+ export declare class BlinkIdUxManager {
62
+ #private;
63
+ /** The camera manager. */
64
+ cameraManager: CameraManager;
65
+ /** The scanning session. */
66
+ scanningSession: RemoteScanningSession;
67
+ /** Whether the demo overlay should be shown. */
68
+ showDemoOverlay: boolean;
69
+ /** Whether the production overlay should be shown. */
70
+ showProductionOverlay: boolean;
71
+ /** The current UI state. */
72
+ uiState: BlinkIdUiState;
73
+ /** The raw UI state key. */
74
+ rawUiStateKey: BlinkIdUiStateKey;
75
+ /** The feedback stabilizer. */
76
+ feedbackStabilizer: FeedbackStabilizer<typeof blinkIdUiStateMap>;
77
+ /** The session settings. */
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
+ */
85
+ constructor(cameraManager: CameraManager, scanningSession: RemoteScanningSession);
86
+ /**
87
+ * Indicates whether the UI should display the demo overlay. Controlled by the
88
+ * license property.
89
+ */
90
+ getShowDemoOverlay(): boolean;
91
+ /**
92
+ * Indicates whether the UI should display the production overlay. Controlled by
93
+ * the license property.
94
+ */
95
+ getShowProductionOverlay(): boolean;
96
+ /**
97
+ * Returns the timeout duration in ms. Null if timeout won't be triggered ever.
98
+ */
99
+ getTimeoutDuration(): number | null;
100
+ /**
101
+ * Returns the time in ms before the help tooltip is shown. Null if tooltip won't be auto shown.
102
+ */
103
+ getHelpTooltipShowDelay(): number | null;
104
+ /**
105
+ * Returns the time in ms before the help tooltip is hidden. Null if tooltip won't be auto hidden.
106
+ */
107
+ getHelpTooltipHideDelay(): number | null;
108
+ /**
109
+ * Adds a callback function to be executed when the UI state changes.
110
+ *
111
+ * @param callback - Function to be called when UI state changes. Receives the
112
+ * new UI state as parameter.
113
+ * @returns A cleanup function that removes the callback when called.
114
+ *
115
+ * @example
116
+ * const cleanup = manager.addOnUiStateChangedCallback((newState) => {
117
+ * console.log('UI state changed to:', newState);
118
+ * });
119
+ *
120
+ * cleanup();
121
+ */
122
+ addOnUiStateChangedCallback(callback: (uiState: BlinkIdUiState) => void): () => void;
123
+ /**
124
+ * Registers a callback function to be called when a scan result is available.
125
+ *
126
+ * @param callback - A function that will be called with the scan result.
127
+ * @returns A cleanup function that, when called, will remove the registered
128
+ * callback.
129
+ *
130
+ * @example
131
+ *
132
+ * const cleanup = manager.addOnResultCallback((result) => {
133
+ * console.log('Scan result:', result);
134
+ * });
135
+ *
136
+ * // Later, to remove the callback:
137
+ * cleanup();
138
+ */
139
+ addOnResultCallback(callback: (result: BlinkIdScanningResult) => void): () => void;
140
+ /**
141
+ * Registers a callback function to filter document classes.
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.
147
+ *
148
+ * @example
149
+ * const cleanup = manager.addDocumentClassFilter((docClassInfo) => {
150
+ * return docClassInfo.country === 'usa';
151
+ * });
152
+ *
153
+ * // Later, to remove the callback:
154
+ * cleanup();
155
+ */
156
+ addDocumentClassFilter(callback: DocumentClassFilter): () => void;
157
+ /**
158
+ * Registers a callback function to be called when a frame is processed.
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.
164
+ *
165
+ * @example
166
+ * const cleanup = manager.addOnFrameProcessCallback((frameResult) => {
167
+ * console.log('Frame processed:', frameResult);
168
+ * });
169
+ *
170
+ * // Later, to remove the callback:
171
+ * cleanup();
172
+ */
173
+ addOnFrameProcessCallback(callback: (frameResult: ProcessResultWithBuffer) => void): () => void;
174
+ /**
175
+ * Registers a callback function to be called when an error occurs during
176
+ * processing.
177
+ *
178
+ * @param callback - A function that will be called with the error state.
179
+ * @returns A cleanup function that, when called, will remove the registered
180
+ * callback.
181
+ *
182
+ * @example
183
+ * const cleanup = manager.addOnErrorCallback((error) => {
184
+ * console.error('Processing error:', error);
185
+ * });
186
+ *
187
+ * // Later, to remove the callback:
188
+ * cleanup();
189
+ */
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
+ */
207
+ addOnDocumentFilteredCallback(callback: (documentClassInfo: DocumentClassInfo) => void): () => void;
208
+ /**
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.
212
+ *
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.
218
+ * @throws {Error} Throws an error if duration is less than or equal to 0 when not null.
219
+ */
220
+ setTimeoutDuration(duration: number | null, setHelpTooltipShowDelay?: boolean): void;
221
+ /**
222
+ * Sets the duration in milliseconds before the help tooltip is shown.
223
+ * A value of null means the help tooltip will not be auto shown.
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.
229
+ */
230
+ setHelpTooltipShowDelay(duration: number | null): void;
231
+ /**
232
+ * Sets the duration in milliseconds before the help tooltip is hidden.
233
+ * A value of null means the help tooltip will not be auto hidden.
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.
239
+ */
240
+ setHelpTooltipHideDelay(duration: number | null): void;
241
+ /**
242
+ * Clears the scanning session timeout.
243
+ */
244
+ clearScanTimeout: () => void;
245
+ /**
246
+ * Gets the result from the scanning session.
247
+ *
248
+ * @param deleteSession - Whether to delete the session after getting the result. Note that
249
+ * it is not possible to get the result a second time after the document has been fully captured,
250
+ * so in this case we should delete the scanning session since it is no longer needed.
251
+ * @returns The result.
252
+ */
253
+ getSessionResult(deleteSession?: boolean): Promise<BlinkIdScanningResult>;
254
+ /**
255
+ * Safely deletes the scanning session.
256
+ */
257
+ safelyDeleteScanningSession(): Promise<void>;
258
+ /**
259
+ * Resets the scanning session.
260
+ *
261
+ * @param startFrameCapture Whether to start frame processing.
262
+ */
263
+ resetScanningSession(startFrameCapture?: boolean): Promise<void>;
264
+ /**
265
+ * Resets the BlinkIdUxManager. Clears all callbacks.
266
+ *
267
+ * Does not reset the camera manager or the scanning session.
268
+ */
269
+ reset(): void;
270
+ }
271
+
272
+ /**
273
+ * Creates the BlinkID feedback UI.
274
+ *
275
+ * @param blinkIdUxManager - The BlinkID Ux Manager.
276
+ * @param cameraManagerComponent - The Camera Manager Component.
277
+ * @param options - The options for the createBlinkIdFeedbackUi function.
278
+ *
279
+ * @returns The function to unmount the feedback UI.
280
+ */
281
+ export declare function createBlinkIdFeedbackUi(blinkIdUxManager: BlinkIdUxManager, cameraManagerComponent: CameraManagerComponent, { localizationStrings, preserveSdkInstance, showOnboardingGuide, showHelpButton, showDocumentFilteredModal, showTimeoutModal, showUnsupportedDocumentModal, }?: FeedbackUiOptions): () => void;
282
+
283
+ /**
284
+ * The English localization strings.
285
+ */
286
+ declare const _default: {
287
+ readonly scan_the_front_side: "Scan the front side of the document";
288
+ readonly scan_data_page: "Scan the data page of the document";
289
+ readonly scan_top_page: "Scan the top page";
290
+ readonly scan_left_page: "Scan the left page";
291
+ readonly scan_right_page: "Scan the right page";
292
+ readonly flip_document: "Flip the document";
293
+ readonly wrong_top: "Move to the top page";
294
+ readonly wrong_left: "Move to the left page";
295
+ readonly wrong_right: "Move to the right page";
296
+ readonly flip_to_back_side: "Flip to the back side";
297
+ readonly move_top: "Move to the page on top";
298
+ readonly move_left: "Move to the page on the left";
299
+ readonly move_right: "Move to the page on the right";
300
+ readonly scan_the_back_side: "Scan the back side of the document";
301
+ readonly scan_the_barcode: "Scan the barcode";
302
+ readonly move_closer: "Move closer";
303
+ readonly move_farther: "Move farther";
304
+ readonly camera_angle_too_steep: "Keep document parallel to phone";
305
+ readonly face_photo_not_fully_visible: "Keep face photo fully visible";
306
+ readonly document_too_close_to_edge: "Move the document from the edge";
307
+ readonly blur_detected: "Keep document and phone still";
308
+ readonly glare_detected: "Tilt or move document to remove reflection";
309
+ readonly occluded: "Keep the document fully visible";
310
+ readonly too_dark: "Move to brighter spot";
311
+ readonly too_bright: "Move to spot with less lighting";
312
+ readonly scan_unsuccessful: "Scan unsuccessful";
313
+ readonly scan_unsuccessful_details: "Unable to read the document. Please try again.";
314
+ readonly document_not_recognized: "Document not recognized";
315
+ readonly document_not_recognized_details: "Scan the front side of a supported document.";
316
+ readonly document_filtered: "Document not accepted";
317
+ readonly document_filtered_details: "Try scanning a different document.";
318
+ readonly onboarding_modal_title: "Keep all the details visible";
319
+ readonly onboarding_modal_details: "Make sure you keep the document well lit. All document fields should be visible on the camera screen.";
320
+ readonly onboarding_modal_btn: "Start scanning";
321
+ readonly help_modal_title_1: "Keep all the fields visible";
322
+ readonly help_modal_details_1: "Make sure you aren’t covering parts of the document with a finger, including the bottom lines. Also, watch out for hologram reflections that go over the document fields.";
323
+ readonly help_modal_title_2: "Watch out for harsh light";
324
+ readonly help_modal_details_2: "Avoid direct harsh light because it reflects from the document and can make parts of the document unreadable. If you can’t read data on the document, it won’t be visible to the camera either.";
325
+ readonly help_modal_title_3: "Keep still while scanning";
326
+ readonly help_modal_details_3: "Try to keep the phone and document still while scanning. Moving either can blur the image and make data on the document unreadable.";
327
+ readonly help_modal_back_btn: "Back";
328
+ readonly help_modal_next_btn: "Next";
329
+ readonly help_modal_done_btn: "Done";
330
+ readonly help_aria_label: "Help";
331
+ readonly help_tooltip: "Need help?";
332
+ readonly alert_retry_btn: "Retry";
333
+ readonly alert_cancel_btn: "Cancel";
334
+ };
335
+
336
+ /**
337
+ * A type representing a filter function for document classification.
338
+ *
339
+ * This function is used to determine whether a document class is supported or
340
+ * not. It takes a `DocumentClassInfo` object as input and returns a boolean
341
+ * value:
342
+ * - `true`: The document class is supported.
343
+ * - `false`: The document class is not supported, and the document will be
344
+ * marked as "unsupported-document".
345
+ *
346
+ * @param documentClassInfo - Information about the document class, such as country and type.
347
+ *
348
+ * @returns A boolean indicating whether the document class is supported.
349
+ */
350
+ export declare type DocumentClassFilter = (documentClassInfo: DocumentClassInfo) => boolean;
351
+
352
+ /**
353
+ * FeedbackStabilizer provides UI state management with temporal smoothing.
354
+ *
355
+ * It helps prevent UI "flickering" by:
356
+ * - Maintaining a time-windowed history of UI state changes
357
+ * - Applying weighted averaging to determine the most appropriate state
358
+ * - Supporting immediate state changes through single-emit events
359
+ * - Enforcing minimum display durations for states
360
+ *
361
+ * @typeParam SdkSpecificStateMap - Type extending UiStateMap for SDK-specific states
362
+ */
363
+ export declare class FeedbackStabilizer<SdkSpecificStateMap extends UiStateMap> {
364
+ /** The initial key. */
365
+ private initialKey;
366
+ /** The UI state map. */
367
+ private uiStateMap;
368
+ /** Time window (in ms) for considering UI state events. */
369
+ private timeWindow;
370
+ /** The decay rate. */
371
+ /** Rate at which event weights decay over time */
372
+ private decayRate;
373
+ /** Queue of regular UI state events within the time window */
374
+ private eventQueue;
375
+ /** Special queue for single-emit events that bypass normal stabilization */
376
+ private singleEventQueue;
377
+ /** Currently displayed state key */
378
+ private currentKey;
379
+ /** Timestamp when current state started displaying */
380
+ private currentStateStartTime;
381
+ /** Accumulated scores for each state in current calculation */
382
+ private summedScores;
383
+ /** History of scores for each state */
384
+ private scoreBoard;
385
+ /**
386
+ * Gets the currently active UI state configuration.
387
+ *
388
+ * @returns The currently active UI state configuration.
389
+ */
390
+ get currentState(): SdkSpecificStateMap[`${Extract<keyof SdkSpecificStateMap, string | number>}`];
391
+ /**
392
+ * Gets a copy of the current event queue for debugging.
393
+ *
394
+ * @returns A copy of the current event queue.
395
+ */
396
+ getEventQueue(): UiStateEvent[];
397
+ /**
398
+ * Gets the current summed scores for each state.
399
+ *
400
+ * @returns The current summed scores for each state.
401
+ */
402
+ getScores(): Record<string, number>;
403
+ /**
404
+ * Gets the score history for each state.
405
+ *
406
+ * @returns The score history for each state.
407
+ */
408
+ getScoreBoard(): Record<string, number[]>;
409
+ /**
410
+ * Updates the time window used for state stabilization
411
+ *
412
+ * @param timeWindow - New time window in milliseconds
413
+ */
414
+ setTimeWindow(timeWindow: number): void;
415
+ /**
416
+ * Creates a new FeedbackStabilizer instance.
417
+ *
418
+ * @param uiStateMap - Map of all possible UI states and their configurations
419
+ * @param initialKey - Key of the initial UI state to display
420
+ * @param timeWindow - Optional custom time window (in ms) for state averaging
421
+ * @param decayRate - Optional custom decay rate for event weights
422
+ */
423
+ constructor(uiStateMap: SdkSpecificStateMap, initialKey: StringKeyOf<SdkSpecificStateMap>, timeWindow?: number, decayRate?: number);
424
+ /**
425
+ * Resets the stabilizer to its initial state.
426
+ *
427
+ * @returns The initial state.
428
+ */
429
+ reset(): void;
430
+ /**
431
+ * Checks if enough time has passed to show a new UI state
432
+ *
433
+ * @returns true if the current state's minimum duration has elapsed
434
+ */
435
+ canShowNewUiState: () => boolean;
436
+ /**
437
+ * Processes a new UI state event and determines the state to display.
438
+ *
439
+ * This method:
440
+ * 1. Handles single-emit events that bypass normal stabilization
441
+ * 2. Maintains a time-windowed queue of regular events
442
+ * 3. Applies temporal averaging with decay to determine the winning state
443
+ *
444
+ * @param incomingUiStateKey - Key of the new UI state event
445
+ * @returns The UI state that should be displayed.
446
+ */
447
+ getNewUiState(incomingUiStateKey: StringKeyOf<SdkSpecificStateMap>): SdkSpecificStateMap[StringKeyOf<SdkSpecificStateMap>];
448
+ }
449
+
450
+ /**
451
+ * The options for the createBlinkIdFeedbackUi function.
452
+ */
453
+ export declare type FeedbackUiOptions = {
454
+ /**
455
+ * The localization strings.
456
+ */
457
+ localizationStrings?: Partial<LocalizationStrings>;
458
+ /**
459
+ * If set to `true`, the BlinkID instance will not be terminated when the
460
+ * feedback UI is unmounted.
461
+ *
462
+ * @defaultValue false
463
+ */
464
+ preserveSdkInstance?: boolean;
465
+ /**
466
+ * If set to `true`, the onboarding guide will be shown.
467
+ *
468
+ * @defaultValue true
469
+ */
470
+ showOnboardingGuide?: boolean;
471
+ /**
472
+ * If set to `true`, the help button will be shown.
473
+ *
474
+ * @defaultValue true
475
+ */
476
+ showHelpButton?: boolean;
477
+ /**
478
+ * If set to `true`, the document filtered modal will be shown.
479
+ *
480
+ * @defaultValue true
481
+ */
482
+ showDocumentFilteredModal?: boolean;
483
+ /**
484
+ * If set to `true`, the timeout modal will be shown.
485
+ *
486
+ * @defaultValue true
487
+ */
488
+ showTimeoutModal?: boolean;
489
+ /**
490
+ * If set to `true`, the document unsupported modal will be shown.
491
+ *
492
+ * @defaultValue true
493
+ */
494
+ showUnsupportedDocumentModal?: boolean;
495
+ };
496
+
497
+ /**
498
+ * The states that are captured when the first side is captured.
499
+ */
500
+ export declare const firstSideCapturedStates: BlinkIdUiStateKey[];
501
+
502
+ /**
503
+ * Determines the appropriate UI state key based on the current frame processing
504
+ * result and scanning settings.
505
+ *
506
+ * This function acts as a state machine, translating the low-level analysis and
507
+ * completeness results into a high-level UI state that drives the user
508
+ * interface.
509
+ *
510
+ * @param frameProcessResult - The current (possibly partial) result of frame
511
+ * processing, including image analysis and completeness.
512
+ * @param settings - Optional scanning settings that may influence state
513
+ * selection.
514
+ * @returns The UI state key representing what should be shown to the user.
515
+ */
516
+ export declare function getUiStateKey(frameProcessResult: PartialProcessResult, settings?: Partial<ScanningSettings>): BlinkIdUiStateKey;
517
+
518
+ /**
519
+ * The locale record type.
520
+ */
521
+ export declare type LocaleRecord = typeof _default;
522
+
523
+ /**
524
+ * The localization strings type.
525
+ */
526
+ export declare type LocalizationStrings = {
527
+ [K in keyof LocaleRecord]: LocaleRecord[K] | (string & {});
528
+ };
529
+
530
+ /**
531
+ * The partial process result.
532
+ */
533
+ export declare type PartialProcessResult = {
534
+ /** The input image analysis result. */
535
+ inputImageAnalysisResult: Partial<InputImageAnalysisResult>;
536
+ /** The result completeness. */
537
+ resultCompleteness: Partial<ResultCompleteness>;
538
+ };
539
+
540
+ /**
541
+ * Represents a UI state configuration with timing and weight parameters.
542
+ * Used to define how different UI states should behave in the stabilization process.
543
+ */
544
+ export declare type UiState = {
545
+ /** Unique identifier for the UI state */
546
+ key: string;
547
+ /** Minimum duration (in milliseconds) this state should be displayed */
548
+ minDuration: number;
549
+ /**
550
+ * If true, the event will be emitted once the previous event is done.
551
+ * It bypasses the averaging process and is handled separately.
552
+ */
553
+ singleEmit?: boolean;
554
+ /**
555
+ * Initial weight for this state when it enters the stabilization queue.
556
+ * Higher values give the state more influence in the averaging process.
557
+ */
558
+ initialWeight?: number;
559
+ };
560
+
561
+ /**
562
+ * Represents a UI state event in the stabilization queue.
563
+ * These events are processed to determine which UI state should be displayed.
564
+ */
565
+ export declare type UiStateEvent = {
566
+ /** Identifier matching a UI state key */
567
+ key: string;
568
+ /** High-resolution timestamp when the event occurred */
569
+ timeStamp: DOMHighResTimeStamp;
570
+ /** Current weight of this event in the stabilization process */
571
+ currentWeight: number;
572
+ /**
573
+ * If true, this event will be emitted once the previous event completes.
574
+ * It bypasses the normal stabilization process.
575
+ */
576
+ singleEmit?: boolean;
577
+ };
578
+
579
+ /**
580
+ * Maps state keys to their corresponding UI state configurations.
581
+ */
582
+ export declare type UiStateMap = Record<string, UiState>;
583
+
584
+ export { }