@ericblade/quagga2 1.7.7 → 1.8.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/quagga.js +5 -2
- package/dist/quagga.min.js +1 -1
- package/package.json +1 -1
- package/type-definitions/quagga.d.ts +70 -38
|
@@ -119,7 +119,7 @@ export interface BarcodeReaderConfig {
|
|
|
119
119
|
|
|
120
120
|
export enum BarcodeDirection {
|
|
121
121
|
Forward = 1,
|
|
122
|
-
Reverse = -1
|
|
122
|
+
Reverse = -1,
|
|
123
123
|
}
|
|
124
124
|
type BarcodeFormat = string;
|
|
125
125
|
|
|
@@ -129,11 +129,11 @@ export interface BarcodeCorrection {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
export interface BarcodePosition {
|
|
132
|
-
start: number;
|
|
133
|
-
startCounter?: number;
|
|
134
132
|
end: number;
|
|
135
133
|
endCounter?: number;
|
|
136
134
|
error?: number;
|
|
135
|
+
start: number;
|
|
136
|
+
startCounter?: number;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
export interface BarcodeInfo extends BarcodePosition {
|
|
@@ -156,18 +156,18 @@ export interface Barcode {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
export interface ThresholdSize {
|
|
159
|
-
size: number;
|
|
160
159
|
counts: number;
|
|
161
|
-
min: number;
|
|
162
160
|
max: number;
|
|
161
|
+
min: number;
|
|
162
|
+
size: number;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
export interface Threshold {
|
|
166
|
-
|
|
166
|
+
bar: {
|
|
167
167
|
narrow: ThresholdSize;
|
|
168
168
|
wide: ThresholdSize;
|
|
169
169
|
};
|
|
170
|
-
|
|
170
|
+
space: {
|
|
171
171
|
narrow: ThresholdSize;
|
|
172
172
|
wide: ThresholdSize;
|
|
173
173
|
};
|
|
@@ -176,14 +176,17 @@ export interface Threshold {
|
|
|
176
176
|
export declare module Readers {
|
|
177
177
|
export abstract class BarcodeReader {
|
|
178
178
|
_row: Array<number>;
|
|
179
|
+
|
|
179
180
|
SINGLE_CODE_ERROR: number;
|
|
181
|
+
|
|
180
182
|
FORMAT: BarcodeFormat;
|
|
183
|
+
|
|
181
184
|
CONFIG_KEYS: BarcodeReaderConfig;
|
|
182
185
|
|
|
183
186
|
static get Exception(): {
|
|
184
|
-
StartNotFoundException: string;
|
|
185
187
|
CodeNotFoundException: string;
|
|
186
188
|
PatternNotFoundException: string;
|
|
189
|
+
StartNotFoundException: string;
|
|
187
190
|
};
|
|
188
191
|
|
|
189
192
|
constructor(config: BarcodeReaderConfig, supplements?: Array<BarcodeReader>);
|
|
@@ -209,7 +212,9 @@ export declare module Readers {
|
|
|
209
212
|
|
|
210
213
|
export class TwoOfFiveReader extends BarcodeReader {
|
|
211
214
|
FORMAT: string;
|
|
215
|
+
|
|
212
216
|
SINGLE_CODE_ERROR: number;
|
|
217
|
+
|
|
213
218
|
AVG_CODE_ERROR: number;
|
|
214
219
|
|
|
215
220
|
decode(row?: Array<number>, start?: BarcodePosition): Barcode | null;
|
|
@@ -259,17 +264,29 @@ export declare module Readers {
|
|
|
259
264
|
|
|
260
265
|
export class Code128Reader extends BarcodeReader {
|
|
261
266
|
CODE_SHIFT: number;
|
|
267
|
+
|
|
262
268
|
CODE_C: number;
|
|
269
|
+
|
|
263
270
|
CODE_B: number;
|
|
271
|
+
|
|
264
272
|
CODE_A: number;
|
|
273
|
+
|
|
265
274
|
START_CODE_A: number;
|
|
275
|
+
|
|
266
276
|
START_CODE_B: number;
|
|
277
|
+
|
|
267
278
|
START_CODE_C: number;
|
|
279
|
+
|
|
268
280
|
STOP_CODE: number;
|
|
281
|
+
|
|
269
282
|
CODE_PATTERN: number[][];
|
|
283
|
+
|
|
270
284
|
SINGLE_CODE_ERROR: number;
|
|
285
|
+
|
|
271
286
|
AVG_CODE_ERROR: number;
|
|
287
|
+
|
|
272
288
|
FORMAT: string;
|
|
289
|
+
|
|
273
290
|
MODULE_INDICES: {
|
|
274
291
|
bar: number[];
|
|
275
292
|
space: number[];
|
|
@@ -288,16 +305,6 @@ export declare module Readers {
|
|
|
288
305
|
protected _verifyTrailingWhitespace(endInfo: BarcodeInfo): BarcodeInfo | null;
|
|
289
306
|
}
|
|
290
307
|
|
|
291
|
-
export class Code32Reader extends Code39Reader {
|
|
292
|
-
FORMAT: string;
|
|
293
|
-
|
|
294
|
-
decode(row?: Array<number>, start?: BarcodePosition): Barcode | null;
|
|
295
|
-
|
|
296
|
-
protected _decodeCode32(code: string): string | null;
|
|
297
|
-
|
|
298
|
-
protected _checkChecksum(code: string): boolean;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
308
|
export class Code39Reader extends BarcodeReader {
|
|
302
309
|
FORMAT: string;
|
|
303
310
|
|
|
@@ -314,6 +321,16 @@ export declare module Readers {
|
|
|
314
321
|
protected _verifyTrailingWhitespace(lastStart: number, nextStart: number, counters: Uint16Array): boolean;
|
|
315
322
|
}
|
|
316
323
|
|
|
324
|
+
export class Code32Reader extends Code39Reader {
|
|
325
|
+
FORMAT: string;
|
|
326
|
+
|
|
327
|
+
decode(row?: Array<number>, start?: BarcodePosition): Barcode | null;
|
|
328
|
+
|
|
329
|
+
protected _decodeCode32(code: string): string | null;
|
|
330
|
+
|
|
331
|
+
protected _checkChecksum(code: string): boolean;
|
|
332
|
+
}
|
|
333
|
+
|
|
317
334
|
export class Code39VINReader extends Code39Reader {
|
|
318
335
|
FORMAT: string;
|
|
319
336
|
|
|
@@ -342,24 +359,6 @@ export declare module Readers {
|
|
|
342
359
|
protected _verifyChecksums(charArray: Array<string>): boolean;
|
|
343
360
|
}
|
|
344
361
|
|
|
345
|
-
export class EAN2Reader extends EANReader {
|
|
346
|
-
FORMAT: string;
|
|
347
|
-
|
|
348
|
-
decode(row?: Array<number>, start?: number): Barcode | null;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
export class EAN5Reader extends EANReader {
|
|
352
|
-
FORMAT: string;
|
|
353
|
-
|
|
354
|
-
decode(row?: Array<number>, start?: number): Barcode | null;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
export class EAN8Reader extends EANReader {
|
|
358
|
-
FORMAT: string;
|
|
359
|
-
|
|
360
|
-
protected _decodePayload(inCode: BarcodePosition, result: Array<number>, decodedCodes: Array<BarcodePosition>): BarcodeInfo | null;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
362
|
export class EANReader extends BarcodeReader {
|
|
364
363
|
FORMAT: string;
|
|
365
364
|
SINGLE_CODE_ERROR: number;
|
|
@@ -384,13 +383,37 @@ export declare module Readers {
|
|
|
384
383
|
protected _checksum(result: Array<number>): boolean;
|
|
385
384
|
}
|
|
386
385
|
|
|
386
|
+
export class EAN2Reader extends EANReader {
|
|
387
|
+
FORMAT: string;
|
|
388
|
+
|
|
389
|
+
decode(row?: Array<number>, start?: number): Barcode | null;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export class EAN5Reader extends EANReader {
|
|
393
|
+
FORMAT: string;
|
|
394
|
+
|
|
395
|
+
decode(row?: Array<number>, start?: number): Barcode | null;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export class EAN8Reader extends EANReader {
|
|
399
|
+
FORMAT: string;
|
|
400
|
+
|
|
401
|
+
protected _decodePayload(inCode: BarcodePosition, result: Array<number>, decodedCodes: Array<BarcodePosition>): BarcodeInfo | null;
|
|
402
|
+
}
|
|
403
|
+
|
|
387
404
|
export class I2of5Reader extends BarcodeReader {
|
|
388
405
|
SINGLE_CODE_ERROR: number;
|
|
406
|
+
|
|
389
407
|
AVG_CODE_ERROR: number;
|
|
408
|
+
|
|
390
409
|
START_PATTERN: number[];
|
|
410
|
+
|
|
391
411
|
STOP_PATTERN: number[];
|
|
412
|
+
|
|
392
413
|
CODE_PATTERN: number[][];
|
|
414
|
+
|
|
393
415
|
MAX_CORRECTION_FACTOR: number;
|
|
416
|
+
|
|
394
417
|
FORMAT: string;
|
|
395
418
|
|
|
396
419
|
constructor(opts: BarcodeReaderConfig);
|
|
@@ -418,7 +441,9 @@ export declare module Readers {
|
|
|
418
441
|
|
|
419
442
|
export class UPCEReader extends EANReader {
|
|
420
443
|
CODE_FREQUENCY: number[][];
|
|
444
|
+
|
|
421
445
|
STOP_PATTERN: number[];
|
|
446
|
+
|
|
422
447
|
FORMAT: string;
|
|
423
448
|
|
|
424
449
|
protected _decodePayload(inCode: BarcodePosition, result: Array<number>, decodedCodes: Array<BarcodePosition>): BarcodeInfo | null;
|
|
@@ -768,6 +793,13 @@ export interface QuaggaJSConfigObject {
|
|
|
768
793
|
*/
|
|
769
794
|
type?: InputStreamType;
|
|
770
795
|
|
|
796
|
+
/**
|
|
797
|
+
* Use canvas.getContext('2d', { willReadFrequently: true }) for browser frame grabber operations
|
|
798
|
+
* @default false
|
|
799
|
+
* ... defaulting false because historically this wasn't an option, so i don't want to change behavior
|
|
800
|
+
*/
|
|
801
|
+
willReadFrequently?: boolean;
|
|
802
|
+
|
|
771
803
|
target?: Element | string;
|
|
772
804
|
|
|
773
805
|
constraints?: MediaTrackConstraints;
|
|
@@ -939,16 +971,16 @@ export interface QuaggaJSConfigObject {
|
|
|
939
971
|
}
|
|
940
972
|
|
|
941
973
|
export interface QuaggaJSReaderConfig {
|
|
942
|
-
format: string;
|
|
943
974
|
config: {
|
|
944
975
|
supplements: string[];
|
|
945
976
|
};
|
|
977
|
+
format: string;
|
|
946
978
|
}
|
|
947
979
|
|
|
948
980
|
export interface MediaTrackConstraintsWithDeprecated extends MediaTrackConstraints {
|
|
981
|
+
facing?: string;
|
|
949
982
|
maxAspectRatio?: number; // i don't see this in the documentation anywhere, but it's in the original test suite...
|
|
950
983
|
minAspectRatio?: number;
|
|
951
|
-
facing?: string;
|
|
952
984
|
}
|
|
953
985
|
|
|
954
986
|
export type TypedArrayConstructor =
|