@qr-platform/qr-code.js 0.8.17

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 (208) hide show
  1. package/.github/workflows/publish.yml +18 -0
  2. package/CHANGELOG.md +233 -0
  3. package/LICENSE.md +77 -0
  4. package/README.md +188 -0
  5. package/docs/advanced-examples.md +523 -0
  6. package/docs/api-reference-guide.md +254 -0
  7. package/docs/documentation.md +1592 -0
  8. package/docs/examples.md +322 -0
  9. package/docs/license-management.md +501 -0
  10. package/docs/typescript-types-definitions.md +372 -0
  11. package/docs/usage-guide.md +622 -0
  12. package/lib/core/qr-code-js.d.ts +48 -0
  13. package/lib/core/qr-constant.d.ts +9 -0
  14. package/lib/core/qr-options-validation.d.ts +13 -0
  15. package/lib/core/qr-svg.d.ts +76 -0
  16. package/lib/core/qr-templates.d.ts +6 -0
  17. package/lib/figures/corner-dot.d.ts +24 -0
  18. package/lib/figures/corner-square.d.ts +24 -0
  19. package/lib/figures/dot.d.ts +31 -0
  20. package/lib/index.d.ts +52 -0
  21. package/lib/lib/image/GIFImage.d.ts +19 -0
  22. package/lib/lib/io/Base64.d.ts +10 -0
  23. package/lib/lib/io/Base64DecodeInputStream.d.ts +15 -0
  24. package/lib/lib/io/Base64EncodeOutputStream.d.ts +17 -0
  25. package/lib/lib/io/ByteArrayInputStream.d.ts +12 -0
  26. package/lib/lib/io/ByteArrayOutputStream.d.ts +12 -0
  27. package/lib/lib/io/InputStream.d.ts +10 -0
  28. package/lib/lib/io/OutputStream.d.ts +12 -0
  29. package/lib/lib/qr-code.d.ts +5 -0
  30. package/lib/lib/qrcode/BitBuffer.d.ts +11 -0
  31. package/lib/lib/qrcode/ErrorCorrectLevel.d.ts +23 -0
  32. package/lib/lib/qrcode/MaskPattern.d.ts +39 -0
  33. package/lib/lib/qrcode/Mode.d.ts +23 -0
  34. package/lib/lib/qrcode/Polynomial.d.ts +15 -0
  35. package/lib/lib/qrcode/QR8BitByte.d.ts +13 -0
  36. package/lib/lib/qrcode/QRAlphaNum.d.ts +13 -0
  37. package/lib/lib/qrcode/QRCode.d.ts +22 -0
  38. package/lib/lib/qrcode/QRCodeMinimal.d.ts +58 -0
  39. package/lib/lib/qrcode/QRData.d.ts +17 -0
  40. package/lib/lib/qrcode/QRKanji.d.ts +13 -0
  41. package/lib/lib/qrcode/QRMath.d.ts +13 -0
  42. package/lib/lib/qrcode/QRNumber.d.ts +14 -0
  43. package/lib/lib/qrcode/QRUtil.d.ts +25 -0
  44. package/lib/lib/qrcode/RSBlock.d.ts +16 -0
  45. package/lib/lib/text/createStringToBytes.d.ts +9 -0
  46. package/lib/lib/text/stringToBytes_SJIS.d.ts +8 -0
  47. package/lib/lib/text/stringToBytes_UTF8.d.ts +7 -0
  48. package/lib/lib/zbar-wasm/index.d.ts +1 -0
  49. package/lib/lib/zxing-js/src/browser/BrowserCodeReader.d.ts +410 -0
  50. package/lib/lib/zxing-js/src/browser/BrowserQRCodeReader.d.ts +29 -0
  51. package/lib/lib/zxing-js/src/browser/BrowserQRCodeSvgWriter.d.ts +46 -0
  52. package/lib/lib/zxing-js/src/browser/BrowserSvgCodeWriter.d.ts +49 -0
  53. package/lib/lib/zxing-js/src/browser/DecodeContinuouslyCallback.d.ts +6 -0
  54. package/lib/lib/zxing-js/src/browser/HTMLCanvasElementLuminanceSource.d.ts +27 -0
  55. package/lib/lib/zxing-js/src/browser/HTMLVisualMediaElement.d.ts +4 -0
  56. package/lib/lib/zxing-js/src/browser/VideoInputDevice.d.ts +22 -0
  57. package/lib/lib/zxing-js/src/browser.d.ts +3 -0
  58. package/lib/lib/zxing-js/src/core/ArgumentException.d.ts +7 -0
  59. package/lib/lib/zxing-js/src/core/ArithmeticException.d.ts +7 -0
  60. package/lib/lib/zxing-js/src/core/ArrayIndexOutOfBoundsException.d.ts +10 -0
  61. package/lib/lib/zxing-js/src/core/BarcodeFormat.d.ts +42 -0
  62. package/lib/lib/zxing-js/src/core/Binarizer.d.ts +53 -0
  63. package/lib/lib/zxing-js/src/core/BinaryBitmap.d.ts +78 -0
  64. package/lib/lib/zxing-js/src/core/ChecksumException.d.ts +8 -0
  65. package/lib/lib/zxing-js/src/core/DecodeHintType.d.ts +91 -0
  66. package/lib/lib/zxing-js/src/core/Dimension.d.ts +13 -0
  67. package/lib/lib/zxing-js/src/core/EncodeHintType.d.ts +99 -0
  68. package/lib/lib/zxing-js/src/core/Exception.d.ts +17 -0
  69. package/lib/lib/zxing-js/src/core/FormatException.d.ts +8 -0
  70. package/lib/lib/zxing-js/src/core/HighContrastLuminanceSource.d.ts +27 -0
  71. package/lib/lib/zxing-js/src/core/IllegalArgumentException.d.ts +7 -0
  72. package/lib/lib/zxing-js/src/core/IllegalStateException.d.ts +7 -0
  73. package/lib/lib/zxing-js/src/core/IndexOutOfBoundsException.d.ts +7 -0
  74. package/lib/lib/zxing-js/src/core/InvertedLuminanceSource.d.ts +22 -0
  75. package/lib/lib/zxing-js/src/core/LuminanceSource.d.ts +84 -0
  76. package/lib/lib/zxing-js/src/core/NodeLuminanceSource.d.ts +36 -0
  77. package/lib/lib/zxing-js/src/core/NotFoundException.d.ts +8 -0
  78. package/lib/lib/zxing-js/src/core/NullPointerException.d.ts +7 -0
  79. package/lib/lib/zxing-js/src/core/OutOfMemoryError.d.ts +6 -0
  80. package/lib/lib/zxing-js/src/core/PlanarYUVLuminanceSource.d.ts +35 -0
  81. package/lib/lib/zxing-js/src/core/RGBLuminanceSource.d.ts +21 -0
  82. package/lib/lib/zxing-js/src/core/Reader.d.ts +49 -0
  83. package/lib/lib/zxing-js/src/core/ReaderException.d.ts +7 -0
  84. package/lib/lib/zxing-js/src/core/ReedSolomonException.d.ts +7 -0
  85. package/lib/lib/zxing-js/src/core/Result.d.ts +52 -0
  86. package/lib/lib/zxing-js/src/core/ResultMetadataType.d.ts +68 -0
  87. package/lib/lib/zxing-js/src/core/ResultPoint.d.ts +34 -0
  88. package/lib/lib/zxing-js/src/core/ResultPointCallback.d.ts +11 -0
  89. package/lib/lib/zxing-js/src/core/UniversalLuminanceSource.d.ts +46 -0
  90. package/lib/lib/zxing-js/src/core/UnsupportedOperationException.d.ts +7 -0
  91. package/lib/lib/zxing-js/src/core/Writer.d.ts +30 -0
  92. package/lib/lib/zxing-js/src/core/WriterException.d.ts +7 -0
  93. package/lib/lib/zxing-js/src/core/common/BitArray.d.ts +111 -0
  94. package/lib/lib/zxing-js/src/core/common/BitMatrix.d.ts +98 -0
  95. package/lib/lib/zxing-js/src/core/common/BitSource.d.ts +38 -0
  96. package/lib/lib/zxing-js/src/core/common/CharacterSetECI.d.ts +89 -0
  97. package/lib/lib/zxing-js/src/core/common/DecoderResult.d.ts +64 -0
  98. package/lib/lib/zxing-js/src/core/common/DefaultGridSampler.d.ts +10 -0
  99. package/lib/lib/zxing-js/src/core/common/DetectorResult.d.ts +16 -0
  100. package/lib/lib/zxing-js/src/core/common/ECIEncoderSet.d.ts +37 -0
  101. package/lib/lib/zxing-js/src/core/common/ECIInput.d.ts +79 -0
  102. package/lib/lib/zxing-js/src/core/common/GlobalHistogramBinarizer.d.ts +29 -0
  103. package/lib/lib/zxing-js/src/core/common/GridSampler.d.ts +36 -0
  104. package/lib/lib/zxing-js/src/core/common/GridSamplerInstance.d.ts +18 -0
  105. package/lib/lib/zxing-js/src/core/common/HybridBinarizer.d.ts +54 -0
  106. package/lib/lib/zxing-js/src/core/common/MinimalECIInput.d.ts +123 -0
  107. package/lib/lib/zxing-js/src/core/common/PerspectiveTransform.d.ts +26 -0
  108. package/lib/lib/zxing-js/src/core/common/StringUtils.d.ts +48 -0
  109. package/lib/lib/zxing-js/src/core/common/detector/CornerDetector.d.ts +35 -0
  110. package/lib/lib/zxing-js/src/core/common/detector/MathUtils.d.ts +36 -0
  111. package/lib/lib/zxing-js/src/core/common/detector/WhiteRectangleDetector.d.ts +71 -0
  112. package/lib/lib/zxing-js/src/core/common/reedsolomon/AbstractGenericGF.d.ts +34 -0
  113. package/lib/lib/zxing-js/src/core/common/reedsolomon/AbstractGenericGFPoly.d.ts +36 -0
  114. package/lib/lib/zxing-js/src/core/common/reedsolomon/GenericGF.d.ts +58 -0
  115. package/lib/lib/zxing-js/src/core/common/reedsolomon/GenericGFPoly.d.ts +47 -0
  116. package/lib/lib/zxing-js/src/core/common/reedsolomon/ReedSolomonDecoder.d.ts +40 -0
  117. package/lib/lib/zxing-js/src/core/common/reedsolomon/ReedSolomonEncoder.d.ts +41 -0
  118. package/lib/lib/zxing-js/src/core/qrcode/QRCodeReader.d.ts +35 -0
  119. package/lib/lib/zxing-js/src/core/qrcode/QRCodeWriter.d.ts +13 -0
  120. package/lib/lib/zxing-js/src/core/qrcode/decoder/BitMatrixParser.d.ts +58 -0
  121. package/lib/lib/zxing-js/src/core/qrcode/decoder/DataBlock.d.ts +28 -0
  122. package/lib/lib/zxing-js/src/core/qrcode/decoder/DataMask.d.ts +36 -0
  123. package/lib/lib/zxing-js/src/core/qrcode/decoder/DecodedBitStreamParser.d.ts +30 -0
  124. package/lib/lib/zxing-js/src/core/qrcode/decoder/Decoder.d.ts +44 -0
  125. package/lib/lib/zxing-js/src/core/qrcode/decoder/ECB.d.ts +12 -0
  126. package/lib/lib/zxing-js/src/core/qrcode/decoder/ECBlocks.d.ts +16 -0
  127. package/lib/lib/zxing-js/src/core/qrcode/decoder/ErrorCorrectionLevel.d.ts +38 -0
  128. package/lib/lib/zxing-js/src/core/qrcode/decoder/FormatInformation.d.ts +33 -0
  129. package/lib/lib/zxing-js/src/core/qrcode/decoder/Mode.d.ts +56 -0
  130. package/lib/lib/zxing-js/src/core/qrcode/decoder/QRCodeDecoderMetaData.d.ts +21 -0
  131. package/lib/lib/zxing-js/src/core/qrcode/decoder/Version.d.ts +44 -0
  132. package/lib/lib/zxing-js/src/core/qrcode/detector/AlignmentPattern.d.ts +21 -0
  133. package/lib/lib/zxing-js/src/core/qrcode/detector/AlignmentPatternFinder.d.ts +82 -0
  134. package/lib/lib/zxing-js/src/core/qrcode/detector/Detector.d.ts +87 -0
  135. package/lib/lib/zxing-js/src/core/qrcode/detector/FinderPattern.d.ts +26 -0
  136. package/lib/lib/zxing-js/src/core/qrcode/detector/FinderPatternFinder.d.ts +114 -0
  137. package/lib/lib/zxing-js/src/core/qrcode/detector/FinderPatternInfo.d.ts +16 -0
  138. package/lib/lib/zxing-js/src/core/qrcode/encoder/BlockPair.d.ts +7 -0
  139. package/lib/lib/zxing-js/src/core/qrcode/encoder/ByteMatrix.d.ts +24 -0
  140. package/lib/lib/zxing-js/src/core/qrcode/encoder/Encoder.d.ts +85 -0
  141. package/lib/lib/zxing-js/src/core/qrcode/encoder/MaskUtil.d.ts +47 -0
  142. package/lib/lib/zxing-js/src/core/qrcode/encoder/MatrixUtil.d.ts +37 -0
  143. package/lib/lib/zxing-js/src/core/qrcode/encoder/QRCode.d.ts +29 -0
  144. package/lib/lib/zxing-js/src/core/util/Arrays.d.ts +45 -0
  145. package/lib/lib/zxing-js/src/core/util/ByteArrayOutputStream.d.ts +174 -0
  146. package/lib/lib/zxing-js/src/core/util/Charset.d.ts +7 -0
  147. package/lib/lib/zxing-js/src/core/util/Collections.d.ts +11 -0
  148. package/lib/lib/zxing-js/src/core/util/Float.d.ts +14 -0
  149. package/lib/lib/zxing-js/src/core/util/Formatter.d.ts +28 -0
  150. package/lib/lib/zxing-js/src/core/util/Integer.d.ts +19 -0
  151. package/lib/lib/zxing-js/src/core/util/Long.d.ts +12 -0
  152. package/lib/lib/zxing-js/src/core/util/OutputStream.d.ts +106 -0
  153. package/lib/lib/zxing-js/src/core/util/StandardCharsets.d.ts +7 -0
  154. package/lib/lib/zxing-js/src/core/util/StringBuilder.d.ts +21 -0
  155. package/lib/lib/zxing-js/src/core/util/StringEncoding.d.ts +51 -0
  156. package/lib/lib/zxing-js/src/core/util/System.d.ts +10 -0
  157. package/lib/lib/zxing-js/src/customTypings.d.ts +16 -0
  158. package/lib/lib/zxing-js/src/index.d.ts +5 -0
  159. package/lib/lib/zxing-js/src/node.d.ts +1 -0
  160. package/lib/license/LicenseManager.d.ts +69 -0
  161. package/lib/license/LicenseManagerNode.d.ts +64 -0
  162. package/lib/node.d.ts +37 -0
  163. package/lib/options-demo.d.ts +239 -0
  164. package/lib/plugins/QRBorderHelpers.d.ts +32 -0
  165. package/lib/plugins/QRBorderPlugin.d.ts +35 -0
  166. package/lib/plugins/QRValidatorZbar.d.ts +38 -0
  167. package/lib/plugins/QRValidatorZbarNode.d.ts +60 -0
  168. package/lib/plugins/QRValidatorZbarNodeSharp.d.ts +83 -0
  169. package/lib/qr-code-js-node.js +1 -0
  170. package/lib/qr-code-js.js +1 -0
  171. package/lib/templates/borders-inner-outter.d.ts +129 -0
  172. package/lib/templates/borders-inner-scale-offset.d.ts +497 -0
  173. package/lib/templates/borders-inner.d.ts +129 -0
  174. package/lib/templates/borders-no-license.d.ts +129 -0
  175. package/lib/templates/borders-outter.d.ts +129 -0
  176. package/lib/templates/borders-text-auto-curved.d.ts +129 -0
  177. package/lib/templates/borders-text-full-curved.d.ts +133 -0
  178. package/lib/templates/borders.d.ts +129 -0
  179. package/lib/templates/scales.d.ts +130 -0
  180. package/lib/templates/scan-validators/index.d.ts +1 -0
  181. package/lib/templates/scan-validators/tests/cases/basic-inverted.d.ts +9 -0
  182. package/lib/templates/scan-validators/tests/cases/basic-no-license.d.ts +3 -0
  183. package/lib/templates/scan-validators/tests/cases/basic.d.ts +3 -0
  184. package/lib/templates/scan-validators/tests/cases/colors-inverted.d.ts +2 -0
  185. package/lib/templates/scan-validators/tests/cases/colors.d.ts +58 -0
  186. package/lib/templates/scan-validators/tests/cases/out-of-borders-inverted.d.ts +9 -0
  187. package/lib/templates/scan-validators/tests/cases/out-of-borders.d.ts +9 -0
  188. package/lib/templates/scan-validators/tests/cases/position-inverted.d.ts +9 -0
  189. package/lib/templates/scan-validators/tests/cases/position.d.ts +3 -0
  190. package/lib/templates/scan-validators/tests/index.d.ts +27 -0
  191. package/lib/tools/browser-image-tools.d.ts +7 -0
  192. package/lib/tools/browser-utils.d.ts +18 -0
  193. package/lib/types/helper.d.ts +23 -0
  194. package/lib/utils/canvas-options.d.ts +7 -0
  195. package/lib/utils/color.d.ts +4 -0
  196. package/lib/utils/gradient.d.ts +26 -0
  197. package/lib/utils/image.d.ts +16 -0
  198. package/lib/utils/merge.d.ts +5 -0
  199. package/lib/utils/options.d.ts +220 -0
  200. package/lib/utils/qrcode.d.ts +8 -0
  201. package/lib/utils/scan-validator-node.d.ts +15 -0
  202. package/lib/utils/scan-validators/abstract-scan-validator.d.ts +43 -0
  203. package/lib/utils/scan-validators/zbar-scan-validator.d.ts +8 -0
  204. package/lib/utils/scan-validators/zxing-canvas-scan-validator.d.ts +10 -0
  205. package/lib/utils/scan-validators/zxing-scan-validator.d.ts +8 -0
  206. package/lib/utils/svg.d.ts +2 -0
  207. package/lib/utils/token-validator.d.ts +19 -0
  208. package/package.json +80 -0
