@sythos/js_barcode_universal 1.5.6 → 1.5.8

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.
Files changed (180) hide show
  1. package/NOTICE.md +1 -1
  2. package/README.md +55 -35
  3. package/bundle/sythos-barcode.esm.js +618 -465
  4. package/bundle/sythos-barcode.js +618 -465
  5. package/package.json +90 -24
  6. package/src/index.d.ts +363 -0
  7. package/src/index.js +286 -133
  8. package/src/{aztec → js/aztec}/decoder.js +0 -1
  9. package/src/{aztec → js/aztec}/detector.js +0 -1
  10. package/src/{aztec → js/aztec}/encoder.js +0 -1
  11. package/src/{aztec → js/aztec}/high-level.js +0 -1
  12. package/src/{aztec → js/aztec}/index.js +0 -1
  13. package/src/{aztec → js/aztec}/tables.js +0 -1
  14. package/src/{aztecrune → js/aztecrune}/decoder.js +0 -1
  15. package/src/{aztecrune → js/aztecrune}/detector.js +0 -1
  16. package/src/{aztecrune → js/aztecrune}/encoder.js +0 -1
  17. package/src/{aztecrune → js/aztecrune}/index.js +0 -1
  18. package/src/{aztecrune → js/aztecrune}/tables.js +0 -1
  19. package/src/{compactpdf417 → js/compactpdf417}/decoder.js +0 -1
  20. package/src/{compactpdf417 → js/compactpdf417}/detector.js +0 -1
  21. package/src/{compactpdf417 → js/compactpdf417}/encoder.js +0 -1
  22. package/src/{compactpdf417 → js/compactpdf417}/index.js +0 -5
  23. package/src/{compactpdf417 → js/compactpdf417}/tables.js +0 -1
  24. package/src/{core → js/core}/bit-buffer.js +0 -1
  25. package/src/{core → js/core}/bit-matrix.js +0 -1
  26. package/src/{core → js/core}/errors.js +0 -1
  27. package/src/{core → js/core}/galois-field.js +0 -1
  28. package/src/{core → js/core}/index.js +0 -1
  29. package/src/{core → js/core}/reed-solomon.js +0 -1
  30. package/src/{databar → js/databar}/codec.js +0 -1
  31. package/src/{databar → js/databar}/decoder.js +0 -1
  32. package/src/{databar → js/databar}/encoder.js +0 -1
  33. package/src/{databar → js/databar}/gs1.js +0 -1
  34. package/src/{databar → js/databar}/index.js +0 -1
  35. package/src/{databar → js/databar}/patterns.js +0 -1
  36. package/src/{databar → js/databar}/tables.js +0 -1
  37. package/src/{datamatrix → js/datamatrix}/decoder.js +0 -1
  38. package/src/{datamatrix → js/datamatrix}/detector.js +0 -1
  39. package/src/{datamatrix → js/datamatrix}/encoder.js +0 -1
  40. package/src/{datamatrix → js/datamatrix}/index.js +0 -1
  41. package/src/{datamatrix → js/datamatrix}/tables.js +0 -1
  42. package/src/{frameqr → js/frameqr}/decoder.js +15 -16
  43. package/src/{frameqr → js/frameqr}/detector.js +2 -3
  44. package/src/{frameqr → js/frameqr}/encoder.js +7 -8
  45. package/src/{frameqr → js/frameqr}/index.js +0 -1
  46. package/src/{frameqr → js/frameqr}/tables.js +10 -11
  47. package/src/{image → js/image}/binarizer.js +0 -1
  48. package/src/{image → js/image}/grid-sampler.js +0 -1
  49. package/src/js/image/index.js +40 -0
  50. package/src/{image → js/image}/luminance.js +0 -1
  51. package/src/{image → js/image}/perspective.js +0 -1
  52. package/src/{micropdf417 → js/micropdf417}/compaction.js +0 -1
  53. package/src/{micropdf417 → js/micropdf417}/decoder.js +0 -1
  54. package/src/{micropdf417 → js/micropdf417}/detector.js +0 -1
  55. package/src/{micropdf417 → js/micropdf417}/encoder.js +0 -1
  56. package/src/{micropdf417 → js/micropdf417}/error-correction.js +0 -1
  57. package/src/{micropdf417 → js/micropdf417}/index.js +0 -1
  58. package/src/{micropdf417 → js/micropdf417}/tables.js +0 -1
  59. package/src/{microqr → js/microqr}/decoder.js +0 -1
  60. package/src/{microqr → js/microqr}/detector.js +0 -1
  61. package/src/{microqr → js/microqr}/encoder.js +0 -1
  62. package/src/js/microqr/index.js +36 -0
  63. package/src/{microqr → js/microqr}/tables.js +0 -1
  64. package/src/{oned → js/oned}/addons.js +0 -1
  65. package/src/{oned → js/oned}/index.js +0 -1
  66. package/src/{oned → js/oned}/patterns.js +0 -1
  67. package/src/{oned → js/oned}/reader.js +0 -1
  68. package/src/{oned → js/oned}/writers.js +0 -1
  69. package/src/{pdf417 → js/pdf417}/compaction.js +0 -1
  70. package/src/{pdf417 → js/pdf417}/decoder.js +0 -1
  71. package/src/{pdf417 → js/pdf417}/detector.js +0 -1
  72. package/src/{pdf417 → js/pdf417}/encoder.js +0 -1
  73. package/src/{pdf417 → js/pdf417}/error-correction.js +0 -1
  74. package/src/js/pdf417/index.js +6 -0
  75. package/src/{pdf417 → js/pdf417}/tables.js +0 -1
  76. package/src/{qr → js/qr}/decoder.js +0 -1
  77. package/src/{qr → js/qr}/detector.js +0 -1
  78. package/src/{qr → js/qr}/encoder.js +0 -1
  79. package/src/js/qr/index.js +44 -0
  80. package/src/{qr → js/qr}/tables.js +0 -1
  81. package/src/{render → js/render}/image-data.js +0 -1
  82. package/src/{render → js/render}/index.js +0 -1
  83. package/src/{render → js/render}/options.js +0 -1
  84. package/src/{render → js/render}/png.js +0 -1
  85. package/src/{render → js/render}/svg.js +0 -1
  86. package/src/{render → js/render}/webgl.js +0 -1
  87. package/src/{render → js/render}/webgpu.js +0 -1
  88. package/src/{rmqr → js/rmqr}/decoder.js +0 -1
  89. package/src/{rmqr → js/rmqr}/detector.js +0 -1
  90. package/src/{rmqr → js/rmqr}/encoder.js +0 -1
  91. package/src/{rmqr → js/rmqr}/index.js +0 -1
  92. package/src/{rmqr → js/rmqr}/tables.js +0 -1
  93. package/src/ts/aztec/decoder.d.ts +57 -0
  94. package/src/ts/aztec/detector.d.ts +62 -0
  95. package/src/ts/aztec/encoder.d.ts +94 -0
  96. package/src/ts/aztec/high-level.d.ts +89 -0
  97. package/src/ts/aztec/index.d.ts +35 -0
  98. package/src/ts/aztec/tables.d.ts +144 -0
  99. package/src/ts/aztecrune/decoder.d.ts +56 -0
  100. package/src/ts/aztecrune/detector.d.ts +53 -0
  101. package/src/ts/aztecrune/encoder.d.ts +51 -0
  102. package/src/ts/aztecrune/index.d.ts +35 -0
  103. package/src/ts/aztecrune/tables.d.ts +75 -0
  104. package/src/ts/bundle/sythos-barcode.d.ts +31 -0
  105. package/src/ts/bundle/sythos-barcode.esm.d.ts +31 -0
  106. package/src/ts/compactpdf417/decoder.d.ts +64 -0
  107. package/src/ts/compactpdf417/detector.d.ts +48 -0
  108. package/src/ts/compactpdf417/encoder.d.ts +49 -0
  109. package/src/ts/compactpdf417/index.d.ts +8 -0
  110. package/src/ts/compactpdf417/tables.d.ts +84 -0
  111. package/src/ts/core/bit-buffer.d.ts +78 -0
  112. package/src/ts/core/bit-matrix.d.ts +129 -0
  113. package/src/ts/core/errors.d.ts +57 -0
  114. package/src/ts/core/galois-field.d.ts +141 -0
  115. package/src/ts/core/index.d.ts +40 -0
  116. package/src/ts/core/reed-solomon.d.ts +65 -0
  117. package/src/ts/databar/codec.d.ts +78 -0
  118. package/src/ts/databar/decoder.d.ts +55 -0
  119. package/src/ts/databar/encoder.d.ts +34 -0
  120. package/src/ts/databar/gs1.d.ts +48 -0
  121. package/src/ts/databar/index.d.ts +37 -0
  122. package/src/ts/databar/patterns.d.ts +46 -0
  123. package/src/ts/databar/tables.d.ts +119 -0
  124. package/src/ts/datamatrix/decoder.d.ts +57 -0
  125. package/src/ts/datamatrix/detector.d.ts +59 -0
  126. package/src/ts/datamatrix/encoder.d.ts +36 -0
  127. package/src/ts/datamatrix/index.d.ts +35 -0
  128. package/src/ts/datamatrix/tables.d.ts +88 -0
  129. package/src/ts/frameqr/decoder.d.ts +64 -0
  130. package/src/ts/frameqr/detector.d.ts +96 -0
  131. package/src/ts/frameqr/encoder.d.ts +73 -0
  132. package/src/ts/frameqr/index.d.ts +34 -0
  133. package/src/ts/frameqr/tables.d.ts +123 -0
  134. package/src/ts/image/binarizer.d.ts +85 -0
  135. package/src/ts/image/grid-sampler.d.ts +82 -0
  136. package/src/{image/index.js → ts/image/index.d.ts} +0 -2
  137. package/src/ts/image/luminance.d.ts +112 -0
  138. package/src/ts/image/perspective.d.ts +111 -0
  139. package/src/ts/index.d.ts +363 -0
  140. package/src/ts/micropdf417/compaction.d.ts +38 -0
  141. package/src/ts/micropdf417/decoder.d.ts +57 -0
  142. package/src/ts/micropdf417/detector.d.ts +95 -0
  143. package/src/ts/micropdf417/encoder.d.ts +34 -0
  144. package/src/ts/micropdf417/error-correction.d.ts +38 -0
  145. package/src/ts/micropdf417/index.d.ts +36 -0
  146. package/src/ts/micropdf417/tables.d.ts +73 -0
  147. package/src/ts/microqr/decoder.d.ts +49 -0
  148. package/src/ts/microqr/detector.d.ts +96 -0
  149. package/src/ts/microqr/encoder.d.ts +33 -0
  150. package/src/{microqr/index.js → ts/microqr/index.d.ts} +0 -2
  151. package/src/ts/microqr/tables.d.ts +107 -0
  152. package/src/ts/oned/addons.d.ts +181 -0
  153. package/src/ts/oned/index.d.ts +55 -0
  154. package/src/ts/oned/patterns.d.ts +259 -0
  155. package/src/ts/oned/reader.d.ts +129 -0
  156. package/src/ts/oned/writers.d.ts +218 -0
  157. package/src/ts/pdf417/compaction.d.ts +59 -0
  158. package/src/ts/pdf417/decoder.d.ts +48 -0
  159. package/src/ts/pdf417/detector.d.ts +73 -0
  160. package/src/ts/pdf417/encoder.d.ts +32 -0
  161. package/src/ts/pdf417/error-correction.d.ts +34 -0
  162. package/src/{pdf417/index.js → ts/pdf417/index.d.ts} +0 -1
  163. package/src/ts/pdf417/tables.d.ts +53 -0
  164. package/src/ts/qr/decoder.d.ts +79 -0
  165. package/src/ts/qr/detector.d.ts +93 -0
  166. package/src/ts/qr/encoder.d.ts +166 -0
  167. package/src/{qr/index.js → ts/qr/index.d.ts} +0 -2
  168. package/src/ts/qr/tables.d.ts +291 -0
  169. package/src/ts/render/image-data.d.ts +58 -0
  170. package/src/ts/render/index.d.ts +110 -0
  171. package/src/ts/render/options.d.ts +98 -0
  172. package/src/ts/render/png.d.ts +58 -0
  173. package/src/ts/render/svg.d.ts +46 -0
  174. package/src/ts/render/webgl.d.ts +45 -0
  175. package/src/ts/render/webgpu.d.ts +51 -0
  176. package/src/ts/rmqr/decoder.d.ts +42 -0
  177. package/src/ts/rmqr/detector.d.ts +81 -0
  178. package/src/ts/rmqr/encoder.d.ts +45 -0
  179. package/src/ts/rmqr/index.d.ts +34 -0
  180. package/src/ts/rmqr/tables.d.ts +89 -0
