@pixelverse/strichjs-sdk 1.1.3 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.0] - 2023-07-12
4
+
5
+ ### Added
6
+
7
+ - The GPU-accelerated barcode locator is now based on WebGL 2, which is widely supported by now. If you are for some reason required to use WebGL 1, set the new `impl` field on the locator configuration to `webgl1`. WebGL 2 supports asynchronous reads which we use to decrease the load on the main thread. Some older Safari versions have reported issues using the asynchronous reads, which is why for the moment we have disabled asynchronous reads on iOS. This will likely change in the future.
8
+
9
+ ### Fixed
10
+
11
+ - Fixed a rare engine crash that resulted from incorrect error handling.
12
+
13
+ ### Changed
14
+
15
+ - Changed the default values for `hysteresisMinCount` to `2` and `hysteresisInterval` to `350`. The previous defaults were causing EAN/UPC codes to be unreadable on low-end Android devices.
16
+
17
+ ## [1.1.4] - 2023-06-26
18
+
19
+ ### Added
20
+
21
+ - User-facing error messages (e.g. "Access to camera not permitted") are now localized. English, Spanish, German, French and Italian are the currently supported languages, with more to come.
22
+ - Prepared support for iOS 17 Safari OffscreenCanvas+WebGL support. STRICH will utilize a GPU-accelerated OffscreenCanvas if the browser supports it.
23
+
24
+ ### Fixed
25
+
26
+ - Improved performance when scanning EAN/UPC codes with hysteresis enabled.
27
+
3
28
  ## [1.1.3] - 2023-06-07
4
29
 
5
30
  ### Added
package/dist/strich.d.ts CHANGED
@@ -6,8 +6,19 @@ export class SdkError extends Error {
6
6
  * Flag indicating if this error is related to camera access.
7
7
  */
8
8
  duringCameraAccess: boolean;
9
+ /**
10
+ * A localized error message, if available, otherwise this will contain the non-localized message.
11
+ */
12
+ localizedMessage: string;
13
+ /**
14
+ * An optional underlying error that caused this error.
15
+ */
9
16
  cause?: Error;
10
- constructor(message: string, cause?: Error);
17
+ /**
18
+ * An optional detail message to display to disambiguate multiple errors (not-translated)
19
+ */
20
+ detailMessage?: string;
21
+ constructor(keyOrMessage: string, cause?: Error);
11
22
  }
12
23
  /**
13
24
  * Configuration for the frame source (camera).
@@ -78,6 +89,20 @@ export interface LocatorConfiguration {
78
89
  * @default false
79
90
  */
80
91
  chromaReject?: boolean;
92
+ /**
93
+ * The locator implementation to use. This should normally not be changed, unless it is specifically required
94
+ * to target WebGL 1.
95
+ *
96
+ * @default 'auto'
97
+ */
98
+ impl?: 'auto' | 'webgl1' | 'webgl2';
99
+ /**
100
+ * An advanced option for disabling asynchronous reads from GPU when using 'webgl2'.
101
+ * Some older iOS versions have issues with WebGL2 asynchronous readbacks.
102
+ *
103
+ * @default false
104
+ */
105
+ forceSyncReadback?: boolean;
81
106
  }
82
107
  /**
83
108
  * The supported symbologies.
@@ -156,7 +181,7 @@ export interface EngineConfiguration {
156
181
  *
157
182
  * Setting this parameter to 0 disables hysteresis (default behavior for versions <= 1.1.0)
158
183
  *
159
- * @default 3
184
+ * @default 2
160
185
  */
161
186
  hysteresisMinCount?: number;
162
187
  /**
@@ -164,7 +189,7 @@ export interface EngineConfiguration {
164
189
  *
165
190
  * This parameter sets the size of the hysteresis window in milliseconds.
166
191
  *
167
- * @default 250
192
+ * @default 350
168
193
  */
169
194
  hysteresisInterval?: number;
170
195
  }
@@ -324,6 +349,12 @@ export class StrichSDK {
324
349
  * @default No custom ID is set by default
325
350
  */
326
351
  static setCustomId(customId: string | null): void;
352
+ /**
353
+ * Override the language that was detected from the browser's language (navigator.language)
354
+ *
355
+ * @param lang ISO language code, e.g. 'en'
356
+ */
357
+ static setLanguage(lang: string): void;
327
358
  }
328
359
  /**
329
360
  * A code detection reported by the STRICH SDK.