@pixelverse/strichjs-sdk 1.7.2 → 1.7.4

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/dist/strich.d.ts CHANGED
@@ -1,3 +1,29 @@
1
+ /**
2
+ * Fine-grained audio feedback configuration object
3
+ */
4
+ export declare interface AudioFeedbackConfiguration {
5
+ /**
6
+ * Toggle audible beep upon successful scan.
7
+ *
8
+ * @remarks
9
+ * Uses the WebAudio API to emit a "cash register"-like beep. Beeping is done on a best-effort
10
+ * basis and should not be relied upon. If the browser does not support the WebAudio API,
11
+ * beeping will not work, and no error will be thrown.
12
+ *
13
+ * @defaultValue true
14
+ */
15
+ enabled?: boolean;
16
+ /**
17
+ * Explicitly set the AudioSession type used for audible feedback.
18
+ *
19
+ * See https://github.com/w3c/audio-session/blob/main/explainer.md#api-design for a list of acceptable values.
20
+ *
21
+ * By default, the value `transient` is used if the AudioSession API is available.
22
+ * Setting this value to `null` will disable setting the AudioSession type.
23
+ */
24
+ audioSessionType?: string | null;
25
+ }
26
+
1
27
  /**
2
28
  * BarcodeReader is the primary interface of the STRICH SDK.
3
29
  */
@@ -234,9 +260,14 @@ export declare interface FeedbackConfiguration {
234
260
  /**
235
261
  * Toggle audible beep upon successful scan.
236
262
  *
263
+ * @remarks
264
+ * Uses the WebAudio API to emit a "cash register"-like beep. Beeping is done on a best-effort
265
+ * basis and should not be relied upon. If the browser does not support the WebAudio API, and in iOS
266
+ * PWAs, an HTML5 audio element will be used instead.
267
+ *
237
268
  * @defaultValue true
238
269
  */
239
- audio?: boolean;
270
+ audio?: boolean | AudioFeedbackConfiguration;
240
271
  /**
241
272
  * Toggle vibration upon successful scan, if supported by device.
242
273
  *
@@ -748,6 +779,17 @@ export declare class StrichSDK {
748
779
  * @param lang - The lower-case ISO language code, e.g. 'en'
749
780
  */
750
781
  static setLanguage(lang: string): void;
782
+ /**
783
+ * Override the preferred audio implementation used to emit audible feedback (beeps). By default, the SDK will
784
+ * automatically select an appropriate implementation.
785
+ *
786
+ * @remarks
787
+ * Using this method should only be necessary in specialized environments.
788
+ * Selecting an unsupported implementation will still fall back to an available one.
789
+ *
790
+ * @param impl - The audio implementation to use, either 'webaudio' for the WebAudio API, or 'html5' for an HTML5 Audio element
791
+ */
792
+ static setAudioImpl(impl: 'webaudio' | 'html5'): void;
751
793
  /**
752
794
  * Check if the browser has access to a camera device, which is required for scanning barcodes.
753
795
  *