rxing-wasm 0.2.9 → 0.2.11
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/package.json +1 -1
- package/rxing_wasm.d.ts +96 -96
- package/rxing_wasm_bg.js +95 -95
- package/rxing_wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/rxing_wasm.d.ts
CHANGED
|
@@ -70,6 +70,102 @@ export function decode_barcode_with_hints(data: Uint8Array, width: number, heigh
|
|
|
70
70
|
export function decode_multi(data: Uint8Array, width: number, height: number, hints: DecodeHintDictionary): MultiDecodeResult;
|
|
71
71
|
/**
|
|
72
72
|
*/
|
|
73
|
+
export enum DecodeHintTypes {
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* * Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
79
|
+
Other = 0,
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* * Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
|
|
83
|
+
* * use {@link Boolean#TRUE}.
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
PureBarcode = 1,
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* * Image is known to be of one of a few possible formats.
|
|
90
|
+
* * Maps to a {@link List} of {@link BarcodeFormat}s.
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
PossibleFormats = 2,
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* * Spend more time to try to find a barcode; optimize for accuracy, not speed.
|
|
97
|
+
* * Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
98
|
+
*
|
|
99
|
+
*/
|
|
100
|
+
TryHarder = 3,
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* * Specifies what character encoding to use when decoding, where applicable (type String)
|
|
104
|
+
*
|
|
105
|
+
*/
|
|
106
|
+
CharacterSet = 4,
|
|
107
|
+
/**
|
|
108
|
+
*
|
|
109
|
+
* * Allowed lengths of encoded data -- reject anything else. Maps to an {@code int[]}.
|
|
110
|
+
*
|
|
111
|
+
*/
|
|
112
|
+
AllowedLengths = 5,
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* * Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;
|
|
116
|
+
* * use {@link Boolean#TRUE}.
|
|
117
|
+
*
|
|
118
|
+
*/
|
|
119
|
+
AssumeCode39CheckDigit = 6,
|
|
120
|
+
/**
|
|
121
|
+
*
|
|
122
|
+
* * Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.
|
|
123
|
+
* * For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to;
|
|
124
|
+
* * use {@link Boolean#TRUE}.
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
AssumeGs1 = 7,
|
|
128
|
+
/**
|
|
129
|
+
*
|
|
130
|
+
* * If true, return the start and end digits in a Codabar barcode instead of stripping them. They
|
|
131
|
+
* * are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them
|
|
132
|
+
* * to not be. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
133
|
+
*
|
|
134
|
+
*/
|
|
135
|
+
ReturnCodabarStartEnd = 8,
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* * The caller needs to be notified via callback when a possible {@link RXingResultPoint}
|
|
139
|
+
* * is found. Maps to a {@link RXingResultPointCallback}.
|
|
140
|
+
*
|
|
141
|
+
*/
|
|
142
|
+
NeedResultPointCallback = 9,
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* * Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
|
|
146
|
+
* * Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5].
|
|
147
|
+
* * If it is optional to have an extension, do not set this hint. If this is set,
|
|
148
|
+
* * and a UPC or EAN barcode is found but an extension is not, then no result will be returned
|
|
149
|
+
* * at all.
|
|
150
|
+
*
|
|
151
|
+
*/
|
|
152
|
+
AllowedEanExtensions = 10,
|
|
153
|
+
/**
|
|
154
|
+
*
|
|
155
|
+
* * If true, also tries to decode as inverted image. All configured decoders are simply called a
|
|
156
|
+
* * second time with an inverted image. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
157
|
+
*
|
|
158
|
+
*/
|
|
159
|
+
AlsoInverted = 11,
|
|
160
|
+
/**
|
|
161
|
+
*
|
|
162
|
+
* * Translate the ASCII values parsed by the Telepen reader into the Telepen Numeric form; use {@link Boolean#TRUE}.
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
165
|
+
TelepenAsNumeric = 12,
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
*/
|
|
73
169
|
export enum EncodeHintTypes {
|
|
74
170
|
/**
|
|
75
171
|
*
|
|
@@ -319,102 +415,6 @@ export enum BarcodeFormat {
|
|
|
319
415
|
}
|
|
320
416
|
/**
|
|
321
417
|
*/
|
|
322
|
-
export enum DecodeHintTypes {
|
|
323
|
-
/**
|
|
324
|
-
*
|
|
325
|
-
* * Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
|
|
326
|
-
*
|
|
327
|
-
*/
|
|
328
|
-
Other = 0,
|
|
329
|
-
/**
|
|
330
|
-
*
|
|
331
|
-
* * Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
|
|
332
|
-
* * use {@link Boolean#TRUE}.
|
|
333
|
-
*
|
|
334
|
-
*/
|
|
335
|
-
PureBarcode = 1,
|
|
336
|
-
/**
|
|
337
|
-
*
|
|
338
|
-
* * Image is known to be of one of a few possible formats.
|
|
339
|
-
* * Maps to a {@link List} of {@link BarcodeFormat}s.
|
|
340
|
-
*
|
|
341
|
-
*/
|
|
342
|
-
PossibleFormats = 2,
|
|
343
|
-
/**
|
|
344
|
-
*
|
|
345
|
-
* * Spend more time to try to find a barcode; optimize for accuracy, not speed.
|
|
346
|
-
* * Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
347
|
-
*
|
|
348
|
-
*/
|
|
349
|
-
TryHarder = 3,
|
|
350
|
-
/**
|
|
351
|
-
*
|
|
352
|
-
* * Specifies what character encoding to use when decoding, where applicable (type String)
|
|
353
|
-
*
|
|
354
|
-
*/
|
|
355
|
-
CharacterSet = 4,
|
|
356
|
-
/**
|
|
357
|
-
*
|
|
358
|
-
* * Allowed lengths of encoded data -- reject anything else. Maps to an {@code int[]}.
|
|
359
|
-
*
|
|
360
|
-
*/
|
|
361
|
-
AllowedLengths = 5,
|
|
362
|
-
/**
|
|
363
|
-
*
|
|
364
|
-
* * Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;
|
|
365
|
-
* * use {@link Boolean#TRUE}.
|
|
366
|
-
*
|
|
367
|
-
*/
|
|
368
|
-
AssumeCode39CheckDigit = 6,
|
|
369
|
-
/**
|
|
370
|
-
*
|
|
371
|
-
* * Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.
|
|
372
|
-
* * For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to;
|
|
373
|
-
* * use {@link Boolean#TRUE}.
|
|
374
|
-
*
|
|
375
|
-
*/
|
|
376
|
-
AssumeGs1 = 7,
|
|
377
|
-
/**
|
|
378
|
-
*
|
|
379
|
-
* * If true, return the start and end digits in a Codabar barcode instead of stripping them. They
|
|
380
|
-
* * are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them
|
|
381
|
-
* * to not be. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
382
|
-
*
|
|
383
|
-
*/
|
|
384
|
-
ReturnCodabarStartEnd = 8,
|
|
385
|
-
/**
|
|
386
|
-
*
|
|
387
|
-
* * The caller needs to be notified via callback when a possible {@link RXingResultPoint}
|
|
388
|
-
* * is found. Maps to a {@link RXingResultPointCallback}.
|
|
389
|
-
*
|
|
390
|
-
*/
|
|
391
|
-
NeedResultPointCallback = 9,
|
|
392
|
-
/**
|
|
393
|
-
*
|
|
394
|
-
* * Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
|
|
395
|
-
* * Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5].
|
|
396
|
-
* * If it is optional to have an extension, do not set this hint. If this is set,
|
|
397
|
-
* * and a UPC or EAN barcode is found but an extension is not, then no result will be returned
|
|
398
|
-
* * at all.
|
|
399
|
-
*
|
|
400
|
-
*/
|
|
401
|
-
AllowedEanExtensions = 10,
|
|
402
|
-
/**
|
|
403
|
-
*
|
|
404
|
-
* * If true, also tries to decode as inverted image. All configured decoders are simply called a
|
|
405
|
-
* * second time with an inverted image. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
406
|
-
*
|
|
407
|
-
*/
|
|
408
|
-
AlsoInverted = 11,
|
|
409
|
-
/**
|
|
410
|
-
*
|
|
411
|
-
* * Translate the ASCII values parsed by the Telepen reader into the Telepen Numeric form; use {@link Boolean#TRUE}.
|
|
412
|
-
*
|
|
413
|
-
*/
|
|
414
|
-
TelepenAsNumeric = 12,
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
*/
|
|
418
418
|
export class BarcodeResult {
|
|
419
419
|
free(): void;
|
|
420
420
|
/**
|
package/rxing_wasm_bg.js
CHANGED
|
@@ -375,6 +375,101 @@ export function decode_multi(data, width, height, hints) {
|
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
+
/**
|
|
379
|
+
*/
|
|
380
|
+
export const DecodeHintTypes = Object.freeze({
|
|
381
|
+
/**
|
|
382
|
+
*
|
|
383
|
+
* * Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
|
|
384
|
+
*
|
|
385
|
+
*/
|
|
386
|
+
Other:0,"0":"Other",
|
|
387
|
+
/**
|
|
388
|
+
*
|
|
389
|
+
* * Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
|
|
390
|
+
* * use {@link Boolean#TRUE}.
|
|
391
|
+
*
|
|
392
|
+
*/
|
|
393
|
+
PureBarcode:1,"1":"PureBarcode",
|
|
394
|
+
/**
|
|
395
|
+
*
|
|
396
|
+
* * Image is known to be of one of a few possible formats.
|
|
397
|
+
* * Maps to a {@link List} of {@link BarcodeFormat}s.
|
|
398
|
+
*
|
|
399
|
+
*/
|
|
400
|
+
PossibleFormats:2,"2":"PossibleFormats",
|
|
401
|
+
/**
|
|
402
|
+
*
|
|
403
|
+
* * Spend more time to try to find a barcode; optimize for accuracy, not speed.
|
|
404
|
+
* * Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
405
|
+
*
|
|
406
|
+
*/
|
|
407
|
+
TryHarder:3,"3":"TryHarder",
|
|
408
|
+
/**
|
|
409
|
+
*
|
|
410
|
+
* * Specifies what character encoding to use when decoding, where applicable (type String)
|
|
411
|
+
*
|
|
412
|
+
*/
|
|
413
|
+
CharacterSet:4,"4":"CharacterSet",
|
|
414
|
+
/**
|
|
415
|
+
*
|
|
416
|
+
* * Allowed lengths of encoded data -- reject anything else. Maps to an {@code int[]}.
|
|
417
|
+
*
|
|
418
|
+
*/
|
|
419
|
+
AllowedLengths:5,"5":"AllowedLengths",
|
|
420
|
+
/**
|
|
421
|
+
*
|
|
422
|
+
* * Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;
|
|
423
|
+
* * use {@link Boolean#TRUE}.
|
|
424
|
+
*
|
|
425
|
+
*/
|
|
426
|
+
AssumeCode39CheckDigit:6,"6":"AssumeCode39CheckDigit",
|
|
427
|
+
/**
|
|
428
|
+
*
|
|
429
|
+
* * Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.
|
|
430
|
+
* * For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to;
|
|
431
|
+
* * use {@link Boolean#TRUE}.
|
|
432
|
+
*
|
|
433
|
+
*/
|
|
434
|
+
AssumeGs1:7,"7":"AssumeGs1",
|
|
435
|
+
/**
|
|
436
|
+
*
|
|
437
|
+
* * If true, return the start and end digits in a Codabar barcode instead of stripping them. They
|
|
438
|
+
* * are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them
|
|
439
|
+
* * to not be. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
440
|
+
*
|
|
441
|
+
*/
|
|
442
|
+
ReturnCodabarStartEnd:8,"8":"ReturnCodabarStartEnd",
|
|
443
|
+
/**
|
|
444
|
+
*
|
|
445
|
+
* * The caller needs to be notified via callback when a possible {@link RXingResultPoint}
|
|
446
|
+
* * is found. Maps to a {@link RXingResultPointCallback}.
|
|
447
|
+
*
|
|
448
|
+
*/
|
|
449
|
+
NeedResultPointCallback:9,"9":"NeedResultPointCallback",
|
|
450
|
+
/**
|
|
451
|
+
*
|
|
452
|
+
* * Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
|
|
453
|
+
* * Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5].
|
|
454
|
+
* * If it is optional to have an extension, do not set this hint. If this is set,
|
|
455
|
+
* * and a UPC or EAN barcode is found but an extension is not, then no result will be returned
|
|
456
|
+
* * at all.
|
|
457
|
+
*
|
|
458
|
+
*/
|
|
459
|
+
AllowedEanExtensions:10,"10":"AllowedEanExtensions",
|
|
460
|
+
/**
|
|
461
|
+
*
|
|
462
|
+
* * If true, also tries to decode as inverted image. All configured decoders are simply called a
|
|
463
|
+
* * second time with an inverted image. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
464
|
+
*
|
|
465
|
+
*/
|
|
466
|
+
AlsoInverted:11,"11":"AlsoInverted",
|
|
467
|
+
/**
|
|
468
|
+
*
|
|
469
|
+
* * Translate the ASCII values parsed by the Telepen reader into the Telepen Numeric form; use {@link Boolean#TRUE}.
|
|
470
|
+
*
|
|
471
|
+
*/
|
|
472
|
+
TelepenAsNumeric:12,"12":"TelepenAsNumeric", });
|
|
378
473
|
/**
|
|
379
474
|
*/
|
|
380
475
|
export const EncodeHintTypes = Object.freeze({
|
|
@@ -617,101 +712,6 @@ UpcE:15,"15":"UpcE",
|
|
|
617
712
|
* UPC/EAN extension format. Not a stand-alone format.
|
|
618
713
|
*/
|
|
619
714
|
UpcEanExtension:16,"16":"UpcEanExtension",MicroQR:17,"17":"MicroQR",Telepen:18,"18":"Telepen",RectangularMicroQR:19,"19":"RectangularMicroQR",UnsuportedFormat:20,"20":"UnsuportedFormat", });
|
|
620
|
-
/**
|
|
621
|
-
*/
|
|
622
|
-
export const DecodeHintTypes = Object.freeze({
|
|
623
|
-
/**
|
|
624
|
-
*
|
|
625
|
-
* * Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
|
|
626
|
-
*
|
|
627
|
-
*/
|
|
628
|
-
Other:0,"0":"Other",
|
|
629
|
-
/**
|
|
630
|
-
*
|
|
631
|
-
* * Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
|
|
632
|
-
* * use {@link Boolean#TRUE}.
|
|
633
|
-
*
|
|
634
|
-
*/
|
|
635
|
-
PureBarcode:1,"1":"PureBarcode",
|
|
636
|
-
/**
|
|
637
|
-
*
|
|
638
|
-
* * Image is known to be of one of a few possible formats.
|
|
639
|
-
* * Maps to a {@link List} of {@link BarcodeFormat}s.
|
|
640
|
-
*
|
|
641
|
-
*/
|
|
642
|
-
PossibleFormats:2,"2":"PossibleFormats",
|
|
643
|
-
/**
|
|
644
|
-
*
|
|
645
|
-
* * Spend more time to try to find a barcode; optimize for accuracy, not speed.
|
|
646
|
-
* * Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
647
|
-
*
|
|
648
|
-
*/
|
|
649
|
-
TryHarder:3,"3":"TryHarder",
|
|
650
|
-
/**
|
|
651
|
-
*
|
|
652
|
-
* * Specifies what character encoding to use when decoding, where applicable (type String)
|
|
653
|
-
*
|
|
654
|
-
*/
|
|
655
|
-
CharacterSet:4,"4":"CharacterSet",
|
|
656
|
-
/**
|
|
657
|
-
*
|
|
658
|
-
* * Allowed lengths of encoded data -- reject anything else. Maps to an {@code int[]}.
|
|
659
|
-
*
|
|
660
|
-
*/
|
|
661
|
-
AllowedLengths:5,"5":"AllowedLengths",
|
|
662
|
-
/**
|
|
663
|
-
*
|
|
664
|
-
* * Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;
|
|
665
|
-
* * use {@link Boolean#TRUE}.
|
|
666
|
-
*
|
|
667
|
-
*/
|
|
668
|
-
AssumeCode39CheckDigit:6,"6":"AssumeCode39CheckDigit",
|
|
669
|
-
/**
|
|
670
|
-
*
|
|
671
|
-
* * Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.
|
|
672
|
-
* * For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to;
|
|
673
|
-
* * use {@link Boolean#TRUE}.
|
|
674
|
-
*
|
|
675
|
-
*/
|
|
676
|
-
AssumeGs1:7,"7":"AssumeGs1",
|
|
677
|
-
/**
|
|
678
|
-
*
|
|
679
|
-
* * If true, return the start and end digits in a Codabar barcode instead of stripping them. They
|
|
680
|
-
* * are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them
|
|
681
|
-
* * to not be. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
682
|
-
*
|
|
683
|
-
*/
|
|
684
|
-
ReturnCodabarStartEnd:8,"8":"ReturnCodabarStartEnd",
|
|
685
|
-
/**
|
|
686
|
-
*
|
|
687
|
-
* * The caller needs to be notified via callback when a possible {@link RXingResultPoint}
|
|
688
|
-
* * is found. Maps to a {@link RXingResultPointCallback}.
|
|
689
|
-
*
|
|
690
|
-
*/
|
|
691
|
-
NeedResultPointCallback:9,"9":"NeedResultPointCallback",
|
|
692
|
-
/**
|
|
693
|
-
*
|
|
694
|
-
* * Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
|
|
695
|
-
* * Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5].
|
|
696
|
-
* * If it is optional to have an extension, do not set this hint. If this is set,
|
|
697
|
-
* * and a UPC or EAN barcode is found but an extension is not, then no result will be returned
|
|
698
|
-
* * at all.
|
|
699
|
-
*
|
|
700
|
-
*/
|
|
701
|
-
AllowedEanExtensions:10,"10":"AllowedEanExtensions",
|
|
702
|
-
/**
|
|
703
|
-
*
|
|
704
|
-
* * If true, also tries to decode as inverted image. All configured decoders are simply called a
|
|
705
|
-
* * second time with an inverted image. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
706
|
-
*
|
|
707
|
-
*/
|
|
708
|
-
AlsoInverted:11,"11":"AlsoInverted",
|
|
709
|
-
/**
|
|
710
|
-
*
|
|
711
|
-
* * Translate the ASCII values parsed by the Telepen reader into the Telepen Numeric form; use {@link Boolean#TRUE}.
|
|
712
|
-
*
|
|
713
|
-
*/
|
|
714
|
-
TelepenAsNumeric:12,"12":"TelepenAsNumeric", });
|
|
715
715
|
|
|
716
716
|
const BarcodeResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
717
717
|
? { register: () => {}, unregister: () => {} }
|
package/rxing_wasm_bg.wasm
CHANGED
|
Binary file
|