@gueshbzh-perso/scanner 0.9.0 → 0.10.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/src/types.ts CHANGED
@@ -118,6 +118,17 @@ export interface ProcessingOptions {
118
118
  maxDimension?: number;
119
119
  /** Frame pipeline. `'auto'` uses WebGL2 and falls back to Canvas 2D. Default: `'auto'`. */
120
120
  backend?: 'auto' | 'webgl' | 'canvas';
121
+ /**
122
+ * Use the browser's native `BarcodeDetector` (Chrome on Android, macOS and
123
+ * ChromeOS) as the fast pass, when it supports every requested format
124
+ * (`micro_qr` excepted). The engine's fallback strategies keep running on
125
+ * the frames it finds nothing in: hard codes (laser engraving, shadows…)
126
+ * are still read. Codes get the same confirmation and de-duplication.
127
+ * It reads codes whatever their orientation. Elsewhere (Safari, Firefox,
128
+ * Chrome on Windows / Linux), or if it fails, the engine does everything.
129
+ * `'off'`: always the engine alone. Default: `'auto'`.
130
+ */
131
+ nativeDetector?: 'auto' | 'off';
121
132
  }
122
133
 
123
134
  export interface ReaderOptions extends EngineOptions, AssetOptions {
@@ -152,6 +163,10 @@ export interface ReaderStats {
152
163
  worker: boolean;
153
164
  /** Frames decoded in parallel (number of workers, `1` on the main thread). */
154
165
  workers: number;
166
+ /** `true` when the native `BarcodeDetector` does the fast pass (see `processing.nativeDetector`). */
167
+ native: boolean;
168
+ /** Average native detection time, in ms (`0` when not used). */
169
+ nativeMs: number;
155
170
  }
156
171
 
157
172
  export interface ReaderEvents {