Add barcode-detector-api-polyfill dependency and update environment variable declarations in SvelteKit project
CI / build (push) Has been skipped
CI / deploy (push) Successful in 1m50s

This commit is contained in:
eewing
2026-02-17 14:58:53 -06:00
parent cff20a652a
commit 9022114c8d
2137 changed files with 201996 additions and 762 deletions
+29
View File
@@ -0,0 +1,29 @@
import { DecodeHintType, MultiFormatReader, } from '@zxing/library';
import { BrowserCodeReader } from './BrowserCodeReader';
export class BrowserMultiFormatReader extends BrowserCodeReader {
constructor(hints, options) {
const reader = new MultiFormatReader();
reader.setHints(hints);
super(reader, hints, options);
this.reader = reader;
}
set possibleFormats(formats) {
this.hints.set(DecodeHintType.POSSIBLE_FORMATS, formats);
this.reader.setHints(this.hints);
}
/**
* Overwrite decodeBitmap to call decodeWithState, which will pay
* attention to the hints set in the constructor function
*/
decodeBitmap(binaryBitmap) {
return this.reader.decodeWithState(binaryBitmap);
}
/**
* Allows to change hints in runtime.
*/
setHints(hints) {
this.hints = hints;
this.reader.setHints(this.hints);
}
}
//# sourceMappingURL=BrowserMultiFormatReader.js.map