Add barcode-detector-api-polyfill dependency and update environment variable declarations in SvelteKit project
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
import { DecodeHintType } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
import { IBrowserCodeReaderOptions } from './IBrowserCodeReaderOptions';
|
||||
/**
|
||||
* Aztec Code reader to use from browser.
|
||||
*
|
||||
* @class BrowserAztecCodeReader
|
||||
* @extends {BrowserCodeReader}
|
||||
*/
|
||||
export declare class BrowserAztecCodeReader extends BrowserCodeReader {
|
||||
/**
|
||||
* Creates an instance of BrowserAztecCodeReader.
|
||||
*/
|
||||
constructor(hints?: Map<DecodeHintType, any>, options?: IBrowserCodeReaderOptions);
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import { AztecCodeReader } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
/**
|
||||
* Aztec Code reader to use from browser.
|
||||
*
|
||||
* @class BrowserAztecCodeReader
|
||||
* @extends {BrowserCodeReader}
|
||||
*/
|
||||
var BrowserAztecCodeReader = /** @class */ (function (_super) {
|
||||
__extends(BrowserAztecCodeReader, _super);
|
||||
/**
|
||||
* Creates an instance of BrowserAztecCodeReader.
|
||||
*/
|
||||
function BrowserAztecCodeReader(hints, options) {
|
||||
return _super.call(this, new AztecCodeReader(), hints, options) || this;
|
||||
}
|
||||
return BrowserAztecCodeReader;
|
||||
}(BrowserCodeReader));
|
||||
export { BrowserAztecCodeReader };
|
||||
//# sourceMappingURL=BrowserAztecCodeReader.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BrowserAztecCodeReader.js","sourceRoot":"","sources":["../../../src/readers/BrowserAztecCodeReader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;;;;GAKG;AACH;IAA4C,0CAAiB;IAC3D;;OAEG;IACH,gCACE,KAAgC,EAChC,OAAmC;eAEnC,kBAAM,IAAI,eAAe,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC;IAC9C,CAAC;IACH,6BAAC;AAAD,CAAC,AAVD,CAA4C,iBAAiB,GAU5D"}
|
||||
+283
@@ -0,0 +1,283 @@
|
||||
import { BarcodeFormat, BinaryBitmap, DecodeHintType, Reader, Result } from '@zxing/library';
|
||||
import { DecodeContinuouslyCallback } from '../common/DecodeContinuouslyCallback';
|
||||
import { HTMLVisualMediaElement } from '../common/HTMLVisualMediaElement';
|
||||
import { IScannerControls } from '../common/IScannerControls';
|
||||
import { IBrowserCodeReaderOptions } from './IBrowserCodeReaderOptions';
|
||||
/**
|
||||
* Base class for browser code reader.
|
||||
*/
|
||||
export declare class BrowserCodeReader {
|
||||
protected readonly reader: Reader;
|
||||
hints: Map<DecodeHintType, any>;
|
||||
/**
|
||||
* Allows to change the possible formats the decoder should
|
||||
* search for while scanning some image. Useful for changing
|
||||
* the possible formats during BrowserCodeReader::scan.
|
||||
*/
|
||||
set possibleFormats(formats: BarcodeFormat[]);
|
||||
/**
|
||||
* Defines what the videoElement src will be.
|
||||
*
|
||||
* @param videoElement
|
||||
* @param stream The stream to be added as a source.
|
||||
*/
|
||||
static addVideoSource(videoElement: HTMLVideoElement, stream: MediaStream): void;
|
||||
/**
|
||||
* Enables or disables the torch in a media stream.
|
||||
*
|
||||
* @experimental This doesn't work across all browsers and is still a Draft.
|
||||
*/
|
||||
static mediaStreamSetTorch(track: MediaStreamTrack, onOff: boolean): Promise<void>;
|
||||
/**
|
||||
* Checks if the stream has torch support.
|
||||
*/
|
||||
static mediaStreamIsTorchCompatible(params: MediaStream): boolean;
|
||||
/**
|
||||
*
|
||||
* @param track The media stream track that will be checked for compatibility.
|
||||
*/
|
||||
static mediaStreamIsTorchCompatibleTrack(track: MediaStreamTrack): boolean;
|
||||
/**
|
||||
* Checks if the given video element is currently playing.
|
||||
*/
|
||||
static isVideoPlaying(video: HTMLVideoElement): boolean;
|
||||
/**
|
||||
* Searches and validates a media element.
|
||||
*/
|
||||
static getMediaElement(mediaElementId: string, type: string): HTMLVisualMediaElement;
|
||||
/**
|
||||
* Receives a source and makes sure to return a Video Element from it or fail.
|
||||
*/
|
||||
static createVideoElement(videoThingy?: HTMLVideoElement | string): HTMLVideoElement;
|
||||
/**
|
||||
* Receives a source and makes sure to return an Image Element from it or fail.
|
||||
*/
|
||||
static prepareImageElement(imageSource?: HTMLImageElement | string): HTMLImageElement;
|
||||
/**
|
||||
* Sets a HTMLVideoElement for scanning or creates a new one.
|
||||
*
|
||||
* @param videoElem The HTMLVideoElement to be set.
|
||||
*/
|
||||
static prepareVideoElement(videoElem?: HTMLVideoElement | string): HTMLVideoElement;
|
||||
/**
|
||||
* Checks if and HTML image is loaded.
|
||||
*/
|
||||
static isImageLoaded(img: HTMLImageElement): boolean;
|
||||
/**
|
||||
* Creates a binaryBitmap based in a canvas.
|
||||
*
|
||||
* @param canvas HTML canvas element containing the image source draw.
|
||||
*/
|
||||
static createBinaryBitmapFromCanvas(canvas: HTMLCanvasElement): BinaryBitmap;
|
||||
/**
|
||||
* Overwriting this allows you to manipulate the snapshot image in anyway you want before decode.
|
||||
*/
|
||||
static drawImageOnCanvas(canvasElementContext: CanvasRenderingContext2D, srcElement: HTMLVisualMediaElement): void;
|
||||
static getMediaElementDimensions(mediaElement: HTMLVisualMediaElement): {
|
||||
height: number;
|
||||
width: number;
|
||||
};
|
||||
/**
|
||||
* 🖌 Prepares the canvas for capture and scan frames.
|
||||
*/
|
||||
static createCaptureCanvas(mediaElement: HTMLVisualMediaElement): HTMLCanvasElement;
|
||||
/**
|
||||
* Just tries to play the video and logs any errors.
|
||||
* The play call is only made is the video is not already playing.
|
||||
*/
|
||||
static tryPlayVideo(videoElement: HTMLVideoElement): Promise<boolean>;
|
||||
/**
|
||||
* Creates a canvas and draws the current image frame from the media element on it.
|
||||
*
|
||||
* @param mediaElement HTML media element to extract an image frame from.
|
||||
*/
|
||||
static createCanvasFromMediaElement(mediaElement: HTMLVisualMediaElement): HTMLCanvasElement;
|
||||
/**
|
||||
* Creates a binaryBitmap based in some image source.
|
||||
*
|
||||
* @param mediaElement HTML element containing drawable image source.
|
||||
*/
|
||||
static createBinaryBitmapFromMediaElem(mediaElement: HTMLVisualMediaElement): BinaryBitmap;
|
||||
static destroyImageElement(imageElement: HTMLImageElement): void;
|
||||
/**
|
||||
* Lists all the available video input devices.
|
||||
*/
|
||||
static listVideoInputDevices(): Promise<MediaDeviceInfo[]>;
|
||||
/**
|
||||
* Let's you find a device using it's Id.
|
||||
*/
|
||||
static findDeviceById(deviceId: string): Promise<MediaDeviceInfo | undefined>;
|
||||
/**
|
||||
* Unbinds a HTML video src property.
|
||||
*/
|
||||
static cleanVideoSource(videoElement: HTMLVideoElement): void;
|
||||
/**
|
||||
* Stops all media streams that are created.
|
||||
*/
|
||||
static releaseAllStreams(): void;
|
||||
/**
|
||||
* Waits for a video to load and then hits play on it.
|
||||
* To accomplish that, it binds listeners and callbacks to the video element.
|
||||
*
|
||||
* @param element The video element.
|
||||
* @param callbackFn Callback invoked when the video is played.
|
||||
*/
|
||||
protected static playVideoOnLoadAsync(element: HTMLVideoElement, timeout: number): Promise<boolean>;
|
||||
/**
|
||||
* Sets the new stream and request a new decoding-with-delay.
|
||||
*
|
||||
* @param stream The stream to be shown in the video element.
|
||||
* @param decodeFn A callback for the decode method.
|
||||
*/
|
||||
protected static attachStreamToVideo(stream: MediaStream, preview?: string | HTMLVideoElement, previewPlayTimeout?: number): Promise<HTMLVideoElement>;
|
||||
/**
|
||||
* Keeps track to created media streams.
|
||||
* @private there is no need this array to be accessible from outside.
|
||||
*/
|
||||
private static streamTracker;
|
||||
/**
|
||||
* Returns a Promise that resolves when the given image element loads.
|
||||
*/
|
||||
private static _waitImageLoad;
|
||||
/**
|
||||
* Checks if the `callbackFn` is defined, otherwise throws.
|
||||
*/
|
||||
private static checkCallbackFnOrThrow;
|
||||
/**
|
||||
* Standard method to dispose a media stream object.
|
||||
*/
|
||||
private static disposeMediaStream;
|
||||
/**
|
||||
* BrowserCodeReader specific configuration options.
|
||||
*/
|
||||
protected readonly options: IBrowserCodeReaderOptions;
|
||||
/**
|
||||
* Creates an instance of BrowserCodeReader.
|
||||
* @param {Reader} reader The reader instance to decode the barcode
|
||||
* @param hints Holds the hints the user sets for the Reader.
|
||||
*/
|
||||
constructor(reader: Reader, hints?: Map<DecodeHintType, any>, options?: IBrowserCodeReaderOptions);
|
||||
/**
|
||||
* Gets the BinaryBitmap for ya! (and decodes it)
|
||||
*/
|
||||
decode(element: HTMLVisualMediaElement): Result;
|
||||
/**
|
||||
* Call the encapsulated readers decode
|
||||
*/
|
||||
decodeBitmap(binaryBitmap: BinaryBitmap): Result;
|
||||
/**
|
||||
* Decodes some barcode from a canvas!
|
||||
*/
|
||||
decodeFromCanvas(canvas: HTMLCanvasElement): Result;
|
||||
/**
|
||||
* Decodes something from an image HTML element.
|
||||
*/
|
||||
decodeFromImageElement(source: string | HTMLImageElement): Promise<Result>;
|
||||
/**
|
||||
* Decodes an image from a URL.
|
||||
*/
|
||||
decodeFromImageUrl(url?: string): Promise<Result>;
|
||||
/**
|
||||
* Continuously tries to decode the barcode from a stream obtained from the given constraints
|
||||
* while showing the video in the specified video element.
|
||||
*
|
||||
* @param {MediaStream} [constraints] the media stream constraints to get s valid media stream to decode from
|
||||
* @param {string|HTMLVideoElement} [previewElem] the video element in page where to show the video while
|
||||
* decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined, in
|
||||
* which case no video will be shown.
|
||||
*/
|
||||
decodeFromConstraints(constraints: MediaStreamConstraints, previewElem: string | HTMLVideoElement | undefined, callbackFn: DecodeContinuouslyCallback): Promise<IScannerControls>;
|
||||
/**
|
||||
* In one attempt, tries to decode the barcode from a stream obtained from the given constraints
|
||||
* while showing the video in the specified video element.
|
||||
*
|
||||
* @param {MediaStream} [constraints] the media stream constraints to get s valid media stream to decode from
|
||||
* @param {string|HTMLVideoElement} [preview] the video element in page where to show the video
|
||||
* while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined,
|
||||
* in which case no video will be shown.
|
||||
*/
|
||||
decodeFromStream(stream: MediaStream, preview: string | HTMLVideoElement | undefined, callbackFn: DecodeContinuouslyCallback): Promise<IScannerControls>;
|
||||
/**
|
||||
* Continuously tries to decode the barcode from the device specified by device while showing
|
||||
* the video in the specified video element.
|
||||
*
|
||||
* @param {string|null} [deviceId] the id of one of the devices obtained after calling
|
||||
* getVideoInputDevices. Can be undefined, in this case it will decode from one of the
|
||||
* available devices, preferring the main camera (environment facing) if available.
|
||||
* @param {string|HTMLVideoElement|null} [video] the video element in page where to show the video
|
||||
* while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined,
|
||||
* in which case no video will be shown.
|
||||
*/
|
||||
decodeFromVideoDevice(deviceId: string | undefined, previewElem: string | HTMLVideoElement | undefined, callbackFn: DecodeContinuouslyCallback): Promise<IScannerControls>;
|
||||
/**
|
||||
* Decodes something from an image HTML element.
|
||||
*/
|
||||
decodeFromVideoElement(source: string | HTMLVideoElement, callbackFn: DecodeContinuouslyCallback): Promise<IScannerControls>;
|
||||
/**
|
||||
* Decodes a video from a URL until it ends.
|
||||
*/
|
||||
decodeFromVideoUrl(url: string, callbackFn: DecodeContinuouslyCallback): Promise<IScannerControls>;
|
||||
/**
|
||||
* In one attempt, tries to decode the barcode from a stream obtained from the given
|
||||
* constraints while showing the video in the specified video element.
|
||||
*
|
||||
* @param constraints the media stream constraints to get s valid media stream to decode from
|
||||
* @param videoSource the video element in page where to show the video while decoding.
|
||||
* Can be either an element id or directly an HTMLVideoElement. Can be undefined,
|
||||
* in which case no video will be shown.
|
||||
* The decoding result.
|
||||
*/
|
||||
decodeOnceFromConstraints(constraints: MediaStreamConstraints, videoSource?: string | HTMLVideoElement): Promise<Result>;
|
||||
/**
|
||||
* In one attempt, tries to decode the barcode from a stream obtained from the given
|
||||
* constraints while showing the video in the specified video element.
|
||||
*
|
||||
* @param {MediaStream} [constraints] the media stream constraints to get s valid media stream to decode from
|
||||
* @param {string|HTMLVideoElement} [video] the video element in page where to show the video while decoding.
|
||||
* Can be either an element id or directly an HTMLVideoElement. Can be undefined,
|
||||
* in which case no video will be shown.
|
||||
*/
|
||||
decodeOnceFromStream(stream: MediaStream, preview?: string | HTMLVideoElement): Promise<Result>;
|
||||
/**
|
||||
* In one attempt, tries to decode the barcode from the device specified by deviceId
|
||||
* while showing the video in the specified video element.
|
||||
*
|
||||
* @param deviceId the id of one of the devices obtained after calling getVideoInputDevices.
|
||||
* Can be undefined, in this case it will decode from one of the available devices,
|
||||
* preferring the main camera (environment facing) if available.
|
||||
* @param videoSource the video element in page where to show the video while decoding.
|
||||
* Can be either an element id or directly an HTMLVideoElement. Can be undefined,
|
||||
* in which case no video will be shown.
|
||||
*/
|
||||
decodeOnceFromVideoDevice(deviceId?: string, videoSource?: string | HTMLVideoElement): Promise<Result>;
|
||||
/**
|
||||
* Decodes something from an image HTML element.
|
||||
*/
|
||||
decodeOnceFromVideoElement(source: string | HTMLVideoElement): Promise<Result>;
|
||||
/**
|
||||
* Decodes a video from a URL.
|
||||
*/
|
||||
decodeOnceFromVideoUrl(url: string): Promise<Result>;
|
||||
/**
|
||||
* Tries to decode from the video input until it finds some value.
|
||||
*/
|
||||
scanOneResult(element: HTMLVisualMediaElement, retryIfNotFound?: boolean, retryIfChecksumError?: boolean, retryIfFormatError?: boolean): Promise<Result>;
|
||||
/**
|
||||
* Continuously decodes from video input.
|
||||
*
|
||||
* @param element HTML element to scan/decode from. It will not be disposed or destroyed.
|
||||
* @param callbackFn Called after every scan attempt, being it successful or errored.
|
||||
* @param finalizeCallback Called after scan process reaches the end or stop is called.
|
||||
*/
|
||||
scan(element: HTMLVisualMediaElement, callbackFn: DecodeContinuouslyCallback, finalizeCallback?: (error?: Error) => void): IScannerControls;
|
||||
/**
|
||||
* Waits for the image to load and then tries to decode it.
|
||||
*/
|
||||
private _decodeOnLoadImage;
|
||||
/**
|
||||
* Get MediaStream from browser to be used.
|
||||
* @param constraints constraints the media stream constraints to get s valid media stream to decode from.
|
||||
* @private For private use.
|
||||
*/
|
||||
private getUserMedia;
|
||||
}
|
||||
+1200
File diff suppressed because it is too large
Load Diff
+1
File diff suppressed because one or more lines are too long
+12
@@ -0,0 +1,12 @@
|
||||
import { DecodeHintType } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
import { IBrowserCodeReaderOptions } from './IBrowserCodeReaderOptions';
|
||||
/**
|
||||
* QR Code reader to use from browser.
|
||||
*/
|
||||
export declare class BrowserDatamatrixCodeReader extends BrowserCodeReader {
|
||||
/**
|
||||
* Creates an instance of BrowserQRCodeReader.
|
||||
*/
|
||||
constructor(hints?: Map<DecodeHintType, any>, options?: IBrowserCodeReaderOptions);
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import { DataMatrixReader } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
/**
|
||||
* QR Code reader to use from browser.
|
||||
*/
|
||||
var BrowserDatamatrixCodeReader = /** @class */ (function (_super) {
|
||||
__extends(BrowserDatamatrixCodeReader, _super);
|
||||
/**
|
||||
* Creates an instance of BrowserQRCodeReader.
|
||||
*/
|
||||
function BrowserDatamatrixCodeReader(hints, options) {
|
||||
return _super.call(this, new DataMatrixReader(), hints, options) || this;
|
||||
}
|
||||
return BrowserDatamatrixCodeReader;
|
||||
}(BrowserCodeReader));
|
||||
export { BrowserDatamatrixCodeReader };
|
||||
//# sourceMappingURL=BrowserDatamatrixCodeReader.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BrowserDatamatrixCodeReader.js","sourceRoot":"","sources":["../../../src/readers/BrowserDatamatrixCodeReader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAkB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;GAEG;AACH;IAAiD,+CAAiB;IAChE;;OAEG;IACH,qCACE,KAAgC,EAChC,OAAmC;eAEnC,kBAAM,IAAI,gBAAgB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC;IAC/C,CAAC;IACH,kCAAC;AAAD,CAAC,AAVD,CAAiD,iBAAiB,GAUjE"}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
import { DecodeHintType } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
import { IBrowserCodeReaderOptions } from './IBrowserCodeReaderOptions';
|
||||
/**
|
||||
* Reader to be used for any One Dimension type barcode.
|
||||
*/
|
||||
export declare class BrowserMultiFormatOneDReader extends BrowserCodeReader {
|
||||
/**
|
||||
* Creates an instance of BrowserBarcodeReader.
|
||||
* @param {Map<DecodeHintType, any>} hints?
|
||||
* @param options
|
||||
*/
|
||||
constructor(hints?: Map<DecodeHintType, any>, options?: IBrowserCodeReaderOptions);
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import { MultiFormatOneDReader } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
/**
|
||||
* Reader to be used for any One Dimension type barcode.
|
||||
*/
|
||||
var BrowserMultiFormatOneDReader = /** @class */ (function (_super) {
|
||||
__extends(BrowserMultiFormatOneDReader, _super);
|
||||
/**
|
||||
* Creates an instance of BrowserBarcodeReader.
|
||||
* @param {Map<DecodeHintType, any>} hints?
|
||||
* @param options
|
||||
*/
|
||||
function BrowserMultiFormatOneDReader(hints, options) {
|
||||
return _super.call(this, new MultiFormatOneDReader(hints), hints, options) || this;
|
||||
}
|
||||
return BrowserMultiFormatOneDReader;
|
||||
}(BrowserCodeReader));
|
||||
export { BrowserMultiFormatOneDReader };
|
||||
//# sourceMappingURL=BrowserMultiFormatOneDReader.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BrowserMultiFormatOneDReader.js","sourceRoot":"","sources":["../../../src/readers/BrowserMultiFormatOneDReader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAkB,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;GAEG;AACH;IAAkD,gDAAiB;IACjE;;;;OAIG;IACH,sCAAmB,KAAgC,EAAE,OAAmC;eACtF,kBAAM,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC;IACzD,CAAC;IACH,mCAAC;AAAD,CAAC,AATD,CAAkD,iBAAiB,GASlE"}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import { BarcodeFormat, BinaryBitmap, DecodeHintType, MultiFormatReader, Result } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
import { IBrowserCodeReaderOptions } from './IBrowserCodeReaderOptions';
|
||||
export declare class BrowserMultiFormatReader extends BrowserCodeReader {
|
||||
set possibleFormats(formats: BarcodeFormat[]);
|
||||
protected readonly reader: MultiFormatReader;
|
||||
constructor(hints?: Map<DecodeHintType, any>, options?: IBrowserCodeReaderOptions);
|
||||
/**
|
||||
* Overwrite decodeBitmap to call decodeWithState, which will pay
|
||||
* attention to the hints set in the constructor function
|
||||
*/
|
||||
decodeBitmap(binaryBitmap: BinaryBitmap): Result;
|
||||
/**
|
||||
* Allows to change hints in runtime.
|
||||
*/
|
||||
setHints(hints: Map<DecodeHintType, any>): void;
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import { DecodeHintType, MultiFormatReader, } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
var BrowserMultiFormatReader = /** @class */ (function (_super) {
|
||||
__extends(BrowserMultiFormatReader, _super);
|
||||
function BrowserMultiFormatReader(hints, options) {
|
||||
var _this = this;
|
||||
var reader = new MultiFormatReader();
|
||||
reader.setHints(hints);
|
||||
_this = _super.call(this, reader, hints, options) || this;
|
||||
_this.reader = reader;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(BrowserMultiFormatReader.prototype, "possibleFormats", {
|
||||
set: function (formats) {
|
||||
this.hints.set(DecodeHintType.POSSIBLE_FORMATS, formats);
|
||||
this.reader.setHints(this.hints);
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
/**
|
||||
* Overwrite decodeBitmap to call decodeWithState, which will pay
|
||||
* attention to the hints set in the constructor function
|
||||
*/
|
||||
BrowserMultiFormatReader.prototype.decodeBitmap = function (binaryBitmap) {
|
||||
return this.reader.decodeWithState(binaryBitmap);
|
||||
};
|
||||
/**
|
||||
* Allows to change hints in runtime.
|
||||
*/
|
||||
BrowserMultiFormatReader.prototype.setHints = function (hints) {
|
||||
this.hints = hints;
|
||||
this.reader.setHints(this.hints);
|
||||
};
|
||||
return BrowserMultiFormatReader;
|
||||
}(BrowserCodeReader));
|
||||
export { BrowserMultiFormatReader };
|
||||
//# sourceMappingURL=BrowserMultiFormatReader.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BrowserMultiFormatReader.js","sourceRoot":"","sources":["../../../src/readers/BrowserMultiFormatReader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAGL,cAAc,EACd,iBAAiB,GAElB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD;IAA8C,4CAAiB;IAS7D,kCACE,KAAgC,EAChC,OAAmC;QAFrC,iBAQC;QAJC,IAAM,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAC;QACvC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACvB,QAAA,kBAAM,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,SAAC;QAC9B,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;IACvB,CAAC;IAfD,sBAAI,qDAAe;aAAnB,UAAoB,OAAwB;YAC1C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;YACzD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;;;OAAA;IAcD;;;OAGG;IACI,+CAAY,GAAnB,UAAoB,YAA0B;QAC5C,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACI,2CAAQ,GAAf,UAAgB,KAA+B;QAC7C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IACH,+BAAC;AAAD,CAAC,AAlCD,CAA8C,iBAAiB,GAkC9D"}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { DecodeHintType } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
import { IBrowserCodeReaderOptions } from './IBrowserCodeReaderOptions';
|
||||
/**
|
||||
* QR Code reader to use from browser.
|
||||
*/
|
||||
export declare class BrowserPDF417Reader extends BrowserCodeReader {
|
||||
/**
|
||||
* Creates an instance of BrowserPDF417Reader.
|
||||
*/
|
||||
constructor(hints?: Map<DecodeHintType, any>, options?: IBrowserCodeReaderOptions);
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import { PDF417Reader } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
/**
|
||||
* QR Code reader to use from browser.
|
||||
*/
|
||||
var BrowserPDF417Reader = /** @class */ (function (_super) {
|
||||
__extends(BrowserPDF417Reader, _super);
|
||||
/**
|
||||
* Creates an instance of BrowserPDF417Reader.
|
||||
*/
|
||||
function BrowserPDF417Reader(hints, options) {
|
||||
return _super.call(this, new PDF417Reader(), hints, options) || this;
|
||||
}
|
||||
return BrowserPDF417Reader;
|
||||
}(BrowserCodeReader));
|
||||
export { BrowserPDF417Reader };
|
||||
//# sourceMappingURL=BrowserPDF417Reader.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BrowserPDF417Reader.js","sourceRoot":"","sources":["../../../src/readers/BrowserPDF417Reader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;GAEG;AACH;IAAyC,uCAAiB;IACxD;;OAEG;IACH,6BACE,KAAgC,EAChC,OAAmC;eAEnC,kBAAM,IAAI,YAAY,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC;IAC3C,CAAC;IACH,0BAAC;AAAD,CAAC,AAVD,CAAyC,iBAAiB,GAUzD"}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { DecodeHintType } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
import { IBrowserCodeReaderOptions } from './IBrowserCodeReaderOptions';
|
||||
/**
|
||||
* QR Code reader to use from browser.
|
||||
*/
|
||||
export declare class BrowserQRCodeReader extends BrowserCodeReader {
|
||||
/**
|
||||
* Creates an instance of BrowserQRCodeReader.
|
||||
*/
|
||||
constructor(hints?: Map<DecodeHintType, any>, options?: IBrowserCodeReaderOptions);
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import { QRCodeReader } from '@zxing/library';
|
||||
import { BrowserCodeReader } from './BrowserCodeReader';
|
||||
/**
|
||||
* QR Code reader to use from browser.
|
||||
*/
|
||||
var BrowserQRCodeReader = /** @class */ (function (_super) {
|
||||
__extends(BrowserQRCodeReader, _super);
|
||||
/**
|
||||
* Creates an instance of BrowserQRCodeReader.
|
||||
*/
|
||||
function BrowserQRCodeReader(hints, options) {
|
||||
return _super.call(this, new QRCodeReader(), hints, options) || this;
|
||||
}
|
||||
return BrowserQRCodeReader;
|
||||
}(BrowserCodeReader));
|
||||
export { BrowserQRCodeReader };
|
||||
//# sourceMappingURL=BrowserQRCodeReader.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BrowserQRCodeReader.js","sourceRoot":"","sources":["../../../src/readers/BrowserQRCodeReader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;GAEG;AACH;IAAyC,uCAAiB;IACxD;;OAEG;IACH,6BACE,KAAgC,EAChC,OAAmC;eAEnC,kBAAM,IAAI,YAAY,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC;IAC3C,CAAC;IACH,0BAAC;AAAD,CAAC,AAVD,CAAyC,iBAAiB,GAUzD"}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
export interface IBrowserCodeReaderOptions {
|
||||
/** Delay time between subsequent successful decode results. */
|
||||
delayBetweenScanSuccess?: number;
|
||||
/** Delay time between decode attempts made by the scanner. */
|
||||
delayBetweenScanAttempts?: number;
|
||||
/** Timeout for waiting the video 'canplay' event. */
|
||||
tryPlayVideoTimeout?: number;
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=IBrowserCodeReaderOptions.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IBrowserCodeReaderOptions.js","sourceRoot":"","sources":["../../../src/readers/IBrowserCodeReaderOptions.ts"],"names":[],"mappings":""}
|
||||
Reference in New Issue
Block a user