@lglab/react-qr-code 1.4.5 → 1.4.10

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 (57) hide show
  1. package/dist/index.es.js +1625 -1330
  2. package/dist/src/components/background.d.ts +9 -0
  3. package/dist/src/components/background.d.ts.map +1 -0
  4. package/dist/src/components/data-modules.d.ts +4 -0
  5. package/dist/src/components/data-modules.d.ts.map +1 -0
  6. package/dist/src/components/data-modules.test.d.ts +2 -0
  7. package/dist/src/components/data-modules.test.d.ts.map +1 -0
  8. package/dist/src/components/finder-patter-inner.test.d.ts +2 -0
  9. package/dist/src/components/finder-patter-inner.test.d.ts.map +1 -0
  10. package/dist/src/components/finder-patter-outer.test.d.ts +2 -0
  11. package/dist/src/components/finder-patter-outer.test.d.ts.map +1 -0
  12. package/dist/src/components/finder-patterns-inner.d.ts +4 -0
  13. package/dist/src/components/finder-patterns-inner.d.ts.map +1 -0
  14. package/dist/src/components/finder-patterns-outer.d.ts +4 -0
  15. package/dist/src/components/finder-patterns-outer.d.ts.map +1 -0
  16. package/dist/src/components/gradient.d.ts +8 -0
  17. package/dist/src/components/gradient.d.ts.map +1 -0
  18. package/dist/src/constants.d.ts +72 -0
  19. package/dist/src/constants.d.ts.map +1 -0
  20. package/dist/src/hooks/use-ids.d.ts +5 -0
  21. package/dist/src/hooks/use-ids.d.ts.map +1 -0
  22. package/dist/src/hooks/use-qr-code.d.ts +18 -0
  23. package/dist/src/hooks/use-qr-code.d.ts.map +1 -0
  24. package/dist/src/index.d.ts +3 -0
  25. package/dist/src/index.d.ts.map +1 -0
  26. package/dist/src/lib/qrcodegen/index.d.ts +101 -0
  27. package/dist/src/lib/qrcodegen/index.d.ts.map +1 -0
  28. package/dist/src/react-qr-code.d.ts +4 -0
  29. package/dist/src/react-qr-code.d.ts.map +1 -0
  30. package/dist/src/react-qr-code.test.d.ts +2 -0
  31. package/dist/src/react-qr-code.test.d.ts.map +1 -0
  32. package/dist/src/test/data-modules-neightbours.d.ts +29 -0
  33. package/dist/src/test/data-modules-neightbours.d.ts.map +1 -0
  34. package/dist/src/types/lib.d.ts +174 -0
  35. package/dist/src/types/lib.d.ts.map +1 -0
  36. package/dist/src/types/utils.d.ts +55 -0
  37. package/dist/src/types/utils.d.ts.map +1 -0
  38. package/dist/src/utils/data-modules.d.ts +18 -0
  39. package/dist/src/utils/data-modules.d.ts.map +1 -0
  40. package/dist/src/utils/data-modules.test.d.ts +2 -0
  41. package/dist/src/utils/data-modules.test.d.ts.map +1 -0
  42. package/dist/src/utils/download.d.ts +4 -0
  43. package/dist/src/utils/download.d.ts.map +1 -0
  44. package/dist/src/utils/finder-patterns-inner.d.ts +13 -0
  45. package/dist/src/utils/finder-patterns-inner.d.ts.map +1 -0
  46. package/dist/src/utils/finder-patterns-outer.d.ts +18 -0
  47. package/dist/src/utils/finder-patterns-outer.d.ts.map +1 -0
  48. package/dist/src/utils/qr-code.d.ts +6 -0
  49. package/dist/src/utils/qr-code.d.ts.map +1 -0
  50. package/dist/src/utils/qr-code.test.d.ts +2 -0
  51. package/dist/src/utils/qr-code.test.d.ts.map +1 -0
  52. package/dist/src/utils/settings.d.ts +15 -0
  53. package/dist/src/utils/settings.d.ts.map +1 -0
  54. package/dist/src/utils/svg.d.ts +12 -0
  55. package/dist/src/utils/svg.d.ts.map +1 -0
  56. package/package.json +13 -14
  57. package/dist/index.d.ts +0 -300
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../../src/utils/download.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAE3E,eAAO,MAAM,WAAW,GAAI,gCAAgC,gBAAgB,SAmB3E,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,6GAU5B,mBAAmB,SA8DrB,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { FilterFnProps } from '../types/utils';
2
+ export declare const isFinderPatternInnerModule: ({ x, y, numCells, }: FilterFnProps) => boolean;
3
+ export declare const finderPatternsInnerLeaf: ({ x, y, radius, }: {
4
+ x: number;
5
+ y: number;
6
+ radius: number;
7
+ }) => string;
8
+ export declare const finderPatternsInnerInOutPoint: ({ x, y, radius, }: {
9
+ x: number;
10
+ y: number;
11
+ radius: number;
12
+ }) => string;
13
+ //# sourceMappingURL=finder-patterns-inner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finder-patterns-inner.d.ts","sourceRoot":"","sources":["../../../src/utils/finder-patterns-inner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,eAAO,MAAM,0BAA0B,GAAI,qBAIxC,aAAa,KAAG,OASlB,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,mBAIrC;IACD,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,MAAM,EAAE,MAAM,CAAA;CACf,WAeA,CAAA;AAED,eAAO,MAAM,6BAA6B,GAAI,mBAI3C;IACD,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,MAAM,EAAE,MAAM,CAAA;CACf,WAcA,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { FilterFnProps } from '../types/utils';
2
+ export declare const isFinderPatternOuterModule: ({ x, y, numCells, }: FilterFnProps) => boolean;
3
+ export declare const finderPatternsOuterRoundedSquare: ({ x, y, radius, }: {
4
+ x: number;
5
+ y: number;
6
+ radius: number;
7
+ }) => string;
8
+ export declare const finderPatternsOuterLeaf: ({ x, y, radius, }: {
9
+ x: number;
10
+ y: number;
11
+ radius: number;
12
+ }) => string;
13
+ export declare const finderPatternsOuterInOutPoint: ({ x, y, radius, }: {
14
+ x: number;
15
+ y: number;
16
+ radius: number;
17
+ }) => string;
18
+ //# sourceMappingURL=finder-patterns-outer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finder-patterns-outer.d.ts","sourceRoot":"","sources":["../../../src/utils/finder-patterns-outer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,eAAO,MAAM,0BAA0B,GAAI,qBAIxC,aAAa,KAAG,OASlB,CAAA;AAED,eAAO,MAAM,gCAAgC,GAAI,mBAI9C;IACD,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,MAAM,EAAE,MAAM,CAAA;CACf,WAuBA,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,mBAIrC;IACD,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,MAAM,EAAE,MAAM,CAAA;CACf,WAuBA,CAAA;AAED,eAAO,MAAM,6BAA6B,GAAI,mBAI3C;IACD,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,MAAM,EAAE,MAAM,CAAA;CACf,WAsBA,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { Excavation, ImageSettings, Modules } from '../types/lib';
2
+ import { CalculatedImageSettings } from '../types/utils';
3
+ export declare const excavateModules: (modules: Modules, excavation: Excavation) => Modules;
4
+ export declare const getImageSettings: (cells: Modules, size: number, margin: number, imageSettings?: ImageSettings) => CalculatedImageSettings | null;
5
+ export declare const getMarginSize: (marginSize?: number) => number;
6
+ //# sourceMappingURL=qr-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qr-code.d.ts","sourceRoot":"","sources":["../../../src/utils/qr-code.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAE7D,eAAO,MAAM,eAAe,GAAI,SAAS,OAAO,EAAE,YAAY,UAAU,KAAG,OAY1E,CAAA;AAED,eAAO,MAAM,gBAAgB,GAC3B,OAAO,OAAO,EACd,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd,gBAAgB,aAAa,KAC5B,uBAAuB,GAAG,IA0B5B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,aAAa,MAAM,KAAG,MAKnD,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=qr-code.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qr-code.test.d.ts","sourceRoot":"","sources":["../../../src/utils/qr-code.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { DataModulesSettings, FinderPatternInnerSettings, FinderPatternOuterSettings } from '../types/lib';
2
+ export declare const sanitizeDataModulesSettings: (settings?: DataModulesSettings) => {
3
+ color: string;
4
+ style: import('..').DataModulesStyle;
5
+ randomSize: boolean;
6
+ };
7
+ export declare const sanitizeFinderPatternOuterSettings: (settings?: FinderPatternOuterSettings) => {
8
+ color: string;
9
+ style: import('..').FinderPatternOuterStyle;
10
+ };
11
+ export declare const sanitizeFinderPatternInnerSettings: (settings?: FinderPatternInnerSettings) => {
12
+ color: string;
13
+ style: import('..').FinderPatternInnerStyle;
14
+ };
15
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/utils/settings.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,cAAc,CAAA;AAErB,eAAO,MAAM,2BAA2B,GAAI,WAAW,mBAAmB;;;;CAMzE,CAAA;AAED,eAAO,MAAM,kCAAkC,GAC7C,WAAW,0BAA0B;;;CAMtC,CAAA;AAED,eAAO,MAAM,kCAAkC,GAC7C,WAAW,0BAA0B;;;CAMtC,CAAA"}
@@ -0,0 +1,12 @@
1
+ export declare function numToAttr(value: number): string;
2
+ export declare const calculateGradientVectors: (rotation: number) => {
3
+ x1: string;
4
+ y1: string;
5
+ x2: string;
6
+ y2: string;
7
+ };
8
+ export declare const star: (cx: number, cy: number, size: number, spikes: number) => string;
9
+ export declare const pinchedSquare: (x: number, y: number, size: number, controlOffset: number) => string;
10
+ export declare const hashtag: (x: number, y: number, size: number) => string;
11
+ export declare const heart: (x: number, y: number, size: number) => string;
12
+ //# sourceMappingURL=svg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../../src/utils/svg.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,UAEtC;AAED,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM;;;;;CAcxD,CAAA;AAED,eAAO,MAAM,IAAI,GAAI,IAAI,MAAM,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,MAc3E,CAAA;AAED,eAAO,MAAM,aAAa,GACxB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,MAAM,MAAM,EACZ,eAAe,MAAM,WAOlB,CAAA;AAEL,eAAO,MAAM,OAAO,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,MAAM,MAAM,WAgCzD,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,MAAM,MAAM,WAiIvD,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lglab/react-qr-code",
3
- "version": "1.4.5",
3
+ "version": "1.4.10",
4
4
  "description": "React library to generate QR codes",
