@microblink/blinkid-ux-manager 7.3.2 → 7.4.1

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 +277 -47
  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 +86 -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 +267 -35
  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 +59 -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 +34 -1
  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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microblink/blinkid-ux-manager",
3
- "version": "7.3.2",
3
+ "version": "7.4.1",
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.3.2",
15
- "@microblink/camera-manager": "^7.2.1",
14
+ "@microblink/blinkid-core": "^7.4.1",
15
+ "@microblink/camera-manager": "^7.2.3",
16
16
  "type-fest": "^4.35.0"
17
17
  },
18
18
  "access": "public",
@@ -6,4 +6,9 @@
6
6
  * the user to retry the scanning process.
7
7
  */
8
8
  export type BlinkIdProcessingError = "timeout" | "unknown";
9
+ /**
10
+ * BlinkID Init errors are not something that should be handled by the end user
11
+ * therefore we don't need to display them in the UI. Camera permission errors
12
+ * are handled in the Camera Manager component.
13
+ */
9
14
  //# sourceMappingURL=BlinkIdProcessingError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlinkIdProcessingError.d.ts","sourceRoot":"","sources":["../../src/core/BlinkIdProcessingError.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAE9B,SAAS,GAGT,SAAS,CAAC"}
1
+ {"version":3,"file":"BlinkIdProcessingError.d.ts","sourceRoot":"","sources":["../../src/core/BlinkIdProcessingError.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAE9B,SAAS,GAGT,SAAS,CAAC;AAEd;;;;GAIG"}
@@ -8,46 +8,64 @@ import { BlinkIdProcessingError } from "./BlinkIdProcessingError";
8
8
  import { BlinkIdUiState, BlinkIdUiStateKey, blinkIdUiStateMap } from "./blinkid-ui-state";
9
9
  import { DocumentClassFilter } from "./DocumentClassFilter";
10
10
  /**
11
- * Manages the UX of the BlinkID SDK.
11
+ * The BlinkIdUxManager class. This is the main class that manages the UX of
12
+ * the BlinkID SDK. It is responsible for handling the UI state, the timeout,
13
+ * the help tooltip, and the document class filter.
12
14
  */
13
15
  export declare class BlinkIdUxManager {
14
16
  #private;
17
+ /** The camera manager. */
15
18
  cameraManager: CameraManager;
19
+ /** The scanning session. */
16
20
  scanningSession: RemoteScanningSession;
21
+ /** Whether the demo overlay should be shown. */
17
22
  showDemoOverlay: boolean;
23
+ /** Whether the production overlay should be shown. */
18
24
  showProductionOverlay: boolean;
25
+ /** The current UI state. */
19
26
  uiState: BlinkIdUiState;
27
+ /** The raw UI state key. */
20
28
  rawUiStateKey: BlinkIdUiStateKey;
29
+ /** The feedback stabilizer. */
21
30
  feedbackStabilizer: FeedbackStabilizer<typeof blinkIdUiStateMap>;
31
+ /** The session settings. */
22
32
  sessionSettings: BlinkIdSessionSettings;
33
+ /**
34
+ * The constructor for the BlinkIdUxManager class.
35
+ *
36
+ * @param cameraManager - The camera manager.
37
+ * @param scanningSession - The scanning session.
38
+ */
23
39
  constructor(cameraManager: CameraManager, scanningSession: RemoteScanningSession);
24
40
  /**
25
- * Indicates whether the UI should display the demo overlay. Controlled by the license property.
41
+ * Indicates whether the UI should display the demo overlay. Controlled by the
42
+ * license property.
26
43
  */
27
44
  getShowDemoOverlay(): boolean;
28
45
  /**
29
- * Indicates whether the UI should display the production overlay. Controlled by the license property.
46
+ * Indicates whether the UI should display the production overlay. Controlled by
47
+ * the license property.
30
48
  */
31
49
  getShowProductionOverlay(): boolean;
32
50
  /**
33
51
  * Returns the timeout duration in ms. Null if timeout won't be triggered ever.
34
- * @returns The timeout duration in ms.
35
52
  */
36
53
  getTimeoutDuration(): number | null;
37
54
  /**
38
55
  * Returns the time in ms before the help tooltip is shown. Null if tooltip won't be auto shown.
39
- * @returns The time in ms before the help tooltip is shown.
40
56
  */
41
57
  getHelpTooltipShowDelay(): number | null;
42
58
  /**
43
59
  * Returns the time in ms before the help tooltip is hidden. Null if tooltip won't be auto hidden.
44
- * @returns The time in ms before the help tooltip is hidden.
45
60
  */
46
61
  getHelpTooltipHideDelay(): number | null;
47
62
  /**
48
63
  * Adds a callback function to be executed when the UI state changes.
49
- * @param callback - Function to be called when UI state changes. Receives the new UI state as parameter.
64
+ *
65
+ * @param callback - Function to be called when UI state changes. Receives the
66
+ * new UI state as parameter.
50
67
  * @returns A cleanup function that removes the callback when called.
68
+ *
51
69
  * @example
52
70
  * const cleanup = manager.addOnUiStateChangedCallback((newState) => {
53
71
  * console.log('UI state changed to:', newState);
@@ -58,8 +76,10 @@ export declare class BlinkIdUxManager {
58
76
  addOnUiStateChangedCallback(callback: (uiState: BlinkIdUiState) => void): () => void;
59
77
  /**
60
78
  * Registers a callback function to be called when a scan result is available.
79
+ *
61
80
  * @param callback - A function that will be called with the scan result.
62
- * @returns A cleanup function that, when called, will remove the registered callback.
81
+ * @returns A cleanup function that, when called, will remove the registered
82
+ * callback.
63
83
  *
64
84
  * @example
65
85
  *
@@ -73,8 +93,11 @@ export declare class BlinkIdUxManager {
73
93
  addOnResultCallback(callback: (result: BlinkIdScanningResult) => void): () => void;
74
94
  /**
75
95
  * Registers a callback function to filter document classes.
76
- * @param callback - A function that will be called with the document class info.
77
- * @returns A cleanup function that, when called, will remove the registered callback.
96
+ *
97
+ * @param callback - A function that will be called with the document class
98
+ * info.
99
+ * @returns A cleanup function that, when called, will remove the registered
100
+ * callback.
78
101
  *
79
102
  * @example
80
103
  * const cleanup = manager.addDocumentClassFilter((docClassInfo) => {
@@ -87,8 +110,11 @@ export declare class BlinkIdUxManager {
87
110
  addDocumentClassFilter(callback: DocumentClassFilter): () => void;
88
111
  /**
89
112
  * Registers a callback function to be called when a frame is processed.
90
- * @param callback - A function that will be called with the frame analysis result.
91
- * @returns A cleanup function that, when called, will remove the registered callback.
113
+ *
114
+ * @param callback - A function that will be called with the frame analysis
115
+ * result.
116
+ * @returns A cleanup function that, when called, will remove the registered
117
+ * callback.
92
118
  *
93
119
  * @example
94
120
  * const cleanup = manager.addOnFrameProcessCallback((frameResult) => {
@@ -100,9 +126,12 @@ export declare class BlinkIdUxManager {
100
126
  */
101
127
  addOnFrameProcessCallback(callback: (frameResult: ProcessResultWithBuffer) => void): () => void;
102
128
  /**
103
- * Registers a callback function to be called when an error occurs during processing.
129
+ * Registers a callback function to be called when an error occurs during
130
+ * processing.
131
+ *
104
132
  * @param callback - A function that will be called with the error state.
105
- * @returns A cleanup function that, when called, will remove the registered callback.
133
+ * @returns A cleanup function that, when called, will remove the registered
134
+ * callback.
106
135
  *
107
136
  * @example
108
137
  * const cleanup = manager.addOnErrorCallback((error) => {
@@ -113,38 +142,70 @@ export declare class BlinkIdUxManager {
113
142
  * cleanup();
114
143
  */
115
144
  addOnErrorCallback(callback: (errorState: BlinkIdProcessingError) => void): () => void;
145
+ /**
146
+ * Registers a callback function to be called when a document is filtered.
147
+ *
148
+ * @param callback - A function that will be called with the document class
149
+ * info.
150
+ * @returns A cleanup function that, when called, will remove the registered
151
+ * callback.
152
+ *
153
+ * @example
154
+ * const cleanup = manager.addOnDocumentFilteredCallback((docClassInfo) => {
155
+ * console.log('Document filtered:', docClassInfo);
156
+ * });
157
+ *
158
+ * // Later, to remove the callback:
159
+ * cleanup();
160
+ */
116
161
  addOnDocumentFilteredCallback(callback: (documentClassInfo: DocumentClassInfo) => void): () => void;
117
162
  /**
118
- * Sets the duration after which the scanning session will timeout. The timeout can occur in various scenarios
119
- * and may be restarted by different scanning events.
163
+ * Sets the duration after which the scanning session will timeout. The
164
+ * timeout can occur in various scenarios and may be restarted by different
165
+ * scanning events.
120
166
  *
121
- * @param duration The timeout duration in milliseconds. If null, timeout won't be triggered ever.
122
- * @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.
167
+ * @param duration The timeout duration in milliseconds. If null, timeout won't
168
+ * be triggered ever.
169
+ * @param setHelpTooltipShowDelay If true, also sets the help tooltip show
170
+ * delay to half of the provided duration. If timeout duration is null, help
171
+ * tooltip show delay will be set to null. Defaults to true.
123
172
  * @throws {Error} Throws an error if duration is less than or equal to 0 when not null.
124
173
  */
125
174
  setTimeoutDuration(duration: number | null, setHelpTooltipShowDelay?: boolean): void;
126
175
  /**
127
176
  * Sets the duration in milliseconds before the help tooltip is shown.
128
177
  * A value of null means the help tooltip will not be auto shown.
129
- * @param duration The duration in milliseconds before the help tooltip is shown. If null, tooltip won't be auto shown.
130
- * @throws {Error} Throws an error if duration is less than or equal to 0 when not null.
178
+ *
179
+ * @param duration The duration in milliseconds before the help tooltip is
180
+ * shown. If null, tooltip won't be auto shown.
181
+ * @throws {Error} Throws an error if duration is less than or equal to 0 when
182
+ * not null.
131
183
  */
132
184
  setHelpTooltipShowDelay(duration: number | null): void;
133
185
  /**
134
186
  * Sets the duration in milliseconds before the help tooltip is hidden.
135
187
  * A value of null means the help tooltip will not be auto hidden.
136
- * @param duration The duration in milliseconds before the help tooltip is hidden. If null, tooltip won't be auto hidden.
137
- * @throws {Error} Throws an error if duration is less than or equal to 0 when not null.
188
+ *
189
+ * @param duration The duration in milliseconds before the help tooltip is
190
+ * hidden. If null, tooltip won't be auto hidden.
191
+ * @throws {Error} Throws an error if duration is less than or equal to 0 when
192
+ * not null.
138
193
  */
139
194
  setHelpTooltipHideDelay(duration: number | null): void;
140
195
  /**
141
- * Clears any active timeout.
196
+ * Clears the scanning session timeout.
142
197
  */
143
198
  clearScanTimeout: () => void;
144
199
  /**
145
- * Resets the manager and clears all callbacks.
200
+ * Resets the scanning session.
201
+ *
202
+ * @param startFrameCapture Whether to start frame processing.
203
+ */
204
+ resetScanningSession(startFrameCapture?: boolean): Promise<void>;
205
+ /**
206
+ * Resets the BlinkIdUxManager. Clears all callbacks.
146
207
  *
147
- * Does not reset the camera manager or the BlinkID core instance.
208
+ * Does not reset the camera manager or the scanning session.
148
209
  */
149
210
  reset(): void;
150
211
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BlinkIdUxManager.d.ts","sourceRoot":"","sources":["../../src/core/BlinkIdUxManager.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EAGlB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,qBAAa,gBAAgB;;IACnB,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,qBAAqB,CAAC;IACvC,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,cAAc,CAAC;IACxB,aAAa,EAAE,iBAAiB,CAAC;IACjC,kBAAkB,EAAE,kBAAkB,CAAC,OAAO,iBAAiB,CAAC,CAAC;IACjE,eAAe,EAAE,sBAAsB,CAAC;gBAwB9C,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,qBAAqB;IA2DxC;;OAEG;IACH,kBAAkB,IAAI,OAAO;IAI7B;;OAEG;IACH,wBAAwB,IAAI,OAAO;IAInC;;;OAGG;IACH,kBAAkB,IAAI,MAAM,GAAG,IAAI;IAInC;;;OAGG;IACH,uBAAuB,IAAI,MAAM,GAAG,IAAI;IAIxC;;;OAGG;IACH,uBAAuB,IAAI,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AK,IAAI;IAQ1D;;;;;;;;;;;;;;;OAeG;IACH,kBAAkB,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,IAAI;IAsBzE;;;;;;;;;;;;;;;OAeG;IACH,6BAA6B,CAC3B,QAAQ,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,KAAK,IAAI;IAsK1D;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,uBAAuB,UAAO;IAY1E;;;;;;;;OAQG;IACH,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQ/C;;;;;;;;OAQG;IACH,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IA+I/C;;OAEG;IACH,gBAAgB,aAQd;IAEF;;;;OAIG;IACG,oBAAoB,CAAC,iBAAiB,UAAO;IAkBnD;;;;OAIG;IACH,KAAK;CAWN"}
@@ -5,10 +5,12 @@ import { DocumentClassInfo } from "@microblink/blinkid-core";
5
5
  /**
6
6
  * A type representing a filter function for document classification.
7
7
  *
8
- * This function is used to determine whether a document class is supported or not.
9
- * It takes a `DocumentClassInfo` object as input and returns a boolean value:
8
+ * This function is used to determine whether a document class is supported or
9
+ * not. It takes a `DocumentClassInfo` object as input and returns a boolean
10
+ * value:
10
11
  * - `true`: The document class is supported.
11
- * - `false`: The document class is not supported, and the document will be marked as "unsupported-document".
12
+ * - `false`: The document class is not supported, and the document will be
13
+ * marked as "unsupported-document".
12
14
  *
13
15
  * @param documentClassInfo - Information about the document class, such as country and type.
14
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentClassFilter.d.ts","sourceRoot":"","sources":["../../src/core/DocumentClassFilter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,iBAAiB,EAAE,iBAAiB,KACjC,OAAO,CAAC"}
1
+ {"version":3,"file":"DocumentClassFilter.d.ts","sourceRoot":"","sources":["../../src/core/DocumentClassFilter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,iBAAiB,EAAE,iBAAiB,KACjC,OAAO,CAAC"}
@@ -3,23 +3,61 @@
3
3
  */
4
4
  import { InputImageAnalysisResult, ResultCompleteness, ScanningSettings } from "@microblink/blinkid-core";
5
5
  import { UiState } from "@microblink/feedback-stabilizer";
6
+ /**
7
+ * The type of reticle to display.
8
+ */
6
9
  export type BlinkIdReticleType = "searching" | "processing" | "error" | "done" | "flip" | "move_top" | "move_left" | "move_right";
10
+ /**
11
+ * The key of the UI state.
12
+ */
7
13
  export 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";
8
14
  /**
9
15
  * Extended UI state for BlinkID.
16
+ *
17
+ * @template K - The key of the UI state.
10
18
  */
11
19
  export type BlinkIdUiStateMap = {
12
20
  [K in BlinkIdUiStateKey]: UiState & {
21
+ /** The key of the UI state. */
13
22
  key: K;
23
+ /** The type of the reticle. */
14
24
  reticleType: BlinkIdReticleType;
15
25
  };
16
26
  };
27
+ /**
28
+ * The states that are captured when the first side is captured.
29
+ */
17
30
  export declare const firstSideCapturedStates: BlinkIdUiStateKey[];
31
+ /**
32
+ * The UI state of BlinkID.
33
+ */
18
34
  export type BlinkIdUiState = BlinkIdUiStateMap[keyof BlinkIdUiStateMap];
35
+ /**
36
+ * The UI state map of BlinkID.
37
+ */
19
38
  export declare const blinkIdUiStateMap: BlinkIdUiStateMap;
39
+ /**
40
+ * The partial process result.
41
+ */
20
42
  export type PartialProcessResult = {
43
+ /** The input image analysis result. */
21
44
  inputImageAnalysisResult: Partial<InputImageAnalysisResult>;
45
+ /** The result completeness. */
22
46
  resultCompleteness: Partial<ResultCompleteness>;
23
47
  };
48
+ /**
49
+ * Determines the appropriate UI state key based on the current frame processing
50
+ * result and scanning settings.
51
+ *
52
+ * This function acts as a state machine, translating the low-level analysis and
53
+ * completeness results into a high-level UI state that drives the user
54
+ * interface.
55
+ *
56
+ * @param frameProcessResult - The current (possibly partial) result of frame
57
+ * processing, including image analysis and completeness.
58
+ * @param settings - Optional scanning settings that may influence state
59
+ * selection.
60
+ * @returns The UI state key representing what should be shown to the user.
61
+ */
24
62
  export declare function getUiStateKey(frameProcessResult: PartialProcessResult, settings?: Partial<ScanningSettings>): BlinkIdUiStateKey;
25
63
  //# sourceMappingURL=blinkid-ui-state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blinkid-ui-state.d.ts","sourceRoot":"","sources":["../../src/core/blinkid-ui-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGL,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAG1D,MAAM,MAAM,kBAAkB,GAC1B,WAAW,GACX,YAAY,GACZ,OAAO,GACP,MAAM,GACN,MAAM,GACN,UAAU,GACV,WAAW,GACX,YAAY,CAAC;AAEjB,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,mBAAmB,GACnB,eAAe,GACf,cAAc,GACd,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,GACnB,oBAAoB,GACpB,UAAU,GACV,WAAW,GACX,YAAY,GACZ,iCAAiC,GACjC,mCAAmC,GACnC,yCAAyC,GACzC,kCAAkC,GAClC,eAAe,GACf,gBAAgB,GAChB,UAAU,GACV,YAAY,GACZ,UAAU,GACV,qBAAqB,GACrB,sBAAsB,GACtB,cAAc,GACd,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,YAAY,CAAC;AAEjB;;GAEG;AAEH,MAAM,MAAM,iBAAiB,GAAG;KAC7B,CAAC,IAAI,iBAAiB,GAAG,OAAO,GAAG;QAClC,GAAG,EAAE,CAAC,CAAC;QACP,WAAW,EAAE,kBAAkB,CAAC;KACjC;CACF,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,EAK7C,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,iBAAiB,CAAC,CAAC;AAExE,eAAO,MAAM,iBAAiB,EAAE,iBAgJtB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG;IACjC,wBAAwB,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC5D,kBAAkB,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACjD,CAAC;AAMF,wBAAgB,aAAa,CAC3B,kBAAkB,EAAE,oBAAoB,EACxC,QAAQ,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,qBAqWrC"}
1
+ {"version":3,"file":"blinkid-ui-state.d.ts","sourceRoot":"","sources":["../../src/core/blinkid-ui-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EACj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GAaG;AACH,wBAAgB,aAAa,CAC3B,kBAAkB,EAAE,oBAAoB,EACxC,QAAQ,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,qBAqWrC"}
@@ -1,7 +1,25 @@
1
1
  /**
2
2
  * Copyright (c) 2025 Microblink Ltd. All rights reserved.
3
3
  */
4
+ /**
5
+ * Calculates the average of an array of numbers.
6
+ *
7
+ * @param arr - The array of numbers.
8
+ * @returns The average of the array.
9
+ */
4
10
  export declare function getAverage(arr: number[]): number;
11
+ /**
12
+ * Converts an unknown value to an Error object.
13
+ *
14
+ * @param thrown - The value to convert.
15
+ * @returns The Error object.
16
+ */
5
17
  export declare const asError: (thrown: unknown) => Error;
18
+ /**
19
+ * Sleeps for a given number of milliseconds.
20
+ *
21
+ * @param ms - The number of milliseconds to sleep.
22
+ * @returns A promise that resolves after the given number of milliseconds.
23
+ */
6
24
  export declare function sleep(ms: number): Promise<unknown>;
7
25
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,UAEvC;AAED,eAAO,MAAM,OAAO,GAAI,QAAQ,OAAO,KAAG,KASzC,CAAC;AAEF,wBAAsB,KAAK,CAAC,EAAE,EAAE,MAAM,oBAErC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,UAEvC;AAED;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,OAAO,KAAG,KASzC,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,EAAE,EAAE,MAAM,oBAErC"}
package/types/index.d.ts CHANGED
@@ -1,6 +1,12 @@
1
1
  /**
2
2
  * Copyright (c) 2025 Microblink Ltd. All rights reserved.
3
3
  */
4
+ /**
5
+ * @packageDocumentation
6
+ * User experience and interface components for BlinkID SDK - provides a complete UI layer for document scanning.
7
+ * This package includes feedback UI, localization support, and document scanning state management to create
8
+ * an intuitive document scanning experience.
9
+ */
4
10
  export * from "./core/blinkid-ui-state";
5
11
  export * from "./core/BlinkIdUxManager";
6
12
  export * from "./ui/createBlinkIdFeedbackUi";
@@ -8,7 +14,15 @@ export type { LocaleRecord, LocalizationStrings, } from "./ui/LocalizationContex
8
14
  export type { DocumentClassFilter } from "./core/DocumentClassFilter";
9
15
  export type * from "@microblink/feedback-stabilizer";
10
16
  export type { BlinkIdProcessingError } from "./core/BlinkIdProcessingError";
17
+ /**
18
+ * The global interface.
19
+ *
20
+ * @see https://newsletter.daishikato.com/p/detecting-dual-module-issues-in-jotai
21
+ */
11
22
  declare const testSymbol: unique symbol;
23
+ /**
24
+ * The global interface.
25
+ */
12
26
  declare global {
13
27
  var __BLINKID_UX_MANAGER__: typeof testSymbol;
14
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,YAAY,EACV,YAAY,EACZ,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,mBAAmB,iCAAiC,CAAC;AACrD,YAAY,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAG5E,QAAA,MAAM,UAAU,eAAW,CAAC;AAE5B,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,sBAAsB,EAAE,OAAO,UAAU,CAAC;CAC/C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,YAAY,EACV,YAAY,EACZ,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,mBAAmB,iCAAiC,CAAC;AACrD,YAAY,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;;;GAIG;AACH,QAAA,MAAM,UAAU,eAAW,CAAC;AAE5B;;GAEG;AACH,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,sBAAsB,EAAE,OAAO,UAAU,CAAC;CAC/C"}