rxing-wasm 0.2.6 → 0.2.7
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 +180 -180
- package/rxing_wasm_bg.js +307 -276
- package/rxing_wasm_bg.wasm +0 -0
package/rxing_wasm_bg.js
CHANGED
|
@@ -4,6 +4,26 @@ export function __wbg_set_wasm(val) {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
const heap = new Array(128).fill(undefined);
|
|
8
|
+
|
|
9
|
+
heap.push(undefined, null, true, false);
|
|
10
|
+
|
|
11
|
+
function getObject(idx) { return heap[idx]; }
|
|
12
|
+
|
|
13
|
+
let heap_next = heap.length;
|
|
14
|
+
|
|
15
|
+
function dropObject(idx) {
|
|
16
|
+
if (idx < 132) return;
|
|
17
|
+
heap[idx] = heap_next;
|
|
18
|
+
heap_next = idx;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function takeObject(idx) {
|
|
22
|
+
const ret = getObject(idx);
|
|
23
|
+
dropObject(idx);
|
|
24
|
+
return ret;
|
|
25
|
+
}
|
|
26
|
+
|
|
7
27
|
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
|
|
8
28
|
|
|
9
29
|
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
@@ -20,15 +40,10 @@ function getUint8Memory0() {
|
|
|
20
40
|
}
|
|
21
41
|
|
|
22
42
|
function getStringFromWasm0(ptr, len) {
|
|
43
|
+
ptr = ptr >>> 0;
|
|
23
44
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
24
45
|
}
|
|
25
46
|
|
|
26
|
-
const heap = new Array(128).fill(undefined);
|
|
27
|
-
|
|
28
|
-
heap.push(undefined, null, true, false);
|
|
29
|
-
|
|
30
|
-
let heap_next = heap.length;
|
|
31
|
-
|
|
32
47
|
function addHeapObject(obj) {
|
|
33
48
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
34
49
|
const idx = heap_next;
|
|
@@ -38,20 +53,6 @@ function addHeapObject(obj) {
|
|
|
38
53
|
return idx;
|
|
39
54
|
}
|
|
40
55
|
|
|
41
|
-
function getObject(idx) { return heap[idx]; }
|
|
42
|
-
|
|
43
|
-
function dropObject(idx) {
|
|
44
|
-
if (idx < 132) return;
|
|
45
|
-
heap[idx] = heap_next;
|
|
46
|
-
heap_next = idx;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function takeObject(idx) {
|
|
50
|
-
const ret = getObject(idx);
|
|
51
|
-
dropObject(idx);
|
|
52
|
-
return ret;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
56
|
let cachedInt32Memory0 = null;
|
|
56
57
|
|
|
57
58
|
function getInt32Memory0() {
|
|
@@ -84,14 +85,14 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
84
85
|
|
|
85
86
|
if (realloc === undefined) {
|
|
86
87
|
const buf = cachedTextEncoder.encode(arg);
|
|
87
|
-
const ptr = malloc(buf.length);
|
|
88
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
88
89
|
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
89
90
|
WASM_VECTOR_LEN = buf.length;
|
|
90
91
|
return ptr;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
let len = arg.length;
|
|
94
|
-
let ptr = malloc(len);
|
|
95
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
95
96
|
|
|
96
97
|
const mem = getUint8Memory0();
|
|
97
98
|
|
|
@@ -107,11 +108,12 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
107
108
|
if (offset !== 0) {
|
|
108
109
|
arg = arg.slice(offset);
|
|
109
110
|
}
|
|
110
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
111
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
111
112
|
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
112
113
|
const ret = encodeString(arg, view);
|
|
113
114
|
|
|
114
115
|
offset += ret.written;
|
|
116
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
WASM_VECTOR_LEN = offset;
|
|
@@ -128,10 +130,12 @@ function getFloat32Memory0() {
|
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
function getArrayF32FromWasm0(ptr, len) {
|
|
133
|
+
ptr = ptr >>> 0;
|
|
131
134
|
return getFloat32Memory0().subarray(ptr / 4, ptr / 4 + len);
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
function getArrayU8FromWasm0(ptr, len) {
|
|
138
|
+
ptr = ptr >>> 0;
|
|
135
139
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
136
140
|
}
|
|
137
141
|
/**
|
|
@@ -139,10 +143,12 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
139
143
|
* @param {string} data
|
|
140
144
|
* @param {number} width
|
|
141
145
|
* @param {number} height
|
|
142
|
-
* @param {
|
|
146
|
+
* @param {BarcodeFormat} bc_type
|
|
143
147
|
* @returns {string}
|
|
144
148
|
*/
|
|
145
149
|
export function encode_barcode(data, width, height, bc_type) {
|
|
150
|
+
let deferred3_0;
|
|
151
|
+
let deferred3_1;
|
|
146
152
|
try {
|
|
147
153
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
148
154
|
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -152,16 +158,18 @@ export function encode_barcode(data, width, height, bc_type) {
|
|
|
152
158
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
153
159
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
154
160
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
155
|
-
var
|
|
156
|
-
var
|
|
161
|
+
var ptr2 = r0;
|
|
162
|
+
var len2 = r1;
|
|
157
163
|
if (r3) {
|
|
158
|
-
|
|
164
|
+
ptr2 = 0; len2 = 0;
|
|
159
165
|
throw takeObject(r2);
|
|
160
166
|
}
|
|
161
|
-
|
|
167
|
+
deferred3_0 = ptr2;
|
|
168
|
+
deferred3_1 = len2;
|
|
169
|
+
return getStringFromWasm0(ptr2, len2);
|
|
162
170
|
} finally {
|
|
163
171
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
164
|
-
wasm.__wbindgen_free(
|
|
172
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
165
173
|
}
|
|
166
174
|
}
|
|
167
175
|
|
|
@@ -176,36 +184,40 @@ function _assertClass(instance, klass) {
|
|
|
176
184
|
* @param {string} data
|
|
177
185
|
* @param {number} width
|
|
178
186
|
* @param {number} height
|
|
179
|
-
* @param {
|
|
187
|
+
* @param {BarcodeFormat} bc_type
|
|
180
188
|
* @param {EncodeHintDictionary} hints
|
|
181
189
|
* @returns {string}
|
|
182
190
|
*/
|
|
183
191
|
export function encode_barcode_with_hints(data, width, height, bc_type, hints) {
|
|
192
|
+
let deferred3_0;
|
|
193
|
+
let deferred3_1;
|
|
184
194
|
try {
|
|
185
195
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
186
196
|
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
187
197
|
const len0 = WASM_VECTOR_LEN;
|
|
188
198
|
_assertClass(hints, EncodeHintDictionary);
|
|
189
|
-
wasm.encode_barcode_with_hints(retptr, ptr0, len0, width, height, bc_type, hints.
|
|
199
|
+
wasm.encode_barcode_with_hints(retptr, ptr0, len0, width, height, bc_type, hints.__wbg_ptr);
|
|
190
200
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
191
201
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
192
202
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
193
203
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
194
|
-
var
|
|
195
|
-
var
|
|
204
|
+
var ptr2 = r0;
|
|
205
|
+
var len2 = r1;
|
|
196
206
|
if (r3) {
|
|
197
|
-
|
|
207
|
+
ptr2 = 0; len2 = 0;
|
|
198
208
|
throw takeObject(r2);
|
|
199
209
|
}
|
|
200
|
-
|
|
210
|
+
deferred3_0 = ptr2;
|
|
211
|
+
deferred3_1 = len2;
|
|
212
|
+
return getStringFromWasm0(ptr2, len2);
|
|
201
213
|
} finally {
|
|
202
214
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
203
|
-
wasm.__wbindgen_free(
|
|
215
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
204
216
|
}
|
|
205
217
|
}
|
|
206
218
|
|
|
207
219
|
function passArray8ToWasm0(arg, malloc) {
|
|
208
|
-
const ptr = malloc(arg.length * 1);
|
|
220
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
209
221
|
getUint8Memory0().set(arg, ptr / 1);
|
|
210
222
|
WASM_VECTOR_LEN = arg.length;
|
|
211
223
|
return ptr;
|
|
@@ -219,8 +231,8 @@ function isLikeNone(x) {
|
|
|
219
231
|
* @param {Uint8Array} data
|
|
220
232
|
* @param {number} width
|
|
221
233
|
* @param {number} height
|
|
222
|
-
* @param {boolean | undefined} try_harder
|
|
223
|
-
* @param {boolean | undefined} filter_image
|
|
234
|
+
* @param {boolean | undefined} [try_harder]
|
|
235
|
+
* @param {boolean | undefined} [filter_image]
|
|
224
236
|
* @returns {BarcodeResult}
|
|
225
237
|
*/
|
|
226
238
|
export function decode_barcode(data, width, height, try_harder, filter_image) {
|
|
@@ -259,9 +271,9 @@ export function convert_js_image_to_luma(data) {
|
|
|
259
271
|
wasm.convert_js_image_to_luma(retptr, ptr0, len0);
|
|
260
272
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
261
273
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
262
|
-
var
|
|
263
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
264
|
-
return
|
|
274
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
275
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
276
|
+
return v2;
|
|
265
277
|
} finally {
|
|
266
278
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
267
279
|
}
|
|
@@ -277,7 +289,7 @@ function getUint32Memory0() {
|
|
|
277
289
|
}
|
|
278
290
|
|
|
279
291
|
function passArray32ToWasm0(arg, malloc) {
|
|
280
|
-
const ptr = malloc(arg.length * 4);
|
|
292
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
281
293
|
getUint32Memory0().set(arg, ptr / 4);
|
|
282
294
|
WASM_VECTOR_LEN = arg.length;
|
|
283
295
|
return ptr;
|
|
@@ -289,7 +301,7 @@ function passArray32ToWasm0(arg, malloc) {
|
|
|
289
301
|
* @param {Uint32Array} data
|
|
290
302
|
* @param {number} width
|
|
291
303
|
* @param {number} height
|
|
292
|
-
* @param {boolean | undefined} try_harder
|
|
304
|
+
* @param {boolean | undefined} [try_harder]
|
|
293
305
|
* @returns {BarcodeResult}
|
|
294
306
|
*/
|
|
295
307
|
export function decode_barcode_rgb(data, width, height, try_harder) {
|
|
@@ -315,7 +327,7 @@ export function decode_barcode_rgb(data, width, height, try_harder) {
|
|
|
315
327
|
* @param {number} width
|
|
316
328
|
* @param {number} height
|
|
317
329
|
* @param {DecodeHintDictionary} hints
|
|
318
|
-
* @param {boolean | undefined} filter_image
|
|
330
|
+
* @param {boolean | undefined} [filter_image]
|
|
319
331
|
* @returns {BarcodeResult}
|
|
320
332
|
*/
|
|
321
333
|
export function decode_barcode_with_hints(data, width, height, hints, filter_image) {
|
|
@@ -324,7 +336,7 @@ export function decode_barcode_with_hints(data, width, height, hints, filter_ima
|
|
|
324
336
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
325
337
|
const len0 = WASM_VECTOR_LEN;
|
|
326
338
|
_assertClass(hints, DecodeHintDictionary);
|
|
327
|
-
wasm.decode_barcode_with_hints(retptr, ptr0, len0, width, height, hints.
|
|
339
|
+
wasm.decode_barcode_with_hints(retptr, ptr0, len0, width, height, hints.__wbg_ptr, isLikeNone(filter_image) ? 0xFFFFFF : filter_image ? 1 : 0);
|
|
328
340
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
329
341
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
330
342
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -350,7 +362,7 @@ export function decode_multi(data, width, height, hints) {
|
|
|
350
362
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
351
363
|
const len0 = WASM_VECTOR_LEN;
|
|
352
364
|
_assertClass(hints, DecodeHintDictionary);
|
|
353
|
-
wasm.decode_multi(retptr, ptr0, len0, width, height, hints.
|
|
365
|
+
wasm.decode_multi(retptr, ptr0, len0, width, height, hints.__wbg_ptr);
|
|
354
366
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
355
367
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
356
368
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -365,174 +377,99 @@ export function decode_multi(data, width, height, hints) {
|
|
|
365
377
|
|
|
366
378
|
/**
|
|
367
379
|
*/
|
|
368
|
-
export const
|
|
369
|
-
/**
|
|
370
|
-
*
|
|
371
|
-
* * Specifies what degree of error correction to use, for example in QR Codes.
|
|
372
|
-
* * Type depends on the encoder. For example for QR codes it's type
|
|
373
|
-
* * {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}.
|
|
374
|
-
* * For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words.
|
|
375
|
-
* * For PDF417 it is of type {@link Integer}, valid values being 0 to 8.
|
|
376
|
-
* * In all cases, it can also be a {@link String} representation of the desired value as well.
|
|
377
|
-
* * Note: an Aztec symbol should have a minimum of 25% EC words.
|
|
378
|
-
*
|
|
379
|
-
*/
|
|
380
|
-
ErrorCorrection:0,"0":"ErrorCorrection",
|
|
381
|
-
/**
|
|
382
|
-
*
|
|
383
|
-
* * Specifies what character encoding to use where applicable (type {@link String})
|
|
384
|
-
*
|
|
385
|
-
*/
|
|
386
|
-
CharacterSet:1,"1":"CharacterSet",
|
|
387
|
-
/**
|
|
388
|
-
*
|
|
389
|
-
* * Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
|
|
390
|
-
*
|
|
391
|
-
*/
|
|
392
|
-
DataMatrixShape:2,"2":"DataMatrixShape",
|
|
393
|
-
/**
|
|
394
|
-
*
|
|
395
|
-
* * Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false"
|
|
396
|
-
* * {@link String } value).
|
|
397
|
-
* * The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1
|
|
398
|
-
* * character set via ECIs.
|
|
399
|
-
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
400
|
-
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
401
|
-
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
402
|
-
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
403
|
-
* * Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case
|
|
404
|
-
* * group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords
|
|
405
|
-
* * for the purpose of delimiting AIs.
|
|
406
|
-
* * This option and {@link #FORCE_C40} are mutually exclusive.
|
|
407
|
-
*
|
|
408
|
-
*/
|
|
409
|
-
DataMatrixCompact:3,"3":"DataMatrixCompact",
|
|
410
|
-
/**
|
|
411
|
-
*
|
|
412
|
-
* * Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
413
|
-
* *
|
|
414
|
-
* * @deprecated use width/height params in
|
|
415
|
-
* * {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}
|
|
416
|
-
*
|
|
417
|
-
*/
|
|
418
|
-
MinSize:4,"4":"MinSize",
|
|
419
|
-
/**
|
|
420
|
-
*
|
|
421
|
-
* * Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
422
|
-
* *
|
|
423
|
-
* * @deprecated without replacement
|
|
424
|
-
*
|
|
425
|
-
*/
|
|
426
|
-
MaxSize:5,"5":"MaxSize",
|
|
380
|
+
export const DecodeHintTypes = Object.freeze({
|
|
427
381
|
/**
|
|
428
382
|
*
|
|
429
|
-
* *
|
|
430
|
-
* * by format; for example it controls margin before and after the barcode horizontally for
|
|
431
|
-
* * most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
383
|
+
* * Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
|
|
432
384
|
*
|
|
433
385
|
*/
|
|
434
|
-
|
|
386
|
+
Other:0,"0":"Other",
|
|
435
387
|
/**
|
|
436
388
|
*
|
|
437
|
-
* *
|
|
438
|
-
* * {@link
|
|
389
|
+
* * Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
|
|
390
|
+
* * use {@link Boolean#TRUE}.
|
|
439
391
|
*
|
|
440
392
|
*/
|
|
441
|
-
|
|
393
|
+
PureBarcode:1,"1":"PureBarcode",
|
|
442
394
|
/**
|
|
443
395
|
*
|
|
444
|
-
* *
|
|
445
|
-
* * {@link
|
|
446
|
-
* * enum values).
|
|
396
|
+
* * Image is known to be of one of a few possible formats.
|
|
397
|
+
* * Maps to a {@link List} of {@link BarcodeFormat}s.
|
|
447
398
|
*
|
|
448
399
|
*/
|
|
449
|
-
|
|
400
|
+
PossibleFormats:2,"2":"PossibleFormats",
|
|
450
401
|
/**
|
|
451
402
|
*
|
|
452
|
-
* *
|
|
453
|
-
* * {@link
|
|
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}.
|
|
454
405
|
*
|
|
455
406
|
*/
|
|
456
|
-
|
|
407
|
+
TryHarder:3,"3":"TryHarder",
|
|
457
408
|
/**
|
|
458
409
|
*
|
|
459
|
-
* * Specifies
|
|
460
|
-
* * {@link String} value).
|
|
461
|
-
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
462
|
-
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
463
|
-
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
464
|
-
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
410
|
+
* * Specifies what character encoding to use when decoding, where applicable (type String)
|
|
465
411
|
*
|
|
466
412
|
*/
|
|
467
|
-
|
|
413
|
+
CharacterSet:4,"4":"CharacterSet",
|
|
468
414
|
/**
|
|
469
415
|
*
|
|
470
|
-
* *
|
|
471
|
-
* * A negative number (-1, -2, -3, -4) specifies a compact Aztec code.
|
|
472
|
-
* * 0 indicates to use the minimum number of layers (the default).
|
|
473
|
-
* * A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code.
|
|
474
|
-
* * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
416
|
+
* * Allowed lengths of encoded data -- reject anything else. Maps to an {@code int[]}.
|
|
475
417
|
*
|
|
476
418
|
*/
|
|
477
|
-
|
|
419
|
+
AllowedLengths:5,"5":"AllowedLengths",
|
|
478
420
|
/**
|
|
479
421
|
*
|
|
480
|
-
* *
|
|
481
|
-
* *
|
|
422
|
+
* * Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;
|
|
423
|
+
* * use {@link Boolean#TRUE}.
|
|
482
424
|
*
|
|
483
425
|
*/
|
|
484
|
-
|
|
426
|
+
AssumeCode39CheckDigit:6,"6":"AssumeCode39CheckDigit",
|
|
485
427
|
/**
|
|
486
428
|
*
|
|
487
|
-
* *
|
|
488
|
-
* *
|
|
489
|
-
* *
|
|
490
|
-
* * * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
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}.
|
|
491
432
|
*
|
|
492
433
|
*/
|
|
493
|
-
|
|
434
|
+
AssumeGs1:7,"7":"AssumeGs1",
|
|
494
435
|
/**
|
|
495
436
|
*
|
|
496
|
-
* *
|
|
497
|
-
* *
|
|
498
|
-
* *
|
|
499
|
-
* * for characters in the input that are not in the ISO-8859-1 character set. Based on experience,
|
|
500
|
-
* * some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can
|
|
501
|
-
* * be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint.
|
|
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}.
|
|
502
440
|
*
|
|
503
441
|
*/
|
|
504
|
-
|
|
442
|
+
ReturnCodabarStartEnd:8,"8":"ReturnCodabarStartEnd",
|
|
505
443
|
/**
|
|
506
444
|
*
|
|
507
|
-
* *
|
|
508
|
-
* * {@link
|
|
445
|
+
* * The caller needs to be notified via callback when a possible {@link RXingResultPoint}
|
|
446
|
+
* * is found. Maps to a {@link RXingResultPointCallback}.
|
|
509
447
|
*
|
|
510
448
|
*/
|
|
511
|
-
|
|
449
|
+
NeedResultPointCallback:9,"9":"NeedResultPointCallback",
|
|
512
450
|
/**
|
|
513
451
|
*
|
|
514
|
-
* *
|
|
515
|
-
* *
|
|
516
|
-
* *
|
|
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.
|
|
517
457
|
*
|
|
518
458
|
*/
|
|
519
|
-
|
|
459
|
+
AllowedEanExtensions:10,"10":"AllowedEanExtensions",
|
|
520
460
|
/**
|
|
521
461
|
*
|
|
522
|
-
* *
|
|
523
|
-
* *
|
|
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}.
|
|
524
464
|
*
|
|
525
465
|
*/
|
|
526
|
-
|
|
466
|
+
AlsoInverted:11,"11":"AlsoInverted",
|
|
527
467
|
/**
|
|
528
468
|
*
|
|
529
|
-
* *
|
|
530
|
-
* * {@link String } value).
|
|
531
|
-
* * This can yield slightly smaller bar codes. This option and {@link #FORCE_CODE_SET} are mutually
|
|
532
|
-
* * exclusive.
|
|
469
|
+
* * Translate the ASCII values parsed by the Telepen reader into the Telepen Numeric form; use {@link Boolean#TRUE}.
|
|
533
470
|
*
|
|
534
471
|
*/
|
|
535
|
-
|
|
472
|
+
TelepenAsNumeric:12,"12":"TelepenAsNumeric", });
|
|
536
473
|
/**
|
|
537
474
|
* Available barcode types
|
|
538
475
|
*/
|
|
@@ -607,114 +544,194 @@ UpcE:15,"15":"UpcE",
|
|
|
607
544
|
UpcEanExtension:16,"16":"UpcEanExtension",MicroQR:17,"17":"MicroQR",Telepen:18,"18":"Telepen",RectangularMicroQR:19,"19":"RectangularMicroQR",UnsuportedFormat:20,"20":"UnsuportedFormat", });
|
|
608
545
|
/**
|
|
609
546
|
*/
|
|
610
|
-
export const
|
|
547
|
+
export const EncodeHintTypes = Object.freeze({
|
|
611
548
|
/**
|
|
612
549
|
*
|
|
613
|
-
* *
|
|
550
|
+
* * Specifies what degree of error correction to use, for example in QR Codes.
|
|
551
|
+
* * Type depends on the encoder. For example for QR codes it's type
|
|
552
|
+
* * {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}.
|
|
553
|
+
* * For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words.
|
|
554
|
+
* * For PDF417 it is of type {@link Integer}, valid values being 0 to 8.
|
|
555
|
+
* * In all cases, it can also be a {@link String} representation of the desired value as well.
|
|
556
|
+
* * Note: an Aztec symbol should have a minimum of 25% EC words.
|
|
614
557
|
*
|
|
615
558
|
*/
|
|
616
|
-
|
|
559
|
+
ErrorCorrection:0,"0":"ErrorCorrection",
|
|
617
560
|
/**
|
|
618
561
|
*
|
|
619
|
-
* *
|
|
620
|
-
* * use {@link Boolean#TRUE}.
|
|
562
|
+
* * Specifies what character encoding to use where applicable (type {@link String})
|
|
621
563
|
*
|
|
622
564
|
*/
|
|
623
|
-
|
|
565
|
+
CharacterSet:1,"1":"CharacterSet",
|
|
624
566
|
/**
|
|
625
567
|
*
|
|
626
|
-
* *
|
|
627
|
-
* * Maps to a {@link List} of {@link BarcodeFormat}s.
|
|
568
|
+
* * Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
|
|
628
569
|
*
|
|
629
570
|
*/
|
|
630
|
-
|
|
571
|
+
DataMatrixShape:2,"2":"DataMatrixShape",
|
|
631
572
|
/**
|
|
632
573
|
*
|
|
633
|
-
* *
|
|
634
|
-
* *
|
|
574
|
+
* * Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false"
|
|
575
|
+
* * {@link String } value).
|
|
576
|
+
* * The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1
|
|
577
|
+
* * character set via ECIs.
|
|
578
|
+
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
579
|
+
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
580
|
+
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
581
|
+
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
582
|
+
* * Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case
|
|
583
|
+
* * group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords
|
|
584
|
+
* * for the purpose of delimiting AIs.
|
|
585
|
+
* * This option and {@link #FORCE_C40} are mutually exclusive.
|
|
635
586
|
*
|
|
636
587
|
*/
|
|
637
|
-
|
|
588
|
+
DataMatrixCompact:3,"3":"DataMatrixCompact",
|
|
638
589
|
/**
|
|
639
590
|
*
|
|
640
|
-
* * Specifies
|
|
591
|
+
* * Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
592
|
+
* *
|
|
593
|
+
* * @deprecated use width/height params in
|
|
594
|
+
* * {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}
|
|
641
595
|
*
|
|
642
596
|
*/
|
|
643
|
-
|
|
597
|
+
MinSize:4,"4":"MinSize",
|
|
644
598
|
/**
|
|
645
599
|
*
|
|
646
|
-
* *
|
|
600
|
+
* * Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
601
|
+
* *
|
|
602
|
+
* * @deprecated without replacement
|
|
647
603
|
*
|
|
648
604
|
*/
|
|
649
|
-
|
|
605
|
+
MaxSize:5,"5":"MaxSize",
|
|
650
606
|
/**
|
|
651
607
|
*
|
|
652
|
-
* *
|
|
653
|
-
* *
|
|
608
|
+
* * Specifies margin, in pixels, to use when generating the barcode. The meaning can vary
|
|
609
|
+
* * by format; for example it controls margin before and after the barcode horizontally for
|
|
610
|
+
* * most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
654
611
|
*
|
|
655
612
|
*/
|
|
656
|
-
|
|
613
|
+
MARGIN:6,"6":"MARGIN",
|
|
657
614
|
/**
|
|
658
615
|
*
|
|
659
|
-
* *
|
|
660
|
-
* *
|
|
661
|
-
* * use {@link Boolean#TRUE}.
|
|
616
|
+
* * Specifies whether to use compact mode for PDF417 (type {@link Boolean}, or "true" or "false"
|
|
617
|
+
* * {@link String} value).
|
|
662
618
|
*
|
|
663
619
|
*/
|
|
664
|
-
|
|
620
|
+
Pdf417Compact:7,"7":"Pdf417Compact",
|
|
665
621
|
/**
|
|
666
622
|
*
|
|
667
|
-
* *
|
|
668
|
-
* *
|
|
669
|
-
* *
|
|
623
|
+
* * Specifies what compaction mode to use for PDF417 (type
|
|
624
|
+
* * {@link com.google.zxing.pdf417.encoder.Compaction Compaction} or {@link String} value of one of its
|
|
625
|
+
* * enum values).
|
|
670
626
|
*
|
|
671
627
|
*/
|
|
672
|
-
|
|
628
|
+
Pdf417Compaction:8,"8":"Pdf417Compaction",
|
|
673
629
|
/**
|
|
674
630
|
*
|
|
675
|
-
* *
|
|
676
|
-
* *
|
|
631
|
+
* * Specifies the minimum and maximum number of rows and columns for PDF417 (type
|
|
632
|
+
* * {@link com.google.zxing.pdf417.encoder.Dimensions Dimensions}).
|
|
677
633
|
*
|
|
678
634
|
*/
|
|
679
|
-
|
|
635
|
+
Pdf417Dimensions:9,"9":"Pdf417Dimensions",
|
|
680
636
|
/**
|
|
681
637
|
*
|
|
682
|
-
* *
|
|
683
|
-
* *
|
|
684
|
-
* *
|
|
685
|
-
* *
|
|
686
|
-
* *
|
|
638
|
+
* * Specifies whether to automatically insert ECIs when encoding PDF417 (type {@link Boolean}, or "true" or "false"
|
|
639
|
+
* * {@link String} value).
|
|
640
|
+
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
641
|
+
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
642
|
+
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
643
|
+
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
687
644
|
*
|
|
688
645
|
*/
|
|
689
|
-
|
|
646
|
+
Pdf417AutoEci:10,"10":"Pdf417AutoEci",
|
|
690
647
|
/**
|
|
691
648
|
*
|
|
692
|
-
* *
|
|
693
|
-
* *
|
|
649
|
+
* * Specifies the required number of layers for an Aztec code.
|
|
650
|
+
* * A negative number (-1, -2, -3, -4) specifies a compact Aztec code.
|
|
651
|
+
* * 0 indicates to use the minimum number of layers (the default).
|
|
652
|
+
* * A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code.
|
|
653
|
+
* * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
694
654
|
*
|
|
695
655
|
*/
|
|
696
|
-
|
|
656
|
+
AztecLayers:11,"11":"AztecLayers",
|
|
697
657
|
/**
|
|
698
658
|
*
|
|
699
|
-
* *
|
|
659
|
+
* * Specifies the exact version of QR code to be encoded.
|
|
660
|
+
* * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
700
661
|
*
|
|
701
662
|
*/
|
|
702
|
-
|
|
663
|
+
QrVersion:12,"12":"QrVersion",
|
|
664
|
+
/**
|
|
665
|
+
*
|
|
666
|
+
* * Specifies the QR code mask pattern to be used. Allowed values are
|
|
667
|
+
* * 0..QRCode.NUM_MASK_PATTERNS-1. By default the code will automatically select
|
|
668
|
+
* * the optimal mask pattern.
|
|
669
|
+
* * * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
670
|
+
*
|
|
671
|
+
*/
|
|
672
|
+
QrMaskPattern:13,"13":"QrMaskPattern",
|
|
673
|
+
/**
|
|
674
|
+
*
|
|
675
|
+
* * Specifies whether to use compact mode for QR code (type {@link Boolean}, or "true" or "false"
|
|
676
|
+
* * {@link String } value).
|
|
677
|
+
* * Please note that when compaction is performed, the most compact character encoding is chosen
|
|
678
|
+
* * for characters in the input that are not in the ISO-8859-1 character set. Based on experience,
|
|
679
|
+
* * some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can
|
|
680
|
+
* * be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint.
|
|
681
|
+
*
|
|
682
|
+
*/
|
|
683
|
+
QrCompact:14,"14":"QrCompact",
|
|
684
|
+
/**
|
|
685
|
+
*
|
|
686
|
+
* * Specifies whether the data should be encoded to the GS1 standard (type {@link Boolean}, or "true" or "false"
|
|
687
|
+
* * {@link String } value).
|
|
688
|
+
*
|
|
689
|
+
*/
|
|
690
|
+
Gs1Format:15,"15":"Gs1Format",
|
|
691
|
+
/**
|
|
692
|
+
*
|
|
693
|
+
* * Forces which encoding will be used. Currently only used for Code-128 code sets (Type {@link String}).
|
|
694
|
+
* * Valid values are "A", "B", "C".
|
|
695
|
+
* * This option and {@link #CODE128_COMPACT} are mutually exclusive.
|
|
696
|
+
*
|
|
697
|
+
*/
|
|
698
|
+
ForceCodeSet:16,"16":"ForceCodeSet",
|
|
699
|
+
/**
|
|
700
|
+
*
|
|
701
|
+
* * Forces C40 encoding for data-matrix (type {@link Boolean}, or "true" or "false") {@link String } value). This
|
|
702
|
+
* * option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive.
|
|
703
|
+
*
|
|
704
|
+
*/
|
|
705
|
+
ForceC40:17,"17":"ForceC40",
|
|
706
|
+
/**
|
|
707
|
+
*
|
|
708
|
+
* * Specifies whether to use compact mode for Code-128 code (type {@link Boolean}, or "true" or "false"
|
|
709
|
+
* * {@link String } value).
|
|
710
|
+
* * This can yield slightly smaller bar codes. This option and {@link #FORCE_CODE_SET} are mutually
|
|
711
|
+
* * exclusive.
|
|
712
|
+
*
|
|
713
|
+
*/
|
|
714
|
+
Code128Compact:18,"18":"Code128Compact",TelepenAsNumeric:19,"19":"TelepenAsNumeric", });
|
|
715
|
+
|
|
716
|
+
const BarcodeResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
717
|
+
? { register: () => {}, unregister: () => {} }
|
|
718
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_barcoderesult_free(ptr >>> 0));
|
|
703
719
|
/**
|
|
704
720
|
*/
|
|
705
721
|
export class BarcodeResult {
|
|
706
722
|
|
|
707
723
|
static __wrap(ptr) {
|
|
724
|
+
ptr = ptr >>> 0;
|
|
708
725
|
const obj = Object.create(BarcodeResult.prototype);
|
|
709
|
-
obj.
|
|
710
|
-
|
|
726
|
+
obj.__wbg_ptr = ptr;
|
|
727
|
+
BarcodeResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
711
728
|
return obj;
|
|
712
729
|
}
|
|
713
730
|
|
|
714
731
|
__destroy_into_raw() {
|
|
715
|
-
const ptr = this.
|
|
716
|
-
this.
|
|
717
|
-
|
|
732
|
+
const ptr = this.__wbg_ptr;
|
|
733
|
+
this.__wbg_ptr = 0;
|
|
734
|
+
BarcodeResultFinalization.unregister(this);
|
|
718
735
|
return ptr;
|
|
719
736
|
}
|
|
720
737
|
|
|
@@ -726,15 +743,15 @@ export class BarcodeResult {
|
|
|
726
743
|
* @returns {number}
|
|
727
744
|
*/
|
|
728
745
|
timestamp() {
|
|
729
|
-
const ret = wasm.barcoderesult_timestamp(this.
|
|
746
|
+
const ret = wasm.barcoderesult_timestamp(this.__wbg_ptr);
|
|
730
747
|
return ret;
|
|
731
748
|
}
|
|
732
749
|
/**
|
|
733
|
-
* @returns {
|
|
750
|
+
* @returns {BarcodeFormat}
|
|
734
751
|
*/
|
|
735
752
|
format() {
|
|
736
|
-
const ret = wasm.barcoderesult_format(this.
|
|
737
|
-
return ret
|
|
753
|
+
const ret = wasm.barcoderesult_format(this.__wbg_ptr);
|
|
754
|
+
return ret;
|
|
738
755
|
}
|
|
739
756
|
/**
|
|
740
757
|
* Each pair of f32 values is an (x,y) point
|
|
@@ -743,12 +760,12 @@ export class BarcodeResult {
|
|
|
743
760
|
result_points() {
|
|
744
761
|
try {
|
|
745
762
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
746
|
-
wasm.barcoderesult_result_points(retptr, this.
|
|
763
|
+
wasm.barcoderesult_result_points(retptr, this.__wbg_ptr);
|
|
747
764
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
748
765
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
749
|
-
var
|
|
750
|
-
wasm.__wbindgen_free(r0, r1 * 4);
|
|
751
|
-
return
|
|
766
|
+
var v1 = getArrayF32FromWasm0(r0, r1).slice();
|
|
767
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
768
|
+
return v1;
|
|
752
769
|
} finally {
|
|
753
770
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
754
771
|
}
|
|
@@ -757,7 +774,7 @@ export class BarcodeResult {
|
|
|
757
774
|
* @returns {number}
|
|
758
775
|
*/
|
|
759
776
|
num_bits() {
|
|
760
|
-
const ret = wasm.barcoderesult_num_bits(this.
|
|
777
|
+
const ret = wasm.barcoderesult_num_bits(this.__wbg_ptr);
|
|
761
778
|
return ret >>> 0;
|
|
762
779
|
}
|
|
763
780
|
/**
|
|
@@ -766,12 +783,12 @@ export class BarcodeResult {
|
|
|
766
783
|
raw_bytes() {
|
|
767
784
|
try {
|
|
768
785
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
769
|
-
wasm.barcoderesult_raw_bytes(retptr, this.
|
|
786
|
+
wasm.barcoderesult_raw_bytes(retptr, this.__wbg_ptr);
|
|
770
787
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
771
788
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
772
|
-
var
|
|
773
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
774
|
-
return
|
|
789
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
790
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
791
|
+
return v1;
|
|
775
792
|
} finally {
|
|
776
793
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
777
794
|
}
|
|
@@ -780,40 +797,41 @@ export class BarcodeResult {
|
|
|
780
797
|
* @returns {string}
|
|
781
798
|
*/
|
|
782
799
|
text() {
|
|
800
|
+
let deferred1_0;
|
|
801
|
+
let deferred1_1;
|
|
783
802
|
try {
|
|
784
803
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
785
|
-
wasm.barcoderesult_text(retptr, this.
|
|
804
|
+
wasm.barcoderesult_text(retptr, this.__wbg_ptr);
|
|
786
805
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
787
806
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
807
|
+
deferred1_0 = r0;
|
|
808
|
+
deferred1_1 = r1;
|
|
788
809
|
return getStringFromWasm0(r0, r1);
|
|
789
810
|
} finally {
|
|
790
811
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
791
|
-
wasm.__wbindgen_free(
|
|
812
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
792
813
|
}
|
|
793
814
|
}
|
|
794
815
|
/**
|
|
795
816
|
* @returns {Map<any, any>}
|
|
796
817
|
*/
|
|
797
818
|
get_meta_data() {
|
|
798
|
-
const ret = wasm.barcoderesult_get_meta_data(this.
|
|
819
|
+
const ret = wasm.barcoderesult_get_meta_data(this.__wbg_ptr);
|
|
799
820
|
return takeObject(ret);
|
|
800
821
|
}
|
|
801
822
|
}
|
|
823
|
+
|
|
824
|
+
const DecodeHintDictionaryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
825
|
+
? { register: () => {}, unregister: () => {} }
|
|
826
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_decodehintdictionary_free(ptr >>> 0));
|
|
802
827
|
/**
|
|
803
828
|
*/
|
|
804
829
|
export class DecodeHintDictionary {
|
|
805
830
|
|
|
806
|
-
static __wrap(ptr) {
|
|
807
|
-
const obj = Object.create(DecodeHintDictionary.prototype);
|
|
808
|
-
obj.ptr = ptr;
|
|
809
|
-
|
|
810
|
-
return obj;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
831
|
__destroy_into_raw() {
|
|
814
|
-
const ptr = this.
|
|
815
|
-
this.
|
|
816
|
-
|
|
832
|
+
const ptr = this.__wbg_ptr;
|
|
833
|
+
this.__wbg_ptr = 0;
|
|
834
|
+
DecodeHintDictionaryFinalization.unregister(this);
|
|
817
835
|
return ptr;
|
|
818
836
|
}
|
|
819
837
|
|
|
@@ -825,59 +843,61 @@ export class DecodeHintDictionary {
|
|
|
825
843
|
*/
|
|
826
844
|
constructor() {
|
|
827
845
|
const ret = wasm.decodehintdictionary_new();
|
|
828
|
-
|
|
846
|
+
this.__wbg_ptr = ret >>> 0;
|
|
847
|
+
return this;
|
|
829
848
|
}
|
|
830
849
|
/**
|
|
831
|
-
* @param {
|
|
850
|
+
* @param {DecodeHintTypes} hint
|
|
832
851
|
* @returns {string}
|
|
833
852
|
*/
|
|
834
853
|
get_hint(hint) {
|
|
854
|
+
let deferred1_0;
|
|
855
|
+
let deferred1_1;
|
|
835
856
|
try {
|
|
836
857
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
837
|
-
wasm.decodehintdictionary_get_hint(retptr, this.
|
|
858
|
+
wasm.decodehintdictionary_get_hint(retptr, this.__wbg_ptr, hint);
|
|
838
859
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
839
860
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
861
|
+
deferred1_0 = r0;
|
|
862
|
+
deferred1_1 = r1;
|
|
840
863
|
return getStringFromWasm0(r0, r1);
|
|
841
864
|
} finally {
|
|
842
865
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
843
|
-
wasm.__wbindgen_free(
|
|
866
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
844
867
|
}
|
|
845
868
|
}
|
|
846
869
|
/**
|
|
847
|
-
* @param {
|
|
870
|
+
* @param {DecodeHintTypes} hint
|
|
848
871
|
* @param {string} value
|
|
849
872
|
* @returns {boolean}
|
|
850
873
|
*/
|
|
851
874
|
set_hint(hint, value) {
|
|
852
875
|
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
853
876
|
const len0 = WASM_VECTOR_LEN;
|
|
854
|
-
const ret = wasm.decodehintdictionary_set_hint(this.
|
|
877
|
+
const ret = wasm.decodehintdictionary_set_hint(this.__wbg_ptr, hint, ptr0, len0);
|
|
855
878
|
return ret !== 0;
|
|
856
879
|
}
|
|
857
880
|
/**
|
|
858
|
-
* @param {
|
|
881
|
+
* @param {DecodeHintTypes} hint
|
|
859
882
|
* @returns {boolean}
|
|
860
883
|
*/
|
|
861
884
|
remove_hint(hint) {
|
|
862
|
-
const ret = wasm.decodehintdictionary_remove_hint(this.
|
|
885
|
+
const ret = wasm.decodehintdictionary_remove_hint(this.__wbg_ptr, hint);
|
|
863
886
|
return ret !== 0;
|
|
864
887
|
}
|
|
865
888
|
}
|
|
889
|
+
|
|
890
|
+
const EncodeHintDictionaryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
891
|
+
? { register: () => {}, unregister: () => {} }
|
|
892
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_encodehintdictionary_free(ptr >>> 0));
|
|
866
893
|
/**
|
|
867
894
|
*/
|
|
868
895
|
export class EncodeHintDictionary {
|
|
869
896
|
|
|
870
|
-
static __wrap(ptr) {
|
|
871
|
-
const obj = Object.create(EncodeHintDictionary.prototype);
|
|
872
|
-
obj.ptr = ptr;
|
|
873
|
-
|
|
874
|
-
return obj;
|
|
875
|
-
}
|
|
876
|
-
|
|
877
897
|
__destroy_into_raw() {
|
|
878
|
-
const ptr = this.
|
|
879
|
-
this.
|
|
880
|
-
|
|
898
|
+
const ptr = this.__wbg_ptr;
|
|
899
|
+
this.__wbg_ptr = 0;
|
|
900
|
+
EncodeHintDictionaryFinalization.unregister(this);
|
|
881
901
|
return ptr;
|
|
882
902
|
}
|
|
883
903
|
|
|
@@ -889,59 +909,69 @@ export class EncodeHintDictionary {
|
|
|
889
909
|
*/
|
|
890
910
|
constructor() {
|
|
891
911
|
const ret = wasm.encodehintdictionary_new();
|
|
892
|
-
|
|
912
|
+
this.__wbg_ptr = ret >>> 0;
|
|
913
|
+
return this;
|
|
893
914
|
}
|
|
894
915
|
/**
|
|
895
|
-
* @param {
|
|
916
|
+
* @param {EncodeHintTypes} hint
|
|
896
917
|
* @returns {string}
|
|
897
918
|
*/
|
|
898
919
|
get_hint(hint) {
|
|
920
|
+
let deferred1_0;
|
|
921
|
+
let deferred1_1;
|
|
899
922
|
try {
|
|
900
923
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
901
|
-
wasm.encodehintdictionary_get_hint(retptr, this.
|
|
924
|
+
wasm.encodehintdictionary_get_hint(retptr, this.__wbg_ptr, hint);
|
|
902
925
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
903
926
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
927
|
+
deferred1_0 = r0;
|
|
928
|
+
deferred1_1 = r1;
|
|
904
929
|
return getStringFromWasm0(r0, r1);
|
|
905
930
|
} finally {
|
|
906
931
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
907
|
-
wasm.__wbindgen_free(
|
|
932
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
908
933
|
}
|
|
909
934
|
}
|
|
910
935
|
/**
|
|
911
|
-
* @param {
|
|
936
|
+
* @param {EncodeHintTypes} hint
|
|
912
937
|
* @param {string} value
|
|
913
938
|
* @returns {boolean}
|
|
914
939
|
*/
|
|
915
940
|
set_hint(hint, value) {
|
|
916
941
|
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
917
942
|
const len0 = WASM_VECTOR_LEN;
|
|
918
|
-
const ret = wasm.encodehintdictionary_set_hint(this.
|
|
943
|
+
const ret = wasm.encodehintdictionary_set_hint(this.__wbg_ptr, hint, ptr0, len0);
|
|
919
944
|
return ret !== 0;
|
|
920
945
|
}
|
|
921
946
|
/**
|
|
922
|
-
* @param {
|
|
947
|
+
* @param {EncodeHintTypes} hint
|
|
923
948
|
* @returns {boolean}
|
|
924
949
|
*/
|
|
925
950
|
remove_hint(hint) {
|
|
926
|
-
const ret = wasm.encodehintdictionary_remove_hint(this.
|
|
951
|
+
const ret = wasm.encodehintdictionary_remove_hint(this.__wbg_ptr, hint);
|
|
927
952
|
return ret !== 0;
|
|
928
953
|
}
|
|
929
954
|
}
|
|
955
|
+
|
|
956
|
+
const MultiDecodeResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
957
|
+
? { register: () => {}, unregister: () => {} }
|
|
958
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_multidecoderesult_free(ptr >>> 0));
|
|
930
959
|
/**
|
|
931
960
|
*/
|
|
932
961
|
export class MultiDecodeResult {
|
|
933
962
|
|
|
934
963
|
static __wrap(ptr) {
|
|
964
|
+
ptr = ptr >>> 0;
|
|
935
965
|
const obj = Object.create(MultiDecodeResult.prototype);
|
|
936
|
-
obj.
|
|
937
|
-
|
|
966
|
+
obj.__wbg_ptr = ptr;
|
|
967
|
+
MultiDecodeResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
938
968
|
return obj;
|
|
939
969
|
}
|
|
940
970
|
|
|
941
971
|
__destroy_into_raw() {
|
|
942
|
-
const ptr = this.
|
|
943
|
-
this.
|
|
944
|
-
|
|
972
|
+
const ptr = this.__wbg_ptr;
|
|
973
|
+
this.__wbg_ptr = 0;
|
|
974
|
+
MultiDecodeResultFinalization.unregister(this);
|
|
945
975
|
return ptr;
|
|
946
976
|
}
|
|
947
977
|
|
|
@@ -953,42 +983,43 @@ export class MultiDecodeResult {
|
|
|
953
983
|
*/
|
|
954
984
|
constructor() {
|
|
955
985
|
const ret = wasm.multidecoderesult_new();
|
|
956
|
-
|
|
986
|
+
this.__wbg_ptr = ret >>> 0;
|
|
987
|
+
return this;
|
|
957
988
|
}
|
|
958
989
|
/**
|
|
959
990
|
* @returns {BarcodeResult | undefined}
|
|
960
991
|
*/
|
|
961
992
|
next() {
|
|
962
|
-
const ret = wasm.multidecoderesult_next(this.
|
|
993
|
+
const ret = wasm.multidecoderesult_next(this.__wbg_ptr);
|
|
963
994
|
return ret === 0 ? undefined : BarcodeResult.__wrap(ret);
|
|
964
995
|
}
|
|
965
996
|
}
|
|
966
997
|
|
|
998
|
+
export function __wbindgen_object_drop_ref(arg0) {
|
|
999
|
+
takeObject(arg0);
|
|
1000
|
+
};
|
|
1001
|
+
|
|
967
1002
|
export function __wbindgen_string_new(arg0, arg1) {
|
|
968
1003
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
969
1004
|
return addHeapObject(ret);
|
|
970
1005
|
};
|
|
971
1006
|
|
|
972
|
-
export function
|
|
973
|
-
takeObject(arg0);
|
|
974
|
-
};
|
|
975
|
-
|
|
976
|
-
export function __wbg_new_f841cc6f2098f4b5() {
|
|
1007
|
+
export function __wbg_new_d9bc3a0147634640() {
|
|
977
1008
|
const ret = new Map();
|
|
978
1009
|
return addHeapObject(ret);
|
|
979
1010
|
};
|
|
980
1011
|
|
|
981
|
-
export function
|
|
1012
|
+
export function __wbg_set_8417257aaedc936b(arg0, arg1, arg2) {
|
|
982
1013
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
983
1014
|
return addHeapObject(ret);
|
|
984
1015
|
};
|
|
985
1016
|
|
|
986
|
-
export function
|
|
1017
|
+
export function __wbg_getTime_2bc4375165f02d15(arg0) {
|
|
987
1018
|
const ret = getObject(arg0).getTime();
|
|
988
1019
|
return ret;
|
|
989
1020
|
};
|
|
990
1021
|
|
|
991
|
-
export function
|
|
1022
|
+
export function __wbg_new0_7d84e5b2cd9fdc73() {
|
|
992
1023
|
const ret = new Date();
|
|
993
1024
|
return addHeapObject(ret);
|
|
994
1025
|
};
|