quadqr-js 1.3.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FORMAT.md +8 -6
- package/README.md +68 -43
- package/SPECIFICATION.md +23 -8
- package/bin/quadqr.js +4 -2
- package/dist/esm/benchmark.js +37 -6
- package/dist/esm/brotli.js +2210 -0
- package/dist/esm/deflate.js +381 -0
- package/dist/esm/quadqr.js +1053 -121
- package/dist/esm/security.js +19 -0
- package/dist/esm/vision.js +244 -66
- package/dist/quadqr.js +4085 -370
- package/dist/quadqr.min.js +3799 -366
- package/docs/API.md +42 -11
- package/docs/BROWSER_CDN.md +9 -5
- package/docs/CLI.md +13 -2
- package/docs/COMPRESSION.md +170 -0
- package/docs/GETTING_STARTED.md +12 -2
- package/docs/HIGH_DENSITY_MODE.md +2 -2
- package/docs/NODE.md +22 -0
- package/docs/README.md +7 -5
- package/docs/RELIABILITY_LAB.md +64 -0
- package/docs/TRIANGLE16.md +7 -17
- package/docs/WASM.md +1 -1
- package/package.json +9 -10
- package/types/benchmark.d.ts +0 -8
- package/types/index.d.ts +0 -403
- package/types/node.d.ts +0 -11
package/package.json
CHANGED
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quadqr-js",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "QuadQR: experimental RGBW matrix code with optional experimental High Density Mode, Spectrum ECC,
|
|
3
|
+
"version": "1.4.2",
|
|
4
|
+
"description": "QuadQR: experimental RGBW matrix code with optional experimental High Density Mode, Spectrum ECC 2.0, multi-frame camera scanning, advanced calibration, Reliability Lab, and 3D perspective recovery.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"browser": "./dist/browser.js",
|
|
9
|
-
"types": "./types/index.d.ts",
|
|
10
9
|
"unpkg": "./dist/quadqr.min.js",
|
|
11
10
|
"jsdelivr": "./dist/quadqr.min.js",
|
|
12
11
|
"exports": {
|
|
13
12
|
".": {
|
|
14
|
-
"types": "./types/index.d.ts",
|
|
15
13
|
"import": "./dist/index.js",
|
|
16
14
|
"require": "./dist/index.cjs",
|
|
17
15
|
"default": "./dist/index.js"
|
|
18
16
|
},
|
|
19
17
|
"./browser": {
|
|
20
|
-
"types": "./types/index.d.ts",
|
|
21
18
|
"import": "./dist/browser.js",
|
|
22
19
|
"default": "./dist/browser.js"
|
|
23
20
|
},
|
|
24
21
|
"./node": {
|
|
25
|
-
"types": "./types/node.d.ts",
|
|
26
22
|
"import": "./dist/node.js",
|
|
27
23
|
"require": "./dist/node.cjs",
|
|
28
24
|
"default": "./dist/node.js"
|
|
29
25
|
},
|
|
30
26
|
"./benchmark": {
|
|
31
|
-
"types": "./types/benchmark.d.ts",
|
|
32
27
|
"import": "./dist/benchmark.js",
|
|
33
28
|
"require": "./dist/benchmark.cjs",
|
|
34
29
|
"default": "./dist/benchmark.js"
|
|
@@ -40,7 +35,6 @@
|
|
|
40
35
|
},
|
|
41
36
|
"files": [
|
|
42
37
|
"dist",
|
|
43
|
-
"types",
|
|
44
38
|
"bin",
|
|
45
39
|
"docs",
|
|
46
40
|
"FORMAT.md",
|
|
@@ -59,7 +53,8 @@
|
|
|
59
53
|
"test": "node tests/self-test.js && node tests/package-test.js",
|
|
60
54
|
"benchmark": "node scripts/benchmark.js",
|
|
61
55
|
"pack:check": "npm run build && npm pack --dry-run",
|
|
62
|
-
"prepublishOnly": "npm run build && npm test"
|
|
56
|
+
"prepublishOnly": "npm run build && npm test",
|
|
57
|
+
"test:demo": "node tests/demo-worker-test.js"
|
|
63
58
|
},
|
|
64
59
|
"engines": {
|
|
65
60
|
"node": ">=20.19"
|
|
@@ -94,9 +89,13 @@
|
|
|
94
89
|
"aes-gcm",
|
|
95
90
|
"wasm",
|
|
96
91
|
"compression",
|
|
92
|
+
"brotli",
|
|
97
93
|
"ed25519",
|
|
98
94
|
"scan-diagnostics",
|
|
99
|
-
"print-qr"
|
|
95
|
+
"print-qr",
|
|
96
|
+
"reliability-lab",
|
|
97
|
+
"perspective-correction",
|
|
98
|
+
"soft-decoding"
|
|
100
99
|
],
|
|
101
100
|
"sideEffects": false
|
|
102
101
|
}
|
package/types/benchmark.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { EccLevel } from "./index.js";
|
|
2
|
-
export const STANDARD_QR_BYTE_CAPACITY: Readonly<Record<EccLevel, readonly number[]>>;
|
|
3
|
-
export function getStandardQrByteCapacity(version: number, ecc?: EccLevel): number;
|
|
4
|
-
export function compareCapacity(version: number, ecc?: EccLevel, options?: { highDensity?: boolean }): Record<string, number | string | null>;
|
|
5
|
-
export function calculateCapacityPlan(options?: { payload?: string | Uint8Array; payloadBytes?: number; ecc?: EccLevel; highDensity?: boolean; compression?: "none" | "auto" | "lz"; signed?: boolean; keyId?: string; embedPublicKey?: boolean }): Record<string, unknown>;
|
|
6
|
-
export function buildCapacityComparison(options?: { ecc?: EccLevel; highDensity?: boolean; versions?: number[] }): Array<Record<string, number | string | null>>;
|
|
7
|
-
export function benchmarkCodec(options?: Record<string, unknown>): Record<string, unknown>;
|
|
8
|
-
export function benchmarkReport(options?: Record<string, unknown>): Record<string, unknown>;
|
package/types/index.d.ts
DELETED
|
@@ -1,403 +0,0 @@
|
|
|
1
|
-
export type EccLevel = "L" | "M" | "Q" | "H";
|
|
2
|
-
export type RenderStyle = "classic" | "depth" | "soft" | "inset";
|
|
3
|
-
export type RenderMode = "screen" | "print";
|
|
4
|
-
export type CompressionMode = "none" | "auto" | "lz";
|
|
5
|
-
export type SecurityMode = "password" | "raw-key";
|
|
6
|
-
|
|
7
|
-
export interface Palette {
|
|
8
|
-
black?: string;
|
|
9
|
-
white?: string;
|
|
10
|
-
red?: string;
|
|
11
|
-
green?: string;
|
|
12
|
-
blue?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface EncodeOptions {
|
|
16
|
-
version?: number | "auto";
|
|
17
|
-
minVersion?: number;
|
|
18
|
-
maxVersion?: number;
|
|
19
|
-
ecc?: EccLevel;
|
|
20
|
-
/** Enable the experimental High Density Mode. Default: false. Uses Triangle16 payload cells at 4 raw bits/body cell. */
|
|
21
|
-
highDensity?: boolean;
|
|
22
|
-
maskId?: number;
|
|
23
|
-
text?: boolean;
|
|
24
|
-
compression?: CompressionMode;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface SigningOptions {
|
|
28
|
-
/** Private Ed25519 key used to create the signature. Never embed or distribute it. */
|
|
29
|
-
privateKey: CryptoKey | Uint8Array | ArrayBuffer;
|
|
30
|
-
/** Optional compact identifier stored with the signature so a verifier can select a trusted public key. */
|
|
31
|
-
keyId?: string;
|
|
32
|
-
/** Optional public key used only when embedPublicKey is explicitly enabled. */
|
|
33
|
-
publicKey?: CryptoKey | Uint8Array | ArrayBuffer;
|
|
34
|
-
/** Embed the public key for self-contained integrity checks. Default: false. */
|
|
35
|
-
embedPublicKey?: boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface SignedEncodeOptions extends EncodeOptions, SigningOptions {}
|
|
39
|
-
|
|
40
|
-
export interface PasswordSecurity {
|
|
41
|
-
mode: "password";
|
|
42
|
-
password: string;
|
|
43
|
-
iterations?: number;
|
|
44
|
-
keyId?: string | Uint8Array | false;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface RawKeySecurity {
|
|
48
|
-
mode: "raw-key";
|
|
49
|
-
key: string | Uint8Array | ArrayBuffer;
|
|
50
|
-
keyId?: string | Uint8Array | false;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface SecureEncodeOptions extends EncodeOptions {
|
|
54
|
-
security: PasswordSecurity | RawKeySecurity;
|
|
55
|
-
signing?: SigningOptions;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface QuadQRCode {
|
|
59
|
-
matrix: number[][];
|
|
60
|
-
version: number;
|
|
61
|
-
size: number;
|
|
62
|
-
formatVersion: number;
|
|
63
|
-
eccLevel: EccLevel;
|
|
64
|
-
highDensity?: boolean;
|
|
65
|
-
bitsPerDataCell?: 2 | 4;
|
|
66
|
-
statesPerDataCell?: 4 | 16;
|
|
67
|
-
payloadBytes: number;
|
|
68
|
-
capacityBytes: number;
|
|
69
|
-
secure?: boolean;
|
|
70
|
-
compressed?: boolean;
|
|
71
|
-
compression?: "none" | "lz";
|
|
72
|
-
signed?: boolean;
|
|
73
|
-
security?: SecurityMetadata | null;
|
|
74
|
-
[key: string]: unknown;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface SecurityMetadata {
|
|
78
|
-
securePayloadVersion?: number;
|
|
79
|
-
mode?: SecurityMode;
|
|
80
|
-
algorithm?: string;
|
|
81
|
-
kdf?: string | null;
|
|
82
|
-
iterations?: number | null;
|
|
83
|
-
keyId?: string | null;
|
|
84
|
-
keyIdHex?: string | null;
|
|
85
|
-
keyIdAuto?: boolean;
|
|
86
|
-
authenticated?: boolean;
|
|
87
|
-
decrypted?: boolean;
|
|
88
|
-
[key: string]: unknown;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface ScanDiagnostics {
|
|
92
|
-
confidence: number;
|
|
93
|
-
cellConfidence: number;
|
|
94
|
-
structureConfidence: number;
|
|
95
|
-
geometryConfidence: number;
|
|
96
|
-
calibrationConfidence: number;
|
|
97
|
-
eccUtilization: number;
|
|
98
|
-
correctedErrors: number;
|
|
99
|
-
erasureSymbols: number;
|
|
100
|
-
stages?: Record<string, boolean>;
|
|
101
|
-
failedStage?: string | null;
|
|
102
|
-
geometryCandidates?: unknown[];
|
|
103
|
-
sampled?: Record<string, unknown> | null;
|
|
104
|
-
[key: string]: unknown;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export interface DecodeResult {
|
|
108
|
-
payload: Uint8Array;
|
|
109
|
-
text: string | null;
|
|
110
|
-
version: number;
|
|
111
|
-
size: number;
|
|
112
|
-
formatVersion: number;
|
|
113
|
-
eccLevel: EccLevel;
|
|
114
|
-
highDensity?: boolean;
|
|
115
|
-
bitsPerDataCell?: 2 | 4;
|
|
116
|
-
statesPerDataCell?: 4 | 16;
|
|
117
|
-
secure: boolean;
|
|
118
|
-
requiresDecryption?: boolean;
|
|
119
|
-
decrypted?: boolean;
|
|
120
|
-
security?: SecurityMetadata | null;
|
|
121
|
-
encryptedPayload?: Uint8Array;
|
|
122
|
-
protectedPayload?: Uint8Array;
|
|
123
|
-
compressed?: boolean;
|
|
124
|
-
compression?: "none" | "lz";
|
|
125
|
-
signed?: boolean;
|
|
126
|
-
/** Legacy v1 signer label, if decoding an older signed symbol. */
|
|
127
|
-
signer?: string | null;
|
|
128
|
-
signingKeyId?: string | null;
|
|
129
|
-
hasEmbeddedPublicKey?: boolean;
|
|
130
|
-
signatureVerified?: boolean | null;
|
|
131
|
-
signatureTrusted?: boolean | null;
|
|
132
|
-
signatureTrustSource?: "external" | "embedded" | null;
|
|
133
|
-
confidence?: number;
|
|
134
|
-
geometryConfidence?: number;
|
|
135
|
-
calibrationConfidence?: number;
|
|
136
|
-
structureConfidence?: number;
|
|
137
|
-
correctedErrors?: number;
|
|
138
|
-
eccUtilization?: number;
|
|
139
|
-
diagnostics?: ScanDiagnostics;
|
|
140
|
-
[key: string]: unknown;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export interface ImageDataLike {
|
|
144
|
-
width: number;
|
|
145
|
-
height: number;
|
|
146
|
-
data: Uint8ClampedArray | Uint8Array;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export interface LogoRenderOptions {
|
|
150
|
-
/** Loaded CanvasImageSource in canvas rendering, ImageDataLike in pixel rendering, or URL/data URL in SVG rendering. */
|
|
151
|
-
source: CanvasImageSource | ImageDataLike | string;
|
|
152
|
-
/** Logo width/height as a fraction of the symbol area. Clamped to 0.05..0.30. Default: 0.18. */
|
|
153
|
-
size?: number | "auto";
|
|
154
|
-
/** Clear the modules behind the logo with a solid background before drawing it. */
|
|
155
|
-
clearBackground?: boolean;
|
|
156
|
-
/** Background padding around the logo in modules. Default: 0.65. */
|
|
157
|
-
padding?: number;
|
|
158
|
-
/** Rounded background corner radius in modules. Default: 0.8. */
|
|
159
|
-
radius?: number;
|
|
160
|
-
/** Background color used when clearBackground is enabled. Default: palette white. */
|
|
161
|
-
backgroundColor?: string;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export interface CameraFinderDiagnostic {
|
|
165
|
-
x: number;
|
|
166
|
-
y: number;
|
|
167
|
-
moduleSize: number;
|
|
168
|
-
confirmations?: number;
|
|
169
|
-
score?: number;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export interface CameraGeometryDiagnostic {
|
|
173
|
-
version: number;
|
|
174
|
-
size: number;
|
|
175
|
-
score: number;
|
|
176
|
-
estimatedSize?: number;
|
|
177
|
-
alignmentScore?: number;
|
|
178
|
-
alignmentGridScore?: number;
|
|
179
|
-
finders?: {
|
|
180
|
-
topLeft: CameraFinderDiagnostic;
|
|
181
|
-
topRight: CameraFinderDiagnostic;
|
|
182
|
-
bottomLeft: CameraFinderDiagnostic;
|
|
183
|
-
};
|
|
184
|
-
[key: string]: unknown;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export interface CameraDiagnosticEvent {
|
|
188
|
-
type: "camera-ready" | "frame" | "method" | "success" | string;
|
|
189
|
-
timestamp: number;
|
|
190
|
-
frame: number;
|
|
191
|
-
state?: "trying" | "miss" | "failed" | "decoded" | string;
|
|
192
|
-
method?: string;
|
|
193
|
-
message?: string;
|
|
194
|
-
elapsedMs?: number;
|
|
195
|
-
missStreak?: number;
|
|
196
|
-
scanWidth?: number;
|
|
197
|
-
scanHeight?: number;
|
|
198
|
-
frameWidth?: number;
|
|
199
|
-
frameHeight?: number;
|
|
200
|
-
scanRect?: { x: number; y: number; width: number; height: number };
|
|
201
|
-
finderCount?: number;
|
|
202
|
-
finders?: CameraFinderDiagnostic[];
|
|
203
|
-
finderMethod?: string | null;
|
|
204
|
-
finderPasses?: Array<{ method: string; finderCount: number; threshold?: number; geometryCount?: number }>;
|
|
205
|
-
geometry?: CameraGeometryDiagnostic | null;
|
|
206
|
-
[key: string]: unknown;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export interface RenderOptions {
|
|
210
|
-
/** Exact square output size in pixels. If neither imageSize nor moduleSize is supplied, defaults to 720. */
|
|
211
|
-
imageSize?: number;
|
|
212
|
-
/** Legacy/low-level pixels per module sizing. Used when imageSize is not supplied. */
|
|
213
|
-
moduleSize?: number;
|
|
214
|
-
quietZone?: number;
|
|
215
|
-
palette?: Palette;
|
|
216
|
-
style?: RenderStyle;
|
|
217
|
-
/** Screen defaults or print-safe palette/quiet-zone/classic-style behavior. */
|
|
218
|
-
mode?: RenderMode;
|
|
219
|
-
renderMode?: RenderMode;
|
|
220
|
-
allowStyledPrint?: boolean;
|
|
221
|
-
allowUnsafePrintQuietZone?: boolean;
|
|
222
|
-
logo?: CanvasImageSource | ImageDataLike | string | LogoRenderOptions;
|
|
223
|
-
logoSize?: number;
|
|
224
|
-
logoClearBackground?: boolean;
|
|
225
|
-
logoPadding?: number;
|
|
226
|
-
logoRadius?: number;
|
|
227
|
-
logoBackgroundColor?: string;
|
|
228
|
-
[key: string]: unknown;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export interface ScanOptions {
|
|
232
|
-
debug?: boolean;
|
|
233
|
-
debugMatrices?: boolean;
|
|
234
|
-
minVersion?: number;
|
|
235
|
-
maxVersion?: number;
|
|
236
|
-
perspective?: boolean;
|
|
237
|
-
axisAlignedFallback?: boolean;
|
|
238
|
-
maxDimension?: number;
|
|
239
|
-
sampleRadius?: number;
|
|
240
|
-
robustSampleRadius?: number;
|
|
241
|
-
/** Disable automatic High Density Mode dual-region sampling. Default: enabled. */
|
|
242
|
-
highDensitySampling?: boolean;
|
|
243
|
-
/** Position of the two High Density Mode samples inside each module. Default: 0.28. */
|
|
244
|
-
highDensitySampleInset?: number;
|
|
245
|
-
/** Radius used around each High Density Mode sample point. */
|
|
246
|
-
highDensitySampleRadius?: number;
|
|
247
|
-
/** Retry failed perspective scans with finer alignment localization. Default: true. */
|
|
248
|
-
preciseAlignmentRecovery?: boolean;
|
|
249
|
-
adaptiveSampling?: boolean;
|
|
250
|
-
spatialColorNormalization?: boolean;
|
|
251
|
-
structureTolerance?: number;
|
|
252
|
-
maxErasureConfidence?: number;
|
|
253
|
-
geometryRefinement?: boolean;
|
|
254
|
-
finderRecovery?: boolean;
|
|
255
|
-
/** Refine a valid projective solution with reliable secondary alignment markers on dense versions. */
|
|
256
|
-
alignmentRefinement?: boolean;
|
|
257
|
-
alignmentRefinePatternThreshold?: number;
|
|
258
|
-
alignmentRefineMaxPoints?: number;
|
|
259
|
-
alignmentRefineMaxDisplacement?: number;
|
|
260
|
-
alignmentRefineCandidateMargin?: number;
|
|
261
|
-
alignmentRefineSkipScore?: number;
|
|
262
|
-
finderAutoColorBlackClip?: number;
|
|
263
|
-
finderAutoColorWhiteClip?: number;
|
|
264
|
-
finderAutoColorHighlightPercentile?: number;
|
|
265
|
-
finderAutoColorOutputHighlight?: number;
|
|
266
|
-
finderAutoColorAnalysisInset?: number;
|
|
267
|
-
finderAutoColorAnalysisInsets?: number[];
|
|
268
|
-
finderAutoColorMinimumInputRange?: number;
|
|
269
|
-
finderAutoColorTargetSamples?: number;
|
|
270
|
-
autoEnhanceRecovery?: boolean;
|
|
271
|
-
autoEnhanceWhenNoGeometry?: boolean;
|
|
272
|
-
autoEnhanceBlackClip?: number;
|
|
273
|
-
autoEnhanceWhiteClip?: number;
|
|
274
|
-
autoEnhanceSaturation?: number;
|
|
275
|
-
autoEnhanceTargetSamples?: number;
|
|
276
|
-
fullFrameAutoEnhanceRecovery?: boolean;
|
|
277
|
-
rectifiedAutoEnhanceRecovery?: boolean;
|
|
278
|
-
rectifiedRecoveryModuleSize?: number;
|
|
279
|
-
rectifiedRecoveryRadiusRatio?: number;
|
|
280
|
-
rectifiedAutoEnhanceBlackClip?: number;
|
|
281
|
-
rectifiedAutoEnhanceWhiteClip?: number;
|
|
282
|
-
rectifiedAutoEnhanceSaturation?: number;
|
|
283
|
-
rectifiedAutoEnhanceHighlightFraction?: number;
|
|
284
|
-
videoCropMode?: "visible" | "full";
|
|
285
|
-
videoObjectFit?: string;
|
|
286
|
-
videoObjectPosition?: string;
|
|
287
|
-
videoCropInset?: number;
|
|
288
|
-
refinementOffset?: number;
|
|
289
|
-
refinementStructureThreshold?: number;
|
|
290
|
-
refinementDecodeThreshold?: number;
|
|
291
|
-
refinementDecodeCandidates?: number;
|
|
292
|
-
[key: string]: unknown;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
export interface CameraFrameMeta {
|
|
296
|
-
frame: number;
|
|
297
|
-
imageData: ImageDataLike;
|
|
298
|
-
scanWidth: number;
|
|
299
|
-
scanHeight: number;
|
|
300
|
-
sourceRect?: { x: number; y: number; width: number; height: number; cropped?: boolean } | null;
|
|
301
|
-
enhancedImageData?: ImageDataLike | null;
|
|
302
|
-
enhancedRect?: { x: number; y: number; width: number; height: number } | null;
|
|
303
|
-
enhancement?: { method?: string; cropInset?: number; analysisInset?: number; [key: string]: unknown } | null;
|
|
304
|
-
diagnostic?: Record<string, unknown> | null;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
export interface CameraScanOptions extends ScanOptions {
|
|
308
|
-
scanInterval?: number;
|
|
309
|
-
stopOnResult?: boolean;
|
|
310
|
-
multiFrame?: boolean;
|
|
311
|
-
multiFrameWindow?: number;
|
|
312
|
-
multiFrameMinFrames?: number;
|
|
313
|
-
cameraAutoColorRecovery?: boolean;
|
|
314
|
-
cameraAutoColorEvery?: number;
|
|
315
|
-
cameraAutoColorBlackClip?: number;
|
|
316
|
-
cameraAutoColorWhiteClip?: number;
|
|
317
|
-
cameraAutoColorHighlightPercentile?: number;
|
|
318
|
-
cameraAutoColorOutputHighlight?: number;
|
|
319
|
-
cameraAutoColorAnalysisInset?: number;
|
|
320
|
-
cameraAutoColorAnalysisInsets?: number[];
|
|
321
|
-
cameraAutoColorCropInsets?: number[];
|
|
322
|
-
cameraAutoColorMinimumInputRange?: number;
|
|
323
|
-
cameraAutoColorTargetSamples?: number;
|
|
324
|
-
cameraAutoEnhanceEvery?: number;
|
|
325
|
-
cameraFinderRecoveryEvery?: number;
|
|
326
|
-
/** Retry a dense/partial geometry frame at higher resolution after at least two finders are detected. */
|
|
327
|
-
cameraHighResolutionRecovery?: boolean;
|
|
328
|
-
cameraHighResolutionMaxDimension?: number;
|
|
329
|
-
cameraHighResolutionEvery?: number;
|
|
330
|
-
cameraHighResolutionMinFinders?: number;
|
|
331
|
-
constraints?: MediaStreamConstraints;
|
|
332
|
-
onResult?: (result: DecodeResult, frame?: CameraFrameMeta | null) => void | Promise<void>;
|
|
333
|
-
onDecode?: (result: DecodeResult, frame?: CameraFrameMeta | null) => void | Promise<void>;
|
|
334
|
-
onScanMiss?: (error: Error) => void;
|
|
335
|
-
onDiagnostic?: (event: CameraDiagnosticEvent) => void;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export const FORMAT_VERSION: number;
|
|
339
|
-
export const MIN_VERSION: number;
|
|
340
|
-
export const MAX_VERSION: number;
|
|
341
|
-
export const DEFAULT_ECC_LEVEL: EccLevel;
|
|
342
|
-
export const RENDER_MODES: Readonly<{ SCREEN: "screen"; PRINT: "print" }>;
|
|
343
|
-
export const PRINT_PALETTE: Readonly<Required<Palette>>;
|
|
344
|
-
export const COMPRESSION_MODES: Readonly<Record<string, CompressionMode>>;
|
|
345
|
-
export const SIGNATURE_ALGORITHMS: Readonly<{ ED25519: "Ed25519" }>;
|
|
346
|
-
export const CELL: Readonly<{ BLACK: -1; RED: 0; GREEN: 1; BLUE: 2; WHITE: 3 }>;
|
|
347
|
-
export const DEFAULT_PALETTE: Readonly<Required<Palette>>;
|
|
348
|
-
export const RENDER_STYLES: Readonly<Record<string, RenderStyle>>;
|
|
349
|
-
export const ECC_LEVELS: Readonly<Record<EccLevel, { id: number; paritySymbols: number; correctableSymbolsPerBlock: number }>>;
|
|
350
|
-
export const SECURITY_MODES: Readonly<{ PASSWORD: "password"; RAW_KEY: "raw-key" }>;
|
|
351
|
-
export const SECURITY_ALGORITHMS: Readonly<{ AES_256_GCM: "AES-256-GCM" }>;
|
|
352
|
-
export const SECURE_PAYLOAD_VERSION: number;
|
|
353
|
-
export const DEFAULT_PBKDF2_ITERATIONS: number;
|
|
354
|
-
|
|
355
|
-
export function encodeText(text: string, options?: EncodeOptions): QuadQRCode;
|
|
356
|
-
export function encodeBytes(input: Uint8Array | ArrayBuffer | ArrayLike<number>, options?: EncodeOptions): QuadQRCode;
|
|
357
|
-
export function encodeUint8Array(input: Uint8Array | ArrayBuffer | ArrayLike<number>, options?: EncodeOptions): QuadQRCode;
|
|
358
|
-
export function encodeSignedText(text: string, options: SignedEncodeOptions): Promise<QuadQRCode>;
|
|
359
|
-
export function encodeSignedBytes(input: Uint8Array | ArrayBuffer | ArrayLike<number>, options: SignedEncodeOptions): Promise<QuadQRCode>;
|
|
360
|
-
export function encodeSecureText(text: string, options: SecureEncodeOptions): Promise<QuadQRCode>;
|
|
361
|
-
export function encodeSecureBytes(input: Uint8Array | ArrayBuffer | ArrayLike<number>, options: SecureEncodeOptions): Promise<QuadQRCode>;
|
|
362
|
-
export function compressPayload(input: Uint8Array | ArrayBuffer | ArrayLike<number>): Uint8Array;
|
|
363
|
-
export function decompressPayload(input: Uint8Array | ArrayBuffer | ArrayLike<number>, expectedLength?: number | null): Uint8Array;
|
|
364
|
-
export function deriveSigningKeyId(publicKey: CryptoKey | Uint8Array | ArrayBuffer, bytes?: number): Promise<string>;
|
|
365
|
-
export function generateSigningKeyPair(): Promise<{ privateKey: CryptoKey; publicKey: CryptoKey; privateKeyPkcs8: Uint8Array; publicKeyBytes: Uint8Array; keyId: string; algorithm: "Ed25519" }>;
|
|
366
|
-
export function decodeMatrix(matrix: number[][], options?: Record<string, unknown>): DecodeResult;
|
|
367
|
-
export function decodeUint8Array(matrix: number[][], options?: Record<string, unknown>): Uint8Array;
|
|
368
|
-
export function decryptDecoded(result: DecodeResult, credentials: { password: string } | { key: string | Uint8Array | ArrayBuffer }): Promise<DecodeResult>;
|
|
369
|
-
export function verifyDecodedSignature(result: DecodeResult, options?: {
|
|
370
|
-
publicKey?: CryptoKey | Uint8Array | ArrayBuffer;
|
|
371
|
-
trustedPublicKey?: CryptoKey | Uint8Array | ArrayBuffer;
|
|
372
|
-
trustedKeys?: Record<string, CryptoKey | Uint8Array | ArrayBuffer> | Map<string, CryptoKey | Uint8Array | ArrayBuffer>;
|
|
373
|
-
allowEmbeddedKey?: boolean;
|
|
374
|
-
}): Promise<DecodeResult>;
|
|
375
|
-
export function renderToCanvas(codeOrMatrix: QuadQRCode | number[][], canvas: HTMLCanvasElement, options?: RenderOptions): HTMLCanvasElement;
|
|
376
|
-
export function renderToImageData(codeOrMatrix: QuadQRCode | number[][], options?: RenderOptions): ImageDataLike;
|
|
377
|
-
export function renderToSVG(codeOrMatrix: QuadQRCode | number[][], options?: RenderOptions): string;
|
|
378
|
-
export function estimateSafeLogoSize(codeOrMatrix: QuadQRCode | number[][], options?: RenderOptions & { ecc?: EccLevel; utilization?: number }): number;
|
|
379
|
-
export function findMaxSafeLogoSize(code: QuadQRCode, options: RenderOptions & { minSize?: number; maxSize?: number; iterations?: number }): { safeSize: number; testedMax: number; iterations: number; empirical: boolean };
|
|
380
|
-
export function getPrintGuidance(codeOrMatrix: QuadQRCode | number[][], options?: { quietZone?: number; physicalSizeMm?: number; dpi?: number; minimumModuleMm?: number }): Record<string, unknown>;
|
|
381
|
-
export function scanImageData(imageData: ImageDataLike, options?: ScanOptions): DecodeResult;
|
|
382
|
-
export function debugScanImageData(imageData: ImageDataLike, options?: ScanOptions): { ok: boolean; result?: DecodeResult; error?: string; debug?: ScanDiagnostics | null };
|
|
383
|
-
export function scanFile(file: Blob, options?: ScanOptions): Promise<DecodeResult>;
|
|
384
|
-
export function scanVideoFrame(video: HTMLVideoElement, options?: ScanOptions): DecodeResult;
|
|
385
|
-
export function startCameraScanner(video: HTMLVideoElement, options?: CameraScanOptions): Promise<{ stop(): void; scanNow(): DecodeResult; stream: MediaStream; video: HTMLVideoElement }>;
|
|
386
|
-
export function applyStressDistortion(imageData: ImageDataLike, type: string, severity?: number, options?: Record<string, unknown>): ImageDataLike;
|
|
387
|
-
export const STRESS_PROFILES: readonly Readonly<{ id: string; label: string; type: string; severity: number; weight: number }>[];
|
|
388
|
-
export function runImageStressTest(imageData: ImageDataLike, expected?: { version?: number; crc32?: number }, options?: Record<string, unknown>): Record<string, unknown>;
|
|
389
|
-
export function assessScanability(code: QuadQRCode, renderOptions?: RenderOptions, options?: Record<string, unknown>): Record<string, unknown>;
|
|
390
|
-
export function rectifyDetectedCode(imageData: ImageDataLike, options?: Record<string, unknown>): ImageDataLike;
|
|
391
|
-
export function rotateMatrix(matrix: number[][], quarterTurns?: number): number[][];
|
|
392
|
-
export function getVersionInfo(version: number, options?: { ecc?: EccLevel; highDensity?: boolean }): Record<string, unknown>;
|
|
393
|
-
export function crc32(bytes: Uint8Array): number;
|
|
394
|
-
export function installCrc32Accelerator(accelerator?: ((bytes: Uint8Array) => number) | null): void;
|
|
395
|
-
export function generateRaw256Key(): Uint8Array;
|
|
396
|
-
export function normalizeRaw256Key(key: string | Uint8Array | ArrayBuffer): Uint8Array;
|
|
397
|
-
export function bytesToHex(bytes: Uint8Array): string;
|
|
398
|
-
|
|
399
|
-
export function initWasm(options?: { url?: string | URL; bytes?: Uint8Array | ArrayBuffer }): Promise<{ enabled: true; module: string; accelerators: readonly string[]; bytes: number }>;
|
|
400
|
-
export function getWasmState(): { enabled: true; module: string; accelerators: readonly string[]; bytes: number } | null;
|
|
401
|
-
export function disableWasm(): void;
|
|
402
|
-
|
|
403
|
-
export const internals: Readonly<Record<string, unknown>>;
|
package/types/node.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from "./index.js";
|
|
2
|
-
import type { DecodeResult, ImageDataLike, QuadQRCode, RenderOptions, ScanOptions } from "./index.js";
|
|
3
|
-
|
|
4
|
-
export function decodePNG(input: Uint8Array | ArrayBuffer): ImageDataLike;
|
|
5
|
-
export function encodePNG(imageData: ImageDataLike, options?: { compressionLevel?: number }): Buffer;
|
|
6
|
-
export function toPNG(codeOrMatrix: QuadQRCode | number[][], options?: RenderOptions & { compressionLevel?: number }): Buffer;
|
|
7
|
-
export function savePNG(codeOrMatrix: QuadQRCode | number[][], filename: string | URL, options?: RenderOptions & { compressionLevel?: number }): Promise<{ filename: string | URL; bytes: number }>;
|
|
8
|
-
export function toSVG(codeOrMatrix: QuadQRCode | number[][], options?: RenderOptions): string;
|
|
9
|
-
export function saveSVG(codeOrMatrix: QuadQRCode | number[][], filename: string | URL, options?: RenderOptions): Promise<{ filename: string | URL; bytes: number }>;
|
|
10
|
-
export function scanBuffer(input: Uint8Array | ArrayBuffer, options?: ScanOptions): Promise<DecodeResult>;
|
|
11
|
-
export function scanFile(filename: string | URL, options?: ScanOptions): Promise<DecodeResult>;
|