@@ -0,0 +1,95 @@
1
+ /*!
2
+ * Sythos Barcode Suite
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2026 Sythos
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * SPDX-FileCopyrightText: 2026 Sythos (https://www.sythos.net)
27
+ * SPDX-License-Identifier: MIT
28
+ *
29
+ * Original work. No code from any other barcode implementation.
30
+ */
31
+ /**
32
+ * Axis-aligned MicroPDF417 raster detection.
33
+ *
34
+ * A MicroPDF417 symbol has a fixed module width for each column count and a
35
+ * dark leading and trailing module in every row. Consequently the bounding
36
+ * rectangle of dark pixels identifies the complete symbol even when a light
37
+ * quiet zone surrounds it. Its width determines the integer raster scale;
38
+ * the existing direct-module decoder then verifies every row-address pattern
39
+ * and selects the exact variant. This is intentionally narrower than the
40
+ * PDF417 photo detector: it handles clean binarized rasters only, not skew or
41
+ * projective camera images.
42
+ *
43
+ * @module micropdf417/detector
44
+ */
45
+ import { BitMatrix } from '../core/bit-matrix.js';
46
+ import { decodeMicroPDF417 } from './decoder.js';
47
+ export type Point = {
48
+ x: number;
49
+ y: number;
50
+ };
51
+ /**
52
+ * Detect and decode one clean, binarized MicroPDF417 raster.
53
+ *
54
+ * Integer upscaling and quiet zones are accepted. The image is retried at all
55
+ * quarter-turns, but arbitrary angles and perspective require caller-side
56
+ * rectification before this function is used. `rotation` reports the clockwise
57
+ * orientation of the supplied input relative to a normally oriented symbol;
58
+ * it is not the inverse correction applied internally while searching.
59
+ *
60
+ * @param {import('../core/bit-matrix.js').BitMatrix} binaryImage Set bit = dark.
61
+ * @param {object} [options] Passed to {@link decodeMicroPDF417}.
62
+ * @returns {(ReturnType<typeof decodeMicroPDF417> & {matrix: BitMatrix, corners: Point[], moduleSize: number, rotation: number}) | null}
63
+ */
64
+ export declare function detectMicroPDF417(binaryImage: import('../core/bit-matrix.js').BitMatrix, options?: object): (ReturnType<typeof decodeMicroPDF417> & {
65
+ matrix: BitMatrix;
66
+ corners: Point[];
67
+ moduleSize: number;
68
+ rotation: number;
69
+ }) | null;
70
+ /** Alias kept symmetric with the other 2D readers. */
71
+ export declare function detectAndDecodeMicroPDF417(binaryImage: any, options?: {}): ({
72
+ text: string;
73
+ bytes: Uint8Array<ArrayBuffer>;
74
+ segments: {
75
+ mode: string;
76
+ text: string;
77
+ bytes: Uint8Array<ArrayBuffer>;
78
+ eci: number;
79
+ latch: any;
80
+ codewordStart: number;
81
+ codewordEnd: number;
82
+ }[];
83
+ codewords: number[];
84
+ rows: any;
85
+ columns: any;
86
+ variant: any;
87
+ eccCodewords: any;
88
+ rowHeight: number;
89
+ corrections: number;
90
+ } & {
91
+ matrix: BitMatrix;
92
+ corners: Point[];
93
+ moduleSize: number;
94
+ rotation: number;
95
+ }) | null;
@@ -0,0 +1,34 @@
1
+ /*!
2
+ * Sythos Barcode Suite
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2026 Sythos
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * SPDX-FileCopyrightText: 2026 Sythos (https://www.sythos.net)
27
+ * SPDX-License-Identifier: MIT
28
+ *
29
+ * Original work. No code from any other barcode implementation.
30
+ */
31
+ /** MicroPDF417 encoder. @module micropdf417/encoder */
32
+ import { BitMatrix } from '../core/bit-matrix.js';
33
+ /** Encode a value as one of the 34 fixed MicroPDF417 variants. */
34
+ export declare function encodeMicroPDF417(value: any, options?: {}): BitMatrix;
@@ -0,0 +1,38 @@
1
+ /*!
2
+ * Sythos Barcode Suite
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2026 Sythos
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * SPDX-FileCopyrightText: 2026 Sythos (https://www.sythos.net)
27
+ * SPDX-License-Identifier: MIT
28
+ *
29
+ * Original work. No code from any other barcode implementation.
30
+ */
31
+ /** Return the fixed number of parity codewords for a MicroPDF417 variant. */
32
+ export declare function microPdf417EccLength(entry: any): any;
33
+ /** Build the MicroPDF417 generator polynomial for a variant's fixed ECC length. */
34
+ export declare function microPdf417Generator(entry: any): number[];
35
+ /** Compute systematic MicroPDF417 parity codewords. `data` must already include padding. */
36
+ export declare function microPdf417ErrorCorrection(data: any, entry: any): number[];
37
+ /** Correct a complete MicroPDF417 codeword stream, optionally marking erasures. */
38
+ export declare function microPdf417CorrectErrors(codewords: any, entry: any, erasures?: any[]): number;
@@ -0,0 +1,36 @@
1
+ /*!
2
+ * Sythos Barcode Suite
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2026 Sythos
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * SPDX-FileCopyrightText: 2026 Sythos (https://www.sythos.net)
27
+ * SPDX-License-Identifier: MIT
28
+ *
29
+ * Original work. No code from any other barcode implementation.
30
+ */
31
+ export { MICROPDF417_VARIANTS, microPdf417NextRap, microPdf417VariantByNumber, microPdf417VariantForCapacity, microPdf417RapSequence, microPdf417RowAddress, validateMicroPdf417Tables, } from './tables.js';
32
+ export { microPdf417EccLength, microPdf417Generator, microPdf417ErrorCorrection, microPdf417CorrectErrors, } from './error-correction.js';
33
+ export { compactMicroPDF417 } from './compaction.js';
34
+ export { encodeMicroPDF417 } from './encoder.js';
35
+ export { decodeMicroPDF417 } from './decoder.js';
36
+ export { detectMicroPDF417, detectAndDecodeMicroPDF417 } from './detector.js';
@@ -0,0 +1,73 @@
1
+ /*!
2
+ * Sythos Barcode Suite
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2026 Sythos
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * SPDX-FileCopyrightText: 2026 Sythos (https://www.sythos.net)
27
+ * SPDX-License-Identifier: MIT
28
+ *
29
+ * Original work. No code from any other barcode implementation.
30
+ */
31
+ /** All 34 predefined MicroPDF417 symbol variants, in format-table order. */
32
+ export declare const MICROPDF417_VARIANTS: readonly Readonly<{
33
+ id: any;
34
+ columns: any;
35
+ rows: any;
36
+ totalCodewords: number;
37
+ dataCodewords: number;
38
+ eccCodewords: any;
39
+ rapStart: any;
40
+ rapRotation: any;
41
+ }>[];
42
+ /** @param {number} value @param {number} offset @returns {number} */
43
+ export declare function microPdf417NextRap(value: number, offset?: number): number;
44
+ /** @param {number} id @returns {Readonly<typeof MICROPDF417_VARIANTS[number]>} */
45
+ export declare function microPdf417VariantByNumber(id: number): Readonly<typeof MICROPDF417_VARIANTS[number]>;
46
+ /**
47
+ * Return the smallest data-region candidate that fits `codewords`.
48
+ * Ties are resolved by width, then height, so selection is deterministic.
49
+ */
50
+ export declare function microPdf417VariantForCapacity(codewords: any): Readonly<{
51
+ id: any;
52
+ columns: any;
53
+ rows: any;
54
+ totalCodewords: number;
55
+ dataCodewords: number;
56
+ eccCodewords: any;
57
+ rapStart: any;
58
+ rapRotation: any;
59
+ }>;
60
+ /** Return the six bar/space run widths for a numbered side or center RAP. */
61
+ export declare function microPdf417RapSequence(number: any, kind?: string): string;
62
+ /**
63
+ * Resolve all row-address data for a zero-based row within a variant.
64
+ * @returns {{left: number, center: number|null, right: number, cluster: 0|3|6}}
65
+ */
66
+ export declare function microPdf417RowAddress(entry: any, row: any): {
67
+ left: number;
68
+ center: number | null;
69
+ right: number;
70
+ cluster: 0 | 3 | 6;
71
+ };
72
+ /** Return any table-invariant failures; an empty result means the table is coherent. */
73
+ export declare function validateMicroPdf417Tables(): string[];
@@ -0,0 +1,49 @@
1
+ /*!
2
+ * Sythos Barcode Suite
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2026 Sythos
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * SPDX-FileCopyrightText: 2026 Sythos (https://www.sythos.net)
27
+ * SPDX-License-Identifier: MIT
28
+ *
29
+ * Original work. No code from any other barcode implementation.
30
+ */
31
+ /**
32
+ * Micro QR decoder for an already sampled M1-M4 module matrix.
33
+ *
34
+ * @module microqr/decoder
35
+ */
36
+ import { ChecksumError, FormatError } from '../core/errors.js';
37
+ /** Decode a sampled Micro QR Code symbol without its quiet zone. */
38
+ export declare function decodeMicroQR(matrix: any): {
39
+ text: string;
40
+ bytes: Uint8Array<ArrayBuffer>;
41
+ mode: string;
42
+ version: any;
43
+ ecc: any;
44
+ mask: number;
45
+ corrections: number;
46
+ formatCorrections: number;
47
+ mirrored: any;
48
+ };
49
+ export { ChecksumError, FormatError };
@@ -0,0 +1,96 @@
1
+ /*!
2
+ * Sythos Barcode Suite
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2026 Sythos
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * SPDX-FileCopyrightText: 2026 Sythos (https://www.sythos.net)
27
+ * SPDX-License-Identifier: MIT
28
+ *
29
+ * Original work. No code from any other barcode implementation.
30
+ */
31
+ /**
32
+ * Micro QR detection in binarized rasters.
33
+ *
34
+ * A Micro QR symbol has one 7x7 finder in its top-left corner. That alone is
35
+ * not enough to distinguish it from one corner of a normal QR Code, so every
36
+ * candidate is also required to have the Micro QR timing arms and a format
37
+ * word which the decoder accepts. The decoder is deliberately the final
38
+ * geometric arbiter; BCH and Reed--Solomon verification make accidental
39
+ * acceptance of ordinary square artwork very unlikely.
40
+ *
41
+ * Finder geometry supplies two local axes. Timing arms refine their lengths,
42
+ * while a small fourth-corner search lets projective sampling absorb mild
43
+ * perspective despite the format having no remote alignment pattern.
44
+ *
45
+ * @module microqr/detector
46
+ */
47
+ import { BitMatrix } from '../core/bit-matrix.js';
48
+ export type Point = {
49
+ x: number;
50
+ y: number;
51
+ };
52
+ export type Detection = {
53
+ /**
54
+ * Outer corners in reading order.
55
+ */
56
+ corners: Point[];
57
+ /**
58
+ * Side length in modules.
59
+ */
60
+ dimension: number;
61
+ version: 'M1' | 'M2' | 'M3' | 'M4';
62
+ /**
63
+ * Estimated pixels per module at the finder.
64
+ */
65
+ moduleSize: number;
66
+ /**
67
+ * Clockwise orientation of the source raster.
68
+ */
69
+ rotation: number;
70
+ /**
71
+ * Whether the detected symbol used inverted polarity.
72
+ */
73
+ inverted: boolean;
74
+ /**
75
+ * Rectified, normally polarised module matrix.
76
+ */
77
+ matrix: BitMatrix;
78
+ };
79
+ /**
80
+ * Find Micro QR symbols in a binarized raster.
81
+ *
82
+ * The search accepts arbitrary in-plane angles, including all quarter-turns.
83
+ * Non-integer scale is supported through centre sampling. Mild projective
84
+ * distortion is handled by searching the unconstrained fourth corner.
85
+ *
86
+ * @param {BitMatrix} binaryImage Set bit = dark.
87
+ * @returns {Detection[]} Best candidate first; empty when no symbol is found.
88
+ */
89
+ export declare function detectMicroQR(binaryImage: BitMatrix): Detection[];
90
+ /**
91
+ * Detect and decode all Micro QR symbols in a binarized raster.
92
+ *
93
+ * @param {BitMatrix} binaryImage
94
+ * @returns {Array<object>}
95
+ */
96
+ export declare function detectAndDecodeMicroQR(binaryImage: BitMatrix): Array<object>;
@@ -0,0 +1,33 @@
1
+ /*!
2
+ * Sythos Barcode Suite
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2026 Sythos
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * SPDX-FileCopyrightText: 2026 Sythos (https://www.sythos.net)
27
+ * SPDX-License-Identifier: MIT
28
+ *
29
+ * Original work. No code from any other barcode implementation.
30
+ */
31
+ import { BitMatrix } from '../core/bit-matrix.js';
32
+ export declare const MICROQR_ALPHANUMERIC = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
33
+ export declare function encodeMicroQR(text: any, options?: {}): BitMatrix | undefined;
@@ -28,9 +28,7 @@
28
28
  *