5
5
  "author": "LGLab",
6
6
  "license": "MIT",
@@ -30,13 +30,13 @@
30
30
  "open-source"
31
31
  ],
32
32
  "type": "module",
33
- "types": "./dist/index.d.ts",
33
+ "types": "./dist/src/index.d.ts",
34
34
  "main": "./dist/index.es.js",
35
35
  "module": "./dist/index.es.js",
36
36
  "exports": {
37
37
  ".": {
38
38
  "import": "./dist/index.es.js",
39
- "types": "./dist/index.d.ts"
39
+ "types": "./dist/src/index.d.ts"
40
40
  }
41
41
  },
42
42
  "files": [
@@ -46,17 +46,16 @@
46
46
  "react": "^18 || ^19"
47
47
  },
48
48
  "devDependencies": {
49
- "@types/node": "^22.14.1",
50
- "@types/react": "^19.1.2",
51
- "@types/react-dom": "^19.1.2",
52
- "@vitejs/plugin-react": "^4.4.0",
53
- "globals": "^16.0.0",
54
- "react": "^19.1.0",
55
- "react-dom": "^19.1.0",
56
- "typescript": "~5.8.3",
57
- "typescript-eslint": "^8.30.1",
58
- "vite": "^6.3.2",
59
- "vite-plugin-dts": "^4.5.3"
49
+ "@types/node": "^25.5.0",
50
+ "@types/react": "^19.2.14",
51
+ "@types/react-dom": "^19.2.3",
52
+ "@vitejs/plugin-react": "^6.0.1",
53
+ "globals": "^17.4.0",
54
+ "react": "^19.2.4",
55
+ "react-dom": "^19.2.4",
56
+ "typescript": "~6.0.2",
57
+ "vite": "^8.0.3",
58
+ "vite-plugin-dts": "^4.5.4"
60
59
  },
