@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,65 @@
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
+ * Build the generator polynomial for `eccLen` parity symbols.
33
+ *
34
+ * g(x) = product over i of (x - a^(base + i)), i = 0 .. eccLen-1
35
+ *
36
+ * `base` is 0 for QR; 1 for Aztec, Data Matrix and PDF417.
37
+ *
38
+ * @param {number} eccLen
39
+ * @param {import('./galois-field.js').GaloisField} field
40
+ * @param {number} [base]
41
+ * @returns {number[]} Monic, degree-descending, length eccLen + 1.
42
+ */
43
+ export declare function generatorPoly(eccLen: number, field: import('./galois-field.js').GaloisField, base?: number): number[];
44
+ /**
45
+ * Compute `eccLen` parity symbols for `data`.
46
+ *
47
+ * @param {ArrayLike<number>} data
48
+ * @param {number} eccLen
49
+ * @param {import('./galois-field.js').GaloisField} field
50
+ * @param {number} [base]
51
+ * @returns {number[]} The parity symbols alone, length eccLen.
52
+ */
53
+ export declare function rsEncode(data: ArrayLike<number>, eccLen: number, field: import('./galois-field.js').GaloisField, base?: number): number[];
54
+ /**
55
+ * Correct errors in a received codeword, in place.
56
+ *
57
+ * @param {number[]} received Data followed by parity, degree-descending.
58
+ * @param {number} eccLen
59
+ * @param {import('./galois-field.js').GaloisField} field
60
+ * @param {number} [base]
61
+ * @param {number[]} [erasures] Known damaged indexes, counted from wire order.
62
+ * @returns {number} Number of symbols corrected.
63
+ * @throws {ChecksumError} If the damage exceeds the correction capacity.
64
+ */
65
+ export declare function rsDecode(received: number[], eccLen: number, field: import('./galois-field.js').GaloisField, base?: number, erasures?: number[]): number;
@@ -0,0 +1,78 @@
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
+ /** Calculate the GS1 modulo-10 check digit for a GTIN body. */
32
+ export declare function gtinCheckDigit(body: any): string;
33
+ /** Return a checked 14-digit GTIN, preserving only its standardized digits. */
34
+ export declare function normalizeGTIN(value: any): string;
35
+ /** Build a checked GTIN-14 from its thirteen-digit data body. */
36
+ export declare function makeGTIN14(body: any): string;
37
+ /**
38
+ * Compact a GTIN into the four values shared by Omnidirectional, Truncated,
39
+ * Stacked and Stacked Omnidirectional. The `physicalCharacters` sequence is
40
+ * left-to-right on a linear DataBar-14 row: 1, 2, 4, 3.
41
+ */
42
+ export declare function encodeDataBar14GTIN(value: any, options?: {}): Readonly<{
43
+ gtin: string;
44
+ linkage: boolean;
45
+ symbolValue: bigint;
46
+ leftPair: bigint;
47
+ rightPair: bigint;
48
+ logicalCharacters: Readonly<{
49
+ outerLeft: number;
50
+ innerLeft: number;
51
+ outerRight: number;
52
+ innerRight: number;
53
+ }>;
54
+ physicalCharacters: readonly number[];
55
+ }>;
56
+ /** Reconstruct and validate a GTIN from the four DataBar-14 character values. */
57
+ export declare function decodeDataBar14GTIN(values: any): Readonly<{
58
+ linkage: boolean;
59
+ gtin: string;
60
+ leftPair: bigint;
61
+ rightPair: bigint;
62
+ }>;
63
+ /** Compact a DataBar Limited-eligible GTIN into its two data character values. */
64
+ export declare function encodeDataBarLimitedGTIN(value: any, options?: {}): Readonly<{
65
+ gtin: string;
66
+ linkage: boolean;
67
+ symbolValue: bigint;
68
+ left: number;
69
+ right: number;
70
+ }>;
71
+ /** Reconstruct and validate a GTIN from DataBar Limited data character values. */
72
+ export declare function decodeDataBarLimitedGTIN(values: any): Readonly<{
73
+ linkage: boolean;
74
+ gtin: string;
75
+ symbolValue: bigint;
76
+ }>;
77
+ /** GS1 transmitted form for the GTIN-only DataBar variants. */
78
+ export declare function dataBarGtinTransmission(value: any): string;
@@ -0,0 +1,55 @@
1
+ /*!
2
+ * Sythos Barcode Suite
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2026 Sythos
7
+ * SPDX-FileCopyrightText: 2026 Sythos (https://www.sythos.net)
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ *
27
+ * SPDX-License-Identifier: MIT
28
+ *
29
+ * Original work. No code from any other barcode implementation.
30
+ */
31
+ /** Decode a clean or integer-scaled 96-module DataBar-14 matrix. */
32
+ export declare function decodeDataBar14(matrix: any): Readonly<{
33
+ format: "databar-omnidirectional";
34
+ text: string;
35
+ gtin: string;
36
+ linkage: boolean;
37
+ symbologyIdentifier: "]e0";
38
+ }>;
39
+ /**
40
+ * Decode GS1 DataBar-14 from one raster scanline. This is the image layer over
41
+ * the existing clean 96-module decoder; it recognizes both Omnidirectional
42
+ * and Truncated symbols because their horizontal pattern is identical.
43
+ *
44
+ * @param {Uint8Array} row
45
+ * @returns {{format:'gs1databar14', text:string, gtin:string, gs1:boolean, linkage:boolean, symbologyIdentifier:string, elements:Array}|null}
46
+ */
47
+ export declare function decodeDataBar14Scanline(row: Uint8Array): {
48
+ format: 'gs1databar14';
49
+ text: string;
50
+ gtin: string;
51
+ gs1: boolean;
52
+ linkage: boolean;
53
+ symbologyIdentifier: string;
54
+ elements: any[];
55
+ } | 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
+ /** GS1 DataBar Omnidirectional and Truncated encoder. @module databar/encoder */
32
+ import { BitMatrix } from '../core/bit-matrix.js';
33
+ /** Encode a checked GTIN as DataBar Omnidirectional or Truncated. */
34
+ export declare function encodeDataBar14(value: any, options?: {}): BitMatrix;
@@ -0,0 +1,48 @@
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 declare const GS1_SEPARATOR = "\u001D";
32
+ export declare function gs1AIInfo(ai: any): {
33
+ ai: string;
34
+ length: number | boolean;
35
+ fixed: number | boolean;
36
+ } | undefined;
37
+ export declare function parseGS1ElementString(input: any): {
38
+ ai: any;
39
+ value: any;
40
+ fixed: number | boolean;
41
+ }[];
42
+ export declare function encodeGS1ElementString(input: any): string;
43
+ export declare function decodeGS1ElementString(data: any): {
44
+ ai: any;
45
+ value: any;
46
+ fixed: number | boolean;
47
+ }[];
48
+ export declare function formatGS1Elements(elements: any): any;
@@ -0,0 +1,37 @@
1
+ /*!
2
+ * Sythos Barcode Suite
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2026 Sythos
7
+ * SPDX-FileCopyrightText: 2026 Sythos (https://www.sythos.net)
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ *
27
+ * SPDX-License-Identifier: MIT
28
+ *
29
+ * Original work. No code from any other barcode implementation.
30
+ */
31
+ /** Verified GS1 DataBar data-layer primitives. @module databar */
32
+ export { dataBarGtinTransmission, decodeDataBar14GTIN, decodeDataBarLimitedGTIN, encodeDataBar14GTIN, encodeDataBarLimitedGTIN, gtinCheckDigit, makeGTIN14, normalizeGTIN, } from './codec.js';
33
+ export { GS1_SEPARATOR, decodeGS1ElementString, encodeGS1ElementString, formatGS1Elements, gs1AIInfo, parseGS1ElementString, } from './gs1.js';
34
+ export { DATABAR14_VARIANTS, DATABAR_LIMITED_VARIANT, dataBar14GroupFor, validateDataBarTables, } from './tables.js';
35
+ export { encodeDataBar14 } from './encoder.js';
36
+ export { decodeDataBar14, decodeDataBar14Scanline } from './decoder.js';
37
+ export { DATABAR14_CHECKSUM_WEIGHTS, DATABAR14_FINDERS, dataBar14CharacterWidths, dataBar14ValueForWidths, dataBarWidths, } from './patterns.js';
@@ -0,0 +1,46 @@
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
+ * Unrank one constrained positive composition.
33
+ *
34
+ * The rank is the GS1 DataBar symbol-character value inside its group. This
35
+ * implementation follows the combinatorial definition directly: it counts
36
+ * every remaining admissible suffix rather than storing third-party patterns.
37
+ */
38
+ export declare function dataBarWidths(rank: any, modules: any, elements: any, maximumWidth: any, noNarrow: any): any[];
39
+ /** Convert one DataBar-14 character value into its eight alternating widths. */
40
+ export declare function dataBar14CharacterWidths(value: any, kind: any): any[];
41
+ /** Recover a character value from its canonical eight-width representation. */
42
+ export declare function dataBar14ValueForWidths(widths: any, kind: any): any;
43
+ /** Nine finder patterns, expressed as normative five-element widths. */
44
+ export declare const DATABAR14_FINDERS: readonly (readonly number[])[];
45
+ /** Weight sequence generated as powers of three modulo 79. */
46
+ export declare const DATABAR14_CHECKSUM_WEIGHTS: readonly number[];
@@ -0,0 +1,119 @@
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
+ /** The four GTIN-only layouts sharing the DataBar-14 compaction rules. */
32
+ export declare const DATABAR14_VARIANTS: Readonly<{
33
+ omnidirectional: Readonly<{
34
+ id: "omnidirectional";
35
+ rows: 1;
36
+ modules: 96;
37
+ checksumModulus: 79;
38
+ pointOfSale: true;
39
+ }>;
40
+ truncated: Readonly<{
41
+ id: "truncated";
42
+ rows: 1;
43
+ modules: 96;
44
+ checksumModulus: 79;
45
+ pointOfSale: false;
46
+ }>;
47
+ stacked: Readonly<{
48
+ id: "stacked";
49
+ rows: 2;
50
+ modules: 50;
51
+ checksumModulus: 79;
52
+ pointOfSale: false;
53
+ }>;
54
+ 'stacked-omnidirectional': Readonly<{
55
+ id: "stacked-omnidirectional";
56
+ rows: 2;
57
+ modules: 50;
58
+ checksumModulus: 79;
59
+ pointOfSale: true;
60
+ }>;
61
+ }>;
62
+ /** GS1 DataBar Limited is a distinct two-character symbology. */
63
+ export declare const DATABAR_LIMITED_VARIANT: Readonly<{
64
+ id: "limited";
65
+ rows: 1;
66
+ checksumModulus: 89;
67
+ pointOfSale: false;
68
+ permittedIndicatorDigits: readonly number[];
69
+ }>;
70
+ /** (16,4) outside character groups, ISO/IEC 24724:2011 Table 1. */
71
+ export declare const DATABAR14_OUTSIDE_GROUPS: readonly Readonly<{
72
+ first: any;
73
+ last: any;
74
+ gsum: any;
75
+ oddModules: any;
76
+ evenModules: any;
77
+ oddWidest: any;
78
+ evenWidest: any;
79
+ oddTotal: any;
80
+ evenTotal: any;
81
+ }>[];
82
+ /** (15,4) inside character groups, ISO/IEC 24724:2011 Table 2. */
83
+ export declare const DATABAR14_INSIDE_GROUPS: readonly Readonly<{
84
+ first: any;
85
+ last: any;
86
+ gsum: any;
87
+ oddModules: any;
88
+ evenModules: any;
89
+ oddWidest: any;
90
+ evenWidest: any;
91
+ oddTotal: any;
92
+ evenTotal: any;
93
+ }>[];
94
+ /** Number of values carried by an inside (15,4) character. */
95
+ export declare const DATABAR14_INSIDE_RADIX = 1597;
96
+ /** Number of values carried by one outside/inside character pair. */
97
+ export declare const DATABAR14_PAIR_RADIX = 4537077;
98
+ /** Stand-alone and composite DataBar-14 payload domain, including linkage. */
99
+ export declare const DATABAR14_SYMBOL_LIMIT = 20000000000000n;
100
+ /** GS1 DataBar Limited divides its 13 data digits into two character values. */
101
+ export declare const DATABAR_LIMITED_PAIR_RADIX = 2013571;
102
+ /** Offset that switches a DataBar Limited value from stand-alone to composite. */
103
+ export declare const DATABAR_LIMITED_LINKAGE_OFFSET = 2015133531096n;
104
+ /** DataBar Limited carries GTIN values whose first digit is zero or one. */
105
+ export declare const DATABAR_LIMITED_DATA_LIMIT = 2000000000000n;
106
+ /** Locate the value group that an outside or inside character belongs to. */
107
+ export declare function dataBar14GroupFor(value: any, kind: any): Readonly<{
108
+ first: any;
109
+ last: any;
110
+ gsum: any;
111
+ oddModules: any;
112
+ evenModules: any;
113
+ oddWidest: any;
114
+ evenWidest: any;
115
+ oddTotal: any;
116
+ evenTotal: any;
117
+ }>;
118
+ /** Check the independently represented table identities. */
119
+ export declare function validateDataBarTables(): string[];
@@ -0,0 +1,57 @@
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
+ * Data Matrix ECC 200 decoder for an already sampled symbol.
33
+ *
34
+ * The detector owns locating, perspective correction and orientation. This
35
+ * module starts with the complete, upright symbol including its finder borders.
36
+ * The table entry is deliberately read through a small normalizer so table data
37
+ * remains declarative: it needs total rows/columns, one data-region's rows and
38
+ * columns, data/ECC codeword counts, and either a block count or data block
39
+ * lengths. The standard 144x144 uneven data blocks are supported.
40
+ *
41
+ * @module datamatrix/decoder
42
+ */
43
+ import { ChecksumError } from '../core/errors.js';
44
+ export type DecodeResult = {
45
+ text: string;
46
+ bytes: Uint8Array;
47
+ correctedErrors: number;
48
+ symbol: object;
49
+ };
50
+ /**
51
+ * Decode an upright, sampled Data Matrix ECC 200 symbol.
52
+ *
53
+ * @param {import('../core/bit-matrix.js').BitMatrix} matrix Full symbol, no quiet zone.
54
+ * @returns {{text: string, bytes: Uint8Array, correctedErrors: number, symbol: object}}
55
+ */
56
+ export declare function decodeDataMatrix(matrix: import('../core/bit-matrix.js').BitMatrix): DecodeResult;
57
+ export { ChecksumError };
@@ -0,0 +1,59 @@
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 type Point = {
32
+ x: number;
33
+ y: number;
34
+ };
35
+ export type Detection = {
36
+ corners: Point[];
37
+ dimension: number;
38
+ width: number;
39
+ height: number;
40
+ moduleSize: number;
41
+ matrix: import('../core/bit-matrix.js').BitMatrix;
42
+ };
43
+ /**
44
+ * Find Data Matrix symbols in a binarized image.
45
+ *
46
+ * @param {import('../core/bit-matrix.js').BitMatrix} binaryImage Set bit = dark.
47
+ * @returns {Detection | null} The strongest candidate, or null when absent.
48
+ */
49
+ export declare function detectDataMatrix(binaryImage: import('../core/bit-matrix.js').BitMatrix): Detection | null;
50
+ /**
51
+ * Detect and decode Data Matrix symbols. Detection failure is normal for an
52
+ * image without a symbol, so candidates that cannot decode are skipped.
53
+ *
54
+ * @param {import('../core/bit-matrix.js').BitMatrix} binaryImage
55
+ * @returns {(import("./decoder.js").DecodeResult & {corners: Point[]}) | null}
56
+ */
57
+ export declare function detectAndDecodeDataMatrix(binaryImage: import('../core/bit-matrix.js').BitMatrix): (import("./decoder.js").DecodeResult & {
58
+ corners: Point[];
59
+ }) | null;
@@ -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
+ /** Data Matrix ECC 200 encoder: ASCII/Base256, RS interleaving and Annex F placement. */
32
+ import { BitMatrix } from '../core/bit-matrix.js';
33
+ /** Encode a string (ASCII mode) or byte payload (Base256) into Data Matrix ECC 200. */
34
+ export declare function encodeDataMatrix(value: any, options?: {}): BitMatrix;
35
+ /** Encode already compacted ASCII/Base256 codewords, primarily for conformance tests. */
36
+ export declare function encodeDataMatrixCodewords(codewords: any, options?: {}): BitMatrix;