@pixelverse/strichjs-sdk 1.11.0 → 1.12.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/dist/strich.d.ts CHANGED
@@ -29,16 +29,12 @@ export declare interface AudioFeedbackConfiguration {
29
29
  */
30
30
  export declare class BarcodeReader {
31
31
  /**
32
- * User-supplied barcode detection handler.
33
- *
34
- * This is a synchronous call, so further processing will not happen until the handler returns.
32
+ * App-supplied barcode detection handler.
35
33
  */
36
- detected?: (detections: CodeDetection[]) => (void);
34
+ detected?: DetectionHandler;
37
35
  /**
38
- * Optional user-supplied error callback.
39
- *
40
- * This is invoked by the BarcodeReader if an error occurred while processing frames, and is usually not
41
- * recoverable.
36
+ * Optional app-supplied error callback, invoked by the BarcodeReader if an unexpected error occurred while
37
+ * processing frames.
42
38
  */
43
39
  onError?: (error: Error) => (void);
44
40
  /**
@@ -108,6 +104,24 @@ export declare class BarcodeReader {
108
104
  * @returns the current visibility of this BarcodeReader instance
109
105
  */
110
106
  getVisible(): boolean;
107
+ /**
108
+ * Programmatically zoom the camera feed if the device supports it.
109
+ *
110
+ * @remarks
111
+ * This method will do nothing if the BarcodeReader is not initialized or has been destroyed.
112
+ *
113
+ * @param enabled - True to enable zoom, false to disable it
114
+ */
115
+ setZoom(enabled: boolean): Promise<void>;
116
+ /**
117
+ * Programmatically toggle the flashlight if the device supports it.
118
+ *
119
+ * @remarks
120
+ * This method will do nothing if the BarcodeReader is not initialized or has been destroyed.
121
+ *
122
+ * @param enabled - True to enable the flashlight, false to disable it
123
+ */
124
+ setFlashlight(enabled: boolean): Promise<void>;
111
125
  }
112
126
 
113
127
  /**
@@ -188,6 +202,32 @@ export declare interface Configuration {
188
202
  feedback?: FeedbackConfiguration;
189
203
  }
190
204
 
205
+ /**
206
+ * Type for barcode detection handler.
207
+ *
208
+ * @remarks
209
+ * This handler is called synchronously when one or more barcodes are detected, so it should avoid performing any
210
+ * expensive operations. STRICH currently tries to detect a barcode as quickly as possible, it may occasionally
211
+ * return multiple detections simultaneously.
212
+ */
213
+ export declare type DetectionHandler = (detections: CodeDetection[]) => DetectionHandlerResult;
214
+
215
+ /**
216
+ * Result type for barcode detection handler.
217
+ *
218
+ * The handler can either return nothing (in versions prior to 1.12 this was the only option), or a boolean or array of
219
+ * booleans indicating whether the app handled the detections.
220
+ *
221
+ * Detections that are returned as unhandled (indicate by a `false` return value) will not be highlighted in the
222
+ * overlay, even if {@link OverlayConfiguration#showDetections} is set to true. No audio or vibration feedback will
223
+ * be emitted either.
224
+ *
225
+ * @remarks
226
+ * Returning `false` from the handler does not influence the usage in quota-based plans. All detections are always
227
+ * counted, regardless if they were handled or not.
228
+ */
229
+ export declare type DetectionHandlerResult = void | boolean | boolean[];
230
+
191
231
  /**
192
232
  * Engine configuration
193
233
  */
@@ -937,7 +977,7 @@ export declare class StrichSDK {
937
977
  *
938
978
  * For more information, please visit https://docs.strich.io/supported-symbologies.html
939
979
  */
940
- export declare type SymbologyName = 'ean13' | 'ean8' | 'upca' | 'upce' | 'databar' | 'databar-exp' | 'code39' | 'code93' | 'code128' | 'i25' | 'codabar' | 'qr' | 'aztec' | 'datamatrix' | 'pdf417';
980
+ export declare type SymbologyName = 'ean13' | 'ean8' | 'upca' | 'upce' | 'databar' | 'databar-exp' | 'code39' | 'code93' | 'code128' | 'i25' | 'codabar' | 'qr' | 'aztec' | 'datamatrix' | 'pdf417' | 'microqr';
941
981
 
942
982
  /**
943
983
  * For variable-length symbologies, min/max length can be specified in addition to the symbology.
@@ -1005,7 +1045,7 @@ export declare type SymbologySpec = {
1005
1045
  curved: boolean;
1006
1046
  } | {
1007
1047
  /** The name of the 2D symbology */
1008
- name: 'aztec' | 'datamatrix' | 'pdf417';
1048
+ name: 'aztec' | 'datamatrix' | 'pdf417' | 'microqr';
1009
1049
  };
1010
1050
 
1011
1051
  export { }