61
60
  "scripts": {
62
61
  "build": "tsc -b && vite build"
package/dist/index.d.ts DELETED
@@ -1,300 +0,0 @@
1
- import { ForwardRefExoticComponent } from 'react';
2
- import { RefAttributes } from 'react';
3
-
4
- /**
5
- * ReactQRCode props.
6
- */
7
- export declare type BackgroundSettings = string | GradientSettings;
8
-
9
- export declare type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined;
10
-
11
- export declare interface DataModulesSettings {
12
- color?: string;
13
- style?: DataModulesStyle;
14
- randomSize?: boolean;
15
- }
16
-
17
- export declare type DataModulesStyle = 'square' | 'square-sm' | 'pinched-square' | 'rounded' | 'leaf' | 'vertical-line' | 'horizontal-line' | 'circle' | 'diamond' | 'star' | 'heart' | 'hashtag';
18
-
19
- export declare type DownloadFileFormat = 'svg' | 'png' | 'jpeg';
20
-
21
- export declare interface DownloadOptions {
22
- name?: string;
23
- format?: DownloadFileFormat;
24
- size?: number;
25
- }
26
-
27
- export declare type ERROR_LEVEL_MAPPED_TYPE = {
28
- [index in ErrorCorrectionLevel]: qrcodegen.QrCode.Ecc;
29
- };
30
-
31
- export declare type ErrorCorrectionLevel = 'L' | 'M' | 'Q' | 'H';
32
-
33
- export declare type Excavation = {
34
- x: number;
35
- y: number;
36
- w: number;
37
- h: number;
38
- };
39
-
40
- export declare interface FinderPatternInnerSettings {
41
- color?: string;
42
- style?: FinderPatternInnerStyle;
43
- }
44
-
45
- export declare type FinderPatternInnerStyle = 'square' | 'pinched-square' | 'rounded-sm' | 'rounded' | 'rounded-lg' | 'circle' | 'inpoint-sm' | 'inpoint' | 'inpoint-lg' | 'outpoint-sm' | 'outpoint' | 'outpoint-lg' | 'leaf-sm' | 'leaf' | 'leaf-lg' | 'diamond' | 'star' | 'heart' | 'hashtag';
46
-
47
- export declare interface FinderPatternOuterSettings {
48
- color?: string;
49
- style?: FinderPatternOuterStyle;
50
- }
51
-
52
- export declare type FinderPatternOuterStyle = 'square' | 'pinched-square' | 'rounded-sm' | 'rounded' | 'rounded-lg' | 'circle' | 'inpoint-sm' | 'inpoint' | 'inpoint-lg' | 'outpoint-sm' | 'outpoint' | 'outpoint-lg' | 'leaf-sm' | 'leaf' | 'leaf-lg';
53
-
54
- export declare interface GradientSettings {
55
- type: GradientSettingsType;
56
- stops: GradientSettingsStop[];
57
- rotation?: number;
58
- }
59
-
60
- export declare interface GradientSettingsStop {
61
- offset: string;
62
- color: string;
63
- }
64
-
65
- export declare type GradientSettingsType = 'linear' | 'radial';
66
-
67
- /**
68
- * Image settings for the QR Code.
69
- */
70
- export declare interface ImageSettings {
71
- /**
72
- * The URI of the embedded image.
73
- */
74
- src: string;
75
- /**
76
- * The height, in pixels, of the image.
77
- */
78
- height: number;
79
- /**
80
- * The width, in pixels, of the image.
81
- */
82
- width: number;
83
- /**
84
- * Whether or not to "excavate" the modules around the embedded image. This
85
- * means that any modules the embedded image overlaps will use the background
86
- * color.
87
- */
88
- excavate?: boolean;
89
- /**
90
- * The horiztonal offset of the embedded image, starting from the top left corner.
91
- * Will center if not specified.
92
- */
93
- x?: number;
94
- /**
95
- * The vertical offset of the embedded image, starting from the top left corner.
96
- * Will center if not specified.
97
- */
98
- y?: number;
99
- /**
100
- * The opacity of the embedded image in the range of 0-1.
101
- * @defaultValue 1
102
- */
103
- opacity?: number;
104
- /**
105
- * The cross-origin value to use when loading the image. This is used to
106
- * ensure compatibility with CORS, particularly when extracting image data
107
- * from QRCodeCanvas.
108
- * Note: `undefined` is treated differently than the seemingly equivalent
109
- * empty string. This is intended to align with HTML behavior where omitting
110
- * the attribute behaves differently than the empty string.
111
- */
112
- crossOrigin?: CrossOrigin;
113
- }
114
-
115
- /**
116
- * qrcodegen
117
- */
118
- export declare type Modules = ReturnType<qrcodegen.QrCode['getModules']>;
119
-
120
- /**
121
- * @license QR Code generator library (TypeScript)
122
- * Copyright (c) Project Nayuki.
123
- * SPDX-License-Identifier: MIT
124
- */
125
- declare namespace qrcodegen {
126
- type bit = number;
127
- type byte = number;
128
- type int = number;
129
- class QrCode {
130
- readonly version: int;
131
- readonly errorCorrectionLevel: QrCode.Ecc;
132
- static encodeText(text: string, ecl: QrCode.Ecc): QrCode;
133
- static encodeBinary(data: Readonly<Array<byte>>, ecl: QrCode.Ecc): QrCode;
134
- static encodeSegments(segs: Readonly<Array<QrSegment>>, ecl: QrCode.Ecc, minVersion?: int, maxVersion?: int, mask?: int, boostEcl?: boolean): QrCode;
135
- readonly size: int;
136
- readonly mask: int;
137
- private readonly modules;
138
- private readonly isFunction;
139
- constructor(version: int, errorCorrectionLevel: QrCode.Ecc, dataCodewords: Readonly<Array<byte>>, msk: int);
140
- getModule(x: int, y: int): boolean;
141
- getModules(): boolean[][];
142
- private drawFunctionPatterns;
143
- private drawFormatBits;
144
- private drawVersion;
145
- private drawFinderPattern;
146
- private drawAlignmentPattern;
147
- private setFunctionModule;
148
- private addEccAndInterleave;
149
- private drawCodewords;
150
- private applyMask;
151
- private getPenaltyScore;
152
- private getAlignmentPatternPositions;
153
- private static getNumRawDataModules;
154
- private static getNumDataCodewords;
155
- private static reedSolomonComputeDivisor;
156
- private static reedSolomonComputeRemainder;
157
- private static reedSolomonMultiply;
158
- private finderPenaltyCountPatterns;
159
- private finderPenaltyTerminateAndCount;
160
- private finderPenaltyAddHistory;
161
- static readonly MIN_VERSION: int;
162
- static readonly MAX_VERSION: int;
163
- private static readonly PENALTY_N1;
164
- private static readonly PENALTY_N2;
165
- private static readonly PENALTY_N3;
166
- private static readonly PENALTY_N4;
167
- private static readonly ECC_CODEWORDS_PER_BLOCK;
168
- private static readonly NUM_ERROR_CORRECTION_BLOCKS;
169
- }
170
- class QrSegment {
171
- readonly mode: QrSegment.Mode;
172
- readonly numChars: int;
173
- private readonly bitData;
174
- static makeBytes(data: Readonly<Array<byte>>): QrSegment;
175
- static makeNumeric(digits: string): QrSegment;
176
- static makeAlphanumeric(text: string): QrSegment;
177
- static makeSegments(text: string): Array<QrSegment>;
178
- static makeEci(assignVal: int): QrSegment;
179
- static isNumeric(text: string): boolean;
180
- static isAlphanumeric(text: string): boolean;
181
- constructor(mode: QrSegment.Mode, numChars: int, bitData: Array<bit>);
182
- getData(): Array<bit>;
183
- static getTotalBits(segs: Readonly<Array<QrSegment>>, version: int): number;
184
- private static toUtf8ByteArray;
185
- private static readonly NUMERIC_REGEX;
186
- private static readonly ALPHANUMERIC_REGEX;
187
- private static readonly ALPHANUMERIC_CHARSET;
188
- }
189
- {};
190
- }
191
-
192
- declare namespace qrcodegen.QrCode {
193
- type int = number;
194
- class Ecc {
195
- readonly ordinal: int;
196
- readonly formatBits: int;
197
- static readonly LOW: Ecc;
198
- static readonly MEDIUM: Ecc;
199
- static readonly QUARTILE: Ecc;
200
- static readonly HIGH: Ecc;
201
- private constructor();
202
- }
203
- {};
204
- }
205
-
206
- declare namespace qrcodegen.QrSegment {
207
- type int = number;
208
- class Mode {
209
- readonly modeBits: int;
210
- private readonly numBitsCharCount;
211
- static readonly NUMERIC: Mode;
212
- static readonly ALPHANUMERIC: Mode;
213
- static readonly BYTE: Mode;
214
- static readonly KANJI: Mode;
215
- static readonly ECI: Mode;
216
- private constructor();
217
- numCharCountBits(ver: int): int;
218
- }
219
- {};
220
- }
221
-
222
- export declare const ReactQRCode: ForwardRefExoticComponent<Omit<ReactQRCodeProps, "ref"> & RefAttributes<ReactQRCodeRef>>;
223
-
224
- export declare interface ReactQRCodeProps {
225
- ref?: React.Ref<ReactQRCodeRef>;
226
- /**
227
- * The value to encode into the QR Code. An array of strings can be passed in
228
- * to represent multiple segments to further optimize the QR Code.
229
- */
230
- value: string | string[];
231
- /**
232
- * The size, in pixels, to render the QR Code.
233
- * @defaultValue 128
234
- */
235
- size?: number;
236
- /**
237
- * The Error Correction Level to use.
238
- * @see https://www.qrcode.com/en/about/error_correction.html
239
- * @defaultValue L
240
- */
241
- level?: ErrorCorrectionLevel;
242
- /**
243
- * The number of _modules_ to use for margin. The QR Code specification
244
- * requires `4`, however you can specify any number. Values will be turned to
245
- * integers with `Math.floor`.
246
- * @defaultValue 0
247
- */
248
- marginSize?: number;
249
- /**
250
- * The minimum version used when encoding the QR Code. Valid values are 1-40
251
- * with higher values resulting in more complex QR Codes. The optimal
252
- * (lowest) version is determined for the `value` provided, using `minVersion`
253
- * as the lower bound.
254
- * @defaultValue 1
255
- */
256
- minVersion?: number;
257
- /**
258
- * If enabled, the Error Correction Level of the result may be higher than
259
- * the specified Error Correction Level option if it can be done without
260
- * increasing the version.
261
- * @defaultValue true
262
- */
263
- boostLevel?: boolean;
264
- /**
265
- * The QR code background either a hex color or GradientSettings.
266
- * @defaultValue #FFFFFF
267
- */
268
- background?: BackgroundSettings;
269
- /**
270
- * The gradient settings applied to the qr code data modules and finder patterns.
271
- */
272
- gradient?: GradientSettings;
273
- /**
274
- * The settings for the data modules.
275
- */
276
- dataModulesSettings?: DataModulesSettings;
277
- /**
278
- * The settings for the finder pattern outer modules.
279
- */
280
- finderPatternOuterSettings?: FinderPatternOuterSettings;
281
- /**
282
- * The settings for the finder pattern outer modules.
283
- */
284
- finderPatternInnerSettings?: FinderPatternInnerSettings;
285
- /**
286
- * The settings for the embedded image.
287
- */
288
- imageSettings?: ImageSettings;
289
- /**
290
- * Optional props to pass to the SVG element.
291
- */
292
- svgProps?: React.SVGProps<SVGSVGElement>;
293
- }
294
-
295
- export declare interface ReactQRCodeRef {
296
- svg: SVGSVGElement | null;
297
- download: (options: DownloadOptions) => void;
298
- }
299
-
300
- export { }