29
29
  * Original work. No code from any other barcode implementation.
30
30
  */
31
-
32
31
  /** Micro QR Code M1-M4 public module surface. @module microqr */
33
-
34
32
  export { encodeMicroQR } from './encoder.js';
35
33
  export { decodeMicroQR } from './decoder.js';
36
34
  export { detectMicroQR, detectAndDecodeMicroQR } from './detector.js';
@@ -0,0 +1,107 @@
1
+ /*!
2
+ * Sythos Barcode Suite
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2026 Sythos
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * SPDX-FileCopyrightText: 2026 Sythos (https://www.sythos.net)
27
+ * SPDX-License-Identifier: MIT
28
+ *
29
+ * Original work. No code from any other barcode implementation.
30
+ */
31
+ /** Numeric version identifiers used by the encoder selection loop. */
32
+ export declare const MICROQR_VERSIONS: readonly number[];
33
+ export declare const MICROQR_VERSION_NAMES: readonly string[];
34
+ export declare const MICROQR_ECC_LEVELS: readonly string[];
35
+ export declare const MICROQR_FORMAT_MASK = 17477;
36
+ export declare const MICROQR_FORMAT_GENERATOR = 1335;
37
+ /** The eight legal Micro QR version/error-correction combinations. */
38
+ export declare const MICROQR_SYMBOLS: readonly Readonly<{
39
+ version: any;
40
+ ecc: any;
41
+ symbolNumber: any;
42
+ size: number;
43
+ totalCodewords: any;
44
+ dataCodewords: any;
45
+ dataBits: any;
46
+ eccCodewords: any;
47
+ blockCount: 1;
48
+ shortDataCodewordBits: number;
49
+ remainderBits: 0;
50
+ }>[];
51
+ /** @param {string|number} version @returns {number} */
52
+ export declare function microQrVersionSize(version: string | number): number;
53
+ /** Resolve the format symbol number for a legal version/ECC pair. */
54
+ export declare function microQrSymbolNumber(version: any, ecc: any): any;
55
+ /** Resolve the immutable single-block layout for a legal version/ECC pair. */
56
+ export declare function microQrBlockLayout(version: any, ecc: any): Readonly<{
57
+ version: any;
58
+ ecc: any;
59
+ symbolNumber: any;
60
+ size: number;
61
+ totalCodewords: any;
62
+ dataCodewords: any;
63
+ dataBits: any;
64
+ eccCodewords: any;
65
+ blockCount: 1;
66
+ shortDataCodewordBits: number;
67
+ remainderBits: 0;
68
+ }>;
69
+ /** @returns {number} Usable message bits, including mode/count overhead. */
70
+ export declare function microQrDataCapacityBits(version: any, ecc: any): number;
71
+ /**
72
+ * Encode the five format data bits with BCH(15,5), then apply the Micro QR
73
+ * format mask. `symbolNumber` occupies the high three data bits and `mask`
74
+ * the low two.
75
+ */
76
+ export declare function microQrFormatInfo(symbolNumber: any, mask: any, maybeMask: any): number;
77
+ /** Decode/correct a 15-bit format word. Returns null beyond three errors. */
78
+ export declare function microQrDecodeFormatInfo(bits: any): {
79
+ version: any;
80
+ ecc: any;
81
+ symbolNumber: any;
82
+ mask: number;
83
+ correctedBits: number;
84
+ bits: number;
85
+ } | null;
86
+ /**
87
+ * Format modules in bit-number order, least significant bit first. Bits 0..7
88
+ * run down column 8; bits 8..14 continue right-to-left along row 8.
89
+ * Position (8,8) is shared by the two arms and appears once.
90
+ */
91
+ export declare function microQrFormatInfoPositions(sizeOrVersion: any): number[][];
92
+ /**
93
+ * Fixed dark function modules before format information is written. Light
94
+ * separator and light timing modules remain unset; use
95
+ * {@link microQrReservedModules} to distinguish them from payload modules.
96
+ */
97
+ export declare function microQrFunctionModules(version: any): any;
98
+ /** Shared immutable-in-use map of finder, separator, timing and format modules. */
99
+ export declare function microQrReservedModules(version: any): any;
100
+ /** Number of modules carrying data or error-correction bits. */
101
+ export declare function microQrFreeModuleCount(version: any): number;
102
+ /** Payload module coordinates as interleaved x,y pairs, MSB-first stream order. */
103
+ export declare function microQrDataModuleOrder(version: any): any;
104
+ /** The four Micro QR data-mask predicates. */
105
+ export declare function microQrMaskBit(mask: any, x: any, y: any): boolean;
106
+ /** Return all internal table/geometry invariant failures. */
107
+ export declare function validateMicroQrTables(): string[];