@@ -0,0 +1,372 @@
1
+ # QRCode.js TypeScript Types and Definitions
2
+ <a id="start"></a>
3
+
4
+ Below is a complete TypeScript Types and Definitions section for all options available in the QRCode.js library. This section is designed as a standalone reference, defining the structure of the options object with interfaces and enums to ensure type safety and clarity for users configuring a QR code.
5
+
6
+ ## Main Options Interface
7
+
8
+ The `Options` interface is the top-level configuration object for generating a QR code. It includes properties for the data to encode, shape, layout, and various styling options.
9
+
10
+ ```typescript
11
+ import { QRCodeJs, Options } from '@qr-platform/qr-code.js'; // Import from '@qr-platform/qr-code.js' for browser
12
+ or
13
+ import { QRCodeJs, Options } from '@qr-platform/qr-code.js/node'; // Import from '@qr-platform/qr-code.js/node' for Node.js
14
+
15
+ ```
16
+
17
+ ```typescript
18
+ interface Options {
19
+ /** The text, URL, or other data to encode into the QR code. This is the only required option. */
20
+ data: string;
21
+
22
+ /** The overall shape of the QR code's boundary. */
23
+ shape: ShapeType;
24
+
25
+ /** The quiet zone (empty space) around the QR code in pixels. */
26
+ margin: number;
27
+
28
+ /** When true, the QR code SVG resizes dynamically to fill the width or height of the parent container, with no internal size dimensions applied. */
29
+ isResponsive: boolean;
30
+
31
+ /** Scales the QR code size relative to its container or border. */
32
+ scale: number;
33
+
34
+ /** Applies a vertical offset (positive moves down, negative moves up) relative to the center. */
35
+ offset: number;
36
+
37
+ /** Applies an absolute vertical offset in pixels. */
38
+ verticalOffset: number;
39
+
40
+ /** Applies an absolute horizontal offset in pixels. */
41
+ horizontalOffset: number;
42
+
43
+ /** Options related to the underlying QR code generation algorithm. */
44
+ qrOptions: QrOptions;
45
+
46
+ /** Options for styling the dots in the QR code. */
47
+ dotsOptions: DotsOptions;
48
+
49
+ /** Options for styling the corner squares. Overrides dotsOptions. */
50
+ cornersSquareOptions?: CornersSquareOptions;
51
+
52
+ /** Options for styling the corner dots. Overrides cornersSquareOptions. */
53
+ cornersDotOptions?: CornersDotOptions;
54
+
55
+ /** Options for styling the background. Set to false to disable. */
56
+ backgroundOptions?: BackgroundOptions | false;
57
+
58
+ /** URL, Buffer, or Blob of an image to embed in the QR code. */
59
+ image?: string | Buffer | Blob;
60
+
61
+ /** Options for the embedded image. */
62
+ imageOptions: ImageOptions;
63
+
64
+ /** Options for adding decorative borders (premium feature). */
65
+ borderOptions?: BorderOptions;
66
+ }
67
+ ```
68
+
69
+ ### QrOptions
70
+
71
+ Options for the QR code generation algorithm.
72
+
73
+ ```typescript
74
+ interface QrOptions {
75
+ /** Specifies the QR code version (size/capacity). 0 means automatic detection. */
76
+ typeNumber: number;
77
+
78
+ /** The encoding mode (e.g., Byte, Numeric, Kanji). Usually auto-detected. */
79
+ mode?: Mode;
80
+
81
+ /** The error correction level, determining redundancy. */
82
+ errorCorrectionLevel: ErrorCorrectionLevel;
83
+ }
84
+ ```
85
+
86
+ ### DotsOptions
87
+
88
+ Options for styling the dots in the QR code.
89
+
90
+ ```typescript
91
+ interface DotsOptions {
92
+ /** The shape of the dots. */
93
+ type: DotType;
94
+
95
+ /** The color of the dots. */
96
+ color: string;
97
+
98
+ /** The size of the dots in pixels. */
99
+ size: number;
100
+
101
+ /** Apply a gradient fill to the dots. */
102
+ gradient?: Gradient;
103
+ }
104
+ ```
105
+
106
+ ### CornersSquareOptions
107
+
108
+ Options for styling the corner squares.
109
+
110
+ ```typescript
111
+ interface CornersSquareOptions {
112
+ /** The shape of the corner squares. Inherits from dotsOptions.type if not specified. */
113
+ type?: CornerSquareType;
114
+
115
+ /** The color of the corner squares. Inherits from dotsOptions.color if not specified. */
116
+ color?: string;
117
+
118
+ /** Apply a gradient fill to the corner squares. */
119
+ gradient?: Gradient;
120
+ }
121
+ ```
122
+
123
+ ### CornersDotOptions
124
+
125
+ Options for styling the corner dots.
126
+
127
+ ```typescript
128
+ interface CornersDotOptions {
129
+ /** The shape of the corner dots. Inherits from cornersSquareOptions.type if not specified. */
130
+ type?: CornerDotType;
131
+
132
+ /** The color of the corner dots. Inherits from cornersSquareOptions.color if not specified. */
133
+ color?: string;
134
+
135
+ /** Apply a gradient fill to the corner dots. */
136
+ gradient?: Gradient;
137
+ }
138
+ ```
139
+
140
+ ### BackgroundOptions
141
+
142
+ Options for styling the background.
143
+
144
+ ```typescript
145
+ interface BackgroundOptions {
146
+ /** The background color. */
147
+ color?: string;
148
+
149
+ /** Rounds the corners of the background (0-1 or percentage). */
150
+ round?: number | string;
151
+
152
+ /** Apply a gradient fill to the background. */
153
+ gradient?: Gradient;
154
+ }
155
+ ```
156
+
157
+ ### ImageOptions
158
+
159
+ Options for the embedded image.
160
+
161
+ ```typescript
162
+ interface ImageOptions {
163
+ /** How the image is embedded. */
164
+ mode?: ImageMode;
165
+
166
+ /** Relative size of the image (0-1). */
167
+ imageSize: number;
168
+
169
+ /** Margin around the image in dot units. */
170
+ margin: number;
171
+
172
+ /** CORS setting for the image. */
173
+ crossOrigin?: string;
174
+
175
+ /** Fill color or gradient for transparent areas. */
176
+ fill?: {
177
+ color: string;
178
+ gradient?: Gradient;
179
+ };
180
+ }
181
+ ```
182
+
183
+ ### BorderOptions (Premium Feature)
184
+
185
+ Options for adding decorative borders.
186
+
187
+ ```typescript
188
+ interface BorderOptions {
189
+ /** Master switch to enable/disable borders. */
190
+ hasBorder: boolean;
191
+
192
+ /** Thickness of the main border in pixels. */
193
+ thickness: number;
194
+
195
+ /** Color of the main border. */
196
+ color: string;
197
+
198
+ /** Corner rounding of the border (e.g., '10%', '20px'). */
199
+ radius: string;
200
+
201
+ /** Thickness for border sides with disabled decorations. */
202
+ noBorderThickness: number;
203
+
204
+ /** Background color for the border area. */
205
+ background?: string;
206
+
207
+ /** Options for scaling/offsetting the inner content area. */
208
+ inner?: {
209
+ radius: string;
210
+ scale: number;
211
+ horizontalOffset: number;
212
+ verticalOffset: number;
213
+ };
214
+
215
+ /** Options for an additional outer border. */
216
+ borderOuter?: {
217
+ color: string;
218
+ thickness: number;
219
+ };
220
+
221
+ /** Options for an additional inner border. */
222
+ borderInner?: {
223
+ color: string;
224
+ thickness: number;
225
+ };
226
+
227
+ /** Add text or images to specific sides of the border. */
228
+ decorations?: {
229
+ top?: DecorationOptions;
230
+ right?: DecorationOptions;
231
+ bottom?: DecorationOptions;
232
+ left?: DecorationOptions;
233
+ };
234
+ }
235
+ ```
236
+
237
+ ### DecorationOptions (for Border Decorations)
238
+
239
+ Options for customizing decorations on border sides.
240
+
241
+ ```typescript
242
+ interface DecorationOptions {
243
+ /** Whether the decoration for this side is disabled. */
244
+ disabled: boolean;
245
+
246
+ /** Whether to enable text on this side of the border. */
247
+ enableText: boolean;
248
+
249
+ /** Positioning offset for the decoration. */
250
+ offset: number;
251
+
252
+ /** Adjustment for the text curve. */
253
+ curveAdjustment: number;
254
+
255
+ /** Whether to disable curved text. */
256
+ curveDisabled: boolean;
257
+
258
+ /** Radius of the text curve (e.g., '50%', '100px'). */
259
+ curveRadius: string;
260
+
261
+ /** The type of decoration to use ('text' or 'image'). */
262
+ type: 'text' | 'image';
263
+
264
+ /** The text content or image URL for the decoration. */
265
+ value: string;
266
+
267
+ /** Style options for text decorations. */
268
+ style?: {
269
+ fontFace: string;
270
+ fontSize: number;
271
+ fontColor: string;
272
+ letterSpacing: number;
273
+ fontWeight: 'normal' | 'bold';
274
+ };
275
+ }
276
+ ```
277
+
278
+ ### Gradient
279
+
280
+ Options for applying gradient fills.
281
+
282
+ ```typescript
283
+ interface Gradient {
284
+ /** Specifies the type of gradient: 'linear' or 'radial'. */
285
+ type: 'linear' | 'radial';
286
+
287
+ /** Rotation angle in radians for linear gradients. */
288
+ rotation?: number;
289
+
290
+ /** Array of color stops defining the gradient (offset: 0-1, color: CSS string). */
291
+ colorStops: Array<{ offset: number; color: string }>;
292
+ }
293
+ ```
294
+
295
+ ## Enums
296
+
297
+ These enums provide predefined values for certain properties, ensuring type safety.
298
+
299
+ ```typescript
300
+ enum ShapeType {
301
+ square = 'square',
302
+ circle = 'circle'
303
+ }
304
+
305
+ enum Mode {
306
+ numeric = 'numeric',
307
+ alphanumeric = 'alphanumeric',
308
+ byte = 'byte',
309
+ kanji = 'kanji',
310
+ unicode = 'unicode'
311
+ }
312
+
313
+ enum ErrorCorrectionLevel {
314
+ L = 'L', // 7% error recovery
315
+ M = 'M', // 15% error recovery
316
+ Q = 'Q', // 25% error recovery
317
+ H = 'H' // 30% error recovery
318
+ }
319
+
320
+ enum DotType {
321
+ dot = 'dot',
322
+ square = 'square',
323
+ rounded = 'rounded',
324
+ extraRounded = 'extra-rounded',
325
+ classy = 'classy',
326
+ classyRounded = 'classy-rounded',
327
+ verticalLine = 'vertical-line',
328
+ horizontalLine = 'horizontal-line',
329
+ randomDot = 'random-dot',
330
+ smallSquare = 'small-square',
331
+ tinySquare = 'tiny-square',
332
+ star = 'star',
333
+ plus = 'plus',
334
+ diamond = 'diamond'
335
+ }
336
+
337
+ enum CornerSquareType {
338
+ dot = 'dot',
339
+ square = 'square',
340
+ rounded = 'rounded',
341
+ classy = 'classy',
342
+ outpoint = 'outpoint',
343
+ inpoint = 'inpoint'
344
+ }
345
+
346
+ enum CornerDotType {
347
+ dot = 'dot',
348
+ square = 'square',
349
+ heart = 'heart',
350
+ rounded = 'rounded',
351
+ classy = 'classy',
352
+ outpoint = 'outpoint',
353
+ inpoint = 'inpoint'
354
+ }
355
+
356
+ enum ImageMode {
357
+ center = 'center',
358
+ overlay = 'overlay',
359
+ background = 'background'
360
+ }
361
+ ```
362
+
363
+ ---
364
+
365
+ ### See Also
366
+ - [QRCode.js Documentation](./documentation.md#start)
367
+ - [Quick References Guide](./quick-references-guide.md#start)
368
+ - [API Reference Guide](./api-reference-guide.md#start)
369
+ - [TypeScript Types and Definitions](./typescript-types-definitions.md#start)
370
+ - [License Management](./license-management.md#start)
371
+ - [Basic Examples](./examples.md#start)
372
+ - [Advanced Examples](./advanced-examples.md#start)