@scandit/web-datacapture-barcode
Version:
Scandit Data Capture SDK for the Web
27 lines • 1.26 kB
TypeScript
import { t as Barcode } from "./Barcode-DNvaiOyn.js";
//#region src/main/ar/BarcodeArFilter.d.ts
/**
* Selects which of the currently visible barcodes MatrixScan AR presents.
*
* `filterBarcodes` runs on the recognition thread inside the SDK worker and must return quickly.
*
* The implementation is transferred to the worker as source code, so it must be a pure function:
* it cannot reference variables from the surrounding scope, and globals such as `window`,
* `console`, `fetch` and `self` are unavailable. Values the filter needs have to be written into
* the function body itself, and `setBarcodeFilter` called again whenever they change.
*
* Running in the worker is also why this returns barcodes directly rather than a promise: the
* engine calls it synchronously while processing a frame and cannot await a result.
*
* A filter that throws, or that returns anything other than an array, leaves all barcodes visible
* for that evaluation.
*/
interface BarcodeArFilter {
/**
* Returns the subset of `barcodes` to keep. Barcodes that are not elements of `barcodes` are
* ignored; returning an empty array hides all of them.
*/
filterBarcodes(barcodes: Barcode[]): Barcode[];
}
//#endregion
export { BarcodeArFilter as t };